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

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

/* ---------- Шрифты (self-hosted, §4.3) ---------- */

@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F,
    U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/manrope-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Noto Sans Georgian Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/noto-sans-georgian-georgian-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+10A0-10FF, U+1C90-1CBF, U+2D00-2D2F;
}

/* ---------- Токены (§4, копия landing/src/styles/tokens.css) ---------- */

:root {
  /* Бренд */
  --wv-navy: #072b64;
  --wv-navy-700: #0b3a80;
  --wv-navy-900: #041a3f;
  --wv-cyan: #00c6f8;
  --wv-cyan-bright: #35d6ff;
  --wv-cyan-ink: #0072a3;
  --wv-cyan-50: #eaf9fe;
  --wv-cyan-100: #cff2fd;
  --wv-white: #ffffff;

  /* Текст и нейтрали */
  --wv-text: #072b64;
  --wv-text-muted: #4a5878;
  --wv-dim: #7e8fac;
  --wv-border: #e1e7f0;
  --wv-border-strong: #c7d2e3;
  --wv-bg-soft: #f8fbfe;
  --wv-skeleton: #eaf0f7;

  /* Акценты */
  --wv-amber: #f5a524;
  --wv-amber-ink: #8a6100;
  --wv-coral: #c8412f;
  --wv-carb: #5b7fd6;

  /* Тени и свечения (§4.4) */
  --wv-shadow-sm: 0 1px 2px rgba(7, 43, 100, 0.06), 0 1px 1px rgba(7, 43, 100, 0.03);
  --wv-shadow: 0 12px 32px -14px rgba(7, 43, 100, 0.22);
  --wv-shadow-lg: 0 32px 64px -24px rgba(7, 43, 100, 0.35);
  --wv-glow-cyan: 0 12px 30px -10px rgba(0, 198, 248, 0.55);
  --wv-glow-amber: 0 12px 30px -10px rgba(245, 165, 36, 0.5);
  --wv-glow-navy: 0 12px 30px -10px rgba(7, 43, 100, 0.5);

  /* Геометрия (§4.4) */
  --wv-r-card: 22px;
  --wv-r-bubble: 16px;
  --wv-r-chip: 999px;
  --wv-r-tag: 7px;
  --wv-btn-size: 59px;   /* было 88px; ÷1.5 — кнопка не съедает место (bcf.4) */
  --wv-gutter: 16px;
  --wv-card-gap: 12px;
  --wv-header-h: 44px;
  --wv-app-pad-bottom: 8px;

  /* Motion (§4.5) */
  --wv-t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --wv-t-base: 180ms ease;
  --wv-t-card: 240ms cubic-bezier(0.22, 0.8, 0.28, 1);
  --wv-t-slow: 400ms cubic-bezier(0.22, 0.8, 0.28, 1);

  /* Заливки кнопки (§5.3) */
  --fill-cyan: radial-gradient(120% 120% at 50% 0%, #35d6ff 0%, #00c6f8 55%, #00a9d6 100%);
  --fill-amber: radial-gradient(120% 120% at 50% 0%, #ffc15e 0%, #f5a524 55%, #de8f10 100%);
  --fill-navy: radial-gradient(120% 120% at 50% 0%, #0b3a80 0%, #072b64 60%, #041a3f 100%);

  --wv-font-sans: "Manrope Variable", "Noto Sans Georgian Variable", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Сброс и документ (§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:
    radial-gradient(22rem 18rem at 50% 100%, rgba(0, 198, 248, 0.16), transparent 70%),
    linear-gradient(180deg, var(--wv-white) 0%, var(--wv-bg-soft) 45%, #eef7fd 100%);
  background-attachment: fixed;
}

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-cyan);
  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: 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 {
  position: relative;
  flex: 0 0 var(--wv-header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.header__mark {
  width: 24px; height: 24px;
  object-fit: contain;
}
.header__word {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--wv-navy);
}
/* Логотип — исключение из правила контраста §4.2 (как на лендинге). */
.header__word i { font-style: normal; color: var(--wv-cyan); }
/* Логотип — кнопка «домой» (bcf.16): выглядит как прежде, без рамки. */
.header__logo {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; 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-cyan); outline-offset: 2px; }
.header__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; background: none;
  color: var(--wv-text-muted);
  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-cyan); outline-offset: 2px; border-radius: 50%; }
.header__nav--search { inset-inline-end: var(--side-x); }

@media (max-height: 600px) {
  :root { --wv-header-h: 36px; }
  .header__mark { width: 20px; height: 20px; }
  .header__word { font-size: 13px; }
}

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

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

.card {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;              /* §3.2 — скроллится содержимое карточки */
  overscroll-behavior: contain;  /* и не «пробивает» в карусель/страницу  */
  background: var(--wv-white);
  border: 1px solid var(--wv-border);
  border-radius: var(--wv-r-card);
  box-shadow: var(--wv-shadow);
  animation: wv-card-in var(--wv-t-card) both;
}
/* Список анимаций, а не замена: иначе при снятии класса wv-card-in
   стартует заново, и карточка «моргает» как после refresh (bcf.5). */
.card--flash { animation: wv-card-in var(--wv-t-card) both, wv-flash 600ms ease-out; }

/* 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(0, 198, 248, .35); } /* --wv-cyan #00c6f8 */
}
@media (prefers-reduced-motion: reduce) {
  .cta--attention { animation: none; outline: 3px solid var(--wv-cyan); }
}

/* §8.2 доп. — клоны крайних карточек для кругового скролла (ui.js
   syncLoop()): видимы только на долю свайпа через границу, не должны
   ни мигать входным wv-card-in, ни ловить тапы. */
.card--clone { animation: none; pointer-events: none; }

/* Временная карточка (waitervoice-bcf.11): крестик у левого верхнего
   угла, центр чуть внутри карточки по диагонали, часть кнопки снаружи. Карточка поэтому не обрезает
   содержимое (overflow: visible), а скроллится внутренний .card__scroll
   со скруглением карточки. */
.card--temp { position: relative; overflow: visible; }
.card__scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: inherit;
}
.card__close {
  position: absolute;
  top: -10px;                    /* центр на 6px внутрь по диагонали от угла */
  inset-inline-start: -10px;
  z-index: 2;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--wv-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 4px rgba(17, 24, 39, 0.18);
  color: var(--wv-navy);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: background var(--wv-t-fast);
}

