/* ThaiQR: owner dashboard, admin area, sign-in and landing page. Tokens come from tokens.css.
   "Kitchen ticket": cream paper on graph paper, espresso ink, 2px square frames, mono captions, dotted leaders.
   Plain CSS, no build step. Sections: base, shell, page, controls, tables, menu editor, dialogs, moderation, sign-in, landing, QR studio. */

/* ---------- base ---------- */
h1 { font-size: var(--fs-2xl); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }
h1, h2, h3, h4 { margin-bottom: .5em; }
hr { border: 0; border-top: 2px dotted var(--line); margin: 20px 0; }
code, kbd { font-family: var(--font-mono); font-size: .86em; background: var(--stone); padding: .1em .4em; border: 1px solid var(--line); }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap > .field { flex: 1 1 0; min-width: 0; }
.row.nowrap > .input { flex: 1 1 0; min-width: 0; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack > * + * { margin-top: 12px; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.bullets { margin: 0; padding-left: 18px; }
.r { text-align: right; }
.wrap-any { word-break: break-all; }
.grow { flex: 1 1 0; min-width: 0; }
.hidden { display: none !important; }
.hide-sm { }
@media (max-width: 560px) { .hide-sm { display: none !important; } }

/* ---------- shell: espresso sidebar on a desktop, bottom bar on a phone ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 6px; padding: 20px 16px 16px; background: var(--espresso); color: var(--on-espresso-2); overflow-y: auto;
	--sb-track: var(--espresso); --sb-thumb: #6b4a32; --sb-thumb-hover: var(--on-espresso-2); }
.side-top { display: flex; align-items: center; gap: 8px; padding: 0 0 12px 2px; }
.side-top .side-brand { flex: 1; min-width: 0; padding: 0; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 2px 12px; font: 600 1.2rem/1 var(--font-display); letter-spacing: -.01em; text-decoration: none; color: var(--on-espresso); }
.brand-mark { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: var(--ink); color: var(--paper); text-decoration: none; }
.brand-mark .i { width: 18px; height: 18px; stroke-width: 1.8; }
.side .brand-mark { background: var(--on-espresso); color: var(--espresso); }
.brand-name { letter-spacing: -.01em; }
.badge.beta { padding: 0 6px; }

/* the venue you are working on: a title-block cell, a switcher when there are several */
.vsw { position: relative; margin-bottom: 8px; }
.vsw summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 10px 12px; border: 2px solid var(--on-espresso); color: var(--on-espresso); cursor: pointer; }
.vsw summary::-webkit-details-marker { display: none; }
.vsw summary:hover { background: var(--espresso-2); }
.vsw summary > .i { color: var(--on-espresso-2); }
.vsw-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
/* the venue name gets two lines before it is cut: "Baan Kanom Thai" should read whole */
.vsw-text b { display: -webkit-box; overflow: hidden; font: 600 1.0625rem/1.2 var(--font-display); -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.vsw-text small { display: block; }
.vsw-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 25; padding: 6px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--sh-2); }
.vsw-pop a { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-height: var(--h-ctl); padding: 6px 10px; text-decoration: none; font-size: var(--fs-md); }
.vsw-pop a:hover { background: var(--stone); }
.vsw-pop a.on { font-weight: 600; }
.vsw-pop hr { margin: 6px 0; }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; margin-top: 6px; }
.nav-i { position: relative; display: flex; align-items: center; gap: 12px; min-height: var(--h-ctl); padding: 6px 12px; border: 0; border-left: 3px solid transparent; background: none; color: var(--on-espresso-2); text-decoration: none; font-size: var(--fs-md); text-align: left; }
.nav-i .i { width: 20px; height: 20px; }
.nav-i:hover { background: rgb(245 236 216 / .07); color: var(--on-espresso); }
.nav-i.on { background: var(--espresso-2); border-left-color: var(--on-espresso); color: var(--on-espresso); font-weight: 600; }
.nav-i.ext .x { margin-left: auto; width: 14px; height: 14px; }
.nav-badge { display: inline-grid; place-items: center; margin-left: auto; min-width: var(--h-count); height: var(--h-count); padding: 0 6px; background: var(--brand); color: #fff; font: 500 .6875rem/1.3 var(--font-mono); text-align: center; }
.side-sep { height: 0; margin: 8px 6px; border-top: 1px dashed #6b4a32; }
.side-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px dashed #6b4a32; }
.side .badge { border-color: #7a5a3e; color: var(--on-espresso-2); }
.side .badge.ok { border-color: #8a9c4a; color: #d3e19a; }
.side .badge.warn { border-color: #b58a3c; color: #f0cf86; }
.side .badge.err { border-color: #c4745c; color: #f0a58f; }
.side .badge.info { border-color: #7f93ab; color: #bfcfe3; }

/* language: one button with the current language's flag and code; the list of languages opens on click */
.langdd { position: relative; flex: none; }
.langdd summary { list-style: none; display: inline-flex; align-items: center; gap: 7px; height: var(--h-ctl-sm); padding: 0 8px 0 9px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: 500 .75rem/1 var(--font-mono); letter-spacing: .06em; cursor: pointer; user-select: none; }
.langdd summary::-webkit-details-marker { display: none; }
.langdd summary:hover { background: var(--stone); }
.langdd .chev { width: 14px; height: 14px; color: var(--ink-3); transition: rotate var(--t-fast); }
.langdd[open] .chev { rotate: 180deg; }
.langdd-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 45; min-width: 184px; padding: 4px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); box-shadow: var(--sh-2); }
.langdd.up .langdd-pop { top: auto; bottom: calc(100% + 6px); }
.more .langdd-pop { right: auto; left: 0; }
.langdd-pop a { display: flex; align-items: center; gap: 10px; min-height: var(--h-ctl); padding: 4px 10px; color: var(--ink); font-size: var(--fs-md); text-decoration: none; }
.langdd-pop a:hover { background: var(--stone); }
.langdd-pop a[aria-current] { font-weight: 600; }
.langdd-pop .ok { width: 16px; height: 16px; margin-left: auto; }
.side .langdd summary { border-color: #7a5a3e; background: transparent; color: var(--on-espresso); }
.side .langdd summary:hover { background: rgb(245 236 216 / .08); }
.side .langdd .chev { color: var(--on-espresso-2); }
.side .langdd .lc { display: none; }
.side .langdd summary { gap: 5px; padding: 0 6px 0 8px; }

.userbox { position: relative; flex: 1; min-width: 0; }
.userbox summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 6px; cursor: pointer; color: var(--on-espresso); }
.userbox summary::-webkit-details-marker { display: none; }
.userbox summary:hover { background: rgb(245 236 216 / .07); }
.userbox summary > .i { margin-left: auto; color: var(--on-espresso-2); }
.avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 2px solid var(--on-espresso-2); color: var(--on-espresso); font: 500 .8125rem/1 var(--font-mono); }
.u-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.u-text b { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-text small { overflow: hidden; color: var(--on-espresso-2); font: 500 .6875rem/1.4 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); white-space: nowrap; text-overflow: ellipsis; }
.userbox .pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 25; padding: 6px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--sh-2); }
.userbox .pop a, .userbox .pop button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--h-ctl); padding: 6px 10px; border: 0; background: none; color: var(--ink); text-align: left; text-decoration: none; font: inherit; cursor: pointer; }
.userbox .pop a:hover, .userbox .pop button:hover { background: var(--stone); }

