/* ==========================================================================
   OrderFood247 — design system
   Ketchup red for actions, mustard for rewards, pickle green for "open/ready",
   kitchen navy for vendor/admin tools. Order tickets are the signature element.
   ========================================================================== */

:root {
  --red: #C8102E;
  --red-ink: #9E0B22;
  --red-soft: #FCE8EB;
  --mustard: #F4B400;
  --mustard-soft: #FFF4D1;
  --green: #1E7A4C;
  --green-soft: #E3F3EA;
  --navy: #1F2A44;
  --navy-2: #2C3A5C;
  --ink: #22201E;
  --muted: #6F6A65;
  --line: #E6E3DF;
  --bg: #F1F2F4;
  --surface: #FFFFFF;
  --paper: #FFFDF8;

  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow-1: 0 1px 2px rgba(34, 32, 30, .06), 0 2px 8px rgba(34, 32, 30, .05);
  --shadow-2: 0 10px 30px rgba(31, 42, 68, .14);
  --wrap: 1180px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--red); text-underline-offset: 2px; }
a:hover { color: var(--red-ink); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 28px; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--r-sm); z-index: 999; }
.skip-link:focus { top: 10px; color: #fff; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  --b: var(--surface); --c: var(--ink); --bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .6rem 1.15rem; border-radius: 999px;
  background: var(--b); color: var(--c); border: 1.5px solid var(--bd);
  font: 600 .95rem/1.1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { color: var(--c); border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { --b: var(--red); --c: #fff; --bd: var(--red); }
.btn-primary:hover { --b: var(--red-ink); --bd: var(--red-ink); color: #fff; }
.btn-dark { --b: var(--navy); --c: #fff; --bd: var(--navy); }
.btn-dark:hover { --b: var(--navy-2); color: #fff; border-color: var(--navy-2); }
.btn-green { --b: var(--green); --c: #fff; --bd: var(--green); }
.btn-green:hover { color: #fff; filter: brightness(1.08); border-color: var(--green); }
.btn-ghost { --b: transparent; --bd: transparent; }
.btn-ghost:hover { background: rgba(34, 32, 30, .06); border-color: transparent; }
.btn-danger { --c: var(--red); --bd: #F3C5CD; }
.btn-danger:hover { --b: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-sm { min-height: 36px; padding: .4rem .85rem; font-size: .875rem; }
.btn-lg { min-height: 54px; padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; font-size: 1.15rem; color: var(--ink); }
.icon-btn:hover { background: rgba(34, 32, 30, .07); }

/* ── Header ──────────────────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 1rem; height: var(--header-h); }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 34px; width: auto; }
.main-nav { display: flex; align-items: center; gap: .15rem; margin-left: .75rem; }
.main-nav a { padding: .5rem .8rem; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .94rem; text-decoration: none; }
.main-nav a:hover { color: var(--ink); background: rgba(34, 32, 30, .05); }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--bg); }
.main-nav a.nav-tools { color: var(--navy); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.town-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; border-radius: 999px; background: var(--bg); color: var(--ink); font-weight: 600; font-size: .88rem; text-decoration: none; border: 1px solid transparent; }
.town-chip:hover { border-color: var(--line); color: var(--ink); }
.town-chip svg { color: var(--red); }
.cart-btn { position: relative; }
.cart-btn .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--red); font-size: .78rem; font-weight: 800; display: inline-grid; place-items: center; }
.cart-btn .count.is-empty { background: rgba(255, 255, 255, .3); color: #fff; }
.account { position: relative; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: .4rem; display: none; }
.account.is-open .account-menu { display: block; }
.account-menu a, .account-menu button { display: flex; width: 100%; gap: .6rem; align-items: center; padding: .6rem .75rem; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font: 500 .94rem var(--font-body); background: none; border: 0; cursor: pointer; text-align: left; }
.account-menu a:hover, .account-menu button:hover { background: var(--bg); }
.account-menu hr { border: 0; border-top: 1px solid var(--line); margin: .35rem 0; }
.account-menu .who { padding: .5rem .75rem .6rem; font-size: .85rem; color: var(--muted); }
.account-menu .who strong { display: block; color: var(--ink); font-size: .95rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; border: 0; cursor: pointer; font-family: var(--font-display); }

@media (max-width: 860px) {
  .main-nav, .town-chip .town-name-long { display: none; }
}

/* Mobile bottom tab bar */
.tabbar { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem 0 .55rem; font-size: .72rem; font-weight: 600; color: var(--muted); text-decoration: none; position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--red); }
  .tabbar .dot { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; border-radius: 999px; background: var(--red); color: #fff; font-size: .68rem; display: grid; place-items: center; padding: 0 4px; }
  .header-actions .cart-btn { display: none; }
}

/* ── Flash / toast ───────────────────────────────────────────────────── */
.flash-stack { position: fixed; z-index: 120; top: calc(var(--header-h) + 12px); right: 16px; left: 16px; display: grid; gap: .5rem; justify-items: end; pointer-events: none; }
.toast { pointer-events: auto; max-width: 420px; width: 100%; background: var(--ink); color: #fff; border-radius: var(--r-md); padding: .85rem 1rem; box-shadow: var(--shadow-2); display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; animation: toast-in .25s ease-out; }
.toast.is-error { background: var(--red-ink); }
.toast.is-info { background: var(--navy); }
.toast.is-success::before { content: "✓"; font-weight: 800; color: #8EE3B4; }
.toast .toast-x { margin-left: auto; background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.toast a { color: #fff; font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ── Forms ───────────────────────────────────────────────────────────── */
.field { display: grid; gap: .35rem; }
.field label, .label { font-weight: 600; font-size: .88rem; }
.field .hint { font-size: .8rem; color: var(--muted); }
.field .err, .form-error { font-size: .83rem; color: var(--red); font-weight: 600; }
.input, .select, .textarea, input[type=text].input {
  width: 100%; min-height: 46px; padding: .65rem .85rem; border-radius: var(--r-sm);
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: 400 1rem var(--font-body); transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31, 42, 68, .12); }
.input[readonly] { background: var(--bg); color: var(--muted); }
.grid-2 { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid-2 { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
.grid-3 { display: grid; gap: .9rem; grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.check { display: inline-flex; gap: .55rem; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }

/* Segmented choice (order type, ASAP/later, payment) */
.segmented { display: flex; flex-wrap: wrap; gap: .5rem; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; font-size: .93rem; }
.segmented label:hover { border-color: var(--ink); }
.segmented input:checked + label { border-color: var(--ink); background: var(--ink); color: #fff; }
.segmented input:focus-visible + label { outline: 3px solid var(--mustard); outline-offset: 2px; }
.pay-options { display: grid; gap: .6rem; }
@media (min-width: 620px) { .pay-options { grid-template-columns: 1fr 1fr; } }
.pay-options input { position: absolute; opacity: 0; }
.pay-options label { display: flex; gap: .8rem; align-items: center; padding: 1rem; border-radius: var(--r-md); border: 1.5px solid var(--line); background: #fff; cursor: pointer; }
.pay-options label strong { display: block; }
.pay-options label span.small { color: var(--muted); }
.pay-options .pay-ico { font-size: 1.5rem; }
.pay-options input:checked + label { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); background: #FFFAFA; }
.pay-options input:focus-visible + label { outline: 3px solid var(--mustard); }

/* ── Panels ──────────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel-pad { padding: 1.25rem; }
@media (min-width: 720px) { .panel-pad { padding: 1.5rem; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1.1rem; }
.stack > * + * { margin-top: 1rem; }

/* Page title band */
.page-head { padding: 2rem 0 1.25rem; }
.page-head h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: .3rem; }
.page-head p { color: var(--muted); margin: 0; max-width: 60ch; }
.crumbs { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0 0 .6rem; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: .35rem; opacity: .5; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* ── Status badges / tags ────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--bg); color: var(--ink); white-space: nowrap; }
.badge.open, .badge.done { background: var(--green-soft); color: var(--green); }
.badge.open::before, .badge.done::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.closed, .badge.cancelled { background: #EEECEA; color: var(--muted); }
.badge.pending { background: var(--mustard-soft); color: #8A5A00; }
.badge.scheduled { background: #E7ECF7; color: var(--navy); }
.badge.loyalty { background: var(--mustard-soft); color: #7A5200; }
.badge.paid { background: #ECEBFF; color: #4B3FD1; }
.badge.red { background: var(--red-soft); color: var(--red); }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { padding: .18rem .6rem; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: .8rem; font-weight: 600; text-decoration: none; }
a.tag:hover { color: var(--ink); background: #E6E8EC; }

/* ── Empty states ────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 3rem 1.25rem; max-width: 520px; margin: 0 auto; }
.empty .empty-art { font-size: 2.6rem; margin-bottom: .5rem; }
.empty h2, .empty h1 { font-size: 1.5rem; }
.empty p { color: var(--muted); }

/* ── Home ────────────────────────────────────────────────────────────── */
.hero { padding: 2.5rem 0 2rem; }
@media (min-width: 900px) { .hero { padding: 4rem 0 3rem; } }
.hero-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.35fr 1fr; gap: 3.5rem; } }
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 4.6rem); line-height: 1; max-width: 12ch; margin-bottom: 1rem; }
.hero h1 .squiggle { background: linear-gradient(transparent 72%, var(--mustard) 72%, var(--mustard) 90%, transparent 90%); }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.town-search { position: relative; max-width: 560px; margin: 1.5rem 0 1rem; }
.town-search .input { min-height: 56px; padding-left: 3rem; border-radius: 999px; font-size: 1.05rem; border-color: #D8D4CF; box-shadow: var(--shadow-1); }
.town-search svg { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); color: var(--red); }
.towns { display: flex; flex-wrap: wrap; gap: .55rem; max-width: 640px; }
.town {
  display: inline-flex; align-items: baseline; gap: .5rem; padding: .7rem 1.05rem; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700;
  transition: border-color .15s, background .15s;
}
.town:hover { border-color: var(--red); color: var(--ink); background: #FFFAFA; }
.town .n { font-size: .8rem; font-weight: 600; color: var(--muted); }
.town[hidden] { display: none; }

/* Ticket — the signature element */
.ticket {
  position: relative; background: var(--paper); border-radius: var(--r-md) var(--r-md) 0 0;
  padding: 1.4rem 1.4rem 1.8rem; box-shadow: var(--shadow-1);
  --tooth: 10px;
  -webkit-mask: radial-gradient(var(--tooth) at 50% calc(100% + var(--tooth) * .35), #0000 98%, #000) 50% / calc(var(--tooth) * 2.2) 100%;
          mask: radial-gradient(var(--tooth) at 50% calc(100% + var(--tooth) * .35), #0000 98%, #000) 50% / calc(var(--tooth) * 2.2) 100%;
}
.ticket-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-bottom: .8rem; border-bottom: 2px dashed var(--line); margin-bottom: .8rem; }
.ticket-head .tno { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; }
.ticket-line { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; font-variant-numeric: tabular-nums; }
.ticket-line .what { min-width: 0; }
.ticket-line .what small { display: block; color: var(--muted); }
.ticket-rule { border: 0; border-top: 2px dashed var(--line); margin: .7rem 0; }
.ticket-total { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; padding-top: .3rem; }
.ticket-steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.ticket-steps li { counter-increment: s; display: grid; grid-template-columns: 2.2rem 1fr; gap: .2rem .6rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.ticket-steps li:last-child { border-bottom: 0; }
.ticket-steps li::before { content: counter(s); grid-row: span 2; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); }
.ticket-steps strong { font-size: 1rem; }
.ticket-steps span { color: var(--muted); font-size: .92rem; }

.band { padding: 3rem 0; }
.band-white { background: #fff; border-block: 1px solid var(--line); }
.split { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 3rem; } }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.feature-list li { display: grid; grid-template-columns: 44px 1fr; gap: .9rem; align-items: start; }
.feature-list .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--bg); }
.feature-list strong { display: block; }
.feature-list span { color: var(--muted); font-size: .95rem; }
.partner { background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 2rem; display: grid; gap: 1.25rem; }
@media (min-width: 820px) { .partner { grid-template-columns: 1.4fr auto; align-items: center; padding: 2.5rem 3rem; } }
.partner h2 { color: #fff; }
.partner p { color: rgba(255, 255, 255, .78); margin: 0; max-width: 56ch; }
.partner .btn { --b: #fff; --c: var(--navy); --bd: #fff; }

/* ── Restaurants list ────────────────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.toolbar .search { position: relative; flex: 1 1 260px; max-width: 420px; }
.toolbar .search .input { padding-left: 2.6rem; border-radius: 999px; }
.toolbar .search svg { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.cuisines { display: flex; gap: .45rem; overflow-x: auto; padding: .25rem 0 .8rem; scrollbar-width: thin; margin-bottom: .5rem; }
.cuisine { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem .4rem .45rem; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); color: var(--ink); font-weight: 600; font-size: .88rem; text-decoration: none; }
.cuisine img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: var(--bg); }
.cuisine.no-img { padding-left: .85rem; }
.cuisine:hover { border-color: var(--ink); color: var(--ink); }
.cuisine[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.filter-chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.r-list { display: grid; gap: .75rem; }
.r-card { display: grid; grid-template-columns: 64px 1fr; gap: 1rem; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); position: relative; }
@media (min-width: 760px) { .r-card { grid-template-columns: 76px 1fr auto; padding: 1.15rem 1.25rem; align-items: center; } }
.r-card:hover { border-color: #CFCAC4; }
.r-mono { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: #fff; background: var(--navy); }
@media (min-width: 760px) { .r-mono { width: 76px; height: 76px; font-size: 1.9rem; } }
.r-mono.c1 { background: #C8102E; } .r-mono.c2 { background: #1F2A44; } .r-mono.c3 { background: #1E7A4C; }
.r-mono.c4 { background: #B45309; } .r-mono.c5 { background: #6D28D9; } .r-mono.c6 { background: #0F766E; }
.r-card h3 { margin: 0 0 .25rem; font-size: 1.2rem; }
.r-card h3 a { color: var(--ink); text-decoration: none; }
.r-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-md); }
.r-card h3 a:hover { text-decoration: underline; }
.r-meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; color: var(--muted); font-size: .9rem; margin-bottom: .45rem; }
.r-side { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; position: relative; z-index: 2; }
@media (min-width: 760px) { .r-side { grid-column: auto; flex-direction: column; align-items: flex-end; } }
.r-card .tags, .r-card .fav-btn, .r-card .r-side a, .r-card .r-side button { position: relative; z-index: 2; }
.fav-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.fav-btn:hover { border-color: var(--red); color: var(--red); }
.fav-btn[aria-pressed="true"] { color: var(--red); border-color: #F3C5CD; background: var(--red-soft); }
.fav-btn svg { width: 20px; height: 20px; }
.fav-btn[aria-pressed="true"] svg path { fill: currentColor; }
.r-stats { font-size: .85rem; color: var(--muted); }
.r-promo { margin-top: .5rem; font-size: .9rem; }
.alpha { display: flex; flex-wrap: wrap; gap: .15rem; margin: 0 0 1rem; }
.alpha a, .alpha span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; font-size: .8rem; font-weight: 700; text-decoration: none; }
.alpha a { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.alpha a:hover { border-color: var(--ink); }
.alpha span { color: #C3BEB8; }

/* ── Restaurant menu page ────────────────────────────────────────────── */
.r-hero { background: var(--navy); color: #fff; padding: 2rem 0 2.2rem; position: relative; overflow: hidden; }
.r-hero::after { content: attr(data-initial); position: absolute; right: -2rem; bottom: -6rem; font: 800 22rem/1 var(--font-display); color: rgba(255, 255, 255, .05); pointer-events: none; }
.r-hero .crumbs, .r-hero .crumbs a { color: rgba(255, 255, 255, .65); }
.r-hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: .6rem; max-width: 20ch; }
.r-hero .r-meta { color: rgba(255, 255, 255, .8); font-size: .95rem; }
.r-hero .r-meta a { color: #fff; }
.r-hero .badge.open { background: rgba(142, 227, 180, .18); color: #9BEBBF; }
.r-hero .badge.closed { background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .8); }
.r-hero .tag { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .85); }
.r-hero .tag:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.r-facts { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.fact { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; padding: .55rem .9rem; min-width: 120px; }
.fact span { display: block; font-size: .75rem; color: rgba(255, 255, 255, .65); }
.fact strong { font-size: 1rem; }
.manage-bar { background: var(--mustard-soft); border-bottom: 1px solid #F1DD9E; padding: .6rem 0; font-size: .92rem; }
.manage-bar .container { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.menu-tabs { position: sticky; top: var(--header-h); z-index: 30; background: rgba(241, 242, 244, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.menu-tabs .container { display: flex; gap: .4rem; overflow-x: auto; padding-top: .6rem; padding-bottom: .6rem; scrollbar-width: none; }
.menu-tabs a, .menu-tabs button { flex: 0 0 auto; padding: .45rem .9rem; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; font-family: inherit; }
.menu-tabs a:hover, .menu-tabs button:hover { color: var(--ink); background: #fff; }
.menu-tabs .is-active { background: var(--ink); color: #fff; }
.menu-tabs .is-active:hover { background: var(--ink); color: #fff; }
.menu-tabs .sep { width: 1px; background: var(--line); margin: .2rem .3rem; flex: 0 0 1px; }
.menu-layout { display: grid; gap: 1.75rem; padding-top: 1.5rem; padding-bottom: 3rem; }
@media (min-width: 1020px) { .menu-layout { grid-template-columns: 1fr 340px; align-items: start; } }
.menu-section { margin-bottom: 2.25rem; }
.menu-section > header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .2rem; flex-wrap: wrap; }
.menu-section h2 { margin: 0; }
.menu-section .desc { color: var(--muted); margin: .1rem 0 .9rem; }
.dish-grid { display: grid; gap: .75rem; margin-top: .75rem; }
@media (min-width: 640px) { .dish-grid { grid-template-columns: 1fr 1fr; } }
.dish { display: grid; grid-template-columns: 1fr auto; gap: .9rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem; }
.dish h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.02rem; margin: 0 0 .25rem; letter-spacing: 0; }
.dish p { color: var(--muted); font-size: .9rem; margin: 0 0 .6rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dish-photo { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; background: var(--bg); }
.dish-flags { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .4rem; }
.flag { font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; }
.flag.best { background: var(--mustard-soft); color: #7A5200; }
.flag.try { background: var(--green-soft); color: var(--green); }
.flag.spicy { background: var(--red-soft); color: var(--red); }
.prices { display: flex; flex-wrap: wrap; gap: .4rem; }
.price-btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; padding: .35rem .45rem .35rem .8rem; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font: 600 .9rem var(--font-body); color: var(--ink); }
.price-btn:hover { border-color: var(--red); }
.price-btn .v { color: var(--muted); font-weight: 500; }
.price-btn .plus { width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 1.05rem; line-height: 1; }
.manage-row { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line); grid-column: 1 / -1; }
.side-cart { position: sticky; top: calc(var(--header-h) + 70px); }
.side-cart .ticket { max-height: calc(100vh - var(--header-h) - 120px); overflow: auto; }
@media (max-width: 1019px) { .side-cart { display: none; } }
.floating-cart { display: none; }
@media (max-width: 1019px) {
  .floating-cart { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 55; display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.1rem; border-radius: 999px; background: var(--red); color: #fff; font-weight: 700; text-decoration: none; box-shadow: var(--shadow-2); }
  .floating-cart:hover { color: #fff; background: var(--red-ink); }
  .floating-cart[hidden] { display: none; }
}
@media (min-width: 761px) and (max-width: 1019px) { .floating-cart { bottom: 20px; max-width: 520px; margin: 0 auto; } }

/* ── Modal (native <dialog>) ─────────────────────────────────────────── */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-lg); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-2); color: var(--ink); }
dialog.modal.wide { width: min(760px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(20, 22, 30, .55); }
dialog.modal[open] { animation: modal-in .2s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem .5rem; }
.modal-head h2 { margin: 0; font-size: 1.35rem; }
.modal-body { padding: .5rem 1.4rem 1.2rem; display: grid; gap: 1rem; }
.modal-foot { display: flex; gap: .6rem; justify-content: flex-end; align-items: center; padding: 1rem 1.4rem 1.3rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot .status { margin-right: auto; font-size: .88rem; font-weight: 600; }
.status.ok { color: var(--green); } .status.bad { color: var(--red); }
@media (max-width: 560px) {
  dialog.modal, dialog.modal.wide { width: 100%; max-width: 100%; inset: auto 0 0 0; margin: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }
}
.qty { justify-self: start; display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.qty button { width: 40px; height: 40px; border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.qty button:hover { background: var(--bg); }
.qty input { width: 44px; text-align: center; border: 0; font: 700 1rem var(--font-body); -moz-appearance: textfield; background: transparent; color: var(--ink); }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.tabs-auth { display: flex; gap: .3rem; background: var(--bg); padding: .3rem; border-radius: 999px; margin: 0 1.4rem; }
.tabs-auth button { flex: 1; border: 0; background: none; padding: .55rem; border-radius: 999px; font: 600 .95rem var(--font-body); cursor: pointer; color: var(--muted); }
.tabs-auth button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }

/* ── Cart / checkout ─────────────────────────────────────────────────── */
.two-col { display: grid; gap: 1.5rem; padding-bottom: 3rem; }
@media (min-width: 980px) { .two-col { grid-template-columns: 1fr 380px; align-items: start; } .two-col > aside { position: sticky; top: calc(var(--header-h) + 16px); } }
.cart-group + .cart-group { margin-top: 1rem; }
.cart-line { display: grid; grid-template-columns: 56px 1fr auto; gap: .9rem; align-items: center; padding: .9rem 1.25rem; border-top: 1px solid var(--line); }
.cart-line:first-of-type { border-top: 0; }
.cart-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--bg); display: grid; place-items: center; font-size: 1.4rem; }
.cart-line .name { font-weight: 700; }
.cart-line .sub { font-size: .85rem; color: var(--muted); }
.cart-line .right { display: grid; justify-items: end; gap: .35rem; }
.cart-line .line-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: 600 .82rem var(--font-body); cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--red); }
.notice { padding: .8rem 1rem; border-radius: var(--r-sm); background: var(--mustard-soft); color: #6B4700; font-size: .92rem; }
.notice.red { background: var(--red-soft); color: var(--red-ink); }
.notice.green { background: var(--green-soft); color: var(--green); }
.notice.navy { background: #E7ECF7; color: var(--navy); }
.step { counter-increment: step; }
.steps-form { counter-reset: step; display: grid; gap: 1rem; }
.step > .panel-head h2::before { content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: .6rem; border-radius: 50%; background: var(--ink); color: #fff; font-size: .9rem; vertical-align: 2px; }
.rest-block { border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem; display: grid; gap: .9rem; }
.rest-block + .rest-block { margin-top: .9rem; }
.rest-block h3 { margin: 0; font-size: 1.05rem; }
.later-fields { display: none; gap: .75rem; grid-template-columns: 1fr 1fr; }
.later-fields.is-on { display: grid; }

/* ── Account pages ───────────────────────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
@media (min-width: 760px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem 1.1rem; }
.stat span { display: block; color: var(--muted); font-size: .85rem; }
.stat strong { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.order-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
.order-card + .order-card { margin-top: .75rem; }
.order-card summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; padding: 1rem 1.25rem; align-items: center; }
.order-card summary::-webkit-details-marker { display: none; }
.order-card summary .t { font-weight: 700; font-size: 1.05rem; }
.order-card summary .s { color: var(--muted); font-size: .88rem; }
.order-card summary .amt { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.order-card[open] summary { border-bottom: 1px solid var(--line); }
.order-card .body { padding: 1rem 1.25rem 1.25rem; }
.points-card { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 1.75rem; display: grid; gap: 1.25rem; position: relative; overflow: hidden; }
@media (min-width: 820px) { .points-card { grid-template-columns: 1fr 1fr; align-items: end; padding: 2.25rem; } }
.points-card .big { font: 800 clamp(3rem, 9vw, 5.2rem)/1 var(--font-display); color: var(--mustard); letter-spacing: -.03em; }
.points-card p { color: rgba(255, 255, 255, .72); margin: 0; }
.meter { height: 12px; border-radius: 999px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--mustard); border-radius: inherit; }
.tier-grid { display: grid; gap: .75rem; }
@media (min-width: 760px) { .tier-grid { grid-template-columns: repeat(4, 1fr); } }
.tier { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 1.15rem; }
.tier.is-current { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tier h3 { margin: 0 0 .15rem; }
.tier ul { padding-left: 1.1rem; margin: .6rem 0 0; color: var(--muted); font-size: .92rem; }
.faq details { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq details p { margin: .6rem 0 0; color: var(--muted); max-width: 70ch; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 700; padding: .7rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFAFB; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover td { background: #FBFBFC; }
.pager { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: center; padding: 1rem; }
.pager a, .pager span { min-width: 38px; height: 38px; padding: 0 .7rem; display: inline-grid; place-items: center; border-radius: 999px; font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); }
.pager .is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager .is-off { color: #BBB5AF; }

/* ── Dashboards (vendor/admin) ───────────────────────────────────────── */
.dash-head { background: var(--navy); color: #fff; padding: 1.75rem 0 4.5rem; }
.dash-head h1 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: .25rem; }
.dash-head p { color: rgba(255, 255, 255, .72); margin: 0; }
.dash-head .crumbs, .dash-head .crumbs a { color: rgba(255, 255, 255, .6); }
.dash-body { margin-top: -3rem; padding-bottom: 3rem; }
.kpis { display: grid; gap: .75rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1.25rem; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: #fff; border-radius: var(--r-md); padding: 1.1rem 1.2rem; box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.kpi span { display: block; font-size: .85rem; color: var(--muted); }
.kpi strong { font: 800 1.85rem/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: .82rem; color: var(--muted); }
.kpi.attn strong { color: #A16207; }
.dash-tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dash-tabs a { padding: .5rem 1rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92rem; }
.dash-tabs a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.filters .field { min-width: 150px; }
.filters .input, .filters .select { min-height: 40px; padding: .4rem .7rem; font-size: .92rem; }
.charts { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
@media (min-width: 960px) { .charts { grid-template-columns: 2fr 1fr; } }
.chart-box { position: relative; height: 260px; padding: .5rem 1rem 1rem; }
.queue { display: grid; gap: .75rem; }
@media (min-width: 900px) { .queue { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
.qcard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem 1.1rem; display: grid; gap: .6rem; border-top: 5px solid var(--mustard); }
.qcard.is-done { border-top-color: var(--green); opacity: .85; }
.qcard.is-cancelled { border-top-color: #B9B3AD; opacity: .7; }
.qcard.is-scheduled { border-top-color: var(--navy); }
.qcard-head { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.qcard-head .tno { font: 800 1.15rem var(--font-display); }
.qitems { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--line); }
.qitems li { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: center; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.qitems li.is-done .qname { text-decoration: line-through; color: var(--muted); }
.qitems li.is-cancelled .qname { text-decoration: line-through; color: #B9B3AD; }
.qitems .note { display: block; font-size: .82rem; color: var(--red-ink); }
.qprogress { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.qprogress i { display: block; height: 100%; background: var(--green); }
.toggle { position: relative; width: 44px; height: 26px; flex: 0 0 auto; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #CFCAC4; cursor: pointer; transition: background .15s; }
.toggle span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(18px); }
.toggle input:focus-visible + span { outline: 3px solid var(--mustard); outline-offset: 2px; }
.hours-grid { display: grid; gap: .5rem; }
.hours-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: .5rem; align-items: center; }
.cost-rows { display: grid; gap: .5rem; }
.cost-row { display: grid; grid-template-columns: 1fr 110px 40px; gap: .5rem; }
.bar { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--red); }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer { background: #fff; border-top: 1px solid var(--line); padding: 2.5rem 0 1.5rem; margin-top: 2rem; font-size: .92rem; }
.footer-grid { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.site-footer h4 { font-family: var(--font-body); font-size: .92rem; margin-bottom: .6rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .legal { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .tabbar, .site-footer, .floating-cart, .btn { display: none !important; }
  body { background: #fff; }
}
.r-card label, .r-card .r-promo a { position: relative; z-index: 2; }
[hidden] { display: none !important; }
.segmented input:disabled + label { opacity: .45; cursor: not-allowed; }

@media (max-width: 560px) {
  .site-header .container { gap: .5rem; }
  .brand img { height: 26px; width: auto; }
  .header-actions { gap: .35rem; }
  .town-chip { max-width: 130px; padding: .4rem .65rem; }
  .town-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-actions .btn-signin-label { display: none; }
  .header-actions [data-open-auth] { padding: .4rem .6rem; }
}
.kpi strong, .kpi em { display: block; }
.more-towns { margin-top: 1rem; max-width: 640px; }
.more-towns summary { cursor: pointer; font-weight: 700; color: var(--ink); padding: .4rem 0; }
.more-towns .towns { margin-top: .6rem; max-height: 320px; overflow-y: auto; padding: 2px; }
/* Keep grid columns from growing wider than small screens */
.two-col, .grid-2, .grid-3, .menu-layout, .split, .hero-grid { min-width: 0; }
.two-col > *, .grid-2 > *, .grid-3 > *, .menu-layout > *, .split > *, .hero-grid > *, .stack > *, .field { min-width: 0; }
.two-col { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .two-col { grid-template-columns: minmax(0, 1fr) 380px; } }
select[multiple].select { max-width: 100%; }
@media (max-width: 480px) { .hours-row { grid-template-columns: 1fr 1fr; } .hours-row .check { grid-column: 1 / -1; } }
