/* ==========================================================================
   Design system: bright yellow brand, white rounded cards, bold Arabic type.
   ========================================================================== */
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(/fonts/plex-arabic-arabic-400.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url(/fonts/plex-arabic-arabic-500.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url(/fonts/plex-arabic-arabic-700.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url(/fonts/plex-arabic-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url(/fonts/plex-arabic-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url(/fonts/plex-arabic-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

:root {
  --brand: #ffd200;
  --brand-strong: #f2c200;
  --brand-soft: #fff6c7;
  --on-brand: #18181b;           /* text on the brand colour (theme.js flips it to white for dark colours) */
  --on-brand-2: rgba(24, 24, 27, .72);
  --ink: #18181b;
  --ink-2: #3f3f46;
  --muted: #8b8b94;
  --bg: #f4f4f6;
  --surface: #ffffff;
  --line: #ebebef;
  --ready: #0fa958;
  --ready-soft: #e3f8ec;
  --warn: #b45309;
  --warn-soft: #fff4e0;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 22px;
  --shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 4px 16px rgba(24, 24, 27, .06);
  --shadow-up: 0 -6px 24px rgba(24, 24, 27, .08);
  --font: "Plex Arabic", system-ui, -apple-system, "Segoe UI", Roboto, Tahoma, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }

.wrap { max-width: 760px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 14px; }

/* --- App bar ------------------------------------------------------------------ */
.appbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
}
.appbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.appbar-brand h1 { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-logo {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--brand); color: var(--on-brand);
  display: grid; place-items: center; font-weight: 700; overflow: hidden;
}
.appbar-logo img { width: 100%; height: 100%; object-fit: cover; }
.appbar-actions { display: flex; align-items: center; gap: 8px; }

.chip-btn {
  min-height: 38px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: .9rem; font-weight: 500; cursor: pointer;
}

.conn { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.conn.ok .dot { background: var(--ready); box-shadow: 0 0 0 3px var(--ready-soft); }

/* --- Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 10px 20px;
  border: 0; border-radius: 999px;
  background: var(--bg); color: var(--ink);
  font-weight: 700; font-size: 1rem;
  cursor: pointer; touch-action: manipulation;
  transition: transform .08s ease, background .15s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ready { background: var(--ready); color: #fff; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-outline { background: var(--surface); box-shadow: 0 0 0 1.5px var(--line) inset; }
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-xl { min-height: 58px; width: 100%; font-size: 1.1rem; }
.btn-text { background: none; border: 0; color: var(--muted); font-weight: 500; min-height: 44px; cursor: pointer; width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none;
  background: var(--bg); display: grid; place-items: center; cursor: pointer; font-size: 1rem;
}
.btn:focus-visible, .chip-btn:focus-visible, .icon-btn:focus-visible, .tab:focus-visible, .cat-chip:focus-visible, .dish:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--ink); outline-offset: 2px;
}

/* --- Cards + forms -------------------------------------------------------------- */
.card { background: var(--surface); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.card-title { font-size: 1.1rem; margin-bottom: 12px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: .9rem; font-weight: 500; color: var(--ink-2); }
input[type="text"], input[type="password"], input[type="number"], input[type="search"], textarea, select {
  font: inherit; font-size: 1rem;
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); outline: none; }
.form-grid { display: grid; gap: 12px; }
@media (min-width: 560px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.error { color: var(--danger); font-size: .95rem; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 46px; height: 28px; border-radius: 999px; background: #d4d4d8; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: inset-inline-start .15s; }
.switch input:checked + .track { background: var(--ready); }
.switch input:checked + .track::after { inset-inline-start: 21px; }
.switch input:focus-visible + .track { outline: 3px solid var(--ink); outline-offset: 2px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-ready { background: var(--ready); color: #fff; }
.badge-muted { background: var(--bg); color: var(--muted); }

.note { font-size: .92rem; color: var(--muted); }
.note.warn { background: var(--warn-soft); color: var(--warn); padding: 12px 14px; border-radius: var(--r-sm); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty-emoji { font-size: 2.4rem; display: block; margin-bottom: 6px; }

/* --- Sheets / modals --------------------------------------------------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(24, 24, 27, .5);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s ease;
}
.sheet {
  background: var(--surface); width: 100%; max-width: 560px;
  max-height: 92vh; max-height: 92dvh; overflow: auto;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
  display: grid; gap: 14px;
  animation: slide-up .2s ease;
}
.sheet::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--line); justify-self: center; }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { border-radius: var(--r-lg); }
  .sheet::before { display: none; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 1.2rem; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sheet-actions .btn { flex: 1 1 120px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(40px); opacity: .5; } }
.modal-open { overflow: hidden; }

.toast {
  position: fixed; inset-inline: 16px; bottom: calc(84px + env(safe-area-inset-bottom));
  margin: 0 auto; max-width: 440px; z-index: 60;
  background: var(--ink); color: #fff;
  padding: 14px 18px; border-radius: var(--r); text-align: center; font-weight: 500;
  box-shadow: var(--shadow);
}
.customer .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }

/* ==========================================================================
   Customer: menu page
   ========================================================================== */
.menu-hero { position: relative; height: 190px; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%); overflow: hidden; }
.menu-hero-img { width: 100%; height: 100%; object-fit: cover; }
.menu-hero.has-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .3), transparent 60%); }
.menu-hero .chip-btn { position: absolute; top: calc(12px + env(safe-area-inset-top)); inset-inline-end: 12px; z-index: 2; background: rgba(255, 255, 255, .92); border: 0; }
.menu-head {
  position: relative; z-index: 1;
  max-width: 728px; margin: -44px auto 0;
  padding: 16px; margin-inline: max(16px, calc((100% - 728px) / 2));
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow);
  display: flex; gap: 14px; align-items: flex-start;
}
.menu-logo {
  width: 72px; height: 72px; border-radius: 18px; flex: none; overflow: hidden;
  background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-size: 2rem; font-weight: 700;
  box-shadow: 0 0 0 4px var(--surface);
  margin-top: -34px;
}
.menu-logo img { width: 100%; height: 100%; object-fit: cover; }
.menu-head-text { min-width: 0; }
.menu-head h1 { font-size: 1.35rem; }
.menu-head p { color: var(--muted); font-size: .92rem; margin-top: 2px; }
.menu-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.menu-search { padding: 14px 16px 0; max-width: 760px; margin: 0 auto; }
.search-box { position: relative; }
.search-box input { padding-inline-start: 46px; background: var(--surface); border-color: transparent; box-shadow: var(--shadow); border-radius: 999px; }
.search-box input:focus { border-color: var(--ink); }
.search-icon { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.cat-nav { position: sticky; top: 0; z-index: 15; background: var(--bg); padding: 10px 0 8px; padding-top: calc(10px + env(safe-area-inset-top)); }
.cat-nav.stuck { box-shadow: 0 1px 0 var(--line); background: rgba(244, 244, 246, .96); }
.cat-nav-inner {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px; scroll-snap-type: x proximity;
  scroll-padding-inline: 16px; /* snap to the padded edge, not the screen edge */
  scrollbar-width: none; max-width: 760px; margin: 0 auto;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; scroll-snap-align: start;
  min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 0;
  background: var(--surface); color: var(--ink-2); font-weight: 500; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line) inset;
}
.cat-chip.active { background: var(--ink); color: #fff; box-shadow: none; }

.menu-body { max-width: 760px; margin: 0 auto; padding: 4px 16px calc(32px + env(safe-area-inset-bottom)); display: grid; gap: 22px; }
.menu-section { scroll-margin-top: 72px; }
.menu-section h2 { font-size: 1.2rem; margin: 6px 4px 10px; }
.menu-items { display: grid; gap: 10px; }
@media (min-width: 700px) { .menu-items { grid-template-columns: 1fr 1fr; } }

.dish {
  display: flex; gap: 12px; align-items: stretch;
  background: var(--surface); border-radius: var(--r); padding: 12px;
  box-shadow: var(--shadow); cursor: pointer; text-align: start; border: 0; width: 100%;
}
.dish-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dish-name { font-weight: 700; font-size: 1rem; }
.dish-desc { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish-price { margin-top: auto; font-weight: 700; font-size: 1rem; }
.dish-img { width: 104px; height: 104px; border-radius: var(--r-sm); flex: none; object-fit: cover; background: var(--bg); }
.dish-img.placeholder { display: grid; place-items: center; font-size: 2.2rem; background: var(--brand-soft); }
.dish.off { opacity: .55; }
.dish.off .dish-img { filter: grayscale(1); }

.dish-sheet { padding-top: 0; }
.dish-sheet::before { display: none; }
.dish-sheet-media { margin: 0 -18px; }
.dish-sheet-img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.dish-sheet-img.placeholder { display: grid; place-items: center; font-size: 4rem; background: var(--brand-soft); aspect-ratio: 16 / 7; }
.dish-sheet h2 { font-size: 1.35rem; }
.dish-sheet p { color: var(--ink-2); }
.price-tag { display: inline-block; background: var(--brand); color: var(--on-brand); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 1.1rem; }

.menu-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 8px 0 0; }

/* ==========================================================================
   Customer: order / pager page
   ========================================================================== */
.order-hero { background: var(--brand); color: var(--on-brand); border-radius: var(--r-lg); padding: 18px 18px 22px; position: relative; overflow: hidden; }
.order-hero::after { content: ""; position: absolute; inset-inline-end: -46px; top: -46px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255, 255, 255, .28); }
.order-hero .eyebrow { font-weight: 500; color: var(--on-brand-2); position: relative; z-index: 1; }
.order-label { font-size: clamp(2.8rem, 15vw, 4.6rem); font-weight: 700; line-height: 1.05; word-break: break-word; position: relative; z-index: 1; }

.tracker-wrap { position: relative; margin-top: 4px; }
.tracker { display: grid; grid-template-columns: repeat(3, 1fr); position: relative; margin: 4px 0 0; padding: 0; list-style: none; }
.tracker::before { content: ""; position: absolute; top: 22px; inset-inline: 16.6%; height: 4px; border-radius: 2px; background: var(--line); }
.tracker-fill { z-index: 1; position: absolute; top: 22px; inset-inline-start: 16.6%; height: 4px; border-radius: 2px; background: var(--ink); width: 0; transition: width .4s ease; }
[data-status="ready"] .tracker-fill { width: 33.4%; background: var(--ready); }
[data-status="collected"] .tracker-fill { width: 66.8%; background: var(--ink); }
.tracker li { z-index: 2; display: grid; justify-items: center; gap: 6px; position: relative; text-align: center; font-size: .88rem; color: var(--muted); font-weight: 500; }
.t-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.35rem;
  background: var(--bg); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line);
}
.t-icon span { filter: grayscale(1); opacity: .5; }
.tracker li.done .t-icon span, .tracker li.current .t-icon span { filter: none; opacity: 1; }
.tracker li.current { color: var(--ink); font-weight: 700; }
.tracker li.current .t-icon { background: var(--brand); box-shadow: 0 0 0 1px var(--brand-strong); }
[data-status="ready"] .tracker li.current .t-icon { background: var(--ready-soft); box-shadow: 0 0 0 2px var(--ready); }
[data-status="preparing"] .tracker li.current .t-icon { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 1px var(--brand-strong), 0 0 0 10px transparent; } }
.status-hint { margin: 14px 0 18px; color: var(--ink-2); text-align: center; }

.link-card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.link-card-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); display: grid; place-items: center; font-size: 1.5rem; flex: none; }
.link-card-text { flex: 1; }
.link-card-text strong { display: block; }
.link-card-text span { color: var(--muted); font-size: .9rem; }
.chev { color: var(--muted); font-size: 1.6rem; line-height: 1; }
[dir="rtl"] .chev { transform: scaleX(-1); }

.btn-primary.is-on { background: var(--ready-soft); color: var(--ready); opacity: 1; }

/* Rating */
.rating-card { text-align: center; display: grid; gap: 14px; }
.rating-card h2 { font-size: 1.25rem; }
.stars { display: flex; justify-content: center; gap: 4px; }
.star {
  width: 54px; height: 54px; border: 0; background: none; cursor: pointer; padding: 0;
  display: grid; place-items: center; transition: transform .1s ease;
}
.star svg { width: 44px; height: 44px; fill: #e4e4e7; transition: fill .1s ease; }
.star.on svg { fill: var(--brand-strong); }
.star:active { transform: scale(.86); }
.star-caption { font-weight: 700; min-height: 1.5em; }
.tag-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tag { min-height: 40px; padding: 6px 14px; border-radius: 999px; cursor: pointer; border: 0; box-shadow: 0 0 0 1.5px var(--line) inset; background: var(--surface); font-weight: 500; }
.tag.on { background: var(--ink); box-shadow: none; color: #fff; }
.thanks-emoji { font-size: 3rem; }

/* Full-screen ready alert */
.ready-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: var(--ready); color: #fff; text-align: center; animation: flash 1s steps(2, jump-none) infinite; }
@keyframes flash { 0% { background: var(--ready); } 100% { background: #0a7f42; } }
.ready-inner { max-width: 480px; display: grid; gap: 12px; justify-items: center; }
.ready-inner h1 { font-size: clamp(2rem, 9vw, 3rem); }
.ready-icon { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; font-size: 3.6rem; background: rgba(255, 255, 255, .2); animation: bounce 1s ease-in-out infinite; }
@keyframes bounce { 50% { transform: scale(1.08); } }
.ready-label { font-size: clamp(3rem, 18vw, 6rem); font-weight: 700; line-height: 1; word-break: break-word; }
.btn-light { background: #fff; color: var(--ready); }
.is-ready { overflow: hidden; }

/* "Enable alerts" prompt */
.enable-overlay { position: fixed; inset: 0; z-index: 45; display: flex; align-items: flex-end; justify-content: center; background: rgba(24, 24, 27, .55); }
.enable-card { background: var(--surface); width: 100%; max-width: 520px; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 26px 20px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 12px; text-align: center; justify-items: center; animation: slide-up .25s ease; }
@media (min-width: 700px) { .enable-overlay { align-items: center; } .enable-card { border-radius: var(--r-lg); } }
.enable-card h1 { font-size: 1.35rem; }
.enable-card p { color: var(--muted); margin-bottom: 6px; }
.enable-icon { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem; background: var(--brand); animation: bounce 1.2s ease-in-out infinite; }

/* iPhone "Add to Home Screen" guide */
.ios-install { position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; justify-content: flex-end; background: rgba(24, 24, 27, .55); }
.ios-install.arrow-top { justify-content: flex-start; }
.ios-sheet { background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 22px 18px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; }
.ios-install.arrow-top .ios-sheet { border-radius: 0 0 var(--r-lg) var(--r-lg); padding-top: calc(22px + env(safe-area-inset-top)); order: 2; }
.ios-app { display: flex; align-items: center; gap: 14px; }
.ios-app img { border-radius: 14px; flex: none; }
.ios-app h1 { font-size: 1.2rem; margin-bottom: 2px; }
.ios-app p { color: var(--muted); font-size: .92rem; }
.ios-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ios-steps li { display: flex; align-items: center; gap: 12px; background: var(--bg); border-radius: var(--r); padding: 12px 14px; }
.step-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-weight: 700; }
.step-text { flex: 1; }
.step-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; }
.step-icon svg { width: 30px; height: 30px; fill: none; stroke: #0a84ff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.step-icon img { border-radius: 7px; }
.ios-arrow { text-align: center; font-size: 2.6rem; color: #fff; line-height: 1; padding: 4px 0 calc(4px + env(safe-area-inset-bottom)); animation: nudge 1s ease-in-out infinite; }
.ios-install.arrow-top .ios-arrow { order: 1; padding: calc(4px + env(safe-area-inset-top)) 0 4px; animation-name: nudge-up; }
@keyframes nudge { 50% { transform: translateY(8px); } }
@keyframes nudge-up { 50% { transform: translateY(-8px); } }

/* ==========================================================================
   Staff dashboard
   ========================================================================== */
.staff .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.login-card { max-width: 420px; margin: 8vh auto 0; text-align: center; display: grid; gap: 16px; }
.login-logo { width: 72px; height: 72px; border-radius: 20px; display: block; margin: 0 auto; }
.login-card input { text-align: center; font-size: 1.4rem; letter-spacing: .3em; }

.tabbar {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); box-shadow: var(--shadow-up);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { display: grid; justify-items: center; gap: 2px; padding: 10px 4px 8px; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: .8rem; font-weight: 500; position: relative; }
.tab-icon { font-size: 1.35rem; line-height: 1.2; filter: grayscale(1); opacity: .6; }
.tab.active { color: var(--ink); font-weight: 700; }
.tab.active .tab-icon { filter: none; opacity: 1; }
.tab.active::before { content: ""; position: absolute; top: 0; width: 36px; height: 4px; border-radius: 0 0 4px 4px; background: var(--brand-strong); }
.tab-count { position: absolute; top: 4px; inset-inline-start: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }
@media (min-width: 900px) {
  .tabbar { position: sticky; top: 59px; bottom: auto; box-shadow: 0 1px 0 var(--line); grid-template-columns: repeat(4, max-content); justify-content: center; gap: 8px; padding: 0 16px; z-index: 19; }
  .tab { grid-auto-flow: column; gap: 8px; padding: 14px 18px; font-size: .95rem; }
  .tab.active::before { top: auto; bottom: 0; width: 100%; border-radius: 4px 4px 0 0; }
  .tab-count { position: static; }
  .staff .wrap { padding-bottom: 32px; }
  .toast { bottom: 24px; }
}

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.35rem; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.6rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.ready b { color: var(--ready); }
.stat.prep b { color: var(--warn); }

.create-form { display: flex; gap: 10px; }
.create-form input { flex: 1; min-width: 0; border-radius: 999px; padding-inline: 18px; }
.create-form .btn { flex: none; }

.orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 700px) { .orders { grid-template-columns: 1fr 1fr; } }
.order { background: var(--surface); border-radius: var(--r-lg); padding: 14px 16px; padding-inline-start: 20px; display: grid; gap: 10px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.order::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: var(--brand-strong); }
.order[data-status="ready"]::before { background: var(--ready); }
.order[data-status="collected"] { opacity: .7; }
.order[data-status="collected"]::before { background: var(--line); }
.order-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order-num { font-size: 1.7rem; font-weight: 700; line-height: 1.1; word-break: break-word; }
.order-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .85rem; }
.order-meta .on { color: var(--ready); font-weight: 700; }
.order { align-content: start; }
.order-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.order-actions .icon-btn { width: 40px; height: 40px; font-weight: 700; font-size: .85rem; }
.order-actions .icon-btn.danger { background: var(--danger-soft); color: var(--danger); }
.order-actions .btn-ready { flex: 1 1 100%; min-height: 48px; font-size: 1rem; }
.order-actions [data-action="collected"] { flex: 1 1 auto; }

/* QR sheet + print */
.qr { background: #fff; border-radius: var(--r); padding: 10px; aspect-ratio: 1; width: 100%; max-width: 360px; margin: 0 auto; box-shadow: 0 0 0 1px var(--line); }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-label { font-size: 2.2rem; text-align: center; }
.qr-url { font-size: .8rem; color: var(--muted); word-break: break-all; text-align: center; direction: ltr; }
.print-only { display: none; }

/* Menu manager */
.cat-block { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.cat-block-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
[dir="rtl"] .cat-block-head { padding: 12px 16px 12px 12px; }
.cat-block-head h3 { flex: 1; font-size: 1.1rem; min-width: 0; }
.cat-block-head h3 small { color: var(--muted); font-weight: 500; font-size: .85rem; margin-inline-start: 6px; }
.cat-items { list-style: none; margin: 0; padding: 0; }
.mi { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.mi-img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: var(--brand-soft); display: grid; place-items: center; font-size: 1.4rem; overflow: hidden; }
.mi-img img { width: 100%; height: 100%; object-fit: cover; }
.mi-text { flex: 1; min-width: 0; cursor: pointer; background: none; border: 0; text-align: start; padding: 0; }
.mi-text strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-text span { color: var(--muted); font-size: .9rem; }
.mi.off .mi-text strong { text-decoration: line-through; color: var(--muted); }
.mi .switch .track { width: 40px; height: 24px; }
.mi .switch .track::after { width: 18px; height: 18px; }
.mi .switch input:checked + .track::after { inset-inline-start: 19px; }
.cat-add { padding: 10px 16px 14px; }
.cat-empty { padding: 14px 16px 4px; color: var(--muted); font-size: .92rem; }
.icon-btn.sm { width: 34px; height: 34px; font-size: .85rem; }

.photo-pick { display: flex; align-items: center; gap: 12px; }
.photo-preview { width: 96px; height: 96px; border-radius: var(--r-sm); background: var(--brand-soft); display: grid; place-items: center; font-size: 2rem; flex: none; overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-btns { display: grid; gap: 8px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Ratings */
.rating-summary { display: grid; gap: 16px; }
@media (min-width: 640px) { .rating-summary { grid-template-columns: 200px 1fr; align-items: center; } }
.avg-box { text-align: center; }
.avg-num { font-size: 3.4rem; font-weight: 700; line-height: 1; }
.avg-stars { color: var(--brand-strong); font-size: 1.4rem; letter-spacing: 2px; direction: ltr; }
.dist { display: grid; gap: 6px; }
.dist-row { display: grid; grid-template-columns: 34px 1fr 36px; align-items: center; gap: 8px; font-size: .9rem; direction: ltr; }
.dist-bar { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; }
.dist-bar i { display: block; height: 100%; background: var(--brand-strong); border-radius: 5px; }
.tag-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-stat { padding: 6px 12px; border-radius: 999px; background: var(--bg); font-size: .9rem; }
.tag-stat b { margin-inline-start: 4px; }
.reviews { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.review { background: var(--surface); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); display: grid; gap: 6px; }
.review-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.review-stars { color: var(--brand-strong); letter-spacing: 1px; direction: ltr; font-size: 1.1rem; }
.review-date { color: var(--muted); font-size: .8rem; }
.review-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.review-tags span { font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.review p { color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.review p.muted { color: var(--muted); }

/* Settings */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12) inset; }
.swatch.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-row input[type="color"] { width: 52px; height: 44px; padding: 2px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.color-hex { font-family: ui-monospace, monospace; color: var(--muted); direction: ltr; }
.img-setting { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.img-setting .preview { width: 72px; height: 72px; border-radius: 16px; background: var(--brand-soft); flex: none; overflow: hidden; display: grid; place-items: center; font-size: 1.6rem; }
.img-setting .preview.wide { width: 128px; }
.img-setting .preview img { width: 100%; height: 100%; object-fit: cover; }
.img-setting .grow { flex: 1; min-width: 120px; }
.img-setting .btns { display: flex; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body.staff > *:not(#qrSheet) { display: none !important; }
  #qrSheet { position: static; background: none; display: block; padding: 0; }
  #qrSheet .sheet { box-shadow: none; max-width: none; max-height: none; border-radius: 0; animation: none; }
  #qrSheet .sheet::before { display: none; }
  .print-only { display: block; text-align: center; font-size: 1.3rem; font-weight: 700; }
  .no-print { display: none !important; }
  .qr { max-width: 12cm; box-shadow: none; }
  .qr-label { font-size: 3rem; }
}

/* Credit link at the bottom of customer pages */
.powered { display: block; width: fit-content; margin: 8px auto calc(28px + env(safe-area-inset-bottom)); padding: 8px 14px; font-size: .8rem; color: var(--muted); text-decoration: none; border-radius: 999px; }
.powered b { color: inherit; font-weight: 700; }
.powered:hover, .powered:focus-visible { color: var(--ink); text-decoration: underline; }
