:root {
  --bg: #181411;
  --bg-elev: #141416;
  --panel: #18181b;
  --panel-2: #202023;
  --accent: #B98256;
  --accent-bright: #c99465;
  --accent-ink: #ffffff;
  --accent-2: #B98256;
  --accent-pink: #ff007f;
  --accent-pink-text: #ff6fae;
  --accent-pink-soft: rgba(255,0,127,0.14);
  --brand-gradient: linear-gradient(165deg, #74c69d 0%, #40916c 40%, #ff007f 100%);
  --text: #fafafa;
  --text-dim: #a1a1aa;
  --muted: #71717a;
  --border: #27272a;
  --border-soft: #1f1f22;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(0,0,0,0.36);
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: var(--font-ui);
  --header-bg: rgba(9,9,11,0.90);
  --bar-bg: rgba(9,9,11,0.92);
  --bg-glow: #12241c;
  --drawing-color: #806346;
  --glass-bg: rgba(24,20,17,0.66);
  --glass-strong: rgba(24,20,17,0.80);
  --card-blur: 12px;
  font-family: var(--font-ui);
}

* { box-sizing: border-box; }
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
html { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 720px; margin: 0 auto; padding: 28px 18px 100px; }

.brand {
  font-family: var(--font-ui); font-weight: 800; font-size: 1.5rem;
  letter-spacing: -0.03em; display: flex; align-items: center; color: var(--text);
}
.brand span {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.brand small { font-weight: 500; font-size: 0.72rem; color: var(--muted); letter-spacing: 0; margin-left: 4px; text-transform: uppercase; }

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel) 60%, var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; letter-spacing: -0.01em; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head-icon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: rgba(61,139,106,0.14); color: var(--accent-2);
  display: flex; align-items: center; justify-content: center;
}
.card-head h3 { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  box-shadow: 0 4px 14px rgba(45,106,79,0.35);
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:not(.secondary):not(.ghost):not(.danger):hover { background: var(--accent-bright); }
.btn.secondary:hover, .btn.ghost:hover { border-color: var(--accent); color: var(--text); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }
.btn.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text-dim); box-shadow: none; }
.btn.small { padding: 7px 14px; font-size: 0.82rem; }
.btn.danger { background: #d9534f; box-shadow: 0 4px 14px rgba(217,83,79,0.25); }
.btn.block { width: 100%; }

.chip {
  display: inline-flex; align-items: center;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  margin: 4px 8px 4px 0;
  cursor: pointer;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.12s ease;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.selected { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.chip-ask {
  display: inline-flex; align-items: center; justify-content: center;
  width: 37px; height: 37px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  margin: 4px 0 4px 4px;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  vertical-align: middle;
  transition: all 0.12s ease;
}
.chip-ask:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-bright); }

table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); font-size: 0.88rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 16px;
  transition: border-color 0.15s ease;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
}
.stat:hover { border-color: var(--accent); }
.stat-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(61,139,106,0.14); color: var(--accent-2);
}
.stat .num-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat .num { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: 0.78rem; }
.stat.pink .num { color: var(--accent-pink-text); }
.stat.pink .stat-icon { background: var(--accent-pink-soft); color: var(--accent-pink-text); }
.trend { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; line-height: 1; }
.trend.up { background: rgba(61,139,106,0.16); color: var(--accent-2); }
.trend.down { background: rgba(224,82,82,0.14); color: #e05252; }
.trend.flat { background: var(--panel-2); color: var(--muted); }

label { display: block; margin: 14px 0 6px; font-size: 0.84rem; color: var(--muted); font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); font-size: 0.95rem; font-family: inherit;
  transition: border-color 0.12s ease;
  -webkit-appearance: none; appearance: none;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 84px; resize: vertical; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.search-box { position: relative; }
.search-box input[type=search] {
  padding: 16px 46px 16px 50px; border-radius: 999px; font-size: 1.05rem;
  border-width: 1.5px; box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.search-box input[type=search]:focus { box-shadow: 0 2px 14px rgba(0,0,0,0.16), 0 0 0 3px rgba(61,139,106,0.18); }
.search-box .search-box-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; display: flex;
}
.search-box:focus-within .search-box-icon { color: var(--accent); }
.search-box .search-box-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; color: var(--muted); text-decoration: none; transition: all 0.12s ease;
}
.search-box .search-box-clear:hover { background: var(--panel-2); color: var(--text); }
.row { display: flex; gap: 20px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 150px; }
.row > .field-tight { flex: 0 0 auto; min-width: 0; }

