/* ==========================================================================
   WaiterVoice — гостевой web-клиент.
   Реализация web/docs/SPEC-PUBLIC.md §3 (раскладка), §4 (токены),
   §5 (кнопка), §6-§7 (индикаторы), §8-§9 (карусель и чат), §11 (экраны).

   Правило §4.7: литеральных цветов вне :root нет — любой цвет берётся
   токеном. Это то, что позволит однажды добавить тёмную тему одним
   медиа-запросом, не переписывая CSS.
   ========================================================================== */

/* ---------- Сброс и документ (§3, §3.2) ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
  height: 100dvh;
  overflow: hidden;             /* §3.2 — документ не скроллится никогда */
  overscroll-behavior: none;    /* и не тянется pull-to-refresh'ем       */
}

body {
  font-family: var(--wv-font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--wv-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background: var(--wv-app-bg);
}

/* §9.2 (docs/feature-hold-to-talk.md) — гостю не нужно выделять текст
   и вызывать контекстное меню на странице: он держит палец на кнопке
   микрофона, и страница не должна скроллиться, выделяться или
   показывать меню. Выделение возвращается там, где гостю оно нужно. */
html,
body {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

input,
textarea,
[contenteditable],
.selectable {
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

img, svg { display: block; max-width: 100%; }
/* display: block перебивает UA-правило [hidden] — без этого спрятанное фото
   ресторана (нет photo_url) оставалось пустым серым прямоугольником. */
img[hidden] { display: none; }
button { font: inherit; cursor: pointer; }
p, h1, h2, h3, ul, ol, li { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--wv-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Каркас экрана (§3) ---------- */

.app {
  position: relative;      /* контейнер для .toast (§6/§7) */
  display: flex;
  flex-direction: column;
  height: var(--wv-app-h, 100dvh);
  /* waitervoice-vwl3: сколько layout viewport закрыла экранная
     клавиатура. Пока открыта шторка поиска, search-overlay.js публикует
     значение на этом же элементе; 0px — когда клавиатуры нет.
     waitervoice-lasg: --wv-app-h — высота, которую .app имела в момент
     открытия шторки поиска; шторка публикует её и возвращает, когда
     viewport снова вырос. */
  --wv-kb-inset: 0px;
  /* waitervoice-lasg: страница не переверстывается, пока открыта
     клавиатура; 100dvh — когда шторка закрыта. */
  --wv-app-h: 100dvh;
  padding-top: env(safe-area-inset-top);
  /* safe-area обязателен (иначе на iPhone кнопку перекрывает
     home-indicator); база убавлена вдвое (16 → 8) — прежний отступ
     съедал место у карусели просто так. */
  padding-bottom: calc(var(--wv-app-pad-bottom) + env(safe-area-inset-bottom));
}

/* Шапка §3.1 */
/* Боковой отступ колонок (waitervoice-bcf.16): общий для иконок шапки
   (домой/поиск) и боковых колонок нижнего бара (динамик/корзина) — одни и
   те же вертикали сверху и снизу. */
.app { --side-x: calc(var(--wv-gutter) + 14px); }
.header {
  /* waitervoice-1iea: чип языка занял самый крайний слот шапки, справа от
     лупы. Ширина фиксированная — вычитается из отступа лупы, чтобы
     плашка и иконка никогда не наезжали друг на друга, и не залезали на
     центральный логотип.
     waitervoice-y8wv.2: шапка справа налево — язык, динамик, лупа,
     шаг 44px (ширина кнопки). */
  --lang-w: 44px;
  position: relative;
  flex: 0 0 var(--wv-header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.header__mark {
  width: 28px; height: 28px;
  object-fit: contain;
}
/* Логотип — кнопка «домой» (bcf.16): значок без слова, рамки нет. */
.header__logo {
  display: flex; align-items: center;
  padding: 0; border: 0; background: none;
  font: inherit; color: inherit; cursor: pointer;
  border-radius: var(--wv-r-tag);
}
.header__logo:active { opacity: 0.6; }
.header__logo:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: 2px; }
.header__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  /* waitervoice-y451: Safari before iOS 26 pads a <button> widely, and
     the global svg max-width rule then squeezed the 26px icon to half. */
  padding: 0;
  border: 0; background: none;
  color: var(--wv-accent);
  cursor: pointer;
}
.header__nav:active { opacity: 0.6; }
/* Поиск пока неактивен (bcf.16) — будет реализован позже. */
.header__nav:disabled { opacity: 0.35; cursor: default; }
.header__nav:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: 2px; border-radius: 50%; }
/* `hidden` из разметки/JS не прячет кнопку: `.header__nav` задаёт
   `display: grid`, а он перебивает правило браузера `[hidden]`. */
.header__nav[hidden] { display: none; }
/* waitervoice-79my: QR сдвинут к центру на половину своей ширины
   (44px / 2), иначе он слева накрывает крестик закрытия карточки.
   waitervoice-y8wv.2: справа от края шапки три слота по 44px — язык,
   динамик, лупа; лупа стоит третьим, поэтому отступ удваивает
   ширину языка. */
.header__nav--search { inset-inline-end: calc(var(--side-x) + var(--lang-w) * 2); }
/* Домик: его центр (61px от края) над центром мини-фото в карточке категории
   (16 отступ карусели + 1 рамка + 16 отступ строки + 28 половина фото);
   QR правее домика на ширину кнопки: центры иконок — в 44px друг от друга. */
.header__nav--menu { inset-inline-start: calc(var(--side-x) + 9px); }
.header__nav--qr { inset-inline-start: calc(var(--side-x) + 53px); }

/* Код языка §7 — в шапке, у самого края (waitervoice-1iea).
   waitervoice-y8wv.2: без плашки и без замка — только код, синим. */
.lang {
  position: absolute;
  inset-inline-end: var(--side-x);
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--lang-w);
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--wv-r-tag);
  background: none;
  color: var(--wv-accent);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  transition: color var(--wv-t-base);
}
.lang.is-detected { background: none; color: var(--wv-accent); }
.lang.is-locked { background: none; color: var(--wv-accent); }
/* waitervoice-ou7z: закрытый стол прячет чип языка. Авторский `display`
   перебил бы правило браузера `[hidden]` — пишем явно. */
.lang[hidden] { display: none; }

/* device height, not viewport: the on-screen keyboard shrinks the
   viewport in some webviews and must not switch the header to its compact
   size (waitervoice-lasg) */
@media (max-device-height: 600px) {
  :root { --wv-header-h: 36px; }
  .header__mark { width: 24px; height: 24px; }
}

/* ---------- Карусель (§8.2) ---------- */

.carousel {
  flex: 1;
  min-height: 0;                 /* §3.2 — без этого раскладка «поедет» */
  display: flex;
  gap: var(--wv-card-gap);
  padding-inline: var(--wv-gutter);
  /* Запас 16px сверху под крестик временной карточки (он торчит за
     угол карточки); margin его компенсирует — карточки не сдвинулись.
     Тот же приём снизу: тень карточки (0 12px 32px -14px) не должна
     обрезаться по краю карточки — иначе фон вокруг неё темнее фона над
     футером. Высота карточек не меняется (padding и отрицательный margin
     равны). */
  padding-top: 16px;
  margin-top: -16px;
  padding-bottom: 32px;
  margin-bottom: -32px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

/* waitervoice-hme6: карточка держит overscroll (`contain`, cards.css), и
   в Safari на Mac горизонтальный жест по прокручиваемой карточке не доходит
   до карусели. По оси X карточка цепляет жест дальше, а карусель сама его
   замыкает — у крайних карточек жест по-прежнему не уходит в историю
   браузера. По оси Y изоляция карточки не меняется. cards.css общий с PWA
   официанта, поэтому правка только здесь. */
.carousel { overscroll-behavior-x: contain; }
.carousel .card,
.carousel .card__scroll { overscroll-behavior-x: auto; }

/* waitervoice-70e: the voice model just asked the guest to tap
   "Confirm order". Pulse the CTA so the tap target is discoverable
   for ~1.8s (auto-removed by ui.js::attentionConfirm after
   CONFIRM_ATTENTION_MS). 3× the 600ms keyframe duration. */
.cta--attention { animation: wv-cta-pulse 600ms ease-in-out 3; }
@keyframes wv-cta-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
  50%      { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(29, 91, 216, .35); } /* --wv-accent #1d5bd8 */
}
@media (prefers-reduced-motion: reduce) {
  .cta--attention { animation: none; outline: 3px solid var(--wv-accent); }
}

/* Точки-индикаторы §8.3 */
.dots {
  flex: 0 0 20px;                /* было 28px: зазор кнопка↔точки ÷2 (bcf.5) */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  /* waitervoice-i3uq: точки не бегут от края до края — их ряд ограничен
     пролётом между центрами шевронов карточки: ширина карточки (100% минус
     два отступа) минус 88px (по 44px от каждого края карточки). */
  width: calc(100% - 2 * var(--wv-gutter) - 88px);
  margin-inline: auto;
}
.dots[hidden] { display: flex; visibility: hidden; }
.dots button {
  border: 0;
  background: none;
  padding: 11px 0;               /* зона касания 44px по высоте */
  line-height: 0;
  /* Кнопки сжимаются: на экране 320px в ряд влезает 20 точек (6px каждая
     при зазоре 4px), а ширина кнопки не должна превышать 14px. */
  flex: 1 1 0;
  min-width: 0;
  max-width: 14px;
  display: flex;
  justify-content: center;
}
.dots i {
  display: block;
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--wv-border-strong);
  transition: background var(--wv-t-fast), width var(--wv-t-fast);
  flex: 0 0 auto;                /* точка не сжимается вместе с кнопкой */
}
.dots i.is-chat { width: 16px; }
.dots button[aria-current="true"] i { background: var(--wv-accent); }
/* waitervoice-ekbj.3: к столу подключился новый гость, а гость ещё не
   открыл карточку ассистента — bullet мигает жёлтым. Тот же токен, что и
   остальная «внимательность» (--wv-amber), своего жёлтый не заводим.
   Селектор с `button` — специфичность (0,2,2), как у правила активной
   точки выше: при равной специфичности решает порядок правил, поэтому
   непрочитанный bullet стоит ПОСЛЕ него (на активной карточке жёлтый
   тоже нужен). */
