/* ThaiQR guest menu. Mobile first: one hand, bright light, a weak signal.
   "Kitchen ticket": a menu that reads like the pass of a good kitchen. The dish NUMBER is stamped on the photo (or in a
   box when there is none), names are set in a book serif with the Thai name below, prices sit at the end of a dotted
   leader. The staff screen is a receipt on espresso. Neutrals do the work; --accent (the venue's colour) only marks what
   is in the order. One light theme everywhere: no dark variant. Tokens come from tokens.css. */

:root {
	--accent-text: var(--accent-on-paper, var(--accent));
	--rail-top: 0px;
	--bar-h: var(--h-bar);
	/* the guest page uses the shared heights (tokens.css): every one-line control is 44 */
	--g-ctl: var(--h-ctl);
	--g-ctl-sm: var(--h-ctl);
}
body.guest { overflow-x: clip; -webkit-tap-highlight-color: transparent; padding-bottom: calc(var(--bar-h) + 28px + env(safe-area-inset-bottom)); }
body.guest.lock { overflow: hidden; }
.shell { max-width: 680px; margin: 0 auto; }

/* ------------------------------------------------------------------ preview banner (owner's draft view) */
.preview-banner { position: sticky; top: 0; z-index: 60; display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; min-height: var(--h-ctl); padding: 4px var(--gutter); background: #241810; color: #f5ecd8; font: 500 .6875rem/1.5 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.preview-banner a { color: #f5ecd8; }

/* ------------------------------------------------------------------ masthead: the title block of the sheet */
.mast { padding: 16px var(--gutter) 4px; }
.tb { border: 2px solid var(--ink); background: var(--paper); container-type: inline-size; }
.tb-name { display: flex; align-items: center; gap: 12px; padding: 12px 14px 10px; border-bottom: 2px solid var(--ink); }
.tb-name .logo { width: var(--h-pic); height: var(--h-pic); max-width: none; flex: none; border: 2px solid var(--ink); background: var(--paper-2); object-fit: cover; }
.tb-name .logo.ph { display: grid; place-items: center; font: 600 1.5rem/1 var(--font-display); }
.tb-name h1 { margin: 0; font-size: clamp(1.5rem, 6.6vw, 2.125rem); line-height: 1.05; letter-spacing: -.015em; overflow-wrap: anywhere; }
.tb-name .tag { margin-top: 4px; color: var(--ink-3); font-size: var(--fs-md); line-height: 1.3; }
/* one row under the name: whether it is open now (it takes the room), the table, the language */
.tb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: stretch; }
.tb-c { display: inline-flex; align-items: center; gap: 8px; min-height: var(--g-ctl-sm); padding: 0 12px; border: 0; border-left: 2px solid var(--ink); background: none; color: var(--ink); font: 500 .6875rem/1.2 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); text-decoration: none; }
.tb-c b { font: 500 .9375rem/1 var(--font-mono); letter-spacing: 0; }
.tb-c .i { color: var(--ink-3); }
.tb-c:active { background: var(--stone); }
.tb-c.table { grid-column: 2; min-width: 0; }
.tb-c.table b { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tb-c.table b { display: inline-flex; align-items: center; min-height: var(--h-tag); padding: 0 7px; background: var(--ink); color: var(--paper); }
.tb-c.lang { grid-column: 3; gap: 6px; letter-spacing: .06em; }
.tb-c.lang .chev { width: 14px; height: 14px; }
.status { grid-column: 1; display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; padding: 6px 14px; color: var(--ink); font: 500 .6875rem/1.3 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.status .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--ok); }
/* a narrow phone with a table: "open until" and the language share the first line, the table gets the whole second
   one, so a label like "Terrace 12" is read in full */
@container (max-width: 380px) {
	.tb-row:has(.status):has(.tb-c.table:not([style*="none"])) { grid-template-columns: minmax(0, 1fr) auto; }
	.tb-row:has(.status):has(.tb-c.table:not([style*="none"])) .status { grid-column: 1; grid-row: 1; }
	.tb-row:has(.status):has(.tb-c.table:not([style*="none"])) .tb-c.lang { grid-column: 2; grid-row: 1; }
	.tb-row:has(.status):has(.tb-c.table:not([style*="none"])) .tb-c.table { grid-column: 1 / -1; grid-row: 2; border-left: 0; border-top: 2px solid var(--ink); }
}
.status.closed .dot { background: var(--ink-3); }
.cover { display: block; width: 100%; height: auto; aspect-ratio: 16 / 7; max-height: 200px; margin: 12px 0 0; border: 2px solid var(--ink); object-fit: cover; background: var(--stone); }
/* the shortcuts stay inside the column like every other block: an even grid (two on a phone, four on a wide screen),
   an odd last one takes the whole row */
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 12px 0 0; }
.quick > :last-child:nth-child(odd):not(:first-child) { grid-column: 1 / -1; }
.pill-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: var(--g-ctl-sm); padding: 0 12px; white-space: nowrap; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: 500 .6875rem/1 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); text-decoration: none; }
.pill-btn .i { color: var(--ink-3); }
.pill-btn:active { background: var(--stone); }


