:root {
  --paper: #faf6ef;
  --card: #fffdf8;
  --ink: #26251f;
  --ink-soft: #6d685c;
  --blue: #5b6b91;
  --blue-deep: #47567a;
  --blue-tint: #edeff4;
  --line: #e6dfd0;
  --radius: 14px;
}

* { box-sizing: border-box; }

/* атрибут hidden сильнее любых display у элемента */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
a:hover { color: var(--blue-deep); }

/* ---------- полоса прокрутки ---------- */

/* На телефонах и на Mac с трекпадом полоса накладная: видна только пока крутят.
   С мышью и на Windows она классическая, торчит всегда и занимает место: рядом с фото
   в карточке получалась пустая кромка. Для таких app.js ставит html.sb-overlay: нативную
   полосу страницы, окон и чата с официантом прячем совсем, а ползунок .sb-thumb рисуем
   сами. Он появляется при прокрутке, через секунду гаснет, тянется мышью. */
html.sb-overlay,
.sb-overlay :is(body, dialog, .waiter-messages) { scrollbar-width: none; }
html.sb-overlay::-webkit-scrollbar,
.sb-overlay :is(body, dialog, .waiter-messages)::-webkit-scrollbar { display: none; }
.sb-overlay .waiter-messages { position: relative; } /* ползунок отсчитывается от самого чата, а не от окна */

.sb-thumb {
  position: absolute; /* внутри прокрутки: сдвиг на scrollTop считает скрипт, окно само обрезает его по скруглению */
  top: 0;
  right: 0;
  z-index: 5;
  box-sizing: border-box;
  width: 11px; /* видимые 5px плюс прозрачные поля, чтобы было за что взяться мышью */
  height: 0;
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(24, 32, 54, 0.3);
  background-clip: padding-box;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.sb-thumb.shown {
  opacity: 1;
  pointer-events: auto;
}
body > .sb-thumb {
  position: fixed; /* у страницы: от края окна браузера */
  z-index: 40;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  text-align: center;
  padding: 64px 20px 46px;
  color: var(--cream, #f6f1e6);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  /* под видео плёнка лёгкая: затемняем только края под логотип и адрес, середину почти не трогаем */
  background:
    linear-gradient(180deg, rgba(24, 32, 54, 0.34) 0%, rgba(24, 32, 54, 0.12) 40%, rgba(24, 32, 54, 0.16) 65%, rgba(24, 32, 54, 0.5) 100%);
}

.hero > :not(.hero-bg):not(.hero-scrim):not(.lang) { position: relative; }

.lang {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 4px;
}

/* ---------- переключатель языка: таблетка по содержимому + своё меню ---------- */

.lang-switch { position: relative; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 600 13px/1 "Manrope", sans-serif;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 0 12px 0 14px;
  min-height: 38px;
  cursor: pointer;
}

/* в шапке — светлая на фото */
.lang .lang-btn {
  color: #f6f1e6;
  background: rgba(24, 32, 54, 0.35);
  border: 1px solid rgba(246, 241, 230, 0.7);
}

/* в липкой полосе категорий — как чип категории */
.cat-lang .lang-btn {
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  min-height: 40px;
}

.lang-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 176px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(24, 32, 54, 0.18);
}

.lang-menu button {
  width: 100%;
  text-align: left;
  font: 500 14px/1.2 "Manrope", sans-serif;
  color: var(--ink);
  background: none;
  border: none;
  border-radius: 9px;
  padding: 10px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.lang-menu button.active {
  background: var(--blue-tint);
  font-weight: 600;
}

.lang-menu button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

@media (hover: hover) {
  .lang-menu button:hover { background: var(--blue-tint); }
}

.logo-script {
  width: 230px;
  max-width: 64vw;
  display: block;
  margin: 26px auto 2px;
  filter: drop-shadow(0 2px 12px rgba(24, 32, 54, 0.45));
}

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

.hero-sub {
  margin: 0;
  color: rgba(246, 241, 230, 0.88);
  font-size: 15px;
}

.hero-addr {
  margin: 18px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(246, 241, 230, 0.65);
}

/* ---------- category nav ---------- */

/* липкая полоса: категории прокручиваются, переключатель языка справа стоит на месте */
.cat-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

/* фильтры — плавающий кружок в левом нижнем углу, зеркально AI-официанту */
.prefs-fab {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(24, 32, 54, 0.22);
  cursor: pointer;
  transition: transform 0.12s ease, bottom 0.28s ease;
}

.prefs-fab:active { transform: scale(0.95); }

.prefs-fab.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.prefs-fab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

body.has-cart-bar .prefs-fab { bottom: calc(78px + env(safe-area-inset-bottom)); }

/* на десктопе фильтры — чип в полосе категорий, размером с чипы; кружок внизу скрыт */
.prefs-btn {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px 0 13px;
  font: 600 13.5px/1 "Manrope", sans-serif;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.prefs-btn.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.prefs-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (min-width: 720px) {
  .prefs-fab { display: none; }
  .prefs-btn { display: inline-flex; }
}

/* строка-напоминание под полосой: что включено, и крестик сбросить */
.prefs-strip {
  margin: 0;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--blue-tint);
}

.prefs-strip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
}

/* неподходящие блюда гаснут, но остаются на месте */
.dish.dish-dim { opacity: 0.38; }
.dish.dish-dim .dish-photo { filter: saturate(0.6); }

/* шторка предпочтений */
.prefs-body .prefs-sub {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 14px;
}

.pref-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 2px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
}