@keyframes wv-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes wv-flash {
  0%   { box-shadow: var(--wv-shadow), 0 0 0 0 rgba(0, 198, 248, 0.7); }
  40%  { box-shadow: var(--wv-shadow), 0 0 0 4px rgba(0, 198, 248, 0.45); }
  100% { box-shadow: var(--wv-shadow), 0 0 0 0 rgba(0, 198, 248, 0); }
}

/* Точки-индикаторы §8.3 */
.dots {
  flex: 0 0 20px;                /* было 28px: зазор кнопка↔точки ÷2 (bcf.5) */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dots[hidden] { display: flex; visibility: hidden; }
.dots button {
  border: 0;
  background: none;
  padding: 11px 4px;             /* зона касания 44px по высоте */
  line-height: 0;
}
.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);
}
.dots i.is-chat { width: 16px; }
.dots button[aria-current="true"] i { background: var(--wv-cyan-ink); }

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

.chat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  min-height: 100%;
}
/* Переписка прижата к низу, как в мессенджере. Именно так, а не через
   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-cyan-50);
  border: 1px solid var(--wv-cyan-100);
  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-cyan-ink);
  animation: wv-blink 1s step-end infinite;
}
@keyframes wv-blink { 50% { opacity: 0; } }

.note {
  align-self: center;
  max-width: 90%;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--wv-text-muted);
  padding: 4px 0;
  animation: wv-card-in var(--wv-t-card) both;
}

/* Пустое состояние §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__name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--wv-text);
}

.card-restaurant__table {
  font-size: 15px;
  color: var(--wv-text-muted);
  margin-top: 2px;
}

.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-cyan-50);
  color: var(--wv-navy);
  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> со стрелкой.
   Только существующие токены. */