.dots button i.is-unread {
  background: var(--wv-amber);
  animation: wv-dot-blink 1.2s ease-in-out infinite;
}
@keyframes wv-dot-blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .dots button i.is-unread { background: var(--wv-amber); animation: none; }
}

/* ---------- Чат (§9) ---------- */

.chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* waitervoice-y4hr: bottom = gap (8) + guest margin (10), like between
     messages. */
  padding: 16px 16px 18px;
  min-height: 100%;
  /* The card is a column flex scroller: without flex: none .chat shrinks
     to the card height, its content overflows and the padding is lost. */
  flex: none;
}
/* Переписка прижата к низу, как в мессенджере. Именно так, а не через
   justify-content: flex-end — тот в скролл-контейнере делает верх
   переписки недостижимым, когда содержимое переросло высоту. */
.chat > :first-child { margin-top: auto; }

/* flex: none обязателен: без него 40 пузырей сжимаются в высоту карточки
   вместо того, чтобы её перерасти, и чат просто не скроллится (§3.2). */
.bubble, .note { flex: none; }

.bubble {
  max-width: 82%;
  padding: 10px 14px;
  font-size: 17px;
  font-weight: 450;
  line-height: 1.45;
  animation: wv-card-in var(--wv-t-card) both;
}
.bubble--guest {
  align-self: flex-end;
  background: var(--wv-accent-50);
  border: 0;
  border-radius: var(--wv-r-bubble) var(--wv-r-bubble) 4px var(--wv-r-bubble);
  margin-top: 10px;
}
.bubble--bot {
  align-self: flex-start;
  background: var(--wv-white);
  border: 1px solid rgba(7, 43, 100, 0.08);
  box-shadow: var(--wv-shadow-sm);
  border-radius: var(--wv-r-bubble) var(--wv-r-bubble) var(--wv-r-bubble) 4px;
}
.bubble--partial { opacity: 0.65; }

/* Каретка стриминга ответа §9.2 — единственный blink в интерфейсе */
.caret {
  display: inline-block;
  width: 2px; height: 18px;
  vertical-align: -3px;
  margin-inline-start: 2px;
  background: var(--wv-accent);
  animation: wv-blink 1s step-end infinite;
}
@keyframes wv-blink { 50% { opacity: 0; } }

.note {
  align-self: flex-start;
  max-width: 82%;
  text-align: start;
  font-size: 13px;
  font-weight: 700;
  color: var(--wv-text-muted);
  padding: 4px 0;
  animation: wv-card-in var(--wv-t-card) both;
}
/* Иконка рядом со строкой-указанием (waitervoice-tma3) — эмодзи
   «внимание». Цвет свой, поэтому правило цвета здесь не нужно. */
.note__icon {
  display: inline-block;
  font-size: inherit;
  vertical-align: baseline;
  margin-inline-end: 4px;
}
/* waitervoice-ekbj.3: строка «к столу присоединился гость» — жёлтый
   треугольник. */
.note[data-note-kind="guest-joined"] .note__icon { color: var(--wv-amber-ink); }
/* Строка-ошибка (waitervoice-mfdb) — красный текст рядом с красным
   знаком. */
.note--error {
  color: var(--wv-coral);
}

/* Плашка вызова инструмента (waitervoice-ytcr.3) — мини-карточка в
   диалоге: тумбнейл · название · строка типа · шеврон. Встаёт по
   левому краю, как пузырь бота, и по той же ширине. */