.badge { padding: 4px 12px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge.approved { background: rgba(61,139,106,0.16); color: var(--accent-2); }
.badge.pending { background: rgba(224,195,82,0.14); color: #e0c352; }
.badge.rejected { background: rgba(224,82,82,0.14); color: #e05252; }

nav.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: rgba(9,9,11,0.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
form.inline { display: inline; }

/* ============ Admin app nav (shared across restaurant + platform admin) ============ */
.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.mobile-only { display: revert; }
.desktop-only { display: none; }

.app-nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(9,9,11,0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.app-nav-brand-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px 10px; gap: 12px;
}
.app-nav-brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex-wrap: wrap; }
.app-nav-brand .brand { font-size: 1.15rem; }
.app-nav-context { font-size: 0.82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-nav-tabs {
  display: flex; gap: 4px; padding: 0 16px 10px;
  overflow-x: auto; scrollbar-width: none;
}
.app-nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  flex-shrink: 0; display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 8px 14px; border-radius: 12px;
  font-size: 0.84rem; font-weight: 600; color: var(--text-dim);
  white-space: nowrap; transition: background 0.12s ease, color 0.12s ease;
}
.nav-tab:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav-tab span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-tab.active { background: var(--brand-gradient); color: #fff; box-shadow: 0 4px 14px rgba(45,106,79,0.35); }

.app-nav-footer { display: none; }
.nav-premium {
  margin: 8px 12px; padding: 14px; border-radius: 12px;
  background: linear-gradient(160deg, rgba(255,0,127,0.16), rgba(61,139,106,0.08));
  border: 1px solid rgba(255,0,127,0.3);
}
.nav-premium-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.84rem; color: var(--accent-pink-text); }
.nav-premium p { font-size: 0.76rem; color: var(--text-dim); margin: 6px 0 10px; line-height: 1.4; }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 1.5rem; margin: 0 0 4px; letter-spacing: -0.015em; }
.page-head p { margin: 0; color: var(--muted); font-size: 0.88rem; }

.admin-content { padding: 28px 24px 100px; max-width: 1180px; }

.btn.icon-only { padding: 8px 9px; }

/* Below 640px, collapse tab labels to icon-only pills so the scroll strip stays compact and legible. */
@media (max-width: 640px) {
  .nav-tab span { display: none; }
  .nav-tab { padding: 9px 11px; }
}

@media (max-width: 480px) {
  .app-nav-brand-row { padding: 12px 14px 8px; }
  .app-nav-tabs { padding: 0 10px 10px; }
  .admin-content { padding: 20px 14px 90px; }
}

/* Desktop: nav becomes a fixed left sidebar instead of a horizontal top bar. */
@media (min-width: 900px) {
  .mobile-only { display: none; }
  .desktop-only { display: block; }
  .admin-body { display: flex; align-items: flex-start; }
  .app-nav {
    position: sticky;
    top: 0;
    flex: 0 0 240px;
    align-self: flex-start;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-bottom: none; border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .app-nav-brand-row { flex: 0 0 auto; padding: 22px 20px 18px; }
  .app-nav-tabs {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    flex-direction: column; align-items: stretch; padding: 4px 12px;
    overflow-x: visible;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
  .app-nav-tabs::-webkit-scrollbar { width: 5px; }
  .app-nav-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
  .nav-tab { text-align: left; flex-shrink: 0; }
  .nav-premium { flex: 0 0 auto; }
  .app-nav-footer {
    flex: 0 0 auto;
    display: block; padding: 14px 16px; border-top: 1px solid var(--border-soft);
    margin-top: auto;
  }
  .app-nav-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .app-nav-user-name { font-weight: 700; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
  .app-nav-user-role { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
  .app-nav-footer .btn { display: flex; align-items: center; justify-content: center; gap: 6px; }
  .admin-content { flex: 1; min-width: 0; margin: 0 auto; }
}

@media (min-width: 900px) and (max-height: 560px) {
  .admin-body .nav-premium { display: none; }
  .admin-body .app-nav-footer { padding-top: 10px; padding-bottom: 10px; }
  .admin-body .app-nav-brand-row { padding-bottom: 12px; }
}

.auth-shell {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px 18px;
}
.auth-shell .brand { margin-bottom: 22px; font-size: 1.7rem; }
.auth-shell .card { width: 100%; max-width: 380px; margin-bottom: 0; }

/* ============ Guest chat ============ */
.chat-shell { position: relative; max-width: 560px; margin: 0 auto; height: var(--app-height, 100dvh); min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.chat-view { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; max-width: 560px; margin: 0 auto; overflow: hidden; }
.menu-view { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; overflow: hidden; }
.chat-thread-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.chat-view[hidden], .menu-view[hidden] { display: none; }
.chat-composer { position: relative; z-index: 3; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--bg); flex-shrink: 0; }
.composer-mode-label { padding: 0 2px 5px; color: var(--muted); font-size: 0.7rem; line-height: 1.3; }
.composer-mode-label[hidden] { display: none; }

.composer-bar { display: flex; align-items: center; gap: 6px; width: 100%; }
.composer-input { flex: 1; min-width: 0; }
.composer-input .ask-inline-row { min-width: 0; width: 100%; }
.composer-input .ask-inline-input { min-width: 0; }
.composer-tool { flex-shrink: 0; }
#staffBtn { white-space: nowrap; }
.chat-composer .ask-inline-row { margin: 0; }
.chat-composer .ask-inline-input { flex: 1; margin: 0; width: auto; height: 42px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }
.chat-composer .chip-ask { flex-shrink: 0; width: 42px; height: 42px; }
.guest-brand { text-decoration: none; color: inherit; min-width: 0; }
.guest-drawings,
.branding-preview-drawings {
  position: absolute; inset: 0; z-index: 1; overflow: hidden;
  pointer-events: none; color: var(--drawing-color);
}
.art-svg {
  position: absolute; display: block; color: currentColor;
  stroke-width: 1.5;
  opacity: var(--art-opacity);
}
.art-svg :is(path, circle, ellipse, rect, line, polyline, polygon) { vector-effect: non-scaling-stroke; }
.art-svg.art-accent { opacity: calc(var(--art-opacity) * 0.82); }
.guest-drawings .art-main { top: 296px; left: -12px; width: 220px; height: 210px; transform: rotate(-2deg); }
.guest-drawings .art-accent { top: 96px; right: -6px; width: 135px; height: 130px; transform: rotate(4deg); }
@media (max-width: 720px) {
  .guest-drawings .art-main { top: 286px; left: -8px; width: 190px; height: 180px; }
  .guest-drawings .art-accent { top: 96px; right: -4px; width: 112px; height: 112px; }
}

.guest-nav {
  display: flex; align-items: center; flex-shrink: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel-2);
}
.guest-nav-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px;
  color: var(--muted); font-size: 0.79rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.guest-nav-link + .guest-nav-link { border-left: 1px solid var(--border); }
.guest-nav-link:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.guest-nav-link.active { color: var(--accent-ink); background: var(--accent); }
.guest-nav-link svg { flex-shrink: 0; }
@media (max-width: 720px) {
  .guest-header { gap: 8px; }
  .guest-nav { order: 3; width: 100%; justify-content: stretch; }
  .guest-nav-link { flex: 1; padding: 8px 10px; font-size: 0.78rem; }
}
.scroll-latest {
  position: absolute; right: 16px; bottom: 12px; z-index: 4;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text);
  box-shadow: var(--shadow); font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.scroll-latest:hover { border-color: var(--accent); color: var(--accent-2); }
.scroll-latest[hidden] { display: none; }
.chat-header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--header-bg); backdrop-filter: blur(10px); z-index: 5;
}
.chat-header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.chat-logo { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.chat-header-brand > div { min-width: 0; }
.chat-header-title {
  font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-header-sub { font-size: 0.72rem; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guest-mealz-wordmark {
  display: inline; color: var(--text); font-family: var(--font-ui);
  font-weight: 800; font-size: 0.82rem; letter-spacing: 0.01em;
}
.guest-mealz-wordmark span {
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
@media (max-width: 720px) {
  .guest-mealz-wordmark { font-size: 0.84rem; }
}
.chat-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.table-pill { color: var(--accent-2); font-weight: 700; }
.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-btn { background: transparent; border: none; color: var(--muted); padding: 7px 13px; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.lang-btn.active { background: var(--accent); color: var(--accent-ink); }

/* Compact MEALZ guest header: logo left, menu right, view switch below. */
.guest-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: nowrap; padding-top: calc(14px + env(safe-area-inset-top));
}
.guest-header .guest-brand {
  flex: 1 1 auto; flex-direction: column; align-items: flex-start;
  gap: 1px; min-width: 0;
}
.guest-header-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.header-order-btn { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text); font-family: var(--font-ui); font-size: 0.73rem; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.header-order-btn[hidden] { display: none; }
.header-order-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.header-order-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.header-order-count { position: absolute; top: -7px; right: -8px; min-width: 16px; height: 16px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 0.6rem; font-weight: 800; line-height: 1; }
.header-order-label { white-space: nowrap; }
@media (max-width: 720px) { .header-order-label { display: none; } .header-order-btn { height: 34px; padding: 0 7px; } }
@media (max-width: 420px) { .header-order-btn { padding: 0 5px; gap: 4px; } }

.guest-ui-lang { flex-shrink: 0; }
.guest-header-actions .guest-ui-lang .lang-btn { padding: 5px 7px; font-size: 0.7rem; }
.guest-view-switch { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.view-mode-label {
  border: 0; background: transparent; padding: 6px 1px; color: var(--muted);
  font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600; line-height: 1;
  white-space: nowrap; cursor: pointer; transition: color 0.12s ease, font-weight 0.12s ease;
}
.view-mode-label:hover { color: var(--text); }
.view-mode-label.is-active { color: var(--text); font-weight: 750; }
.view-mode-label:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }
.guest-account-anchor { position: relative; flex-shrink: 0; }
.guest-account-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--icon-color, var(--text));
  cursor: pointer;
}
.guest-account-toggle:hover { background: var(--panel); border-color: var(--accent); }
.guest-account-toggle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.guest-logo {
  display: inline-flex; align-items: baseline; line-height: 1;
  font-family: var(--font-ui); font-weight: 800;
  font-size: 1.3rem; letter-spacing: -0.035em; color: var(--text);
}
.guest-logo span {
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.guest-brand-meta {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 0.68rem; line-height: 1.3;
}
.guest-brand-restaurant { color: var(--text-dim); font-weight: 700; }
.guest-header .guest-nav {
  grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0;
}
.guest-header .guest-nav-link { flex: 1; }
.guest-menu-anchor { position: relative; grid-column: 2; grid-row: 1; flex-shrink: 0; }
.guest-menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease;
}
.guest-menu-toggle:hover { background: var(--panel); border-color: var(--accent); }
.guest-menu-toggle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.guest-menu-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  width: 260px; max-width: calc(100vw - 24px);
  padding: 14px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel); box-shadow: var(--shadow);
}
.guest-menu-dropdown[hidden] { display: none; }
.guest-menu-name {
  font-size: 1rem; font-weight: 800; line-height: 1.25; color: var(--text);
  overflow-wrap: anywhere;
}
.guest-menu-meta {
  margin-top: 2px; color: var(--muted); font-size: 0.74rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.guest-menu-lang { margin-top: 12px; }
.guest-menu-lang .lang-switch { display: flex; width: 100%; }
.guest-menu-lang .lang-btn { flex: 1; padding: 8px 12px; font-size: 0.8rem; }
.guest-menu-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.guest-menu-actions .btn { width: 100%; }

/* Single AI chat / menu switch in the top-right corner. */
.view-toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 0;
  border: 0; background: transparent; color: var(--text); font-family: var(--font-ui);
  cursor: pointer; white-space: nowrap; line-height: 1;
}
.view-toggle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 999px; }
.view-toggle-track {
  position: relative; display: block; flex: 0 0 44px; width: 44px; height: 26px;
  border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border);
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.view-toggle[aria-checked="true"] .view-toggle-track { background: var(--accent); border-color: var(--accent); }
.view-toggle-thumb {
  position: absolute; z-index: 2; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,0.28);
  transition: transform 0.18s ease, background-color 0.18s ease;
}
.view-toggle[aria-checked="true"] .view-toggle-thumb { transform: translateX(18px); background: var(--accent-ink); }
.view-toggle-label { font-family: var(--font-ui); font-size: 0.88rem; font-weight: 650; color: var(--text); }
@media (max-width: 720px) {
  .guest-header { gap: 6px; }
  .guest-header-actions { gap: 5px; }
  .guest-header-actions .guest-ui-lang .lang-btn { padding: 4px 6px; font-size: 0.66rem; }
  .guest-view-switch { gap: 4px; }
  .view-mode-label { font-size: 0.7rem; padding: 5px 0; }
  .view-toggle-track { flex-basis: 40px; width: 40px; height: 24px; }
  .view-toggle-thumb { width: 16px; height: 16px; }
  .view-toggle[aria-checked="true"] .view-toggle-thumb { transform: translateX(16px); }
  .view-toggle-label { font-size: 0.8rem; }
  .guest-brand-meta { font-size: 0.62rem; }
}
@media (prefers-reduced-motion: reduce) {
  .view-toggle-track, .view-toggle-thumb, .view-toggle-state { transition: none; }
}

.chat-thread { position: relative; flex: 1; min-height: 0; padding: 18px; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 24px; }
.msg-row.step-past { display: none; }
/* Hide the visible scrollbar only on the chat message list; the menu list keeps its own. */
#thread { scrollbar-width: none; -ms-overflow-style: none; }
#thread::-webkit-scrollbar { width: 0; height: 0; display: none; }
#thread:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.msg-row { position: relative; z-index: 2; display: flex; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.msg-row.guest { justify-content: flex-end; }
.msg-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--icon-color, var(--text)); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.msg-avatar-z { font-family: var(--font-ui); font-weight: 800; font-size: 13px; line-height: 1; }
.ai-chef-avatar { display: block; width: 22px; height: 22px; }
.bubble.ai {
  background: var(--glass-bg); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: var(--radius); border-bottom-left-radius: 4px;
  padding: 13px 17px; max-width: 84%;
  box-shadow: var(--shadow); line-height: 1.55; font-size: 0.94rem;
}
.bubble.guest {
  background: color-mix(in srgb, var(--accent) 12%, var(--glass-strong));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  color: var(--text); line-height: 1.5; font-size: 0.94rem;
  border-radius: var(--radius); border-bottom-right-radius: 4px;
  padding: 11px 16px; max-width: 78%; box-shadow: 0 4px 14px rgba(45,106,79,0.25);
}
.typing-dots { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.chip-row { display: flex; flex-wrap: wrap; margin: 4px 0 18px 38px; }
.chat-thread .chat-input { margin: 4px 0 6px 38px; width: calc(100% - 38px); }
.ask-inline-row { display: flex; align-items: center; gap: 8px; margin: 0 0 18px 38px; }
.ask-inline-row .ask-inline-input { flex: 1; margin: 0; width: auto; height: 42px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }
.ask-inline-row .chip-ask { flex-shrink: 0; width: 42px; height: 42px; }

.dish {
  position: relative; z-index: 2;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px; background: var(--glass-bg); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(var(--card-blur)); backdrop-filter: blur(var(--card-blur));
  transition: border-color 0.12s ease;
}
.dish.in-cart { border-color: var(--accent); }
.dish.has-image { display: flex; gap: 14px; align-items: flex-start; }
.dish-img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--panel-2); }
.dish-body { flex: 1; min-width: 0; }
.dish h3 { margin: 0 0 4px; font-size: 1.02rem; letter-spacing: -0.01em; }
.dish-desc { color: var(--muted); font-size: 0.88rem; margin: 4px 0 10px; line-height: 1.45; }
.tag { display: inline-block; font-size: 0.72rem; color: var(--text-dim); background: var(--panel-2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 999px; margin: 0 6px 6px 0; }
.allergen-note { font-size: 0.76rem; color: #e0a352; margin-top: 8px; }
.allergen-note.missing { color: var(--muted); }
.dish-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.menu-add-btn { flex-shrink: 0; white-space: nowrap; }
.menu-list .dish, .menu-list .dish.has-image {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: stretch; gap: 12px; min-width: 0;
  position: relative; z-index: 2;
}
.menu-list .dish { padding: 12px; }
/* The full-card details opener is a sibling of the add/stepper controls, never their parent. */
.dish-open { position: absolute; inset: 0; z-index: 1; margin: 0; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.dish-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-list .dish-img-frame,
.menu-list .dish-body,
.menu-list .dish-list-main,
.menu-list .dish-head,
.menu-list .dish-desc,
.menu-list .dish-tags,
.menu-list .dish-meta,
.menu-list .dish-badges,
.menu-list .dish-footer { pointer-events: none; }
.menu-list .dish-footer { position: relative; z-index: 2; }
.menu-list .menu-add-btn,
.menu-list .menu-card-qty,
.menu-list .menu-qty-btn { pointer-events: auto; position: relative; z-index: 2; }
.menu-list .dish-img-frame {
  position: relative;
  width: 96px; height: 96px; aspect-ratio: 1 / 1; flex-shrink: 0; overflow: hidden;
  border-radius: 12px; background: var(--panel-2); margin: 0;
  align-self: start; display: flex; align-items: center; justify-content: center;
}
.menu-list .dish-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }
.dish-chef-ribbon {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid rgba(233, 196, 106, .32);
  border-radius: 0;
  background: linear-gradient(100deg, rgba(73, 0, 62, .98) 0%, #8e017b 52%, rgba(84, 0, 72, .98) 100%);
  color: #fff7fb;
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .015em;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),
    inset 0 -1px 0 rgba(0, 0, 0, .18),
    0 4px 14px rgba(0, 0, 0, .16);
}
.dish-chef-ribbon::after {
  content: '';
  position: absolute;
  inset: 1px 14px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 247, 251, .35), transparent);
  pointer-events: none;
}
.dish-chef-ribbon > span { display: inline-block; }
.dish-chef-icon { width: 13px; height: 13px; flex: 0 0 13px; stroke: currentColor; }
/* Chef-marked items keep the ribbon in every section, including the featured block. */
body.guest-redesign .dish-kicker { display: none !important; }
@media (max-width: 600px) {
  .dish-chef-ribbon { height: 32px; padding: 0 10px; gap: 6px; font-size: 12px; }
  .dish-chef-icon { width: 12px; height: 12px; flex-basis: 12px; }
}
.menu-list .dish-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  min-height: 2.5em;
}
.menu-list .dish-img-placeholder {
  color: var(--text-dim); font-size: 2.2rem; font-weight: 800;
  background: radial-gradient(circle at 50% 35%, rgba(45,106,79,0.22), var(--panel-2) 65%);
}
.menu-list .dish-img-placeholder span { line-height: 1; }
.menu-list .dish-body {
  display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0;
}
.menu-list .dish h3 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
  flex: 1; min-width: 0; margin: 0; min-height: 2.5em; font-size: 1rem; line-height: 1.25;
  font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em;
}
.menu-list .dish-head .price { flex-shrink: 0; font-size: 0.9rem; padding-top: 1px; }
.menu-list .dish-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere;
  margin: 0 0 2px; min-height: 2.8em; line-height: 1.4;
}
.menu-list .dish-optional {
  position: relative; height: 64px; min-height: 64px; max-height: 64px;
  overflow: hidden; flex-shrink: 0;
}
.menu-list .dish-optional::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 24px;
  background: linear-gradient(180deg, rgba(0,0,0,0), var(--glass-bg));
  pointer-events: none;
}
.compact-dish-body { display: flex; flex-direction: column; gap: 5px; }
.dish-tags {
  display: flex; flex-wrap: wrap; align-content: flex-start; align-items: flex-start;
  gap: 4px 6px;
}
.dish-tags .tag {
  flex: 0 0 auto; margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dish-meta { display: flex; flex-wrap: nowrap; align-items: center; gap: 3px 8px; min-height: 17px; font-size: 0.74rem; color: var(--muted); }
.dish-category { color: var(--text-dim); font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dish-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 22px; }
.allergen-icon, .diet-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text-dim);
}
.allergen-icon svg, .diet-icon svg { width: 14px; height: 14px; }
.diet-icon { color: var(--accent-2); }
.menu-list .dish-footer {
  display: flex; flex-wrap: nowrap; justify-content: flex-start; align-items: center;
  gap: 8px; margin-top: auto; padding-top: 2px; flex-shrink: 0;
}
.menu-list .price { font-size: 0.92rem; white-space: nowrap; }
.price { color: var(--text); font-weight: 700; font-size: 1rem; }
.qty-stepper { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 1rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.12s ease;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.qty-value { min-width: 18px; text-align: center; font-weight: 700; }


/* Guest menu layouts: list uses full-width rows; cards keeps the existing card grid. */
.menu-view.layout-list .menu-grid { display: flex; flex-direction: column; gap: 10px; }
.menu-view.layout-list .menu-grid .dish,
.menu-view.layout-list .menu-grid .dish.has-image {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-areas: "image body"; align-items: center; gap: 12px;
  padding: 12px; margin-bottom: 0;
}
.menu-view.layout-list .menu-grid .dish-img-frame { grid-area: image; width: 84px; height: 84px; border-radius: 12px; }
.menu-view.layout-list .menu-grid .dish-list-main { grid-area: body; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.menu-view.layout-list .menu-grid .dish-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 0; }
.menu-view.layout-list .menu-grid .dish-head h3 {
  margin: 0; min-width: 0; font-family: var(--font-serif); font-weight: 600; font-size: 1rem; line-height: 1.25;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.menu-view.layout-list .menu-grid .dish-head .price { flex-shrink: 0; font-size: 0.9rem; white-space: nowrap; padding-top: 1px; }
.menu-view.layout-list .menu-grid .dish-desc {
  margin: 0; font-size: 0.82rem; line-height: 1.4; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.menu-view.layout-list .menu-grid .dish-tags { gap: 4px; }
.menu-view.layout-list .menu-grid .dish-tags .tag { margin: 0; padding: 2px 8px; font-size: 0.68rem; }
.menu-view.layout-list .menu-grid .dish-meta, .menu-view.layout-list .menu-grid .dish-badges { min-height: 0; }
.menu-view.layout-list .menu-grid .dish-footer {
  position: static; display: flex; align-items: center; justify-content: flex-end;
  width: 100%; margin: 4px 0 0; padding: 0; gap: 8px;
}
.menu-view.layout-list .menu-grid .menu-add-btn { align-self: center; white-space: nowrap; }
@media (max-width: 600px) {
  .menu-view.layout-list .menu-grid { gap: 8px; }
  .menu-view.layout-list .menu-grid .dish,
  .menu-view.layout-list .menu-grid .dish.has-image { grid-template-columns: 64px minmax(0, 1fr); align-items: start; padding: 10px; }
  .menu-view.layout-list .menu-grid .dish-img-frame { width: 64px; height: 64px; }
  .menu-view.layout-list .menu-grid .menu-add-btn { grid-column: 2; justify-self: start; margin-top: 2px; }
}
.cart-bar { position: relative; z-index: 3;
  position: sticky; bottom: 0; background: var(--bar-bg); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); padding: 14px 18px; display: none;
  align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0;
}
.cart-bar.visible { display: flex; }
.cart-summary { font-size: 0.85rem; color: var(--text-dim); }
.cart-summary .cart-total { color: var(--text); font-weight: 700; font-size: 1rem; }


.order-confirm { text-align: center; padding: 8px 0; }
.order-confirm .checkmark { font-size: 2.4rem; margin-bottom: 8px; }
.order-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 0.9rem; }
.order-line:last-child { border-bottom: none; }
.order-total-row { display: flex; justify-content: space-between; padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--border); font-weight: 700; }