.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__list li + li .home-menu__btn { border-top: 1px solid var(--wv-border); }
.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-cyan); 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); }

/* Без фона-«таблетки» (было var(--wv-cyan-50) + border-radius: 999px) —
   на карточке и так достаточно акцентных чипов (кухни, примеры вопросов),
   промо читается как обычный текст. */
.card-restaurant__promo {
  margin-top: 14px;
  color: var(--wv-navy);
  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);
}

.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-navy);
}
.card-restaurant__steps span {
  font-size: 12px;
  line-height: 1.25;
  color: var(--wv-text-muted);
}

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

/* ---------- Карточка блюда (§8.6.2) ---------- */

/* waitervoice-bcf.15: фото + корзина в левом нижнем углу (верхний левый
   занят крестиком закрытия). */
.dish__media { position: relative; }
.dish__media .dish__photo { display: block; }
.dish__photo-cart {
  position: absolute;
  inset-inline-start: 12px;
  bottom: 12px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--wv-border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.22);
  color: var(--wv-cyan-ink);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: transform var(--wv-t-fast), background var(--wv-t-fast);
}
.dish__photo-cart:active { transform: scale(0.92); background: #fff; }
.dish__photo-cart:focus-visible { outline: 2px solid var(--wv-cyan); outline-offset: 2px; }
.dish__photo {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  border-radius: calc(var(--wv-r-card) - 1px) calc(var(--wv-r-card) - 1px) 0 0;
  background: var(--wv-skeleton);
}
.dish__body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.dish__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dish__name { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
/* Плашка «ккал / вес» справа в шапке (waitervoice-bcf.7, вариант C):
   компактные шрифты, чтобы имя блюда получило максимум ширины. */
.dish__stat {
  flex-shrink: 0;
  min-width: 62px;
  border: 1px solid var(--wv-border);
  background: var(--wv-bg-soft);
  border-radius: 10px;
  padding: 4px 8px;
  font-variant-numeric: tabular-nums;
}
.dish__stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; line-height: 1.25; }
.dish__stat-row + .dish__stat-row { border-top: 1px solid var(--wv-border); margin-top: 3px; padding-top: 3px; }
.dish__stat-row b { font-size: 14px; font-weight: 800; }
.dish__stat-row span { font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--wv-text-muted); }
.dish__stat-row + .dish__stat-row b { font-size: 13px; font-weight: 700; }
.dish__desc { font-size: 15px; font-weight: 450; line-height: 1.5; color: var(--wv-text-muted); }

.macros { display: grid; gap: 6px; }
.macros li {
  display: grid;
  grid-template-columns: 4.2rem 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}
.macros span:first-child { color: var(--wv-text-muted); }
.macros b { height: 6px; border-radius: 999px; background: var(--wv-skeleton); overflow: hidden; }
.macros b i { display: block; height: 100%; border-radius: inherit; }
.macros .m-p i { background: var(--wv-cyan); }
.macros .m-f i { background: var(--wv-amber); }
.macros .m-c i { background: var(--wv-carb); }
.macros u { text-decoration: none; font-variant-numeric: tabular-nums; }

.sect__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wv-text-muted);
  margin-bottom: 8px;
}
/* Компактные чипы (waitervoice-bcf.8): мельче и плотнее, идут в поток по
   ширине карточки. Бейджи — отдельным блоком под ингредиентами (bcf.12). */
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips span {
  background: var(--wv-cyan-50);
  color: var(--wv-navy);
  border-radius: var(--wv-r-chip);
  padding: 3px 9px;
  font-size: 11.5px;
  line-height: 1.3;
  font-weight: 700;
}
.chips span.badge { background: var(--wv-skeleton); }
.dish__ings { font-size: 15px; font-weight: 450; line-height: 1.5; }
/* Футер карточки: цена слева, «в корзину» справа (waitervoice-bcf.9). */
.dish__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dish__price { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dish__basket { flex-shrink: 0; }
.basket__add {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--wv-cyan);
  color: var(--wv-navy);            /* §4.2 — navy на cyan, не белый */
  box-shadow: var(--wv-glow-cyan);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--wv-t-fast);
}
.basket__add:active { transform: scale(0.92); }
.basket__step {
  display: flex; align-items: center;
  height: 44px;
  border-radius: var(--wv-r-chip);
  background: var(--wv-cyan-50);
  border: 1px solid var(--wv-cyan-100);
}
.basket__btn {
  width: 44px; height: 44px;
  border: 0; background: none;
  color: var(--wv-navy);
  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-cyan-100); }