/* ------------------------------------------------------------------ find: search, number pad, diet filter */
.find { display: flex; gap: 8px; padding: 12px var(--gutter) 0; }
.field { position: relative; flex: 1; min-width: 0; }
.field .i { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.field input { width: 100%; height: var(--g-ctl); padding: 0 14px 0 42px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); font-size: 1rem; text-overflow: ellipsis; }
.field input::placeholder { color: var(--ink-3); }
.field input:focus { outline: 0; background: var(--paper-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 38%, transparent); }
.sq-btn { position: relative; width: var(--g-ctl); height: var(--g-ctl); flex: none; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); }
.sq-btn.num { background: var(--ink); color: var(--paper); }
.sq-btn:active { background: var(--stone); }
.sq-btn.num:active { background: var(--ink-2); }
.sq-btn .n { position: absolute; top: -9px; right: -9px; min-width: 22px; height: 22px; padding: 0 5px; display: grid; place-items: center; border: 2px solid var(--bg); background: var(--accent); color: var(--accent-ink); font: 500 .6875rem/1 var(--font-mono); }
.chipnote { display: flex; align-items: center; gap: 10px; min-height: var(--h-ctl); margin: 12px var(--gutter) 0; padding: 0 12px; border: 2px dashed var(--ink-3); background: var(--paper); font-size: var(--fs-sm); }
.chipnote button { margin-left: auto; padding: 6px; border: 0; background: transparent; color: inherit; font-weight: 600; text-decoration: underline; }

/* ------------------------------------------------------------------ sticky station tabs */
.rail { position: sticky; top: var(--rail-top); z-index: 30; margin-top: 14px; background: var(--bg); border-bottom: 2px solid var(--ink); }
.rail-in { display: flex; align-items: flex-end; max-width: 680px; margin: 0 auto; }
.rail nav { flex: 1; min-width: 0; display: flex; align-items: flex-end; overflow-x: auto; padding-inline: var(--gutter) 0; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.rail nav::-webkit-scrollbar { display: none; }
.rail nav a { flex: none; display: flex; align-items: center; min-height: var(--h-ctl); padding: 0 14px; margin-right: -2px; border: 2px solid var(--ink); border-bottom: 0; background: var(--stone); color: var(--ink-3); font: 500 .6875rem/1.2 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); text-decoration: none; white-space: nowrap; scroll-snap-align: start; }
.rail nav a[aria-current="true"] { background: var(--ink); color: var(--paper); }
/* the tools end where the dishes end */
.rail .tools { display: flex; align-items: center; gap: 2px; padding: 0 var(--gutter) 4px 4px; }
.rail .tools button { width: var(--h-ctl); height: var(--h-ctl); display: grid; place-items: center; border: 0; background: transparent; color: var(--ink-3); }
.rail .tools button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ------------------------------------------------------------------ menu */
.cat { scroll-margin-top: calc(var(--rail-top) + 54px); }
.cat h2 { display: flex; align-items: baseline; gap: 10px; padding: 26px var(--gutter) 10px; font-size: 1.375rem; font-weight: 600; }
.cat h2 .lead { flex: 1; min-width: 12px; border-bottom: 2px dotted var(--line); transform: translateY(-4px); }
.cat h2 small { color: var(--ink-3); font: 500 .75rem/1 var(--font-mono); letter-spacing: 0; }
.dishes { display: flex; flex-direction: column; gap: 10px; padding: 0 var(--gutter); container: dishes / inline-size; }

