/* Чёрный фон, белые чернильные мазки, цветные акценты. */
:root {
  --bg: #0b0b0c;
  --panel: #161618;
  --panel-2: #1f1f22;
  --ink: #f4f1ea;
  --muted: #9a9a9f;
  --c1: #f0a24b;   /* кофейный оранжевый */
  --c2: #7fd1b9;   /* мята */
  --c3: #6fb3ff;   /* небо */
  --c4: #f28ca0;   /* клубника */
  --c5: #c9a7ff;   /* лаванда */
  --danger: #ff6b6b;
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; padding-bottom: calc(76px + var(--safe-bottom)); }
button { font: inherit; color: inherit; }

/* шапка */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 6px; }
/* логотип владельца вместо названия текстом: белый на прозрачном, на тёмном фоне */
.brand-logo { display: block; height: 66px; width: auto; }
.brand { position: relative; }
.brand-name { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; position: relative; z-index: 1; }
.brand-ink { position: absolute; left: -8px; right: -14px; bottom: -8px; height: 22px; width: calc(100% + 22px); color: var(--ink); opacity: .92; z-index: 0; }
.lang { background: transparent; border: 1px solid #333; border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--muted); }

/* экраны */
.screen { padding: 8px 14px 24px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
h2 { font-size: 20px; margin: 18px 4px 10px; position: relative; display: inline-block; }
h2::after { content: ""; display: block; height: 8px; margin-top: 2px; background: var(--ink); opacity: .9;
  clip-path: polygon(0 40%, 6% 10%, 20% 50%, 35% 20%, 50% 60%, 65% 15%, 80% 55%, 100% 30%, 98% 90%, 70% 70%, 50% 100%, 30% 65%, 10% 95%, 2% 70%); }
.muted { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 4px 10px; }

/* чипсы категорий */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--panel-2); color: var(--ink); font-weight: 600; }
.chip.active { background: var(--c1); color: #1a1208; }

/* карточки позиций */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item { background: var(--panel); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.item .photo { aspect-ratio: 1 / 1; background: var(--panel-2) center/cover no-repeat; }
.item .photo.none { display: grid; place-items: center; color: #2c2c30; }
.item .photo.none svg { width: 56px; height: 56px; }
.item .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.item .name { font-weight: 700; line-height: 1.2; }
.item .desc { color: var(--muted); font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item .row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 6px; flex-wrap: wrap; }
.item .price { font-weight: 700; color: var(--c1); font-size: 15px; white-space: nowrap; }
.add { border: 0; border-radius: 12px; background: var(--ink); color: #111; font-weight: 700; padding: 7px 10px; font-size: 14px; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; background: var(--panel-2); border-radius: 12px; }
.qty button { border: 0; background: transparent; width: 30px; height: 30px; font-size: 18px; font-weight: 700; color: var(--ink); }
.qty span { min-width: 20px; text-align: center; font-weight: 700; }

/* детальная страница позиции */
.hero { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius); background: var(--panel-2) center/cover no-repeat; }
.hero.none { display: grid; place-items: center; color: #2c2c30; }
.hero.none svg { width: 90px; height: 90px; }
.full-desc { color: var(--ink); opacity: .85; line-height: 1.5; margin: 4px 4px 14px; white-space: pre-wrap; }
.detail-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px; }
.price.big { font-size: 22px; font-weight: 800; color: var(--c1); }
.btn.back { text-align: left; margin: 0 0 8px; padding: 6px 4px; }
.item .photo, .item .name, .item .desc { cursor: pointer; }

/* корзина и списки */
.line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 4px; border-bottom: 1px solid #222; }
.line .title { font-weight: 600; }
.line .sub { color: var(--muted); font-size: 13px; }
.total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; padding: 14px 4px; }

/* кнопки */
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 14px; font-weight: 800; font-size: 16px; margin-top: 10px; }
.btn.primary { background: var(--c1); color: #1a1208; }
.btn.secondary { background: var(--panel-2); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid #3a2222; }
.btn:disabled { opacity: .5; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.choice button { border: 2px solid #2a2a2e; background: var(--panel); border-radius: 14px; padding: 12px; font-weight: 700; }
.choice button.active { border-color: var(--c2); color: var(--c2); }

/* формы */
label.field { display: block; margin: 10px 0; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin: 0 4px 6px; }
input, textarea { width: 100%; background: var(--panel); border: 1px solid #2a2a2e; border-radius: 14px; padding: 12px 14px; color: var(--ink); font: inherit; }
input:focus, textarea:focus { outline: none; border-color: var(--c3); }
textarea { min-height: 70px; resize: vertical; }

/* статус заказа */
.status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--panel-2); }
.status.new { color: var(--c3); } .status.awaiting_payment { color: var(--c1); } .status.receipt { color: var(--c1); }
.status.accepted, .status.delivering { color: var(--c2); } .status.done { color: var(--c2); } .status.rejected, .status.cancelled { color: var(--danger); } .status.refund_requested { color: var(--c1); } .status.refunded { color: var(--muted); }
.card { background: var(--panel); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.card.pay { border: 1px solid var(--c1); }
.btn.busy { opacity: .75; }
.card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.qr { width: 100%; max-width: 260px; border-radius: 12px; display: block; margin: 10px auto; }

/* «кто здесь» */
.people { list-style: none; padding: 0; margin: 0; }
.people li { padding: 12px 14px; margin: 8px 0; background: var(--panel); border-radius: 14px; position: relative; }
.people li.me { border: 1px solid var(--c4); }
.people li::before { content: ""; position: absolute; left: -6px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%) rotate(12deg); background: var(--ink); opacity: .9;
  clip-path: polygon(50% 0, 80% 20%, 100% 55%, 75% 100%, 35% 90%, 0 60%, 15% 20%); }

/* вкладки */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(11,11,12,.92); backdrop-filter: blur(10px); border-top: 1px solid #1d1d20; padding: 8px 6px calc(8px + var(--safe-bottom)); }
.tab { position: relative; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; padding: 6px 0; }
/* значки вкладок — кусочки пазла, как стол на логотипе: каждый повёрнут по-своему и чуть
   сбит по высоте, будто их сложили руками */
.tab .piece { width: 26px; height: 26px; opacity: .35; transition: opacity .2s; }
.tab .piece.c1 { color: var(--c1); } .tab .piece.c2 { color: var(--c2); } .tab .piece.c3 { color: var(--c3); } .tab .piece.c4 { color: var(--c4); } .tab .piece.c5 { color: var(--c5); }
.tab[data-tab="menu"] .piece { transform: translateY(1px) rotate(-6deg); }
.tab[data-tab="cart"] .piece { transform: translateY(-2px) rotate(84deg); }
.tab[data-tab="orders"] .piece { transform: translateY(2px) rotate(183deg); }
.tab[data-tab="here"] .piece { transform: translateY(-1px) rotate(272deg); }
.tab[data-tab="profile"] .piece { transform: translateY(1px) rotate(-95deg); }
.tab[data-tab="settings"] .piece { transform: translateY(-1px) rotate(95deg); }
.tab[data-tab="bonus"] .piece { transform: translateY(2px) rotate(176deg); }
.tab[data-tab="staff"] .piece { transform: translateY(-2px) rotate(-4deg); }
.tab.active { color: var(--ink); }
.tab.active .piece { opacity: 1; }
.tab[hidden] { display: none; }
.badge { position: absolute; top: 2px; right: calc(50% - 26px); background: var(--c1); color: #1a1208; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 6px; display: none; }
.badge.on { display: block; }

/* тост */
/* ширина по тексту, но не уже экрана: при left: 50% браузер иначе сжимает блок до половины ширины,
   и длинное сообщение растекается кругом */
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #111; padding: 10px 16px; border-radius: 18px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; width: max-content; max-width: min(90vw, 440px); line-height: 1.35; text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%); }

/* бонусы: ломаная шкала с точками и иконкой в конце */
.bonus { background: var(--panel); border-radius: var(--radius); padding: 14px 14px 10px; margin: 10px 0; }
.bonus .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.bonus .head b { font-size: 16px; }
.bonus .head span { color: var(--muted); font-size: 13px; }
.bonus svg { width: 100%; height: 64px; display: block; }
.bonus .reward { color: var(--c1); font-weight: 700; font-size: 13px; margin-top: 4px; }
.toggle { display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.toggle input { width: auto; }
.line .free { color: var(--c2); font-weight: 700; }

/* чернильные пятна на пустых экранах */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 90px; height: 90px; color: var(--ink); opacity: .9; display: block; margin: 0 auto 10px; }

/* профиль: формы и список адресов; оформление: выбор сохранённого адреса */
.actions { display: flex; gap: 8px; }
.actions .btn { margin-top: 10px; }
.pick { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.opt { text-align: left; border: 1px solid #2a2a2e; background: var(--panel); color: var(--ink); border-radius: 14px; padding: 12px 14px; font: inherit; }
.opt::before { content: "○ "; color: var(--muted); }
.opt.active { border-color: var(--c1); }
.opt.active::before { content: "● "; color: var(--c1); }
.line .chip { padding: 6px 12px; }

/* предупреждение «сейчас закрыты» на оформлении; поля часов работы в ряд */
.card.notice { border: 1px solid #3b2f1a; line-height: 1.45; }
.actions .field { flex: 1; }

/* QR для кассы в профиле */
.qrcard { text-align: center; }
.qrbox { background: #fff; border-radius: 16px; padding: 12px; display: flex; justify-content: center; }
.qrbox svg { width: 100%; max-width: 260px; height: auto; display: block; }
/* день брони на QR выдачи и предупреждение «не в свой день» — у гостя и у кассира */
.qrday { font-weight: 700; margin: 2px 0 10px; }
.warn { color: var(--c1); border: 1px solid #5a3d16; border-radius: 12px; padding: 8px 10px; margin: 0 0 10px; font-size: 14px; line-height: 1.4; text-align: left; }

/* предзаказ: третья кнопка способа получения — во всю ширину, дни и время — чипами с переносом */
.choice button:nth-child(3) { grid-column: 1 / -1; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }

.choice:has(> button:only-child) button { grid-column: 1 / -1; }

/* iOS 14, Chrome < 88: нет aspect-ratio — блоки фото держим отступом, иначе у них нулевая высота */
@supports not (aspect-ratio: 1 / 1) {
  .item .photo { height: 0; padding-top: 100%; }
  .hero { height: 0; padding-top: 75%; }
}

/* опции позиции в карточке: группа — заголовок и варианты чипами */
.opt-group { margin: 12px 0 4px; }
.opt-title { font-weight: 700; margin: 0 4px 2px; }
