/*
 * Restaurant pages. Plain CSS from 'self' (CSP style-src 'self'). Guest pages follow the `mess` template:
 * one phone-width column, thumb-reach controls, a bottom cart bar; wider screens show the same column
 * centered. Colors, fonts and corners come from the version's theme CSS (`--t-*` tokens, SUITE-SPEC 6.2);
 * the values after each token are the fallbacks used before it loads. Owner: Claude. Created 15 Nov 2026.
 * Mess template 15 Nov 2026.
 */
:root {
  --bg: #f5f1ea; --surface: #ffffff; --text: #1d1a16; --muted: #6f685e; --line: #ebe4d8;
  --accent: #c2481f; --accent-dark: #9c3815; --accent-soft: #fbe9e0; --accent-text: #ffffff;
  --hero-from: #2f1c12; --hero-to: #7b3517; --hero-text: #fff8f0;
  --ok: #1f7a4a; --ok-soft: #e3f3ea; --warn: #9a6a00; --error: #b42318; --error-soft: #fdecea;
  --radius: 16px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(40, 25, 10, 0.06), 0 6px 20px rgba(40, 25, 10, 0.08);
  --column: 520px; --gutter: 16px; --bar-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110e; --surface: #1f1b17; --text: #f3ede5; --muted: #a89f93; --line: #332d27;
    --accent: #ea7a47; --accent-dark: #ffa47a; --accent-soft: #3a2418; --accent-text: #1a110b;
    --ok: #6fc28f; --ok-soft: #1b3326; --warn: #e0b048; --error: #ff8a80; --error-soft: #3a1c1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-tap-highlight-color: transparent; }
main { max-width: 720px; margin: 0 auto; padding: var(--gutter); }
h1 { font-size: 1.5rem; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 0; }
ul, ol { list-style: none; padding: 0; margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); margin: 0; }
.error { color: var(--error); font-weight: 600; margin: 0; }
.demo-banner { background: #2a211a; color: #f7e9d8; text-align: center; font-size: 0.75rem; padding: 5px 12px; }
.notice { background: var(--surface); border-left: 4px solid var(--warn); padding: 10px 12px; border-radius: var(--radius-sm); margin: 12px 0; }
.btn { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 10px 18px; min-height: 44px; }
.btn.small { padding: 4px 12px; min-height: 34px; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 650; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Guest: `mess` template, one phone column ---------- */
body.guest {
  --bg: var(--t-background, #f4f2f9); --surface: var(--t-surface, #ffffff); --text: var(--t-text, #1c1a33); --muted: var(--t-muted, #5d5a78);
  --line: color-mix(in srgb, var(--muted) 22%, transparent);
  --accent: var(--t-primary, #2c2764); --accent-text: var(--t-on-primary, #fff4dc); --accent-dark: var(--t-primary, #2c2764);
  --accent-soft: color-mix(in srgb, var(--t-primary, #2c2764) 9%, var(--surface));
  --gold: var(--t-accent, #f2b46a); --on-gold: var(--t-on-accent, #1b1c4a);
  --hero-from: var(--t-hero-from, #1b1c4a); --hero-to: var(--t-hero-to, #4a2f66); --hero-text: var(--t-hero-text, #fff4dc);
  --radius: var(--t-radius, 18px); --shadow: var(--t-card-shadow, 0 1px 2px rgba(20, 16, 40, 0.06), 0 8px 22px -10px rgba(20, 16, 40, 0.28));
  --veg: #1a7f37; --nonveg: #a4161a; --egg: #b8860b;
  font-family: var(--t-font-body, system-ui, sans-serif);
  color-scheme: light;
}
body.guest h1, body.guest h2, body.guest .order-no { font-family: var(--t-font-heading, Georgia, serif); font-weight: 400; letter-spacing: 0.01em; }
body.guest main { max-width: var(--column); padding: 0 0 calc(var(--bar-h) + 32px + env(safe-area-inset-bottom)); }
body.guest main > .message, body.guest main > .error { padding: 0 var(--gutter); }
body.guest .demo-banner { background: #15163d; color: #fff4dc; }

/* Hero: the hill at dusk behind the name. */
.hero { position: relative; overflow: hidden; color: var(--hero-text); background: linear-gradient(160deg, var(--hero-from), var(--hero-to)); min-height: 230px; display: flex; align-items: flex-end; }
.hero.compact { min-height: 128px; }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 80% 35%; }
.hero-text { position: relative; padding: 18px var(--gutter) 16px; width: 100%; }
.hero .tagline { margin: 0 0 2px; font-size: 0.95rem; color: var(--gold); letter-spacing: 0.02em; }
.hero h1 { font-size: 1.8rem; line-height: 1.15; text-shadow: 0 2px 12px rgba(10, 8, 30, 0.55); }
.hero.compact h1 { font-size: 1.3rem; }
.hero-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 0.78rem; font-weight: 600; background: rgba(255, 244, 220, 0.16); color: inherit; backdrop-filter: blur(4px); }
.chip.open::before, .chip.shut::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5fd38d; }
.chip.shut::before { background: #ff8a7a; }
.topbar .chip { background: var(--accent-soft); color: var(--accent); }

.announcement { margin: 12px var(--gutter) 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--gold) 22%, var(--surface)); color: var(--text); font-size: 0.92rem; white-space: pre-line; }
.closed-card { border-left: 5px solid var(--gold); }
.closed-card h2 { margin-bottom: 4px; }
.closed-card p { margin: 0 0 4px; }

/* Category tabs stay under the thumb while scrolling. */
.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px var(--gutter); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-size: 0.9rem; font-weight: 600; color: var(--muted); min-height: 40px; }
.tab[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.category { padding: 20px var(--gutter) 4px; scroll-margin-top: 62px; }
.category h2 { font-size: 1.35rem; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.category h2::before { content: ""; width: 10px; height: 14px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 70%, #fff6d6, var(--gold) 55%, #ef7d32); box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 70%, transparent); flex: none; }
.items { display: grid; gap: 12px; }
.item { display: grid; grid-template-columns: 1fr 108px; gap: 12px; align-items: start; background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.item.off { opacity: 0.55; }
.item.off .item-photo { filter: grayscale(1); }
.item-body h3 { font-size: 1.02rem; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; line-height: 1.3; }
.price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; font-size: 1.02rem; }
.price-row s { color: var(--muted); font-size: 0.88rem; }
.tag { background: var(--gold); color: var(--on-gold); border-radius: 6px; font-size: 0.7rem; font-weight: 700; padding: 1px 7px; text-transform: uppercase; letter-spacing: 0.04em; }
.desc { margin: 4px 0 0; color: var(--muted); font-size: 0.86rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item-media { position: relative; padding-bottom: 18px; }
.item-photo { display: block; width: 108px; height: 108px; border-radius: calc(var(--radius) - 4px); object-fit: cover; background: var(--line); }
.no-photo { background:
  radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--gold) 55%, transparent) 0 18%, transparent 19%),
  radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--surface) 90%, transparent) 0 34%, transparent 35%),
  linear-gradient(160deg, var(--hero-from), var(--hero-to)); }
.item-action { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); }
.add { min-width: 88px; height: 38px; border: 1px solid var(--accent); border-radius: 10px; background: var(--surface); color: var(--accent); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.82rem; box-shadow: var(--shadow); }
.stepper { display: inline-flex; align-items: center; height: 38px; min-width: 88px; border-radius: 10px; background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow); overflow: hidden; }
.stepper button { border: 0; background: transparent; color: inherit; width: 32px; height: 100%; font-size: 1.15rem; font-weight: 700; }
.stepper button:disabled { opacity: 0.4; }
.stepper .n { flex: 1; text-align: center; font-weight: 700; min-width: 20px; }
.stepper.compact { height: 34px; min-width: 88px; background: var(--accent-soft); color: var(--accent); box-shadow: none; border: 1px solid var(--accent); }
.sold-out { display: inline-block; white-space: nowrap; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-size: 0.72rem; font-weight: 600; color: var(--muted); }

