/* Guest, cashier and admin UI. The defaults are the Мясоедов look: a warm light
   theme where the pass and tier cards stay dark like cuts of meat on butcher
   paper. A venue's brand.theme overrides these custom properties (web.Theme). */
:root {
  color-scheme: light;
  /* Butcher-paper cream, espresso text, oxblood accent. */
  --bg: #f6efe5;
  --surface: #fffaf2;
  --surface-2: #efe4d4;
  --line: rgba(64, 34, 24, 0.12);
  --line-2: rgba(64, 34, 24, 0.24);
  --text: #2b1b15;
  --muted: #6b574a;
  --faint: #978476;
  --accent: #9b2226;
  --accent-2: #b52b30;
  --copper: #a35a26;
  --gold: #8f6418;
  --steel: #6f6f6f;
  --ok: #2e7a47;
  --err: #b3261e;
  --ink: #241612; /* dark "steak" surfaces: pass, tier cards, tier badges */
  --on-ink: #f5ece0; /* text on --ink */
  --ink-label: #e4bc70; /* links and the scanner frame on dark surfaces */
  --pass-bg: #181210;
  --pass-fg: #f5ece0;
  --pass-strip: #3a0f10; /* behind strip artwork while it loads */
  --tint: rgba(155, 34, 38, 0.06); /* faint accent wash */
  --halo: #ecdcc6; /* circle behind the hero pass */
  --shadow: rgba(70, 30, 15, 0.55);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --display-weight: 800;
  --pass-font: -apple-system, "SF Pro Text", "Helvetica Neue", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  font-variant-numeric: lining-nums; /* Playfair defaults to old-style figures */
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: var(--display-weight); line-height: 1.08; margin: 0 0 0.5em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h3 { font-size: 1.05rem; font-family: var(--font); font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper); margin-bottom: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- demo stand ---- */
.showcase-bar { background: var(--ink); color: var(--on-ink); text-align: center; font-size: 0.85rem; padding: 8px 16px; }
.showcase-bar a { color: var(--ink-label); }
.demo-logins { display: grid; gap: 8px; }
.demo-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.demo-logins code { font-weight: 700; }

/* ---- top bar & footer ---- */
.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: var(--display-weight); letter-spacing: 0.08em; font-size: 1.1rem; }
.brand { flex: none; } /* the scrolling admin nav must not squash the logo */
.brand img { width: 34px; height: 34px; }
.footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 32px 0 48px; color: var(--faint); font-size: 0.875rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.footer a { color: var(--muted); }

