:root {
  --bg: #0f1420; --surface: #161d2b; --surface2: #1f2839; --line: #2a3346;
  --ink: #eef1f6; --muted: #9aa6bd; --accent: #f59e0b; --accent-ink: #1a1205;
  --ok: #22c55e; --danger: #ef4444; --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px; line-height: 1.4;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-overflow-scrolling: touch;
}
button { font: inherit; cursor: pointer; }

#app { max-width: 560px; margin: 0 auto; padding: 0 14px 90px; min-height: 100vh; }
#app.loading { display: flex; align-items: center; justify-content: center; }
.splash { color: var(--muted); padding: 40vh 20px; text-align: center; }

.m-header {
  padding: 14px 2px 2px; position: sticky; top: 0; background: var(--bg); z-index: 5;
  display: flex; align-items: center; gap: 12px; height: 70px;
}
.m-logo { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; }
.m-brand-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 10px;
  background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.12);
  text-decoration: none; flex: none; line-height: 1;
}
.m-brand-link span:first-child { font-size: 20px; font-weight: 800; color: #111; letter-spacing: -0.3px; }
.m-brand-link span:last-child  { font-size: 20px; font-weight: 900; color: #22c55e; letter-spacing: -0.5px; }
.m-cafe { font-size: 22px; font-weight: 800; }
.m-table { color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 2px; }

.m-empty { color: var(--muted); text-align: center; padding: 40px 10px; }

/* category nav strip */
.m-cats-nav {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 10px;
  position: sticky; top: 70px; z-index: 4; background: var(--bg);
  scrollbar-width: none; -ms-overflow-style: none;
}
.m-cats-nav::-webkit-scrollbar { display: none; }
.m-cats-btn {
  flex: none; background: var(--surface2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.m-cats-btn.active {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}

.m-cat { margin-top: 14px; }
.m-cat-title { font-size: 17px; margin: 6px 2px 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.m-dish {
  display: flex; gap: 12px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 10px;
}
.m-dish-photo { width: 72px; height: 72px; flex: none; border-radius: 10px; object-fit: cover; background: var(--surface2); }
.m-noimg { display: flex; text-align: center; justify-content: space-around; font-size: 45px; color: #fefefe3d; align-items: baseline;}
.m-dish-main { flex: 1; min-width: 0; }
.m-dish-name { font-weight: 600; }
.m-dish-desc { color: var(--muted); font-size: 13px; margin: 2px 0; }
.m-dish-price { font-weight: 700; color: var(--accent); margin-top: 2px; }
.m-dish-ctrl { flex: none; display: flex; align-items: center; gap: 8px; }

.addbtn {
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 10px;
  padding: 9px 12px; font-weight: 700; font-size: 14px; white-space: nowrap;
}
.qbtn {
  width: 34px; height: 34px; border-radius: 9px; border: none; background: var(--surface2);
  color: var(--ink); font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.qbtn:active { background: var(--line); }
.qnum { min-width: 20px; text-align: center; font-weight: 700; }

/* re-order bar */
.rebarbtn {
  width: 100%; background: var(--surface2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 16px; font-size: 14px; font-weight: 600;
  text-align: center; margin: 4px 0 14px; cursor: pointer;
}
.rebarbtn:hover { color: var(--ink); border-color: var(--muted); }

/* cart bar */
.cartbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; width: calc(100% - 28px);
  max-width: 532px; background: var(--accent); color: var(--accent-ink); border: none; border-radius: 14px;
  padding: 15px 18px; font-weight: 800; display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 20;
}

/* subhead / back */
.m-subhead { display: flex; align-items: center; gap: 12px; padding: 16px 0 8px; position: sticky; top: 0; background: var(--bg); }
.m-subhead h2 { margin: 0; font-size: 20px; }
.backbtn { background: var(--surface2); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.backbtn.wide { width: 100%; margin-top: 18px; padding: 13px; font-weight: 600; }

/* cart */
.cart-row { display: flex; align-items: center; gap: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.cart-info { flex: 1; min-width: 0; }
.cart-name { font-weight: 600; }
.cart-price { color: var(--muted); font-size: 13px; }
.cart-comment { display: block; margin: 14px 0; }
.cart-comment span { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.cart-comment textarea {
  width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px; font: inherit; resize: vertical;
}
.cart-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 19px; margin: 8px 2px 14px; }
.sendbtn { width: 100%; background: var(--ok); color: #04210f; border: none; border-radius: 14px;
  padding: 16px; font-weight: 800; font-size: 17px; }
.sendbtn[disabled] { opacity: .7; }
.pay-hint { color: var(--muted); text-align: center; font-size: 13px; margin-top: 12px; }

/* status — прогресс каждой позиции отдельно (единый стиль со staff, см. CLAUDE.md) */
.status-box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px; text-align: left; margin-top: 16px; }
.status-items { list-style: none; padding: 0; margin: 0; }
.status-item { display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--line); }
.status-item:last-child { border-bottom: none; }
.status-item.is-cancelled { opacity: .5; text-decoration: line-through; }
.status-item-emoji { font-size: 22px; flex-shrink: 0; }
.status-item-name { flex: 1; font-size: 15px; }
.status-item-label { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.status-item-note { list-style: none; font-size: 13px; color: var(--muted); padding: 0 0 8px 32px;
  margin-top: -4px; }
.status-hint { color: var(--muted); font-size: 14px; text-align: center; margin-top: 12px; }

/* submitted / order confirmation */
.submitted-box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px; margin-top: 16px; }
.submitted-title { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.submitted-hint { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.submitted-items { list-style: none; padding: 0; margin: 0 0 14px; }
.submitted-items li { display: flex; justify-content: space-between; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.submitted-items li:last-child { border-bottom: none; }
.submitted-total { display: flex; justify-content: space-between; font-weight: 800;
  font-size: 18px; margin: 4px 0 18px; }
/* Скидка стоит НАД итогом и мельче — это пояснение к итогу, не второй итог. */
.submitted-total--discount { font-size: 15px; font-weight: 600; color: var(--accent);
  margin-bottom: 2px; }
.edit-order-hint { color: var(--muted); font-size: 14px; text-align: center; margin: 0 0 8px; }
.edit-order-btn { width: 100%; background: none; border: 1px solid var(--line); color: var(--ink);
  border-radius: 12px; padding: 12px; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.pulse-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 6px; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }

/* toast */
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(20px);
  background: var(--danger); color: #fff; padding: 12px 18px; border-radius: 12px; max-width: 90%;
  text-align: center; opacity: 0; transition: .25s; z-index: 40; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── card design (шаблон «Карточки») ── */
.cards-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 10px;
}
.card-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}
/* Фото — <img>, а не div с background-image: URL картинки приходит из БД,
   и в разметке это был инлайновый style (под CSP style-src). object-fit
   даёт ту же обрезку, что center/cover у фона. Подложка var(--surface2)
   остаётся: она видна, пока картинка грузится, и у .card-nophoto. */
.card-photo {
  width: 100%; aspect-ratio: 4/3; background: var(--surface2); display: block;
  object-fit: cover;
}
.card-nophoto { background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 72px; color: #fefefe3d; }
.card-body { padding: 8px 10px 4px; flex: 1; }
.card-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.card-price { font-weight: 700; color: var(--accent); font-size: 13px; margin-top: 4px; }
.card-foot {
  padding: 6px 8px 8px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-top: 1px solid var(--line);
}
.card-addbtn {
  width: 100%; background: var(--accent); color: var(--accent-ink); border: none;
  border-radius: 8px; padding: 7px 8px; font-weight: 700; font-size: 13px; cursor: pointer;
}

/* ── cards-plus design (шаблон «Карточки плюс») ── */
.cplus-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.cplus-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.cplus-photo {
  width: 100%; aspect-ratio: 16/9; background: var(--surface2); display: block;
  object-fit: cover;
}
.cplus-nophoto {
  display: flex; align-items: center; justify-content: center; font-size: 72px; color: #fefefe3d;
}
.cplus-body { padding: 12px 14px 14px; }
.cplus-name { font-weight: 700; font-size: 17px; line-height: 1.3; }
.cplus-desc { color: var(--muted); font-size: 14px; margin-top: 4px; }
.cplus-extra {
  color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.55;
  border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px;
}
.cplus-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px;
}
.cplus-price { font-weight: 800; font-size: 18px; color: var(--accent); }
.cplus-ctrl { display: flex; align-items: center; gap: 8px; flex: none; }



/* ── browse-only notice ── */
.browse-notice {
  margin: 12px 16px; padding: 12px 16px; border-radius: var(--radius);
  font-size: 14px; line-height: 1.5;
}
.browse-notice--warn {
  background: #7c3a001a; border: 1px solid #c0621066; color: var(--ink);
}

/* ── лист выбора модификаторов ──────────────────────────────────────────────
   Шторка снизу, а не отдельный экран: гость не теряет место в меню, и
   возврат по кнопке «назад» браузера не выбрасывает его из каталога. */
.mod-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
body.mod-open { overflow: hidden; }
.mod-sheet {
  width: 100%; max-width: 560px; background: var(--bg);
  border-radius: 18px 18px 0 0; max-height: 88vh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
  animation: modUp .18s ease-out;
}
@keyframes modUp { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
.mod-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.mod-title { flex: 1; font-weight: 700; font-size: 18px; }
.mod-close {
  flex: none; width: 34px; height: 34px; border-radius: 9px; border: none;
  background: var(--surface2); color: var(--ink); font-size: 17px; line-height: 1;
}
.mod-body { overflow-y: auto; padding: 4px 16px 12px; -webkit-overflow-scrolling: touch; }
.mod-group { padding: 12px 0; border-bottom: 1px solid var(--line); }
.mod-group:last-child { border-bottom: none; }
.mod-group-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.mod-group-name { font-weight: 700; }
.mod-group-rule { color: var(--muted); font-size: 13px; }
.mod-opt {
  display: flex; align-items: center; gap: 10px; padding: 11px 2px;
  border-bottom: 1px solid transparent;
}
.mod-opt input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.mod-opt-name { flex: 1; min-width: 0; }
.mod-opt-price { color: var(--muted); font-size: 14px; white-space: nowrap; }
.mod-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.mod-foot .sendbtn[disabled] { background: var(--surface2); color: var(--muted); }

/* состав позиции в корзине и на экране «заказ отправлен» */
.cart-mods { color: var(--accent); font-size: 13px; margin: 2px 0; }
.submitted-mods { color: var(--muted); font-size: 13px; }
.addbtn-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px;
  background: rgba(0,0,0,.22); font-size: 13px;
}
.status-item-mods { color: var(--muted); font-size: 13px; }

/* ⚠️ Атрибут hidden сам по себе даёт display:none, но ЛЮБОЙ класс с
   display:flex/grid его перебивает — специфичность у класса выше, чем
   у браузерного правила для hidden. Раз раскладку задают классы, правило
   нужно явно, иначе «скрытый» блок остаётся на экране.
   Зеркало того же правила в staff-ui.css. */
[hidden] { display: none !important; }

/* ── Баннеры поверх страницы (стол протух / стол не распознан) ──
   Значения перенесены один в один из прежних инлайновых атрибутов:
   цвета здесь СВОИ, а не из палитры кафе, намеренно — сообщение об
   ошибке обязано читаться на любой теме, включая ту, где акцент
   совпал бы с фоном баннера. */
.m-banner {
  /* Ширина — по колонке меню (#app, 560px), а не во весь экран: на широком
     экране растянутый во всю ширину баннер отрывается от контента, к
     которому относится. left/right + margin:auto центрируют fixed-элемент,
     max-width удерживает его в колонке. */
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  width: 100%; max-width: 560px; margin: 0 auto;
  background: #1c2330; color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 14px; line-height: 1.4; box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  border-radius: 0 0 12px 12px;
}
.m-banner--error { background: #7f1d1d; }
/* ⚠️ Контент под баннером НЕ сдвигается намеренно. Отступ через
   :has(.m-banner) выглядел логично, но баннер исчезает по таймеру
   (banner.js) — вместе с ним отступ схлопывался, и вся страница
   прыгала вверх на глазах у гостя. Перекрытие шапки на несколько
   секунд безобиднее скачка раскладки. */
.m-banner-close {
  background: none; border: none; color: #fff; font-size: 20px; cursor: pointer;
  padding: 0; line-height: 1; flex-shrink: 0;
}

/* Ошибка оформления в корзине — та же палитра, что у баннера ошибки. */
.m-error {
  background: #7f1d1d; color: #fecaca;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 14px;
}

/* Пиксель Метрики для браузеров без JS: уводится за край экрана, а не
   display:none — скрытая картинка в части браузеров не загружается,
   и счётчик не сработал бы. */
.m-metrika-px { position: absolute; left: -9999px; }