/* Veg, non-veg and egg markers: the square-and-dot sign Indian menus use, with a text label for readers. */
.diet { flex: none; width: 16px; height: 16px; border: 1.6px solid currentColor; border-radius: 3px; display: inline-grid; place-items: center; margin-top: 2px; }
.diet span { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.diet.veg { color: var(--veg); }
.diet.nonveg { color: var(--nonveg); }
.diet.egg { color: var(--egg); }

.site-foot { padding: 24px var(--gutter) 8px; display: grid; gap: 6px; font-size: 0.85rem; white-space: pre-line; }
.site-foot p { margin: 0; }

/* Bottom cart bar: always in thumb reach. */
.cart-bar-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 0 12px calc(12px + env(safe-area-inset-bottom)); pointer-events: none; }
.cart-bar { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: calc(var(--column) - 24px); margin: 0 auto; min-height: var(--bar-h); border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-text); padding: 10px 18px; box-shadow: 0 10px 28px -6px color-mix(in srgb, var(--accent) 70%, transparent); text-align: left; }
.cart-bar-left { display: grid; font-size: 0.85rem; }
.cart-bar-left strong { font-size: 0.95rem; }
.cart-bar-right { font-weight: 750; font-size: 1.02rem; color: var(--gold); }

/* Checkout */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px var(--gutter); position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.back { border: 0; background: none; font-weight: 650; font-size: 1rem; padding: 8px 4px; color: var(--accent); min-height: 44px; }
.checkout { display: grid; gap: 14px; padding: 16px var(--gutter) 0; }
.checkout h1 { font-size: 1.6rem; }
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
body.guest main > .card { margin: 14px var(--gutter) 0; }
.lines { display: grid; gap: 14px; }
.line { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; }
.line-photo { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; display: block; }
.line-body { display: grid; font-size: 0.95rem; }
.line-body .muted { font-size: 0.82rem; }
.line-end { display: grid; justify-items: end; gap: 4px; font-size: 0.92rem; }
.link { border: 0; background: none; color: var(--accent); font-weight: 650; padding: 14px 0 0; min-height: 44px; }
.field { display: grid; gap: 6px; margin-top: 12px; font-size: 0.9rem; font-weight: 600; }
.field:first-of-type { margin-top: 0; }
.field small { font-weight: 400; color: var(--muted); }
.field input, .field textarea { font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); width: 100%; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row input { flex: 1; min-width: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 9px 14px; font-weight: 600; font-size: 0.9rem; min-height: 44px; }
.choice[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.bill .row { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; }
.bill .row.total { font-weight: 750; font-size: 1.15rem; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 8px; }
.bill .row.save { color: var(--veg); font-weight: 600; }
.bill .row.fine { margin: 2px 0 0; }
.tax-inside { margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--bg); }
.tax-inside > .fine:first-child { margin: 0 0 4px; font-weight: 600; }
.fine { font-size: 0.8rem; color: var(--muted); margin: 6px 0 0; }
.notice { background: color-mix(in srgb, var(--gold) 20%, var(--surface)); border-left: 4px solid var(--gold); padding: 10px 12px; border-radius: 10px; margin: 12px 0 0; font-size: 0.9rem; }
.pay-option { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 12px; border: 2px solid var(--accent); border-radius: 14px; background: var(--accent-soft); }
.pay-option > span:last-child { display: grid; gap: 2px; }
.pay-option small { color: var(--muted); font-size: 0.82rem; }
.radio-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--accent); background: radial-gradient(circle, var(--accent) 0 45%, transparent 50%); margin-top: 2px; }
.policy p { margin: 0; white-space: pre-line; font-size: 0.92rem; }
.agree { display: flex; gap: 12px; align-items: flex-start; font-size: 0.86rem; color: var(--muted); padding: 0 4px; }
.agree input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.message:empty { display: none; }
.place-wrap { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); }
.place { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 56px; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-text); font-size: 1.02rem; font-weight: 750; padding: 0 20px; box-shadow: 0 10px 28px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.place span:last-child { color: var(--gold); font-size: 0.95rem; }
.place:disabled { opacity: 0.55; }