.menu-view .menu-scroll {
  flex: 1; min-height: 0; width: 100%;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.menu-view .menu-list { padding: 0 18px 84px; }
.menu-view .menu-toolbar {
  padding: 18px 18px 12px;
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.menu-view .menu-toolbar .chat-input { margin: 0 0 6px; width: 100%; }
.menu-filter-strip { display: none; }
.menu-filter-toggle { display: none; }
.menu-toolbar { padding: 18px 18px 0; }
.menu-section-title { position: relative; z-index: 2; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin: 18px 0 8px; }
.menu-section-title:first-child { margin-top: 0; }
.menu-chef-featured-title {
  margin-top: 2px;
  padding: 7px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, var(--accent-soft), transparent 72%);
  color: var(--text);
  letter-spacing: 0.1em;
}


.rating-widget { text-align: center; padding: 10px 0; }
.rating-stars { font-size: 1.8rem; letter-spacing: 4px; cursor: pointer; }
.rating-stars .star { color: var(--border); transition: color 0.1s ease; }
.rating-stars .star.active { color: #e0c352; }

.privacy-menu { position: relative; display: inline-block; }
.privacy-dropdown {
  position: absolute; bottom: 100%; right: 0; margin-bottom: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; width: 220px; box-shadow: var(--shadow); font-size: 0.8rem;
  max-width: calc(100vw - 36px);
}
/* Header dropdowns open downward instead of upward (upward would run off the top of the screen). */
.privacy-dropdown.dropdown-down { bottom: auto; top: 100%; margin-bottom: 0; margin-top: 8px; }
/* Persistent close affordance for the header dropdowns (rendered once, outside the swappable content). */
.dropdown-body { padding-right: 26px; }
.dropdown-close {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 6px;
  color: var(--muted); font-size: 1.15rem; line-height: 1; cursor: pointer;
}
.dropdown-close:hover,
.dropdown-close:focus-visible { background: var(--panel-2); color: var(--text); }
.dropdown-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.role-badge { background: var(--panel-2); color: var(--text-dim); text-transform: uppercase; vertical-align: middle; margin-left: 8px; }
.bar-chart { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: 46px 1fr 56px; align-items: center; gap: 10px; font-size: 0.78rem; }
.bar-label { color: var(--muted); }
.bar-track { background: var(--panel-2); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, var(--accent), var(--accent-bright)); height: 100%; border-radius: 999px; min-width: 3px; }
.bar-value { text-align: right; color: var(--text-dim); }

/* ============ Admin: analytics & reviews (shared bar/funnel widgets) ============ */
.funnel { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.funnel-step { display: grid; grid-template-columns: 140px 1fr 60px; align-items: center; gap: 12px; }
.funnel-label { font-size: 0.85rem; color: var(--text-dim); }
.funnel-track { background: var(--panel-2); border-radius: 999px; height: 22px; overflow: hidden; position: relative; }
.funnel-fill { background: linear-gradient(90deg, var(--accent), var(--accent-bright)); height: 100%; border-radius: 999px; display: flex; align-items: center; padding-left: 10px; font-size: 0.75rem; font-weight: 700; color: #fff; min-width: 30px; }
.funnel-count { text-align: right; font-weight: 700; }
.hour-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-top: 10px; align-items: end; height: 90px; }
.hour-bar-wrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.hour-bar { width: 100%; background: linear-gradient(180deg, var(--accent-bright), var(--accent)); border-radius: 4px 4px 0 0; min-height: 2px; }
.hour-label { font-size: 0.62rem; color: var(--muted); margin-top: 4px; }
.pref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-top: 10px; }
.pref-block h4 { margin: 0 0 8px; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rating-row { display: grid; grid-template-columns: 40px 1fr 50px; align-items: center; gap: 10px; font-size: 0.82rem; margin-bottom: 6px; }

@media (max-width: 520px) {
  .funnel-step { grid-template-columns: 92px 1fr 38px; gap: 8px; }
  .funnel-label { font-size: 0.76rem; }
  .funnel-count { font-size: 0.85rem; }
  .funnel-fill { font-size: 0.68rem; padding-left: 8px; }
}

/* ============ Admin: reviews ============ */
.review-card { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border-soft); }
.review-card:last-child { border-bottom: none; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: #fff;
}
.avatar-0 { background: #2d6a4f; } .avatar-1 { background: #3080ff; }
.avatar-2 { background: #b5860b; } .avatar-3 { background: #6a5fd8; }
.avatar-4 { background: #c0546f; } .avatar-5 { background: #3d8b6a; }
.review-body { flex: 1; min-width: 0; }
.review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.review-name { font-weight: 700; }
.review-time { font-size: 0.76rem; color: var(--muted); }
.review-stars { color: #e0c352; font-size: 0.9rem; letter-spacing: 2px; margin: 3px 0 6px; }
.review-text { font-size: 0.9rem; color: var(--text-dim); line-height: 1.5; }
.review-dishes { font-size: 0.76rem; color: var(--muted); margin-top: 6px; }

.admin-body {
  /* MEALZ admin tokens; later overridable from admin settings. */
  --admin-accent: #74c69d;
  --admin-accent-hover: #8bd6ad;
  --admin-accent-ink: #102018;
  --admin-accent-soft: rgba(116, 198, 157, .15);
  --admin-accent-2: #ff007f;
  --admin-brand-gradient: linear-gradient(165deg, #74c69d 0%, #40916c 40%, #ff007f 100%);
  --admin-chart-1: #74c69d;
  --admin-chart-2: #40916c;
  --admin-chart-3: #ff007f;
  --admin-chart-4: #a1a1aa;
  --accent: var(--admin-accent);
  --accent-bright: var(--admin-accent-hover);
  --accent-ink: var(--admin-accent-ink);
  --accent-soft: var(--admin-accent-soft);
  --accent-2: var(--admin-accent-2);
  /* Stronger secondary text on admin dark surfaces. */
  --text-dim: #b4b4bd;
  --muted: #a1a1aa;
  --status-paid: #a1a1aa;
  --urgency-warn: #d6a43a;
  --urgency-warn-ink: #241a06;
  --urgency-urgent: #d95852;
  --urgency-urgent-ink: #21100f;
}

/* ============ Admin: orders ============ */
.admin-body {
  --danger-soft: rgba(224, 82, 82, .14);
  --danger-ink: #e05252;
  --status-new: #d6a43a;
  --status-preparing: #5da2ff;
  --status-served: #b98256;
  --status-paid: #a1a1aa;
}
.admin-body .nav-tab.active {
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
  border-left: 3px solid var(--admin-accent);
  box-shadow: none;
}
.admin-body .nav-tab.active .icon { color: var(--admin-accent); }
.admin-body .chip.selected,
.admin-body .admin-menu-tab.active,
.admin-body .settings-tab.active,
.admin-body .view-toggle button.active {
  background: var(--admin-accent-soft);
  border-color: var(--admin-accent);
  color: var(--admin-accent);
}
.admin-body .kanban-col .kanban-count {
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
}
.admin-body .refresh-dot {
  background: var(--admin-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--admin-accent) 16%, transparent);
}
.admin-body .bar-fill,
.admin-body .funnel-fill,
.admin-body .hour-bar,
.admin-body .dow-bar,
.admin-body .table-perf-fill {
  background: var(--admin-chart-1);
}
.admin-body .funnel-fill { color: var(--admin-accent-ink); }
.admin-body input::placeholder,
.admin-body textarea::placeholder { color: var(--muted); opacity: 1; }
.admin-body .bar-value span,
.admin-body .table-perf-value span { opacity: 1 !important; }
.admin-body .trend.up {
  background: var(--admin-accent-soft);
  color: var(--admin-accent);
}
.admin-body .trend.down { background: rgba(224,82,82,.16); color: #f08a86; }
.admin-body .trend.flat { background: var(--panel-2); color: var(--text-dim); }
.staff-help-card { border-color: var(--border); }
.staff-help-card.is-actionable { border-color: var(--urgency-warn); }
.staff-help-list { display: flex; flex-direction: column; }
.staff-help-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  min-width: 0;
}
.staff-help-row:last-child { border-bottom: 0; }
.staff-help-main { display: flex; align-items: center; gap: 7px; min-width: 0; flex-wrap: wrap; }
.staff-help-main strong { color: var(--text); font-size: 0.92rem; font-weight: 600; }
.staff-help-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; }
.staff-help-meta time { color: var(--muted); font-size: 0.74rem; white-space: nowrap; }
.staff-help-session { color: var(--text-dim); font: 0.7rem/1.3 ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; max-width: 160px; white-space: nowrap; }
.staff-help-row.is-old .staff-help-main strong { color: var(--text-dim); }
.staff-help-row[data-urgency="warn"] .order-age { background: var(--urgency-warn); border-color: var(--urgency-warn); color: var(--urgency-warn-ink); }
.staff-help-row[data-urgency="urgent"] .order-age,
.staff-help-row[data-urgency="stale"] .order-age { background: var(--urgency-urgent); border-color: var(--urgency-urgent); color: var(--urgency-urgent-ink); }
.staff-help-row[data-urgency="warn"] .staff-help-main { border-left: 3px solid var(--urgency-warn); padding-left: 8px; }
.staff-help-row[data-urgency="urgent"] .staff-help-main,
.staff-help-row[data-urgency="stale"] .staff-help-main { border-left: 3px solid var(--urgency-urgent); padding-left: 8px; }
.help-old-separator { margin: 10px 0 2px; padding-top: 10px; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: .04em; }
@media (max-width: 700px) {
  .staff-help-row { grid-template-columns: minmax(0, 1fr) auto; }
  .staff-help-meta { grid-column: 1; grid-row: 2; align-items: flex-start; }
  .staff-help-row form { grid-column: 2; grid-row: 1 / span 2; }
}
.filter-row { display: flex; flex-wrap: wrap; margin-bottom: 18px; }
.filter-row .chip { text-decoration: none; }
.order-card { padding: 18px; }
.order-card-head { display: flex; align-items: center; margin-bottom: 4px; min-width: 0; }
.order-card-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1 1 auto; }
.order-card-title > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-time { color: var(--muted); font-size: 0.78rem; margin-left: 0; flex: 0 0 auto; }
.order-status-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 18px; margin-bottom: 10px; }
.order-status-row .order-age { margin-left: 0; }
.order-actions { display: flex; align-items: center; gap: 24px; margin-top: 14px; flex-wrap: nowrap; }
.order-actions form { margin: 0; }
.order-action-main { flex: 1 1 auto; min-width: 0; }
.order-action-main .btn { width: auto; }
.order-action-delete { flex: 0 0 auto; margin-left: auto; }
.order-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, transform 120ms ease;
}
.order-delete:hover,
.order-delete:focus-visible { color: var(--danger-ink); background: var(--danger-soft); }
.order-delete:focus-visible { outline: 2px solid var(--danger-ink); outline-offset: 2px; }
.order-delete:active { transform: scale(.92); }
.order-delete svg { display: block; }
@media (max-width: 600px) {
  .order-delete { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .order-delete { transition: none; }
  .order-delete:active { transform: none; }
}
.badge.status-new { background: rgba(224,195,82,0.14); color: #e0c352; }
.badge.status-preparing { background: rgba(48,128,255,0.14); color: #5da2ff; }
.badge.status-served { background: rgba(61,139,106,0.16); color: var(--accent-2); }
.badge.status-paid { background: rgba(161,161,170,0.14); color: var(--text-dim); }
.badge.status-cancelled { background: rgba(224,82,82,0.14); color: #e05252; }

.admin-refresh-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--text-dim);
}
.orders-refresh-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.refresh-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 16%, transparent);
}
.orders-refresh-state.is-pulsing .refresh-dot { animation: admin-refresh-pulse 600ms ease-out; }
.orders-refresh-state.is-stale { color: var(--muted); }
.orders-refresh-state.is-stale .refresh-dot {
  background: var(--muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 16%, transparent);
}
@keyframes admin-refresh-pulse {
  0% { transform: scale(1); opacity: .75; }
  55% { transform: scale(1.6); opacity: 1; }
  100% { transform: scale(1); opacity: .85; }
}

.order-card { position: relative; }
.order-card.is-new-order {
  animation: admin-new-order-glow 5s cubic-bezier(.2,.8,.2,1) both;
}
.order-card.is-new-order::before,
.order-card.is-new-order-static::before {
  content: '';
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent);
  z-index: 1;
}
.order-card.is-new-order .order-card-head,
.order-card.is-new-order-static .order-card-head { padding-right: 38px; }
.order-new-label {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 0.68rem/1 var(--font-ui);
  letter-spacing: .02em;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 28%, transparent);
}
@keyframes admin-new-order-glow {
  0% {
    opacity: 0;
    transform: translateY(-8px);
    box-shadow: 0 0 0 2px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 42%, transparent);
  }
  18% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 0 0 2px var(--accent), 0 0 30px color-mix(in srgb, var(--accent) 52%, transparent);
  }
  60% {
    box-shadow: 0 0 0 2px var(--accent), 0 0 18px color-mix(in srgb, var(--accent) 34%, transparent);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent);
  }
}
.kanban-count.is-bumped { animation: admin-count-bump 300ms ease-out; }
@keyframes admin-count-bump {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.25); }
}
.new-orders-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0 0 10px;
  padding: 7px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--accent);
  font: 700 0.78rem/1 var(--font-ui);
  cursor: pointer;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 15%, transparent);
}
.new-orders-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-paid-hidden="true"] { display: none !important; }
.paid-toggle {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  justify-content: center;
}
.order-card.paid-reveal {
  animation: admin-paid-reveal 180ms ease-out both;
  animation-delay: var(--paid-reveal-delay, 0ms);
}
@keyframes admin-paid-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .admin-refresh-line { align-items: flex-start; }
  .orders-refresh-state { font-size: 0.74rem; }
}
@media (prefers-reduced-motion: reduce) {
  .order-card.is-new-order,
  .orders-refresh-state.is-pulsing .refresh-dot,
  .kanban-count.is-bumped,
  .new-orders-pill { animation: none !important; transition: none !important; }
  .order-card.is-new-order { box-shadow: 0 0 0 2px var(--accent); }
  .order-card.paid-reveal { animation: none !important; }
}