.pref-row:last-child { border-bottom: 1px solid var(--line); }
.pref-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.pref-row > span:first-of-type { flex: 1 1 auto; }

.pref-switch {
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background 0.18s ease;
}

.pref-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(24, 32, 54, 0.3);
  transition: transform 0.18s ease;
}

.pref-row input:checked ~ .pref-switch { background: var(--blue); }
.pref-row input:checked ~ .pref-switch::after { transform: translateX(18px); }
.pref-row input:focus-visible ~ .pref-switch { outline: 2px solid var(--blue); outline-offset: 2px; }

.prefs-hint {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

/* язык в полосе — кружок «RU»; появляется, когда шапка ушла вверх, до этого места не занимает */
.cat-lang {
  flex: 0 0 auto;
  width: 0;
  margin-left: -10px; /* съедаем gap полосы, пока скрыт */
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: width 0.2s ease, margin-left 0.2s ease, opacity 0.2s ease;
}

.cat-lang.show {
  width: 40px;
  margin-left: 0;
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
}

.cat-bar.lang-shown .cat-scroll { margin-right: 0; }

/* зона нажатия кружка шире видимой: 52px при 40px кружке */
.cat-lang .lang-btn { position: relative; }
.cat-lang .lang-btn::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
}

/* на телефоне — кружок «RU» */
.cat-lang .lang-btn {
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  justify-content: center;
  font-size: 12px;
  border-radius: 50%;
}

/* на десктопе — таблетка «RU ▾» размером с чипы */
@media (min-width: 720px) {
  .cat-lang.show { width: auto; }
  .cat-lang .lang-btn {
    width: auto;
    min-height: 40px;
    height: auto;
    padding: 0 12px 0 14px;
    font-size: 13px;
    border-radius: 999px;
  }
  .cat-lang .lang-btn svg { display: inline; }
}

.cat-lang .lang-btn svg { display: none; }

/* обёртка не прокручивается — на ней затухание краёв работает и в Safari
   (на самом прокручиваемом элементе Safari двигает маску вместе с содержимым) */
.cat-scroll {
  flex: 1 1 auto;
  min-width: 0;
  /* чипы на всю ширину экрана, полоса прокручивается от края до края;
     когда справа показан язык, полоса заканчивается перед ним и чипы тают до кружка */
  margin: 0 -16px;
  transition: margin-right 0.2s ease;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 36px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 36px), transparent 100%);
}

.cat-nav {
  position: relative; /* offsetLeft чипов считается от самой полосы, а не от липкого контейнера */
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  scroll-padding-left: 16px;
  scrollbar-width: none;
}


/* на телефоне чипы компактнее, чтобы помещалось два-три */
@media (max-width: 639px) {
  .cat-nav a {
    font-size: 13px;
    padding: 9px 13px;
    min-height: 38px;
  }
}

.cat-nav::-webkit-scrollbar { display: none; }

.cat-nav a {
  flex: 0 0 auto;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 15px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.cat-nav a.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

/* ---------- menu ---------- */

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px 32px;
}

.cat-section { padding-top: 18px; }

.cat-section h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 27px;
  font-weight: 600;
  margin: 10px 0 12px;
  scroll-margin-top: 64px;
}