.plate {
  align-self: flex-start;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 82%;
  margin-top: 10px;
  padding-block: 8px;
  padding-inline: 8px 12px;
  font: inherit;
  text-align: start;
  color: inherit;
  background: var(--wv-white);
  border: 1px solid rgba(7, 43, 100, 0.08);
  box-shadow: var(--wv-shadow-sm);
  border-radius: var(--wv-r-bubble);
  animation: wv-card-in var(--wv-t-card) both;
}
.plate:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: 2px; }
.plate__thumb {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--wv-r-tag);
  background: var(--wv-accent-50);
  color: var(--wv-accent);
}
.plate__thumb img { width: 100%; height: 100%; object-fit: cover; }
/* Фото в плашке — того же размера, что и фото блюда в карточке раздела. */
.plate__thumb--photo { width: 80px; height: 80px; border-radius: 14px; background: var(--wv-skeleton); }
.plate__body { min-width: 0; }
.plate__title,
.plate__kind {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plate__title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.plate__kind { font-size: 12px; font-weight: 500; color: var(--wv-text-muted); }
.plate__chev {
  flex: none;
  margin-inline-start: 4px;
  color: var(--wv-accent);
}
/* Логический шеврон: в RTL-диалоге зеркалится (направление приходит
   из текстов сервера, см. ui.js::toolPlate). */
.plate__chev.is-rtl { transform: scaleX(-1); }

/* Пустое состояние §9.4 — удалено в v0.4.83 (feature-guest-card.md):
   имя/стол/лид/три подсказки переехали на отдельную стартовую
   карточку `card-restaurant` (§8.6.1a). */

/* ---------- Стартовая карточка гостя (§8.6.1a, v0.4.83) ---------- */

.card-restaurant__hero {
  width: 100%;
  /* 4:3 — тот же размер и кадровка, что у .dish__photo (фото блюда).
     height: auto обязателен: атрибут height из разметки иначе перебивает
     aspect-ratio, и фото растягивается в высоту. */
  height: auto;
  aspect-ratio: 16 / 9;   /* feature-guest-card.md §0.1 п.2; 4:3 съедало треть экрана и уводило Menu под сгиб */
  object-fit: cover;
  /* Full-bleed со скруглением только верхних углов — тот же приём, что
     у .dish__photo, иначе стартовая карточка визуально разъедется с
     карточками блюд, стоящими рядом. */
  border-radius: calc(var(--wv-r-card) - 1px) calc(var(--wv-r-card) - 1px) 0 0;
  background: var(--wv-skeleton);
  flex: none;
}

.card-restaurant__body {
  padding: 16px;   /* .card своего padding'а не имеет — см. .chat */
  flex: none;
}

/* Название ресторана и код стола — одна строка: имя слева, код справа. */
.card-restaurant__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.card-restaurant__name,
.card-restaurant__table {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--wv-text);
}

.card-restaurant__name {
  /* Длинное имя переносится, а не выталкивает код стола за край. */
  min-width: 0;
}

.card-restaurant__table {
  flex: none;
  margin: 0;
  text-align: right;
  /* Имя скрыто — код стола всё равно прижат вправо. */
  margin-inline-start: auto;
}

.card-restaurant__description {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--wv-text);
  /* Владелец может написать до 500 символов (restaurant schema.ts:59) —
     на стартовом экране это недопустимо, обрезаем до трёх строк. Полное
     описание гость всё равно может спросить голосом. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.card-restaurant__tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.card-restaurant__tags span {
  background: var(--wv-accent-50);
  color: var(--wv-accent);
  border-radius: var(--wv-r-chip);
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
}

/* Блок «Menu» (waitervoice-bcf.1, web/docs/feature-home-menu-sections.md):
   сгруппированный список на всю ширину, строка — <button> со стрелкой.
   С версии waitervoice-gkbi.3 — дерево разделов аккордеоном: группа
   раскрыта до уровня OPEN_TO_LEVEL, подсписок — `.home-menu__sub`.
   Только существующие токены. */
.home-menu { margin-top: 18px; }
.home-menu__title { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; color: var(--wv-text); }
.home-menu__list {
  margin-top: 10px;
  border: 1px solid var(--wv-border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--wv-white);
}
/* Разделитель — на любом уровне вложенности, а не только в корневом списке. */
.home-menu__item + .home-menu__item > .home-menu__btn { border-top: 1px solid var(--wv-border); }
/* Первый ряд подсписка — граница против строки группы над ним. */
.home-menu__sub > .home-menu__item:first-child > .home-menu__btn { border-top: 1px solid var(--wv-border); }
.home-menu__sub {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--wv-bg-soft);
}
/* Правило с `display` перебило бы UA-правило `[hidden]` — пишем явно. */
.home-menu__sub[hidden] { display: none; }
.home-menu__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--wv-t-fast);
}
.home-menu__btn:active { background: var(--wv-bg-soft); }
@media (hover: hover) { .home-menu__btn:hover { background: var(--wv-bg-soft); } }
.home-menu__btn:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: -2px; }
.home-menu__name { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.home-menu__count { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--wv-text-muted); }
.home-menu__chev { width: 18px; height: 18px; flex: none; color: var(--wv-dim); }

/* Отступ по уровню (глубина дерева ограничена сервером — MAX_CATEGORY_DEPTH). */
.home-menu__btn[data-level="2"] { padding-inline-start: 34px; }
.home-menu__btn[data-level="3"] { padding-inline-start: 54px; }
.home-menu__btn[data-level="4"] { padding-inline-start: 74px; }
/* Вложенный ряд — ниже и спокойнее корневого. */
.home-menu__sub .home-menu__btn { min-height: 46px; }
.home-menu__sub .home-menu__name { font-size: 15px; font-weight: 600; }
/* Нажатие вложенного ряда: тон подсписка (`--wv-bg-soft`) совпадает с тоном
   нажатия корневого ряда — без своего тона тап не виден совсем. Ближайший
   существующий токен к `--soft` макета — `--wv-skeleton`. */
.home-menu__sub .home-menu__btn:active { background: var(--wv-skeleton); }
@media (hover: hover) { .home-menu__sub .home-menu__btn:hover { background: var(--wv-skeleton); } }
/* Стрелка группы раскрывается поворотом. */
.home-menu__btn--group .home-menu__chev { transition: transform var(--wv-t-fast); }
.home-menu__btn--group[aria-expanded="true"] .home-menu__chev { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
  .home-menu__btn--group .home-menu__chev { transition: none; }
}

/* Герой блока «Menu» (waitervoice-m38g.7, waitervoice-lh1v.7): разделы
   меню, которые показываются сейчас. Фото на весь блок, название — поверх,
   потемнение под ним. */
.herorot {
  margin-top: 10px;
  border-radius: 16px;
  overflow: hidden;
}
/* Правило с `display` перебило бы UA-правило `[hidden]` — пишем явно. */
.herorot[hidden] { display: none; }
.herorot__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.herorot__track::-webkit-scrollbar { display: none; }
.herorot__track > .sechero {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.sechero {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--wv-accent-50);
  font: inherit;
  text-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sechero:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: -2px; }
.sechero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Правило с `display` перебило бы UA-правило `[hidden]` — пишем явно. */
.sechero__img[hidden] { display: none; }
/* Затемнение — под фото и названием, над ними. */
.sechero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, var(--wv-scrim-hero), transparent 62%);
  pointer-events: none;
}
.sechero__title {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  padding: 16px 14px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
  color: var(--wv-on-photo);
}
/* Раздел без фото — брендовая заливка вместо картинки. */
.sechero--empty { background: linear-gradient(135deg, var(--wv-accent-50), var(--wv-accent)); }

/* Картинка раздела в строке списка: фото или буква названия.
   waitervoice-u2q8 (владелец 2026-11-25): 80×80 на ВСЕХ уровнях — не мельче
   фото блюда (80×80) на карточке раздела. */
.home-menu__thumb {
  width: 80px;
  height: 80px;
  flex: none;
  border-radius: 14px;
  background: var(--wv-skeleton);
  object-fit: cover;
}
.home-menu__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--wv-dim);
}
/* Строка с картинкой — по высоте картинки (80 + отступы строки). Отступ
   уровня не перебиваем: вложенность читается тем же `[data-level]`. */
.home-menu__btn--pic { min-height: 100px; }
.home-menu__sub .home-menu__btn--pic { min-height: 100px; }

/* Без фона-«таблетки» (было var(--wv-cyan-50) + border-radius: 999px) —
   на карточке и так достаточно акцентных чипов (кухни, примеры вопросов),
   промо читается как обычный текст. */
.card-restaurant__promo {
  margin-top: 14px;
  color: var(--wv-text);
  text-align: center;
}
.card-restaurant__promo-lead {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
}
.card-restaurant__promo-help {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--wv-text-muted);
}