.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; }
.basket__add:focus-visible, .basket__btn:focus-visible { outline: 2px solid var(--wv-cyan-ink); 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 { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.catcard__title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.catcard__count {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--wv-text-muted);
  flex-shrink: 0;
}
.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: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 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-cyan); outline-offset: -2px; border-radius: var(--wv-r-tag); }
.catrow__photo {
  width: 56px;
  height: 56px;
  border-radius: var(--wv-r-tag);
  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: 700;
  line-height: 1.3;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.catrow__meta { font-size: 13px; font-weight: 700; color: var(--wv-text-muted); margin-top: 2px; }
.catrow__price {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.cart { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.cart__title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.cart__table { font-size: 15px; color: var(--wv-text-muted); margin-top: 2px; }
.cart__items { display: flex; flex-direction: column; gap: 10px; }
/* Строка корзины (waitervoice-bcf.14): N × [миниатюра] имя … сумма. */
.cart__pick,
.orders__pick {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0; border: 0; background: none; text-align: start;
  font: inherit; font-size: 17px; color: inherit; cursor: pointer;
}
.cart__qty,
.orders__qty { flex-shrink: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart__thumb,
.orders__thumb {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--wv-r-tag);
  object-fit: cover;
  background: var(--wv-skeleton);
}
.cart__name,
.orders__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cart__sum,
.orders__sum { flex-shrink: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart__pick:active,
.orders__pick:active { opacity: 0.6; }
.cart__pick:focus-visible,
.orders__pick:focus-visible { outline: 2px solid var(--wv-cyan); outline-offset: 2px; border-radius: var(--wv-r-tag); }
.cart__note,
.orders__note { font-size: 15px; color: var(--wv-text-muted); margin-top: 2px; }
.cart__sep,
.orders__sep { height: 1px; background: var(--wv-border); }
.cart__total,
.orders__total { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; font-weight: 700; }
.cart__total b,
.orders__total b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

.cta {
  min-height: 52px;
  border: 0;
  border-radius: var(--wv-r-chip);
  background: var(--wv-cyan);
  color: var(--wv-navy);         /* §4.2 — navy на cyan, не белый */
  font-size: 17px;
  font-weight: 700;
  box-shadow: var(--wv-glow-cyan);
  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; }
.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); }

/* ---------- Карточка истории заказов (§8.6.3a, waitervoice-xc1) ---------- */

.orders { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.orders__title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.orders__table { font-size: 15px; color: var(--wv-text-muted); margin-top: 2px; }
.orders__items { display: flex; flex-direction: column; gap: 10px; }
.orders__block { display: flex; flex-direction: column; gap: 8px; }
.orders__head { display: flex; justify-content: space-between; align-items: center; }

/* waitervoice-nyp.2.3: segmented Mine / Whole-table control. Sits
   flush with the title row, same chip tokens as the existing
   `.orders__status`. Tabs are 32px tall (≥ 44px touch zone with
   padding), the active tab gets the accent color. */
.orders__view {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 2px;
  border-radius: var(--wv-r-chip);
  background: var(--wv-bg-elev);
  border: 1px solid var(--wv-border);
}
.orders__view button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 6px 14px;
  min-height: 32px;
  border-radius: calc(var(--wv-r-chip) - 4px);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}
.orders__view button[aria-selected="true"] {
  background: var(--wv-cyan);
  color: var(--wv-bg);
}
.orders__view button:focus-visible {
  outline: 2px solid var(--wv-cyan);
  outline-offset: 2px;
}

/* waitervoice-nyp.2.3: per-guest divider in Whole-table view. Same
   visual weight as `.orders__head`, with a top margin that collapses
   for the first part. */
.orders__guest {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 16px;
  font-weight: 700;
}
.orders__guest:not(:first-child) {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--wv-border);
}
.orders__no {
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--wv-text-muted);
}
.orders__status {
  display: inline-flex; gap: 4px; align-items: center;
  padding: 2px 10px;
  border-radius: var(--wv-r-chip);
  background: var(--wv-cyan-50);
  color: var(--wv-cyan-ink);
  font-size: 13px; font-weight: 700;
}
.orders__subtotal {
  align-self: flex-end;
  font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.orders__empty {
  font-size: 15px; font-weight: 450; line-height: 1.5;
  color: var(--wv-text-muted);
}

.cart__done {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px;
  border-radius: var(--wv-r-chip);
  background: var(--wv-cyan-50);
  color: var(--wv-cyan-ink);
  font-size: 17px; font-weight: 700;
}

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

.hint {
  flex: 0 0 0;
  min-height: 0;   /* иначе пустой слот держал ~8px по высоте содержимого (bcf.5) */
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Раскрывается только пока реально что-то показано (UI.setHint) —
   пустой слот больше не отъедает место у карусели (§5.5). */
.hint:has(span.is-on) { flex: 0 0 24px; }
.hint span {
  background: var(--wv-white);
  border: 1px solid var(--wv-cyan-100);
  box-shadow: var(--wv-shadow-sm);
  border-radius: var(--wv-r-chip);
  padding: 3px 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--wv-text-muted);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--wv-t-card), transform var(--wv-t-card);
}
.hint span.is-on { opacity: 1; transform: none; }

