[hidden] { display: none !important; }
:root {
  --teal-900:#0A3B37; --teal-700:#0B6E66; --teal-100:#DDF1EE;
  --sun-400:#F6B826; --sun-100:#FFF1CC; --sun-ink:#8A5A00;
  --ground:#FBF8F1; --card:#FFFFFF; --line:#E6E1D6; --muted:#4F6360;
  --ok:#15803D; --ok-soft:#DCF3E3; --bad:#B42318; --bad-soft:#FCE4E2;
  --bg:var(--ground); --ink:var(--teal-900); --brand:var(--teal-700); --brand-soft:var(--teal-100); --brand-deep:var(--teal-900); --gold:var(--sun-400);
  --font-head:"Prompt",sans-serif; --font-body:"Noto Sans Thai Looped",sans-serif;
  --r-card:16px; --r-btn:14px; --shadow:0 2px 8px rgba(27,31,28,.08);
  --brand-ink: #fff; --warn: #b45309; --radius: 14px; --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Sarabun", "Noto Sans Thai", system-ui, sans-serif; font-size: 16px; line-height: 1.45;
  background: var(--bg); color: var(--ink); -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; font-size: 16px; } /* >=16px: iOS won't zoom */
button { cursor: pointer; border: 0; border-radius: 10px; min-height: 44px; padding: 0 14px; background: #e2e8f0; color: var(--ink); }
button.primary { background: var(--brand); color: var(--brand-ink); font-weight: 500; }
button.danger { background: #fee2e2; color: var(--bad); }
button.ghost { background: transparent; color: var(--brand); }
button:disabled { opacity: .45; }
input, select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--ink); }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 18px; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: 14px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 2px rgba(27,31,28,.06); }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.topbar { position: sticky; top: 0; z-index: 5; background: var(--brand); color: #fff; padding: 10px 16px; }
.topbar .row { justify-content: space-between; }
.topbar h1 { font-size: 18px; }
.chip { background: rgba(255,255,255,.18); color: #fff; border-radius: 999px; padding: 4px 12px; min-height: 44px; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; }
.tabs { display: flex; gap: 4px; margin-top: 8px; }
.tabs button { flex: 1; background: rgba(255,255,255,.12); color: #fff; min-height: 40px; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--brand); font-weight: 500; }

.tile-img { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 10px; color: #fff; font-weight: 500; font-size: 20px; background-size: cover; background-position: center; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button { display: flex; flex-direction: column; gap: 4px; padding: 6px; height: auto; background: var(--card); font-size: 13px; line-height: 1.2; box-shadow: 0 1px 2px rgba(27,31,28,.08); }
.quick button b { font-size: 14px; color: var(--brand); }

.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { min-width: 44px; padding: 0; font-size: 20px; }
.qty span { min-width: 28px; text-align: center; font-weight: 500; }
.unit-toggle { min-height: 32px; font-size: 13px; padding: 0 10px; background: var(--brand-soft); color: var(--brand); }

.paybar { position: sticky; bottom: 0; z-index: 4; background: var(--card); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + var(--safe-b)); }
.paybar .total { font-size: 26px; font-weight: 500; }
.big-change { font-size: 44px; font-weight: 500; color: var(--ok); text-align: center; }
.cash-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cash-btns button { min-height: 52px; font-weight: 500; }

.sheet-bg { position: fixed; inset: 0; z-index: 20; background: rgba(27,31,28,.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }
.sheet .actions { display: flex; gap: 8px; margin-top: 16px; }
.sheet .actions button { flex: 1; }
.qr { width: 240px; margin: 8px auto; }
.photo-prev { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; background: #e2e8f0; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); z-index: 30; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; max-width: 90vw; }
.toast.bad { background: var(--bad); }
.badge { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 13px; background: #e2e8f0; color: var(--ink); }
.badge.warn { background: #fef3c7; color: var(--warn); }
.badge.bad { background: #fee2e2; color: var(--bad); }
.badge.ok { background: #dcfce7; color: var(--ok); }
.list > * + * { border-top: 1px solid var(--line); }
.list > * { padding: 10px 0; }
.search-results { margin-top: 6px; }
.search-results button { width: 100%; display: flex; justify-content: space-between; background: #fff; border: 1px solid var(--line); margin-top: 4px; text-align: left; }
video.scanner { width: 100%; border-radius: 10px; background: #000; max-height: 50vh; object-fit: cover; }

/* ---------- round 2: category boxes (2 columns, thumb-sized) ---------- */
.scanrow { margin-bottom: 6px; }
.crumbs { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; flex-wrap: wrap; }
.crumbs nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-width: 0; }
.crumbs nav button { background: none; min-height: 40px; padding: 0 6px; color: var(--brand); font-weight: 500; }
.crumbs nav span { color: var(--muted); }
.crumbs .back { background: var(--brand); color: #fff; font-weight: 500; min-height: 48px; padding: 0 16px; }
.boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 700px) { .boxes { grid-template-columns: repeat(4, 1fr); } }
.boxes .sect { grid-column: 1 / -1; font-size: 15px; color: var(--muted); margin: 6px 0 -2px; }
.box { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 2px;
  min-height: 112px; padding: 12px; text-align: left; border-radius: 16px; background: var(--card); color: var(--ink);
  box-shadow: 0 1px 3px rgba(27,31,28,.10); overflow: hidden; line-height: 1.25; }
.box b { font-size: 17px; }
.box small { color: var(--muted); font-size: 13px; }
.box.cat { background: var(--c); color: #fff; }
.box.cat small { color: rgba(255,255,255,.9); }
.box.cat .ic { position: absolute; top: 10px; right: 12px; font-size: 22px; opacity: .85; }
.box.prod { border-left: 8px solid var(--c); }
.box.prod .price { font-size: 20px; font-weight: 500; color: var(--brand); }
.box.prod .ph { position: absolute; inset: 0 0 auto auto; width: 56px; height: 56px; border-radius: 0 0 0 12px; background-size: cover; background-position: center; }
.box .n { position: absolute; top: 8px; right: 8px; min-width: 30px; height: 30px; border-radius: 999px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 500; font-size: 15px; padding: 0 6px; }
.box.prod .ph ~ .n { right: 64px; }
.box.add { background: transparent; border: 2px dashed #7d8f8c; color: var(--muted); box-shadow: none; justify-content: center; align-items: center; text-align: center; font-weight: 500; min-height: 72px; }
.stockmode .box.prod { border-left-color: #b45309; }
.stockmode .topbar { background: #92400e; }

.paybar { display: flex; gap: 10px; align-items: stretch; }
.billbtn { flex: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; background: #f1f5f9; min-height: 60px; text-align: left; }
.billbtn b { font-size: 24px; }
.paybtn { min-height: 60px; min-width: 42%; font-size: 20px; }
.stockmode .paybtn { background: #b45309; }
.paytabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.paytabs button[aria-selected="true"] { background: var(--brand); color: #fff; font-weight: 500; }
.cash-btns .primary { grid-column: span 3; min-height: 56px; font-size: 18px; }
.qty input { width: 64px; text-align: center; min-height: 44px; padding: 4px; }
.sum { border-top: 2px solid var(--line); margin-top: 6px; padding-top: 8px; }
.receipt { font-size: 14px; line-height: 1.5; }
.receipt h3 { text-align: center; margin: 10px 0 2px; font-size: 16px; }
.receipt .lines, .receipt .buyer { border-top: 1px dashed #94a3b8; border-bottom: 1px dashed #94a3b8; padding: 6px 0; margin: 6px 0; }
.staff .paybar { position: fixed; left: 0; right: 0; bottom: 0; box-shadow: 0 -6px 16px rgba(27,31,28,.12); } /* เส้นขอบชัด: สินค้าที่เลื่อนลงไปใต้แถบบิลต้องเห็นว่าถูกบัง ไม่ใช่กดได้ */
.staff main { padding-bottom: calc(100px + var(--safe-b)) !important; }
/* product photo on top, name + price under it */
.box.prod.has-ph { padding: 0 0 10px; border-left: 0; justify-content: flex-start; }
.box.prod.has-ph .ph { position: static; display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0; margin-bottom: 6px; }
.box.prod.has-ph > b, .box.prod.has-ph > .price, .box.prod.has-ph > small { padding: 0 12px; }
.box.prod.has-ph .n { right: 8px; box-shadow: 0 0 0 3px #fff; }
.stockmode .box.prod.has-ph { outline: 3px solid #b45309; outline-offset: -3px; }

/* ---------- round 3: Claude Design (claude.ai/artifact/6K4eJZMowMpiVbuDaTKAQp) ---------- */
h1, h2, .box b, .box .price, .billbtn b, .paybtn, .big-change, .kpi b, .cash-btns button { font-family: "Prompt", "Sarabun", sans-serif; }
.topbar { padding: 14px 16px 12px; }
.topbar h1 { font-size: 20px; font-weight: 500; }
.topbar .sub { font-size: 14px; color: var(--brand-soft); }
#who { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 6px; background: var(--brand-deep); font-size: 15px; }
#who .av { width: 32px; height: 32px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); display: grid; place-items: center; font-weight: 500; }
.scanrow input { min-height: 52px; border-radius: 14px; border: 2px solid var(--brand); font-size: 17px; }
#cam { width: 52px; min-height: 52px; padding: 0; border-radius: 14px; background: var(--gold); color: var(--ink); display: grid; place-items: center; }
.crumbs .back { background: #e7e5e4; color: var(--ink); min-height: 44px; border-radius: 12px; }
.crumbs nav button { color: var(--muted); font-weight: 400; }
.crumbs nav button:last-child { color: var(--ink); font-weight: 500; }
.box { border-radius: 18px; }
.box.cat { background: #fff; color: var(--ink); border: 2px solid var(--c); justify-content: space-between; min-height: 104px; }
.box.cat .ic { position: static; color: var(--c); opacity: 1; }
.box.cat b { font-size: 19px; font-weight: 500; }
.box.cat small { color: var(--muted); }
.box.prod:not(.has-ph) { background: var(--c); color: #fff; border-left: 0; justify-content: space-between; min-height: 128px; }
.box.prod:not(.has-ph) .price { color: #fff; font-size: 24px; }
.box.prod:not(.has-ph) small { color: rgba(255,255,255,.92); }
.box.prod b { font-size: 18px; font-weight: 500; }
.box.prod.has-ph .price { font-size: 22px; }
.box .n { background: var(--gold); color: var(--ink); box-shadow: 0 0 0 3px #fff; }
.box.add { border-color: #a8a29e; border-radius: 18px; }
.stockmode .topbar { background: var(--brand); }
.stockmode .paybtn { background: var(--brand); }
.paybar { padding: 12px 16px calc(16px + var(--safe-b)); }
.billbtn { background: #f5f5f4; border-radius: 16px; min-height: 64px; }
.paybtn { min-height: 64px; flex: 1.2; border-radius: 16px; font-size: 22px; font-weight: 500; }
.paytabs { background: #e7e5e4; padding: 4px; border-radius: 14px; gap: 4px; }
.paytabs button { background: transparent; min-height: 48px; font-size: 17px; }
.paytabs button[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 500; }
.cash-btns { gap: 10px; }
.cash-btns button { min-height: 64px; border: 2px solid #d6d3d1; border-radius: 16px; background: #fff; font-size: 22px; font-weight: 500; }
.cash-btns .exact { background: var(--brand-soft); border-color: var(--brand); }
.change-panel { margin-top: 12px; padding: 14px; border-radius: 20px; background: var(--brand); color: #fff; text-align: center; font-weight: 500; }
.change-panel .big-change { color: #fff; font-size: 52px; line-height: 1.1; }
.change-panel.short { background: #fef3c7; color: #78350f; }
.change-panel.short .big-change { color: #78350f; }
.sheet .actions button { min-height: 56px; border-radius: 14px; }
.big-change { color: var(--brand); }
/* owner */
.owner .topbar { background: var(--ink); }
.owner .kpi { border-radius: 16px; }
.owner .kpi:first-child { background: var(--brand); color: #fff; }
.owner .kpi:first-child .muted { color: var(--brand-soft); }
.owner .card { border-radius: 18px; }
.paytotal { text-align: center; margin: 12px 0 8px; font-size: 34px; font-weight: 500; }

/* ร้านสังฆภัณฑ์: โทนจีวร (เหลือง-ส้ม) · ตัวขาวบน --brand ผ่าน 4.5:1 */
/* คู่มือ infographic ถ่ายจากร้านมินิมาร์ท ซ่อนไว้จนกว่าจะมีชุดของร้านนี้ */
:root[data-shop="sangkha"] .guide-link { display: none; }
:root[data-shop="sangkha"] { --brand: #b45309; --brand-soft: #fef3c7; --brand-deep: #78350f; --bg: #fbf6ec; --gold: #f59e0b; }

/* ลงยอดตอนว่าง: slot chips, same weight as the POS tabs */
.slots { display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.slots button { flex: 1; min-height: 44px; white-space: nowrap; padding: 0 6px; border: 0; border-radius: 12px; background: #f5f5f4; color: var(--ink); font-weight: 500; }
.slots button[aria-pressed="true"] { background: var(--brand); color: #fff; }

/* "? ถามน้องฝาง 24 ชม." on every page, round-3 gold */
.helpbtn { position: fixed; right: 12px; bottom: 96px; z-index: 10; min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px;
  border-radius: 22px; background: #fbbf24; color: #422006; font-weight: 500; text-decoration: none; box-shadow: 0 2px 8px rgba(27,31,28,.15); }
/* ---------- r4 (ห้อง Designer · plans/2026-10-31_fang-saas/design-r4) · tokens map onto the names every page already uses ---------- */

body { font-family: var(--font-body); font-size: 17px; line-height: 1.55; background: var(--ground); color: var(--ink); font-variant-numeric: tabular-nums; }
button, input, select { font-size: 17px; }
button { border-radius: var(--r-btn); background: #EFEBE1; color: var(--ink); }
button.primary { background: var(--brand); color: #fff; }
button.ghost { background: transparent; color: var(--brand); }
input, select { border-color: var(--line); border-radius: 12px; }
.muted, label { color: var(--muted); }
.card { border-radius: var(--r-card); box-shadow: var(--shadow); }
.topbar { background: var(--brand); }
.topbar .row { flex-wrap: nowrap; }
.topbar h1 { font-family: var(--font-head); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { background: rgba(255,255,255,.16); }
/* "ถามน้องฝาง" lives in the top bar now (common.js moves it): no more floating button over content */
.helpbtn { position: static; box-shadow: none; flex: none; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: var(--r-btn);
  background: var(--sun-400); color: var(--teal-900); font-size: 15px; font-weight: 500; }
.helpbtn svg { flex: none; }
@media (max-width: 420px) { .topbar .helpbtn span { display: none; } .topbar .helpbtn { padding: 0 10px; } }
/* product without a photo: a tinted box with the first syllable big, name and price under it (no fake pictures) */
.box.prod:not(.has-ph) { background: var(--card); color: var(--ink); padding: 0 0 10px; justify-content: flex-start; min-height: 0; border: 0; }
.box.prod .syl { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 6px; background: var(--tint);
  font-family: var(--font-head); font-size: 36px; font-weight: 500; color: var(--teal-900); line-height: 1; }
.box.prod:not(.has-ph) > b, .box.prod:not(.has-ph) > .price, .box.prod:not(.has-ph) > small { padding: 0 12px; }
.box.prod:not(.has-ph) b { font-family: var(--font-body); font-size: 16px; font-weight: 500; }
.box.prod:not(.has-ph) .price, .box.prod.has-ph .price { color: var(--teal-900); font-size: 20px; font-family: var(--font-head); }
.box.prod:not(.has-ph) small { color: var(--muted); }
.box .n { background: var(--sun-400); color: var(--teal-900); }
.paybtn, .primary { font-family: var(--font-head); }
/* status = icon + word + colour, never colour alone */
.st { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px; font-size: 15px; font-weight: 500; }
.st.wait { background: var(--sun-100); color: var(--sun-ink); }
.st.doing { background: var(--teal-100); color: var(--teal-900); }
.st.done { background: var(--ok-soft); color: #0F6B30; } /* 5.7:1 บนพื้นเขียวอ่อน (เดิม --ok ได้ 4.29:1) */
.st.off { background: var(--bad-soft); color: var(--bad); }
.ibar { display: flex; gap: 6px; flex: none; }
.ibtn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 52px; min-height: 52px; padding: 4px 6px;
  border-radius: var(--r-btn); background: rgba(255,255,255,.16); color: #fff; font-size: 14px; text-decoration: none; }
.logo { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.topbar .row > h1 { flex: 1; }
.topbar .row > .helpbtn { margin-left: auto; }
.tabs { gap: 6px; margin-top: 10px; }
.tabs button { background: #fff; color: var(--ink); min-height: 48px; font-weight: 500; border: 0; }
.tabs button[aria-selected="true"] { background: var(--teal-900); color: #fff; }
.topbar .ibar .helpbtn { flex-direction: column; justify-content: center; gap: 2px; min-width: 52px; min-height: 52px; padding: 4px 8px; font-size: 14px; }
.topbar .ibar .helpbtn span { display: inline; }
.topbar .sub { color: var(--teal-100); }
.nw { white-space: nowrap; }
.tabs button { font-size: 15px; padding: 2px 4px; line-height: 1.25; }
#cam { background: var(--teal-900); color: #fff; }
.crumbs nav button { min-height: 44px; }
/* น้องฝาง panel (common.js helpPanel) */
dialog.hp { border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; height: min(80vh, 640px); border-radius: 20px 20px 0 0;
  background: var(--ground); color: var(--ink); display: none; flex-direction: column; box-shadow: 0 -8px 30px rgba(27,31,28,.25); }
dialog.hp[open] { display: flex; }
dialog.hp::backdrop { background: rgba(27,31,28,.4); }
.hp header { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; background: var(--brand); color: #fff; font-family: var(--font-head); }
.hp .x { min-width: 44px; background: transparent; color: #fff; display: grid; place-items: center; padding: 0; }
.hp-chat { flex: 1; overflow: auto; display: grid; align-content: start; gap: 10px; padding: 14px 16px; }
.hp .msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; line-height: 1.5; }
.hp .msg.u { justify-self: end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.hp .msg.b { justify-self: start; background: #fff; border-bottom-left-radius: 4px; }
.hp .msg small { display: block; margin-top: 4px; }
.hp form { display: flex; gap: 8px; padding: 10px 16px calc(14px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); }
.hp form input { flex: 1; min-height: 48px; }
@media (min-width: 700px) {
  dialog.hp { margin: auto 24px 24px auto; width: 400px; height: min(620px, calc(100vh - 48px)); border-radius: 20px; }
}
.csvbtn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--r-btn); background: var(--teal-100); color: var(--teal-900); font-weight: 500; text-decoration: none; }
/* every page: logo in the top bar goes to the fangai.app front page */
.topbar .home, .hero .home { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: 10px; border-radius: 10px; background: #fff; }
.topbar .home img, .hero .home img { width: 30px; height: 30px; }
.topbar .home + h1, .topbar .home + div { flex: 1; min-width: 0; }
/* sales page header: the shop name keeps its full width; the icon buttons drop to their own line when the screen is narrow */
.topbar .sellhead { flex-wrap: wrap; row-gap: 8px; }
.topbar .sellhead .name { flex: 1 1 200px; min-width: 0; }
.topbar .sellhead .ibar { margin-left: auto; }

/* credit book row: a whole-row tap target, name left, amount right */
.debt { width: 100%; min-height: 48px; display: flex; gap: 8px; align-items: center; background: transparent; color: var(--ink); padding: 8px 0; text-align: left; border-radius: 0; border-top: 1px solid var(--line); }
.debt:first-child { border-top: 0; }
.debt b, #credit-hist b, #exp-list .badge { font-variant-numeric: tabular-nums; }
/* optional extras that must not cost a tap when unused (expiry/cost at receiving) */
details.opt { margin-top: 6px; }
details.opt summary { color: var(--muted); font-size: 14px; min-height: 44px; display: flex; align-items: center; cursor: pointer; }
details.opt .row { gap: 8px; flex-wrap: wrap; }
/* segmented day filter (owner: expiring) */
.seg { gap: 4px; }
.seg button { min-height: 44px; padding: 0 10px; background: var(--bg); color: var(--ink); border-radius: var(--r-btn); }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
/* unslop r19: debt amounts in one right column · empty-list notes don't pad the card · owner nav starts left */
.debt .grow { flex: 1; min-width: 0; }
.list > p { margin: 0; }
.topbar nav.row { justify-content: flex-start; }
.topbar .sellhead .name { flex: 1 1 0; }
.topbar .sellhead #who { margin: 0; flex: none; }
.topbar .sellhead .ibar { flex-basis: 100%; justify-content: flex-end; }

/* ---------- r20: Claude Design redesign (claude.ai/artifact/QF9Tt6g11ZbnerddPssb8x · กวางเลือก 12/11)
   paper #F4F3EF · ink #1B1F1C · one accent #C2410C · IBM Plex Sans Thai + Plex Mono for money · quiet chrome ---------- */
:root {
  --teal-900:#1B1F1C; --teal-700:#C2410C; --teal-100:#ECEAE4;
  --sun-400:#C2410C; --sun-100:#FBE9DF; --sun-ink:#9A3412;
  --ground:#F4F3EF; --card:#FFFFFF; --line:#E4E2DC; --muted:#5F655F;
  --bg:var(--ground); --ink:#1B1F1C; --brand:#C2410C; --brand-soft:#FBE9DF; --brand-deep:#1B1F1C; --gold:#C2410C;
  --font-head:"IBM Plex Sans Thai",sans-serif; --font-body:"IBM Plex Sans Thai",sans-serif; --font-mono:"IBM Plex Mono",ui-monospace,monospace;
  --r-card:12px; --r-btn:10px; --shadow:0 1px 2px rgba(27,31,28,.06),0 8px 24px rgba(27,31,28,.06); --hair:rgba(27,31,28,.08);
}
body { font-size: 16px; line-height: 1.5; }
button, input, select { font-size: 16px; }
button { background: #ECEAE4; }
input, select { border-color: var(--hair); border-radius: 10px; }
.card { box-shadow: none; border: 1px solid var(--hair); }
h1, h2, .paybtn, .primary { font-weight: 500; }
/* money and counts: mono, tabular */
.price, .billbtn b, #total, .paytotal, .big-change, .debt b, .qty span, .kpi b, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }
/* top bar: paper, not a coloured slab */
.topbar { background: var(--ground); color: var(--ink); border-bottom: 1px solid var(--hair); }
.owner .topbar, .stockmode .topbar { background: var(--ground); }
.topbar .sub { color: var(--muted); }
.topbar .home { background: #fff; border: 1px solid var(--hair); }
.chip, #who { background: #fff; color: var(--ink); border: 1px solid var(--hair); }
#who .av { background: var(--ink); color: #fff; }
.ibtn { background: #fff; color: var(--ink); border: 1px solid var(--hair); }
.tabs button { background: transparent; color: var(--muted); font-weight: 500; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--hair); }
.helpbtn, .topbar .ibar .helpbtn { background: #fff; color: var(--ink); border: 1px solid var(--hair); }
/* sell grid: white tiles, name then price, stock in muted text; colour only where it means something */
.scanrow input { border: 1px solid var(--hair); border-radius: 10px; min-height: 48px; }
#cam { background: var(--ink); color: #fff; border-radius: 10px; min-height: 48px; width: 48px; }
.box, .box.cat, .box.add { border-radius: 12px; box-shadow: none; }
.box.cat { border: 0; border-left: 4px solid var(--c); }
.box.cat .ic { color: var(--c); }
.box.prod .syl { background: var(--ground); color: var(--muted); font-size: 28px; aspect-ratio: 16 / 9; }
.box.prod:not(.has-ph) .price, .box.prod.has-ph .price { font-family: var(--font-mono); color: #4A504B; font-size: 16px; }
.box .n { background: var(--brand); color: #fff; box-shadow: none; font-family: var(--font-mono); font-weight: 500; }
.box.add { border: 1px dashed rgba(27,31,28,.25); }
.crumbs .back { background: #fff; border: 1px solid var(--hair); }
/* pay bar and sheets */
.paybar { border-top: 1px solid var(--hair); }
.billbtn { background: var(--ground); border-radius: 12px; }
.paybtn { border-radius: 12px; font-size: 18px; }
.paytabs { background: var(--ground); border-radius: 12px; }
.cash-btns button { border: 1px solid rgba(27,31,28,.16); border-radius: 12px; font-family: var(--font-mono); font-weight: 500; }
.cash-btns .exact { background: var(--brand-soft); border-color: var(--brand); }
.change-panel { background: var(--ink); border-radius: 12px; }
.change-panel.short { background: var(--sun-100); color: var(--sun-ink); }
.change-panel.short .big-change { color: var(--sun-ink); }
.receipt .lines, .receipt .buyer, .sum { border-color: rgba(27,31,28,.25); border-style: dashed; border-width: 1px 0 0; }
.owner .kpi:first-child { background: var(--ink); }
.owner .kpi:first-child .muted { color: #D9D6CF; }
.st.doing { background: #ECEAE4; color: var(--ink); }
.csvbtn { background: #fff; border: 1px solid var(--hair); color: var(--ink); }
.seg button { background: #fff; border: 1px solid var(--hair); }
.seg button[aria-pressed="true"], .slots button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.slots { background: var(--ground); border-bottom: 1px solid var(--hair); }
.slots button { background: #fff; border: 1px solid var(--hair); }
.hp header { background: var(--ink); }
.hp .msg.u { background: var(--ink); }
dialog.hp::backdrop, .sheet-bg { background: rgba(27,31,28,.45); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* desktop sell (>=1100px): the top bar becomes a left rail, the bill sits open on the right like a receipt */
.billside { display: none; }
@media (min-width: 1100px) {
  body.staff { padding-left: 232px; padding-right: 424px; }
  body.staff .topbar { position: fixed; left: 0; top: 0; bottom: 0; width: 232px; padding: 20px 12px; display: flex; flex-direction: column; gap: 16px; border-bottom: 0; border-right: 1px solid var(--hair); overflow-y: auto; }
  body.staff .topbar .sellhead { flex-direction: column; align-items: stretch; gap: 10px; }
  body.staff .topbar .sellhead .home { margin: 0; }
  body.staff .topbar .sellhead .name { flex: none; }
  body.staff .topbar .sellhead .ibar { flex-basis: auto; justify-content: flex-start; flex-wrap: wrap; }
  body.staff .tabs { flex-direction: column; margin: 0; gap: 2px; }
  body.staff .tabs button { flex: none; justify-content: flex-start; text-align: left; min-height: 40px; padding: 0 12px; font-size: 15px; }
  body.staff .tabs button .nw + .nw { margin-left: 4px; }
  body.staff main.wrap { max-width: none; padding: 20px 24px !important; }
  body.staff .boxes { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  body.staff .billside { display: flex; flex-direction: column; position: fixed; top: 20px; right: 24px; bottom: 132px; width: 400px; background: #fff; border-radius: 4px; box-shadow: var(--shadow); }
  body.staff .billside header { display: flex; justify-content: space-between; align-items: baseline; padding: 20px 24px 12px; border-bottom: 1px dashed rgba(27,31,28,.25); margin: 0 0 4px; }
  body.staff .billside header h2 { margin: 0; font-size: 17px; }
  body.staff .billside .lines { flex: 1; overflow-y: auto; padding: 4px 24px; }
  body.staff .billside .sl { display: flex; align-items: center; gap: 10px; min-height: 52px; border-bottom: 1px solid rgba(27,31,28,.06); }
  body.staff .billside .sl .nm { flex: 1; min-width: 0; font-size: 15px; line-height: 1.35; }
  body.staff .billside .sl .qty button { min-width: 32px; min-height: 32px; font-size: 16px; border-radius: 8px; background: var(--ground); }
  body.staff .billside .sl .amt { font-family: var(--font-mono); min-width: 76px; text-align: right; }
  body.staff .billside .empty { color: var(--muted); padding: 24px 0; }
  body.staff .billside footer { border-top: 1px dashed rgba(27,31,28,.25); padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; }
  body.staff .paybar { left: auto; right: 24px; bottom: 20px; width: 400px; border: 0; border-radius: 0 0 4px 4px; background: #fff; box-shadow: var(--shadow); padding: 16px 24px; }
  body.staff .paybar .billbtn { display: none; }
  body.staff .paybar .paybtn { min-height: 64px; font-size: 18px; }
  body.staff main { padding-bottom: 32px !important; }
  body.staff .helpbtn { align-self: flex-start; }
}
/* r20b: plain tiles like the design (name on top, price at the foot), no syllable block; bill and pay button read as one receipt */
.box.prod .syl { display: none; }
.box.prod:not(.has-ph) { padding: 12px; justify-content: space-between; min-height: 96px; gap: 8px; }
.box.prod:not(.has-ph) > b, .box.prod:not(.has-ph) > .price, .box.prod:not(.has-ph) > small { padding: 0; }
.box.prod:not(.has-ph) > b { padding-right: 28px; line-height: 1.35; }
.box.prod:not(.has-ph) > small:empty { display: none; }
@media (min-width: 1100px) {
  body.staff .boxes { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
  body.staff .box.prod:not(.has-ph) { min-height: 112px; }
  body.staff .billside { bottom: 116px; border-radius: 4px 4px 0 0; box-shadow: 0 1px 2px rgba(27,31,28,.06); }
  body.staff .paybar { box-shadow: 0 8px 24px rgba(27,31,28,.06); padding-top: 0; }
  body.staff .billside footer { padding-bottom: 16px; }
}
/* r20c: cards keep a 12px gap now that they have hairlines instead of shadows; owner nav lines up with the content column */
main > * + .card, main > .card + * { margin-top: 12px; }
.owner .topbar nav { max-width: 1100px; margin: 10px auto 0 !important; padding: 0 16px; }
.owner .kpi { border: 1px solid var(--hair); }
.owner .kpi:first-child { border-color: var(--ink); }

/* ---------- r21: member card + owner desktop (Claude Design Member-Mobile / Owner-Desktop) ---------- */
/* member: the code is a torn ticket, points and what's owed under it, then the last bills */
.mtick { background: #fff; border-radius: 4px 4px 0 0; box-shadow: var(--shadow); margin-bottom: 26px; }
.mtick .tear { display: block; width: 100%; height: 10px; margin-bottom: -10px; }
.mtick-top { padding: 20px; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; border-bottom: 1px dashed rgba(27,31,28,.25); margin: 0 20px; padding-left: 0; padding-right: 0; }
.mcode { font: 500 40px/1.2 var(--font-mono); font-variant-numeric: tabular-nums; }
.mqr summary { font-size: 14px; color: var(--muted); cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.mqr .qr { max-width: 200px; margin: 8px auto 0; }
.mtick-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 16px 20px 20px; }
.mtick-stats > div { display: flex; flex-direction: column; gap: 4px; }
.mtick-stats b { font-size: 24px; font-weight: 500; }
.mtick-stats b small { font: 400 14px var(--font-body); }
.mtick-stats .acc { color: var(--brand); }
.mtick-stats small.muted { font-size: 13px; }
.msec { font-size: 15px; font-weight: 500; margin: 0 0 8px; }
.mlist { background: #fff; border-radius: 12px; }
.mrow { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(27,31,28,.06); }
.mrow:last-child { border-bottom: 0; }
.mrow > div { display: flex; flex-direction: column; gap: 2px; }
.mrow .r { align-items: flex-end; }
.mrow small { font-size: 13px; }
.mempty { padding: 16px; margin: 0; }
.mopt { display: flex !important; gap: 12px; align-items: center; background: #fff; border-radius: 12px; padding: 12px 16px; min-height: 44px; margin: 16px 0; color: #4A504B; font-size: 14px; }
.mopt input { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); flex: none; }
.mfoot { font-size: 13px; color: var(--muted); line-height: 1.5; }
.mfoot p { margin: 0 0 6px; }
.mfoot a, .linkbtn { color: #4A504B; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 0; min-height: 0; text-decoration: underline; cursor: pointer; font-family: inherit; }

/* owner: stat cards read as numbers, today's sales carries the accent */
.owner .kpi:first-child { background: #fff; border-color: var(--hair); }
.owner .kpi:first-child .muted { color: var(--muted); }
.owner .kpi:first-child b { color: var(--brand); }
.owner .kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; }
.owner .kpi b { font-size: 26px; }
.owner .kpi small { font-size: 13px; color: var(--muted); }
/* weekly profit: one bar per week, this week in the accent */
.wkchart { display: flex; align-items: flex-end; gap: 16px; height: 200px; border-bottom: 1px solid rgba(27,31,28,.12); padding: 0 4px; margin: 4px 0 8px; }
.wkchart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.wkchart .bar span { font: 400 13px var(--font-mono); color: var(--muted); white-space: nowrap; }
.wkchart .bar i { display: block; width: 100%; max-width: 72px; background: #D9D7D0; border-radius: 6px 6px 0 0; min-height: 2px; }
.wkchart .bar.now span { color: var(--brand); }
.wkchart .bar.now i { background: var(--brand); }
.wkchart .bar.neg span { color: var(--bad); }
.wkchart.empty { height: auto !important; align-items: center; border-bottom: 0; padding: 20px 4px; }
.wkchart.empty p { margin: 0; }
.cols > * { align-self: start; }
.wklabels { display: flex; gap: 16px; padding: 0 4px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.wklabels span { flex: 1; text-align: center; min-width: 0; }
.wklabels span:last-child { color: var(--ink); }
.pl-detail summary { cursor: pointer; color: #4A504B; font-size: 14px; min-height: 40px; display: flex; align-items: center; }
.lowt td, .lowt th { padding: 10px 6px; }
.lowt .warnn { color: var(--brand); }
.owner .nl { display: none; }
.owner section[id], .owner .card[id] { scroll-margin-top: 16px; }
@media (min-width: 1100px) {
  body.owner { padding-left: 240px; }
  body.owner .topbar { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; padding: 20px 12px; border-bottom: 0; border-right: 1px solid var(--hair); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
  body.owner .topbar > .wrap { flex-direction: column; align-items: flex-start !important; gap: 10px; padding: 0 12px !important; }
  body.owner .topbar h1 { font-size: 16px; }
  body.owner .topbar nav { flex-direction: column; flex-wrap: nowrap !important; gap: 2px !important; align-items: stretch !important; margin: 0 !important; align-self: stretch; width: 100%; padding: 0; max-width: none; }
  body.owner .topbar nav a { min-height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: #4A504B; font-size: 15px; text-decoration: none !important; }
  body.owner .topbar nav a:hover { background: #fff; color: var(--ink); }
  body.owner .topbar nav a.on { background: #fff; color: var(--ink); font-weight: 500; }
  body.owner .topbar nav .nl { display: flex; }
  body.owner .topbar nav .nl b { font: 400 13px var(--font-mono); color: var(--brand); }
  body.owner .topbar nav a[href="staff"] { order: 99; margin-top: 16px; min-height: 44px; justify-content: center; background: var(--brand); color: #fff; border-radius: 10px; font-weight: 500; }
  body.owner main.wrap { max-width: 1360px; padding: 24px 32px 40px !important; margin: 0; }
  body.owner .kpis { gap: 12px; }
  body.owner .cols { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }
  body.owner .cols #pl { grid-column: 1; grid-row: span 2; }
  body.owner .cols #expiring, body.owner .cols #lowsec { grid-column: 2; }
  body.owner .cols .span2 { grid-column: 1 / -1; }
  body.owner .wkchart { height: 240px; gap: 24px; }
  body.owner .wklabels { gap: 24px; }
}

/* unslop r22: disabled = neutral, not a faded accent · stock below zero reads as a problem · headings 500 */
button:disabled, button.primary:disabled, .paybtn:disabled { opacity: 1; background: #ECEAE4; color: var(--muted); border-color: transparent; cursor: default; }
.box small.neg { color: var(--bad); }
h1, h2, .paybtn, .primary { font-weight: 500; }
.box b, .box.prod b, .box.cat b { font-weight: 500; }

/* unslop r23 (กวาง 13/11): header icons sit on the name row · bills list quiet · a closed bill needs no extra tap */
@media (max-width: 1099px) {
  .topbar .sellhead { flex-wrap: wrap; row-gap: 8px; }
  .topbar .sellhead .ibar { flex-basis: auto; margin-left: auto; gap: 4px; }
}
.ibtn, .topbar .ibar .helpbtn { flex-direction: row; gap: 6px; min-width: 0; min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.ibtn svg, .topbar .ibar .helpbtn svg { width: 18px; height: 18px; }
.topbar #who { border-radius: 10px; min-height: 40px; }
#bills .bl .row { min-height: 32px; }
button.mini { min-height: 32px; padding: 0 12px; font-size: 14px; background: transparent; border: 1px solid var(--hair); color: var(--ink); border-radius: 8px; }
button.mini.bad { color: var(--bad); }
#bills .off { color: var(--muted); }
#bills .off .amt { text-decoration: line-through; }
.debt small { font-size: 13px; font-weight: 400; }
.billbtn.last #total { color: var(--brand); font-size: 28px; }
.topbar .ibar .helpbtn { font-weight: 400; }
.ask label { margin-top: 0; font-size: 16px; color: var(--ink); }
.ask-msg { margin: 0 0 16px; font-size: 16px; line-height: 1.6; }
.mem-pick { display: flex; flex-direction: column; border: 1px solid var(--hair); border-radius: 10px; margin: -4px 0 8px; overflow: hidden; }
.mem-pick button { display: flex; align-items: center; justify-content: space-between; min-height: 44px; border-radius: 0; background: #fff; padding: 0 12px; font-size: 16px; }
.mem-pick button + button { border-top: 1px solid var(--hair); }
.mem-pick button:hover { background: var(--ground); }
.mem-pick p { margin: 0; padding: 10px 12px; }
.cash-btns .exact.on { background: var(--brand); color: #fff; border-color: var(--brand); }
@media (min-width: 1100px) { body.staff .billside { bottom: 100px; } } /* sits on the pay bar (20 + 80) — no gap */
/* photo upload: one tappable card instead of the browser's "Choose File" (Kwang 13/11) */
.upl { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; padding: 12px; min-height: 72px; border: 1px dashed rgba(27,31,28,.25); border-radius: 12px; background: var(--ground); color: var(--ink); cursor: pointer; }
.upl:hover { background: #ECEAE4; }
.upl:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.upl input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upl .upl-ic { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 10px; background: #fff; color: var(--muted); border: 1px solid var(--hair); }
.upl .photo-prev { width: 64px; height: 64px; border-radius: 10px; flex: none; object-fit: cover; }
.upl .photo-prev:not([src]) { display: none; }
.upl .photo-prev[src] + .upl-ic { display: none; }
.upl .upl-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.upl .upl-t b { font-weight: 500; font-size: 16px; }
.upl .upl-t small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.upl:has(.photo-prev[src]) { border-style: solid; border-color: var(--hair); background: #fff; }
.nohelp .helpbtn, .nohelp [data-help] { display: none !important; }
/* r25 owner per Stitch: icons, shop block, top bar with bell + avatar, quick purchase order */
.ms { font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-feature-settings: "liga"; font-feature-settings: "liga"; -webkit-font-smoothing: antialiased; overflow: hidden; width: 1em; flex: none; }
.ni { display: inline-flex; align-items: center; gap: 10px; }
.sb-shop, .sb-me { display: none; }
.obar { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.obar-t { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.obar-t b { font-weight: 500; font-size: 17px; }
.obar-t span, .obar-up { color: var(--muted); font-size: 14px; }
.obar-a { display: flex; align-items: center; gap: 8px; }
.bell { position: relative; min-width: 44px; padding: 0; background: transparent; color: var(--ink); border-radius: 999px; display: inline-grid; place-items: center; }
.bell:hover { background: #fff; }
.bell i { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font: 500 11px/18px var(--font-mono); font-style: normal; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--brand); color: #fff; display: inline-grid; place-items: center; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.bell-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(320px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; }
.bell-pop a { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; }
.bell-pop a:hover { background: var(--bg); }
.bell-pop a .ms { color: var(--brand); }
.bell-pop p { margin: 10px; }
.kpi .kh { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi .kh .ms { color: var(--muted); }
.kpi.acc b, .kpi.acc .kh .ms { color: var(--brand); }
.kpi.owe b, .kpi.owe .kh .ms { color: var(--bad); }
.rc-ic { width: 40px; height: 40px; border-radius: 8px; background: var(--bg); color: var(--muted); display: inline-grid; place-items: center; font-size: 22px; }
.po-btn { margin-top: 12px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
dialog.po { border: 0; border-radius: 16px; padding: 18px; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--ink); background: var(--card); }
dialog.po::backdrop { background: rgba(27,31,28,.4); }
.po-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.po-h h2 { margin: 0; }
.po-row { display: grid; grid-template-columns: 1fr 88px; gap: 10px; align-items: center; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--hair); color: var(--ink); font-size: 15px; }
.po-row input { text-align: right; font-family: var(--font-mono); }
.po-prev { white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 10px 12px; font: 14px/1.5 var(--font-body); margin: 12px 0; }
@media (min-width: 900px) {
  body.owner .topbar h1 { display: none; }
  body.owner .sb-shop { display: grid; gap: 2px; }
  body.owner .sb-shop b { font-size: 17px; font-weight: 500; }
  body.owner .sb-shop span { color: var(--muted); font-size: 13px; }
  body.owner .sb-shop .sb-open { justify-self: start; margin-top: 4px; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
  body.owner .topbar nav a.nl .ms { color: inherit; }
  body.owner .topbar nav a[href="staff"] .ni { gap: 8px; }
  body.owner .sb-me { display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 10px 12px; background: #fff; border: 1px solid var(--hair); border-radius: 10px; align-self: stretch; }
  body.owner .sb-me[hidden] { display: none; }
  body.owner .sb-me img { width: 36px; height: 36px; border-radius: 999px; object-fit: cover; }
  body.owner .sb-me b { display: block; font-weight: 500; font-size: 15px; }
  body.owner .sb-me small { color: var(--muted); font-size: 12px; }
}
.po-h .ghost { min-width: 44px; padding: 0; display: inline-grid; place-items: center; color: var(--muted); }
@media (max-width: 899px) { body.owner .obar-t b, body.owner .obar-up { display: none; } }

/* ---------- r26: phase C — promos and coupon on the pay sheet, own payment channels, owner promo/adjust/history screens, printable receipt ---------- */
.paytabs.n4 button { font-size: 15px; padding: 0 4px; }
.disc { margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.disc .row { padding: 2px 0; font-size: 15px; }
.disc-box { margin: 0 0 8px; }
.disc-box summary { min-height: 44px; display: flex; align-items: center; color: var(--brand); cursor: pointer; }
.disc-row { display: flex; gap: 8px; margin-bottom: 8px; }
.disc-row input { flex: 1; min-width: 0; }
.disc-row button { flex: none; }
.chan-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 4px; }
.chan-btns button { min-height: 52px; background: #fff; border: 1px solid var(--hair); }
.chan-btns button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.bl .mini.rcp { min-height: 44px; }
/* owner back-office screens */
.pr-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 0; border-top: 1px solid var(--hair); align-items: center; }
.pr-row b { font-weight: 500; }
.pr-row .pr-a { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pr-row .pr-a button, .hist-more, .adj-btn { min-height: 44px; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 10px; }
.hist-f { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; }
.hist-row { padding: 12px 0; border-top: 1px solid var(--hair); }
.hist-row .hl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hist-row .hl b { font-variant-numeric: tabular-nums; }
.hist-row details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--brand); }
.adj-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--hair); }
.adj-row .d { font: 500 16px var(--font-mono); font-variant-numeric: tabular-nums; }
.chan-set { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chan-set span { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--hair); border-radius: 999px; padding: 0 4px 0 14px; min-height: 44px; }
.chan-set span button { min-width: 44px; background: transparent; color: var(--bad); }
.logo-prev { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--hair); border-radius: 10px; background: #fff; }
/* printable receipt (opened from the sales page and the bill history) */
.rcpt-page { background: #E9E6DE; }
.rcpt-bar { display: flex; gap: 8px; justify-content: center; padding: 12px 16px; }
.rcpt-bar button { min-width: 140px; }
.rcpt { width: min(100%, 380px); margin: 0 auto 32px; background: #fff; color: #111; padding: 20px 18px 24px; box-shadow: var(--shadow); font-size: 15px; line-height: 1.4; }
.rcpt h1 { font-size: 19px; text-align: center; margin: 6px 0 2px; }
.rcpt .rl { display: block; max-width: 96px; max-height: 96px; margin: 0 auto; object-fit: contain; }
.rcpt .rc { text-align: center; font-size: 13px; color: #333; margin: 2px 0; }
.rcpt .rt { text-align: center; font-weight: 500; margin: 8px 0 4px; }
.rcpt .rvoid { text-align: center; font-weight: 500; border: 2px solid #111; padding: 6px; margin: 8px 0; }
.rcpt .rline { border-top: 1px dashed #777; margin-top: 8px; padding-top: 8px; }
.rcpt .rr { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; font-variant-numeric: tabular-nums; }
.rcpt .rr span:first-child { min-width: 0; overflow-wrap: anywhere; }
.rcpt .rtot { font-weight: 500; font-size: 17px; }
.rcpt .rfoot { text-align: center; white-space: pre-line; margin: 14px 0 4px; font-size: 14px; }
.rcpt .rmap { margin-top: 12px; text-align: center; }
.rcpt .rmap .qr { width: 96px; margin: 0 auto 2px; }
@media print {
  @page { margin: 4mm; }
  .rcpt-bar { display: none; }
  .rcpt-page { background: #fff; }
  .rcpt { width: 72mm; max-width: none; margin: 0; padding: 0; box-shadow: none; font-size: 12px; }
}

/* customer display (จอลูกค้า): big numbers for a screen across the counter · dark ink on light ground, no letter-spacing, no uppercase */
.cdisp { background: #fff; min-height: 100vh; }
.cd { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); min-height: 100vh; }
.cd[hidden] { display: none; }
.cd-l { padding: 28px 32px; display: flex; flex-direction: column; gap: 16px; }
.cd-brand { display: flex; align-items: center; gap: 14px; }
.cd-brand h1 { font-size: clamp(24px, 3vw, 40px); font-weight: 500; }
.cd-brand img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; }
.cd-idle { flex: 1; display: flex; align-items: center; justify-content: center; font-size: clamp(32px, 5vw, 64px); font-weight: 500; color: var(--brand); text-align: center; }
.cd-lines { display: flex; flex-direction: column; }
.cd-lines .ln { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: clamp(20px, 2.4vw, 32px); }
.cd-lines .nm { min-width: 0; overflow-wrap: anywhere; }
.cd-lines .q { color: var(--muted); font-size: .72em; white-space: nowrap; }
.cd-lines .am { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.cd-lines .off { color: var(--ok); }
.cd-r { background: var(--brand-soft); padding: 28px 24px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; text-align: center; }
.cd-label { font-size: clamp(18px, 2vw, 26px); color: var(--ink); }
.cd-total b { font: 500 clamp(56px, 9vw, 128px)/1 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.cd-total span { font-size: clamp(20px, 2.4vw, 32px); }
.cd-sum { font-size: clamp(16px, 1.6vw, 22px); color: #0f4f49; }
.cd-qr { width: min(80%, 340px); background: #fff; padding: 12px; border-radius: 16px; }
.cd-qr svg { display: block; width: 100%; height: auto; }
.cd-hint { font-size: clamp(20px, 2.4vw, 30px); font-weight: 500; }
.cd-fs { position: fixed; right: 12px; top: 12px; z-index: 3; min-height: 40px; background: #fff; border: 1px solid var(--line); }
.cd-pair { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--ground); }
.cd-pair .card { width: min(100%, 420px); }
@media (max-width: 800px) { .cd { grid-template-columns: 1fr; } .cd-r { padding: 20px 16px; } }
.pair-code { font: 600 40px var(--font-mono); text-align: center; background: var(--brand-soft); border-radius: 12px; padding: 10px; margin: 8px 0; color: var(--ink); }

/* category share on the owner page: one row per category, bar = share of the period's sales */
.shr { padding: 10px 0; border-top: 1px solid var(--hair, var(--line)); }
.shr-h { display: flex; justify-content: space-between; gap: 12px; }
.shr-h b { font-variant-numeric: tabular-nums; }
.shr-bar { height: 10px; border-radius: 999px; background: var(--brand-soft); margin: 6px 0 4px; overflow: hidden; }
.shr-bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* ---- phase E: restaurant floor (tables.html), option groups, service charge ---- */
.tbl-zone { margin: 14px 0 6px; font-size: 15px; color: var(--muted); font-weight: 500; }
.tbl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.tbl { min-height: 96px; padding: 10px 12px; border-radius: 14px; border: 2px solid #94a3b8; background: #fff; color: var(--ink); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 2px; text-align: left; }
.tbl b { font-size: 22px; font-variant-numeric: tabular-nums; }
.tbl .tw { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; }
.tbl small { font-size: 13px; color: var(--muted); }
.tbl.busy { background: var(--sun-100); border-color: #b45309; }
.tbl.busy .tw { color: var(--sun-ink); }
.tbl.billing { background: var(--ok-soft); border-color: var(--ok); }
.tbl.billing .tw { color: var(--ok); }
.tbl.free .tw { color: var(--muted); }
.bl-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.bl-line .bl-m { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.bl-line.void b, .bl-line.void .bl-amt { text-decoration: line-through; color: var(--muted); }
.bl-line .bl-a { grid-column: 1 / -1; display: flex; gap: 8px; }
.bl-line .bl-a button { min-height: 40px; font-size: 14px; }
.bl-sum { border-top: 2px solid var(--line); padding-top: 8px; margin-top: 4px; display: grid; gap: 4px; }
.bl-sum .row { justify-content: space-between; }
.bl-sum .bl-tot { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bl-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.bl-acts .wide { grid-column: 1 / -1; }
.bl-acts button { padding: 0 6px; }
.mod-grp { margin: 10px 0 0; padding: 0; border: 0; }
.mod-grp legend { font-weight: 500; padding: 0; margin-bottom: 4px; }
.mod-opt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; color: var(--ink); font-size: 16px; margin: 0; }
.mod-opt input { width: 22px; height: 22px; min-height: 0; flex: none; }
.mod-opt .grow { flex: 1; }
.mod-ed { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 8px; display: grid; gap: 6px; }
.mod-ed .mo { display: grid; grid-template-columns: 1fr 96px auto; gap: 6px; }
.tb-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }

/* ---------- r29: phase F — RawBT print bar on the receipt, recipe + theme + production on the owner/staff pages ---------- */
.rcpt-bar.rawbt { flex-wrap: wrap; align-items: center; padding-top: 0; }
.rcpt-bar.rawbt button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rb-drawer { display: inline-flex; align-items: center; gap: 8px; margin: 0; min-height: 44px; color: var(--ink); font-size: 15px; }
.rb-drawer input { width: 22px; min-height: 0; height: 22px; accent-color: var(--brand); }
@media print { .rcpt-bar.rawbt { display: none !important; } }
.theme-set { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; margin-top: 10px; }
.swatch { display: flex; align-items: center; gap: 10px; justify-content: flex-start; background: var(--card); border: 2px solid var(--line); color: var(--ink); text-align: left; }
.swatch i { width: 24px; height: 24px; border-radius: 50%; background: var(--sw); flex: none; }
.swatch[aria-pressed="true"] { border-color: var(--ink); font-weight: 500; }

/* r30 (13/11): phase D–E added จอลูกค้า + โต๊ะ to the sales header · on a phone the row takes its own line and wraps (no sideways scroll at 390px) */
@media (max-width: 599px) {
  .topbar .sellhead .ibar { flex-basis: 100%; flex-wrap: wrap; justify-content: flex-start; margin-left: 0; }
}

/* one pattern for a wrong field (fieldErr in common.js) */
.ferr { color: var(--bad); font-size: 15px; margin: 4px 0 0; }
[aria-invalid=true] { border-color: var(--bad) !important; box-shadow: 0 0 0 1px var(--bad); }
.lastbill { display: grid; gap: 2px; padding: 12px; margin: 8px 0; border-radius: 12px; background: var(--ok-soft); color: var(--ink); }
.lastbill b { font-size: 32px; font-family: var(--font-mono); }
.mem-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--ok-soft); color: var(--ink); font-weight: 500; padding: 4px 4px 4px 10px; border-radius: 999px; }
.mem-chip button { min-height: 32px; min-width: 32px; padding: 0; border-radius: 999px; }
.mem-miss { color: var(--bad); font-weight: 500; }

/* back office below 1100 px: the section links as one scrollable strip, the header scrolls away so a jumped-to heading is not hidden under it */
@media (max-width: 1099px) {
  body.owner .topbar { position: static; }
  body.owner .topbar nav { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; max-width: 100%; }
  body.owner .topbar nav > * { flex: 0 0 auto; }
  .owner .nl { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid var(--hair); color: var(--ink); text-decoration: none; white-space: nowrap; }
}
.cal .up b { color: #166534; }
.keyhint { font-size: 14px; margin: 6px 0 0; }
@media (max-width: 699px) { .keyhint { display: none; } }

/* ---- polish (unslop 16/11): one type family, quiet chrome, the totals carry the weight ---- */
h1, h2, h3, .box b, .paybtn, .primary { font-family: var(--font-head); }
#total, .paytotal, .big-change, .lastbill b { font-weight: 600; }
/* keyboard shortcuts as keycaps: the counter is run from the keyboard */
kbd { font: 500 13px/1 var(--font-mono); color: var(--ink); background: var(--card, #FBFBF8); border: 1px solid rgba(27,31,28,.18); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; margin-right: 4px; }
.keyhint { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
/* counter nav: quiet, the scan box and the bill come first */
body.staff .topbar .sellhead .ibtn { background: transparent; border-color: transparent; color: var(--muted, #5B615C); min-height: 44px; font-size: 14px; }
body.staff .topbar .sellhead .ibtn:hover { background: rgba(27,31,28,.06); color: var(--ink); }
/* exact-amount button: one line, its own row under the notes */
.cash-btns .exact { grid-column: 1 / -1; font-family: var(--font-head); font-size: 20px; white-space: nowrap; min-height: 52px; }
.cash-btns [data-exact] { font-family: var(--font-head); }
@media (max-width: 760px) { .keyhint { display: none; } } /* phones have no F-keys (ux-exam 16/11 H8-1) */