/* ---- buttons & forms ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font: 700 1rem/1 var(--font); text-decoration: none;
  cursor: pointer; transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 1.1rem; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.875rem; }
.btn-danger { background: transparent; border-color: rgba(239, 106, 94, 0.5); color: var(--err); }
.btn-danger:hover { background: rgba(239, 106, 94, 0.1); }
.btn-wallet { background: #000; border: 1px solid #a6a6a6; border-radius: 12px; min-height: 56px; color: #fff; font-weight: 600; }
.btn-wallet:hover { background: #111; }
.btn-wallet svg { width: 26px; height: 26px; flex: none; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 0.875rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field small { display: block; color: var(--faint); margin-top: 6px; font-size: 0.8rem; }
input, select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: #fff; color: var(--text); font: 500 1rem var(--font);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
input[type="checkbox"] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 0; }
/* iOS Safari gives date inputs a native min-width wider than the form and centres the value. */
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9rem; color: var(--muted); margin-bottom: 20px; }
.alert { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.alert-error { background: #fbebe8; border-color: #ecbcb5; color: #8a1f17; }
.alert-ok { background: #e9f4ec; border-color: #b9dcc3; color: #1e5a33; }
.alert-demo { background: #fbf2dd; border-color: #e9d29f; color: #5f4310; font-weight: 400; }
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

/* ---- Wallet pass replica ---- */
.pass {
  --label: #e4bc70;
  width: 100%; max-width: 340px; border-radius: 14px; overflow: hidden;
  background: var(--pass-bg); color: var(--pass-fg); font-family: var(--pass-font);
  box-shadow: 0 40px 70px -30px var(--shadow), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.pass-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; }
.pass-head img { width: 30px; height: 30px; }
.pass-logotext { flex: 1; font-weight: 700; font-size: 15px; letter-spacing: 0.03em; }
.pf { display: flex; flex-direction: column; min-width: 0; }
.pf-r { text-align: right; align-items: flex-end; }
.pf .l { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--label); }
.pf .v { font-size: 16px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pass-strip { aspect-ratio: 375 / 144; background: var(--pass-strip) center / cover no-repeat; padding: 10px 14px; }
.pass-strip .v { font-size: 46px; font-weight: 300; line-height: 1.05; letter-spacing: -0.01em; }
.pass-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px 0; }
.pass-qr { width: 156px; margin: 18px auto 18px; padding: 10px 10px 6px; background: #fff; border-radius: 8px; color: #111; text-align: center; font-size: 11px; }
.pass-qr img { width: 100%; image-rendering: pixelated; }

/* ---- landing ---- */
.hero { padding: 56px 0 24px; }
.hero .wrap { display: grid; gap: 48px; align-items: center; grid-template-columns: 1.15fr 0.85fr; }
.hero .lead { font-size: 1.2rem; color: var(--muted); max-width: 36ch; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); }
.hero .lead strong { color: var(--text); }
.hero-pass { display: flex; justify-content: center; position: relative; }
.hero-pass::before { content: ""; position: absolute; width: min(420px, 90%); aspect-ratio: 1; border-radius: 50%; background: var(--halo); top: 50%; left: 50%; transform: translate(-50%, -50%); }
.hero-pass .pass { position: relative; }
.hero-pass .pass { transform: rotate(3deg); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.section { padding: 56px 0 0; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.tier { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 200px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; background: var(--pass-strip) center / cover no-repeat; color: var(--on-ink); box-shadow: 0 24px 40px -28px var(--shadow); }
.tier::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18, 14, 13, 0) 30%, rgba(18, 14, 13, 0.85)); background: linear-gradient(180deg, transparent 30%, color-mix(in srgb, var(--pass-bg) 88%, transparent)); }
.tier > * { position: relative; z-index: 1; }
.tier-code { font-family: var(--font); font-weight: 800; letter-spacing: 0.14em; font-size: 0.85rem; }
.tier-pct { font-family: var(--display); font-weight: var(--display-weight); font-size: 3.4rem; line-height: 1; }
.tier-note { color: rgba(245, 236, 224, 0.78); color: color-mix(in srgb, var(--on-ink) 78%, transparent); font-size: 0.9rem; }
.perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 24px; }
.perk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.perk b { display: block; font-family: var(--display); font-weight: var(--display-weight); font-size: 1.5rem; margin-bottom: 6px; color: var(--accent); }
.perk span { color: var(--muted); font-size: 0.92rem; }
.join { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: start; }
.join .card-box { padding: 28px; }

/* ---- card page ---- */
.card-page { display: grid; grid-template-columns: 360px 1fr; gap: 48px; padding-top: 40px; align-items: start; }
.card-page .pass { max-width: 360px; }
.inapp .btn { margin-top: 10px; }
.inapp span { display: block; margin-top: 6px; }
.desktop-qr { display: flex; gap: 16px; align-items: center; }
.desktop-qr img { flex: none; image-rendering: pixelated; border-radius: 6px; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.history .delta { font-weight: 700; }
.plus { color: var(--ok); }
.minus { color: var(--muted); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; margin-bottom: 14px; color: var(--muted); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 0.85rem; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--copper)); border-radius: inherit; }

/* ---- prose pages ---- */
.prose { max-width: 720px; padding-top: 40px; }
.prose h2 { margin-top: 1.6em; font-size: 1.3rem; }
.prose li { margin-bottom: 0.4em; color: var(--muted); }
.prose p { color: var(--muted); }

/* ---- login ---- */
.auth { max-width: 440px; margin: 64px auto 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin-bottom: 20px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 8px; border-radius: 10px; color: var(--muted); transition: background 0.15s; }
.seg b { display: block; font-weight: 700; }
.seg small { display: block; font-size: 0.75rem; color: var(--faint); margin-top: 2px; }
.seg input:checked + span { background: var(--accent); color: #fff; }
.seg input:checked + span small { color: rgba(255, 255, 255, 0.75); }
.seg input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }

