/* ---------- Base: fluid type scale so 1rem grows with the screen (phone -> 4K kiosk) ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* --ui-scale comes from Admin > Business settings > Kiosk display size (Small .72 / Medium .86 / Large 1) */
html { font-size: max(10px, calc(clamp(14px, calc(6px + .55vw + .85vh), 26px) * var(--ui-scale, .86))); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; height: 100dvh; overflow: hidden;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, var(--bg), var(--bg2)) fixed;
  /* touch-native: no text selection, no callouts, no double-tap zoom, no pull-to-refresh */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; overscroll-behavior: none;
}
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }

#app { height: 100dvh; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#app > * { animation: screen-in .35s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(1.2rem) scale(.985); } to { opacity: 1; transform: none; } }

/* Scrollable areas: momentum scroll, thin bars, no scroll chaining */
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3.2rem; padding: .7rem 1.3rem; border-radius: 999px;
  font-weight: 700; font-size: 1.05rem; letter-spacing: .01em;
  background: var(--surface2); border: 1px solid var(--border);
  transition: transform .12s ease, filter .15s ease, background .15s;
}
.btn:active { transform: scale(.95); filter: brightness(.92); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; box-shadow: 0 .35rem 1rem color-mix(in srgb, var(--primary) 40%, transparent); }
.btn.ghost { background: transparent; }
.btn.big { min-height: 4.2rem; font-size: 1.3rem; padding: 1rem 2rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 3.2rem; height: 3.2rem; min-height: 0; padding: 0; font-size: 1.4rem; }

/* ---------- Welcome ---------- */
.welcome { position: relative; flex: 1; display: grid; place-items: center; overflow: hidden; padding: 1.5rem; }
.welcome .tools { position: absolute; top: max(1rem, env(safe-area-inset-top)); right: 1rem; z-index: 2; }
.hero { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; max-width: 60rem; width: 100%; }
.hero-emoji { font-size: clamp(4rem, 12vmin, 9rem); animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 .6rem .8rem rgba(0,0,0,.3)); }
.hero-logo { height: clamp(5rem, 16vmin, 11rem); max-width: 60vw; object-fit: contain; animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 .6rem .8rem rgba(0,0,0,.3)); }
.hero h1 { font-size: clamp(2.2rem, 7vmin, 5rem); line-height: 1.05; font-weight: 900; letter-spacing: -.02em; }
.hero .tagline { color: var(--muted); font-size: 1.3rem; }
.cta-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.2rem; width: 100%; margin-top: 1rem; }
.cta {
  display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 2rem 1rem;
  border-radius: 2rem; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .15s, background .15s;
}
.cta:first-child { background: var(--primary); color: var(--on-primary); }
.cta:active { transform: scale(.96); }
.cta-ico { font-size: clamp(2.5rem, 7vmin, 4.5rem); }
.cta b { font-size: 1.8rem; }
.cta small { font-size: 1rem; opacity: .75; }
.hint { color: var(--muted); font-size: 1.1rem; }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes bob { 50% { transform: translateY(-.8rem) rotate(-2deg); } }
.floaters span { position: absolute; font-size: clamp(2rem, 6vmin, 4rem); opacity: .16; left: calc(var(--i) * 18% + 2%); bottom: -4rem; animation: rise calc(14s + var(--i) * 3s) linear infinite; animation-delay: calc(var(--i) * -3s); }
@keyframes rise { to { transform: translateY(-115dvh) rotate(40deg); } }