/* гравюрная линейка после названия категории */
.cat-section h2::after {
  content: "";
  flex: 1;
  height: 5px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  opacity: 0.9;
}

.dish-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dish {
  display: flex;
  gap: 14px;
  align-items: stretch;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.dish:active { background: var(--blue-tint); }

@media (hover: hover) {
  .dish {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  }
  .dish:hover {
    border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
    box-shadow: 0 6px 22px rgba(24, 32, 54, 0.08);
    transform: translateY(-2px);
  }
  .cat-nav a { transition: border-color 0.15s ease, color 0.15s ease; }
  .cat-nav a:hover:not(.active) { border-color: var(--blue); color: var(--blue); }
}

.dish-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dish-name {
  font-weight: 700;
  font-size: 15px;
  margin: 0;
}

.badge-new {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--blue);
  background: var(--blue-tint);
  border-radius: 999px;
  padding: 3px 7px;
}

.badge-diet {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #3e6b3f;
  background: #ecf3e8;
  border-radius: 999px;
  padding: 4px 9px;
}

.diet-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.dish-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish-price {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--blue);
  font-size: 14.5px;
}

.dish-photo {
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--blue-tint);
}

/* ---------- dialog ---------- */

dialog {
  border: none;
  border-radius: 18px 18px 0 0;
  padding: 0;
  width: 100%;
  max-width: 640px;
  margin: auto auto 0;
  /* не выше видимой области: на iPhone 100% считается с адресной строкой, и верх уезжал за экран */
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 -18px 50px rgba(24, 32, 54, 0.35);
}

dialog[open] { animation: sheet-up 0.28s ease; }

@keyframes sheet-up {
  from { transform: translateY(28px); opacity: 0; }
}

dialog::backdrop {
  background: rgba(24, 32, 54, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* на телефоне карточка блюда — на весь экран, без щели с подложкой сайта сверху */
@media (max-width: 639px) {
  #dish-dialog {
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }
}

@media (min-width: 640px) {
  dialog {
    border-radius: 18px;
    margin: auto;
    box-shadow: 0 24px 60px rgba(24, 32, 54, 0.4);
  }
}

.dialog-close {
  position: absolute;
  z-index: 2; /* поверх галереи */
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(250, 246, 239, 0.9);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

/* верхний ряд карточки: язык и крестик прилипают к верху и не уезжают при прокрутке описания */
.dialog-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px;
  margin-bottom: -68px; /* не занимает высоту: галерея идёт сразу под ним */
  pointer-events: none;
}

.dialog-top > * { pointer-events: auto; }

#dish-dialog .dialog-close { position: static; }

/* переключатель языка в карточке — компактный, в одной стилистике с крестиком */
.dialog-top .lang-btn {
  min-height: 34px;
  padding: 0 10px 0 12px;
  font-size: 12px;
  color: var(--ink);
  background: rgba(250, 246, 239, 0.88);
  border: none;
}

#dish-dialog .dialog-close {
  width: 40px;
  height: 40px;
  background: rgba(250, 246, 239, 0.88);
}

.dialog-close:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.dialog-photo {
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 44vh;
  object-fit: cover;
  display: block;
}

/* ---------- галерея карточки ---------- */

.gallery {
  position: relative;
  background: #1a1e2a;
  overflow: hidden;
}

.gallery-track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  /* на телефоне — «инстаграмный» портрет 4:5 от ширины окна (окно во всю ширину экрана).
     Не aspect-ratio + max-height: Safari переносит max-height на ширину, и кадр сужается */
  height: min(125vw, 62vh);
}

.gallery-track::-webkit-scrollbar { display: none; }

.gallery-slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}

.gallery-bg {
  position: absolute;
  inset: -32px;
  background-size: cover;
  background-position: center;
  filter: blur(26px) brightness(0.65);
}