/* ---- admin ---- */
.admin-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.admin-nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 0.92rem; white-space: nowrap; }
.admin-nav a:hover { color: var(--text); background: var(--surface); }
.admin-nav a.on { color: var(--text); background: var(--surface-2); }
.admin-main { padding-top: 32px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 1.8rem; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 32px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .k { color: var(--muted); font-size: 0.85rem; }
.stat .v { font-family: var(--display); font-weight: var(--display-weight); font-size: 1.8rem; margin-top: 2px; }
.stat .s { color: var(--faint); font-size: 0.8rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--faint); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tr.link-row { cursor: pointer; }
tr.link-row:hover td { background: var(--surface-2); }
.badge { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; background: var(--ink); color: var(--on-ink); }
.badge-muted { color: var(--faint); background: transparent; border: 1px solid currentColor; }
.searchbar { display: flex; gap: 8px; max-width: 480px; flex: 1; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 140px; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -8px 0 16px; }
.presets a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 0.875rem; font-weight: 600; }
.presets a:hover { color: var(--text); background: var(--surface); }
.presets a.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.presets .btn { margin-left: auto; }
table.report tr.empty td { color: var(--faint); }
th.hl, td.hl { background: var(--tint); font-weight: 700; }
tfoot td { font-weight: 800; border-top: 2px solid var(--line-2); border-bottom: 0; }
.guide { display: grid; gap: 20px; max-width: 820px; }
.guide h2 { font-size: 1.3rem; margin-bottom: 0.6em; }
.guide h3 { margin: 20px 0 10px; }
.guide .steps li { color: var(--text); }
dl.kv dt { color: var(--faint); }
dl.kv dd { margin: 0; }