.bar {
  position: relative;
  /* waitervoice-bcf.14: центр кнопки mic от низа бара (padding-bottom 12px
     + половина кнопки) и половина зазора боковых колонок. Верхний элемент
     колонки кончается на --side-gap выше опорной линии --side-c, нижний
     начинается на --side-gap ниже. --side-c = центр mic, опущенный на 10px:
     иначе корзина/динамик наезжают на точки карусели (bcf.15). */
  --mic-c: calc(12px + var(--wv-btn-size) / 2);
  --side-c: calc(var(--mic-c) - 10px);
  --side-gap: 6px;
  /* 4px над кнопкой (было 12) и по-прежнему 12px под ней — зазор между
     точками карусели и кнопкой вдвое меньше (waitervoice-bcf.5). */
  flex: 0 0 calc(var(--wv-btn-size) + 16px);
  padding-bottom: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* Кнопка §5.1-§5.3 */
.mic {
  position: relative;
  width: var(--wv-btn-size);
  height: var(--wv-btn-size);
  border-radius: 50%;
  border: 1.5px solid var(--wv-border-strong);
  background: var(--wv-white);
  color: var(--wv-text-muted);
  box-shadow: var(--wv-shadow);
  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);
}
/* Расширенная зона нажатия — 67px (≥44px), визуальный размер не меняется */
.mic::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; }

/* Кольцо вокруг кнопки — носитель анимаций (§5.1) */
.ring {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  pointer-events: none;
}
.ring--breath {
  border: 1.5px solid rgba(0, 198, 248, 0.4);
  background: radial-gradient(circle, rgba(0, 198, 248, 0.12) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--wv-t-base);
}
.ring--trace {
  background: conic-gradient(from 0deg, transparent 0 75%, var(--wv-cyan) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  opacity: 0;
}
/* width/height обязательны: у <canvas> есть собственный размер, и при
   width:auto он побеждает inset:0 — холст вылезал из кнопки. */
.mic canvas { position: absolute; inset: 0; width: 100%; height: 100%;
              border-radius: 50%; pointer-events: 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="idle"] .ring--breath { opacity: 1; animation: wv-breathe 4.5s ease-in-out infinite; }
.app[data-state="connecting"] .ring--trace { opacity: 1; animation: wv-spin 1.1s linear infinite; }
.app[data-state="connecting"] .mic { color: var(--wv-dim); }

.app[data-state="recording"] .mic {
  background: var(--fill-cyan);
  border-color: transparent;
  color: var(--wv-navy);
  box-shadow: var(--wv-glow-cyan);
}
.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); }