/* кадр заполняет окно целиком и режется по центру — как в инсте, одинаково на телефоне и компе */
.gallery-media {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.gallery-bg { display: none; }

/* горизонтальный кадр в вертикальном окне резался бы по бокам — его показываем целиком на размытом фоне */
.gallery-slide.landscape .gallery-media { object-fit: contain; }
.gallery-slide.landscape .gallery-bg { display: block; }

@media (min-width: 640px) {
  .gallery-track { height: min(540px, 62vh); }
}

.gallery-arrow {
  position: absolute;
  top: calc((100% - 76px) / 2); /* центр большого кадра без ленты превью (60px + отступы) */
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: none;
  border-radius: 999px;
  background: rgba(250, 246, 239, 0.9);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.gallery-arrow.prev { left: 12px; }
.gallery-arrow.next { right: 12px; }
.gallery-arrow[hidden] { display: none; }
.gallery-arrow:focus-visible { opacity: 1; outline: 2px solid var(--blue); outline-offset: 2px; }

@media (hover: hover) {
  .gallery:hover .gallery-arrow { opacity: 1; }
  .gallery-arrow:hover { transform: scale(1.06); }
}

/* на тач-экране наведения нет — маленькие стрелки видны всегда, подсказывают, что можно листать */
@media (hover: none) {
  .gallery-arrow {
    opacity: 0.85;
    width: 34px;
    height: 34px;
    margin-top: -17px;
  }
  .gallery-arrow svg { width: 18px; height: 18px; }
  .gallery-arrow.prev { left: 10px; }
  .gallery-arrow.next { right: 10px; }
}

/* лента превью под большим кадром: видно, сколько кадров и что на них */
.gallery-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--card);
}

.gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: var(--blue-tint);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb.active {
  opacity: 1;
  border-color: var(--blue);
}

.gallery-thumb:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (hover: hover) {
  .gallery-thumb:hover { opacity: 1; }
}

.gallery-thumb-play {
  position: absolute;
  right: 3px;
  bottom: 3px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

@media (min-width: 640px) {
  .gallery-thumb { width: 72px; height: 72px; }
  .gallery-arrow { top: calc((100% - 88px) / 2); }
}

.dialog-info { padding: 18px 20px 12px; }

/* карточка без фото: название ниже верхнего ряда с языком и крестиком */
.dialog-info.no-media { padding-top: 68px; }

.dialog-info h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 6px;
}

.dialog-info p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* строка аллергенов — спокойная, в тон весу: информация, а не предупреждение */
.dialog-info .dialog-allergens {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: -6px 0 12px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.9;
}

.dialog-info .dialog-allergens svg { flex: 0 0 auto; margin-top: 1px; opacity: 0.8; }
.dialog-info .dialog-allergens b { font-weight: 600; }

.dialog-info .dialog-weight {
  margin: -6px 0 12px;
  color: var(--ink-soft);
  font-size: 13px;
}

.dialog-price {
  font-weight: 700;
  font-size: 18px;
  color: var(--blue);
}

/* ---------- корзина ---------- */

/* квадрат 108px внутри рамки карточки, по центру по высоте; «+» чуть выступает за угол фото */
.dish-photo-wrap {
  position: relative;
  flex: 0 0 108px;
  align-self: center;
}

.dish-photo-wrap .dish-photo {
  width: 100%;
  height: 108px;
  display: block;
}

.dish-add {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 38px;
  height: 38px;
  border: 2.5px solid var(--card);
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(24, 32, 54, 0.28);
  transition: transform 0.12s ease, background 0.12s ease;
}

.dish-add:active { transform: scale(0.88); }

@media (hover: hover) {
  .dish-add:hover { transform: scale(1.08); background: var(--blue-deep); }
  .dish-add:hover:active { transform: scale(0.92); }
}

.dish-add-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--paper);
  border: 1.5px solid var(--blue);
  color: var(--blue);
  font: 700 11px/16px "Manrope", sans-serif;
  text-align: center;
}

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.dish-add-count.bump,
.cart-bar .bump { animation: bump 0.3s ease; }

/* карточка без фото — кнопка в правом нижнем углу карточки */
.dish-add-inline {
  position: absolute;
  right: 12px;
  bottom: 12px;
}

.dish { position: relative; }

.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
  transform: translateY(130%);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1), opacity 0.2s ease;
}

.cart-bar.visible {
  transform: translateY(0);
  opacity: 1;
}

.cart-bar button {
  pointer-events: auto;
  width: 100%;
  max-width: 480px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: 700 15px/1 "Manrope", sans-serif;
  padding: 0 22px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(24, 32, 54, 0.35);
}

.cart-bar button span:last-child { margin-left: auto; }

body.has-cart-bar .site-footer { padding-bottom: 96px; }

