/* Blackstock Market · QR ordering. A market hall's signs: each unit's name on a tile-green enamel plate, the rest a
   printed menu board. Light by day, dark for the theatres and the evening (the phone's own setting). */
@font-face { font-family: 'BM Sign'; src: url('/fonts/bm-sign-regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'BM Sign'; src: url('/fonts/bm-sign-bold.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'BM Text'; src: url('/fonts/bm-text.woff') format('woff'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'BM Text'; src: url('/fonts/bm-text-italic.woff') format('woff'); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --paper: #f2f4f1; --sheet: #fbfcfa; --ink: #1b2420; --muted: #57655f; --rule: #d3dbd6;
  --tile: #1f5e4b; --tile-ink: #f2f4f1; --tile-soft: #e1ece6; --brass: #b9892c; --brass-ink: #6e4f12; --brass-soft: #f3e7c6;
  --warn: #a3302a; --warn-soft: #f7e3e1; --ok: #1f6b43; --shade: rgba(16, 26, 22, .45);
  --sign: 'BM Sign', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --text: 'BM Text', Georgia, 'Times New Roman', serif;
  --gut: 16px; --max: 620px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1714; --sheet: #16211d; --ink: #e5ebe7; --muted: #9db0a7; --rule: #2a3933;
    --tile: #2f8667; --tile-ink: #f2f6f3; --tile-soft: #1c3029; --brass: #d9ae4f; --brass-ink: #f0d48e; --brass-soft: #3a3020;
    --warn: #e58079; --warn-soft: #3a2221; --ok: #6cc597; --shade: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.35 var(--sign); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.boot { max-width: var(--max); margin: 40vh auto 0; padding: 0 var(--gut); text-align: center; color: var(--muted); font-family: var(--text); }
.serif { font-family: var(--text); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.money { font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }

/* ---------- the top: where you are, and your order ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top); }
.top-in { max-width: var(--max); margin: 0 auto; padding: 10px var(--gut) 8px; display: flex; align-items: center; gap: 12px; }
.top-where { flex: 1; min-width: 0; }
.top-venue { font-size: 14px; color: var(--muted); letter-spacing: .02em; }
.top-place { font-weight: 700; font-size: 21px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bag { flex: none; min-width: 48px; height: 44px; padding: 0 12px; border: 1.5px solid var(--tile); border-radius: 22px; background: transparent; color: var(--tile); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.bag[data-n="0"] { opacity: .55; }
.bag svg { width: 18px; height: 18px; }

/* ---------- the units: enamel signs ---------- */
.signs { display: flex; gap: 10px; overflow-x: auto; padding: 12px var(--gut) 10px; max-width: var(--max); margin: 0 auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.signs::-webkit-scrollbar { display: none; }
.sign { flex: none; scroll-snap-align: start; border: 0; padding: 0; background: none; }
.plate { display: block; padding: 9px 16px 8px; border-radius: 5px; font-weight: 700; font-size: 17px; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap;
  color: var(--tile); background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--tile); }
.sign[aria-pressed="true"] .plate { color: var(--tile-ink); background: var(--tile); box-shadow: inset 0 0 0 1.5px var(--tile), inset 0 0 0 4px var(--tile), inset 0 0 0 5px var(--brass); }
.hero-sign { margin: 18px 0 6px; }
.hero-sign .plate { display: inline-block; font-size: 30px; line-height: 1; padding: 16px 22px 14px; letter-spacing: .1em; white-space: normal;
  color: var(--tile-ink); background: var(--tile); box-shadow: inset 0 0 0 5px var(--tile), inset 0 0 0 7px var(--brass), inset 0 0 0 9px var(--tile); }

/* ---------- categories ---------- */
.cats { position: sticky; z-index: 15; background: var(--paper); border-bottom: 1px solid var(--rule); }
.cats-in { max-width: var(--max); margin: 0 auto; display: flex; gap: 4px; overflow-x: auto; padding: 0 calc(var(--gut) - 10px); scrollbar-width: none; }
.cats-in::-webkit-scrollbar { display: none; }
.cat-link { flex: none; border: 0; background: none; padding: 12px 10px 10px; font-size: 16px; color: var(--muted); border-bottom: 3px solid transparent; }
.cat-link[aria-current="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--brass); }

/* ---------- the menu board ---------- */
.board { padding-bottom: 120px; }
.cat-h { font-weight: 700; font-size: 27px; line-height: 1.1; margin: 30px 0 4px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); scroll-margin-top: 120px; }
.sub-h { font-weight: 700; font-size: 17px; color: var(--muted); margin: 22px 0 0; letter-spacing: .02em; }
.sub-h.l2 { font-size: 15px; margin-top: 14px; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 14px 0 15px; border-bottom: 1px solid var(--rule); }
.item-main { border: 0; background: none; padding: 0; text-align: left; min-width: 0; }
.item-name { font-weight: 700; font-size: 19px; line-height: 1.15; }
.item-desc { font-family: var(--text); font-size: 15px; line-height: 1.45; color: var(--muted); margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-top: 7px; align-items: center; font-size: 14px; color: var(--muted); }
.item-alg { font-size: 14px; color: var(--muted); }
.item-price { margin-top: 8px; font-weight: 700; font-size: 18px; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.item-photo { width: 76px; height: 76px; border-radius: 6px; object-fit: cover; background: var(--tile-soft); display: block; }
.add { min-width: 76px; height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid var(--tile); background: var(--paper); color: var(--tile); font-weight: 700; font-size: 16px; }
.item.out .item-name, .item.out .item-price { color: var(--muted); }
.tag { display: inline-block; padding: 2px 7px 1px; border-radius: 3px; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.tag.offer { background: var(--brass-soft); color: var(--brass-ink); }
.tag.age { box-shadow: inset 0 0 0 1.5px var(--warn); color: var(--warn); }
.tag.diet { background: var(--tile-soft); color: var(--tile); }
.tag.out { background: var(--warn-soft); color: var(--warn); }
.note-line { font-family: var(--text); font-size: 15px; color: var(--muted); margin: 14px 0 0; }

/* ---------- messages ---------- */
.banner { margin: 14px 0 0; padding: 12px 14px; border-radius: 8px; background: var(--warn-soft); color: var(--ink); font-family: var(--text); font-size: 15.5px; line-height: 1.45; }
.banner b { font-family: var(--sign); font-size: 17px; display: block; margin-bottom: 2px; }
.banner.calm { background: var(--tile-soft); }
.banner a { color: var(--tile); font-weight: 600; text-underline-offset: 2px; }
.empty-page { padding-top: 18vh; text-align: left; }
.empty-page h1 { font-weight: 700; font-size: 34px; line-height: 1.05; margin: 0 0 12px; }
.empty-page p { font-family: var(--text); font-size: 17px; line-height: 1.5; color: var(--muted); margin: 0 0 10px; max-width: 32em; }

/* ---------- the bar at the bottom ---------- */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--paper) 70%, transparent); pointer-events: none; }
.bar-btn { pointer-events: auto; max-width: calc(var(--max) - 2 * var(--gut)); margin: 0 auto; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 56px; padding: 0 20px; border: 0; border-radius: 28px; background: var(--tile); color: var(--tile-ink); font-weight: 700; font-size: 18px; box-shadow: 0 6px 18px rgba(16, 40, 31, .28); }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: var(--shade); }
.sheet[hidden] { display: none; }
.panel { width: 100%; max-width: var(--max); max-height: 94vh; overflow-y: auto; overscroll-behavior: contain; background: var(--sheet); border-radius: 18px 18px 0 0;
  padding: 0 var(--gut) calc(18px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(28px); opacity: .4; } to { transform: none; opacity: 1; } }
.panel-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0 10px; background: var(--sheet); }
.panel-top h2 { font-weight: 700; font-size: 24px; line-height: 1.1; margin: 0; }
.close { flex: none; width: 44px; height: 44px; border-radius: 22px; border: 1.5px solid var(--rule); background: var(--sheet); font-size: 22px; line-height: 1; }
.hero-photo { width: calc(100% + 2 * var(--gut)); margin: 0 calc(-1 * var(--gut)) 12px; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--tile-soft); }
.lead { font-family: var(--text); font-size: 16px; line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.alg-box { margin: 14px 0; padding: 12px 14px; border-left: 4px solid var(--brass); background: var(--paper); border-radius: 0 6px 6px 0; }
.alg-box b { display: block; font-size: 16px; margin-bottom: 3px; }
.alg-box p { margin: 2px 0; font-size: 15.5px; }
.alg-box .serif { font-size: 14.5px; color: var(--muted); }
.group { margin: 18px 0 0; border: 0; padding: 0; }
.group > legend, .group-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; width: 100%; padding: 0; margin: 0 0 8px; }
.group-h b, .group > legend b { font-size: 18px; }
.group-h span, .group > legend span { font-size: 14.5px; color: var(--muted); }
.opts { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 420px) { .opts { grid-template-columns: 1fr 1fr; } }
.opt { min-height: 52px; padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--rule); background: var(--sheet); text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.opt small { font-size: 13.5px; color: var(--muted); }
.opt[aria-pressed="true"], .opt[aria-checked="true"] { border-color: var(--tile); box-shadow: inset 0 0 0 1px var(--tile); background: var(--tile-soft); }
.opt:disabled { opacity: .45; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1.5px solid var(--rule); background: var(--sheet); font-size: 15.5px; }
.chip[aria-pressed="true"] { border-color: var(--tile); background: var(--tile-soft); color: var(--tile); font-weight: 700; }
.field { display: block; margin: 18px 0 0; }
.field > span { display: block; font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; min-height: 48px; padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--rule); background: var(--paper); font-family: var(--text); font-size: 16.5px; }
.field textarea { min-height: 70px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--tile); outline: none; box-shadow: 0 0 0 3px var(--brass-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--rule); border-radius: 24px; }
.qty button { width: 44px; height: 44px; border: 0; background: none; font-size: 22px; font-weight: 700; color: var(--tile); }
.qty button:disabled { color: var(--rule); cursor: default; }
.qty b { min-width: 30px; text-align: center; font-size: 18px; }
.qty.sm button { width: 38px; height: 38px; font-size: 19px; }
.cta { width: 100%; min-height: 54px; margin-top: 18px; padding: 0 18px; border: 0; border-radius: 27px; background: var(--tile); color: var(--tile-ink); font-weight: 700; font-size: 18px; }
.cta:disabled { background: var(--rule); color: var(--muted); cursor: default; }
.ghost { width: 100%; min-height: 48px; margin-top: 10px; border: 1.5px solid var(--rule); border-radius: 24px; background: transparent; font-size: 16.5px; }
.err { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 15.5px; }
.add-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; }