/* Order tracker */
.order-card { text-align: center; }
.placed { color: var(--veg); font-weight: 700; margin: 0 0 8px; }
.order-label { margin: 0; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.order-no { font-size: 2.3rem; margin: 2px 0 0; letter-spacing: 0.03em; color: var(--accent); }
.pill { display: inline-block; border-radius: 999px; padding: 4px 14px; margin: 8px 0 4px; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 0.9rem; }
.s-counter { background: color-mix(in srgb, var(--gold) 30%, var(--surface)); color: var(--on-gold); }
.s-paid, .s-preparing, .s-delivered { background: color-mix(in srgb, var(--veg) 12%, var(--surface)); color: var(--veg); }
.s-cancelled { background: color-mix(in srgb, var(--nonveg) 10%, var(--surface)); color: var(--nonveg); }
.counter-note { margin: 6px 0 0; font-weight: 600; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0 6px; position: relative; }
.steps li { display: grid; justify-items: center; gap: 6px; font-size: 0.76rem; color: var(--muted); position: relative; }
.steps li::before { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.steps li:first-child::before { display: none; }
.steps .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); z-index: 1; }
.steps li.done .dot { background: var(--veg); border-color: var(--veg); }
.steps li.done::before, .steps li.now::before { background: var(--veg); }
.steps li.now .dot { border-color: var(--gold); background: var(--gold); box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 35%, transparent); }
.steps li.now, .steps li.done { color: var(--text); font-weight: 650; }
.cancelled { color: var(--nonveg); font-weight: 650; }
.actions { display: grid; gap: 10px; }
.summary { display: grid; gap: 8px; margin: 0 0 12px; }
.summary li { display: flex; justify-content: space-between; gap: 12px; }
.summary .q { color: var(--muted); margin-right: 8px; font-weight: 650; }
.stars { display: flex; gap: 6px; justify-content: center; margin: 4px 0 8px; }
.star { border: 0; background: none; font-size: 2.2rem; line-height: 1; color: var(--line); padding: 2px; min-width: 44px; min-height: 44px; }
.star[aria-pressed="true"] { color: var(--gold); }
.feedback .btn { width: 100%; margin-top: 14px; }
.thanks { text-align: center; color: var(--muted); }
.thanks .given { color: var(--gold); letter-spacing: 0.1em; }
body.guest .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
body.guest main > .btn.wide { display: block; width: calc(100% - 2 * var(--gutter)); margin: 16px auto 0; }
.status-page { text-align: center; padding: 28px 20px; margin-top: 24px; }
.status-page h1 { font-size: 1.5rem; margin-bottom: 8px; color: var(--accent); }
.status-page p { margin: 0; color: var(--muted); }