/* официант принял заказ или очистил корзину: строка внизу на 6 секунд, над полосой корзины, если она есть */
.cart-notice {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  /* строка показывается как popover (поверх модальных окон): снимаем его стандартные отступы, рамку и растяжку */
  top: auto;
  right: auto;
  margin: 0;
  border: 0;
  height: auto;
  overflow: visible;
  z-index: 21;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: 600 14px/1.3 "Manrope", sans-serif;
  text-align: center;
  box-shadow: 0 10px 30px rgba(24, 32, 54, 0.3);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
  pointer-events: none;
}
.cart-notice.visible { transform: translate(-50%, 0); opacity: 1; }
body.has-cart-bar .cart-notice { bottom: calc(84px + env(safe-area-inset-bottom)); }

.cart-body { padding: 20px 20px 24px; }

.cart-body h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 4px;
}

.cart-table {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cart-empty { color: var(--ink-soft); margin: 18px 0; }

/* строка корзины на телефоне: фото слева, название во всю ширину, под ним степпер и сумма —
   в одну строку с фото длинному названию осталась бы полоска в пару слов */
.cart-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  grid-template-areas:
    "photo name name"
    "photo qty sum";
  align-items: center;
  gap: 6px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

/* на широком экране места хватает — всё в одну строку */
@media (min-width: 640px) {
  .cart-row {
    grid-template-columns: 60px minmax(0, 1fr) auto auto;
    grid-template-areas: "photo name qty sum";
  }
}

.cart-row-photo {
  grid-area: photo;
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--blue-tint);
}

/* на телефоне строка выше фото (название, пожелание, степпер): фото к верху, вровень с первой
   строкой названия; 2px — под высоту букв в строке */
@media (max-width: 639px) {
  .cart-row-photo { align-self: start; margin-top: 2px; }
}

.cart-row-name { grid-area: name; min-width: 0; font-weight: 600; font-size: 14px; line-height: 1.3; }

.cart-row .stepper { grid-area: qty; justify-self: start; }

.cart-row-sum {
  grid-area: sum;
  min-width: 84px;
  text-align: right;
  font-weight: 700;
  color: var(--blue);
  font-size: 14px;
}

.stepper {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--blue-tint);
  border-radius: 999px;
}

.stepper button {
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  color: var(--blue);
  font: 700 17px/1 "Manrope", sans-serif;
  cursor: pointer;
}

.stepper span {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

/* нижний отступ корзины даёт панель итога */
#cart-dialog .cart-body { padding-bottom: 0; }

/* итог и кнопки прилипают к низу шторки: длинный заказ прокручивается под ними, как описание
   под панелью покупки в карточке блюда */
.cart-foot {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding: 0 20px calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  transition: box-shadow 0.2s ease;
}

/* тень — только когда под панелью спрятана часть списка (класс ставит app.ts) */
.cart-foot.raised { box-shadow: 0 -10px 24px rgba(24, 32, 54, 0.08); }

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0 14px;
  font-size: 16px;
}

.cart-total-row strong { color: var(--blue); font-size: 19px; }

.cart-order {
  width: 100%;
  min-height: 50px;
  border: none;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: 700 15px/1 "Manrope", sans-serif;
  cursor: pointer;
}

.cart-order:disabled { opacity: 0.45; cursor: default; }

/* второе действие в корзине — «Попросить счёт», контурная кнопка под основной */
.cart-bill {
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--blue);
  font: 600 14px/1 "Manrope", sans-serif;
  cursor: pointer;
}

/* вызов выключен руководителями: вместо «Позвать» и «Счёт» — просьба показать корзину официанту */
.cart-show {
  margin: 0;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: var(--blue-tint);
  color: var(--blue-deep);
  font: 600 15px/1.35 "Manrope", sans-serif;
  text-align: center;
}

/* ---------- шторка «Официант» ---------- */

.staff-table {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 14px;
}

.staff-actions { display: flex; flex-direction: column; gap: 10px; }

.staff-btn {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: 700 15px/1 "Manrope", sans-serif;
  cursor: pointer;
}

.staff-btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.staff-btn.open { border-color: var(--blue); color: var(--blue); }
.staff-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.staff-pay {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.staff-pay .staff-btn { min-height: 46px; font-weight: 600; }

/* статус вызова: точка пульсирует, пока ждём, и становится зелёной, когда приняли */
.staff-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--blue-tint);
}

.staff-status p { margin: 0; flex: 1 1 auto; font-weight: 600; font-size: 14.5px; }

.staff-pulse {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  animation: staff-pulse 1.2s ease-in-out infinite;
}

.staff-pulse.done {
  background: #3e8f4a;
  animation: none;
}