/* photo | text, and the price line under the text; the photo spans both rows, so the price line sits at the bottom */
.dish { position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 0 12px; padding: 10px; border: 2px solid var(--ink); background: var(--paper); cursor: pointer; }
.dish > .photo { grid-column: 1; grid-row: 1 / 3; }
.dish > .body { grid-column: 2; grid-row: 1; }
.dish > .buy { grid-column: 2; grid-row: 2; }
.dish:active { background: var(--stone); }
.dish.has { box-shadow: inset 5px 0 0 var(--accent); }
.dish .photo { position: relative; width: 88px; height: 88px; overflow: hidden; border: 2px solid var(--ink); background: var(--stone); }
.dish .photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
/* the dish number is stamped on the corner of its photo */
.dish .tk { position: absolute; left: 0; bottom: 0; display: inline-grid; place-items: center; min-width: 34px; min-height: var(--h-tag); padding: 0 7px; background: var(--ink); color: var(--paper); font: 500 .8125rem/1.35 var(--font-mono); font-variant-numeric: tabular-nums; text-align: center; }
.dish .body { min-width: 0; display: flex; flex-direction: column; }
.dish h3 { font-size: 1.1875rem; font-weight: 600; line-height: 1.15; text-wrap: pretty; overflow-wrap: anywhere; hyphens: auto; }
.dish .th { margin: 3px 0 0; color: var(--ink-3); font: 500 .875rem/1.4 var(--font-th); }
.dish .desc { display: -webkit-box; margin: 6px 0 0; overflow: hidden; color: var(--ink-2); font-size: var(--fs-md); line-height: 1.4; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.dish .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.dish .buy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 8px; }
/* a narrow phone: the price line runs across the whole card, so the stepper replaces the "+" in place */
@container dishes (max-width: 339px) {
	.menu:not(.grid) .dish > .photo { grid-row: 1; }
	.menu:not(.grid) .dish > .buy { grid-column: 1 / -1; }
}
.dish .buy .act, .dish .buy .soldtag { margin-left: auto; }
.buy .lead { flex: 1; min-width: 8px; border-bottom: 2px dotted var(--line); transform: translateY(-3px); }
.dish.sold .tk { background: var(--ink-3); }
/* no photo, list mode: the number sits in a box and the text uses the full width */
.menu:not(.grid) .dish:not(.has-photo) { grid-template-columns: 58px minmax(0, 1fr); }
.menu:not(.grid) .dish:not(.has-photo) .photo { width: 58px; height: 46px; background: var(--paper-2); }
.menu:not(.grid) .dish:not(.has-photo) .ph-tile { display: none; }
.menu:not(.grid) .dish:not(.has-photo) .tk { position: static; width: 100%; height: 100%; display: grid; place-items: center; background: none; color: var(--ink); font-size: 1.25rem; }