/* Wider screens: the same phone column, set on a soft background. */
@media (min-width: 600px) {
  body.guest { background: color-mix(in srgb, var(--hero-from) 14%, var(--bg)); }
  body.guest main { background: var(--bg); min-height: 100vh; box-shadow: 0 0 40px rgba(20, 16, 40, 0.14); }
}

/* ---------- Staff board: tablet landscape first, phone portrait swipes between columns ---------- */
body.board main { max-width: 1400px; padding: 12px; }
.board-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.board-head h1 { font-size: 1.25rem; }
.board-head .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.board-head select { font: inherit; min-height: 44px; border-radius: 999px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: start; }
.column { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; min-height: 60vh; }
.column h2 { display: flex; justify-content: space-between; align-items: center; margin: 4px 2px 8px; font-size: 1rem; }
.column .count { background: var(--line); border-radius: 999px; padding: 0 9px; font-size: 0.85rem; }
.board .card { border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; background: var(--bg); box-shadow: none; }
.board .card.overdue { border-left-color: var(--error); background: var(--error-soft); }
.board .card.fresh { animation: fresh 1.2s ease-out 2; }
@keyframes fresh { 0% { box-shadow: 0 0 0 0 var(--accent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) { .board .card.fresh { animation: none; outline: 2px solid var(--accent); } }
.board .card p { margin: 2px 0; }
.board .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 2px; }
.board .card .btn { min-height: 44px; padding: 8px 14px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-no { font-size: 1.1rem; }
.age { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.age.late { color: var(--error); font-weight: 700; }
.where { font-weight: 600; }
.card-lines { margin: 6px 0; }
.card-lines li { font-size: 1rem; padding: 2px 0; }
.card-total { font-weight: 650; }
.fresh-note { border-left-color: var(--accent); }
.status { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; }
@media (max-width: 900px) and (orientation: portrait), (max-width: 640px) {
  .columns { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 8px; }
  .column { flex: 0 0 88%; scroll-snap-align: start; min-height: 70vh; }
  .board-head h1 { font-size: 1.1rem; }
}

/* ---------- Local dev pages ---------- */
.dev ul li { margin: 6px 0; }
.dev h2 { margin-top: 1.2em; }

/* ---------- Public demonstration pages ---------- */
body.demo main { max-width: 560px; padding: 16px; }
.demo-card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-top: 8px; }
.demo-card h1 { margin: 4px 0 10px; }
.demo-card h2 { margin-top: 18px; }
.biz { font-weight: 700; font-size: 1.1rem; margin: 0 0 6px; }
.eyebrow { margin: 0; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.demo-points { list-style: disc; padding-left: 20px; margin: 12px 0 16px; display: grid; gap: 4px; }
.demo-links { display: grid; gap: 8px; }
.demo-links .btn, .demo-links a.btn { display: block; text-align: center; text-decoration: none; }
.btn.big { width: 100%; min-height: 52px; font-size: 1.05rem; }
a.btn { display: inline-block; text-decoration: none; }
