/*modified 2026-11-02 00:50:00*/
:root {
  --bg: #faf6f1;
  --surface: #ffffff;
  --surface-2: #f3ece3;
  --border: #e6dccf;
  --text: #2a1d12;
  --text-2: #6b5a4a;
  --muted: #9a8a7a;
  --accent: #7a4a22;
  --accent-2: #a9662e;
  --accent-soft: #f3e3d0;
  --on-accent: #fff;
  --ok: #1f7a3d;
  --ok-soft: #e3f3e8;
  --warn: #9a5b00;
  --warn-soft: #fdf0d5;
  --danger: #b3261e;
  --danger-soft: #fbe5e3;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #ece6de;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 35, 10, .06), 0 4px 16px rgba(60, 35, 10, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17120e;
    --surface: #211a14;
    --surface-2: #2b221a;
    --border: #3a2f25;
    --text: #f2e9df;
    --text-2: #c9b8a6;
    --muted: #8f7f70;
    --accent: #d9944f;
    --accent-2: #e8ab6b;
    --accent-soft: #3a2a1b;
    --on-accent: #1a1007;
    --ok: #6cc98a;
    --ok-soft: #1d3324;
    --warn: #e8b04a;
    --warn-soft: #3a2d12;
    --danger: #ff8a80;
    --danger-soft: #3d1c1a;
    --series-1: #3987e5;
    --series-2: #d95926;
    --grid: #33291f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Sarabun", "Noto Sans Thai", "Leelawadee UI", "Thonburi", system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
a { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.boot-failed { text-align: center; color: var(--text-2); padding: 16px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.side {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 10px; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; font-size: 1.05rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 500; position: relative;
}
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 20px; height: 20px; flex: none; }
.badge {
  margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px;
  font-size: .72rem; padding: 0 7px; line-height: 18px; font-weight: 700;
}
.shop-pick { padding: 0 4px 12px; }
.shop-pick select, .shop-top select { min-height: 44px; font-weight: 600; }
.shop-pick .shop-name { display: block; padding: 0 4px; color: var(--text-2); font-weight: 600; }
.shop-top { display: none; }
.side .who { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--border); font-size: .85rem; }
.main { padding: 20px 24px 40px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .side {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; z-index: 20;
    flex-direction: row; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border);
  }
  .brand, .side .who, .shop-pick { display: none; }
  .shop-top { display: flex; align-items: center; gap: 8px; padding: 10px 14px 0; }
  .shop-top select { flex: 1; min-width: 0; }
  .shop-top .shop-name { font-weight: 700; flex: 1; }
  .shop-top .icon-btn { width: 44px; height: 44px; display: grid; place-items: center; flex: none; }
  .nav { display: flex; flex: 1; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: .7rem; flex: 1; text-align: center; }
  .nav a .badge { position: absolute; top: 2px; right: 18%; margin: 0; }
  .main { padding: 14px 14px 90px; }
}

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border);
  background: var(--surface); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; min-height: 40px;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .88rem; }
.btn.lg { min-height: 52px; font-size: 1.1rem; padding: 10px 20px; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); }

label.field { display: block; }
label.field > span { display: block; font-size: .85rem; color: var(--text-2); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-height: 40px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .82rem; color: var(--text-2); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.neutral { background: var(--surface-2); color: var(--text-2); }
.pill.pickup { background: var(--accent); color: var(--on-accent); font-size: .9rem; padding: 2px 10px; }
.pill.takeaway { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); font-size: .9rem; padding: 1px 10px; }
.pill.delivery { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); font-size: .9rem; padding: 1px 10px; }
.delivery-box { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); display: grid; gap: 6px; }
.delivery-box .btn { text-decoration: none; }
.fee-tier { display: grid; grid-template-columns: auto minmax(60px, 90px) auto minmax(60px, 90px) auto 40px; gap: 6px; align-items: center; white-space: nowrap; justify-content: start; }
.pill.pickup-time { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); font-size: .9rem; padding: 1px 10px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--text-2); font-weight: 500;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

