/* The guest's menu (TechDocs/POS_QR_MENU.md). Served from /menu-assets/ rather
   than /m/…, so the param route never has to tell a file from a token. Kept
   plain on purpose: it is a page for a phone at a counter, not part of the
   marketing design system, and it must not need a build step. */

:root {
  --bg: #f6f7f8;
  --card: #fff;
  --ink: #1c2126;
  --muted: #667079;
  --line: #e3e6e9;
  --accent: #0a6cff;
  --off: #9aa3ab;
  --badge: #eceff2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --card: #1e2226;
    --ink: #f1f3f4;
    --muted: #a0a9b1;
    --line: #2d3339;
    --accent: #5aa0ff;
    --off: #6c757d;
    --badge: #2a3036;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }

.top { padding: 28px 16px 8px; max-width: 720px; margin: 0 auto; }
.top h1 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; }
.top .sub { margin: 4px 0 0; color: var(--muted); }
.at-table {
  display: inline-block; margin: 10px 0 0; padding: 4px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: 15px; color: var(--muted);
}
.at-table b { color: var(--ink); }

.brand { display: flex; align-items: center; gap: 14px; }
.logo { flex: none; width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: var(--card); border: 1px solid var(--line); }
.contacts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: 15px; color: var(--muted); }
.contacts a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
.c-hours summary { cursor: pointer; color: var(--ink); }
.week { list-style: none; margin: 6px 0 0; padding: 8px 12px; display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.week li { display: flex; justify-content: space-between; gap: 16px; }
.week b { font-weight: 600; color: var(--ink); white-space: nowrap; }

.tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 16px; margin-top: 8px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; padding: 8px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
}
.tabs a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

main { max-width: 720px; margin: 0 auto; padding: 0 16px 24px; }
.cat { padding-top: 24px; scroll-margin-top: 64px; }
.cat h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: -0.01em; }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.empty { color: var(--muted); padding: 32px 0; text-align: center; }