/* waitervoice-hi73: строка «ИИ, может ошибаться» внизу карточек. */
.ai-disclaimer {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--wv-text-muted);
  text-align: center;
}
.ai-disclaimer:empty { display: none; }

.card-restaurant__steps {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.card-restaurant__steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.card-restaurant__steps-icon {
  width: 22px;
  height: 22px;
  color: var(--wv-text-muted);
}
.card-restaurant__steps span {
  font-size: 12px;
  line-height: 1.25;
  color: var(--wv-text-muted);
}

@media (max-device-height: 600px) {
  /* Тот же брейкпоинт, что уже ужимает шапку. */
  .card-restaurant__promo { margin-top: 12px; }
  .card-restaurant__steps { margin-top: 12px; }
}

.dish__basket { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.basket__add {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--wv-accent);
  color: #fff;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--wv-t-fast);
}
.basket__add:active { transform: scale(0.92); }
/* Иконка корзины рядом со счётчиком в подвале карточки: тот же круг, что
   «в корзину», но без glow. Над фото вид задаёт cards.css. */
.dish__basket:not(.dish__photo-cart) .basket__cart {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--wv-accent);
  color: #fff;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--wv-t-fast);
}
.dish__basket:not(.dish__photo-cart) .basket__cart:active { transform: scale(0.92); }
.dish__basket:not(.dish__photo-cart) .basket__cart:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: 2px; }
.basket__step {
  display: flex; align-items: center;
  height: 44px;
  border-radius: var(--wv-r-chip);
  background: #fff;
  border: 1px solid var(--wv-accent-line);
}
.basket__btn {
  width: 44px; height: 44px;
  border: 0; background: none;
  color: var(--wv-accent);
  font: inherit; font-size: 22px; font-weight: 700; line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 50%;
  transition: background var(--wv-t-fast);
}
.basket__btn:active { background: var(--wv-accent-line); }
.basket__btn:disabled { color: var(--wv-dim); cursor: default; }
.basket__qty { min-width: 26px; text-align: center; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
/* Плашка окна заказа (waitervoice-jijx.5): блюдо вне окна — вместо
   кнопки корзины время окна. Вид тот же, что у степпера, но без
   интерактива. Только существующие токены. */
.basket__step--window {
  justify-content: center;
  padding: 0 10px;
  cursor: default;
}
.basket__window {
  font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: inherit;
  white-space: nowrap;
}
.basket__add:focus-visible, .basket__btn:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: 2px; }

/* ---------- Карточка раздела (web/docs/feature-category-card.md §2) ----------
   Только существующие токены. Строка — <button> (§5: тап открывает
   карточку блюда), поэтому сброс кнопочных стилей и собственные
   :active / :focus-visible — глобальный tap-highlight подавлен. */

.catcard { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.catcard__head { position: relative; min-height: 36px; display: flex; align-items: center; justify-content: center; }
.catcard__title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; text-align: center; margin-inline: 56px; }
/* waitervoice-4ftp: шевроны соседних разделов по краям заголовка.
   28px от головы — это 44px от края карточки (у карточки поля 16px),
   центр фотографии блюда. */
.catcard__nav {
  position: absolute;
  top: 50%;
  left: 28px;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  border: 1.5px solid var(--wv-accent);
  border-radius: 50%;
  background: var(--wv-white);
  color: var(--wv-accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.catcard__nav--next { left: auto; right: 28px; transform: translate(50%, -50%); }
.catcard__nav:active { background: var(--wv-accent-50); }
.catcard__nav:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: 2px; }
.catcard__nav svg { width: 20px; height: 20px; display: block; }
.catcard__empty { font-size: 15px; font-weight: 450; line-height: 1.5; color: var(--wv-text-muted); }
.catcard__list { display: flex; flex-direction: column; margin-inline: -16px; }
.catcard__list li + li .catrow { border-top: 1px solid var(--wv-border); }

.catrow {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 12px 16px;           /* до краёв карточки — вся ширина тапается */
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--wv-t-fast);
}
.catrow:active { background: var(--wv-bg-soft); }
@media (hover: hover) { .catrow:hover { background: var(--wv-bg-soft); } }
.catrow:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: -2px; border-radius: var(--wv-r-tag); }
.catrow__photo {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--wv-skeleton);
  flex-shrink: 0;
}
.catrow__body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.catrow__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--wv-text);
  line-height: 1.3;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.catrow__meta { font-size: 13.5px; font-weight: 500; color: var(--wv-text-muted); margin-top: 2px; }
.catrow__price {
  font-size: 16px;
  font-weight: 700;
  color: var(--wv-text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.catrow__chev {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--wv-dim);
}
.catrow__chev svg { width: 16px; height: 16px; display: block; }
[dir="rtl"] .catrow__chev { transform: scaleX(-1); }

/* ---------- Карточка корзины (§8.6.3) ---------- */

.cart { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.cart__items { display: flex; flex-direction: column; gap: 10px; }

.cta {
  min-height: 52px;
  border: 0;
  border-radius: var(--wv-r-chip);
  background: var(--wv-accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: none;
  transition: background var(--wv-t-base), box-shadow var(--wv-t-base);
}
.cta[disabled] { background: var(--wv-border-strong); color: var(--wv-text-muted); box-shadow: none; }
.cta:not([disabled]):active { background: var(--wv-accent-press); }
.cart__empty { font-size: 15px; font-weight: 450; line-height: 1.5; color: var(--wv-text-muted); }
.cart__hint { text-align: center; font-size: 13px; font-weight: 600; color: var(--wv-text-muted); }
/* waitervoice-xc1 (F2): when confirm POST fails the hint shows the
   error in coral so the message stands out against the cyan-CTA
   button right above it. */
.cart__hint--error { color: var(--wv-coral); }

/* ---------- Карточка корзины: блок блюд и блок итогов (waitervoice-cp93.2) ---------- */

/* Строка блюда: кнопка с миниатюрой, именем и суммой — и счётчик справа. */
.cart__item { display: flex; align-items: flex-start; gap: 6px; }
/* Авторское `display` бьёт `hidden` из браузера — без этой строки строка
   без блюда осталась бы на экране. */
.cart__item[hidden] { display: none; }
.cart__dishes {
  gap: 0;
  border: 1px solid var(--wv-border);
  border-radius: 16px;
  padding: 6px 12px;
}
.cart__dishes .cart__item { padding: 8px 0; }
.cart__item + .cart__item { border-top: 1px solid var(--wv-border); }
.cart__dishes .cart__pick {
  align-items: flex-start;
  gap: 8px;
  padding: 0;
  font-size: 15px;
  font-weight: 400;
}
.cart__text { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.cart__dishes .cart__name { line-height: 1.25; font-weight: 400; }
.cart__dishes .cart__note { font-size: 13px; color: var(--wv-text-muted); margin: 0; line-height: 1.3; }
.cart__dishes .cart__sum { font-size: 15px; font-weight: 400; color: var(--wv-text-muted); }
/* Счётчик строки: та же «таблетка», что у счётчика в карточке блюда. */
.cart__step {
  display: flex; align-items: center;
  height: 28px; flex: none;
  border: 1px solid var(--wv-border-strong);
  border-radius: var(--wv-r-chip);
}
.cart__step-btn {
  width: 26px; height: 26px;
  border: 0; background: none;
  color: var(--wv-accent);
  font: inherit; font-size: 17px; font-weight: 400; line-height: 1;
  border-radius: 50%; cursor: pointer;
}
.cart__step-btn:disabled { color: var(--wv-dim); cursor: default; }
.cart__step-qty {
  min-width: 16px; text-align: center;
  font-size: 14px; font-weight: 400;
  font-variant-numeric: tabular-nums;
}
/* Итоги: сколько блюд, из чего складывается сумма, и сама сумма. */
.cart__totals {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--wv-border);
  border-radius: 16px;
  padding: 12px 16px;
}
.cart__count {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 15px; font-weight: 500; color: var(--wv-text-muted);
  font-variant-numeric: tabular-nums;
}
.cart__count b { font-weight: 600; }
.cart__totals .cart__total { border-top: 1px solid var(--wv-border); padding-top: 10px; margin-top: 4px; }

/* ---------- Лист подтверждения заказа (waitervoice-cp93.3) ---------- */

.cartsheet__dim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(7, 43, 100, 0.45);
}
.cartsheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 41;
  display: flex; flex-direction: column; gap: 12px;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  background: var(--wv-white);
  border-radius: var(--wv-r-card) var(--wv-r-card) 0 0;
  box-shadow: var(--wv-shadow-lg);
  animation: wv-sheet-up var(--wv-t-slow) both;
}
@media (prefers-reduced-motion: reduce) { .cartsheet { animation: none; } }
.cartsheet__grab {
  width: 40px; height: 5px; border-radius: 3px;
  background: var(--wv-border-strong); align-self: center;
}
.cartsheet__title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.cartsheet__body { font-size: 15px; line-height: 1.45; color: var(--wv-text-muted); }
.cartsheet__facts {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--wv-border);
  border-radius: 14px;
  padding: 12px 16px;
  font-variant-numeric: tabular-nums;
}
.cartsheet__row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 15px; color: var(--wv-text-muted);
}
.cartsheet__row:last-child { font-size: 17px; font-weight: 700; color: var(--wv-text); }
.cartsheet__row:last-child b { font-size: 20px; font-weight: 800; }
.cartsheet__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.cartsheet__cancel {
  min-height: 52px;
  border: 1.5px solid var(--wv-accent-line);
  border-radius: var(--wv-r-chip);
  background: var(--wv-white);
  color: var(--wv-accent);
  font-size: 17px; font-weight: 700;
}