@keyframes staff-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.6); opacity: 0.45; }
}

.staff-link {
  flex: 0 0 auto;
  border: none;
  background: none;
  color: var(--ink-soft);
  font: 600 13px/1 "Manrope", sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px 0;
}

.staff-again {
  margin: 8px 2px 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.staff-closed,
.staff-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fbf3d9;
  color: #6b5416;
  font-size: 14px;
}

.staff-error { background: #f8e3df; color: #7a2e22; margin: 12px 0 0; }

.staff-ai,
.staff-review {
  margin-top: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.staff-ai:not([hidden]) + .staff-review { margin-top: 10px; }

/* отзыв: пять звёзд; при оценке ниже пятёрки под ними поле для текста */
.staff-feedback-q {
  margin: 4px 0 10px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
}

.staff-stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0 0 16px;
}

.staff-stars button {
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: none;
  color: #ddd4c2;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.staff-stars button.on { color: #e0a13a; }
.staff-stars button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.staff-feedback-form { display: flex; flex-direction: column; gap: 10px; }

.staff-feedback-form textarea {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  font: 400 16px/1.4 "Manrope", sans-serif; /* 16px — iPhone не приближает страницу при вводе */
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  resize: vertical;
}

.staff-feedback-form textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.staff-btn:disabled { opacity: 0.45; cursor: default; }

.staff-feedback-done {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--blue-tint);
  font-weight: 600;
  font-size: 14.5px;
}

/* точка на кружке официанта, пока вызов ждёт ответа */
.waiter-fab { position: fixed; }
.waiter-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e0a13a;
  border: 2px solid var(--paper);
  animation: staff-pulse 1.2s ease-in-out infinite;
}

.cart-soon {
  margin: 10px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 12.5px;
}

/* тело карточки растянуто на всё окно, чтобы панель покупки была внизу и у короткого описания */
#dialog-body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

#dialog-body .dialog-info { flex: 1 0 auto; }

/* панель с ценой и «В корзину» прилипает к нижнему краю окна, описание уходит под неё */
.dialog-buy {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--card);
  border-top: 1px solid rgba(24, 32, 54, 0.08);
  box-shadow: 0 -10px 24px rgba(24, 32, 54, 0.08);
}

.dialog-buy .dialog-price { margin: 0; }

/* полоса корзины в карточке блюда: второй строкой под ценой, как полоса внизу страницы */
.dialog-buy { flex-wrap: wrap; }
.dish-cart-btn {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: none;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: 700 15px/1 "Manrope", sans-serif;
  padding: 0 20px;
  cursor: pointer;
}
.dish-cart-btn span:last-child { margin-left: auto; }

.buy-btn {
  min-height: 44px;
  border: none;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: 700 14px/1 "Manrope", sans-serif;
  padding: 0 22px;
  cursor: pointer;
}

/* обязательная опция не выбрана: кнопка подсказывает, что выбрать */
.buy-btn[aria-disabled="true"] {
  background: var(--blue-tint);
  color: var(--ink-soft);
  cursor: default;
  line-height: 1.25;
  padding: 8px 18px;
}

/* ---------- опции блюда: гарнир, вкус, добавки ---------- */

.dish-options { margin-top: 16px; display: grid; gap: 14px; }

.opt-title { margin: 0 0 8px; font-weight: 700; font-size: 14px; }

.opt-hint { margin-left: 8px; font-weight: 500; font-size: 12px; color: var(--ink-soft); }

.opt-values { display: flex; flex-wrap: wrap; gap: 8px; }

.opt-chip {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: 600 14px/1.2 "Manrope", sans-serif;
  cursor: pointer;
}

.opt-chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }

.opt-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.opt-price { margin-left: 6px; font-weight: 500; opacity: 0.75; }

.cart-row-opts { display: block; margin-top: 2px; font-weight: 500; font-size: 12.5px; color: var(--ink-soft); }

/* пожелание к строке корзины: ссылка «+ Добавить пожелание», заполненное — текст с 💬, по тапу — поле */
.cart-row-note-add,
.cart-row-note {
  display: block;
  max-width: 100%;
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
  font: 500 12.5px/1.35 "Manrope", sans-serif;
  cursor: pointer;
}

.cart-row-note-add { color: var(--blue); }

.cart-row-note { color: var(--ink-soft); font-style: italic; overflow-wrap: anywhere; }