/* small tag icons: allergens, diets, spice. Always readable, never colour-only */
.tg { display: inline-flex; align-items: center; justify-content: center; height: var(--h-tag); min-width: var(--h-tag); padding: 0 5px; border: 1.5px solid var(--ink-3); color: var(--ink-2); font: 500 .6875rem/1 var(--font-mono); }
.tg .i { width: 16px; height: 16px; }
.tg.allergen { border-color: var(--brand); color: var(--brand); }
.tg.diet { border-color: var(--ok); color: var(--ok); }
.spice { display: inline-flex; color: var(--brand); }
.spice .i { width: 16px; height: 16px; flex: none; }
.spice .i + .i { margin-left: -3px; }
/* badges (popular, new, chef pick): a small stamp */
.stamp { display: inline-flex; align-items: center; gap: 4px; min-height: var(--h-tag); padding: 0 7px; border: 1.5px solid var(--ink-3); color: var(--ink-2); font: 500 .6875rem/1 var(--font-mono); text-transform: var(--tt); letter-spacing: .06em; }
.stamp .i { width: 12px; height: 12px; }
.stamp.popular { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.stamp.new { border-color: var(--info); color: var(--info); }

.price { font: 500 1.0625rem/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.soldtag { display: inline-flex; align-items: center; max-width: 100%; min-height: var(--h-tag); padding: 0 8px; border: 1.5px solid var(--brand); color: var(--brand); font: 500 .6875rem/1.3 var(--font-mono); text-transform: var(--tt); letter-spacing: .06em; }
.soldtag.mt { margin-top: 12px; }
.dish.sold .th, .dish.sold h3, .dish.sold .price, .dish.sold .desc { opacity: .55; }
.dish.sold .photo img { filter: grayscale(1) contrast(.8) brightness(1.1); }

/* add button turns into a stepper once the dish is in the order */
.add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: var(--g-ctl-sm); height: var(--g-ctl-sm); padding: 0; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); transition: background var(--t-fast), color var(--t-fast), translate var(--t-fast); }
.add span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.add:active { translate: 0 1px; background: var(--ink); color: var(--paper); }
.stepper { display: none; align-items: center; height: var(--g-ctl-sm); border: 2px solid var(--ink); background: var(--ink); color: var(--paper); }
.stepper button { width: 42px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: inherit; }
.stepper button:active { background: rgb(255 255 255 / .18); }
.stepper b { min-width: 26px; text-align: center; font: 500 1rem/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.stepper.alw { display: inline-flex; }
.dish .open { all: unset; cursor: pointer; display: inline; }
.dish .open:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.dish.has .add { display: none; }
.dish.has .stepper { display: inline-flex; animation: pop var(--t-med) var(--ease); }
@keyframes pop { from { scale: .92; } to { scale: 1; } }
.dish.sold .add, .dish.sold .stepper { display: none; }
body:not([data-staff]) .add, body:not([data-staff]) .stepper { display: none !important; }

/* placeholder plate for dishes without a photo */
.ph-tile { position: relative; width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; background: var(--stone); color: var(--ink-3); }
.ph-tile .i { width: 46%; height: 46%; opacity: .3; stroke-width: 1.3; }

/* the page shown for an address with no menu behind it */
body.guest.nf-page { padding-bottom: 0; }
.nf { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 32px var(--gutter); text-align: center; }
.nf .i { width: 56px; height: 56px; color: var(--ink-3); stroke-width: 1.3; }
.nf h1 { font-size: var(--fs-2xl); }
.nf p { color: var(--ink-2); max-width: 32ch; }

.noresults { padding: 48px var(--gutter); color: var(--ink-2); text-align: center; }
.noresults button { margin-top: 12px; }

/* photo mode: two columns of plates */
.menu.grid .dishes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.menu.grid .dish { display: flex; flex-direction: column; gap: 0; padding: 0; }
.menu.grid .dish .photo { width: 100%; height: auto; aspect-ratio: 4 / 3; border: 0; border-bottom: 2px solid var(--ink); }
.menu.grid .dish .body { flex: 1; padding: 10px 10px 0; }
.menu.grid .dish > .buy { padding: 8px 10px 12px; }
.menu.grid .dish h3 { font-size: 1.0625rem; }
.menu.grid .dish .desc { display: none; }
/* a plate is narrow on a small phone: the stepper's buttons give up a little width so it stays inside the plate */
.menu.grid .dish .stepper button { width: 36px; }
@media (min-width: 640px) { .menu.grid .dishes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ info blocks */
/* the venue's details: a framed block in the same column as the dishes (same left and right edge) */
.info { width: calc(100% - 2 * var(--gutter)); max-width: calc(680px - 2 * var(--gutter)); margin: 32px auto 24px; border: 2px solid var(--ink); background: var(--paper); }
.info section { padding: 16px; border-bottom: 2px dotted var(--line); }
.info section:last-child { border-bottom: 0; }
.info h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--ink-2); font: 500 .75rem/1.4 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.info p { margin-bottom: 8px; color: var(--ink-2); }
.info .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.info .links > a, .info .links > button { display: inline-flex; align-items: center; gap: 8px; min-height: var(--g-ctl-sm); padding: 0 14px; border: 2px solid var(--ink); background: var(--paper-2); color: var(--ink); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }
.info .links > a:active, .info .links > button:active { background: var(--stone); }
.info .links > span { display: inline-flex; align-items: center; min-height: var(--h-tag); padding: 0 10px; background: var(--stone); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; }
.info details summary { display: flex; align-items: center; gap: 12px; min-height: var(--tap); list-style: none; cursor: pointer; }
.info details summary .muted { margin-left: auto; }
.info details summary::-webkit-details-marker { display: none; }
.info details summary h2 { margin: 0; }
.info details summary .i.chev { color: var(--ink-3); transition: rotate var(--t-med) var(--ease); }
.info details[open] summary .i.chev { rotate: 180deg; }
.hours { width: 100%; margin-top: 6px; border-collapse: collapse; }
.hours td { padding: 8px 0; border-bottom: 1px dotted var(--line); font-variant-numeric: tabular-nums; }
.hours td:last-child { text-align: right; font-family: var(--font-mono); }
.hours tr.today td { color: var(--ink); font-weight: 600; }
.kv { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.kv + .kv { margin-top: 8px; }
.kv code { display: inline-flex; align-items: center; min-height: var(--g-ctl-sm); padding: 0 12px; border: 2px solid var(--ink); background: var(--paper-2); font: 500 var(--fs-md)/1.3 var(--font-mono); word-break: break-all; }
.muted { color: var(--ink-3); }
.foot { padding: 28px var(--gutter) 36px; color: var(--ink-3); font: 500 .6875rem/1.5 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); text-align: center; }
.foot a { color: inherit; font-weight: 500; }

/* ------------------------------------------------------------------ order bar */
/* the bar is fixed, so the page's padding does not reach it: it keeps its place by itself while a window is open (tokens.css) */
html:has(dialog:modal) .orderbar { inset-inline-end: calc(12px + var(--sbw, 0px)); }
.orderbar { position: fixed; z-index: 40; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 656px; margin-inline: auto; min-height: var(--bar-h); display: flex; align-items: center; gap: 12px; padding: 0 12px 0 14px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); box-shadow: var(--sh-2); text-align: left; animation: rise var(--t-med) var(--ease); }
@keyframes rise { from { translate: 0 120%; opacity: 0; } to { translate: 0 0; opacity: 1; } }
.orderbar .cnt { min-width: 30px; height: 30px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 500 .9375rem/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.orderbar .lbl { flex: 1 1 auto; min-width: 76px; line-height: 1.25; overflow-wrap: anywhere; }
.orderbar .lbl b { display: block; font: 500 .75rem/1.3 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.orderbar .lbl small { font: 500 1.0625rem/1.2 var(--font-mono); font-variant-numeric: tabular-nums; }
.orderbar .go { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 8px; min-height: var(--g-ctl-sm); padding: 6px 14px; text-align: left; background: var(--paper); color: var(--ink); font: 500 .6875rem/1.25 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.orderbar.bump { animation: bump var(--t-med) var(--ease); }
@keyframes bump { 40% { scale: 1.02; } }

/* ------------------------------------------------------------------ dialogs: bottom sheets on phones, centred sheets on wide screens */
dialog { padding: 0; border: 0; color: var(--ink); background: var(--paper); }
dialog.sheet { width: min(100%, 560px); max-width: 100%; max-height: 92dvh; margin: auto auto 0; flex-direction: column; overflow: hidden; border: 2px solid var(--ink); border-bottom: 0;
	translate: 0 100%; opacity: 1; transition: translate var(--t-med) var(--ease), overlay var(--t-med) allow-discrete, display var(--t-med) allow-discrete; }
dialog.sheet[open] { display: flex; translate: 0 0; }
@starting-style { dialog.sheet[open] { translate: 0 100%; } }
dialog::backdrop { background: rgb(36 24 16 / 0); transition: background var(--t-med) var(--ease), overlay var(--t-med) allow-discrete, display var(--t-med) allow-discrete; }
dialog[open]::backdrop { background: rgb(36 24 16 / .6); }
@starting-style { dialog[open]::backdrop { background: rgb(36 24 16 / 0); } }
@media (min-width: 640px) { dialog.sheet { margin: auto; border-bottom: 2px solid var(--ink); max-height: 88dvh; translate: 0 20px; } dialog.sheet[open] { translate: 0 0; } @starting-style { dialog.sheet[open] { translate: 0 20px; } } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: calc(var(--h-bar) + 2px); padding: 8px var(--gutter); border-bottom: 2px solid var(--ink); flex: none; }
.sheet-head h2 { margin: 0; font-size: 1.25rem; }
.x { width: var(--g-ctl-sm); height: var(--g-ctl-sm); flex: none; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); }
.x:active { background: var(--stone); }
.sheet-body { flex: 1; min-height: 0; padding: 16px var(--gutter) calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 8px; flex: none; padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); background: var(--paper); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--g-ctl); padding: 0 20px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: 500 .75rem/1.2 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); text-decoration: none; }
.btn:active { background: var(--stone); }
.btn.primary, .btn.dark { background: var(--ink); color: var(--paper); }
.btn.primary:active, .btn.dark:active { background: var(--ink-2); }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .4; }
.btn.sq { width: var(--g-ctl); padding: 0; }
.btn.sm { min-height: var(--g-ctl-sm); padding: 0 14px; }
.btn-row { display: flex; gap: 8px; }
.btn-row.spaced { margin-top: 14px; }
.grow { flex: 1; }