/* Shimmer поверх amber-заливки §5.4.4 */
.shimmer {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(255, 255, 255, 0.35) 25%, transparent 50%);
  opacity: 0;
  pointer-events: none;
}
.app[data-state="processing"] .shimmer { opacity: 1; animation: wv-spin 2.8s linear infinite; }

/* Три точки глифа 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-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.06); opacity: 0.75; }
}
@keyframes wv-spin { to { transform: rotate(360deg); } }
@keyframes wv-fade-dot { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* Индикатор состояния §6 — по нижнему краю круглой кнопки, а не по
   центру .bar (кнопка визуально тяжелее и тянет взгляд вниз). */
.status {
  position: absolute;
  inset-inline-start: var(--side-x);
  /* 44px зона нажатия; центр — на центре плашки языка справа (bcf.14) */
  bottom: calc(var(--side-c) - var(--side-gap) - 33px);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; background: none;
}
.status__dot {
  width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--wv-dim);
  transition: background var(--wv-t-base), width var(--wv-t-fast), height var(--wv-t-fast);
}
.status__halo {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 999px;
  border: 1.5px solid var(--wv-dim);
  opacity: 0;
}
.app[data-state="connecting"] .status__halo { opacity: 1; animation: wv-halo 1.1s ease-out infinite; }
@keyframes wv-halo {
  from { transform: scale(1); opacity: 1; }
  to   { transform: scale(1.6); opacity: 0; }
}
.app[data-state="recording"] .status__dot { background: var(--wv-cyan-ink); }
.app[data-state="processing"] .status__dot { background: var(--wv-amber-ink); animation: wv-fade-dot 1.4s ease-in-out infinite; }
.app[data-state="disabled"] .status__dot,
.app[data-state="ended"] .status__dot { background: var(--wv-coral); }

/* speaking — три полоски вместо точки (форма, а не только цвет) */
.status__bars { position: absolute; display: none; align-items: center; gap: 2px; height: 14px; }
.status__bars i { width: 3px; border-radius: 2px; background: var(--wv-navy); height: 4px; }
.app[data-state="speaking"] .status__bars { display: flex; }
.app[data-state="speaking"] .status__dot { display: none; }

/* Чип языка §7 — тот же нижний край, что у .status (см. комментарий там) */
.lang {
  position: absolute;
  inset-inline-end: calc(var(--wv-gutter) + 20px);
  /* нижний элемент правой колонки (bcf.14) */
  bottom: calc(var(--side-c) - var(--side-gap) - 22px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 28px; height: 22px;
  padding: 0 7px;
  border: 0;
  border-radius: var(--wv-r-tag);
  background: var(--wv-skeleton);
  color: var(--wv-dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  transition: background var(--wv-t-base), color var(--wv-t-base);
}
.lang.is-detected { background: var(--wv-cyan-50); color: var(--wv-cyan-ink); }
.lang.is-locked { background: var(--wv-cyan-100); color: var(--wv-cyan-ink); }
.lang svg { width: 12px; height: 12px; display: none; }

/* Верхние элементы боковых колонок (waitervoice-bcf.14): динамик слева,
   корзина справа — над статусом и языком. Центр по горизонтали совпадает
   с центром элемента под ним. */
.cart-jump, .audio-toggle {
  position: absolute;
  bottom: calc(var(--side-c) + var(--side-gap));
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; background: none;
  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-cyan); outline-offset: 2px; border-radius: 50%; }
.audio-toggle { inset-inline-start: var(--side-x); color: var(--wv-text-muted); }
.cart-jump {
  inset-inline-end: var(--side-x);
  color: var(--wv-text-muted);
  opacity: 0.35;
}
.cart-jump.is-full { opacity: 1; color: var(--wv-cyan-ink); }
/* Число порций в заказе (waitervoice-bcf.14) — кружок у правого верхнего
   угла иконки корзины. */
.cart-jump__n {
  position: absolute;
  top: 2px;
  inset-inline-end: 0;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--wv-cyan-ink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--wv-white);
}
.cart-jump__n[hidden] { display: none; }
.lang.is-locked svg { display: block; animation: wv-card-in var(--wv-t-fast) both; }