/* waitervoice-e5hn: the restaurant is not accepting orders right now.
   The message stands in for the Confirm button — the guest has to read
   WHEN the restaurant takes orders, so it is a step above the hint in
   size and weight, and it keeps the muted ink: a closed restaurant is
   a state, not an error. */
.cart__closed {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--wv-text-muted);
}

/* ---------- Карточка «QR соседу» (waitervoice-oe7k) ---------- */

.qrcard { align-items: stretch; }
.qrcard__qr {
  /* Тихая зона: сервер рисует QR через segno с border=0, то есть без
     неё, а на тёмной теме светлый код без полей не сканируется вообще.
     Отступ + белый фон — это и есть quiet zone (4 модуля при scale=4). */
  align-self: center;
  width: min(100%, 260px);
  padding: 16px;
  border-radius: var(--wv-r-chip);
  background: #fff;
  /* Тап по коду копирует ссылку для гостя (waitervoice-cgra) — он
     выглядит как кнопка и на самом деле ею является (role="button"). */
  cursor: pointer;
}
.qrcard__qr:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: 2px; }
.qrcard__qr[aria-disabled="true"] { cursor: default; }
.qrcard__qr:empty { display: none; }
.qrcard__qr > svg { display: block; width: 100%; height: auto; }
.qrcard__countdown {
  display: flex;
  justify-content: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 700;
  color: var(--wv-text-muted);
}
.qrcard__countdown[hidden] { display: none; }
.qrcard__status { text-align: center; font-size: 15px; line-height: 1.5; }
.qrcard__status--ok { color: var(--wv-text); font-weight: 700; }
/* Ответ на копирование ссылки. Пустой элемент не должен занимать
   место в колонке карточки, пока копировать было нечего. */
.qrcard__copynote { text-align: center; font-size: 14px; font-weight: 700; color: var(--wv-text-muted); }
.qrcard__copynote:empty { display: none; }
.qrcard__error { text-align: center; font-size: 15px; color: var(--wv-coral); }
.qrcard__error[hidden], .qrcard__again[hidden], .qrcard__retry[hidden] { display: none; }


/* ---------- Нижний бар: кнопка и индикаторы (§5-§7) ---------- */

/* ---------- Футер гостя (waitervoice-s87e.7) ---------- */

/* waitervoice-rzug: поля футера — свои отступы (12 px), не --side-x:
   на 320 px поле ввода должно быть 296 px, а с корзиной — 242 px. */
.app { --foot-x: 12px; }

/* Подпись под баром — обычный текст: постоянная строка и переходные
   сообщения поверх неё (UI.setHint / UI.setFooterCaption). */
.hint {
  flex: 0 0 auto;
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px var(--foot-x) 8px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--wv-text-muted);
  text-align: center;
}
.hint span { display: inline; }

/* Плашки вопросов гостя — из sample_questions документа меню. */
.question-chips {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 0 var(--foot-x) 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.question-chips::-webkit-scrollbar { display: none; }
.question-chips[hidden] { display: none; }
.qchip {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--wv-accent-line);
  border-radius: var(--wv-r-chip);
  background: var(--wv-white);
  color: var(--wv-accent);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.qchip:active { background: var(--wv-accent-50); }

.bar {
  position: relative;
  flex: 0 0 auto;
  padding-bottom: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* waitervoice-ol9s: закрытый стол — гостю не нужен ввод: поле, микрофон
   и подсказка исчезают вместе с собой. */
.app.is-table-closed .bar, .app.is-table-closed .question-chips, .app.is-table-closed .hint { display: none; }

/* waitervoice-1zlc.2 (QA NEW-16): the on-screen keyboard must not make the
   page reflow. The whole page pans as one, by the inset the keyboard covers
   (`--wv-kb-inset`, published by app-height-lock.js): the header, the
   carousel, the bar and the hint move together, the carousel keeps its size
   (no reflow) and the keyboard overlays the bottom. A transform, not a
   margin or a height: the column must not change its layout. */
.app.is-footer-typing {
  transform: translateY(calc(-1 * var(--wv-kb-inset, 0px)));
}

/* Ряд футера: поле ввода с микрофоном и кнопкой отправки + корзина. */
.cmp {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 var(--foot-x);
}
.footer-field {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 2px 2px 14px;
  border: 1px solid var(--wv-border);
  border-radius: 23px;
  background: var(--wv-white);
  box-shadow: var(--wv-shadow-sm);
}
.footer-field:focus-within { border-color: var(--wv-accent); }
#footerInput[hidden] { display: none; }
.footer-field.is-holding {
  padding-left: 16px;
  gap: 10px;
  border-color: transparent;
  background: var(--wv-accent-50);
}
.hold-indicator {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hold-indicator[hidden] { display: none; }
.hold-wave { display: flex; align-items: center; gap: 3px; height: 16px; }
.hold-wave i {
  width: 3px;
  height: 25%;
  border-radius: 2px;
  background: var(--wv-accent);
  animation: wv-hold-wave 0.9s ease-in-out infinite;
}
.hold-wave i:nth-child(odd) { animation-delay: 0.2s; }
.hold-wave i:nth-child(3n) { animation-delay: 0.45s; }
.hold-indicator.is-sending .hold-wave i { animation: none; height: 25%; opacity: 0.5; }
.hold-live {
  overflow: hidden;
  color: var(--wv-text);
  font-size: 14px;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: clip;
}
.hold-live.is-waiting { color: var(--wv-text-muted); }
.mic.is-holding { transform: scale(1.08); }
.mic.is-holding::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid var(--wv-accent);
  border-radius: 50%;
  opacity: 0.35;
  animation: wv-hold-pulse 1.2s infinite;
}
/* waitervoice-dmti: место точек и чипов остаётся занятым — иначе карусель вырастает и карточка встаёт вплотную к кнопке микрофона */
.app.is-holding .dots,
.app.is-holding .question-chips { visibility: hidden; }
@keyframes wv-hold-wave { 0%, 100% { height: 25%; } 50% { height: 100%; } }
@keyframes wv-hold-pulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.25); opacity: 0; }
}
#footerInput {
  flex: 1;
  min-width: 0;
  max-height: 96px;
  padding: 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--wv-text);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  overflow-y: hidden;
}
#footerInput::placeholder {
  color: var(--wv-dim);
  white-space: nowrap;
  overflow: hidden;
}
#footerInput:disabled { opacity: 0.6; }