/* 16px — иначе iPhone приближает страницу при вводе */
.cart-row-note-input,
.cart-note-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  padding: 0 12px;
  font: 500 16px/1.3 "Manrope", sans-serif;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.cart-row-note-input:focus,
.cart-note-input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

/* поле у блюда с кнопками ✓ и ✕ справа */
.cart-row-note-edit {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.cart-row-note-edit .cart-row-note-input { flex: 1 1 auto; min-width: 0; }

.note-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
}

.note-btn.ok { border-color: var(--blue); background: var(--blue); color: #fff; }

.note-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* пожелание к заказу — под списком, перед итогом; ✓ и ✕ как у поля блюда, пока поле в работе
   (в фокусе или с текстом, класс active ставит app.ts) */
.cart-note { margin: 18px 0 8px; }

.cart-note-label { display: block; font-weight: 600; font-size: 14px; }

.cart-note-field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.cart-note-field .cart-note-input { flex: 1 1 auto; min-width: 0; }

.cart-note-field:not(.active) .note-btn { display: none; }

.cart-note-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-soft); }

/* ---------- черновик меню (ссылка из Telegram) ---------- */

.draft-banner {
  position: sticky;
  top: 0;
  z-index: 11;
  height: 30px;
  padding: 6px 12px;
  background: #b4532a;
  color: #fff;
  font: 700 13px/18px "Manrope", sans-serif;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.draft .cat-bar { top: 30px; }

.draft-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #b4532a;
  color: #fff;
  font: 700 11px/1 "Manrope", sans-serif;
  letter-spacing: 0.08em;
}

/* ---------- атмосферная вставка ---------- */

.mood {
  position: relative;
  margin-top: 26px;
  overflow: hidden;
}

.mood img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: center 30%;
}

/* второй кадр коллажа — только на десктопе */
.mood .mood-b { display: none; }

.mood p {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 32px;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 26px;
  line-height: 1.3;
  color: #f6f1e6;
  background: rgba(24, 32, 54, 0.58);
  text-shadow: 0 2px 12px rgba(24, 32, 54, 0.6);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 26px 20px 40px;
  color: var(--ink-soft);
  font-size: 14px;
}

.footer-address { margin: 0 0 6px; }
.footer-address a { color: inherit; text-decoration: none; }
/* часы работы — строкой под адресом, тем же приглушённым цветом */
.footer-hours { margin: 0 0 12px; }

/* ссылки «иконка + слово» в цвете сайта, без рамок.
   На телефоне — сетка 2×2, чтобы ссылки всегда стояли парами, а не «три и одна» */
.footer-links {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
  column-gap: 22px;
  row-gap: 0;
}

.footer-links a:nth-child(odd) { justify-self: end; }
.footer-links a:nth-child(even) { justify-self: start; }

@media (max-width: 359px) {
  .footer-links { column-gap: 14px; font-size: 14px; }
}

@media (min-width: 640px) {
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 26px;
  }
}