/* ---------- Attract screen ("Touch to start") ---------- */
.attract { position: relative; flex: 1; display: grid; place-items: center; overflow: hidden; padding: 2rem; text-align: center; cursor: pointer; outline: none; }
.attract-body { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: clamp(.8rem, 2.4vmin, 1.8rem); width: 100%; max-width: 70rem; }
/* slow drifting colour glow behind everything, built from the theme colours */
.aurora { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.aurora i { position: absolute; width: 75vmax; height: 75vmax; border-radius: 50%; filter: blur(9vmax); opacity: .42;
  background: radial-gradient(circle, var(--primary), transparent 65%); left: -25vmax; top: -20vmax; animation: drift 20s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: radial-gradient(circle, var(--accent), transparent 65%); left: auto; right: -30vmax; top: 25%; animation-duration: 26s; animation-delay: -7s; }
.aurora i:nth-child(3) { background: radial-gradient(circle, color-mix(in srgb, var(--primary) 50%, var(--accent)), transparent 65%); left: 10%; top: auto; bottom: -35vmax; animation-duration: 32s; animation-delay: -12s; }
@keyframes drift { from { transform: translate(-8%, -6%) scale(1); } to { transform: translate(14%, 10%) scale(1.3); } }
.attract .floaters { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

.logo-wrap { position: relative; display: grid; place-items: center; width: clamp(9rem, 30vmin, 20rem); height: clamp(9rem, 30vmin, 20rem); }
.logo-wrap .hero-emoji { font-size: clamp(5rem, 20vmin, 13rem); position: relative; z-index: 1; }
.logo-wrap .hero-logo { height: 100%; width: auto; max-width: 100%; position: relative; z-index: 1; }
.ring { position: absolute; inset: 8%; border-radius: 50%; border: .18rem solid color-mix(in srgb, var(--primary) 70%, transparent); opacity: 0;
  animation: ripple 3.9s ease-out infinite; animation-delay: calc(var(--r) * 1.3s); }
@keyframes ripple { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }

.brand-name { font-size: clamp(2.6rem, 9vmin, 7rem); line-height: 1.02; font-weight: 900; letter-spacing: -.02em; text-wrap: balance; }
.brand-name span { display: inline-block; opacity: 0; transform: translateY(1.1em) rotate(5deg) scale(.9);
  animation: word-in .9s cubic-bezier(.2, .9, .3, 1.25) forwards; animation-delay: calc(.2s + var(--w) * .14s); }
@keyframes word-in { to { opacity: 1; transform: none; } }
.attract .tagline { color: var(--muted); font-size: clamp(1.1rem, 3vmin, 1.9rem); opacity: 0; animation: fade-up .8s ease forwards; animation-delay: .9s; }
@keyframes fade-up { from { opacity: 0; transform: translateY(.8rem); } to { opacity: 1; transform: none; } }

.showcase { display: flex; align-items: center; gap: 1rem; padding: .7rem 1.8rem .7rem 1.1rem; border-radius: 999px; background: color-mix(in srgb, var(--surface) 85%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(6px); animation: showcase-in .7s cubic-bezier(.2, .9, .3, 1.2) both; }
.showcase.swap { animation: showcase-in .7s cubic-bezier(.2, .9, .3, 1.2) both; }
.showcase .e { font-size: clamp(2.4rem, 6vmin, 4rem); line-height: 1; }
.showcase .t { display: flex; flex-direction: column; text-align: left; }
.showcase .t b { font-size: clamp(1.2rem, 3.2vmin, 2rem); }
.showcase .t small { color: var(--muted); font-size: clamp(1rem, 2.6vmin, 1.5rem); font-weight: 700; }
@keyframes showcase-in { from { opacity: 0; transform: translateY(1.2rem) scale(.92); } to { opacity: 1; transform: none; } }

.touch { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-top: clamp(.6rem, 3vmin, 2.4rem); }
.finger { font-size: clamp(2.6rem, 8vmin, 5rem); line-height: 1; transform-origin: 50% 90%; animation: tap 1.9s ease-in-out infinite; filter: drop-shadow(0 .4rem .5rem rgba(0,0,0,.35)); }
@keyframes tap { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-.7rem) scale(1.06); } 62% { transform: translateY(.5rem) scale(.9); } }
.touch-btn { position: relative; overflow: hidden; display: inline-block; padding: clamp(1rem, 2.6vmin, 1.8rem) clamp(2.2rem, 7vmin, 5rem); border-radius: 999px;
  background: var(--primary); color: var(--on-primary); font-weight: 900; text-transform: uppercase; letter-spacing: .1em; font-size: clamp(1.5rem, 4.6vmin, 3.2rem);
  animation: glow 2.2s ease-out infinite, breathe 3.4s ease-in-out infinite; }
.touch-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.55) 50%, transparent 62%); transform: translateX(-120%); animation: sweep 3.6s ease-in-out infinite; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 60%, transparent); } 100% { box-shadow: 0 0 0 2.4rem transparent; } }
@keyframes breathe { 50% { transform: scale(1.045); } }
@keyframes sweep { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.attract:active .touch-btn { transform: scale(.94); }
.attract:focus-visible .touch-btn { outline: .25rem solid var(--text); outline-offset: .3rem; }
@media (orientation: landscape) { .logo-wrap { width: clamp(7rem, 22vmin, 15rem); height: clamp(7rem, 22vmin, 15rem); } .attract-body { gap: .7rem; } }
/* order-type choice screen shares the glow */
.welcome .hero { position: relative; z-index: 2; }

/* ---------- Menu screen layout ---------- */
.menu-screen {
  flex: 1; min-height: 0; display: grid; gap: .8rem; padding: .8rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "cats" "items" "bar";
  position: relative;
}
.top { grid-area: top; display: flex; align-items: center; gap: .8rem; }
.top .brand { flex: 1; min-width: 0; font-weight: 900; font-size: 1.3rem; display: flex; flex-direction: column; line-height: 1.15; }
.top .brand small { font-weight: 600; font-size: .85rem; color: var(--muted); }
.tools { display: flex; gap: .6rem; }
.brand-logo { height: 1.5rem; width: auto; vertical-align: -.3rem; border-radius: .3rem; }
.cats { grid-area: cats; display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: .5rem; min-height: 3.2rem; padding: .5rem 1.2rem;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 1.05rem;
  transition: background .15s, transform .12s;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.chip .e { font-size: 1.4rem; }

.items { grid-area: items; padding: .2rem .2rem 1rem;
  display: grid; gap: .9rem; align-content: start;
  grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 599px) { .items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; } }
.card {
  position: relative; display: flex; flex-direction: column; gap: .6rem; padding: .9rem; text-align: left;
  border-radius: 1.5rem; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .12s ease; animation: pop .35s ease both;
}
.card:active { transform: scale(.97); }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.card .art {
  display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 1.1rem; overflow: hidden;
  font-size: clamp(3rem, 6vw + 1rem, 5rem);
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 45%, transparent), color-mix(in srgb, var(--primary) 25%, transparent) 70%), var(--surface2);
}
.card .art img { width: 100%; height: 100%; object-fit: cover; }
.card h3 { font-size: 1.15rem; line-height: 1.2; }
.card p { color: var(--muted); font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .info { flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.tags { display: flex; gap: .35rem; flex-wrap: wrap; }
.tag { font-size: .72rem; font-weight: 800; padding: .15rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--text); text-transform: uppercase; letter-spacing: .04em; }
.buy { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.price { font-size: 1.3rem; font-weight: 900; }
.add { display: inline-flex; align-items: center; gap: .4rem; background: var(--primary); color: var(--on-primary); font-weight: 800; padding: .55rem 1rem; border-radius: 999px; min-height: 2.8rem; }
.add i { font-style: normal; font-size: 1.2rem; }
.card.soldout { opacity: .5; filter: grayscale(.8); pointer-events: none; }
.badge { position: absolute; top: 1.2rem; left: 1.2rem; background: var(--danger); color: #fff; font-weight: 800; font-size: .8rem; padding: .25rem .7rem; border-radius: 999px; }

/* ---------- Cart: sidebar on wide screens, bottom sheet on narrow ---------- */
.cart { grid-area: cart; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 1.6rem; box-shadow: var(--shadow); overflow: hidden; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem .6rem; }
.cart-head h2 { font-size: 1.3rem; }
.cart-lines { flex: 1; padding: 0 1rem; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; font-size: 1.05rem; }
.empty .big { font-size: 3.5rem; display: block; margin-bottom: .5rem; }
.line { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .8rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--border); animation: pop .25s ease both; }
.line .e { font-size: 1.8rem; grid-row: span 2; }
.line .n { font-weight: 800; }
.line .o { grid-column: 2; color: var(--muted); font-size: .85rem; }
.line .p { font-weight: 800; text-align: right; }
.line .qty { grid-column: 3; grid-row: 2; justify-self: end; }
.qty { display: inline-flex; align-items: center; gap: .3rem; background: var(--surface2); border-radius: 999px; padding: .2rem; }
.qty button { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--surface); font-size: 1.3rem; font-weight: 800; border: 1px solid var(--border); }
.qty button:active { transform: scale(.88); }
.qty span { min-width: 1.6rem; text-align: center; font-weight: 800; font-size: 1.1rem; }
.totals { padding: .9rem 1.1rem 1.1rem; border-top: 1px solid var(--border); display: grid; gap: .5rem; background: var(--surface2); }
.totals .row { display: flex; justify-content: space-between; color: var(--muted); font-size: .95rem; }
.totals .row.total { color: var(--text); font-size: 1.45rem; font-weight: 900; }
.totals .row.combo { color: var(--primary); font-weight: 800; }
.combo-hint { margin: .6rem 1rem 1rem; padding: .7rem .9rem; border-radius: var(--radius, 14px); background: var(--surface2); border: 2px dashed var(--primary); font-weight: 700; font-size: .95rem; }
.combo-hint p + p { margin-top: .4rem; }
.card.deal .art { font-size: 3rem; }
.deal-parts { color: var(--text); font-weight: 700; }

.cart-bar { grid-area: bar; display: none; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; padding: .8rem 1.4rem; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: 1.15rem; box-shadow: var(--shadow); }
.cart-bar[disabled] { opacity: .5; }
.scrim { display: none; }

@media (min-width: 760px) {
  .menu-screen { grid-template-columns: minmax(0, 1fr) clamp(19rem, 30vw, 32rem); grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "top top" "cats cart" "items cart"; }
  .cart { grid-row: 2 / 4; }
  .cart .close { display: none; }
}
@media (max-width: 759px) {
  .cart-bar { display: flex; }
  .cart { position: fixed; left: .6rem; right: .6rem; bottom: .6rem; max-height: 85dvh; z-index: 30; transform: translateY(115%); transition: transform .3s cubic-bezier(.2,.9,.3,1); }
  .menu-screen.cart-open .cart { transform: none; }
  .menu-screen.cart-open .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 25; }
}
/* ---------- Portrait (kiosk stands, phones, tablets held upright) ----------
   Width alone can't tell a portrait 1080x1920 kiosk from a desktop window, so this is keyed on orientation:
   one column of big dishes, the order lives in a bottom bar + slide-up sheet. */