/* ---------- Полноэкранные состояния §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:
    radial-gradient(22rem 18rem at 50% 100%, rgba(0, 198, 248, 0.16), transparent 70%),
    linear-gradient(180deg, var(--wv-white) 0%, var(--wv-bg-soft) 45%, #eef7fd 100%);
}
.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-in var(--wv-t-slow) both; }
.sheet h2 { font-size: 20px; font-weight: 800; }
.sheet p { font-size: 17px; color: var(--wv-text-muted); }
@keyframes wv-sheet-in {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

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

.toast {
  /* absolute относительно .app (не fixed от вьюпорта) и bottom считаем
     от фактической высоты .bar, а не от произвольной константы — так
     пузырь всегда садится вплотную над кнопкой, а не поверх неё.
     Раньше (bottom: btn-size+56) оба размера были независимы от
     реальной высоты .bar и при высоте вьюпорта помельче/побольше могли
     перекрыть верх кнопки — поймано вживую при замере зазора. */
  position: absolute;
  inset-inline: 0;
  bottom: calc(var(--wv-app-pad-bottom) + env(safe-area-inset-bottom) + var(--wv-btn-size) + 16px);
  z-index: 25;
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--wv-t-base);
}
.toast.is-on { opacity: 1; }
.toast span {
  background: var(--wv-navy);
  color: var(--wv-white);
  border-radius: var(--wv-r-chip);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
}

/* ---------- 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` без правок: это утверждённый
   вид, и любое расхождение с прототипом было бы отдельным решением.
   `.chat > .langpop:first-child { margin-block: auto }` — прижимает
   popup к центру свободного места карточки, история уезжает вниз. */

.langpop {
  flex: none;
  margin: 0 0 4px;
  padding: 16px;
  border-radius: 18px;
  background: var(--wv-cyan-50);
  border: 1px solid var(--wv-cyan-100);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: wv-card-in var(--wv-t-card) both;
}
/* Popup — по центру свободного места карточки; история под ним прижата к низу. */
.chat > .langpop:first-child { margin-block: auto; }
.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-cyan-ink);
  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-cyan-ink);
}
.langpop__listen { display: flex; align-items: center; gap: 4px; height: 24px; }
.langpop__listen i {
  width: 4px; border-radius: 2px; background: var(--wv-cyan);
  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 } }
.langpop__timer { margin-inline-start: auto; font-size: 13px; font-weight: 700; color: var(--wv-text-muted); font-variant-numeric: tabular-nums; }

/* «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-cyan-100);
}
.langpop__bar i {
  display: block; height: 100%; border-radius: inherit;
  background: var(--wv-cyan); 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, корзина, «домой», чип — неактивны. */
.app.is-onboarding .mic { color: var(--wv-dim); border-color: var(--wv-border); box-shadow: var(--wv-shadow-sm); }
.app.is-onboarding .ring--breath { opacity: 0 !important; animation: none !important; }
.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; }

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

@media (prefers-reduced-motion: reduce) {
  .carousel { scroll-behavior: auto; }
  .ring--breath { animation: none !important; }
  .ring--trace { animation: none !important; opacity: 1; }
  .app[data-state="connecting"] .ring--trace { animation: wv-pulse 1.6s ease-in-out infinite !important; }
  .shimmer { 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 { animation: none; }
  @keyframes wv-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.75; } }
}