.order-age[hidden] { display: none !important; }
.order-age {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  min-width: 72px;
  margin-left: 7px;
  justify-content: center;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  vertical-align: 1px;
}
.order-card[data-urgency="warn"] {
  background-image: linear-gradient(to right, var(--urgency-warn) 0 3px, transparent 3px);
}
.order-card[data-urgency="warn"] .order-age {
  border-color: color-mix(in srgb, var(--urgency-warn) 55%, var(--border));
  background: var(--urgency-warn);
  color: var(--urgency-warn-ink);
}
.order-card[data-urgency="urgent"],
.order-card[data-urgency="stale"] {
  background-image: linear-gradient(to right, var(--urgency-urgent) 0 3px, transparent 3px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--urgency-urgent) 26%, transparent), 0 0 18px color-mix(in srgb, var(--urgency-urgent) 15%, transparent);
}
.order-card[data-urgency="urgent"] .order-age,
.order-card[data-urgency="stale"] .order-age {
  border-color: color-mix(in srgb, var(--urgency-urgent) 55%, var(--border));
  background: var(--urgency-urgent);
  color: var(--urgency-urgent-ink);
}
.order-age-icon {
  font-size: 0.72rem;
  line-height: 1;
  cursor: help;
}
.order-card.urgency-pulse { animation: admin-urgency-pulse 400ms ease-out; }
@keyframes admin-urgency-pulse {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--urgency-urgent) 20%, transparent), 0 0 12px color-mix(in srgb, var(--urgency-urgent) 8%, transparent); }
  45% { box-shadow: 0 0 0 2px var(--urgency-urgent), 0 0 22px color-mix(in srgb, var(--urgency-urgent) 38%, transparent); }
}
@media (max-width: 600px) {
  .order-age { margin-left: 0; margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .order-card.urgency-pulse { animation: none !important; }
}

.order-status-row .badge {
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--status-color, var(--text-dim)) 28%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--status-color, var(--text-dim)) 10%, transparent);
  color: var(--status-color, var(--text-dim));
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .04em;
  text-transform: none;
}
.recent-order-row .badge { text-transform: none; }
.order-status-row .badge.status-new { --status-color: var(--status-new); }
.order-status-row .badge.status-preparing { --status-color: var(--status-preparing); }
.order-status-row .badge.status-served { --status-color: var(--status-served); }
.order-status-row .badge.status-paid { --status-color: var(--status-paid); }
.order-status-row .badge.status-cancelled { --status-color: var(--danger-ink); }
@media (max-width: 600px) {
  .order-status-row .badge { font-size: 10px; }
}