.item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px;
}
.pic { flex: none; width: 88px; height: 88px; border-radius: 12px; overflow: hidden; background: var(--badge); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.body { flex: 1; min-width: 0; }
.body h3 { margin: 0; font-size: 17px; line-height: 1.25; }
.desc { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.comp { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.comp b { font-weight: 600; color: var(--ink); }
.allergens { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.allergens li {
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--badge); color: var(--ink); border: 1px solid var(--line);
}
.allergen-line { font-weight: 600; }
.foot .foot-note { margin: 0 0 8px; color: var(--ink); }
.price { margin: 6px 0 0; font-weight: 700; }

.badge {
  display: inline-block; vertical-align: 2px; margin-left: 6px;
  padding: 1px 8px; border-radius: 999px;
  background: var(--badge); color: var(--muted);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.badge:empty { display: none; }

/* A dish that is stopped or out stays on the page, greyed and captioned:
   «Сирника немає» is an answer to the guest, an empty gap is not. */
.item[data-state="stop"] .pic, .item[data-state="out"] .pic { opacity: 0.45; }
.item[data-state="stop"] h3, .item[data-state="out"] h3,
.item[data-state="stop"] .price, .item[data-state="out"] .price,
.item[data-state="stop"] .desc, .item[data-state="out"] .desc,
.item[data-state="stop"] .comp, .item[data-state="out"] .comp,
.item[data-state="stop"] .comp b, .item[data-state="out"] .comp b { color: var(--off); }

.sizes { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sizes li {
  padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line);
  font-size: 14px; white-space: nowrap;
}
.sizes li b { font-weight: 700; }
.sizes li.off { color: var(--off); text-decoration: line-through; }

.mods { margin-top: 8px; font-size: 14px; }
.mods summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.group { margin-top: 8px; }
.group h4 { margin: 0; font-size: 14px; }
.group h4 small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.group p { margin: 2px 0 0; color: var(--muted); }
.group b { color: var(--ink); font-weight: 600; white-space: nowrap; }

.foot { max-width: 720px; margin: 0 auto; padding: 8px 16px 40px; color: var(--muted); font-size: 13px; text-align: center; }
.foot p { margin: 4px 0; }

.gone { max-width: 420px; margin: 20vh auto 0; padding: 0 20px; text-align: center; }
.gone h1 { font-size: 24px; margin: 0 0 8px; }
.gone p { color: var(--muted); margin: 0; }

/* The table-tent card. */
.qr-page { background: var(--bg); }
.card {
  max-width: 360px; margin: 32px auto; padding: 28px 24px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
}
.card h1 { margin: 0; font-size: 26px; line-height: 1.15; }
.card .lead { margin: 6px 0 16px; font-size: 18px; font-weight: 600; }
.qr { width: 260px; max-width: 100%; margin: 0 auto; }
.qr svg { width: 100%; height: auto; display: block; }
.seat { margin: 6px 0 0; }
.seat b { display: block; font-size: 30px; line-height: 1.1; }
.seat span { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; }

.sheet-head {
  max-width: 900px; margin: 24px auto 0; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.sheet-head h1 { margin: 0; font-size: 24px; }
.sheet-head p { margin: 2px 0 0; color: var(--muted); }
.sheet-head .print { margin-top: 0; }
.sheet {
  max-width: 900px; margin: 16px auto 32px; padding: 0 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px;
}
.sheet .empty { grid-column: 1 / -1; }
.table-card { margin: 0; max-width: none; padding: 20px 16px; }
.table-card h2 { margin: 0; font-size: 16px; color: var(--muted); font-weight: 600; }
.table-card .qr { width: 180px; margin-top: 12px; }
.table-card .hint { margin-top: 10px; }

.card .url { margin: 12px 0 0; color: var(--muted); font-size: 13px; word-break: break-all; }
.card .hint { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.print {
  margin-top: 20px; padding: 12px 22px; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}

/* The guest's bill (phase Q5): a bar over the bottom edge and a sheet over the page. */
.dock {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20;
  max-width: 688px; margin: 0 auto; display: grid; gap: 8px;
}
.dock:empty { display: none; }
.bill-bar, .cart-bar {
  width: 100%; padding: 14px 20px; border: 0; border-radius: 14px;
  font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}
.bill-bar { background: var(--ink); color: var(--bg); }
.cart-bar { background: var(--accent); color: #fff; }
.bill-bar[hidden], .cart-bar[hidden] { display: none; }
body:has(.dock:not(:empty)) .foot { padding-bottom: 150px; }
.bill-sheet {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}
.bill-sheet[hidden] { display: none; }
body.bill-open { overflow: hidden; }
.bill-panel {
  width: 100%; max-width: 720px; max-height: 88vh; overflow: auto;
  background: var(--card); border-radius: 20px 20px 0 0; padding: 0 20px 24px;
}
.bill-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 0 10px; background: var(--card); border-bottom: 1px solid var(--line);
}
.bill-head h2 { margin: 0; font-size: 20px; }
.bill-close {
  width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--badge); color: var(--ink);
  font: inherit; font-size: 24px; line-height: 1; cursor: pointer;
}
.bill-round { padding-top: 16px; }
.bill-round-head {
  margin: 0 0 6px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-size: 15px; color: var(--muted);
}
.bill-status { padding: 1px 8px; border-radius: 999px; background: var(--badge); font-size: 12px; font-weight: 600; }
.bill-line { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; }
.bill-line-name { min-width: 0; }
.bill-line-name small { display: block; color: var(--muted); font-size: 13px; }
.bill-line.paid { color: var(--off); }
.bill-line b { white-space: nowrap; }
.bill-paid { color: var(--off); }
.bill-total {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; padding-top: 14px;
  border-top: 2px solid var(--ink); font-size: 20px; font-weight: 700;
}
.bill-note { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

/* Ordering (phase Q6): the «Додати» button on a dish, the sheet that asks the
   dish's questions, the cart, and the guest's own requests. */
.add {
  margin-top: 10px; padding: 8px 16px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
}
.item[data-state="stop"] .add, .item[data-state="out"] .add { display: none; }
.opt-head { margin: 18px 0 6px; font-size: 15px; }
.opt-head small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.opt.on { border-color: var(--accent); background: var(--badge); }
.opt.off { color: var(--off); text-decoration: line-through; cursor: default; }
.opt input { margin-right: 10px; }
.opt span { flex: 1; }
.opt b { white-space: nowrap; font-weight: 600; }
.note-input {
  width: 100%; margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--ink); font: inherit;
}
.qty { display: inline-flex; align-items: center; gap: 12px; }
.qty button {
  width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  color: var(--ink); font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
}
.qty output { min-width: 1.5em; text-align: center; font-weight: 700; }
.order-foot { position: sticky; bottom: 0; padding: 12px 0 0; background: var(--card); }
.primary {
  width: 100%; padding: 14px 20px; border: 0; border-radius: 14px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.primary:disabled { opacity: 0.45; cursor: default; }
.link-btn { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.cart-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cart-line small { display: block; color: var(--muted); font-size: 13px; }
.cart-line .qty { flex: none; }
.req { padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.req b { display: block; }
.req small { display: block; color: var(--muted); }
.req.pending b { color: var(--accent); }
.error { margin: 10px 0 0; color: #c0392b; font-size: 14px; }

/* A print page opened without the owner's link: visible on screen, never on paper. */
.notice {
  max-width: 900px; margin: 16px auto 0; padding: 10px 14px; border-radius: 12px;
  background: var(--badge); color: var(--ink); font-size: 14px;
}

/* Explicit sizes: `A6` is not a page-size keyword in CSS (only A5, A4, A3, B5,
   B4, JIS-B5, JIS-B4, letter, legal, ledger), and an invalid `size` is dropped
   silently — the card would print on Letter. */
@page card { size: 105mm 148mm; margin: 8mm; }
@page sheet { size: 210mm 297mm; margin: 10mm; }
.qr-page { page: card; }
.sheet-page { page: sheet; }

@media print {
  body { background: #fff; color: #000; }
  .print, .notice, .dock, .bill-sheet, .add { display: none; }
  /* The heading and the button are for the screen; on paper the cards get
     the whole page — three rows of two fit an A4, ten tables take two sheets. */
  .sheet-head { display: none; }
  .sheet { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5mm; margin: 0; padding: 0; max-width: none; }
  .card { border: 0; margin: 0 auto; padding: 0; background: #fff; max-width: none; }
  .card .lead, .card h1, .card .url, .card .hint { color: #000; }
  .qr { width: 70mm; }
  /* After the single-card rules above: a table card on the sheet keeps its
     cut line and its own, smaller QR. */
  .table-card { break-inside: avoid; border: 1px dashed #999; border-radius: 4mm; padding: 4mm; background: #fff; margin: 0; }
  .table-card h2, .seat span { color: #333; }
  .table-card .qr { width: 44mm; margin-top: 3mm; }
  .table-card .hint { margin-top: 2mm; }
}