.footer-links a {
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.footer-links a svg { flex: 0 0 auto; opacity: 0.85; }

@media (hover: hover) {
  .footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- десктоп ---------- */

@media (min-width: 720px) {
  .hero { padding: 96px 24px 72px; }
  .logo-script { width: 300px; }
  .hero-sub { font-size: 17px; }

  .cat-bar { padding: 12px 24px; }
  .cat-scroll { margin: 0 -24px; }
  .cat-nav {
    justify-content: safe center;
    padding: 0 24px;
  }

  main {
    max-width: 1060px;
    padding: 12px 32px 56px;
  }

  .cat-section { padding-top: 28px; }
  .cat-section h2 { font-size: 32px; scroll-margin-top: 72px; }

  .dish-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .dish { padding: 14px; }
  .dish-photo-wrap { flex-basis: 120px; }
  .dish-photo-wrap .dish-photo { height: 120px; }

  .mood {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
  .mood img { height: 440px; }
  .mood .mood-b { display: block; object-position: center 60%; }
  .mood p { font-size: 36px; }

  .site-footer { padding: 36px 24px 48px; font-size: 15px; }
}

/* ---------- AI-официант ---------- */

.waiter-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 21;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px 0 14px;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 600 14px/1 "Manrope", sans-serif;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(24, 32, 54, 0.32);
  transition: transform 0.12s ease, bottom 0.28s ease;
}

.waiter-fab:active { transform: scale(0.95); }

body.has-cart-bar .waiter-fab { bottom: calc(78px + env(safe-area-inset-bottom)); }

/* на телефоне — кружок с иконкой, чтобы не занимать экран */
@media (max-width: 719px) {
  .waiter-fab {
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
  .waiter-fab svg { width: 24px; height: 24px; }
  .waiter-fab #waiter-fab-label { display: none; }
}

/* на широком экране корзина по центру, официант в правом углу, оба на одной линии */
@media (min-width: 720px) {
  .cart-bar button {
    max-width: 440px;
    min-height: 50px; /* базовые 52px перебивали height */
    height: 50px;
  }

  /* та же высота, шрифт и тень, что у корзины — читаются как пара */
  .waiter-fab {
    min-height: 50px;
    height: 50px;
    padding: 0 20px 0 16px;
    font: 700 15px/1 "Manrope", sans-serif;
    box-shadow: 0 10px 30px rgba(24, 32, 54, 0.35);
  }

  body.has-cart-bar .waiter-fab { bottom: calc(10px + env(safe-area-inset-bottom)); }
}

.waiter-body {
  display: flex;
  flex-direction: column;
  height: min(78vh, 640px);
  padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
}

.waiter-head { padding: 0 44px 10px 4px; }

.waiter-head h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  margin: 0;
}

.waiter-hint {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.waiter-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overscroll-behavior: contain;
}

.waiter-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.waiter-msg.user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.waiter-msg.bot {
  align-self: flex-start;
  background: var(--blue-tint);
  color: var(--ink);
  border-bottom-left-radius: 5px;
}

.waiter-msg.bot.pending { color: var(--ink-soft); }

.waiter-msg.bot.error { background: #f6e6e2; color: #7a3b2e; }

.waiter-msg p { margin: 0; }
.waiter-msg p + p, .waiter-msg ul + p, .waiter-msg p + ul { margin-top: 8px; }

.waiter-msg ul {
  margin: 0;
  padding-left: 18px;
}

.waiter-msg li { margin: 3px 0; }
.waiter-msg li b { font-weight: 700; }
.waiter-msg li i { color: var(--ink-soft); font-style: italic; }

.waiter-order {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed color-mix(in srgb, var(--blue) 45%, transparent);
}

.waiter-order .waiter-order-title { font-weight: 700; margin-bottom: 4px; }
.waiter-order .waiter-order-total { font-weight: 700; color: var(--blue); margin-top: 6px; }
.waiter-order .waiter-order-note { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }

.waiter-notice {
  margin: 8px 4px 0;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
}

.waiter-composer {
  display: flex;
  gap: 8px;
  padding-top: 10px;
}

.waiter-composer input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 500 15px "Manrope", sans-serif;
}

.waiter-composer input:focus { outline: 2px solid var(--blue); outline-offset: -1px; }

.waiter-composer button {
  flex: 0 0 46px;
  height: 46px;
  border: none;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.waiter-composer button:disabled { opacity: 0.5; cursor: default; }

.waiter-composer #waiter-mic {
  background: var(--blue-tint);
  color: var(--blue);
}

.waiter-composer #waiter-mic .stop-icon { display: none; }

.waiter-composer.recording #waiter-mic {
  background: #c0463c;
  color: #fff;
  animation: rec-pulse 1.2s ease-in-out infinite;
}

.waiter-composer.recording #waiter-mic .mic-icon { display: none; }
.waiter-composer.recording #waiter-mic .stop-icon { display: block; }

.waiter-composer.recording input { color: #c0463c; font-weight: 600; }

/* во время записи стрелка отправки становится отменой: запись сбрасывается без отправки */
.waiter-composer #waiter-send .cancel-icon { display: none; }
.waiter-composer.recording #waiter-send { background: var(--blue-tint); color: var(--ink-soft); }
.waiter-composer.recording #waiter-send .send-icon { display: none; }
.waiter-composer.recording #waiter-send .cancel-icon { display: block; }

@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 70, 60, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(192, 70, 60, 0); }
}

.waiter-reset {
  margin: 8px auto 0;
  border: none;
  background: none;
  color: var(--ink-soft);
  font: 500 12px "Manrope", sans-serif;
  text-decoration: underline;
  cursor: pointer;
}

/* в верхнем ряду карточки: пометка черновика и язык рядом */
#dialog-lang { display: flex; align-items: center; gap: 8px; }