/* ---------- your order ---------- */
.unit-h { font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--tile); margin: 18px 0 2px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.line-name { font-weight: 700; font-size: 17.5px; }
.line-sub { font-family: var(--text); font-size: 14.5px; color: var(--muted); margin-top: 2px; }
.line-off { font-size: 14.5px; color: var(--brass-ink); margin-top: 3px; }
.line-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.line-price { font-weight: 700; font-size: 17px; }
.line-price s { color: var(--muted); font-weight: 400; margin-right: 6px; }
.nudge { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--brass-soft); color: var(--brass-ink); font-size: 15.5px; }
.sum { margin-top: 18px; }
.sum div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 16.5px; }
.sum .saved { color: var(--brass-ink); }
.sum .total { font-weight: 700; font-size: 22px; padding-top: 10px; margin-top: 6px; border-top: 2px solid var(--ink); }
.codes { display: flex; gap: 8px; }
.codes input { flex: 1; text-transform: uppercase; }
.codes input::placeholder { text-transform: none; }
.codes button { flex: none; min-width: 72px; border-radius: 10px; border: 1.5px solid var(--tile); background: transparent; color: var(--tile); font-weight: 700; }
.code-chip { display: inline-flex; align-items: center; gap: 6px; margin: 8px 8px 0 0; padding: 4px 6px 4px 10px; border-radius: 16px; background: var(--tile-soft); color: var(--tile); font-weight: 700; font-size: 15px; }
.code-chip button { width: 28px; height: 28px; border: 0; border-radius: 14px; background: transparent; color: inherit; font-size: 15px; }
.small { font-family: var(--text); font-size: 14.5px; line-height: 1.45; color: var(--muted); margin: 10px 0 0; }
.wait { opacity: .55; }