/* a bar that runs edge to edge keeps its content on the edges of the column (padding-inline: var(--edge)) */
:root { --edge: max(var(--gutter), calc((100% - var(--col)) / 2 + var(--gutter))); --mtop-h: 0px; }
.mtop, .tabbar, .more { display: none; }
@media (max-width: 900px) {
	:root { --mtop-h: calc(var(--h-bar) + 2px); }
	.shell { display: block; }
	.side { display: none; }
	.mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; height: var(--mtop-h); padding: 0 var(--edge); background: var(--paper); border-bottom: 2px solid var(--ink); }
	.mtop-title { flex: 1; min-width: 0; }
	.mtop-title b { display: block; font: 600 1.125rem/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; padding: 6px max(6px, calc((100% - var(--col)) / 2)) calc(6px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 2px solid var(--ink); }
	/* fixed, so the page's padding does not reach it: it keeps its width by itself while a window is open (tokens.css) */
	html:has(dialog:modal) .tabbar { right: var(--sbw, 0px); }
	.tabbar .nav-i { flex: 1; flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 2px; border-left: 0; color: var(--ink-3); font: 500 .6875rem/1.2 var(--font-mono); text-transform: var(--tt); letter-spacing: .04em; text-align: center; }
	.tabbar .nav-i .i { width: 22px; height: 22px; }
	.tabbar .nav-i:hover { background: none; color: var(--ink); }
	.tabbar .nav-i.on { background: none; color: var(--ink); font-weight: 500; }
	.tabbar .nav-i.on::before { content: ""; position: absolute; top: -8px; left: 22%; right: 22%; height: 4px; background: var(--ink); }
	.tabbar .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
	.more:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 60; background: rgb(36 24 16 / .55); }
	/* the same bottom sheet as the guest page's: at most 560 wide, framed on three sides */
	.more-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); border: 2px solid var(--ink); border-bottom: 0; background: var(--paper); animation: sheet-up var(--t-med) var(--ease); }
	.more-list { display: flex; flex-direction: column; }
	.more .nav-i { min-height: var(--h-ctl); border-left: 0; border-bottom: 1px dotted var(--line); color: var(--ink); font-size: var(--fs-lg); }
	.more .nav-i:hover { background: var(--stone); color: var(--ink); }
	.more .nav-i.on { background: var(--stone); color: var(--ink); border-left: 3px solid var(--ink); }
	.more-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 12px 8px 0; }
}
@keyframes sheet-up { from { translate: 0 24px; opacity: 0; } }