/* ============ Guest modals: item details & order review ============ */
.mealz-modal-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,0.62); backdrop-filter: blur(2px); padding: 0;
}
.mealz-modal {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow); padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
}
.mealz-modal-close {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; padding: 0;
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 1.35rem; line-height: 1; cursor: pointer;
}
.mealz-modal-close:hover, .mealz-modal-close:focus-visible { background: var(--panel-2); color: var(--text); }
.mealz-modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mealz-modal h2 { margin: 0 40px 8px 0; font-size: 1.25rem; letter-spacing: -0.01em; }
.mealz-modal-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; margin: 4px 0 14px; background: var(--panel-2); display: block; }
.mealz-modal-img-placeholder {
  width: 100%; height: 140px; border-radius: 12px; margin: 4px 0 14px; background: var(--panel-2);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; font-size: 2rem;
}
.mealz-modal-desc { color: var(--text-dim); line-height: 1.55; margin: 0 0 12px; }
.mealz-modal-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mealz-section { margin-top: 14px; }
.mealz-section-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin-bottom: 5px; }
.mealz-allergens { border: 1px solid rgba(224,163,82,0.35); background: rgba(224,163,82,0.08); color: #e0a352; border-radius: 10px; padding: 10px 12px; font-size: 0.85rem; }
.mealz-allergens.missing { border-color: var(--border); background: var(--panel-2); color: var(--muted); }
.mealz-facts { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 0.85rem; color: var(--text-dim); }
.mealz-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.mealz-modal-note { font-size: 0.82rem; color: var(--muted); margin-top: 8px; }
.mealz-review-line { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.mealz-review-line:last-child { border-bottom: none; }
.mealz-review-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.mealz-review-name { font-weight: 600; }
.mealz-review-unit { color: var(--muted); font-size: 0.8rem; }
.mealz-review-line-total { font-weight: 700; white-space: nowrap; }
.mealz-review-controls { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.mealz-review-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.05rem; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.mealz-review-error { color: #e05252; font-size: 0.85rem; margin-top: 10px; }
.mealz-review-empty { color: var(--muted); font-size: 0.9rem; }
.mealz-details-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 0 10px; }
.mealz-details-meta-row { display: flex; align-items: baseline; gap: 6px; }
.mealz-details-meta-label { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.mealz-details-meta-value { font-weight: 600; }
.mealz-details-modal { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.mealz-details-modal .mealz-modal-img { max-height: 260px; }
.mealz-details-modal h2 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em; }
.mealz-details-qty-section { margin-top: 16px; }
.mealz-qty-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.mealz-qty-btn { width: 36px; height: 36px; flex: 0 0 36px; font-size: 1.1rem; }
.mealz-qty-value { min-width: 28px; text-align: center; font-size: 1rem; font-weight: 800; }
.mealz-qty-total { margin-left: auto; color: var(--text); font-size: 1rem; font-weight: 800; white-space: nowrap; }
@media (max-width: 480px) { .mealz-qty-total { flex: 1 0 100%; margin-left: 0; text-align: right; } }
.mealz-details-modal .mealz-modal-close {
  position: sticky; top: 8px; float: right; z-index: 3;
  width: 40px; height: 40px; margin: -6px -6px 6px 10px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  font-size: 1.6rem; box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.mealz-details-modal .mealz-modal-close:hover,
.mealz-details-modal .mealz-modal-close:focus-visible { background: var(--border); color: #fff; }
@media (min-width: 640px) {
  .mealz-modal-overlay { align-items: center; padding: 24px; }
  .mealz-modal { border-radius: var(--radius); }
}

@media (max-width: 480px) {
  .container { padding: 20px 14px 90px; }
  .card { padding: 18px; }
}

/* ============ Guest full profile ============ */
.mealz-profile-modal { max-width: 760px; }
.profile-section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.profile-section-title { font-weight: 800; font-size: 1rem; margin-bottom: 10px; }
.profile-hint { font-size: 0.82rem; color: var(--muted); line-height: 1.5; margin: 4px 0 10px; }
.profile-form { display: flex; flex-direction: column; gap: 10px; }
.profile-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--text-dim); }
.profile-field-label { color: var(--muted); font-size: 0.76rem; font-weight: 600; }
.profile-check-row { display: flex; flex-wrap: wrap; gap: 12px; }
.profile-check { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-dim); }
.profile-msg { font-size: 0.82rem; margin-top: 8px; min-height: 1.2em; }
.profile-account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.profile-account-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--panel-2); }
.profile-account-name { font-weight: 800; font-size: 1.05rem; }
.profile-account-email { color: var(--muted); font-size: 0.84rem; }
.profile-avatar-preview { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; display: block; margin: 6px 0 12px; border: 1px solid var(--border); }
.profile-avatar-row { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-avatar-option { width: 48px; height: 48px; border-radius: 50%; padding: 0; border: 2px solid transparent; background: transparent; cursor: pointer; }
.profile-avatar-option img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.profile-avatar-option.active { border-color: var(--accent-2); }
.profile-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.profile-summary-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.profile-summary-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.profile-summary-value { font-weight: 800; font-size: 1.05rem; margin-top: 4px; }
.profile-summary-sub { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }
.profile-orders { display: flex; flex-direction: column; gap: 8px; }
.profile-order { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--bg-elev); }
.profile-order-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 0.78rem; }
.profile-order-date { color: var(--muted); }
.profile-order-items { font-size: 0.85rem; margin: 6px 0; color: var(--text-dim); }
.profile-order-foot { display: flex; justify-content: space-between; font-weight: 700; }
.profile-order-rating { color: #e0c352; }
@media (max-width: 560px) { .profile-summary-grid { grid-template-columns: 1fr; } }
.profile-restaurant-logo { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--panel-2); margin-bottom: 8px; }