/* ---- cashier app ---- */
.kassa { min-height: 100dvh; display: flex; flex-direction: column; }
.kassa-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); gap: 12px; }
.kassa-main { flex: 1; width: min(560px, 100% - 32px); margin: 0 auto; padding: 20px 0 40px; }
.scan-box { position: relative; aspect-ratio: 1; max-height: 60vh; margin: 0 auto 16px; border-radius: var(--radius); overflow: hidden; background: #000; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; }
.scan-box::after { content: ""; position: absolute; inset: 18%; border: 3px solid var(--ink-label); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.results { list-style: none; padding: 0; margin: 12px 0 0; }
.results button { width: 100%; text-align: left; display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); font: inherit; margin-bottom: 8px; cursor: pointer; }
.results button:hover { border-color: var(--line-2); }
.member-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.member-head h2 { font-family: var(--font); font-weight: 800; font-size: 1.5rem; margin: 0 0 4px; }
.balance-big { font-family: var(--display); font-size: 2.4rem; font-weight: var(--display-weight); line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.chip { font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.chip-bday { background: #fbf2dd; color: var(--gold); }
.chip-tier { background: var(--ink); }
.money-input { font-family: var(--display); font-size: 2.2rem; font-weight: var(--display-weight); min-height: 72px; text-align: center; }
.redeem-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.redeem-row input[type="number"] { flex: 1; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.summary div { display: flex; justify-content: space-between; padding: 4px 0; }
.summary .total { font-size: 1.15rem; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.done { text-align: center; padding: 24px 0; }
.done .tick { width: 72px; height: 72px; border-radius: 50%; background: #e9f4ec; color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; font-size: 2.2rem; }
.done .big { font-family: var(--display); font-size: 2.8rem; font-weight: var(--display-weight); color: var(--ok); }
.pos-discount { border: 2px solid var(--accent); background: var(--tint); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 20px; }
.pos-discount .k { font-weight: 700; }
.pos-discount .v { font-family: var(--display); font-size: 2.6rem; font-weight: var(--display-weight); color: var(--accent); line-height: 1.1; }
.recent { margin-top: 32px; }
.recent li { font-size: 0.9rem; }
.qr-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); display: grid; place-items: center; padding: 24px; z-index: 10; }
.qr-modal .sheet { background: #fff; color: #111; border-radius: var(--radius); padding: 24px; text-align: center; max-width: 340px; }
.qr-modal img { width: 260px; height: 260px; image-rendering: pixelated; margin: 0 auto 12px; }
[hidden] { display: none !important; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .hero .wrap, .join, .card-page { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .hero-pass .pass { transform: none; }
  .perks { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .card-page { gap: 32px; }
  .card-page .pass { margin: 0 auto; }
}
@media (max-width: 640px) {
  .tiers { grid-template-columns: 1fr; }
  .tier { min-height: 150px; }
  .grid-2 { grid-template-columns: 1fr; }
  .card-box { padding: 20px; }
  th, td { padding: 10px 12px; }
  .hide-sm { display: none; }
}

/* ---- print (reconciliation report, setup guide) ---- */
@media print {
  .topbar, .no-print, .alert-demo { display: none !important; }
  body { background: #fff; }
  .admin-main { padding-top: 0; }
  .table-wrap, .card-box { border-color: #bbb; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* ---- automatic pushes ---- */
.autopush-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
.autopush-head h2 { font-size: 1.3rem; margin: 0; }
.autopush-head .check { margin: 0; align-items: center; font-weight: 700; color: var(--text); cursor: pointer; }
.push-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 18px; border-radius: 18px; background: var(--surface-2); font-size: 0.9rem; line-height: 1.35; }
.push-note img { width: 34px; height: 34px; border-radius: 8px; flex: none; }
.push-note > div { flex: 1; min-width: 0; }
.push-note .meta { display: flex; justify-content: space-between; gap: 8px; }
.push-note .meta span { color: var(--faint); font-size: 0.8rem; }
.push-note p { margin: 2px 0 0; overflow-wrap: anywhere; }
.autopush-send { display: grid; grid-template-columns: minmax(140px, 200px) 1fr auto; gap: 8px 20px; align-items: center; margin-top: 20px; }
.autopush-send .field, .autopush-send p { margin: 0; }
.autopush-log { font-size: 1.2rem; margin-top: 32px; }
@media (max-width: 640px) {
  .autopush-send { grid-template-columns: 1fr; }
}

/* ---- gifts ---- */
.gifts-page { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 24px; align-items: start; }
.gift-done { border-color: var(--gold); }
.gift-when { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.gift-state { display: inline-block; border-radius: 8px; min-width: 9em; }
.copy-row { display: flex; gap: 8px; margin-top: 10px; }
.copy-row input { flex: 1; min-width: 0; font-size: 0.85rem; }
.gift-hero { padding: 40px 0 0; }
.gift-card { display: flex; gap: 20px; align-items: flex-start; background: var(--surface); border: 1px solid var(--gold); border-radius: var(--radius); padding: 28px; }
.gift-card .gift-emoji { font-size: 3rem; line-height: 1; }
.gift-card h2 { margin-bottom: 0.3em; }
.gift-card .lead { font-size: 1.15rem; color: var(--muted); }
@media (max-width: 900px) {
  .gifts-page { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .gift-card { flex-direction: column; gap: 8px; padding: 20px; }
}

.topbar-actions { display: flex; gap: 8px; align-items: center; }
/* A long name («PROSECCO BAR») plus both buttons overflows a phone; the hero
   right below has the same «Получить карту». */
@media (max-width: 420px) {
  .topbar-actions .btn-ghost + .btn { display: none; }
}

/* ---- guest menu (/menu) ---- */
.mn { min-height: 100dvh; }
.mn-wrap { width: min(980px, 100% - 32px); margin-inline: auto; }
.mn-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.mn .brand img { border-radius: 9px; }
.mn-langs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); }
.mn-langs a { padding: 6px 11px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 0.78rem; letter-spacing: 0.04em; }
.mn-langs a[aria-current] { background: var(--text); color: var(--bg); }
.mn-hero { padding: 18px 0 14px; }
.mn-hero .eyebrow { margin-bottom: 0.4rem; }
.mn-hero h1 { font-size: clamp(2.6rem, 11vw, 4rem); margin: 0; }
.mn-tabs { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; background: var(--bg); background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.mn-tabs-row { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px max(16px, calc((100% - 980px) / 2)); }
/* The guest-card button stays pinned at the right; the tabs scroll under a fade. */
.mn-tabs.has-card .mn-tabs-row { padding-right: 34px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.mn-tabs .mn-tabs-card { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-right: max(16px, calc((100% - 980px) / 2)); padding: 8px 13px; border-radius: 99px; background: var(--pass-bg); color: var(--pass-fg); font-weight: 700; font-size: 0.84rem; }
.mn-tabs .mn-tabs-card:hover { color: var(--pass-fg); }
.mn-tabs-card svg { width: 17px; height: 17px; fill: none; stroke: var(--ink-label); stroke-width: 1.8; stroke-linejoin: round; }
.mn-tabs-row::-webkit-scrollbar { display: none; }
.mn-tabs a { flex: none; padding: 8px 15px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.mn-tabs a:hover { color: var(--text); }
.mn-tabs a.on { background: var(--accent); color: #fff; }
.mn-main { padding-bottom: 8px; }
.mn-sec { padding-top: 30px; scroll-margin-top: 62px; }
.mn-sec h2 { font-size: clamp(1.6rem, 6vw, 2.1rem); margin: 0 0 14px; }
.mn-list { display: grid; gap: 10px; }
.dish { display: flex; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); -webkit-tap-highlight-color: transparent; }
.dish[data-dish] { cursor: pointer; transition: transform 0.12s, box-shadow 0.15s; }
.dish[data-dish]:hover { box-shadow: 0 14px 30px -24px var(--shadow); }
.dish[data-dish]:active { transform: scale(0.985); }
.dish[data-dish]:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.dish-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dish-name { font: 700 1.02rem/1.3 var(--font); margin: 0 0 4px; letter-spacing: 0; }
.dish-desc { color: var(--muted); font-size: 0.88rem; line-height: 1.45; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.tag { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.tag-hit { background: var(--accent); color: #fff; }
.tag-new { background: var(--copper); color: #fff; }
.tag-spicy { background: #fbe1d9; color: #a3271c; }
.tag-veg { background: #e1f0e3; color: #2a6e40; }
.tag-out { background: var(--text); color: var(--bg); }
.dish-prices { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: auto; }
.dish-price { display: inline-flex; align-items: baseline; gap: 6px; }
.dish-price .portion { color: var(--faint); font-size: 0.85rem; }
.dish-price b { font-size: 1.02rem; font-weight: 800; }
.dish-photo { flex: none; width: 108px; height: 108px; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
.dish.is-out .dish-photo { filter: grayscale(1); opacity: 0.5; }
.dish.is-out .dish-name, .dish.is-out .dish-price b { color: var(--faint); }
.mn-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin: 30px 0 0; padding: 16px; border-radius: var(--radius); background: var(--pass-bg); color: var(--pass-fg); text-decoration: none; box-shadow: 0 24px 40px -30px var(--shadow); }
.mn-card-logo img { width: 44px; height: 44px; border-radius: 10px; }
.mn-card-text { flex: 1 1 200px; min-width: 0; }
.mn-card-text b { display: block; font-size: 1.02rem; }
.mn-card-text span { display: block; font-size: 0.87rem; opacity: 0.8; line-height: 1.4; }
.mn-card-go { flex: none; padding: 9px 16px; border-radius: 99px; background: var(--ink-label); color: var(--pass-bg); font-weight: 800; font-size: 0.88rem; }
.mn-note { margin: 34px auto 0; max-width: 52ch; color: var(--faint); font-size: 0.86rem; white-space: pre-line; text-align: center; }
.mn-empty { padding: 56px 0; text-align: center; color: var(--muted); font-size: 1.1rem; }
.mn-foot { margin-top: 48px; padding: 28px 0 calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--faint); font-size: 0.86rem; line-height: 1.7; }
.mn-foot b { color: var(--muted); }
.mn-foot a { color: var(--muted); }
.dish-sheet { padding: 0; border: 0; width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0; border-radius: 22px 22px 0 0; background: var(--surface); color: var(--text); overflow: auto; overscroll-behavior: contain; }
.dish-sheet::backdrop { background: rgba(10, 8, 6, 0.55); }
.dish-sheet[open] { animation: sheet-up 0.24s ease-out; }
@keyframes sheet-up { from { transform: translateY(48px); opacity: 0; } }
.sheet-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.sheet-body { padding: 20px 20px calc(26px + env(safe-area-inset-bottom)); }
.sheet-body h2 { font-size: 1.7rem; margin: 0 0 10px; }
.sheet-body .dish-tags { margin-bottom: 12px; }
.sheet-body .dish-tags:empty { display: none; }
.sheet-desc { color: var(--muted); white-space: pre-line; margin: 0 0 14px; }
.sheet-desc:empty { display: none; }
.sheet-prices > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.sheet-prices span { color: var(--muted); }
.sheet-prices b { font-size: 1.1rem; font-weight: 800; }
.sheet-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); color: #fff; cursor: pointer; }
.sheet-close svg { width: 20px; height: 20px; }
.dish-sheet.no-photo .sheet-close { background: var(--surface-2); color: var(--text); }
.dish-sheet.no-photo .sheet-body { padding-top: 26px; padding-right: 64px; }
body.sheet-open { overflow: hidden; }
@media (min-width: 640px) {
  .dish-sheet { margin: auto; border-radius: 22px; }
  .dish-photo { width: 124px; height: 124px; }
}
@media (min-width: 860px) {
  .mn-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .dish { padding: 12px; gap: 12px; }
  .dish-photo { width: 92px; height: 92px; }
}

/* ---- admin: menu editor ---- */
.mhint { margin: -10px 0 16px; }
.drag-dots { display: inline-block; width: 10px; height: 16px; vertical-align: -3px; background-image: radial-gradient(currentColor 1.3px, transparent 1.7px); background-size: 5px 5.4px; color: var(--faint); }
.mcats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.mcat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.mcat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 18px; border-bottom: 1px solid var(--line); }
.mcat-title { min-width: 0; }
.mcat-title h2 { font-size: 1.3rem; margin: 0; }
.mcat.is-hidden .mcat-title h2 { color: var(--faint); }
.mcat-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.mcat-meta:not(:empty) { margin-top: 4px; }
.mcat-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.icon-btn { width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mitems { list-style: none; margin: 0; padding: 0; }
.mitem { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 4px; border-bottom: 1px solid var(--line); background: var(--surface); }
.mitem:last-child { border-bottom: 0; }
.mitem:target { background: var(--tint); }
.mitem.dragging { position: relative; z-index: 3; border-radius: 12px; box-shadow: 0 16px 34px -14px var(--shadow); border-color: transparent; }
.drag-handle { flex: none; width: 30px; height: 46px; display: grid; place-items: center; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.dragging .drag-handle { cursor: grabbing; }
.mitem-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; padding: 2px 0; }
.mitem-main:hover b { color: var(--accent); }
.mitem-photo { width: 52px; height: 52px; flex: none; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.mitem-text { min-width: 0; }
.mitem-text b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mitem-text small { display: block; color: var(--muted); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mitem.is-out .mitem-photo { filter: grayscale(1); opacity: 0.45; }
.mitem.is-out .mitem-text b { color: var(--faint); }
.mitems-empty { padding: 16px 18px; }
.switch { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 96px; padding: 6px 0 6px 6px; border: 0; background: none; cursor: pointer; font: 700 0.8rem var(--font); color: var(--ok); }
.switch-label { order: -1; }
.switch-track { position: relative; width: 46px; height: 28px; flex: none; border-radius: 99px; background: var(--ok); transition: background 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transform: translateX(18px); transition: transform 0.15s; }
.switch[aria-checked="false"] { color: var(--err); }
.switch[aria-checked="false"] .switch-track { background: var(--line-2); }
.switch[aria-checked="false"] .switch-track::after { transform: none; }
.switch:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; border-radius: 8px; }
.switch:disabled { opacity: 0.6; cursor: wait; }
.mcat-edit { border-top: 1px solid var(--line); }
.mcat-edit summary { padding: 11px 18px; color: var(--muted); font-size: 0.86rem; font-weight: 600; cursor: pointer; list-style: none; }
.mcat-edit summary::-webkit-details-marker { display: none; }
.mcat-edit summary::after { content: " ›"; }
.mcat-edit[open] summary::after { content: " ‹"; }
.mcat-edit form { padding: 0 18px; }
.mcat-edit form + form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 18px 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.mnew { margin-top: 20px; }
.mnew-first { max-width: 860px; padding: 32px; }
.mnew-first h2 { margin-bottom: 0.4em; }
.mnote { margin-top: 16px; }
.back-link { display: inline-block; margin-bottom: 6px; color: var(--muted); text-decoration: none; font-weight: 600; }
.mform-grid { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 20px; align-items: start; }
.mform-photo { position: sticky; top: 16px; }
.photo-drop { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border: 2px dashed var(--line-2); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; cursor: pointer; }
.photo-drop:hover, .photo-drop.dragover { border-color: var(--accent); }
.photo-drop.has-photo { border-style: solid; border-color: transparent; }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop input[type="file"] { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.photo-drop:focus-within { outline: 2px solid var(--copper); outline-offset: 2px; }
.photo-empty { display: grid; justify-items: center; gap: 4px; padding: 16px; text-align: center; color: var(--muted); }
.photo-empty svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; margin-bottom: 4px; }
.photo-empty small { color: var(--faint); }
.photo-change { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 99px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.8rem; font-weight: 700; white-space: nowrap; pointer-events: none; }
.photo-status { min-height: 1.3em; margin: 10px 0 6px; color: var(--muted); }
.photo-status.is-error { color: var(--err); }
.lang-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 4px 0 18px; overflow-x: auto; }
.lang-tabs button { padding: 10px 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 600 0.92rem var(--font); cursor: pointer; white-space: nowrap; }
.lang-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.lang-dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--copper); vertical-align: 2px; }
.mform fieldset { border: 0; padding: 0; margin: 4px 0 20px; min-width: 0; }
.mform legend { padding: 0; margin-bottom: 8px; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.price-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.price-input { position: relative; display: block; }
.price-input input { padding-right: 34px; }
.price-input span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.prices small { display: block; margin-top: 4px; color: var(--faint); font-size: 0.8rem; }
.prices [data-add-price] { margin-top: 2px; }
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span { display: inline-block; padding: 8px 15px; border: 1px solid var(--line-2); border-radius: 99px; font-weight: 600; font-size: 0.875rem; color: var(--muted); cursor: pointer; user-select: none; }
.pick input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.pick input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }
.stock-check { margin: 0 0 22px; }
.stock-check b { display: block; color: var(--text); }
.stock-check small { display: block; color: var(--faint); }
.mform-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mform-delete { margin-top: 16px; }
@media (max-width: 900px) {
  .mform-grid { grid-template-columns: 1fr; }
  .mform-photo { position: static; }
}
@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
  .mcat-head { padding: 12px 12px 12px 14px; }
  .mcat-title h2 { font-size: 1.15rem; }
  .switch { min-width: 0; }
  .switch-label { display: none; }
  .mnew-first { padding: 22px; }
}
body.is-dragging { -webkit-user-select: none; user-select: none; cursor: grabbing; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 30; max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 99px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 0.9rem; text-align: center; opacity: 0; transform: translate(-50%, 16px); transition: opacity 0.2s, transform 0.2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--err); color: #fff; }

/* Guest list: one-tap selections and the filter panel. */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.preset { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 0.875rem; text-decoration: none; white-space: nowrap; }
.preset:hover { color: var(--text); border-color: var(--text); }
.preset.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.preset-reset { border-style: dashed; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 14px; padding: 18px 18px 6px; margin-bottom: 20px; }
.filters .field { margin-bottom: 12px; }
.filters .field > span { font-size: 0.8rem; margin-bottom: 4px; }
.filters input, .filters select { min-height: 42px; padding: 8px 12px; font-size: 0.92rem; }
.filters-q { grid-column: span 2; }
.filters-go { display: flex; align-items: flex-end; padding-bottom: 12px; }
.filters-go .btn { width: 100%; min-height: 42px; }
@media (max-width: 640px) {
  /* One swipeable row of selections keeps the list on the first screen. */
  .presets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .presets::-webkit-scrollbar { display: none; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters-q { grid-column: 1 / -1; }
}