/* public pages (landing, sign-in, legal) */
.pub-top { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 2px solid var(--ink); }
.pub-in { max-width: var(--col); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 10px; min-height: 60px; }
.pub-in .side-brand { padding: 0; color: var(--ink); }
@media (max-width: 480px) { .pub-in { gap: 8px; } .pub-in .badge.beta { display: none; } }
@media (max-width: 380px) { .pub-in .langdd .lc { display: none; } .pub-in .langdd summary { gap: 5px; padding: 0 6px 0 8px; } }
@media (max-width: 360px) { .pub-in:has(> .btn:not(.hide-sm)) .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
/* a row of fields with its button: on a small phone the button takes its own line */
@media (max-width: 420px) { .row.nowrap.fit { flex-wrap: wrap; } .row.nowrap.fit > .btn { flex: 1 1 100%; } }
.spacer { flex: 1; }
.footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; padding: 28px var(--gutter) 36px; color: var(--ink-3); font: 500 var(--fs-badge)/1.5 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.footer a { color: var(--ink-3); }
.footer a:hover { color: var(--ink); }

/* ---------- page: one column, the guest menu's width (docs/UI_STANDARD.md) ---------- */
/* Every page is one column of blocks 16 apart. A block never sets its own outer margin inside the page: the gap does. */
.page { width: 100%; max-width: var(--col); margin: 0 auto; padding: 16px var(--gutter) 64px; display: flex; flex-direction: column; gap: 16px; }
/* a group of blocks inside the page (a settings tab, a list) keeps the same rhythm */
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
main.page > *, div.col > * { min-width: 0; margin-top: 0; margin-bottom: 0; }
@media (max-width: 900px) { .page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* The title block, as on the guest page: the page's name (and one line about it) in a frame, then one row of cells.
   The first cell takes the room (a state, the way back, a search field); the actions are cells at the right end. */
.page-head { border: 2px solid var(--ink); background: var(--paper); }
.ph-name { padding: 12px 14px 10px; }
.page-head h1 { margin: 0; font-size: clamp(1.5rem, 6.6vw, 2.125rem); line-height: 1.05; letter-spacing: -.015em; }
.page-head h1 .muted { font-weight: 600; }
.ph-note { margin: 4px 0 0; color: var(--ink-3); font-size: var(--fs-md); line-height: 1.3; }
.ph-row { display: flex; align-items: stretch; border-top: 2px solid var(--ink); overflow-x: auto; scrollbar-width: none; }
.ph-row::-webkit-scrollbar { display: none; }
.ph-row > :first-child:not(.ph-l) { margin-left: auto; }
.ph-l { flex: 1 0 auto; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: var(--h-ctl); padding: 6px 14px; color: var(--ink); font: 500 .6875rem/1.3 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); text-decoration: none; }
a.ph-l:hover { background: var(--stone); }
a.ph-l .i { color: var(--ink-3); }
/* a cell is a button without its own frame: the rules of the row are its frame */
.ph-row > .btn, .ph-row > form > .btn { height: 100%; min-height: var(--h-ctl); padding: 0 14px; border: 0; border-left: 2px solid var(--ink); background: none; color: var(--ink); font-size: .6875rem; }
.ph-row > form { display: flex; }
.ph-row > .btn:hover, .ph-row > form > .btn:hover { background: var(--stone); }
.ph-row > .btn .i { color: var(--ink-3); }
.ph-row > .btn.primary, .ph-row > .btn.on { background: var(--ink); color: var(--paper); }
.ph-row > .btn.primary .i, .ph-row > .btn.on .i { color: var(--paper); }
.ph-row > .btn.accent { background: var(--brand); color: #fff; }
.ph-row > .btn.accent .i { color: #fff; }
.ph-row > .btn.primary:hover { background: #46301f; }
.ph-row > .btn.accent:hover { background: var(--brand-strong); }
/* a phone keeps the row on one line: every cell but the last (the primary one) shows only its icon */
@media (max-width: 560px) {
	.ph-row > .btn:not(:last-child):has(.i), .ph-row > form:not(:last-child) > .btn:has(.i) { width: var(--h-ctl); padding: 0; flex: none; }
	.ph-row > .btn:not(:last-child):has(.i) > span, .ph-row > form:not(:last-child) > .btn:has(.i) > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.ph-l.check { padding: 0 14px; cursor: pointer; }
.ph-l.check input { margin-top: 0; }
/* the search field of a list page fills the first cell */
.ph-search { padding: 0; }
.ph-search .input { height: 100%; min-height: var(--h-ctl); border: 0; background: var(--paper-2); }
.ph-search .input:focus { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--brand) 38%, transparent); }

/* ---------- blocks ---------- */
/* a card: one thing with its own actions, or a form. A 2px ink frame on paper, 16 inside (14 on a phone). */
.card { --cp: 16px; background: var(--paper); border: 2px solid var(--ink); padding: var(--cp); }
/* the caption of a block or of a section: mono, small, no icon, no bar (the guest page's "Opening hours") */
.card-title, .cap { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--ink-2); font: 500 var(--fs-label)/1.4 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.card-title .muted, .cap .muted { margin-left: auto; color: var(--ink-3); letter-spacing: 0; }
/* a sheet of sections: several short groups in one frame, split by dotted rules (the guest page's info block) */
.sheet { padding: 0; }
.sheet > section, .sheet > .sec { padding: 16px; border-bottom: 2px dotted var(--line); }
.sheet > :is(section, .sec):last-child { border-bottom: 0; }
/* a group of fields inside a form is named in the serif, so the name is not taken for a field's mono label */
.sec-t { margin: 0 0 12px; font-size: 1.1875rem; line-height: 1.15; }
.card > :last-child, .sheet > :is(section, .sec) > :last-child { margin-bottom: 0; }
/* folder tabs standing on the frame of the open block */
.tabbed > .tabs { margin: 0; border-bottom: 0; }
/* a group caption: serif name, dotted leader, count (the guest page's category caption) */
.gcap { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-size: 1.375rem; font-weight: 600; }
.gcap .lead { flex: 1; min-width: 12px; border-bottom: 2px dotted var(--line); transform: translateY(2px); }
.gcap small { color: var(--ink-3); font: 500 .75rem/1 var(--font-mono); letter-spacing: 0; }
/* cards of one list: 10 apart */
.cards { display: flex; flex-direction: column; gap: 10px; }
/* a list card (a venue, a code): picture, name, a line of state, actions at the bottom (the guest page's dish card) */
.lcard { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 10px; border: 2px solid var(--ink); background: var(--paper); }
.lcard .pic { width: var(--h-pic); height: var(--h-pic); display: grid; place-items: center; overflow: hidden; border: 2px solid var(--ink); background: var(--paper-2); font: 600 1.5rem/1 var(--font-display); color: var(--ink); text-decoration: none; }
.lcard .pic img { width: 100%; height: 100%; display: block; object-fit: cover; }
.lcard .nm { margin: 0; font-size: 1.1875rem; line-height: 1.15; }
.lcard .nm a { text-decoration: none; }
.lcard .nm a:hover { text-decoration: underline; }
.lcard .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; color: var(--ink-3); font-size: var(--fs-sm); }
.lcard .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.lcard .acts .lead { flex: 1; min-width: 8px; border-bottom: 2px dotted var(--line); }
/* a card that is one link: the name's link covers the card (a guest dish card opens wherever it is tapped) */
.lcard.link { position: relative; }
.lcard.link .nm a::after { content: ""; position: absolute; inset: 0; }
.lcard.link:hover { background: var(--paper-2); }
.lcard .acts form { display: flex; }
/* the role takes the room, access sits at the right end; when both do not fit, access drops to the next line */
.user-acts .input-group { flex: 1 1 150px; max-width: 280px; }
.user-acts > form:nth-child(2) { margin-left: auto; }
.user-acts .full { flex: 1 1 100%; }
/* a log: entries in one frame split by dotted rules (the guest page's opening hours): what, where, when, then the details */
.log > .sec { padding: 10px 14px; }
.log-h { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.log-h .lead { flex: 1; min-width: 8px; border-bottom: 2px dotted var(--line); }
.log-h .when { color: var(--ink-3); font: 500 .75rem/1.3 var(--font-mono); white-space: nowrap; }
.log-e .small { margin-top: 3px; overflow-wrap: anywhere; }
.log-e code.copy { display: inline-block; margin-top: 4px; }
/* entries listed inside a section (the moderation overview): split by the same dotted rule */
.qline + .qline { margin-top: 8px; padding-top: 8px; border-top: 1px dotted var(--line); }
.grid { display: grid; gap: 16px; }
/* a grid of form fields: the fields carry their own bottom margin, so the rows need no gap of their own */
.grid:has(> .field) { row-gap: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) {
	.g2, .g3, .g4 { grid-template-columns: 1fr; }
	.grid:has(> .stat) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.card { --cp: 14px; }
	.sheet > section, .sheet > .sec { padding: 14px; }
}

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--h-ctl); padding: 0 16px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font: 500 var(--fs-label)/1.2 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); white-space: nowrap; cursor: pointer; text-decoration: none; transition: background var(--t-fast), color var(--t-fast), translate var(--t-fast); }
.btn:hover { background: var(--stone); text-decoration: none; }
.btn:active { translate: 0 1px; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: #46301f; border-color: #46301f; }
.btn.accent { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.accent:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.danger { color: var(--brand); border-color: var(--brand); }
.btn.danger:hover { background: var(--err-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--stone); }
.btn.sm { min-height: var(--h-ctl-sm); padding: 0 12px; }
.btn.block { width: 100%; }
@media (max-width: 640px) { .btn.squeeze { padding: 0 11px; } .btn.squeeze .lbl { display: none; } }
.btn[disabled], .btn.disabled { opacity: .42; pointer-events: none; }
.htmx-request .btn.primary, .btn.htmx-request { opacity: .75; }

/* a small stamped label: state, count, language */
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: var(--h-tag); padding: 0 8px; border: 1.5px solid var(--ink-3); background: transparent; color: var(--ink-3); font: 500 var(--fs-badge)/1.2 var(--font-mono); text-transform: var(--tt); letter-spacing: .06em; white-space: nowrap; }
.badge.ok { border-color: var(--ok); color: var(--ok); }
.badge.warn, .badge.gold { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.badge.err { border-color: var(--err); color: var(--err); }
.badge.info { border-color: var(--info); color: var(--info); }
.badge.brand { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }

.alert { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; padding: 12px 14px; border: 2px solid var(--info); background: var(--info-soft); color: #2a3646; }
.alert.ok { border-color: var(--ok); background: var(--ok-soft); color: #2e3b14; }
.alert.warn { border-color: var(--warn); background: var(--warn-soft); color: #5c3b08; }
.alert.err { border-color: var(--err); background: var(--err-soft); color: #6b2412; }
.alert .i { margin-top: 2px; }
.alert > div { flex: 1; min-width: 0; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* forms */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; margin-bottom: 6px; color: var(--ink-2); font: 500 var(--fs-label)/1.4 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.hint { margin-top: 5px; color: var(--ink-3); font-size: var(--fs-sm); }
.hint.above { display: block; margin: 0 0 5px; }
/* a field labelled by its language: the flag and the native name, not a sentence */
.field > label.lang-label { display: flex; align-items: center; gap: 8px; color: var(--ink); font: 500 var(--fs-sm)/1.3 var(--font-text); text-transform: none; letter-spacing: 0; }
.hint.ok { color: var(--ok); }
.hint.err { color: var(--err); }
.input, select, textarea { width: 100%; height: var(--h-ctl); padding: 0 12px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper-2); font: inherit; color: var(--ink); transition: box-shadow var(--t-fast); }
/* a text area is as tall as its rows say (".input" alone would pin it to one control height) */
textarea, textarea.input { height: auto; min-height: 64px; padding: 9px 12px; line-height: 1.45; resize: vertical; }
/* the arrow of a select (".input" sets the whole background, so the select needs the more specific rule) */
select, select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232a1c12' stroke-width='2.4' stroke-linecap='square'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, select:focus, textarea:focus { outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 38%, transparent); }
.input.err, .input[aria-invalid="true"] { border-color: var(--brand); }
.input::placeholder, textarea::placeholder { color: #85694e; }
.input[readonly] { background: var(--stone); }
.input.sm, select.sm { height: var(--h-ctl-sm); padding-top: 0; padding-bottom: 0; }
.input-group { display: flex; }
.input-group .input { flex: 1; min-width: 0; }
.input-group .btn { flex: none; margin-left: -2px; }
.input-group .btn.eye { width: var(--h-ctl); padding: 0; }
.input-group .pre { display: grid; place-items: center; padding: 0 12px; border: 2px solid var(--ink); border-right: 0; background: var(--stone); color: var(--ink-3); font: 500 var(--fs-sm) var(--font-mono); white-space: nowrap; }
/* a tick with its words is a one-line control: 44 high, the box in the middle of the line */
.check { display: flex; gap: 10px; align-items: center; min-height: var(--h-ctl); padding: 0; cursor: pointer; }
.check.flush { padding: 0; }
.check input { margin: 0; width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
/* an option with a line of explanation; the chosen ones get the ink frame */
.check-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 2px solid var(--line); background: transparent; cursor: pointer; }
.check-card:hover { border-color: var(--ink-3); }
.check-card:has(input:checked) { border-color: var(--ink); background: var(--paper-2); }
.check-card .muted { display: block; margin-top: 1px; line-height: 1.35; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
@media (max-width: 640px) { .check-grid, .check-cols { grid-template-columns: 1fr; } }
.check-card:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.check-card input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--ink); }
.check-card b { display: block; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: var(--h-ctl); padding: 4px 12px; line-height: 1.3; border: 2px solid var(--ink); background: var(--paper-2); cursor: pointer; font-size: var(--fs-md); user-select: none; transition: background var(--t-fast); }
.chip:hover { background: var(--stone); }
/* a set of options of the same kind (languages, payment methods): equal cells in columns, no lonely last chip */
.chips.even { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.chips.even .chip { min-width: 0; white-space: nowrap; }
.chips.even .chip > span:last-child { overflow: hidden; text-overflow: ellipsis; }
/* the groups of a long card (Wi-Fi, reviews, payments): a caption with a dotted rule above it */
.card > h3 { margin: 0 0 10px; font-size: 1.0625rem; }
.card > h3 ~ h3 { margin-top: 20px; padding-top: 16px; border-top: 1px dotted var(--line); }
.chip:has(input:checked), .chip.on { background: var(--ink); color: var(--paper); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.tagicon { display: inline-flex; align-items: center; font-weight: 600; font-size: var(--fs-xs); }
.tagicon .i { width: 1.1em; height: 1.1em; }
.hours th { text-align: left; font: 500 var(--fs-badge)/1.4 var(--font-mono); text-transform: var(--tt); color: var(--ink-3); }
.hours input[type=time] { width: 124px; }
@media (max-width: 560px) {
	.hours, .hours tbody, .hours td { display: block; }
	.hours thead { display: none; }
	.hours tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 12px 0; border-bottom: 1px dotted var(--line); }
	.hours td { padding: 0; border: 0; }
	.hours td:nth-child(1), .hours td:nth-child(2) { grid-column: 1 / -1; }
	.hours td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 2px; }
	.hours input[type=time] { width: 100%; }
}
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches label { position: relative; display: block; width: var(--h-ctl); height: var(--h-ctl); border: 2px solid var(--ink); cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches label:has(input:checked) { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.swatches label:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 5px; }
/* segmented control: bordered cells that choose one value; the chosen one is filled */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; }
.seg label, .seg a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--h-ctl); padding: 0 14px; margin-left: -2px; border: 2px solid var(--ink); background: var(--stone); color: var(--ink-3); cursor: pointer; font: 500 var(--fs-label)/1.2 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); text-decoration: none; }
.seg label:first-child, .seg a:first-child { margin-left: 0; }
.seg a:hover, .seg label:hover { color: var(--ink); text-decoration: none; }
.seg a.on, .seg a.on:hover, .seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.seg.wrap { flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; }
.seg label:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 1px; }
/* the on/off switch: a square slider, the knob is the ink */
.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border: 2px solid var(--ink); background: var(--paper); cursor: pointer; transition: background var(--t-med); }
.switch span::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: var(--ink); transition: transform var(--t-med) var(--ease), background var(--t-med); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::before { background: var(--paper); transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
/* tabs: bordered folders on a rule, the chosen one filled. One component for the sections of a page, the language of a
   text and the stations of the menu; a row that does not fit scrolls sideways instead of wrapping into two storeys. */
.tabs { display: flex; margin: 0 0 16px; border-bottom: 2px solid var(--ink); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > :is(a, button) { flex: none; display: inline-flex; align-items: center; gap: 8px; 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 var(--fs-badge)/1.2 var(--font-mono); white-space: nowrap; text-transform: var(--tt); letter-spacing: var(--ls); text-decoration: none; cursor: pointer; }
.tabs > :is(a, button):hover { background: var(--paper); color: var(--ink); }
.tabs > :is(a, button):focus-visible { outline-offset: -5px; }
.tabs > .on, .tabs > .on:hover, .tabs > [aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tabs b { font-weight: 500; color: var(--ink); }
.tabs > .on b { color: var(--paper); }
/* a language tab says whether its text is filled in: a filled square, or an empty one */
.dotmark { width: 7px; height: 7px; display: inline-block; background: var(--ok); }
.tabs > .on .dotmark { background: #c9d98a; }
.dotmark.off { background: transparent; border: 1.5px solid var(--line); }
.photo-drop { display: flex; gap: 12px; align-items: center; padding: 12px; border: 2px dashed var(--ink-3); background: var(--paper-2); }
.photo-drop { align-items: flex-start; }
.photo-drop img { width: var(--h-pic); height: var(--h-pic); flex: none; border: 2px solid var(--ink); object-fit: cover; background: var(--paper); }
/* the cover in the guest page's proportion (16:7) */
.photo-drop img.wide { width: calc(var(--h-pic) * 16 / 7); height: var(--h-pic); }
.photo-drop .btn.ghost { width: var(--h-ctl); padding: 0; flex: none; }
.file-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-btn { position: relative; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.file-name { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* photos in bulk: a dish waiting for its new photo (now → new), and the files that were not used */
.bulk-swaps { display: grid; gap: 8px; margin-top: 12px; }
.bulk-swaps b { overflow-wrap: anywhere; }
.swap-pics { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.swap-pics > span { display: grid; justify-items: center; gap: 2px; }
.swap-pics img { width: var(--h-pic); height: var(--h-pic); border: 2px solid var(--ink); object-fit: cover; background: var(--paper); }
.swap-pics small { color: var(--ink-3); font: 500 .6875rem/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.swap-pics > .i { color: var(--ink-3); }
.bulk-bad { list-style: none; margin: 12px 0 0; padding: 0; font-size: var(--fs-sm); }
.bulk-bad li { padding: 5px 0; border-bottom: 1px dotted var(--line); overflow-wrap: anywhere; }
.bulk-bad li:last-child { border-bottom: 0; }
/* the demo link on the overview: its QR beside the address */
.demo-link { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.demo-link > .grow { flex: 1 1 240px; min-width: 0; }
.demo-qr { width: 132px; flex: none; padding: 4px; border: 2px solid var(--ink); background: #fff; }
.demo-qr svg { display: block; width: 100%; height: auto; }
/* themes in Settings → Look: a small dish card drawn in each palette (the colours come from the venue's Theme) */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.theme-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 2px solid var(--line); background: transparent; cursor: pointer; }
.theme-card:hover { border-color: var(--ink-3); }
.theme-card:has(input:checked) { border-color: var(--ink); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--ink); }
.theme-card:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.theme-card input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.theme-sample { display: block; padding: 12px 8px; background-color: var(--s-bg); }
.theme-sample.grid { background-image: linear-gradient(#e2d4b6 1px, transparent 1px), linear-gradient(90deg, #e2d4b6 1px, transparent 1px); background-size: 12px 12px; }
.ts-card { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 5px 5px 5px 8px; border: 2px solid var(--s-ink); background: var(--s-paper); color: var(--s-ink); font: 600 .8125rem/1.2 var(--font-display); }
.ts-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ts-lead { flex: 1 1 0; min-width: 0; border-bottom: 2px dotted currentColor; opacity: .35; }
.ts-price { color: var(--s-primary); font: 500 .75rem/1 var(--font-mono); white-space: nowrap; }
.ts-add { width: 22px; height: 22px; flex: none; display: grid; place-items: center; background: var(--s-primary); color: var(--s-on); font: 500 .875rem/1 var(--font-mono); }
.theme-name b { display: block; font-weight: 600; }
.theme-name small { display: block; color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.35; }
.ai-tag { display: inline-flex; align-items: center; min-height: var(--h-tag); margin-left: 6px; padding: 0 6px; border: 1.5px solid var(--ink-3); color: var(--ink-3); font: 500 .6875rem/1.4 var(--font-mono); text-transform: var(--tt); letter-spacing: .06em; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px dotted var(--line); text-align: left; vertical-align: middle; }
.table th { padding-top: 10px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); font: 500 var(--fs-badge)/1.3 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); color: var(--ink-3); white-space: nowrap; background: var(--stone); }
.table tr:last-child td { border-bottom: 0; }
/* a long log reads better tight */
.table.dense td { padding-top: 7px; padding-bottom: 7px; }
.table tbody tr:hover td { background: var(--paper-2); }
.card.table-wrap { padding: 0; overflow: hidden; }
/* a table card with a caption: the caption and an empty line keep the card's inner edge */
.table-wrap > .tcap { margin: 0; padding: 12px 14px 4px; }
.table-wrap > .tpad { margin: 0; padding: 4px 14px 14px; }
.table.flush td:first-child, .table.flush th:first-child { padding-left: 0; }
.table.flush td:last-child, .table.flush th:last-child { padding-right: 0; }
.table .role-pick { width: 132px; }
.search-q { width: 240px; max-width: 100%; }
.w60 { width: 60%; }
.table-wrap { overflow-x: auto; }
/* on a phone every row becomes a small card: the cell's data-label names it */
@media (max-width: 640px) {
	.table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; }
	.table.stack thead { display: none; }
	.table.stack tr { padding: 14px 16px; border-bottom: 1px dotted var(--line); }
	.table.stack tr:last-child { border-bottom: 0; }
	.table.stack td { padding: 4px 0; border: 0; display: flex; gap: 12px; justify-content: space-between; align-items: center; text-align: right; }
	.table.stack td:first-child { display: block; text-align: left; padding-bottom: 6px; }
	.table.stack td[data-label]::before { content: attr(data-label); color: var(--ink-3); font: 500 var(--fs-badge)/1.3 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); text-align: left; flex: none; }
	.table.stack td:last-child { justify-content: flex-end; padding-top: 8px; }
	.table.stack tbody tr:hover td { background: none; }
}

/* ---------- numbers, progress, checklists ---------- */
.stat { padding: 14px 16px; background: var(--paper); border: 2px solid var(--ink); }
.stat b { display: block; font: 500 2rem/1.1 var(--font-mono); letter-spacing: -.03em; }
.stat span { display: block; margin-top: 4px; color: var(--ink-3); font-size: var(--fs-sm); }
a.stat { color: inherit; text-decoration: none; }
a.stat:hover { background: var(--paper-2); }
.grid.tickets { gap: 20px; padding-top: 22px; }
/* a ticket hung on a rail: used for the headline numbers of the statistics page */
.stat.ticket { position: relative; padding: 12px 14px 14px; border-bottom: 0; margin-bottom: 14px; }
.stat.ticket::before { content: ""; position: absolute; left: 50%; top: -14px; width: 34px; height: 14px; margin-left: -17px; border: 2px solid var(--ink); background: var(--kraft); }
.stat.ticket::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: -12px; height: 12px; 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; }
.stat.ticket b { font-size: 2.25rem; }
.rail-bar { position: relative; height: 10px; margin: 18px 0 0; background: var(--ink); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; border-bottom: 2px solid var(--ink); }
.bars-axis { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--ink-3); font: 500 .6875rem/1.2 var(--font-mono); }
.lang-cell { display: inline-flex; align-items: center; gap: 8px; font: 500 .75rem/1 var(--font-mono); }
.bars i { flex: 1; max-width: 44px; min-height: 3px; position: relative; background: var(--ink); }
.bars i:hover { background: var(--brand); }
.progress { height: 12px; border: 2px solid var(--ink); background: var(--paper); }
.progress > i { display: block; height: 100%; background: var(--ink); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dotted var(--line); }
.checklist li:last-child { border-bottom: 0; }
/* a long checklist in two columns on a wide card */
.checklist.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.checklist.cols li:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
@media (max-width: 640px) { .checklist.cols { grid-template-columns: 1fr; } .checklist.cols li:nth-last-child(2):nth-child(odd) { border-bottom: 1px dotted var(--line); } }
.checklist .ico { width: var(--h-mark); height: var(--h-mark); flex: none; display: grid; place-items: center; border: 2px solid var(--ink-3); border-radius: 50%; background: var(--paper); color: var(--ink-3); }
.checklist li.done .ico { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.checklist li.warn .ico { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.checklist li.err .ico { border-color: var(--brand); background: var(--brand); color: #fff; }
.checklist .ico .i { width: 13px; height: 13px; stroke-width: 2.4; }

/* statistics: the dishes opened most, a row of key/value lines on a dotted leader, scans per table as columns */
/* a dish of the top list: the guest card in small (photo with the stamped number, name), a bar and the count */
.td { display: grid; grid-template-columns: var(--h-pic) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 2px solid var(--ink); background: var(--paper); }
.td .pl { position: relative; width: var(--h-pic); height: var(--h-pic); display: grid; place-items: center; border: 2px solid var(--ink); background: var(--stone); color: var(--ink-3); overflow: hidden; }
.td .pl .tk { position: absolute; left: 0; bottom: 0; display: inline-grid; place-items: center; min-width: 26px; min-height: var(--h-tag); padding: 0 5px; background: var(--ink); color: var(--paper); font: 500 .75rem/1.35 var(--font-mono); text-align: center; }
.col-tight { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kv-row:has(.progress) { align-items: center; }
.td .pl img { width: 100%; height: 100%; object-fit: cover; display: block; }
.td .nm { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font: 600 1.0625rem/1.2 var(--font-display); }
/* a dish number in a list: the stamp of the guest card */
.num { 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; }
.td .bar { display: block; margin-top: 7px; height: 10px; border: 2px solid var(--ink); position: relative; }
.td .bar::before { content: ""; position: absolute; inset: 0; width: var(--p); background: var(--ink); }
.ct { font: 500 1.25rem/1 var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.kv-row { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; color: inherit; text-decoration: none; }
a.kv-row:hover span { text-decoration: underline; }
.kv-row > i { flex: 1; min-width: 8px; border-bottom: 2px dotted var(--line); transform: translateY(-3px); }
.tbars { display: flex; gap: 6px; height: 150px; overflow-x: auto; border-bottom: 2px solid var(--ink); padding-bottom: 0; }
.tcol { flex: 1 0 32px; display: flex; flex-direction: column; justify-content: flex-end; min-width: 32px; }
.tcol i { display: block; min-height: 4px; background: var(--ink); }
.tcol i.zero { height: 4px !important; background: var(--line); }
.tcol span { margin-top: 6px; padding-bottom: 4px; text-align: center; font: 500 .6875rem/1 var(--font-mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- menu editor: the guest page's categories and dish cards, with the owner's controls on them ---------- */
/* the stations are the guest rail's folders and stay on screen over a long menu; every station is on one page, so a dish
   can be dragged from one to another */
.mtabs { position: sticky; top: var(--mtop-h); z-index: 20; margin: 0; background: var(--bg); }
.cat { scroll-margin-top: calc(var(--mtop-h) + 56px); container-type: inline-size; }
/* the caption: serif name, dotted leader, count, then the category's own tools */
.cat-head { display: flex; align-items: center; gap: 10px; padding: 24px 0 10px; }
#menu-list > .cat:first-child > .cat-head { padding-top: 0; }
.cat-head h2 { min-width: 0; margin: 0; font-size: 1.375rem; overflow-wrap: anywhere; }
.cat-head .lead { flex: 1; min-width: 12px; border-bottom: 2px dotted var(--line); transform: translateY(5px); }
.cat-head .count { color: var(--ink-3); font: 500 .75rem/1 var(--font-mono); }
.cat-head .tools { display: flex; align-items: center; gap: 6px; }
.cat-head .tools .btn.ghost { width: var(--h-ctl-sm); padding: 0; }
.handle { display: inline-grid; place-items: center; width: var(--h-ctl-sm); height: var(--h-ctl-sm); color: var(--ink-3); cursor: grab; touch-action: none; }
.handle:hover { background: var(--stone); color: var(--ink); }
.sortable-ghost { opacity: .35; }
.dish-list { display: flex; flex-direction: column; gap: 10px; min-height: 12px; }
.cat > .empty { padding: 14px 16px; border: 2px dashed var(--ink-3); text-align: left; }
/* a dish: the guest card (photo with the stamped number, name, the other language, the line at the bottom), with the
   price, the sold-out switch and the edit button on the bottom line */
.dish { position: relative; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 10px; border: 2px solid var(--ink); background: var(--paper); }
.dish > .handle { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; }
.dish-photo { position: relative; width: 88px; height: 88px; padding: 0; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--stone); color: var(--ink-3); overflow: hidden; cursor: pointer; }
.dish-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dish-photo.blank { border-style: dashed; border-color: var(--ink-3); background: var(--paper-2); font: 500 .6875rem/1.25 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.dish-photo.blank > span { display: grid; justify-items: center; gap: 2px; margin-bottom: 14px; }
.dish-photo.blank .i { width: 20px; height: 20px; }
.dish-photo:hover { border-color: var(--ink); }
/* the number is stamped on the corner of the photo, as on the guest card */
.dish-photo .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; letter-spacing: 0; }
.dish.sold .dish-photo img { filter: grayscale(1) contrast(.8) brightness(1.1); }
.dish.sold .tk { background: var(--ink-3); }
.dish .body { min-width: 0; display: flex; flex-direction: column; }
.dish-name { padding-right: 30px; font: 600 1.1875rem/1.15 var(--font-display); overflow-wrap: anywhere; }
.dish.sold .dish-name, .dish.sold .alt { opacity: .55; }
.dish .alt { margin-top: 3px; overflow: hidden; color: var(--ink-3); font-size: .875rem; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }
.dish-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.dish-meta:not(:has(*)) { display: none; }
/* "sold out" is said by the switch; a phone hides the switch's words, so the card says it */
.dish-meta .sold-b { display: none; }
@container (max-width: 520px) { .dish-meta .sold-b { display: inline-flex; } }
/* the bottom line: price, a leader, available today, edit */
.dish-ops { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: auto; padding-top: 8px; }
.dish-ops > .btn { margin-left: auto; }
.dish-ops .lead { flex: 1; min-width: 8px; border-bottom: 2px dotted var(--line); transform: translateY(6px); }
.dish-ops .btn { flex: none; }
.price-input { width: 96px; height: var(--h-ctl); padding: 0 10px; text-align: right; font: 500 1.0625rem/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.price-input.price-from { width: auto; min-width: 96px; justify-content: flex-end; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.sw-line { display: inline-flex; align-items: center; gap: 8px; min-height: var(--h-ctl); font-size: var(--fs-sm); cursor: pointer; }
.sw-line.no { color: var(--brand); font-weight: 600; }
.reorder { display: none; gap: 6px; }
.mv { width: var(--h-ctl-sm); height: var(--h-ctl-sm); padding: 0; display: grid; place-items: center; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; }
.mv:hover { background: var(--stone); }
.mv:active { translate: 0 1px; }
.dish > .reorder { grid-column: 3; flex-direction: column; justify-content: center; gap: 0; }
.dish > .reorder .mv + .mv { margin-top: -2px; }
/* touch screens and phones: arrows instead of the drag grip, shown only in "reorder" mode so a card stays as the guest sees it */
.touch-only { display: none !important; }
@media (max-width: 640px), (pointer: coarse) {
	.touch-only { display: inline-flex !important; }
	.handle { display: none; }
	.dish-name { padding-right: 0; }
	.reordering .reorder { display: flex; }
	.reordering .dish { grid-template-columns: 88px minmax(0, 1fr) auto; }
	.reordering .dish-ops, .reordering .cat-head .tools > :not(.reorder) { display: none; }
}
.btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
/* a narrow card (a phone) keeps the bottom line on one row: the labels of the switch and of the buttons go */
@container (max-width: 520px) {
	.sw-line > span:last-child, .dish-ops .btn .lbl, .cat-head .tools .btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
	.dish-ops .btn, .cat-head .tools .btn { width: var(--h-ctl); min-width: var(--h-ctl); padding: 0; }
	.cat-head .tools .btn { width: var(--h-ctl-sm); min-width: var(--h-ctl-sm); }
	.price-input { width: 76px; }
}

/* ---------- the dish form ---------- */
/* category, number, price and spice in one row; their hints in one line under it */
.grid.item-basics { grid-template-columns: minmax(0, 1fr) 92px 116px auto; gap: 0 14px; align-items: end; }
.item-basics .field { margin-bottom: 6px; }
.item-basics .seg label { padding: 0 11px; }
.item-basics-hint { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0 0 18px; }
@media (max-width: 640px) {
	.grid.item-basics { grid-template-columns: 1fr 1fr; }
	.item-basics .field:first-child, .item-basics .field:last-child { grid-column: 1 / -1; }
}
/* the photo (the stage of the marks) and the key ingredients side by side */
.media-ing { display: grid; grid-template-columns: minmax(0, 270px) minmax(0, 1fr); gap: 0 20px; align-items: start; }
.media-ing .label { margin-bottom: 6px; }
.photo-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
.photo-line .check { padding: 0; }
.ing-col > .row.between { min-height: 22px; margin-bottom: 6px; }
@media (max-width: 640px) { .media-ing { grid-template-columns: 1fr; gap: 18px; } }
/* tags: the group name on the left, its chips on the right */
.tag-groups { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px 14px; align-items: start; }
.tag-groups .tg-name { padding-top: 7px; color: var(--ink-3); font: 500 var(--fs-badge)/1.3 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.tag-groups .chips { gap: 6px; }
.tag-groups .chip { min-height: var(--h-ctl-sm); padding: 3px 10px; font-size: var(--fs-sm); }
@media (max-width: 560px) { .tag-groups { grid-template-columns: 1fr; gap: 4px; } .tag-groups .tg-name { padding-top: 8px; } }

/* ---------- key ingredients of a dish: the stage is the 4:3 frame the guest sees ---------- */
.mark-stage { position: relative; aspect-ratio: 4 / 3; border: 2px solid var(--ink); background: var(--stone); overflow: hidden; }
.mark-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.mark-stage.blank { display: grid; place-items: center; border-style: dashed; border-color: var(--ink-3); background: var(--paper-2); cursor: pointer; }
.mark-stage.blank:hover { background: var(--stone); }
.mark-stage.placing { cursor: crosshair; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent); }
.stage-empty { padding: 16px; color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.35; text-align: center; }
.stage-empty .i { display: block; width: 28px; height: 28px; margin: 0 auto 8px; stroke-width: 1.4; }
.stage-tip { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 6px 10px; background: var(--ink); color: var(--paper); font: 500 var(--fs-badge)/1.4 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); text-align: center; pointer-events: none; }
/* a mark: a dot on the spot, a leader, a lettered label (fixed colours: it sits on a photograph) */
.mk { 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); }
.mk-l.sel { background: #2a1c12; color: #f5ecd8; border-color: #f5ecd8; }
.ing-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ing-row .input { height: var(--h-ctl-sm); padding: 0 10px; }
.ing-pin { width: var(--h-ctl-sm); height: var(--h-ctl-sm); flex: none; display: grid; place-items: center; padding: 0; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); color: var(--ink); font: 500 .8125rem/1 var(--font-mono); cursor: pointer; }
.ing-pin[data-set="1"] { background: var(--ink); color: var(--paper); }
.ing-pin.on { outline: 3px solid var(--brand); outline-offset: 2px; }
.ing-row .btn { min-width: var(--h-ctl-sm); min-height: var(--h-ctl-sm); padding: 0 6px; }
.ing-row .btn .i.x { width: .8em; height: .8em; margin-left: -4px; }
/* price variants in the dish form: a name (per language) and a price per row */
.variants { margin-bottom: 18px; }
.var-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.var-row .input { height: var(--h-ctl-sm); padding: 0 10px; }
.var-row .var-price { width: 120px; flex: none; }
.var-row .btn { min-width: var(--h-ctl-sm); min-height: var(--h-ctl-sm); padding: 0 6px; }
.input.as-note { display: flex; align-items: center; color: var(--ink-3); background: var(--paper-2); font-size: var(--fs-sm); }

/* ---------- dialogs: the guest page's sheet, as wide as the column; a bottom sheet on a phone ---------- */
dialog { padding: 0; border: 2px solid var(--ink); width: min(var(--col), calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); background: var(--paper); color: var(--ink); box-shadow: var(--sh-3); }
dialog::backdrop { background: rgb(36 24 16 / .6); }
#modal { overflow: hidden; }
.modal-head { position: sticky; top: 0; z-index: 2; 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); background: var(--paper); }
.modal-head h2 { margin: 0; font-size: 1.25rem; }
/* the close button is the guest sheet's square */
.modal-head [data-close-modal] { width: var(--h-ctl); min-height: var(--h-ctl); padding: 0; border-color: var(--ink); background: var(--paper); }
.modal-body { padding: 16px var(--gutter) 20px; overflow-y: auto; max-height: calc(100dvh - 164px); }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 8px var(--gutter); border-top: 2px solid var(--ink); background: var(--paper); }
.modal-foot .push-left { margin-right: auto; }
@media (max-width: 640px) {
	#modal { width: 100%; margin: auto auto 0; border-width: 2px 0 0; max-height: 92dvh; }
	.modal-body { max-height: calc(92dvh - 140px); }
	.modal-foot { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
	.modal-foot .btn { flex: 1; }
	.modal-foot .push-left { flex: none; width: var(--h-ctl); padding: 0; }
	.modal-foot .push-left .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- moderation: the menu under review is laid out like the guest page: a caption per category, a card per dish ---------- */
.diff-group { display: flex; flex-direction: column; gap: 10px; }
.diff-head { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-size: 1.375rem; overflow-wrap: anywhere; }
.diff-head .lead { flex: 1; min-width: 12px; border-bottom: 2px dotted var(--line); transform: translateY(5px); }
.diff-head small { color: var(--ink-3); font: 500 .75rem/1 var(--font-mono); }
.diff-head .badge { flex: none; }
.diff-card { padding: 4px 14px; border: 2px solid var(--ink); background: var(--paper); }
.diff-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; padding: 8px 0; border-top: 1px dotted var(--line); }
.diff-card > .diff-row:first-child, .diff-inline > .diff-row:first-child { border-top: 0; }
.diff-row .f { color: var(--ink-3); font: 500 var(--fs-badge)/1.5 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); }
.diff-row .old { padding: 4px 8px; background: var(--err-soft); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--err) 55%, transparent); }
.diff-row .new { padding: 4px 8px; background: var(--ok-soft); }
.diff-row .none { color: var(--ink-3); font-style: italic; }
.diff-row img { max-height: 72px; border: 2px solid var(--ink); display: block; }
/* a dish under review: the guest card's head (number, name, price), then what changed */
.diff-item { padding: 10px 14px; border: 2px solid var(--ink); background: var(--paper); }
.di-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.di-head b { font: 600 1.1875rem/1.15 var(--font-display); }
.di-head .lead { flex: 1; min-width: 8px; border-bottom: 2px dotted var(--line); transform: translateY(5px); }
.di-head .price { font: 500 1.0625rem/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.di-body { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; }
.di-texts > div + div { margin-top: 4px; }
.remark { margin-top: 6px; }
.remark summary { display: inline-flex; align-items: center; min-height: var(--h-ctl-sm); cursor: pointer; color: var(--brand); }
.diff-card .remark { margin: 0; padding: 4px 0 6px; border-top: 1px dotted var(--line); }
.diff-card > .remark:first-child { border-top: 0; }
.diff-inline { margin-top: 6px; }
.diff-photo { width: 88px; height: 88px; flex: none; border: 2px solid var(--ink); object-fit: cover; }
.gone { text-decoration: line-through; }
@media (max-width: 640px) { .diff-row { grid-template-columns: 1fr 1fr; gap: 4px 10px; } .diff-row .f { grid-column: 1 / -1; } }
.sev-ERROR { color: var(--err); } .sev-WARN { color: var(--warn); } .sev-INFO { color: var(--info); }
/* the decision: the last block of the review, after the whole menu has been read */
.decide .btn-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 560px) { .decide .btn-row { flex-direction: column-reverse; } .decide .btn-row .btn { width: 100%; } }
.ph-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.langs-prev { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.langs-prev .btn { padding: 0 10px; }
.kv-row:has(.langs-prev) { align-items: center; }

/* ---------- sign-in: a docket in the column, with a torn lower edge ---------- */
.auth { width: 100%; max-width: var(--col); margin: 0 auto; padding: 16px var(--gutter) 40px; }
.auth-card { position: relative; padding: 16px 16px 22px; margin-bottom: 14px; border-bottom: 0; }
.auth-card::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: -12px; height: 12px; 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; }
.auth-card h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 6.6vw, 2.125rem); line-height: 1.05; letter-spacing: -.015em; }
.auth-card > p.muted { margin-bottom: 16px; }
.auth-card > h1 + form, .auth-card > h1 + .alert { margin-top: 14px; }
.auth-card hr { margin: 18px -16px; }
.auth-card .alert { margin: 12px 0; }
.auth-card > .alert:first-child { margin-top: 0; }
/* the browser check: one quiet line above the button */
.pow-status { display: flex; align-items: center; gap: 8px; min-height: 1.4em; margin: 12px 0 0; font: 500 var(--fs-sm) var(--font-mono); }
.pow-status:empty { display: none; }
.pow-status::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--warn); animation: pow-pulse 1s ease-in-out infinite; }
.pow-status.done::before { background: var(--ok); animation: none; }
.pow-status.err { color: var(--err); font-weight: 500; }
.pow-status.err::before { background: var(--err); animation: none; }
@keyframes pow-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pow-status::before { animation: none; } }

/* ---------- landing: the same column; the title block, the real guest page as the demo, then the blocks ---------- */
.land { width: 100%; max-width: var(--col); margin: 0 auto; padding: 16px var(--gutter) 0; display: flex; flex-direction: column; gap: 16px; }
.land .page-head h1 { font-size: clamp(1.875rem, 7.4vw, 2.75rem); line-height: 1.06; text-wrap: balance; }
:lang(th) .land .page-head h1 { line-height: 1.35; }
/* a phone: the kicker takes the first line of the row, the two ways in share the second */
@media (max-width: 560px) {
	.land .ph-row:has(.btn) { display: grid; grid-template-columns: 1fr 1fr; }
	.land .ph-row .l-kick { grid-column: 1 / -1; border-bottom: 2px solid var(--ink); }
	.land .ph-row .l-kick + .btn { border-left: 0; }
	.land .ph-row .btn { margin: 0; }
}
.land .ph-note { margin-top: 10px; color: var(--ink-2); font-size: 1.0625rem; line-height: 1.5; }
.l-kick .i { color: var(--brand); }
.l-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; }
.l-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: var(--h-ctl); padding: 0 12px; border: 2px solid var(--ink); background: var(--paper-2); color: var(--ink); font: inherit; font-size: var(--fs-sm); white-space: nowrap; cursor: pointer; transition: background var(--t-fast); }
.l-chip:hover { background: var(--stone); }
.l-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.l-phone { width: min(330px, 100%); margin: 16px auto 0; padding: 9px; border-radius: 42px; background: var(--ink); box-shadow: var(--sh-3); }
.l-phone iframe { display: block; width: 100%; height: 640px; border: 0; border-radius: 34px; background: var(--bg); }
.l-section > h2 { margin: 8px 0 10px; font-size: 1.375rem; line-height: 1.2; }
:lang(th) .l-section > h2 { line-height: 1.45; }
/* three steps: a sheet of sections, a circled number on each */
.l-steps { margin: 0; padding: 0; list-style: none; }
.l-steps li { display: grid; grid-template-columns: var(--h-mark) minmax(0, 1fr); gap: 4px 14px; }
.l-steps .tk { grid-row: span 2; display: grid; place-items: center; width: var(--h-mark); height: var(--h-mark); border: 2px solid var(--ink); border-radius: 50%; background: var(--paper-2); font: 500 .8125rem/1 var(--font-mono); }
.l-steps h3, .l-item h3 { margin: 4px 0 0; font-size: 1.1875rem; line-height: 1.15; }
.l-steps p, .l-item p { margin: 0; color: var(--ink-2); }
/* what it does: cards of one list, an icon plate and the text */
.l-item { display: grid; grid-template-columns: var(--h-pic) minmax(0, 1fr); gap: 4px 12px; padding: 10px; border: 2px solid var(--ink); background: var(--paper); }
.l-item .ico { grid-row: span 2; width: var(--h-pic); height: var(--h-pic); display: grid; place-items: center; border: 2px solid var(--ink); background: var(--paper-2); color: var(--ink); }
.l-item .ico .i { width: 22px; height: 22px; }
.l-wall { display: flex; flex-wrap: wrap; gap: 0 24px; align-items: baseline; font: 600 clamp(1.4rem, 5vw, 1.875rem)/1.6 var(--font-display); color: var(--ink-3); }
.l-wall span:first-child { color: var(--ink); }
.l-cta { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; margin-top: 8px; padding: 20px 16px; border: 2px solid var(--ink); background: var(--espresso); color: var(--on-espresso); }
.l-cta h2 { margin: 0; color: var(--on-espresso); font-size: 1.375rem; }
.l-cta .btn { background: var(--on-espresso); border-color: var(--on-espresso); color: var(--espresso); }
.l-cta .btn:hover { background: #fff; }
@media (max-width: 640px) { .l-phone iframe { height: 580px; } }

/* legal text: one sheet in the column */
.legal-doc h1 { margin: 0 0 12px; font-size: clamp(1.5rem, 6.6vw, 2.125rem); line-height: 1.05; }
.legal-doc h3 { margin: 22px 0 6px; font-size: 1.1875rem; }
.legal-doc p { color: var(--ink-2); }
.legal-doc p:last-child { margin-bottom: 0; }

/* ---------- QR studio ---------- */
/* two codes side by side even on a phone, three in the column */
.qr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.qr-tile { padding: 10px; border: 2px solid var(--ink); background: var(--paper); text-align: center; }
.qr-tile .qr-img { padding: 8px; border: 1px dotted var(--line); background: var(--paper-2); }
.qr-tile .qr-img svg { width: 100%; height: auto; display: block; }
.qr-tile .nm { margin-top: 8px; font: 600 1.1875rem/1.15 var(--font-display); }
/* the short address on one line, in the mono of the printed card */
.qr-tile .url { overflow: hidden; color: var(--ink-3); font: 500 .75rem/1.5 var(--font-mono); white-space: nowrap; text-overflow: ellipsis; }
/* the three ways to take a code: two files and the print dialog, side by side on any tile width */
.qr-acts { display: grid; grid-template-columns: 1fr 1fr var(--h-ctl-sm); gap: 6px; margin-top: 8px; }
.qr-acts .btn { min-width: 0; padding: 0 6px; }
.qr-pick { display: flex; align-items: center; min-height: 28px; margin: 0 0 4px; cursor: pointer; }
.qr-pick input { width: 18px; height: 18px; accent-color: var(--ink); cursor: pointer; }
/* choosing codes to print: above the tiles they choose from */
.qr-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.qr-bar .check { padding: 0; }
.self-end { align-self: flex-end; }
.qr-more { margin-top: 8px; text-align: left; }
.qr-more summary { min-height: var(--h-ctl-sm); padding: 6px 0; list-style: none; cursor: pointer; color: var(--ink-3); font: 500 var(--fs-badge)/1.4 var(--font-mono); text-transform: var(--tt); letter-spacing: var(--ls); text-align: center; }
.qr-more summary::-webkit-details-marker { display: none; }
.qr-more summary:hover, .qr-more[open] summary { color: var(--ink); }
.qr-more form { display: flex; gap: 6px; margin-top: 6px; }
.qr-more form .input { min-width: 0; height: var(--h-ctl-sm); padding: 0 9px; }
.qr-more form .btn { flex: none; }
/* the design: the sample on the left, its options on the right (one column on a phone) */
.qr-design { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 0 16px; align-items: start; }
.qr-design > * { min-width: 0; }
.qr-preview { display: grid; place-items: center; padding: 12px; border: 2px solid var(--ink); background: var(--paper-2); }
.qr-preview svg { width: 100%; max-width: 240px; height: auto; }
@media (max-width: 560px) { .qr-design { grid-template-columns: minmax(0, 1fr); } .qr-preview { margin-bottom: 16px; } }

/* ---------- small things ---------- */
.toast { position: fixed; z-index: 100; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; align-items: 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: 500 var(--fs-md) var(--font-text); }
.toast.err { background: var(--brand); border-color: var(--brand); }
@media (max-width: 900px) { .toast { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.htmx-indicator { opacity: 0; transition: opacity var(--t-fast); }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 32px 16px; text-align: center; color: var(--ink-3); }
.empty p:last-child { margin-bottom: 0; }
.card.empty { border-style: dashed; }
.empty .i { width: 36px; height: 36px; margin-bottom: 10px; stroke-width: 1.4; color: var(--ink-3); }
.empty h2 { color: var(--ink); }
.err-ico { width: 64px; height: 64px; color: var(--brand); stroke-width: 1.4; }
.code-input { padding-left: .45em; font: 500 1.75rem/1.2 var(--font-mono); letter-spacing: .45em; text-align: center; font-variant-numeric: tabular-nums; height: var(--h-key); }
.verify-banner { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; min-height: var(--h-ctl); padding: 4px var(--gutter); border-bottom: 2px dashed var(--warn); background: var(--warn-soft); color: #5c3b08; font-size: var(--fs-md); }
.verify-banner a { color: inherit; font-weight: 600; }
.mail-preview { width: 100%; height: 420px; border: 2px solid var(--ink); background: var(--paper-2); }
fieldset.plain { min-width: 0; margin: 0; padding: 0; border: 0; }
code.copy { padding: 2px 6px; background: var(--stone); font-size: var(--fs-sm); word-break: break-all; user-select: all; }

/* ---------- spacing utilities: last, so that they win over a component's own margin (".field.mb0") ---------- */
.mt0 { margin-top: 0; } .mt1 { margin-top: 8px; } .mt2 { margin-top: 16px; }
.mb0 { margin-bottom: 0; } .mb1 { margin-bottom: 8px; } .mb2 { margin-bottom: 16px; }