@media (orientation: portrait) {
  .menu-screen { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "top" "cats" "items" "bar"; padding: 1rem; gap: 1rem; }
  .cart-bar { display: flex; min-height: 5rem; font-size: 1.35rem; padding: 1rem 1.8rem; }
  .cart { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; max-height: 82dvh; z-index: 30; transform: translateY(115%); transition: transform .3s cubic-bezier(.2, .9, .3, 1); grid-row: auto; }
  .cart .close { display: inline-flex; }
  .cart { visibility: hidden; transition: transform .3s cubic-bezier(.2, .9, .3, 1), visibility 0s .3s; }
  .menu-screen.cart-open .cart { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .9, .3, 1), visibility 0s; }
  .menu-screen.cart-open .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 25; }
  .top .brand { font-size: 1.6rem; }
  .cats { gap: .8rem; padding: .2rem 0 .6rem; }
  .chip { min-height: 3.8rem; padding: .6rem 1.5rem; font-size: 1.2rem; }
  .items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; padding: .2rem .2rem 1.4rem; }
  .card { padding: 1.1rem; gap: .8rem; border-radius: 1.8rem; }
  .card .art { aspect-ratio: 4 / 3; font-size: clamp(4rem, 12vw, 7rem); }
  .card h3 { font-size: 1.35rem; }
  .card p { font-size: 1rem; -webkit-line-clamp: 3; }
  .price { font-size: 1.5rem; }
  .add { min-height: 3.2rem; padding: .6rem 1.2rem; }
  /* eat-in / take-away choice: big stacked buttons */
  .cta-row { grid-template-columns: 1fr; gap: 1.4rem; }
  .cta { flex-direction: row; justify-content: flex-start; text-align: left; gap: 1.6rem; padding: 2.4rem 2.6rem; }
  .cta > * { flex: none; }
  .cta b { font-size: 2.2rem; }
  .cta small { font-size: 1.15rem; }
  /* review / payment / result panels use the full width */
  .panel { max-width: min(46rem, 94vw); }
}
@media (orientation: portrait) and (min-width: 1000px) { .items { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (orientation: portrait) and (max-width: 520px) { .items { gap: .7rem; } .card { padding: .8rem; } .card .art { font-size: 3.4rem; } }

/* Landscape phones: keep it compact */
@media (max-height: 480px) { .card .art { aspect-ratio: 16 / 7; font-size: 2.4rem; } }

/* ---------- Checkout / status screens ---------- */
.center-screen { flex: 1; min-height: 0; display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
.panel { width: min(100%, 64rem); background: var(--surface); border: 1px solid var(--border); border-radius: 2rem; box-shadow: var(--shadow); padding: clamp(1rem, 3vw, 2rem); display: grid; gap: 1.4rem; }
.panel.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.panel h2 { font-size: 1.6rem; }
.summary { display: grid; gap: .3rem; }
.sum-line { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--border); }
.sum-line small { display: block; color: var(--muted); }
.field { display: grid; gap: .4rem; }
.field label { font-weight: 700; color: var(--muted); }
.field input { min-height: 3.4rem; padding: .6rem 1.1rem; font: inherit; font-size: 1.15rem; border-radius: 1rem; border: 2px solid var(--border); background: var(--surface2); color: var(--text); outline: none; }
.field input:focus { border-color: var(--primary); }
.pay-grid { display: grid; gap: 1rem; align-content: start; }
.pay { display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.4rem; border-radius: 1.5rem; text-align: left; background: var(--surface2); border: 2px solid var(--border); transition: transform .12s, border-color .15s; }
.pay:active { transform: scale(.97); border-color: var(--primary); }
.pay .i { font-size: 2.6rem; }
.pay b { display: block; font-size: 1.3rem; }
.pay small { color: var(--muted); }
.pay.main { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.pay.main small { color: inherit; opacity: .8; }

.status { text-align: center; display: grid; gap: 1rem; justify-items: center; }
.status h2 { font-size: clamp(1.6rem, 4vmin, 2.6rem); }
.status p { color: var(--muted); font-size: 1.15rem; max-width: 34rem; }
.spinner { width: 6rem; height: 6rem; border-radius: 50%; border: .5rem solid var(--border); border-top-color: var(--primary); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tap { font-size: 4.5rem; animation: bob 1.6s ease-in-out infinite; }
.check { width: 6rem; height: 6rem; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #06210f; font-size: 3.4rem; font-weight: 900; animation: pop .5s cubic-bezier(.2,1.6,.4,1) both; }
.check.bad { background: var(--danger); color: #fff; }
.order-no { font-size: clamp(4rem, 14vmin, 9rem); font-weight: 900; line-height: 1; color: var(--primary); letter-spacing: -.02em; }
.order-no-label { text-transform: uppercase; letter-spacing: .2em; color: var(--muted); font-weight: 800; }
.row-btns { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.receipt-ask { width: min(100%, 34rem); display: grid; gap: .9rem; justify-items: center; padding: 1.3rem; border-radius: 1.6rem; background: var(--surface2); border: 1px solid var(--border); }
.receipt-ask h3 { font-size: 1.4rem; }
.receipt-ask p { color: var(--text); margin: 0; }
.receipt-ask.done { border-color: var(--ok); }
.spinner.small { width: 2.6rem; height: 2.6rem; border-width: .3rem; }
.paused-title { font-size: clamp(1.4rem, 4.5vmin, 2.8rem); font-weight: 800; }
.eta { color: var(--text) !important; }
.allergen-line { font-size: .78rem; color: var(--accent); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.allergen-box { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .7rem .9rem; margin-bottom: 1rem; border-radius: 1rem; background: color-mix(in srgb, var(--accent) 18%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.alg { padding: .1rem .6rem; border-radius: 999px; background: var(--surface); font-weight: 700; font-size: .9rem; }
.req-box { width: 100%; padding: .7rem 1rem; font: inherit; font-size: 1.05rem; border-radius: 1rem; border: 2px solid var(--border); background: var(--surface2); color: var(--text); resize: none; outline: none; -webkit-user-select: text; user-select: text; }
.req-box:focus { border-color: var(--primary); }
.link-btn { padding: .2rem 0; color: var(--primary); font-weight: 700; font-size: .85rem; text-decoration: underline; }
.countdown { color: var(--muted); }

/* ---------- Modals ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: grid; place-items: center; padding: 1rem; animation: fade .2s ease both; backdrop-filter: blur(4px); }
@keyframes fade { from { opacity: 0; } }
.dialog { width: min(100%, 40rem); max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 2rem; box-shadow: var(--shadow); overflow: hidden; animation: dialog-in .3s cubic-bezier(.2,.9,.3,1) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(2rem) scale(.96); } }
.dialog-head { display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.4rem .6rem; }
.dialog-head .e { font-size: 3rem; }
.dialog-head h2 { flex: 1; font-size: 1.5rem; line-height: 1.15; }
.dialog-body { padding: .4rem 1.4rem 1rem; flex: 1; }
.dialog-foot { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.4rem; border-top: 1px solid var(--border); background: var(--surface2); }
.dialog-foot .btn.primary { flex: 1; }
.group { margin-bottom: 1.2rem; }
.group h4 { margin: 0 0 .5rem; font-size: 1.05rem; display: flex; gap: .6rem; align-items: center; }
.req { font-size: .7rem; font-weight: 800; background: var(--danger); color: #fff; padding: .15rem .55rem; border-radius: 999px; text-transform: uppercase; }
.opt-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 3.4rem; padding: .6rem 1rem; border-radius: 1.1rem; background: var(--surface2); border: 2px solid var(--border); font-weight: 700; text-align: left; transition: border-color .12s, background .12s, transform .1s; }
.opt:active { transform: scale(.96); }
.opt.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 20%, var(--surface2)); }
.opt small { color: var(--muted); font-weight: 700; white-space: nowrap; }
.opt.on::after { content: "✓"; color: var(--primary); font-weight: 900; }

.themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .8rem; padding: .5rem 0 1rem; }
.theme { display: grid; justify-items: center; gap: .5rem; padding: .8rem .4rem; border-radius: 1.2rem; border: 2px solid var(--border); background: var(--surface2); font-weight: 700; }
.theme.on { border-color: var(--primary); }
.theme:active { transform: scale(.95); }
.swatch { width: 3.4rem; height: 3.4rem; border-radius: 50%; border: 3px solid rgba(255,255,255,.7); box-shadow: 0 .2rem .6rem rgba(0,0,0,.3); }

.count-big { font-size: 3rem; font-weight: 900; color: var(--primary); text-align: center; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: max(1.2rem, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: grid; gap: .5rem; width: min(92vw, 30rem); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: .9rem 1.3rem; border-radius: 1.2rem; font-weight: 700; text-align: center; box-shadow: var(--shadow); animation: pop .25s ease both; }
.toast.err { background: var(--danger); color: #fff; }
/* portrait: the order bar / sheet lives at the bottom, so notices go to the top */
@media (orientation: portrait) { #toasts { bottom: auto; top: max(6rem, env(safe-area-inset-top)); } }

.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.08); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