/* Кнопка отправки — круглая, акцентная, как на макете. */
.footer-send {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--wv-accent);
  color: var(--wv-white);
  cursor: pointer;
}
.footer-send[hidden] { display: none; }
.footer-send:disabled { opacity: 0.5; cursor: default; }
.footer-send:active { background: var(--wv-accent-press); }

/* Кнопка §5.1-§5.3 */
.mic {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--wv-accent);
  color: var(--wv-white);
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-touch-callout: none;
  transition: background var(--wv-t-base), color var(--wv-t-base),
              box-shadow var(--wv-t-base), border-color var(--wv-t-base);
}
/* Расширенная зона нажатия — 48px (≥44px), визуальный размер не меняется */
.mic::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.mic[hidden] { display: none; }

/* §9.2 — жест на кнопке не должен превращаться в скролл или зум */
#mic { touch-action: none; }

.mic .glyph { position: absolute; width: 22px; height: 22px; opacity: 0; transform: scale(0.92);
              transition: opacity var(--wv-t-base), transform var(--wv-t-base); }
.mic .glyph.is-on { opacity: 1; transform: none; }

/* Состояния кнопки §5.2 */
.app[data-state="connecting"] .mic { color: var(--wv-dim); }

.app[data-state="recording"] .mic {
  background: var(--wv-accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(29, 91, 216, 0.5);
}
.app[data-state="processing"] .mic {
  background: var(--fill-amber);
  border-color: transparent;
  color: var(--wv-navy);
  box-shadow: var(--wv-glow-amber);
}
.app[data-state="speaking"] .mic {
  background: var(--fill-navy);
  border-color: transparent;
  color: var(--wv-white);
  box-shadow: var(--wv-glow-navy);
}
.app[data-state="disabled"] .mic,
.app[data-state="ended"] .mic { color: var(--wv-dim); border-color: var(--wv-border); box-shadow: var(--wv-shadow-sm); }

/* waitervoice-65te: без доступа к микрофону кнопка выглядит выключенной —
   серый круг с перечёркнутым микрофоном. Не «приглушённой»: гость должен
   видеть, что микрофон отключён, а не что кнопка еле видна.
   waitervoice-krs4: такой вид — только в idle, где на кнопке нарисован
   микрофон. Во время приветствия и ответа на кнопке динамик и процесс,
   и серая кнопка там не про доступ. */
.app[data-state="idle"] .mic[aria-disabled="true"] {
  position: relative;
  color: var(--wv-text-muted);
  background: var(--wv-border);
  border: 0;
  box-shadow: none;
  cursor: default;
}

/* waitervoice-65te: перечёркивание микрофона — косая черта через круг. */
.app[data-state="idle"] .mic[aria-disabled="true"]::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--wv-text-muted);
  border-radius: 1px;
  transform: rotate(45deg);
  box-shadow: 0 0 0 1.5px var(--wv-border);
  pointer-events: none;
}

/* Три точки глифа processing — перетекают прозрачностью, не прыгают */
.app[data-state="processing"] .dot-a { animation: wv-fade-dot 1.4s ease-in-out infinite; }
.app[data-state="processing"] .dot-b { animation: wv-fade-dot 1.4s ease-in-out 0.22s infinite; }
.app[data-state="processing"] .dot-c { animation: wv-fade-dot 1.4s ease-in-out 0.44s infinite; }

@keyframes wv-fade-dot { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* Кнопка корзины (waitervoice-y8wv.3): в подвале — только когда в
   корзине есть блюда, и в виде прототипа: белая круглая кнопка с синим
   значком. Размер 46px, центр — на линии микрофона. */
.cart-jump {
  position: relative;
  flex: none;
  width: 46px; height: 46px;
  display: none;
  place-items: center;
  border: 1.5px solid var(--wv-accent-line);
  border-radius: 50%;
  background: var(--wv-white);
  color: var(--wv-accent);
  opacity: 1;
  cursor: pointer;
  transition: opacity var(--wv-t-base), color var(--wv-t-base);
}
.cart-jump:focus-visible, .audio-toggle:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: 2px; border-radius: 50%; }
/* waitervoice-y8wv.2: динамик уехал в шапку (между кодом языка и лупой);
   позицию и размер ему даёт `.header__nav`, здесь — только слот и цвет. */
.audio-toggle { inset-inline-end: calc(var(--side-x) + var(--lang-w)); inset-inline-start: auto; color: var(--wv-accent); }
/* waitervoice-ytcr.4: два глифа динамика в DOM, переключаются
   прозрачностью — как у mic, без мигания (см. .mic .glyph ниже). */
.audio-toggle .glyph { position: absolute; opacity: 0; transition: opacity var(--wv-t-base); }
.audio-toggle .glyph.is-on { opacity: 1; }
/* Режим «только текст» — кнопка говорит, что голос выключен. */
.audio-toggle.is-text { color: var(--wv-dim); }
.cart-jump.is-full { display: grid; }
/* waitervoice-ax5u: закрытый стол убирает ярлык корзины атрибутом hidden —
   авторское правило выше сильнее браузерного [hidden], поэтому своё. */
.cart-jump[hidden] { display: none; }
.cart-jump:active { background: var(--wv-accent-50); }
.cart-jump svg { width: 22px; height: 22px; }
/* Число порций в заказе (waitervoice-bcf.14) — кружок у правого верхнего
   угла иконки корзины. */
.cart-jump__n {
  position: absolute;
  top: -5px;
  inset-inline-end: -5px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--wv-accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  box-shadow: none;
}
.cart-jump__n[hidden] { display: none; }

/* ---------- Полноэкранные состояния §11 ---------- */

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  text-align: center;
  background: var(--wv-app-bg);
}
.screen.is-on { display: flex; animation: wv-card-in var(--wv-t-slow) both; }
.screen img { width: 56px; height: 56px; object-fit: contain; margin-bottom: 8px; }
.screen h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.screen p { font-size: 17px; color: var(--wv-text-muted); max-width: 22rem; }
.screen__progress {
  position: absolute; top: 0; inset-inline: 0; height: 3px; overflow: hidden;
  background: var(--wv-cyan-50);
}
.screen__progress i {
  display: block; width: 40%; height: 100%; background: var(--wv-cyan);
  animation: wv-indet 1.2s ease-in-out infinite;
}