.alert { padding: 10px 14px; border-radius: 10px; display: flex; gap: 10px; align-items: flex-start; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.billing-banner { margin-bottom: 12px; }
.billing-banner svg { width: 20px; height: 20px; flex: none; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------- modal & toast ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(20, 10, 0, .45); display: grid; place-items: center; z-index: 50; padding: 16px;
  animation: fade .12s ease-out;
}
.modal {
  background: var(--surface); border-radius: 16px; width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); gap: 10px; }
.modal-body { padding: 16px 18px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; flex: none; }
.modal-head { flex: none; }
@media (max-width: 860px) {
  .modal-bg { padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
  .modal { max-height: calc(100vh - 20px - env(safe-area-inset-bottom)); max-height: calc(100dvh - 20px - env(safe-area-inset-bottom)); }
}
@keyframes fade { from { opacity: 0; } }
#toast-root { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); animation: fade .15s; }
.toast.error { background: var(--danger); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); padding: 28px; }
.login img { width: 56px; height: 56px; display: block; margin: 0 auto 10px; object-fit: contain; border-radius: 12px; }
.powered { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; font-size: .8rem; color: var(--muted); }
.powered img, .login .powered img { width: 18px; height: 18px; margin: 0; border-radius: 4px; }
.logo-preview { width: 88px; height: 88px; object-fit: contain; border-radius: 16px; background: var(--surface-2); padding: 6px; }