/* dish detail */
.sheet-col { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pre-line { white-space: pre-line; }
.d-photo { position: relative; margin: -16px calc(var(--gutter) * -1) 16px; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 2px solid var(--ink); background: var(--stone); }
.d-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.d-photo .ph-tile .i { width: 30%; height: 30%; }
.d-photo .x { position: absolute; top: 12px; right: var(--gutter); }
/* marks on the dish photo: a dot on the ingredient, a leader, a lettered label (fixed colours: it sits on a photograph) */
.d-marks { position: absolute; inset: 0; pointer-events: none; }
.mk-line { position: absolute; height: 2px; margin-top: -1px; background: #f5ecd8; transform-origin: 0 50%; box-shadow: 0 0 0 1px rgb(36 24 16 / .55); }
.mk-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 2px solid #2a1c12; border-radius: 50%; background: #f5ecd8; }
.mk-l { position: absolute; width: var(--h-mark); height: var(--h-mark); margin: calc(var(--h-mark) / -2) 0 0 calc(var(--h-mark) / -2); display: grid; place-items: center; border: 2px solid #2a1c12; border-radius: 50%; background: #f5ecd8; color: #2a1c12; font: 500 .75rem/1 var(--font-mono); }
.d-kick { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink-3); font: 500 .6875rem/1.3 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.d-kick b { display: inline-flex; align-items: center; min-height: var(--h-tag); padding: 0 8px; background: var(--ink); color: var(--paper); font-weight: 500; letter-spacing: 0; }
.d-name { margin: 8px 0 0; font-size: clamp(1.75rem, 8vw, 2.25rem); line-height: 1.05; letter-spacing: -.015em; }
.d-th { margin-top: 6px; color: var(--ink); font: 600 1.375rem/1.45 var(--font-th); }
.d-desc { margin: 10px 0 0; color: var(--ink-2); }
/* the spec list: what the dish is, set like the legend of a drawing */
.d-spec { margin: 14px 0 0; border: 2px solid var(--ink); background: var(--paper-2); }
.d-spec > div { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px dashed var(--line); font-size: var(--fs-md); }
.d-spec > div:last-child { border-bottom: 0; }
.d-spec .lead { flex: 1; min-width: 8px; border-bottom: 2px dotted var(--line); transform: translateY(-3px); }
.d-spec .k { color: var(--ink-3); font: 500 .6875rem/1.3 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.d-spec .dots { display: inline-flex; gap: 5px; }
.d-spec .dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--brand); }
.d-spec .dots i.on { background: var(--brand); }
.d-legend { margin: 14px 0 0; padding: 0; list-style: none; border: 2px solid var(--ink); background: var(--paper-2); }
.d-legend li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px dashed var(--line); font: 500 1.0625rem/1.3 var(--font-display); }
.d-legend li:last-child { border-bottom: 0; }
.d-legend li:lang(th) { font-family: var(--font-th); }
.d-legend b { width: var(--h-mark); height: var(--h-mark); flex: none; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; font: 500 .6875rem/1 var(--font-mono); }
.d-legend b.none { border: 0; width: var(--h-mark); }
.d-legend b.none::before { content: ""; width: 7px; height: 7px; background: var(--ink-3); }
.d-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.d-tags .chip { display: inline-flex; align-items: center; gap: 6px; min-height: var(--h-tag); padding: 0 10px; border: 2px solid var(--ink); background: var(--paper-2); font: 500 .6875rem/1.2 var(--font-mono); text-transform: var(--tt); letter-spacing: .06em; }
.d-tags .chip.allergen { border-color: var(--brand); color: var(--brand); }
.d-tags .chip.diet { border-color: var(--ok); color: var(--ok); }
.d-price { font: 500 1.75rem/1 var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.dfoot { align-items: stretch; gap: 10px; }
.dfoot .go { flex: 1; min-height: var(--h-ctl); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); font: 500 .75rem/1.2 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.dfoot .go b { font: 500 1rem/1 var(--font-mono); letter-spacing: 0; }
.dfoot .go:active { background: var(--ink-2); }
.dfoot .stepper { background: var(--paper); color: var(--ink); }
.dfoot .stepper button:active { background: var(--stone); }

/* options (diet filter, allergy card) */
.optgroup h3 { margin: 18px 0 8px; color: var(--ink-3); font: 500 .6875rem/1.4 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts.spaced { margin-bottom: 16px; }
.opt { display: inline-flex; align-items: center; gap: 8px; min-height: var(--g-ctl-sm); padding: 0 14px; border: 2px solid var(--ink); background: var(--paper-2); font-weight: 500; }
.opt[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.note { margin-top: 16px; color: var(--ink-3); font-size: var(--fs-sm); }
.listbtn { display: flex; align-items: center; justify-content: space-between; min-height: var(--g-ctl); padding: 0 4px; border-bottom: 1px dotted var(--line); color: var(--ink); font-size: var(--fs-lg); text-decoration: none; }
.listbtn[aria-current="true"] { font-weight: 600; }
.listbtn .i { color: var(--accent-text); }
.listbtn .ln { display: inline-flex; align-items: center; gap: 12px; }

/* order list */
.tablebox { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 4px 12px; margin-bottom: 12px; padding: 10px 12px; border: 2px dashed var(--ink-3); background: var(--paper-2); }
.tablebox label { display: flex; flex-direction: column; gap: 2px; font: 500 .75rem/1.4 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.tablebox label small { color: var(--ink-3); font-weight: 400; text-transform: none; letter-spacing: 0; font-family: var(--font-text); }
.tablebox input { width: 100%; height: var(--g-ctl-sm); padding: 0 10px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); font: 500 1.25rem/1 var(--font-mono); text-align: center; }
.tablebox input:focus { outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 38%, transparent); }
.tablebox .hint { grid-column: 1 / -1; margin: 2px 0 0; color: var(--ink-3); font-size: var(--fs-sm); }
.line { display: grid; grid-template-columns: 40px 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px dotted var(--line); }
.line.nophoto { grid-template-columns: 26px minmax(0, 1fr) auto; }
.line .lt { width: 40px; height: 40px; object-fit: cover; border: 2px solid var(--ink); background: var(--stone); }
.line .tk { font: 500 1.0625rem/1 var(--font-mono); text-align: center; }
.line .stepper button { width: 36px; }
.line .nm { font: 600 1.0625rem/1.2 var(--font-display); overflow-wrap: anywhere; }
.line .tt { margin-top: 2px; color: var(--ink-3); font: 500 .8125rem/1.4 var(--font-th); overflow-wrap: anywhere; }
.line .wish { grid-column: 3 / -1; }
.line.nophoto .wish { grid-column: 2 / -1; }
.line .wishbtn { padding: 4px 0; border: 0; background: transparent; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; text-decoration: underline; text-underline-offset: .2em; }
.line .reqs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.line .reqs button { min-height: var(--h-ctl); padding: 0 12px; border: 2px solid var(--ink); background: var(--paper-2); font-size: var(--fs-sm); }
.line .reqs button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.line .stepper { display: inline-flex; }
.sumrow { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; }
.sumrow span { font: 500 .75rem/1.4 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.sumrow b { font: 500 1.5rem/1 var(--font-mono); font-variant-numeric: tabular-nums; }

/* number pad */
.pad-display { display: flex; align-items: center; gap: 14px; min-height: 68px; margin-bottom: 12px; padding: 8px 14px; border: 2px solid var(--ink); background: var(--paper-2); }
.pad-display .big { flex: none; min-width: 1.6ch; font: 500 2.75rem/1 var(--font-mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pad-display .what { min-width: 0; line-height: 1.3; }
.pad-display .what b { display: block; font: 600 1.0625rem/1.2 var(--font-display); }
.pad-display .what small { color: var(--ink-3); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad button { height: var(--h-key); display: grid; place-items: center; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: 500 1.5rem/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.pad button:active { background: var(--ink); color: var(--paper); }
.pad button.fn { background: var(--stone); }
.pad-actions { display: flex; gap: 8px; margin-top: 12px; }

/* staff screens: a receipt on espresso. Always light paper, huge, high contrast. The Thai is what the staff reads. */
dialog.full { width: 100%; max-width: 100%; height: 100dvh; max-height: none; margin: 0; flex-direction: column; overflow: hidden; background-color: #241810; background-image: radial-gradient(#3a2a1c 1px, transparent 1.2px); background-size: 18px 18px; color: #f5ecd8; }
dialog.full[open] { display: flex; }
/* the title bar, the line under it and the button keep the docket's width: one column, centred */
dialog.full { --dk: min(560px, calc(100% - 2 * var(--gutter))); }
dialog.full .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex: none; width: var(--dk); min-height: var(--h-bar); margin: 0 auto; padding: 8px 0; }
dialog.full .top h2 { margin: 0; font: 600 1.0625rem/1.35 var(--font-display); }
dialog.full .top small { display: block; color: #d6c19a; font: 500 .6875rem/1.4 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
dialog.full .top > div:first-child { flex: 1; min-width: 0; }
dialog.full .x { border-color: #d6c19a; background: transparent; color: #f5ecd8; }
dialog.full .hint { flex: none; width: var(--dk); margin: 0 auto; padding: 4px 0 10px; color: #d6c19a; font-size: var(--fs-sm); }
/* no scrollbar here: it would stand beside the docket as a strip and push it off the column of the bar and the button;
   the docket cut by the button and its zigzag end say there is more */
dialog.full .list { flex: 1; overflow-y: auto; padding: 4px var(--gutter) 16px; scrollbar-width: none; }
dialog.full .list::-webkit-scrollbar { display: none; }
.docket { max-width: 560px; margin: 0 auto; padding: 20px 18px 8px; background: #f5ecd8; color: #2a1c12; container: docket / inline-size; }
.docket + .zz { display: block; max-width: 560px; height: 12px; margin: 0 auto; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12'%3E%3Cpath d='M0 0L8 12L16 0Z' fill='%23f5ecd8'/%3E%3C/svg%3E") repeat-x; }
.dk-head { text-align: center; }
.dk-head h3 { margin: 0; font: 700 1.625rem/1.4 var(--font-th); }
.dk-head small { display: block; margin-top: 2px; color: #6b4a32; font: 500 .6875rem/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .14em; }
.dk-rule { margin: 12px 0; border: 0; border-top: 2px dashed #2a1c12; }
.dk-table { display: flex; justify-content: space-between; align-items: baseline; font: 700 1.5rem/1.4 var(--font-th); }
.dk-table b { font: 500 2.25rem/1 var(--font-mono); }
.srow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "num txt qty"; gap: 8px 12px; align-items: center; padding: 12px 0; border-bottom: 1px dotted #b79f7c; }
.srow.ph { grid-template-columns: 56px auto minmax(0, 1fr) auto; grid-template-areas: "pic num txt qty"; }
.srow > img { grid-area: pic; } .srow > .snum { grid-area: num; } .srow > .stxt { grid-area: txt; } .srow > .sq { grid-area: qty; }
/* a phone-wide docket: photo, number and count make the first line, the Thai name takes the whole width under them */
@container docket (max-width: 439px) {
	.srow { grid-template-areas: "num . qty" "txt txt txt"; }
	.srow.ph { grid-template-areas: "pic num . qty" "txt txt txt txt"; }
}
.srow img { width: 56px; height: 56px; object-fit: cover; border: 2px solid #2a1c12; display: block; background: #e4d6b8; }
.snum { min-width: 40px; font: 500 1.75rem/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.sth { color: #2a1c12; font: 600 1.5rem/1.4 var(--font-th); overflow-wrap: anywhere; }
.sloc { color: #6b4a32; font: 500 .6875rem/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; overflow-wrap: anywhere; }
.sreq { margin-top: 2px; color: #9b3b24; font: 600 1.25rem/1.5 var(--font-th); overflow-wrap: anywhere; }
.sq { color: #2a1c12; font: 500 2.25rem/1 var(--font-mono); text-align: right; }
.sq small { margin-right: 2px; font-size: 1.25rem; font-weight: 400; }
.dk-sum { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0 8px; font: 700 1.5rem/1.4 var(--font-th); }
.dk-sum b { font: 500 1.75rem/1 var(--font-mono); }
dialog.full .back { flex: none; width: var(--dk); margin: 8px auto calc(8px + env(safe-area-inset-bottom)); min-height: var(--h-ctl); border: 2px solid #f5ecd8; background: transparent; color: #f5ecd8; font: 500 .75rem/1.2 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.alcard { text-align: center; }
.alcard .warn { width: 76px; height: 76px; display: grid; place-items: center; margin: 4px auto 6px; border: 3px solid #9b3b24; border-radius: 50%; color: #9b3b24; }
.alcard .warn .i { width: 42px; height: 42px; stroke-width: 1.8; }
.alcard .th1 { margin: 8px 0; font: 600 1.5rem/1.55 var(--font-th); }
.alcard ul { margin: 0 0 12px; padding: 0; list-style: none; color: #9b3b24; font: 700 1.875rem/1.55 var(--font-th); }
.alcard .loc { color: #4a3324; font-size: 1.125rem; line-height: 1.6; }
.alcard .loc.strong { margin-top: 8px; font-weight: 800; }
.phrase { padding: 14px 0; border-bottom: 1px dotted var(--line); }
.phrase .pth { font: 600 1.5rem/1.55 var(--font-th); }
.phrase .ploc { color: var(--ink-3); }

/* toast */
.toastg { position: fixed; z-index: 90; left: 50%; translate: -50% 0; bottom: calc(var(--bar-h) + 32px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); display: flex; align-items: center; justify-content: center; min-height: var(--h-ctl); padding: 6px 18px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); box-shadow: var(--sh-2); font-weight: 500; font-size: var(--fs-sm); text-align: center; animation: rise var(--t-med) var(--ease); }