@keyframes wv-indet {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

/* Шторка «стол закрыт» §11.4 — снизу, не модалка по центру */
.sheet {
  position: fixed;
  inset-inline: 0; bottom: 0;
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 24px 24px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  background: var(--wv-white);
  border-radius: var(--wv-r-card) var(--wv-r-card) 0 0;
  box-shadow: var(--wv-shadow-lg);
}
.sheet.is-on { display: flex; animation: wv-sheet-up var(--wv-t-slow) both; }
.sheet h2 { font-size: 20px; font-weight: 800; }
.sheet p { font-size: 17px; color: var(--wv-text-muted); }
/* waitervoice-fe66: это нижний лист (`wv-sheet-up`), а не поисковая
   шторка (`wv-sheet-in`) — у каждого своё имя, иначе одно перекрывает
   другое. */
@keyframes wv-sheet-up {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

/* ---------- Тост §6/§7 ---------- */

.toast {
  /* absolute относительно .app (не fixed от вьюпорта). Положение плашки
     (left/right/bottom) ставит ui.js::placeToast — замером по чату и
     карточке чата: края — края пузырей, низ — последняя системная
     строка. Здесь своего положения нет, чтобы не было второй копии. */
  position: absolute;
  z-index: 25;
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--wv-t-base);
}
.toast.is-on { opacity: 1; }
/* waitervoice-y8wv.2: тост — тёмная плашка на всю ширину экрана, текст
   слева; раньше это была маленькая круглая подпись по центру. */
.toast span {
  background: #14161b;
  color: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  text-align: start;
  flex: 1;
  max-width: none;
}

/* ---------- Dev-панель §15.3 ---------- */

/* Открытая dev-панель поджимает приложение вверх — иначе она закрывает
   собой ровно то, что чаще всего и проверяют: кнопку и индикаторы. */
body.has-dev .app { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

.devpanel {
  position: fixed;
  inset-inline: 0; bottom: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px calc(8px + env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom));
  background: var(--wv-navy);
}
.devpanel button {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: var(--wv-white);
  border-radius: var(--wv-r-chip);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}
.devpanel button.is-close { margin-inline-start: auto; border-color: transparent; }

/* ---------- Popup языка (feature-language-onboarding.md §8.4) ----------
   Перенос из `public/proto/lang-popup.css` без правок: это утверждённый
   вид, и любое расхождение с прототипом было бы отдельным решением.
   Popup sticky — по центру ВИДИМОЙ части карточки, история прокручивается
   под ним. `translate`, а не `transform`: transform занят анимацией `wv-card-in`.
   Позиционирование — единственное расхождение с прототипом: там popup
   центрировался авто-margin'ом, но в прототипе нет скроллящейся карточки.
   `.chat > :first-child { margin-top: auto }` прижал бы popup к низу истории,
   а sticky не поднимает его выше — поэтому popup сбрасывает margin-top (waitervoice-n5od). */

.langpop {
  flex: none;
  margin: 0 0 4px;
  padding: 16px;
  border-radius: 18px;
  background: var(--wv-accent-50);
  border: 1px solid var(--wv-accent-line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: wv-card-in var(--wv-t-card) both;
}
.chat > .langpop:first-child {
  position: sticky;
  top: 50%;
  translate: 0 -50%;
  z-index: 1;
  margin-top: 0;
}
.langpop__head { display: flex; align-items: center; gap: 10px; }
.langpop__icon {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wv-white); color: var(--wv-accent);
  box-shadow: var(--wv-shadow-sm);
}
.langpop__icon svg { width: 20px; height: 20px; }
.langpop__title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.langpop__body { font-size: 15px; font-weight: 450; line-height: 1.45; color: var(--wv-text-muted); }
.langpop__note {
  font-size: 13px; font-weight: 700; color: var(--wv-coral);
}
.langpop__actions { display: flex; flex-direction: column; gap: 8px; }
.langpop .cta { width: 100%; }
.langpop__alt {
  min-height: 44px; border: 0; background: none;
  font-size: 15px; font-weight: 700; color: var(--wv-accent);
}
.langpop__listen { display: flex; align-items: center; gap: 4px; height: 24px; }
.langpop__listen i {
  width: 4px; border-radius: 2px; background: var(--wv-accent);
  animation: lp-eq 0.9s ease-in-out infinite;
}
.langpop__listen i:nth-child(2) { animation-delay: .15s }
.langpop__listen i:nth-child(3) { animation-delay: .3s }
.langpop__listen i:nth-child(4) { animation-delay: .45s }
.langpop__listen i:nth-child(5) { animation-delay: .6s }
@keyframes lp-eq { 0%,100% { height: 6px } 50% { height: 22px } }

/* «Preparing» — перевод меню, реальный прогресс по частям. */
.langpop--prep { align-items: stretch; text-align: center; }
.langpop__bar {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--wv-white); box-shadow: inset 0 0 0 1px var(--wv-accent-line);
}
.langpop__bar i {
  display: block; height: 100%; border-radius: inherit;
  background: var(--wv-accent); transition: width var(--wv-t-slow);
}
.langpop__pct { font-size: 13px; font-weight: 700; color: var(--wv-text-muted); font-variant-numeric: tabular-nums; }

/* Пока язык не подтверждён: mic, корзина, «домой», чип — неактивны.
   waitervoice-65te: у микрофона без доступа свой вид — эти два правила
   его не перекрашивают. */
.app.is-onboarding:not(.is-listen-armed):not([data-state="recording"]) .mic:not([aria-disabled="true"]) { color: var(--wv-dim); border-color: var(--wv-border); box-shadow: var(--wv-shadow-sm); }
/* waitervoice-c9d6: карточка `listen` просит нажать кнопку и говорить —
   значит, mic в этом состоянии нажимаем: живой вид глифа (белый), как
   без `is-onboarding`.
   waitervoice-65te: у микрофона без доступа свой вид — это правило его
   не перекрашивает. */
.app.is-onboarding.is-listen-armed .mic:not([aria-disabled="true"]) { color: var(--wv-white); box-shadow: none; }
.app.is-onboarding .cart-jump, .app.is-onboarding .audio-toggle { opacity: 0.2; }
.app.is-onboarding .header__nav { opacity: 0.2; }
.app.is-onboarding .chat { padding-top: 12px; }
/* waitervoice-ed8q: until the language is confirmed the app is locked.
   `inert` (ui.js) is the primary lock; this is the pointer fallback for
   browsers without it. */
.app.is-onboarding .header,
.app.is-onboarding .cart-jump { pointer-events: none; }
/* One visible card — there is nothing to swipe to. */
.app.is-onboarding .carousel { overflow-x: hidden; }

/* waitervoice-1zlc.6: the language popup is modal — the dialog behind it
   neither scrolls nor takes taps; only the popup itself stays live. */
.app.is-onboarding #card-chat { overflow: hidden; touch-action: none; }
.app.is-onboarding #card-chat .chat > :not(.langpop) { pointer-events: none; }

/* ---------- prefers-reduced-motion §4.6 ----------
   Не «выключить анимации» (иначе исчезает единственный сигнал «идёт
   процесс»), а заменить движение на изменение прозрачности. */

@media (prefers-reduced-motion: reduce) {
  .carousel { scroll-behavior: auto; }
  .hold-wave i,
  .mic.is-holding::after { animation: none !important; }
  .app[data-state="processing"] .mic { animation: wv-pulse 1.6s ease-in-out infinite; }
  .app[data-state="recording"] .mic,
  .app[data-state="speaking"] .mic { animation: wv-pulse 1.6s ease-in-out infinite; }
  .card, .bubble, .note, .screen.is-on, .app.is-search-anim .search { animation: none; }
  /* waitervoice-4622.5: полоса «ищем по смыслу» без движения — сигнал
     остаётся (полоса залита целиком), исчезает только анимация. */
  .app[data-pending="1"] .search__bar::after { animation: none; width: 100%; opacity: .5; }
  @keyframes wv-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.75; } }
}

