@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg: #0E0E0D;
  --surface: #181816;
  --surface-2: #151513;
  --line: #2A2A27;
  --line-soft: #22211E;
  --text: #F2EFE8;
  --text-2: #C9C5BC;
  --muted: #A19D93;
  --accent: #D4A84B;
  --accent-hi: #E6C276;
  --danger: #E5735F;
  --ok: #7FC48A;
  --radius: 16px;
  --display: 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; padding-bottom: calc(96px + var(--safe-b)); }
#app.has-cartbar { padding-bottom: calc(168px + var(--safe-b)); }
#app.wide { max-width: 1100px; padding-bottom: 40px; }

.screen { padding: calc(16px + var(--safe-t)) 20px 24px; display: flex; flex-direction: column; gap: 18px; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.h1 { font-family: var(--display); font-weight: 700; font-size: 30px; letter-spacing: 1.5px; text-transform: uppercase; margin: 0; line-height: 1.05; }
.h2 { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 1px; text-transform: uppercase; margin: 0; }
.eyebrow { font-size: 11px; letter-spacing: 2px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.eyebrow.accent { color: var(--accent); }
.muted { color: var(--muted); }
.price { font-family: var(--display); font-weight: 500; font-size: 18px; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* шапка */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 2px; line-height: 1; }
.brand-sub { font-size: 11px; letter-spacing: 2px; color: var(--muted); margin-top: 4px; }

/* кнопки */
.btn { height: 52px; border-radius: 14px; border: none; padding: 0 20px; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.btn-accent { background: var(--accent); color: #0E0E0D; }
.btn-accent:active { background: var(--accent-hi); }
.btn-accent:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-outline { background: transparent; border: 1px solid var(--text); color: var(--text); }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-sm { height: 40px; border-radius: 10px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; }

/* переключатель заведения */
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; padding: 4px; background: var(--surface-2); }
.seg button { min-height: 48px; border: none; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px; }
.seg button small { font-size: 10px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--text); color: #0E0E0D; }
.seg button[aria-pressed="true"] small { color: #4A4843; }

/* фото и заглушки */
.ph { background: repeating-linear-gradient(135deg, #22211E 0 2px, #151513 2px 8px); }
.photo { position: relative; overflow: hidden; border: 1px solid var(--line); background-color: var(--surface-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* главный баннер */
.hero { position: relative; height: 260px; border-radius: 20px; }
.hero-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px; background: linear-gradient(to top, rgba(14,14,13,.96) 55%, rgba(14,14,13,0)); display: flex; flex-direction: column; gap: 10px; }
.hero-title { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.05; letter-spacing: .5px; margin: 0; }

.card { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.card-link { text-decoration: none; color: var(--text); }

/* горизонтальная лента */
.hscroll { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; scroll-padding: 0 20px; scroll-snap-type: x proximity; }
.hscroll::after { content: ''; flex: 0 0 8px; }
.hscroll::-webkit-scrollbar { display: none; }
.mini { width: 150px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; scroll-snap-align: start; background: none; border: none; padding: 0; text-align: left; color: var(--text); }
.mini .photo { height: 112px; border-radius: 14px; }
.mini-name { font-size: 13px; line-height: 1.3; height: 34px; overflow: hidden; }

/* меню */
.chips { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 20px; margin: 0 -20px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line-soft); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.chip[aria-current="true"] { background: var(--text); border-color: var(--text); color: #0E0E0D; font-weight: 600; }
.cat-block { scroll-margin-top: 64px; display: flex; flex-direction: column; gap: 14px; }
.dish { display: flex; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.dish .photo { width: 100px; height: 100px; flex-shrink: 0; border-radius: 14px; }
.dish-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dish-name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.dish-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.dish-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dish.off { opacity: .45; }
.add { width: 44px; height: 38px; border-radius: 10px; border: 1px solid var(--accent); background: transparent; color: var(--accent); font-size: 22px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.qty { height: 38px; border-radius: 10px; background: var(--accent); color: #0E0E0D; display: inline-flex; align-items: center; font-weight: 600; }
.qty button { width: 38px; height: 38px; border: none; background: transparent; color: #0E0E0D; font-size: 20px; }
.qty span { min-width: 20px; text-align: center; }

/* плавающая корзина */
.cartbar { position: fixed; left: 50%; transform: translateX(-50%); width: calc(min(480px, 100vw) - 32px); bottom: calc(92px + var(--safe-b)); height: 56px; border-radius: 16px; background: var(--accent); color: #0E0E0D; text-decoration: none; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; font-weight: 600; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.5); border: none; }
.cartbar .count { width: 26px; height: 26px; border-radius: 50%; background: #0E0E0D; color: var(--accent); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }

/* нижняя навигация */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(480px, 100vw); height: calc(80px + var(--safe-b)); padding: 8px 8px calc(16px + var(--safe-b)); background: rgba(14,14,13,.97); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); z-index: 30; }
.tabbar a { text-decoration: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; position: relative; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--accent); color: #0E0E0D; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* формы */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.input, .select, .textarea { min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 15px; width: 100%; }
.textarea { padding: 12px 14px; min-height: 80px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); outline: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opt { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 14px; }
.opt[aria-pressed="true"] { border: 1.5px solid var(--accent); background: #1C1A14; color: var(--text); font-weight: 600; }
.switch { width: 52px; height: 32px; border-radius: 16px; border: none; background: var(--line); position: relative; flex-shrink: 0; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); transition: left .15s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { left: 24px; background: #0E0E0D; }
.error { color: var(--danger); font-size: 13px; }

.sum-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.total { display: flex; align-items: baseline; justify-content: space-between; }
.total b { font-family: var(--display); font-size: 28px; }

.empty { text-align: center; padding: 48px 8px; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted); }

/* карта гостя */
.guest-card { border-radius: 22px; border: 1px solid #3A3833; padding: 20px; display: flex; flex-direction: column; gap: 16px; background: repeating-linear-gradient(135deg, #1F1E1B 0 1px, #141412 1px 6px); }

/* лист снизу */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: min(480px, 100vw); max-height: 92dvh; overflow-y: auto; background: var(--bg); border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 12px 20px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 16px; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); align-self: center; }
.sheet .photo { height: 240px; border-radius: 16px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(16px + var(--safe-t)); z-index: 80; background: var(--text); color: #0E0E0D; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }

.status-steps { display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.step .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; }
.step.done { color: var(--text); }
.step.done .dot { background: var(--accent); border-color: var(--accent); }

/* профиль: списки-меню как в приложениях доставки */
.menu-group { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.menu-row { width: 100%; min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; color: var(--text); text-decoration: none; background: transparent; border: none; border-top: 1px solid var(--line-soft); font-size: 16px; }
.menu-row:first-child { border-top: none; }
.menu-row:active { background: var(--surface-2); }
.menu-row > .row > svg { color: var(--accent); flex-shrink: 0; }
.menu-row > svg { color: var(--muted); flex-shrink: 0; }
.pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: #0E0E0D; }
.muted-pill { background: var(--line); color: var(--text-2); }
.ok-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ok); }
.verify-dog { display: flex; justify-content: center; color: var(--text); padding: 12px 0 4px; }
.input.otp { text-align: center; font-family: var(--display); font-size: 30px; letter-spacing: 12px; min-height: 64px; }

/* выбор адреса и галочки */
.addr-opt { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 15px; line-height: 1.35; }
.addr-opt[aria-checked="true"] { border-color: var(--accent); background: #1C1A14; }
.radio-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; position: relative; }
.addr-opt[aria-checked="true"] .radio-dot { border-color: var(--accent); }
.addr-opt[aria-checked="true"] .radio-dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 15px; color: var(--text-2); cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; border-radius: 7px; border: 2px solid var(--line); background: var(--surface-2); flex-shrink: 0; display: grid; place-content: center; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ''; width: 10px; height: 6px; border-left: 2.5px solid #0E0E0D; border-bottom: 2.5px solid #0E0E0D; transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check.consent { align-items: flex-start; font-size: 13px; line-height: 1.5; min-height: 0; }
.check.consent input { margin-top: 1px; }
.check.consent a { color: var(--accent); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; line-height: 1.5; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text-2); }
.badge-ok { font-size: 12px; font-weight: 600; color: var(--ok); }

.opt-wide { width: 100%; min-height: 60px; padding: 10px 16px; display: flex; align-items: center; }
.pay-box { gap: 8px; }
.pay-box.ok { border-color: var(--ok); }
.pay-box.ok b { color: var(--ok); }
.pay-box.bad { border-color: var(--danger); }
.pay-box.bad b { color: var(--danger); }
.pay-box.wait { border-color: var(--accent); }
.pay-pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.pay-pill.held, .pay-pill.paid { color: var(--ok); border-color: var(--ok); }
.pay-pill.pending { color: var(--accent); border-color: var(--accent); }
.pay-pill.failed { color: var(--danger); border-color: var(--danger); }
.install-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.install-steps b { color: var(--text); }
.install-steps svg { color: var(--accent); }

/* загрузка: бульдог */
.pk-loader { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text); }
.pk-stage { position: relative; width: 150px; height: 150px; display: grid; place-items: center; animation: pk-bounce .6s cubic-bezier(.3,.7,.4,1) infinite alternate; }
.pk-dog { width: 120px; height: 120px; animation: pk-shake 1.2s ease-in-out infinite; transform-origin: 50% 85%; }
.pk-ring { position: absolute; inset: 0; width: 150px; height: 150px; animation: pk-spin 1.4s linear infinite; }
.pk-ring circle { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 120 360; }
.pk-shadow { width: 92px; height: 10px; border-radius: 50%; background: rgba(242,239,232,.12); animation: pk-shadow .6s cubic-bezier(.3,.7,.4,1) infinite alternate; }
.pk-load-text { margin-top: 14px; font-family: var(--display); font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }
@keyframes pk-bounce { from { transform: translateY(0); } to { transform: translateY(-16px); } }
@keyframes pk-shadow { from { transform: scaleX(1); opacity: 1; } to { transform: scaleX(.7); opacity: .5; } }
@keyframes pk-shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-7deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(2deg); } }
@keyframes pk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pk-stage, .pk-dog, .pk-ring, .pk-shadow { animation: none; } }
.logo-mark { display: block; flex-shrink: 0; }
.logo-full { display: block; max-width: 100%; height: auto; }

.info-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0 8px; line-height: 1.8; user-select: none; -webkit-user-select: none; }

/* ---------- админка ---------- */
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.order { display: flex; flex-direction: column; gap: 10px; }
.order.new { border-color: var(--accent); }
.status-pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.status-pill.new { background: var(--accent); color: #0E0E0D; border-color: var(--accent); }
.status-pill.done { color: var(--ok); border-color: var(--ok); }
.status-pill.cancelled { color: var(--danger); border-color: var(--danger); }
.adm-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.adm-item .photo { width: 56px; height: 56px; border-radius: 10px; flex-shrink: 0; }
.adm-item .grow { flex: 1; min-width: 0; }
.adm-item .name { font-weight: 600; font-size: 14px; }
.adm-item { flex-wrap: wrap; }
.adm-item .ctl { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.input.price-input { width: 96px; min-height: 40px; text-align: right; padding: 0 10px; }
@media (max-width: 600px) {
  .adm-item .grow { flex-basis: calc(100% - 68px); }
  .adm-item .ctl { width: 100%; justify-content: flex-end; }
  .cat-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tabs .chip { flex-shrink: 0; }
}
.table-wrap { overflow-x: auto; }
.demo-banner { background: #2B2414; border: 1px solid #5A4A22; color: var(--accent-hi); padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.4; }

/* ---------- два заведения: цветовая метка, чтобы заказы не путались ---------- */
.venue-tag { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.venue-tag.v-petrogradka, .chip.v-petrogradka[aria-current="true"] { background: #2B4A6B; color: #E8F1FB; border-color: #2B4A6B; }
.venue-tag.v-murino, .chip.v-murino[aria-current="true"] { background: #2F5A3A; color: #E6F5EA; border-color: #2F5A3A; }
.card.order.v-petrogradka { border-left: 4px solid #4A7FB5; }
.card.order.v-murino { border-left: 4px solid #4E9A60; }
.stop-chip { font-size: 12px; min-height: 32px; padding: 4px 10px; }
.stop-chip.off { border-color: var(--danger); color: var(--danger); }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin: 4px 0; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.doc-sheet { height: 88dvh; display: flex; flex-direction: column; }
.doc-sheet iframe { flex: 1; width: 100%; border: 0; border-radius: 12px; background: var(--bg); }

/* ---------- карта гостя ---------- */
.loy-card { gap: 12px; }
.loy-balance { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1; color: var(--text); }
.loy-balance small { font-size: 16px; color: var(--text-2); font-weight: 500; }
.loy-prog { height: 6px; border-radius: 3px; background: rgba(242,239,232,.12); overflow: hidden; }
.loy-prog span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.loy-no { font-family: var(--display); letter-spacing: 3px; color: var(--text-2); font-size: 14px; }
.loy-qr { background: #fff; padding: 10px; border-radius: 16px; line-height: 0; }
.loy-qr svg { width: 220px; height: 220px; }
.qr-fallback { width: 220px; height: 120px; display: grid; place-items: center; color: #0E0E0D; font-family: var(--display); font-size: 28px; letter-spacing: 4px; }
.scan-video { width: 100%; max-height: 300px; border-radius: 16px; background: #000; object-fit: cover; }
.cashier-guest { border-color: var(--accent); }
.tier-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 36px; gap: 8px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.tier-row > .input[name=t_name] { grid-column: 1 / -1; }
.tier-f { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.tier-f .input { min-width: 0; padding-left: 10px; padding-right: 8px; }