/* ---------- POS ---------- */
/* minmax(0, 1fr): a long row of category tabs scrolls inside the page instead of widening it (phones had to zoom out) */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.cat-tabs button {
  border: 1px solid var(--border); background: var(--surface); padding: 8px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; font-weight: 500;
}
.cat-tabs button.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.menu-tile {
  border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 14px 12px; cursor: pointer; text-align: left;
  min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow);
  transition: transform .06s;
}
.menu-tile:active { transform: scale(.97); }
.menu-tile:hover { border-color: var(--accent-2); }
.menu-tile .name { font-weight: 600; font-size: 1.02rem; }
.menu-tile .price { color: var(--accent); font-weight: 700; }
/* retail: stock left of this item after what is already in the cart */
.menu-tile .stock-left { font-size: .82rem; color: var(--text-2); }
.menu-tile .stock-left.out { color: var(--danger); font-weight: 700; }
.cart { position: sticky; top: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.cart-items { overflow-y: auto; flex: 1; margin: 0 -16px; padding: 0 16px; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.cart-line .opts { font-size: .82rem; color: var(--text-2); grid-column: 1 / -1; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.qty button { border: 0; background: var(--surface-2); width: 34px; height: 32px; cursor: pointer; font-size: 1.1rem; }
.qty span { min-width: 34px; text-align: center; font-weight: 600; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.35rem; font-weight: 700; padding: 12px 0; }
.opt-group { margin-bottom: 16px; }
.opt-group h4 { margin: 0 0 8px; font-size: .95rem; display: flex; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 10px; cursor: pointer; min-height: 42px;
}
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.chip small { color: var(--muted); margin-left: 4px; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.dine-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dine-choice .chip { min-height: 48px; font-size: 1.05rem; }
.cash-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.change-alert { text-align: center; background: var(--ok-soft); color: var(--ok); border: 2px solid var(--ok); border-radius: 16px; padding: 18px 12px; }
.change-alert-label { font-size: 1.2rem; font-weight: 700; }
.change-alert-amount { font-size: clamp(3rem, 16vw, 4.6rem); font-weight: 800; line-height: 1.1; margin: 6px 0 10px; }
.change-alert-detail { color: var(--text-2); font-size: 1rem; }
.change-box { background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 12px 16px; display: flex; justify-content: space-between; font-size: 1.3rem; font-weight: 700; }
.mobile-cart-bar { display: none; }
@media (max-width: 1100px) { .pos { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 860px) {
  .pos { grid-template-columns: minmax(0, 1fr); }
  .cart { display: none; }
  .cart.open { display: flex; position: fixed; inset: 0 0 0 0; z-index: 30; border-radius: 0; max-height: none; top: 0; }
  .mobile-cart-bar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 15;
  }
}

/* ---------- reports ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { font-size: .82rem; color: var(--text-2); }
.kpi .value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .sub { font-size: .8rem; color: var(--muted); }
.kpi .value.neg { color: var(--danger); }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .bar-1 { fill: var(--series-1); }
.chart .bar-2 { fill: var(--series-2); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: var(--surface-2); }
.chart path { pointer-events: none; }
.legend { display: flex; gap: 16px; font-size: .85rem; color: var(--text-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip {
  position: absolute; pointer-events: none; background: var(--text); color: var(--bg); padding: 8px 10px; border-radius: 8px;
  font-size: .82rem; white-space: nowrap; transform: translate(-50%, -100%); z-index: 5;
}
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 8px; align-items: center; padding: 5px 0; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }

/* ---------- QR orders (staff) ---------- */
#o-incoming:not(:empty) { margin-bottom: 18px; }
.incoming-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.incoming-grid .card + .card { margin-top: 0; }
.incoming { display: grid; gap: 8px; border-left: 4px solid var(--warn); }
.incoming-items { display: grid; gap: 2px; }
.bill-card .bill-round { padding: 8px 0; border-top: 1px dashed var(--border); display: grid; gap: 4px; }
.bill-card.asked { border-color: var(--warn); box-shadow: 0 0 0 2px var(--warn-soft); }
.pp-box { text-align: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.pp-box .pp-img { background: #fff; border-radius: 12px; padding: 8px; width: min(240px, 100%); margin: 0 auto 6px; }
.pp-box .pp-img svg, .pp-box .pp-img img { display: block; width: 100%; height: auto; }
.pp-box .pp-amount { font-size: 1.4rem; font-weight: 700; }
.pp-box a.btn { text-decoration: none; }
.qr-card { text-align: center; }
.qr-card .qr-logo { width: 48px; height: 48px; object-fit: contain; display: block; margin: 0 auto 6px; border-radius: 10px; }
.qr-card .qr-brand { font-weight: 700; font-size: 1.1rem; }
.qr-card .qr-shop { color: var(--text-2); font-size: .9rem; }
/* QR stays black-on-white in dark mode so phones can scan it */
.qr-card .qr-img { background: #fff; border-radius: 12px; padding: 8px; width: min(260px, 100%); margin: 10px auto; }
.qr-card .qr-img svg { display: block; width: 100%; height: auto; }
.qr-card .qr-table { font-size: 1.4rem; font-weight: 700; }
.qr-card .qr-hint { color: var(--muted); font-size: .85rem; }

/* ---------- kitchen screen ---------- */
.kitchen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.k-col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 60vh; }
.k-col h3 { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-size: 1.15rem; }
.k-col h3 .pill { margin-left: auto; min-width: 32px; justify-content: center; font-size: .95rem; padding: 2px 10px; background: var(--surface); }
.k-list { display: grid; gap: 10px; }
.k-list .card + .card { margin-top: 0; }
.k-card { display: grid; gap: 8px; padding: 12px 14px; border-left: 5px solid var(--warn); }
.k-preparing .k-card { border-left-color: var(--accent); }
.k-ready .k-card { border-left-color: var(--ok); }
.k-no { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.k-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 1.1rem; }
.k-qty { color: var(--accent); }
.k-opts { font-size: .9rem; color: var(--text-2); padding-left: 1.8em; }
.k-note { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 6px 10px; font-weight: 600; }
.k-age { color: var(--text-2); font-weight: 600; }
.k-age.late { color: var(--danger); }
.k-card .k-next { flex: 1; }
.kitchen.with-qr { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.k-qr .k-card { border-left-color: var(--danger); }
.k-qr .k-card.k-unpaid { border-left-color: var(--ok); }
.k-sub { margin: 6px 4px 0; font-size: .95rem; color: var(--text-2); }
.k-take { min-height: 44px; padding: 0 6px; font-weight: 600; }
.k-take input { width: 22px; height: 22px; }
.k-pending { text-decoration: none; margin-bottom: 12px; font-weight: 600; align-items: center; }
.k-pending svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 860px) {
  .kitchen, .kitchen.with-qr { grid-template-columns: 1fr; }
  .k-col { min-height: 0; }
}

/* ---------- customer menu (/m/<token>) ---------- */
.cm { max-width: 640px; margin: 0 auto; padding: 0 16px calc(110px + env(safe-area-inset-bottom)); }
.cm-head { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 14px 0 8px; }
.cm-head h1 { font-size: 1.3rem; }
.cm-brand { display: flex; align-items: center; gap: 12px; }
.cm-brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; flex: none; }
.cm-head .sub { color: var(--text-2); font-size: .9rem; }
.cm .cat-tabs { margin: 10px 0 0; }
.cm-items { display: grid; gap: 10px; margin-top: 12px; }
.cm-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 14px 16px; min-height: 64px;
}
.cm-item:active { transform: scale(.99); }
.cm-item.sold-out { opacity: .55; cursor: default; }
.cm-item.sold-out:active { transform: none; }
.cm-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); margin: -4px 0 -4px -6px; }
.cm-photo { display: block; width: min(100%, 360px, 40vh); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 14px; margin: 0 auto 14px; background: var(--surface-2); }
.menu-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.menu-photo-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.menu-photo { width: 120px; height: 120px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; text-align: center; }
.menu-photo img { width: 100%; height: 100%; object-fit: cover; }
.icon-picker { max-height: 340px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.icon-pick { border: 2px solid transparent; background: var(--surface-2); border-radius: 12px; padding: 4px; display: grid; gap: 2px; font-size: .75rem; line-height: 1.2; text-align: center; cursor: pointer; color: var(--text-2); }
.icon-pick img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; }
.icon-pick.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.cm-item .name { font-weight: 600; font-size: 1.05rem; }
.cm-item .price { margin-left: auto; color: var(--accent); font-weight: 700; white-space: nowrap; }
.cm-item .in-cart { background: var(--accent); color: var(--on-accent); border-radius: 999px; min-width: 26px; text-align: center; font-size: .85rem; font-weight: 700; padding: 1px 8px; }
.cm-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
}
.cm-bar .btn { max-width: 608px; margin: 0 auto; display: flex; }
.cm-orders { display: grid; gap: 10px; margin-top: 12px; }
.cm-status { display: flex; gap: 12px; align-items: center; }
.cm-status .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--warn); }
.cm-status.ok .dot { background: var(--ok); }
.cm-status.done .dot { background: var(--muted); }
.cm-status.bad .dot { background: var(--danger); }
.cm-status.ready .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.cm-big { font-size: 1.15rem; font-weight: 700; }
.card.cm-bill { border: 2px solid var(--accent); }
.cm-pickup { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.card.cm-ready { border-color: var(--ok); background: var(--ok-soft); animation: cm-pulse 1s ease-in-out 3; }
.card.cm-ready .cm-big { color: var(--ok); font-size: 1.4rem; }
@keyframes cm-pulse { 50% { transform: scale(1.02); } }
@media (prefers-reduced-motion: reduce) { .card.cm-ready { animation: none; } }
.cm-steps {
  list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 10px 0 0; padding: 0;
  font-size: .78rem; color: var(--muted); text-align: center;
}
.cm-steps li { border-top: 4px solid var(--border); padding-top: 4px; }
.cm-steps li.on { border-top-color: var(--ok); color: var(--text-2); font-weight: 600; }
.toast.ok { background: var(--ok); color: var(--bg); }

/* ---------- settings editors ---------- */
.line-editor { display: grid; gap: 6px; }
.line-editor .ln { display: grid; grid-template-columns: 1fr 110px 60px 36px; gap: 6px; align-items: center; }
.choice-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface-2); }
.choice-card + .choice-card { margin-top: 10px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.me-card { max-width: 420px; margin-bottom: 14px; }
.me-card a.btn { text-decoration: none; }
.manual-link { text-align: center; margin-top: 10px; font-size: .9rem; }
.manual-link a { display: inline-block; padding: 8px 12px; }
.card.me-card + .card { margin-top: 0; }

@media print {
  .side, .mobile-cart-bar, .page-head .btn, .filters { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; break-inside: avoid; }
}
.btn svg, .icon-btn svg { width: 18px; height: 18px; flex: none; }
.grid > .card + .card { margin-top: 0; }
.side { align-self: start; }