.recommendation-empty { color: var(--muted); font-size: 0.86rem; line-height: 1.5; margin: -2px 0 14px; }
.recommend-stage { margin: 8px 0 16px; }
.recommend-stage .menu-section-title { margin-top: 14px; }
.recommend-stage-intro { color: var(--text-dim); font-size: 0.84rem; line-height: 1.45; margin: -2px 0 10px; }
.recommend-stage-list { display: block; }
.recommend-stage-status { color: var(--muted); font-size: 0.82rem; line-height: 1.45; margin: 4px 0 10px; }
.recommend-more { margin: 0 0 10px; }
.recommend-review { margin: 6px 0 10px; }
.recommend-review[hidden] { display: none; }

/* ============ Guest responsive / mobile tuning ============ */
@media (max-width: 720px) {
  body.guest-chat-page {
    position: fixed; inset: 0; min-height: 0; overflow: hidden;
    overscroll-behavior: none;
  }
  body.guest-chat-page .chat-shell {
    position: fixed; top: var(--app-top, 0px); left: 50%; transform: translateX(-50%);
    width: 100%; max-height: var(--app-height, 100dvh);
    height: var(--app-height, 100dvh); margin: 0;
    overflow: hidden; background: var(--bg);
  }
  body.guest-chat-page .chat-thread {
    flex: 1; min-height: 0; overflow-y: auto;
    background: transparent;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  body.guest-chat-page .menu-view .menu-scroll { background: transparent; }
  body.guest-chat-page .chat-composer .ask-inline-input,
  body.guest-chat-page .chat-composer .chat-input { font-size: 16px; }
  html.keyboard-open body.guest-chat-page .chat-composer { padding-bottom: 8px; }
  .chat-header { padding: calc(10px + env(safe-area-inset-top)) 12px 10px; gap: 6px 8px; }
  .chat-header-brand { gap: 8px; }
  .chat-logo { width: 32px; height: 32px; border-radius: 9px; }
  .chat-header-title { font-size: 0.98rem; }
  .chat-header-sub { font-size: 0.68rem; }
  .chat-header-actions { gap: 4px; }
  .chat-header-actions .btn.icon-only { padding: 7px 8px; min-width: 38px; min-height: 38px; }
  .lang-btn { padding: 7px 10px; font-size: 0.74rem; }
  .guest-nav { order: 3; width: 100%; }
  .guest-nav-link { flex: 1; padding: 9px 8px; font-size: 0.78rem; gap: 5px; }
  .chat-thread { padding: 14px 12px 20px; }
  .chat-composer { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  #staffBtn span { display: none; }
  #staffBtn { padding: 8px 9px; min-width: 40px; min-height: 40px; }
  .composer-tool { min-width: 40px; min-height: 40px; }
  .composer-tool .btn { min-width: 40px; min-height: 40px; }
  .cart-bar { padding: 10px 12px; }
  .menu-toolbar { padding: 10px 12px 0; }
  .menu-toolbar .chip-row { margin: 2px 0 6px; }
  .menu-toolbar .chip { padding: 7px 12px; font-size: 0.84rem; }
  .menu-view { position: relative; }
  .menu-filter-strip { display: block; flex: 0 0 44px; height: 44px; position: relative; }
  .menu-filter-toggle:not([hidden]) {
    display: inline-flex;
    position: absolute; top: 3px; right: 12px;
    z-index: 5;
    align-items: center; justify-content: center;
    width: 38px; height: 38px; padding: 0;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--bar-bg);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    color: var(--text); box-shadow: var(--shadow);
    cursor: pointer;
  }
  .menu-filter-toggle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
  .menu-view .menu-list { padding: 0 12px 84px; }
  .menu-view .menu-toolbar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 6;
    padding: 10px 12px 10px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.18s ease, opacity 0.18s ease, visibility 0s linear 0.18s;
    will-change: transform;
  }
  .menu-view .menu-toolbar.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.18s ease, opacity 0.18s ease, visibility 0s;
  }
  .menu-section-title { margin: 12px 0 6px; }
}
@media (max-width: 430px) {
  .dish { padding: 12px; }
  .dish.has-image { gap: 10px; }
  .dish-img { width: 72px; height: 72px; border-radius: 10px; }
  .dish h3 { font-size: 0.98rem; overflow-wrap: anywhere; }
  .dish-desc { font-size: 0.82rem; margin: 3px 0 8px; overflow-wrap: anywhere; }
  .tag { font-size: 0.68rem; padding: 3px 8px; }
  .dish-footer { flex-wrap: wrap; gap: 8px; }
  .qty-stepper { gap: 8px; }
  .qty-btn { width: 40px; height: 40px; }
  .qty-stepper .btn.small { min-width: 40px; min-height: 40px; }
  .price { font-size: 0.95rem; }
  .cart-summary { font-size: 0.8rem; }
  .cart-bar .btn { min-height: 38px; }
  .mealz-modal { padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); }
  .mealz-modal h2 { font-size: 1.1rem; }
  .mealz-modal .btn.small { min-height: 40px; }
  .mealz-modal-actions .btn { flex: 1; }
  .mealz-review-row { flex-wrap: wrap; }
  .mealz-review-name { overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  .chat-logo { display: none; }
  .chat-header-title { font-size: 0.95rem; }
  .chat-header-actions .btn.icon-only { padding: 7px 8px; min-width: 38px; min-height: 38px; }
  .lang-btn { padding: 6px 8px; }
  .guest-nav-link { font-size: 0.75rem; padding: 8px 6px; }
  .guest-nav-link svg { width: 12px; height: 12px; }
}
@media (max-height: 560px) {
  .mealz-modal { padding: 12px; max-height: 94vh; }
  .mealz-modal-img { max-height: 110px; }
  .mealz-modal-img-placeholder { height: 80px; }
  .mealz-modal h2 { font-size: 1.05rem; margin-bottom: 6px; }
  .mealz-modal-actions { position: sticky; bottom: 0; background: var(--panel); padding-top: 8px; padding-bottom: 4px; z-index: 2; }
  .mealz-review-controls { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-view .menu-toolbar { transition: none; }
}

/* ============ Guest profile / account modal ============ */
.account-menu-title { font-weight: 700; margin-bottom: 8px; }
.mealz-modal-overlay.profile-modal-overlay {
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(0,0,0,0.66);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.mealz-modal.mealz-profile-modal {
  width: 100%; max-width: 420px;
  max-height: calc(var(--app-height, 100dvh) - 32px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius); padding: 20px;
}
.profile-tabs {
  display: flex; gap: 4px; margin: 0 0 14px; padding: 4px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px;
}
.profile-tab {
  flex: 1; border: 0; background: transparent; color: var(--text-dim);
  padding: 9px 10px; border-radius: 999px; font-size: 0.86rem; font-weight: 700;
  font-family: inherit; cursor: pointer;
}
.profile-tab.active { background: var(--accent); color: var(--accent-ink); }
.profile-tab:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.profile-field[hidden] { display: none; }
.profile-form .btn.block { margin-top: 4px; }
.profile-data { display: flex; flex-direction: column; margin-top: 4px; }
.profile-data-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 0; border-bottom: 1px solid var(--border-soft);
}
.profile-data-label {
  color: var(--muted); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.profile-data-value { font-size: 0.92rem; font-weight: 600; overflow-wrap: anywhere; }
.profile-preferences { margin-top: 14px; }

.profile-accordion {
  margin-top: 10px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel-2); overflow: hidden;
}
.profile-accordion > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; color: var(--text); font-size: 0.9rem; font-weight: 800;
}
.profile-accordion > summary::-webkit-details-marker { display: none; }
.profile-accordion > summary::after {
  content: '+'; color: var(--accent-2); font-size: 1.1rem; font-weight: 800; line-height: 1;
}
.profile-accordion[open] > summary::after { content: '−'; }
.profile-accordion > summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.profile-accordion-body {
  border-top: 1px solid var(--border-soft); padding: 12px 14px 14px;
}
.profile-accordion .profile-form { gap: 8px; }
.profile-accordion .profile-field { margin-top: 2px; }
.profile-accordion .profile-msg { margin-top: 6px; }
.profile-accordion .profile-order:last-child { margin-bottom: 0; }
.profile-empty { color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
.profile-msg.saved { color: var(--accent-2); }
.profile-check input { width: auto; accent-color: var(--accent); }
.profile-logout { margin-top: 20px; }
@media (max-width: 640px) {
  .mealz-modal-overlay.profile-modal-overlay { padding: 10px; }
  .mealz-modal.mealz-profile-modal {
    max-height: calc(var(--app-height, 100dvh) - 20px);
    padding: 16px;
  }
}

/* Floating AI assistant button on the guest menu. It sits above the order summary when visible. */
.menu-chat-fab {
  position: absolute; right: 16px; bottom: calc(var(--menu-cart-bar-height, 0px) + 16px);
  z-index: 9; width: 48px; height: 48px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--accent); color: var(--accent-ink);
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}
.menu-chat-fab:hover { background: var(--accent-bright); transform: translateY(-1px); }
.menu-chat-fab:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Compact AI recommendation rows */
.chat-thread .ai-dish {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px;
  margin-bottom: 10px; border-radius: 14px;
}
.chat-thread .ai-dish .dish-img {
  width: 72px; height: 72px; border-radius: 10px; flex: 0 0 72px;
}
.chat-thread .ai-dish .ai-dish-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 1.3rem; font-weight: 800;
  background: var(--panel-2);
}
.chat-thread .ai-dish .dish-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chat-thread .ai-dish .dish-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.chat-thread .ai-dish h3 {
  margin: 0; min-width: 0; font-family: var(--font-serif); font-weight: 600;
  font-size: 0.98rem; line-height: 1.25; letter-spacing: -0.01em;
}
.chat-thread .ai-dish .dish-head .price { flex-shrink: 0; font-size: 0.9rem; }
.chat-thread .ai-dish .dish-tags { margin-top: 1px; }
.chat-thread .ai-dish .dish-footer { margin-top: 5px; justify-content: flex-start; }
.chat-thread .ai-dish .qty-stepper .btn { padding: 5px 11px; font-size: 0.76rem; }
.recommend-more,
.btn.ghost.recommend-more {
  border: 0; background: transparent; padding: 4px 0; color: var(--text-dim);
  text-decoration: underline; text-underline-offset: 3px; box-shadow: none;
}
.recommend-more:hover { color: var(--text); transform: none; }
/* Search magnifier on the right of the menu search field */
.menu-search-box { position: relative; }
.menu-search-box .chat-input { padding-right: 42px; }
.menu-search-icon {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; display: inline-flex;
}