/* ---------- the ticket: an order that's in ---------- */
.ticket { margin: 26px auto 0; max-width: 420px; background: var(--sheet); border-radius: 4px; padding: 24px 22px 22px; position: relative; text-align: center;
  box-shadow: 0 1px 0 var(--rule), 0 10px 30px rgba(16, 40, 31, .12); animation: print .55s cubic-bezier(.2, .8, .2, 1) both; }
.ticket::before, .ticket::after { content: ''; position: absolute; left: 0; right: 0; height: 10px;
  background: radial-gradient(circle at 6px -1px, var(--paper) 6px, transparent 6.5px) repeat-x; background-size: 14px 10px; }
.ticket::before { top: 0; }
.ticket::after { bottom: 0; transform: rotate(180deg); }
@keyframes print { from { transform: translateY(-24px); clip-path: inset(0 0 100% 0); } to { transform: none; clip-path: inset(0 0 0 0); } }
.ticket-k { font-size: 16px; color: var(--muted); letter-spacing: .04em; margin-top: 4px; }
.ticket-no { font-weight: 700; font-size: 96px; line-height: .95; letter-spacing: -.01em; margin: 6px 0 4px; font-variant-numeric: tabular-nums lining-nums; }
.ticket-where { font-size: 19px; font-weight: 700; }
.ticket-paid { font-family: var(--text); font-size: 15.5px; color: var(--muted); margin-top: 4px; }
.progress { margin: 20px 0 0; padding: 0; list-style: none; text-align: left; border-top: 1px dashed var(--rule); }
.progress li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 2px; border-bottom: 1px dashed var(--rule); font-size: 17px; }
.state { font-weight: 700; }
.state.making { color: var(--brass-ink); }
.state.ready, .state.done { color: var(--ok); }
.after { max-width: 420px; margin: 18px auto 0; }

.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 22px; background: var(--ink); color: var(--paper); font-size: 16px; max-width: calc(100% - 32px); transition: opacity .18s, transform .18s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.foot-links { display: flex; gap: 20px; margin: 10px 0 0; font-family: var(--text); font-size: 14px; }
.foot-links a, .small a { color: var(--tile); text-underline-offset: 2px; }
.foot { margin: 34px 0 0; padding: 16px 0 0; border-top: 1px solid var(--rule); font-family: var(--text); font-size: 14px; color: var(--muted); line-height: 1.5; }

@media (prefers-reduced-motion: reduce) { .panel, .ticket { animation: none; } .toast { transition: none; } }