/* ---------- Поиск по меню (waitervoice-4622.2) ----------
   Вариант «a» из web/public/proto/search.html: шторка под шапкой, во всю
   ширину. Правила варианта «b» (поле вместо логотипа) сюда не перенесены. */

/* лупа ↔ крестик отмены */
.header__nav--search .ico-close { display: none; }
.app.is-search .header__nav--search .ico-close { display: block; }
.app.is-search .header__nav--search .ico-search { display: none; }
.app.is-search .header__nav--search { color: var(--wv-accent); }

/* The footer has nothing to do under an open sheet; hidden, it cannot
   show through the sheet at any moment of the animation (waitervoice-fe66).
   `visibility`, not `display`: the footer keeps its box, so nothing
   moves when the sheet closes. */
.app.is-search .bar { visibility: hidden; }

/* waitervoice-yf7a: в iOS Safari клавиатура не сжимает layout viewport,
   и жест по открытой шторке «протягивает» всю страницу — шапка уезжает
   за экран. Пока шторка открыта, страница жестов не принимает;
   прокручивается только список (`.search__body`). */
.app.is-search { touch-action: none; }

.sfield {
  display: flex; align-items: center; gap: 8px; height: 44px; padding-inline: 14px;
  border: 1.5px solid var(--wv-border); border-radius: var(--wv-r-chip);
  background: var(--wv-white); color: var(--wv-text-muted);
}
.sfield:focus-within { border-color: var(--wv-accent); box-shadow: 0 0 0 3px var(--wv-accent-50); }
.sfield input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font: inherit; font-size: 17px; color: var(--wv-text);
}
.sfield input::placeholder { color: var(--wv-dim); }
.sfield--sheet { margin: 6px var(--wv-gutter) 8px; }

.search {
  /* absolute от `.app`, а его `padding-top` (safe-area) в абсолютные
     координаты не попадает — без этой строки на iPhone с вырезом шторка
     накрыла бы половину шапки. */
  position: absolute; inset-inline: 0;
  /* waitervoice-mwpx: шторка доходит до самого низа layout viewport —
     под строкой «галочка» и плашкой адреса Safari рисует прозрачную
     полосу НИЖЕ видимой области, и там должен быть фон шторки, а не
     карточка за ней. Чтобы строки не уходили под клавиатуру
     (waitervoice-vwl3), их удерживает отступ списка `.search__body` на
     `--wv-kb-inset` — ту часть layout viewport, которую закрыла
     клавиатура; search-overlay.js публикует её на `#app`, пока шторка
     открыта. */
  bottom: 0;
  top: calc(var(--wv-header-h) + env(safe-area-inset-top));
  display: flex; flex-direction: column; background: var(--wv-bg-soft);
  z-index: 5;
}
/* `display: flex` выше — авторское правило и перебивает встроенное
   `[hidden] { display: none }`: без этой строки шторка видна всегда и
   закрывает стартовую карточку (waitervoice-4622.6). */
.search[hidden] { display: none; }
/* вход анимируем только при живом открытии лупой; класс ставит
   search-overlay.js и не снимается, как в прототипе. */
.app.is-search-anim .search { animation: wv-sheet-in var(--wv-t-card) both; }
/* The sheet slides in WITHOUT opacity: a translucent sheet lets the
   footer bar and the start card show through it (waitervoice-fe66). */
@keyframes wv-sheet-in {
  from { transform: translateY(8px); }
  to   { transform: none; }
}

/* waitervoice-4622.5: the "ищем по смыслу" strip. It is `opacity: 0`
   until a semantic request is in the air, so the keyword list above it
   never moves and never flickers. Ported from proto/search.css. */
.search__bar {
  height: 2px; margin-inline: var(--wv-gutter); border-radius: 2px;
  overflow: hidden; opacity: 0;
}
.app[data-pending="1"] .search__bar { opacity: 1; background: var(--wv-skeleton); position: relative; }
.app[data-pending="1"] .search__bar::after {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 35%;
  background: var(--wv-cyan); animation: wv-search-bar 1s ease-in-out infinite;
}
/* Направление хода — свойство, а не два набора keyframes: у RTL-гостя
   полоса едет справа налево, и переключать её должен `dir`, а не
   отдельное правило с физическим `left`. */
.app { --wv-search-bar-from: -100%; --wv-search-bar-to: 300%; }
/* waitervoice-dz54: полоса едет по направлению ПОИСКА, а не шапки:
   направление несёт сам лист поиска (`#search`), у шапки его нет. */
#search[dir="rtl"] { --wv-search-bar-from: 100%; --wv-search-bar-to: -300%; }
@keyframes wv-search-bar {
  from { transform: translateX(var(--wv-search-bar-from)); }
  to { transform: translateX(var(--wv-search-bar-to)); }
}

.search__body { flex: 1; overflow-y: auto; padding: 4px var(--wv-gutter) calc(16px + var(--wv-kb-inset, 0px)); touch-action: none; overscroll-behavior: contain; }
/* waitervoice-yf7a: список принимает жест только когда ему есть что
   прокручивать; иначе жест не имеет цели и «протягивает» всю страницу
   (iOS Safari). Класс ставит search-overlay.js. */
.search__body.is-scrollable { touch-action: pan-y; }
/* строка для скринридера: сколько строк нашлось. Своего текста у неё
   нет — число, иначе пришлось бы тащить в бандл ещё одну строку. */
.search__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.shint { padding: 14px 2px 6px; font-size: 15px; color: var(--wv-text-muted); }

/* строка результата (по спеке .catrow из feature-category-card.md) */
.srow {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border: 0; border-bottom: 1px solid var(--wv-border); background: none;
  text-align: start; font: inherit; color: inherit; cursor: pointer;
}
.srow:last-child { border-bottom: 0; }
.srow:active { opacity: .6; }
.srow:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: 2px; border-radius: var(--wv-r-tag); }
.srow__thumb {
  width: 56px; height: 56px; flex-shrink: 0; border-radius: 12px;
  background: var(--wv-skeleton); object-fit: cover;
}
.srow__main { flex: 1; min-width: 0; }
.srow__name { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.srow__meta { font-size: 13px; color: var(--wv-text-muted); margin-top: 2px;
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.srow__price { flex-shrink: 0; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* waitervoice-0rxq: плашка «Спроси у ассистента про «…»» — первая строка
   списка поиска. Поверхность и шеврон — плашки диалога (.plate), раскладка
   — строка списка. */
.sask {
  width: 100%; display: flex; align-items: center; gap: 10px;
  margin: 2px 0 10px; padding-block: 8px; padding-inline: 12px;
  text-align: start; font: inherit; color: inherit; cursor: pointer;
  background: var(--wv-white); border: 1px solid rgba(7, 43, 100, 0.08);
  box-shadow: var(--wv-shadow-sm); border-radius: var(--wv-r-bubble);
}
.sask:focus-visible { outline: 2px solid var(--wv-accent); outline-offset: 2px; }
.sask__mark { width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; }
.sask__title { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.snone { padding: 28px 4px; text-align: center; }
.snone__t { font-size: 18px; font-weight: 800; }
.snone__p { margin-top: 6px; font-size: 15px; color: var(--wv-text-muted); }
