@font-face { font-family: 'Google Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/GoogleSans-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Google Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/GoogleSans-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Google Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/GoogleSans-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Google Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/GoogleSans-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Kanit'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/Kanit-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Kanit'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/Kanit-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Kanit'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/Kanit-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Kanit'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/Kanit-Bold.ttf') format('truetype'); }
:root {
  --primary: #D9480F; --primary-dark: #9A3412; --primary-bright: #F0652F;
  --tint: #FFE8DD; --tint-2: #FFD6C4; --ground: #FFF8F2; --surface: #FFFFFF;
  --ink: #17201C; --muted: #5B6B66; --faint: #8A9490; --line: #F1DACB; --line-soft: #F7EEE6;
  --ok: #15803D; --ok-dark: #166534; --ok-tint: #DCFCE7;
  --warn: #A16207; --warn-tint: #FEF9C3; --warn-dark: #854D0E;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Google Sans', 'Kanit', system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--ground); min-height: 100vh; font-size: 16px; line-height: 1.45; }
a { color: var(--primary); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

.page { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--ground); }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line-soft); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 10px; }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; display: flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; }
.icon-btn.soft { background: var(--ground); }
.main { flex: 1; padding: 14px 16px 120px; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; }
.bottom-inner { max-width: 480px; margin: 0 auto; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; padding: 0 18px; border-radius: var(--radius); border: 0; font-size: 17px; font-weight: 700; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:disabled { background: #E8B9A3; cursor: not-allowed; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost { background: transparent; color: var(--muted); height: 44px; font-weight: 500; }
.btn-block { width: 100%; }
.btn-split { justify-content: space-between; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.pill-ok { color: var(--ok-dark); background: var(--ok-tint); }
.pill-warn { color: var(--warn-dark); background: var(--warn-tint); }
.pill-primary { color: var(--primary-dark); background: var(--tint); }
.pill-hot { color: #B91C1C; background: #FEE2E2; }

.card { background: var(--surface); border-radius: 16px; padding: 14px; }
.card + .card { margin-top: 12px; }
.card h2 { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .faint { color: var(--faint); }
.price { font-weight: 700; font-size: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 6px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13.5px; color: var(--muted); }
.field input, .field textarea { height: 48px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface); }
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 15px; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.chip:disabled { color: var(--faint); background: var(--ground); border-color: var(--line-soft); cursor: not-allowed; }

/* tabs */
.tabs { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line-soft); position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 4; }
.main section:last-child { min-height: 70vh; } /* ให้หมวดสุดท้ายเลื่อนขึ้นถึงแถบได้ */
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 44px; padding: 0 0 6px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: 16px; white-space: nowrap; }
.tab.on { color: var(--primary); border-color: var(--primary); font-weight: 700; }

/* menu */
.featured { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; margin-bottom: 18px; }
.fcard .thumb { aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; position: relative; background: #F3E6DD; border: 0; padding: 0; width: 100%; cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .badge { position: absolute; top: 8px; left: 8px; }
.thumb .zoom { position: absolute; bottom: 8px; right: 8px; width: 26px; height: 26px; border-radius: 999px; background: rgba(23,32,28,.6); color: #fff; display: flex; align-items: center; justify-content: center; }
.fcard .name { margin-top: 6px; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add { width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--primary); color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.add.qty { background: var(--tint); color: var(--primary); border: 1.5px solid var(--primary); font-size: 14px; }
.section-title { margin: 14px 0 4px; font-size: 19px; font-weight: 700; }
.lrow { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); position: relative; }
.lrow .thumb { width: 104px; height: 104px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: #F3E6DD; border: 0; padding: 0; position: relative; cursor: zoom-in; }
.lrow .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lrow .body a { font-size: 18px !important; line-height: 1.3; }
.lrow .add { position: absolute; right: 0; bottom: 10px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 50; display: flex; flex-direction: column; color: #fff; }
.lightbox .head { display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top)) 16px 0; }
.lightbox .body { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; touch-action: pinch-zoom; }
.lightbox .body img { width: 100%; max-height: 80vh; object-fit: contain; }
.lightbox .foot { padding: 0 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.lightbox .icon-btn { background: rgba(255,255,255,.15); color: #fff; }

/* item page */
.hero { height: 290px; background: #F3E6DD; position: relative; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .back { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 16px; background: #fff; }
.hero .zoom { position: absolute; bottom: 12px; right: 12px; width: 32px; height: 32px; border-radius: 999px; background: rgba(23,32,28,.6); color: #fff; display: flex; align-items: center; justify-content: center; border: 0; }
.opt-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; height: 52px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--line-soft); background: var(--surface); text-align: left; }
.opt:last-child { border-bottom: 0; }
.opt .box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid #D8B9A8; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.opt .box.radio { border-radius: 999px; }
.opt.on .box { background: var(--primary); border-color: var(--primary); color: #fff; }
.opt .lbl { flex: 1; font-size: 16px; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--ground); border-radius: 999px; padding: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 999px; border: 0; font-size: 20px; font-weight: 700; background: var(--surface); color: var(--primary); }
.stepper button.plus { background: var(--primary); color: #fff; }
.stepper span { min-width: 28px; text-align: center; font-weight: 700; }

/* cart */
.cline { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.cline:last-child { border-bottom: 0; }
.cline .qtybox { width: 26px; height: 26px; border-radius: 8px; background: var(--tint); color: var(--primary); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; }
.tile.on { border-color: var(--primary); background: var(--tint); color: var(--primary-dark); }
.tile b { font-size: 16px; } .tile small { font-size: 13px; opacity: .85; }
.round { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 58px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; }
.round.on { border-color: var(--primary); background: var(--tint); color: var(--primary-dark); }
.round:disabled { color: var(--faint); background: var(--ground); border-color: var(--line-soft); cursor: not-allowed; }
.round .l { display: flex; flex-direction: column; gap: 2px; } .round b { font-size: 16px; } .round small { font-size: 13px; opacity: .85; }
.error { background: #FEE2E2; color: #991B1B; border-radius: 12px; padding: 10px 14px; font-size: 15px; }

/* pay */
.qr-wrap { width: 232px; height: 232px; padding: 10px; background: #fff; border: 1.5px solid var(--line-soft); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.qr-wrap canvas, .qr-wrap img { width: 210px !important; height: 210px !important; }
.amount { font-size: 36px; font-weight: 700; line-height: 1.1; }
.dots { display: flex; gap: 4px; padding: 0 4px; } .dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--primary); animation: pulse 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .3s } .dots span:nth-child(3) { animation-delay: .6s }
@keyframes pulse { 0%,100% { opacity: .3 } 50% { opacity: 1 } }

/* status */
.hero-ok { background: var(--primary-bright); color: #fff; padding: calc(56px + env(safe-area-inset-top)) 24px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.hero-ok .check { width: 72px; height: 72px; border-radius: 999px; background: #fff; color: var(--ok); display: flex; align-items: center; justify-content: center; }
.sheet { background: var(--ground); border-radius: 28px 28px 0 0; margin-top: -16px; padding: 24px 16px 40px; flex: 1; }
.big-no { font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.tl { display: flex; align-items: center; gap: 10px; } .tl + .tl { margin-top: 12px; }
.tl .dot { width: 24px; height: 24px; border-radius: 999px; border: 2px solid var(--line); background: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.tl.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl.now .dot { border-color: var(--primary); } .tl.now { color: var(--primary); font-weight: 600; }
.tl .t { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }

/* merchant */
.m-page { min-height: 100vh; display: flex; background: var(--ground); }
.m-nav { width: 88px; background: var(--ink); color: #fff; display: flex; flex-direction: column; align-items: center; padding: 16px 0; gap: 8px; flex-shrink: 0; }
.m-nav .logo { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 8px; }
.m-nav button { width: 64px; height: 56px; border-radius: 12px; border: 0; background: transparent; color: #A7B3AF; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; }
.m-nav button.on { background: #2A3531; color: #fff; }
.m-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-head { height: 72px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 14px; }
.stat { padding: 8px 14px; border-radius: 12px; background: var(--ground); display: flex; flex-direction: column; min-width: 110px; } .stat small { font-size: 11px; color: var(--muted); } .stat b { font-size: 16px; }
.stat.warn { background: var(--warn-tint); } .stat.warn * { color: var(--warn-dark); }
.cols { flex: 1; padding: 16px 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; overflow: auto; }
.col h2 { margin: 0 0 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.col h2 .n { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #E6ECEA; }
.col h2 .n.hot { background: var(--primary); color: #fff; }
.ocard { background: var(--surface); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ocard.new { border: 1.5px solid var(--primary); }
.ocard.pend { border: 1.5px dashed #CA8A04; background: #FEFCE8; }
.ocard .no { font-size: 26px; font-weight: 700; }
.ocard .lines { font-size: 16px; color: #3C4A46; line-height: 1.5; white-space: pre-line; }
.ocard .act { white-space: nowrap; height: 48px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--primary); color: #fff; font-size: 16px; font-weight: 600; margin-left: auto; }
.ocard .act.outline { background: var(--surface); color: var(--primary); border: 1.5px solid var(--primary); }
.ocard .act.dark { background: var(--ink); }
.ocard .act.ghost { background: transparent; color: var(--muted); margin-left: 0; }
.ocard > .row:last-child { flex-wrap: wrap; }
@media (max-width: 900px) { .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .m-nav { display: none; } }
@media (max-width: 560px) { .cols { grid-template-columns: 1fr; } .m-head { flex-wrap: wrap; height: auto; padding: 12px; } }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.mobile-tabs { display: none; }
@media (max-width: 900px) { .mobile-tabs { display: flex; } }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--surface); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi small { font-size: 13px; color: var(--muted); } .kpi b { font-size: 28px; line-height: 1.15; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 18px; }
.bar-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; position: relative; }
.bar { width: 100%; max-width: 44px; background: var(--tint-2); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar.hot { background: var(--primary); }
.bar-col:hover .bar { background: var(--primary); }
.bar-val { font-size: 11px; color: var(--muted); height: 14px; white-space: nowrap; }
.bar-lbl { font-size: 11px; color: var(--muted); white-space: nowrap; }
.toplist { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.toplist li { display: flex; gap: 8px; align-items: baseline; } .toplist li span:first-child { flex: 1; }
.track { flex: 1; height: 10px; background: var(--line-soft); border-radius: 999px; overflow: hidden; } .fill { height: 100%; background: var(--primary); border-radius: 999px; }
/* ร้าน: ตัวหนังสือใหญ่ขึ้น */
.m-page { font-size: 16px; }
.m-head { height: 84px; } .m-head b { font-size: 22px; } .stat b { font-size: 22px; } .stat small { font-size: 13px; }
.col h2 { font-size: 18px; }
.ocard .small { font-size: 15px; }
.ocard { padding: 16px; gap: 10px; border-radius: 16px; }
.ocard .pill { font-size: 13px; padding: 4px 10px; }
.col h2 .n { font-size: 14px; padding: 3px 10px; }

/* POS */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pos-item { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 0 0 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; overflow: hidden; }
.pos-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #F3E6DD; }
.pos-item .n { padding: 6px 10px 0; font-size: 16px; font-weight: 600; line-height: 1.25; }
.pos-item .p { padding: 0 10px; font-size: 15px; color: var(--primary); font-weight: 700; }
.pos-item:active { border-color: var(--primary); background: var(--tint); }
.pos-item.off { opacity: .45; }
.pos-cart { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 110px); }
@media (max-width: 900px) { .pos { grid-template-columns: 1fr; } .pos-cart { position: static; max-height: none; } }

/* ---- modal (หน้าต่างแก้ไข) ให้พอดีจอมือถือ ---- */
.modal-card { width: 100%; max-width: 560px; max-height: calc(100vh - 24px); overflow: auto; box-sizing: border-box; }
.modal-card input, .modal-card select, .modal-card textarea { min-width: 0; max-width: 100%; }
.modal-card .grid-2 > * { min-width: 0; }
.modal-card .row.wrap { flex-wrap: wrap; }
.modal-card .row.wrap > .stack:last-child { flex: 1 1 220px; }
/* ---- ร้านบนมือถือ ---- */
@media (max-width: 900px) {
  .m-head { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .m-head > .row { margin-left: 0 !important; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .m-head .stat { min-width: 120px; flex-shrink: 0; }
  .mobile-tabs { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line-soft); padding: 10px 16px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .mobile-tabs .chip { flex-shrink: 0; }
  #view-admin { padding: 12px 16px 100px !important; }
  .cols { padding: 12px 16px 100px; }
}
.pos-bar { display: none; }
@media (max-width: 900px) {
  .pos-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); border-top: 1px solid var(--line-soft); }
}

/* กันช่องกรอกดันหน้าจอให้กว้างเกิน (มือถือ) */
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .modal-card input:not([type=checkbox]):not([type=radio]):not([type=file]), .modal-card select { width: 100%; box-sizing: border-box; }
.pos > *, .pos-cart > *, .grid-2 > * { min-width: 0; }

/* ขายพ่วงตอนเช็กเอาต์ */
.upsell-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.upsell-card { flex: 0 0 128px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 0 0 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; overflow: hidden; }
.upsell-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #F3E6DD; }
.upsell-card .n { padding: 6px 10px 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upsell-card .p { padding: 0 10px; font-size: 15px; font-weight: 700; color: var(--primary); }
.upsell-card:active { border-color: var(--primary); background: var(--tint); }

/* วัตถุดิบ */
.ing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ing { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid #86EFAC; background: var(--ok-tint); color: var(--ok-dark); text-align: left; min-height: 72px; }
.ing b { font-size: 16px; } .ing span { font-size: 13px; font-weight: 600; } .ing small { font-size: 11.5px; opacity: .8; line-height: 1.35; }
.ing.out { border-color: #FCA5A5; background: #FEE2E2; color: #991B1B; }
.m-head #ingCtl, .m-head #busyCtl { flex-shrink: 0; }

/* สิทธิ์: ซ่อนของเจ้าของในหน้าพนักงาน (เซิร์ฟเวอร์ก็ล็อกไว้อีกชั้น) */
body.role-staff [data-owner] { display: none !important; }
body:not(.role-staff) [data-staff] { display: none !important; }

/* toast */
.toast-box { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 9999; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { pointer-events: auto; background: #1F2421; color: #fff; padding: 14px 18px; border-radius: 14px; font-size: 17px; line-height: 1.4; box-shadow: 0 10px 30px rgba(0,0,0,.25); border-left: 5px solid #EF4444; cursor: pointer; }
.pin-in::placeholder { letter-spacing: 0; font-size: 18px; }

/* ===== v2: หน้าแรก ===== */
.home { background: var(--surface); }
.home-hero { height: 200px; background: var(--primary-bright) url(/img/storefront.svg) center 85% / cover no-repeat; }
.home-card { position: relative; margin-top: -20px; background: var(--surface); border-radius: 22px 22px 0 0; padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; flex: 1; }
.home-card h1 { margin: 0; font-size: 28px; line-height: 1.15; }
.home-card #tagline { margin: -6px 0 0; font-size: 16px; }
.home-status { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.home-status .sep { color: var(--faint); }
.dot-live { width: 10px; height: 10px; border-radius: 999px; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-tint); flex-shrink: 0; }
.dot-live.off { background: #DC2626; box-shadow: 0 0 0 4px #FEE2E2; }
.home-mode { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 10px 12px; border-radius: 12px; background: var(--ground); }
.home-mode #modeIcon { color: var(--primary); display: flex; flex-shrink: 0; }
.home-card #startBtn { margin-top: 4px; }
.home-card #reorder { display: flex; align-items: center; gap: 12px; justify-content: space-between; border: 1.5px solid var(--line); margin: 0; }
.home-card #reorder.hidden { display: none; }
.home-card #reorder .btn { height: 44px; font-size: 15px; flex-shrink: 0; }
.home-steps { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.home-foot { text-align: center; margin-top: auto; }

/* ===== v2: เมนู ===== */
.cart-ic { position: relative; display: flex; } .cart-ic svg { width: 22px; height: 22px; }
.cart-n { position: absolute; top: -8px; right: -10px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #fff; color: var(--primary); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.featured { gap: 16px 12px; }
.fcard .name { margin-top: 8px; }
.thumb .badge { top: 6px; left: 6px; }

/* ===== v2: หน้ารายการ ===== */
.hero { height: 240px; }
.seg { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); background: var(--ground); border-radius: 14px; padding: 4px; gap: 4px; }
.seg .chip { height: 48px; padding: 0 2px; border: 0; border-radius: 10px; background: transparent; font-size: 15px; line-height: 1.15; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.seg .chip.on { background: var(--primary); color: #fff; box-shadow: 0 2px 6px rgba(217,72,15,.25); }
.seg .chip small { font-size: 11px; }
@media (max-width: 360px) { .seg { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.opt { height: 50px; }

/* ===== v2: ตะกร้า ===== */
.cart-main { display: flex; flex-direction: column; gap: 12px; padding-bottom: 110px; }
.cart-main .card + .card { margin-top: 0; }
.card h2 { font-size: 17px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.h2-sub { font-size: 13px; font-weight: 400; color: var(--muted); }
.sub-block { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.sub-lbl { font-size: 15px; font-weight: 600; }
.slot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slot-grid .chip { padding: 0 4px; height: 46px; font-size: 16px; }
.slot-grid .chip.asap { grid-column: 1 / -1; }
.more-btn { height: 40px; border: 0; background: transparent; color: var(--primary); font-weight: 600; font-size: 15px; align-self: flex-start; padding: 0 2px; }
.cline .qtybox { width: auto; min-width: 30px; padding: 0 6px; height: 28px; font-size: 14px; }
.qty-ctl { display: flex; gap: 6px; }
.qty-ctl button { width: 40px; height: 40px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 20px; font-weight: 700; color: var(--primary); display: flex; align-items: center; justify-content: center; }
.sum-box { display: flex; flex-direction: column; gap: 4px; padding: 2px 4px; font-size: 15px; color: var(--muted); }
.promo-hint { color: var(--primary-dark); font-weight: 600; }
.upsell-card { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 12px; }
.upsell-card img { width: 52px; height: 52px; border-radius: 9px; }
.upsell-card .t { display: flex; flex-direction: column; }
.upsell-card .n, .upsell-card .p { padding: 0; }
.upsell-card .n { font-size: 15px; }

/* ===== v2: หน้าร้าน ===== */
.m-nav { gap: 4px; padding: 14px 0; }
.m-nav button, .m-nav .nav-a { width: 72px; height: 58px; border-radius: 12px; border: 0; background: transparent; color: #A7B3AF; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12.5px; text-decoration: none; line-height: 1.15; }
.m-nav button.on { background: #2A3531; color: #fff; }
.m-nav button.on svg { color: var(--primary-bright); }
.m-nav button:hover, .m-nav .nav-a:hover { color: #fff; }
@media (min-width: 901px) { .m-head { height: 76px; } }
.m-head b#shop { font-size: 19px; }
.stat { min-width: 96px; padding: 8px 14px; }
.ocard .oc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ocard .oc-who { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 15px; color: var(--muted); margin-top: -4px; }
.ocard .oc-who b { color: var(--ink); }
.ocard .oc-foot { gap: 8px; flex-wrap: wrap; } .ocard .oc-foot b { font-size: 17px; }
.ocard .lines { padding: 8px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }

/* ===== v2: ตั้งค่า (หัวข้อพับได้) ===== */
.set { padding: 0; }
.set > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; padding: 16px 44px 16px 16px; position: relative; min-height: 60px; }
.set > summary::-webkit-details-marker { display: none; }
.set > summary::after { content: ''; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .15s; }
.set[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.set > summary b { font-size: 17px; }
.set > summary span { font-size: 14px; color: var(--muted); }
.set > summary span.on { color: var(--ok-dark); font-weight: 600; }
.set > :not(summary) { margin: 0 16px; }
.set > :last-child { margin-bottom: 16px; }
.set[open] > summary { border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; }
.set h2 { font-size: 16px; }
.switch-row { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 12px !important; }
.switch-row input { width: 22px; height: 22px; }
.save-bar { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--ground) 70%, transparent); }
.save-bar .btn { min-width: 220px; }
.link-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.link-rows > div { display: flex; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--ground); font-size: 14px; }
.link-rows b { word-break: break-all; }

/* ===== v3: เช็คเอาต์ ===== */
.big-input { width: 100%; height: 58px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 16px; font-size: 22px; letter-spacing: .04em; background: var(--surface); font-variant-numeric: tabular-nums; }
.big-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; }
.pick .radio { width: 22px; height: 22px; border-radius: 999px; border: 2px solid #D8B9A8; flex-shrink: 0; }
.pick.on { border-color: var(--primary); background: var(--tint); }
.pick.on .radio { border: 7px solid var(--primary); }
.pick .l { display: flex; flex-direction: column; gap: 1px; } .pick b { font-size: 16px; } .pick small { font-size: 13.5px; color: var(--muted); }

/* ===== v3: ขายคู่ ===== */
.upsell-inline { display: flex; align-items: center; gap: 10px; }
.upsell-inline .sub-lbl { flex-shrink: 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.upsell-inline .upsell-row { margin: 0; padding: 0; flex: 1; }
.pair-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 8; width: min(calc(100% - 24px), 456px); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 8px; border-radius: 16px; background: var(--ink); color: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.25); overflow: hidden; animation: pairIn .25s ease-out; }
.pair-bar.out { opacity: 0; transform: translate(-50%, 12px); transition: .25s; }
.pair-bar img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #F3E6DD; }
.pair-bar .t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .pair-bar .t b { font-size: 16px; } .pair-bar .t span { font-size: 14px; color: #FFD6C4; }
.pair-add { height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--primary-bright); color: #fff; font-size: 16px; font-weight: 700; }
.pair-x { width: 36px; height: 36px; border: 0; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; display: flex; align-items: center; justify-content: center; }
.pair-x svg { width: 16px; height: 16px; }
.pair-timer { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--primary-bright); animation: pairT 6s linear forwards; }
@keyframes pairIn { from { opacity: 0; transform: translate(-50%, 16px); } }
@keyframes pairT { from { width: 100%; } to { width: 0; } }

/* ===== v3: โทนหน้าร้าน — สว่าง เรียบ ใช้ส้มเฉพาะจุดสำคัญ ===== */
.m-page, body:has(.m-page:not(.hidden)) { --ground: #F5F4F1; --line: #E3E0DA; --line-soft: #EDEBE7; }
body:has(.m-page:not(.hidden)) { background: #F5F4F1; }
.m-nav { background: var(--surface); color: var(--ink); border-right: 1px solid var(--line-soft); }
.m-nav button, .m-nav .nav-a { color: var(--muted); }
.m-nav button:hover, .m-nav .nav-a:hover { color: var(--ink); background: var(--ground); }
.m-nav button.on { background: var(--tint); color: var(--primary-dark); font-weight: 600; }
.m-nav button.on svg { color: var(--primary); }
.m-nav #whoBadge { color: var(--muted) !important; }
.m-head { border-bottom: 1px solid var(--line-soft); }
.m-page .stat { background: var(--ground); }
.m-page .stat.warn { background: var(--warn-tint); }
.m-page .chip.on { background: var(--tint); border-color: var(--primary); color: var(--primary-dark); }
.m-page .seg { background: var(--ground); }
.m-page .seg .chip.on { background: var(--surface); color: var(--primary-dark); border: 1.5px solid var(--primary); box-shadow: none; }
.m-page .col h2 .n { background: #E7E5E0; }
.m-page .ocard { border: 1px solid var(--line-soft); }
.m-page .ocard.new { border: 1.5px solid var(--primary); }
.m-page .card { border: 1px solid var(--line-soft); }
.m-page .field input, .m-page .field textarea, .m-page select { border-color: var(--line); }
.m-page .col h2 .n.hot { background: var(--primary); color: #fff; }

/* ===== v3: หัวหน้าร้าน — ปุ่มรับออเดอร์ + สถานะร้าน ===== */
.head-pos { height: 44px; padding: 0 18px; font-size: 16px; flex-shrink: 0; }
.state-seg { display: flex; background: var(--ground); border-radius: 12px; padding: 3px; gap: 2px; flex-shrink: 0; }
.state-seg button { height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap; }
.state-seg button small { font-weight: 500; font-size: 12px; }
.state-seg [data-s=normal].on { background: var(--ok-tint); color: var(--ok-dark); box-shadow: inset 0 0 0 1.5px #86EFAC; }
.state-seg [data-s=busy].on { background: var(--warn-tint); color: var(--warn-dark); box-shadow: inset 0 0 0 1.5px #FDE68A; }
.state-seg [data-s=pause].on { background: #FEE2E2; color: #991B1B; box-shadow: inset 0 0 0 1.5px #FCA5A5; }
.state-closed { height: 44px; font-weight: 600; background: #FEE2E2 !important; color: #991B1B !important; border-color: #FCA5A5 !important; }
@media (max-width: 900px) { .head-pos { display: none; } }
.q-lbl { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink) !important; font-size: 15px !important; }
.q-lbl i { font-style: normal; width: 22px; height: 22px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pos-cart .slot-grid .chip { height: 42px; font-size: 15px; }
#posMoreSlot { border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--surface); font-size: 15px; }
#posMoreSlot.on { border-color: var(--primary); color: var(--primary-dark); background: var(--tint); }
.pos-cart input { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 16px; width: 100%; min-width: 0; }
.head-pos.btn-outline { border-color: var(--line); }

/* ===== v3: การ์ดออเดอร์ — เน้นวิธีรับ + เวลา ===== */
.ocard .oc-top { flex-wrap: wrap; justify-content: flex-start; }
.ftag { font-size: 18px; font-weight: 700; padding: 6px 12px; border-radius: 10px; line-height: 1.2; }
.ft-here { background: #EDE9FE; color: #5B21B6; }
.ft-now { background: var(--tint); color: var(--primary-dark); }
.ft-pick { background: #FEF3C7; color: #92400E; }
.ft-del { background: #CCFBF1; color: #115E59; }
.due { font-size: 14px; font-weight: 600; color: var(--muted); }
.due.late { color: #B91C1C; }
.ocard .lines { font-size: 17px; color: var(--ink); }
.ocard .oc-foot { align-items: baseline; }
.qno { font-size: 15px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--ground); letter-spacing: .02em; }

/* ===== v3: ตัวเลือกรับอาหารแบบขยายแผง ===== */
.pick-wrap { border-radius: 12px; }
.pick-wrap.on { background: var(--tint); box-shadow: inset 0 0 0 1.5px var(--primary); }
.pick-wrap.on .pick { border-color: transparent; background: transparent; }
.pick-panel { padding: 0 14px 14px 48px; }
.pick-panel:empty, .pick-wrap:not(.on) .pick-panel { display: none; }
.pick-panel .sub-block { margin-top: 2px; }
.pick-panel .sub-block + .sub-block { margin-top: 12px; }
.pick-panel .slot-grid .chip:not(.on), .pick-panel .chip:not(.on), .pick-panel .round:not(.on) { background: var(--surface); }
@media (max-width: 380px) { .pick-panel { padding-left: 14px; } }
.slot-more { grid-column: 1 / -1; height: 46px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 16px; font-size: 16px; color: var(--ink); }
.slot-more.on { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 600; }
.ocard .oc-foot .pill { margin-left: auto; }

/* ===== v4: ชื่อ/เบอร์ จำเป็นเฉพาะนัดรับ/ส่ง ===== */
input.bad { border-color: #DC2626 !important; background: #FEF2F2 !important; outline-color: #DC2626 !important; }
.need-msg { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #FEE2E2; color: #991B1B; font-size: 14px; font-weight: 600; }

/* ===== v4: การ์ดออเดอร์ — รายการอาหารอ่านง่าย + คิวนัดรับ ===== */
.olines { list-style: none; margin: 0; padding: 4px 0 !important; display: flex; flex-direction: column; white-space: normal !important; }
.olines li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.olines li:last-child { border-bottom: 0; }
.olines .lq { min-width: 34px; height: 34px; padding: 0 6px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 19px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.olines .ld { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 3px; }
.olines .ld b { font-size: 19px; line-height: 1.25; }
.olines .ld small { font-size: 15px; color: var(--muted); line-height: 1.35; }
.olines .ld small.lw { color: #B45309; font-weight: 600; }
.olines li.lx { font-size: 14px; color: var(--muted); padding: 6px 0; }
.ocard .lines.olines { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.q-head { margin-top: 18px !important; }
.q-note { margin: -4px 0 10px; }
.ocard.queued { background: #FFFCF5; border: 1.5px dashed #E0B04A; }
.ocard.queued .olines .lq { background: #8A7F6A; }

/* ===== v5: ลูกค้า ===== */
.dot-live { animation: liveGlow 1.8s ease-in-out infinite; }
.dot-live.off { animation: none; }
@keyframes liveGlow { 0%, 100% { box-shadow: 0 0 0 3px rgba(22,163,74,.25), 0 0 6px 1px rgba(22,163,74,.45); } 50% { box-shadow: 0 0 0 7px rgba(22,163,74,.10), 0 0 14px 4px rgba(22,163,74,.55); } }
#openState { color: var(--ok); }
.dot-live.off + #openState { color: #DC2626; }
.reorder { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 14px; border-radius: 12px; background: var(--ground); }
.reorder .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reorder .t b { font-size: 15px; } .reorder .t span { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reorder button { height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--primary); background: var(--surface); color: var(--primary); font-weight: 700; font-size: 15px; flex-shrink: 0; }
.fcard .thumb, .lrow .thumb { cursor: pointer; }

/* ===== v5: เช็คเอาต์ ===== */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-grid.two { grid-template-columns: 1fr 1fr; }
.mode-opt { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 600; text-align: left; color: var(--ink); }
.mode-opt.wide { grid-column: 1 / -1; }
.mode-opt .m-sub { font-weight: 400; color: var(--muted); font-size: 14px; }
.mode-opt .radio, .round .radio { width: 22px; height: 22px; border-radius: 999px; border: 2px solid #CBBFB7; flex-shrink: 0; background: var(--surface); }
.mode-opt.on { border-color: var(--ink); }
.mode-opt.on .radio, .round.on .radio { border: 7px solid var(--ink); }
.mode-panel { margin-top: 4px; }
.mode-panel.hidden { display: none; }
.round.on { background: var(--surface); border-color: var(--ink); color: var(--ink); }
.req { color: #DC2626; font-weight: 700; }
#contact .field label { font-size: 14px; color: var(--ink); font-weight: 600; }
#contact .field label .faint { font-weight: 400; }
#contact input { height: 50px; font-size: 18px; }
.loc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.loc-btn { height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink); }
#addr { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 16px; resize: vertical; background: var(--surface); }
textarea.bad { border-color: #DC2626 !important; background: #FEF2F2 !important; }
.cl-edit { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.cl-edit b { font-size: 16px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.sum-box { align-items: flex-end; padding: 0 4px; }
.sum-tbl { display: grid; grid-template-columns: auto auto; gap: 3px 18px; margin: 0; font-size: 14px; color: var(--muted); min-width: 200px; }
.sum-tbl dt { text-align: left; } .sum-tbl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sum-tbl .neg { color: var(--ok-dark); }
.sum-tbl .tot { color: var(--ink); font-weight: 700; font-size: 15px; padding-top: 4px; border-top: 1px solid var(--line); }
.promo-hint { font-size: 13.5px; }
.sum-tbl { column-gap: 0; } .sum-tbl dd { padding-left: 24px; }

/* ===== หน้ารายละเอียด: ปุ่มกลับลอยตลอด + ชื่อโผล่เมื่อหัวข้อเลื่อนพ้น (แบบ large-title collapse) ===== */
.hero .back { display: none; }
.item-bar { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 9; width: 100%; max-width: 480px; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); background: transparent; border-bottom: 1px solid transparent; transition: background-color .18s, border-color .18s; pointer-events: none; }
.item-bar .icon-btn { pointer-events: auto; background: #fff; box-shadow: 0 2px 8px rgba(23,32,28,.12); transition: box-shadow .18s; }
.item-bar b { flex: 1; min-width: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.item-bar.on { background: var(--surface); border-bottom-color: var(--line-soft); pointer-events: auto; }
.item-bar.on .icon-btn { box-shadow: none; }
.item-bar.on b { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .item-bar, .item-bar b, .item-bar .icon-btn { transition: none; } }

/* ===== v6: เช็คเอาต์ — เบอร์/แต้ม/สรุปยอด ===== */
#contact input#phone { height: 54px; font-size: 20px; letter-spacing: .03em; }
.pts { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #FFF6DA; color: #6B4E00; }
.pts-ic { width: 30px; height: 30px; border-radius: 999px; background: #F5B301; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.pts-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pts-t b { font-size: 15px; } .pts-t span { font-size: 13.5px; opacity: .85; }
.pts-use { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1.5px solid #F5B301; font-weight: 700; font-size: 14px; flex-shrink: 0; cursor: pointer; }
.pts-use input { width: 18px; height: 18px; accent-color: #B98500; }
.pts.hidden, .pts-use.hidden { display: none; }
.sum-card { padding: 12px 16px; }
.sum-card .sum-tbl { display: grid; grid-template-columns: 1fr auto; gap: 6px 0; width: 100%; min-width: 0; font-size: 15px; color: var(--muted); }
.sum-card .sum-tbl dd { padding-left: 16px; }
.sum-card .sum-tbl .tot { color: var(--ink); font-size: 17px; font-weight: 700; padding-top: 8px; margin-top: 2px; border-top: 1px dashed var(--line); }
.sum-card .promo-hint { margin-bottom: 8px; padding: 8px 10px; border-radius: 10px; background: var(--tint); color: var(--primary-dark); }
#payBtn #grand { font-size: 19px; }

/* ===== v6: หน้าสถานะ ===== */
.line-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: #E9F9EF; border: 1.5px solid #9BE3B5; }
.line-card.hidden { display: none; }
.line-ic { width: 40px; height: 40px; border-radius: 12px; background: #06C755; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; } .lc-t b { font-size: 16px; color: #0B5D2A; } .lc-t span { font-size: 13.5px; color: #2F6B45; line-height: 1.35; }
.line-btn { height: 42px; padding: 0 16px; border-radius: 999px; background: #06C755; color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; text-decoration: none; flex-shrink: 0; cursor: pointer; }
.line-btn.hidden { display: none; }
.tl-l { font-size: 15px; }
.tl.done .tl-l { font-weight: 600; }
.tl.now .tl-l { font-weight: 700; color: var(--ink); }
.tl.now .dot { border: 0; }
.tl.now.wait .dot { background: #F5B301; animation: blinkY 1.2s ease-in-out infinite; }
.tl.now.cook .dot { background: var(--primary-bright); animation: blinkO 1.2s ease-in-out infinite; }
.tl.now.ok .dot { background: var(--ok); }
@keyframes blinkY { 0%, 100% { box-shadow: 0 0 0 0 rgba(245,179,1,.6); opacity: 1; } 50% { box-shadow: 0 0 0 7px rgba(245,179,1,0); opacity: .55; } }
@keyframes blinkO { 0%, 100% { box-shadow: 0 0 0 0 rgba(240,101,47,.6); opacity: 1; } 50% { box-shadow: 0 0 0 7px rgba(240,101,47,0); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .tl.now .dot { animation: none; } }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.contact-row .btn { height: 50px; font-size: 15px; }
.contact-row .btn.hidden { display: none; }
.contact-row:has(.hidden) { grid-template-columns: 1fr; }

/* ===== แจ้งโอน (แนบสลิป) ===== */
.sheet-wrap { background: rgba(23,32,28,.55) !important; justify-content: flex-end; align-items: center; }
.sheet-card { width: 100%; max-width: 480px; background: var(--surface); color: var(--ink); border-radius: 22px 22px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; max-height: 92vh; overflow: auto; }
.slip-pick { display: flex; align-items: center; justify-content: center; min-height: 150px; border: 2px dashed var(--line); border-radius: 14px; background: var(--ground); text-align: center; color: var(--muted); font-weight: 600; cursor: pointer; overflow: hidden; }
.slip-pick small { font-weight: 400; }
.slip-pick img { max-height: 46vh; width: auto; max-width: 100%; display: block; }
.slip-note { height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 16px; }
.slip-th { display: block; width: 84px; height: 112px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: zoom-in; }
.slip-open { padding: 0; border: 0; background: none; } .olines li.lx:has(.slip-open) { align-items: center; gap: 10px; display: flex; }
.sheet-card .icon-btn { background: var(--ground) !important; color: var(--ink) !important; }

/* ===== v7: เมนูร้าน 4 อย่าง + แท็บย่อย ===== */
.m-nav .nav-sep { flex: 1; }
.m-nav .nav-mini { height: 44px; font-size: 11.5px; }
.subnav { display: flex; gap: 4px; padding: 10px 20px 0; background: var(--ground); overflow-x: auto; scrollbar-width: none; }
.subnav.hidden { display: none; }
.subnav button { height: 42px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font-size: 16px; font-weight: 600; white-space: nowrap; }
.subnav button.on { color: var(--ink); border-bottom-color: var(--primary); }
.subnav + #view-admin { padding-top: 14px !important; border-top: 1px solid var(--line); }
.out-btn { height: 44px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.out-btn.has { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }
.out-n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #DC2626; color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 900px) { .subnav { padding: 8px 16px 0; } }
/* เมนู (ตั้งค่า): แถวกะทัดรัด */
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.mrow img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #F3E6DD; }
.mrow-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mrow-t b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow-t span { font-size: 14px; color: var(--muted); } .mrow-t em { font-style: normal; color: #991B1B; }
.mrow.off img { filter: grayscale(1); opacity: .6; }
.mrow .chip { height: 38px; flex-shrink: 0; }
.sold-sw { height: 38px; min-width: 78px; padding: 0 12px; border-radius: 999px; border: 1.5px solid #86EFAC; background: var(--ok-tint); color: var(--ok-dark); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.sold-sw.out { border-color: #FCA5A5; background: #FEE2E2; color: #991B1B; }
.admin-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 8px; }

/* ===== v8: หน้ารับออเดอร์ — กล่องเงิน (เงินทอนเด่นสุด) + ตัวเลือกเมนูอ่านง่าย ===== */
.money { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; background: var(--ground); }
.money .m-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 15px; color: var(--muted); }
.money .m-row b { font-size: 20px; color: var(--ink); }
.money .m-in { width: 150px !important; height: 46px; text-align: right; font-size: 20px; font-weight: 700; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--surface); }
.money #posQuick { justify-content: flex-end; }
.money #posQuick .chip { height: 38px; }
.m-change { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1.5px dashed var(--line); }
.m-change span { font-size: 16px; font-weight: 600; color: var(--muted); }
.m-change b { font-size: 34px; line-height: 1.1; color: var(--muted); font-variant-numeric: tabular-nums; }
.m-change.ready { background: var(--ok-tint); border: 1.5px solid #86EFAC; } .m-change.ready span, .m-change.ready b { color: var(--ok-dark); }
.m-change.short { background: #FEE2E2; border: 1.5px solid #FCA5A5; } .m-change.short span, .m-change.short b { color: #991B1B; } .m-change.short b { font-size: 22px; }
.pk-g { display: flex; flex-direction: column; gap: 8px; }
.pk-g > b { font-size: 16px; }
.pk-g .opt { height: 48px; }
.pk-note { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 16px; }
.lightbox .modal-card .seg .chip { font-size: 15px; }
.mob-only { display: none; }

/* ===== v8: ร้านบนมือถือ — หัวบาง + เมนูหลักอยู่ล่างจอ ===== */
@media (max-width: 900px) {
  .m-head { gap: 8px !important; padding: 8px 12px !important; position: sticky; top: 0; z-index: 6; }
  .m-head > .stack { flex: 1 1 100%; flex-direction: row !important; align-items: baseline; gap: 8px !important; }
  .m-head #clock, .m-head > .row { display: none !important; }
  .m-head .out-btn, .m-head .chip { height: 38px; }
  .state-seg button { height: 34px; padding: 0 10px; font-size: 14px; }
  .mob-only { display: inline-flex; }
  .m-out { height: 38px; padding: 0 12px; margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 14px; align-items: center; }
  .mobile-tabs { position: fixed !important; top: auto !important; left: 0; right: 0; bottom: 0; z-index: 8; display: grid !important; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)) !important; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 0 !important; box-shadow: 0 -4px 14px rgba(23,32,28,.05); }
  .mobile-tabs .chip { height: 46px; border: 0; border-radius: 10px; background: transparent; font-size: 14px; font-weight: 600; color: var(--muted); padding: 0 4px; }
  .mobile-tabs .chip.on { background: var(--tint); color: var(--primary-dark); }
  body.role-staff .mobile-tabs [data-owner], body:not(.role-staff) .mobile-tabs [data-staff] { display: none !important; }
  .cols, #view-admin { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important; }
  .pos-bar { bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 900px) { #view-admin:has(.pos) { padding-bottom: calc(170px + env(safe-area-inset-bottom, 0px)) !important; } }
/* ลำดับสายตาตามขั้นตอน: ยังไม่รับเงิน → ยอดออเดอร์เด่น · รับเงินครบ → เงินทอนเด่น */
.money .m-total b { font-size: 36px; line-height: 1.1; color: var(--ink); transition: font-size .15s; }
.money .m-total span { font-size: 16px; font-weight: 600; color: var(--ink); }
.m-change b { font-size: 20px; transition: font-size .15s; }
.money.paid .m-total b { font-size: 20px; color: var(--muted); }
.money.paid .m-total span { font-weight: 400; color: var(--muted); }
.money.paid .m-change b { font-size: 36px; }
@media (prefers-reduced-motion: reduce) { .money .m-total b, .m-change b { transition: none; } }

/* ===== v9: หน้าต่าง (modal) — หัว/ปุ่มอยู่กับที่ เลื่อนเฉพาะเนื้อหา ===== */
html.lock, html.lock body { overflow: hidden; overscroll-behavior: none; }
.modal-flex { display: flex; flex-direction: column; padding: 0 !important; max-height: calc(100dvh - 24px) !important; overflow: hidden !important; }
.modal-flex .modal-head { padding: 16px 18px 10px; border-bottom: 1px solid var(--line-soft); flex-shrink: 0; }
.modal-flex .modal-body { padding: 14px 18px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.modal-flex .modal-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-soft); flex-shrink: 0; background: var(--surface); }

/* ===== v9: หน้ารับออเดอร์ — ขวา = รายการอาหาร · ถามวิธีรับ / คิดเงิน เป็นหน้าต่าง ===== */
.pos-cart { gap: 10px !important; }
.pos-type { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; min-width: 0; }
.pos-type b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-type span { font-size: 13px; color: var(--primary); font-weight: 600; flex-shrink: 0; }
.pos-lines { flex: 1; min-height: 160px; overflow-y: auto; display: flex; flex-direction: column; }
.pos-empty { padding: 40px 0; text-align: center; color: var(--faint); }
.pl { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.pl-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; padding: 0; }
.pl-t b { font-size: 17px; } .pl-t span { font-size: 14px; color: var(--muted); }
.pl-p { font-size: 16px; flex-shrink: 0; }
.pos-sum { display: flex; align-items: baseline; justify-content: space-between; padding-top: 4px; }
.pos-sum span { color: var(--muted); font-size: 15px; } .pos-sum b { font-size: 30px; }
#posCheckout { height: 58px; font-size: 18px; }
.pos-sheet { position: fixed; inset: 0; z-index: 40; background: rgba(23,32,28,.5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pos-sheet.hidden { display: none; }
.pos-sheet .sheet-card { border-radius: 20px; max-width: 520px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; gap: 14px; padding: 18px; }
.pos-sheet .sh-title { font-size: 20px; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-grid button { min-height: 86px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.type-grid button b { font-size: 20px; } .type-grid button small { font-size: 13.5px; color: var(--muted); }
.type-grid button.on { border-color: var(--primary); background: var(--tint); color: var(--primary-dark); }
.table-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.table-grid button { height: 56px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 20px; font-weight: 700; }
.table-grid button.wide { grid-column: 1 / -1; font-size: 15px; font-weight: 600; height: 46px; color: var(--muted); }
.table-grid button.on { border-color: var(--primary); background: var(--primary); color: #fff; }
@media (max-width: 900px) {
  .pos-sheet { align-items: flex-end; padding: 0; }
  .pos-sheet .sheet-card { border-radius: 20px 20px 0 0; max-height: 92dvh; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}
/* หน้าต่างรับออเดอร์ บังเฉพาะพื้นที่ทำงาน — หัวจอและเมนูซ้ายยังกดได้ */
@media (min-width: 901px) { .pos-sheet { top: 76px; left: 88px; } }
@media (max-width: 900px) { .pos-sheet { top: 54px; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); } .pos-sheet .sheet-card { max-height: 100%; } }

/* ===== v10: หน้าต่างรับออเดอร์ขนาดคงที่ + แท็บ + บิลค้างจ่าย ===== */
.pos-sheet .sheet-big { width: min(760px, 100%); max-width: 760px; height: min(640px, 100%); max-height: none; padding: 0; gap: 0; display: flex; flex-direction: column; overflow: hidden; }
.sheet-big .sh-head { padding: 16px 18px 12px; flex-shrink: 0; }
.sheet-big .sh-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.sheet-big .sh-foot { flex-shrink: 0; padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; }
.sheet-big .sh-foot .btn { height: 56px; font-size: 18px; }
.type-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 18px 14px; border-radius: 12px; background: var(--ground); padding: 4px; flex-shrink: 0; }
.type-tabs button { height: 52px; border: 0; border-radius: 9px; background: transparent; font-size: 17px; font-weight: 600; color: var(--muted); }
.type-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(23,32,28,.12); }
.now-note { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 40px 0; text-align: center; }
.now-note b { font-size: 22px; } .now-note span { color: var(--muted); }
.table-grid button { height: 64px; font-size: 22px; }
.bills-btn { height: 38px; display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.bills-btn span { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--ground); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.bills-btn.has { border-color: #F5B301; background: #FFF6DA; } .bills-btn.has span { background: #F5B301; color: #fff; }
.pos-mode { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-radius: 10px; background: #FFF6DA; color: #6B4E00; font-weight: 600; }
.pos-mode.hidden { display: none; } .pos-mode .chip { margin-left: auto; height: 34px; }
.bill { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); }
.bill-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .bill-h b:first-child { font-size: 17px; } .bill-t { margin-left: auto; font-size: 20px; }
.oc-tools { gap: 6px; } .oc-tools .chip { height: 36px; font-size: 14px; }
@media (max-width: 900px) { .pos-sheet .sheet-big { height: 100%; border-radius: 20px 20px 0 0; } .type-tabs button { font-size: 15px; height: 48px; } }

/* ===== v11: รับออเดอร์ — แผงขวาสูงเต็มจอ + แตะเมนูใส่ทันที ===== */
@media (min-width: 901px) {
  .pos-cart { position: sticky; top: 0; height: calc(100vh - 76px - 32px); max-height: none; }
  .pos-lines { flex: 1; min-height: 0; }
}
.pos-item { position: relative; }
.pi-q { position: absolute; top: 8px; right: 8px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; display: none; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.2); z-index: 1; }
.pos-item.in .pi-q { display: inline-flex; }
.pos-item.in { border-color: var(--primary); }
.pos-item.added { animation: piAdd .35s ease-out; }
@keyframes piAdd { 0% { transform: scale(.96); background: var(--tint); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .pos-item.added { animation: none; } }
.pl-t span { text-decoration: underline dotted var(--line); text-underline-offset: 3px; }

/* ===== v13: มือถือ/แท็บเล็ตแนวตั้ง — หัวบางแถวเดียว · เมนูหลักอยู่บน · สถานะร้านเป็นดรอปดาวน์ · เมนูเลื่อนข้าง ===== */
.pos-cats { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-width: 0; }
.pos-cats #posCats { flex: 1; min-width: 0; margin: 0; }
.cat-find { flex-shrink: 0; width: 44px; height: 44px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.cat-find:active { background: var(--tint); }
.cat-q { height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; font-size: 16px; width: 100%; box-sizing: border-box; }
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-list button { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; font-size: 17px; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; }
.cat-list button small { color: var(--faint); font-weight: 500; font-size: 14px; }
.cat-list button.on { background: var(--tint); color: var(--primary-dark); }
.cat-list button:active { background: var(--ground); }
.state-dd { display: none; position: relative; }
.state-btn { height: 40px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.state-dd i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: #22C55E; }
.state-dd .s-busy i { background: #F59E0B; } .state-dd .s-pause i { background: #EF4444; }
.state-btn.s-busy { background: var(--warn-tint); border-color: #FDE68A; color: var(--warn-dark); }
.state-btn.s-pause { background: #FEE2E2; border-color: #FCA5A5; color: #991B1B; }
.state-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(23,32,28,.16); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.state-menu.hidden { display: none; }
.state-menu button { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 6px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; color: var(--ink); }
.state-menu button span { display: flex; flex-direction: column; }
.state-menu button b { font-size: 16px; } .state-menu button small { font-size: 13px; color: var(--muted); }
.state-menu button.on { background: var(--ground); }
.mob-out { display: none; }

@media (max-width: 900px) {
  .state-seg { display: none !important; }
  .state-dd { display: inline-block; }
  .m-head { height: 56px !important; flex-wrap: nowrap !important; padding: 0 12px !important; gap: 8px !important; }
  .m-head > .stack { flex: 1 1 auto !important; min-width: 0; }
  .m-head b#shop { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-head .out-btn { height: 40px; }
  /* เมนูหลักขึ้นไปอยู่ใต้หัว (ใช้บ่อยสุด) */
  .mobile-tabs { position: sticky !important; top: 56px !important; bottom: auto !important; z-index: 5; display: grid !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 6px 8px !important; border-top: 0 !important; border-bottom: 1px solid var(--line-soft) !important; box-shadow: none !important; }
  .mobile-tabs .chip { height: 42px; font-size: 15px; }
  .cols, #view-admin { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important; }
  #view-admin:has(.pos) { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
  .pos-sheet { top: 110px !important; bottom: 0 !important; }
  .mob-out { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)); padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-soft); color: var(--muted); font-size: 14px; }
  .mob-out.hidden { display: none; }
  /* หมวด: แถวเลื่อนข้างแยกต่างหาก */
  .pos-cats { margin: 0 0 8px; }
  #posCats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
  #posCats::-webkit-scrollbar { display: none; }
  #posCats .chip { flex-shrink: 0; }
}
.pos-item[hidden], .cat-list button[hidden] { display: none !important; }
/* หมวดเยอะ: แถวเดียวเลื่อนข้างทุกขนาดจอ + จางขอบขวาให้รู้ว่ายังมีต่อ */
#posCats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 24px; }
#posCats::-webkit-scrollbar { display: none; }
#posCats .chip { flex-shrink: 0; }

/* ===== v14: การ์ดเมนู (จอแนวนอน 2 แผง) / แถวเมนูรูปซ้าย (มือถือ + แท็บเล็ตแนวตั้ง) + ตะกร้าแบบดึงขึ้น ===== */
.pos-bar { display: none !important; }
.pos-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.pos-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "img img" "info step"; align-items: end; gap: 0; padding: 0; cursor: pointer; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; text-align: left; -webkit-tap-highlight-color: transparent; }
.pos-item img { grid-area: img; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #F3E6DD; display: block; }
.pi-info { grid-area: info; display: flex; flex-direction: column; gap: 2px; padding: 8px 6px 10px 10px; min-width: 0; align-self: stretch; }
.pos-item .n { padding: 0; font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 0; }
.pos-item .p { padding: 0; margin-top: auto; font-size: 16px; font-weight: 700; color: var(--ink); }
.pos-item.off .p { color: var(--muted); font-weight: 500; font-size: 14px; }
.pi-step { grid-area: step; display: flex; align-items: center; border-radius: 999px; margin: 0 8px 8px 0; }
.pi-step button { width: 44px; height: 44px; border-radius: 999px; border: 0; font-size: 24px; font-weight: 600; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.pi-add { background: var(--primary); color: #fff; }
.pi-add:active { transform: scale(.92); }
.pi-dec { background: transparent; color: var(--primary); display: none !important; }
.pos-item .pi-q { position: static; display: none; min-width: 26px; padding: 0 2px; background: none; color: var(--ink); box-shadow: none; font-size: 17px; font-weight: 700; text-align: center; }
.pos-item.in { border-color: var(--primary); }
.pos-item.in .pi-dec { display: inline-flex !important; }
.pos-item.in .pi-q { display: inline-block; }
.pos-item.in .pi-step { background: var(--tint); }
.pos-item:active { background: var(--ground); }
.pos-item:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.pos-sec { display: none; }
.pc-handle, .pc-scrim { display: none; }
.pos-empty small { display: block; margin-top: 4px; }
/* ค้นหาเมนู/หมวด */
.find-res { display: flex; flex-direction: column; gap: 2px; }
.find-h { font-size: 13px; color: var(--faint); font-weight: 600; margin: 10px 4px 4px; }
.find-dish { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 64px; padding: 6px 8px; border-radius: 12px; cursor: pointer; }
.find-dish:active { background: var(--ground); }
.find-dish img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #F3E6DD; }
.find-dish b { font-size: 16px; display: block; } .find-dish small { color: var(--muted); font-size: 14px; }
.find-dish .pi-add { width: 44px; height: 44px; border-radius: 999px; border: 0; font-size: 24px; display: inline-flex; align-items: center; justify-content: center; }
.find-dish .fq { font-size: 13px; color: var(--primary-dark); font-weight: 600; margin-left: 6px; }
.find-none { padding: 24px 8px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  #view-admin { overflow: visible !important; }
  .pos { display: block; }
  /* หมวดติดบนสุดขณะเลื่อน */
  .pos-cats { position: sticky; top: 110px; z-index: 4; background: var(--ground); margin: -12px -16px 0; padding: 10px 16px 8px; }
  /* เมนู: แถวรูปซ้าย แบบเดียวกับฝั่งลูกค้า เลื่อนลงต่อเนื่องทุกหมวด */
  .pos-grid { display: flex; flex-direction: column; gap: 8px; }
  .pos-sec { display: block; font-size: 15px; font-weight: 700; color: var(--muted); margin: 14px 2px 0; scroll-margin-top: 180px; }
  .pos-sec:first-child { margin-top: 6px; }
  .pos-item { grid-template-columns: 76px minmax(0, 1fr) auto; grid-template-areas: "img info step"; align-items: center; border-radius: 14px; min-height: 92px; padding: 8px; gap: 12px; }
  .pos-item img { width: 76px; height: 76px; aspect-ratio: 1; border-radius: 10px; }
  .pi-info { padding: 0; align-self: center; gap: 4px; }
  .pos-item .p { margin-top: 0; }
  .pi-step { margin: 0; }
  /* ตะกร้า: ติดล่าง ดึงขึ้นดูรายการ ไม่บังทั้งจอ */
  #view-admin:has(.pos) { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
  .pos-cart { position: fixed !important; left: 0; right: 0; bottom: 0; top: auto !important; z-index: 20; height: auto !important; max-height: 78vh !important; margin: 0 auto; max-width: 900px; border-radius: 20px 20px 0 0 !important; border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -8px 28px rgba(23,32,28,.14); padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)) !important; gap: 10px !important; transition: max-height .25s ease; }
  .pc-handle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 54px; padding: 14px 0 4px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--ink); touch-action: none; position: relative; }
  .pc-handle::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line); }
  .pc-handle b { font-size: 17px; } .pc-handle .pc-n { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 700; }
  .pc-handle .pc-n.zero { background: var(--line); color: var(--muted); }
  .pc-handle .pc-type { color: var(--muted); font-size: 14px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pc-handle svg { transition: transform .2s; color: var(--muted); }
  .pos-cart.open .pc-handle svg { transform: rotate(180deg); }
  .pc-handle.bump .pc-n { animation: pcBump .35s ease-out; }
  @keyframes pcBump { 40% { transform: scale(1.3); } }
  /* ปิดอยู่: เห็นแค่แถบสรุป + ปุ่มคิดเงิน */
  .pos-cart:not(.open) > :not(.pc-handle) { display: none !important; }
  .pos-cart.open .pos-lines { flex: 1 1 auto; min-height: 80px; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
  .pc-scrim { display: block; position: fixed; inset: 0; z-index: 19; background: rgba(23,32,28,.28); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .pc-scrim.on { opacity: 1; pointer-events: auto; }
  .pos-sheet { z-index: 40; }
}
@media (prefers-reduced-motion: reduce) { .pos-cart, .pc-handle svg { transition: none !important; } }
@media (min-width: 641px) and (max-width: 900px) { .pos-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .pos-sec { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  /* ปิดอยู่: แถบสรุปอย่างเดียว (ยอด + จำนวน) · ปุ่มคิดเงินอยู่ข้างใน ต้องเปิดดูรายการก่อนเสมอ */
  .pos-cart:not(.open) { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important; }
  .pc-handle { min-height: 64px; }
  .pc-handle .pc-total { font-size: 20px; font-weight: 800; }
}

/* ===== v15: แถบบน = งานหลัก (รับ/ดูออเดอร์ · บิลค้าง) · ที่เหลือในเมนู ☰ (มือถือ + แท็บเล็ตแนวตั้ง) ===== */
.tb, .drw, .drw-scrim, .shop-strip { display: none; }
.mob-out, .mob-out.hidden { display: none !important; }
@media (max-width: 900px) {
  .m-head, .mobile-tabs { display: none !important; }
  .tb { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 6; height: 60px; padding: 0 max(10px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px)); background: var(--surface); border-bottom: 1px solid var(--line-soft); }
  .tb-menu { position: relative; flex-shrink: 0; width: 48px; height: 48px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .tb-menu:active { background: var(--ground); }
  .tb-dot { position: absolute; top: 9px; right: 8px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); display: none; }
  .tb-dot.s-busy { display: block; background: #F59E0B; } .tb-dot.s-pause, .tb-dot.s-closed { display: block; background: #EF4444; }
  .tb-seg { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--ground); border-radius: 14px; }
  .tb-seg button { height: 42px; border: 0; border-radius: 10px; background: transparent; font-size: 16px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; white-space: nowrap; padding: 0 6px; }
  .tb-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(23,32,28,.12); font-weight: 700; }
  .tb-bills { flex-shrink: 0; height: 50px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 15px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
  .tb-bills:active { background: var(--ground); }
  .tb-n { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--ink); font-size: 13px; font-weight: 700; }
  .tb-n:empty { display: none; }
  .tb-n.hot { background: var(--primary); color: #fff; }
  .tb-bills .tb-n:not(:empty) { background: var(--warn-tint); color: var(--warn-dark); }
  .shop-strip { display: block; width: 100%; border: 0; padding: 10px 16px; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
  .shop-strip.hidden { display: none; }
  .shop-strip.s-busy { background: var(--warn-tint); color: var(--warn-dark); }
  .shop-strip.s-pause, .shop-strip.s-closed { background: #FEE2E2; color: #991B1B; }
  .pos-sheet { top: 60px !important; }
  /* เมนู ☰ */
  .drw-scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(23,32,28,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .drw-scrim.on { opacity: 1; pointer-events: auto; }
  .drw { display: flex; flex-direction: column; gap: 6px; position: fixed; top: 0; bottom: 0; left: 0; z-index: 45; width: min(340px, 86vw); background: var(--surface); box-shadow: 8px 0 30px rgba(23,32,28,.18); padding: calc(10px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); overflow-y: auto; overscroll-behavior: contain; transform: translateX(-104%); transition: transform .24s cubic-bezier(.2,.8,.2,1); visibility: hidden; }
  .drw.open { transform: none; visibility: visible; }
  .drw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 4px 10px; border-bottom: 1px solid var(--line-soft); }
  .drw-head b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .drw-nav { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
  .drw-nav button { display: flex; align-items: center; gap: 14px; height: 58px; padding: 0 14px; border: 0; border-radius: 14px; background: transparent; font-size: 20px; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; }
  .drw-nav button svg { width: 26px; height: 26px; color: var(--muted); flex-shrink: 0; }
  .drw-nav button.on { background: var(--tint); color: var(--primary-dark); } .drw-nav button.on svg { color: var(--primary); }
  .drw-nav button:active { background: var(--ground); }
  .drw-sec { padding: 10px 2px 6px; }
  .drw-sec h3 { margin: 0 0 8px 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
  .drw .state-seg { display: grid !important; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .drw .state-seg button { height: 50px; font-size: 16px; }
  .drw .state-closed { width: 100%; height: 50px; }
  .drw-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; color: var(--ink); cursor: pointer; }
  .drw-row b { color: var(--primary-dark); font-size: 15px; }
  .drw-row.has { border-color: #FCA5A5; background: #FEF2F2; } .drw-row.has span { color: #991B1B; font-weight: 600; }
  .drw-links { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line-soft); margin-top: 6px; }
  .drw-links a, .drw-links button { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; font-size: 16px; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; }
  .drw-out { margin-top: auto; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; background: transparent; font-size: 15px; color: var(--muted); cursor: pointer; }
}
@media (prefers-reduced-motion: reduce) { .drw, .drw-scrim { transition: none; } }

/* ===== v16: ดูออเดอร์ (แบบ LINE MAN / Wongnai POS) — แท็บทีละสถานะบนมือถือ · คอลัมน์บนจอแนวนอน · การ์ดสั้น ปุ่มหลักปุ่มเดียว ===== */
.ov { flex: 1; min-width: 0; padding: 14px 20px 24px; }
.ov-tabs { display: none; }
.ov-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 14px; align-items: start; }
.ov-col h2 { margin: 0 0 10px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.ov-col h2 .n { font-size: 13px; padding: 2px 9px; border-radius: 999px; background: #E7E5E0; color: var(--ink); }
.ov-col h2 .n.hot { background: var(--primary); color: #fff; }
.ov-col.k-pay h2 .n.hot { background: #F59E0B; }
.ov-list { display: flex; flex-direction: column; gap: 8px; }
.ov-empty { margin: 0; padding: 18px 12px; text-align: center; color: var(--faint); font-size: 14px; border: 1.5px dashed var(--line); border-radius: 14px; }
.ov-sub { margin: 10px 2px 0; font-size: 14px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ov-sub .n { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #E7E5E0; }
.oc2 { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent; }
.oc2:active { background: var(--ground); }
.oc2:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.oc2.unread { border-color: #FDBA8C; background: #FFF8F3; }
.oc2.unread::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 6px; border-radius: 14px 0 0 14px; background: var(--primary); }
.oc2.cx { opacity: .65; }
.oc2-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.oc2-h .qno { font-size: 17px; font-weight: 800; background: none; padding: 0; margin-right: 2px; }
.oc2-h .ftag { font-size: 13px; padding: 2px 8px; }
.oc2-h .ft-edit { background: #FEF3C7; color: var(--warn-dark); }
.oc2-h .ot { margin-left: auto; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.oc2-h .ot.late { color: #B42318; font-weight: 700; }
.oc2-items { display: flex; flex-direction: column; gap: 2px; font-size: 16px; line-height: 1.35; color: var(--ink); }
.oc2-items i { font-style: normal; color: var(--muted); font-size: 14px; }
.oc2-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.oc2-f b { font-size: 16px; }
.oc2-f .oc2-n { font-size: 14px; color: var(--muted); max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc2-f .pill { font-size: 12px; }
.oc2-f .sp { flex: 1; }
.oc2-go { min-height: 46px; padding: 0 16px; font-size: 16px; border-radius: 12px; margin: 0; }
/* รายละเอียด */
.od-wrap { z-index: 55; background: rgba(23,32,28,.5); align-items: center; justify-content: center; padding: 16px; }
.od-card { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: 0 20px 50px rgba(23,32,28,.25); }
.od-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px 18px; border-bottom: 1px solid var(--line-soft); }
.od-head b { font-size: 18px; }
.od-body { overflow-y: auto; overscroll-behavior: contain; padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px)); }
.od-body .ocard { border: 0; box-shadow: none; padding: 0; margin: 0; background: none; }
.cx-list { display: flex; flex-direction: column; gap: 6px; }
.cx-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; font-size: 16px; color: var(--ink); }
.cx-list button small { color: var(--muted); font-size: 13px; }
.cx-list button:active { background: #FEF2F2; border-color: #FCA5A5; }
@media (max-width: 900px) {
  .ov { padding: 0 0 24px; }
  .ov-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 60px; z-index: 5; background: var(--ground); padding: 10px 16px 8px; }
  .ov-tabs::-webkit-scrollbar { display: none; }
  .ov-tabs button { flex: 1 0 auto; height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 16px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; white-space: nowrap; }
  .ov-tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
  .ov-tabs .tn { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #E7E5E0; color: var(--ink); font-size: 13px; font-weight: 700; }
  .ov-tabs .tn:empty { display: none; }
  .ov-tabs button.on .tn { background: rgba(255,255,255,.22); color: #fff; }
  .ov-tabs .tn.hot { background: var(--primary); color: #fff; }
  .ov-tabs .t-pay:not(.on) { border-color: #FCD34D; background: #FFFBEB; color: var(--warn-dark); }
  .ov-tabs .t-pay .tn.hot { background: #F59E0B; }
  .ov-board { display: block; padding: 4px 16px 0; }
  .ov-col { display: none; } .ov-col.on { display: block; }
  .ov-col h2 { display: none; }
  .od-wrap { align-items: flex-end; padding: 0; }
  .od-card { max-width: none; border-radius: 20px 20px 0 0; max-height: 88vh; }
}
@media (min-width: 641px) and (max-width: 900px) { .ov-col.on .ov-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .ov-col.on .ov-sub, .ov-col.on .ov-empty { grid-column: 1 / -1; } }
.oc2-h .ftag:not([class*="ft-"]) { background: var(--ground); color: var(--muted); }
.oc2-go, .oc2-go.act { background: var(--primary); color: #fff; border: 0; font-weight: 700; box-shadow: none; }
.oc2-go:active { filter: brightness(.94); }
.oc2-go.outline { background: var(--surface); color: var(--primary-dark); border: 1.5px solid var(--primary); }
.ov-col.k-pay .oc2-go { background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink); }
.od-card { color: var(--ink); }
.od-wrap { flex-direction: row; }
.od-card .icon-btn { background: var(--ground); color: var(--ink); }
.cx-card { color: var(--ink); } .cx-list button { justify-content: center; }
#toastBox { z-index: 90 !important; }
.oc2-pay { min-height: 46px; padding: 0 14px; font-size: 15px; border-radius: 12px; margin: 0; background: #FFFBEB; color: var(--warn-dark); border: 1.5px solid #FCD34D; font-weight: 700; }
.pos-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border-radius: 16px; background: var(--ground); text-align: center; }
.pos-qr.hidden { display: none; }
.pos-qr .qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 120px; justify-content: center; }
.pos-qr canvas { width: 240px; height: 240px; background: #fff; border-radius: 12px; padding: 10px; box-sizing: content-box; }
.pos-qr .qr-amt { font-size: 28px; }
/* สีปุ่มตามความหมาย (ใช้เหมือนกันทั้งการ์ดและรายละเอียด) */
.act.k-go, .oc2-go.k-go { background: var(--primary); color: #fff; border: 0; }
.act.k-done, .oc2-go.k-done { background: var(--ink); color: #fff; border: 0; }
.act.k-money, .oc2-go.k-money, .oc2-pay.k-money { background: #FEF3C7; color: #78350F; border: 1.5px solid #F59E0B; }
.oc2-go.soft { background: var(--surface); color: var(--primary-dark); border: 1.5px solid var(--primary); }
.ov-col.k-pay .oc2-go { background: #FEF3C7; color: #78350F; border: 1.5px solid #F59E0B; }
/* รายการ: ความเผ็ดบรรทัดแรก ท็อปปิ้งบรรทัดละอย่าง · ที่แก้ไขไฮไลต์ ของเดิมขีดฆ่า */
.opl { display: block; font-size: 14px; color: var(--muted); line-height: 1.35; }
.opl.sp { color: #B91C1C; font-weight: 600; }
.opl.note { color: var(--warn-dark); }
.opl.chg { color: #78350F; font-weight: 700; }
.opl.chg::before { content: "● "; color: #F59E0B; }
.opl s, .lq s, .mi-n s { opacity: .55; text-decoration-thickness: 2px; }
.opl.gone { color: var(--faint); }
.upd { display: inline-block; vertical-align: 2px; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: #F59E0B; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; }
.upd.new { background: #2563EB; } .upd.del { background: #DC2626; }
.olines li.edited { background: #FFFBEB; border-radius: 10px; }
.olines li.gone b { color: var(--faint); font-weight: 600; }
.lq s { margin-right: 3px; font-size: .8em; }
.oc2-items { gap: 6px; }
.oc2-items .mi { display: flex; flex-direction: column; }
.oc2-items .mi .opl { padding-left: 1.6em; font-size: 14px; }
.oc2-items .mi.edited { background: #FFFBEB; border-radius: 8px; padding: 2px 6px; margin: 0 -6px; }
.oc2-items .mi.gone .mi-n { color: var(--faint); }

/* ===== v17: รายละเอียดออเดอร์ — อ่านจากบนลงล่างตามที่ร้านต้องรู้ · ปุ่มติดล่าง · ยกเลิกแยกเป็นลิงก์แดง ===== */
.od-body { padding: 0 18px; }
.od { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }
.od-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.od-top .ftag { font-size: 16px; padding: 5px 12px; }
.od-due { font-size: 14px; font-weight: 700; color: var(--primary-dark); }
.od-due.late { color: #B42318; }
.od-st { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--muted); padding: 3px 10px; border-radius: 999px; background: var(--ground); }
.od-meta { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--ground); }
.od-meta > div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; font-size: 15px; align-items: baseline; }
.od-meta span:first-child { color: var(--muted); font-size: 14px; }
.od-meta b { font-weight: 600; overflow-wrap: anywhere; }
.od-meta a { color: var(--primary-dark); }
.od-note { color: var(--warn-dark); }
.od-lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.od-lines li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.od-lines li:last-child { border-bottom: 0; }
.od-lines .lq { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.od-lines .ld { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.od-lines .ld b { font-size: 17px; font-weight: 700; }
.od-lines .lp { font-size: 15px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.od-lines li.edited { background: #FFFBEB; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; border-bottom-color: transparent; }
.od-sum { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1.5px dashed var(--line); }
.od-sr { display: flex; justify-content: space-between; align-items: center; font-size: 15px; color: var(--muted); }
.od-total { color: var(--ink); font-size: 17px; } .od-total b { font-size: 22px; }
.od-slip { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.od-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.od-tools .chip { height: 44px; padding: 0 16px; font-size: 15px; }
.od-tools .od-cancel { margin-left: auto; background: transparent; border: 0; color: #B42318; font-size: 15px; font-weight: 600; height: 44px; padding: 0 6px; }
.od-foot { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 10px; margin: 0 -18px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line-soft); }
.od-foot .act { flex: 1; height: 54px; border-radius: 14px; font-size: 17px; font-weight: 700; margin: 0; }
.od-foot .od-wait { flex: 1; align-self: center; color: var(--warn-dark); font-size: 14px; }
.od-card .od-body { padding-bottom: 0; }
/* ป้ายแก้ไข: สีอ่อน ไม่ชนกับสีปุ่ม */
.upd { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; line-height: 16px; }
.upd.new { background: #DBEAFE; color: #1E40AF; border-color: #93C5FD; }
.upd.del { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }
.oc2-items .mi-n { font-weight: 600; }
.oc2-items .mi-n b { font-weight: 800; }
.opl s, .mi-n s { font-weight: 500; color: var(--faint); opacity: 1; } .od-lines li.edited + li.edited { margin-top: 6px; }
/* ===== v18: การแก้ไข — สีเดียว (เหลือง) · ในรายการโชว์แค่จุด · รายละเอียดเต็มในหน้าออเดอร์ ===== */
.upd, .upd.new, .upd.del { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.opl.chg::before { content: none; }
.opl.chg { color: #92400E; font-weight: 700; }
.od-lines li.edited { background: none; margin: 0; padding-left: 10px; padding-right: 0; border-radius: 0; box-shadow: inset 3px 0 0 #F59E0B; border-bottom: 1px solid var(--line-soft); }
.od-lines li.edited + li.edited { margin-top: 0; }
.od-lines .gone-row .lq { background: var(--ground); color: var(--faint); }
.od-lines .gone-row .ld { color: var(--faint); font-size: 15px; }
.od-lines .gone-h { font-size: 13px; font-weight: 600; color: var(--muted); }
.chg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #F59E0B; margin-right: 6px; vertical-align: 2px; }
.oc2-items .mi.edited { background: none; padding: 0; margin: 0; }
.od-tools { margin-top: -2px; }
.od-tools .chip { flex: 1; }
.od-danger { display: flex; justify-content: center; }
.od-danger .od-cancel { background: transparent; border: 0; color: #B42318; font-size: 15px; font-weight: 600; height: 44px; padding: 0 12px; }
.od-due-row { color: var(--warn-dark); } .od-due-row b { font-size: 17px; }
.pc-handle .pc-type.mode { color: #92400E; font-weight: 700; }

/* v19 ค่าใช้จ่าย / ต้นทุน */
.tnum { font-variant-numeric: tabular-nums; }
.cost-week .btn { width: 48px; height: 44px; padding: 0; font-size: 22px; }
.cost-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.cost-kpis .kpi b { font-size: 24px; }
.kpi.cost-pos { background: var(--ok-tint); } .kpi.cost-pos b, .kpi.cost-pos .small { color: var(--ok-dark); }
.kpi.cost-neg { background: #FEE2E2; } .kpi.cost-neg b, .kpi.cost-neg .small { color: #991B1B; }
.cost-days { display: flex; flex-direction: column; }
.cost-day { display: grid; grid-template-columns: 1fr 96px 96px; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.cost-day span:not(:first-child) { text-align: right; }
.cost-day.cost-dh { order: -1; font-size: 12px; color: var(--muted); padding-top: 0; }
.cost-day.is-today { font-weight: 600; } .cost-day.is-future { color: var(--faint, #9CA3AF); }
.cost-g { display: grid; grid-template-columns: 112px 1fr 84px; gap: 10px; align-items: center; padding: 5px 0; }
.cost-g b { text-align: right; font-size: 15px; }
.cost-tbl { display: flex; flex-direction: column; }
.cost-tr { display: grid; grid-template-columns: minmax(0, 1fr) 44px 56px 56px 92px; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.cost-tr[hidden] { display: none; }
.cost-tr > span:not(:first-child) { text-align: right; }
.cost-tr > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.cost-tr small { font-size: 12px; } .cost-tr > span:last-child small { color: var(--muted); margin-left: 2px; }
.cost-th { font-size: 12px; color: var(--muted); padding-top: 0; }
.cost-low { color: var(--warn-dark); }
.cost-list { display: flex; flex-direction: column; }
.cost-li { position: relative; overflow: hidden; border-bottom: 1px solid var(--line-soft); }
.cost-li[hidden] { display: none; }
.cost-li-in { position: relative; z-index: 1; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto 44px; gap: 8px; align-items: center; padding: 6px 0; background: var(--surface); }
.cost-what { display: flex; flex-direction: column; min-width: 0; } .cost-what small { font-size: 12px; }
.cost-del { height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 20px; }
.cost-del.arm { background: #FEE2E2; color: #991B1B; font-size: 13px; font-weight: 600; }
@media (max-width: 520px) {
  .cost-kpis { grid-template-columns: 1fr 1fr; } .cost-kpis .kpi:last-child { grid-column: 1 / -1; }
  .cost-tr { grid-template-columns: minmax(0, 1fr) 34px 50px 78px; } .cost-tr > span:nth-child(3) { display: none; }
}

/* v20 หน้าต่างจดค่าใช้จ่าย (ทีละขั้น) */
.gdot { display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-right: 6px; vertical-align: 1px; flex-shrink: 0; background: var(--gc, #9CA3AF); }
.gstrip { position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gc, #9CA3AF); }
.g-tam { --gc: #65A30D; } .g-plara { --gc: #92400E; } .g-seafood { --gc: #0284C7; } .g-pork { --gc: #DB2777; } .g-chicken { --gc: #D97706; } .g-beef { --gc: #B91C1C; }
.g-egg { --gc: #CA8A04; } .g-starch { --gc: #A8A29E; } .g-veg { --gc: #16A34A; } .g-drink { --gc: #0891B2; } .g-shared { --gc: #6B7280; } .g-fixed { --gc: #7C3AED; }
.cost-g > span:first-child { display: flex; align-items: center; }
.cost-what > span { display: flex; align-items: center; min-width: 0; }
.cost-hero { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cost-go { height: 56px; padding: 0 22px; font-size: 17px; flex-shrink: 0; }
@media (max-width: 520px) { .cost-go { width: 100%; } }
.xs { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.xs-scrim { position: absolute; inset: 0; background: rgba(23,32,28,.45); opacity: 0; transition: opacity .2s; }
.xs.on .xs-scrim { opacity: 1; }
.xs-card { position: relative; width: 100%; max-width: 520px; height: min(92dvh, 760px); background: var(--surface); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; overflow: hidden; transform: translateY(100%); transition: transform .24s cubic-bezier(.2,.8,.2,1); padding-bottom: env(safe-area-inset-bottom, 0px); }
.xs.on .xs-card { transform: none; }
@media (min-width: 700px) { .xs { align-items: center; } .xs-card { border-radius: 20px; height: min(86vh, 760px); } }
.xs-head { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: 10px 8px 4px; }
.xs-head button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 26px; color: var(--muted); border-radius: 12px; }
.xs-title { text-align: center; font-size: 18px; }
.xs-steps { display: flex; gap: 6px; justify-content: center; padding-bottom: 8px; }
.xs-steps i { width: 22px; height: 4px; border-radius: 4px; background: var(--line); transition: background .2s; } .xs-steps i.on { background: var(--primary); }
.xs-track { flex: 1; min-height: 0; display: flex; width: 300%; transform: translateX(calc(var(--step, 0) * -33.3333%)); transition: transform .26s cubic-bezier(.2,.8,.2,1); }
.xs-pane { width: 33.3333%; flex-shrink: 0; overflow-y: auto; padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.xs-search input { width: 100%; height: 52px; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 16px; font-size: 17px; background: var(--ground); }
.xs-search input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.xs-h { font-size: 13px; font-weight: 600; color: var(--muted); margin: 6px 2px 0; }
.xs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.xs-tile { position: relative; text-align: left; min-height: 74px; padding: 12px 12px 12px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.xs-tile b { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; } .xs-tile small { font-size: 13px; color: var(--muted); }
.xs-tile em { position: absolute; top: 8px; right: 8px; font-style: normal; font-size: 11px; font-weight: 600; color: var(--primary-dark); background: var(--tint); padding: 2px 7px; border-radius: 999px; }
.xs-tile.done { background: var(--ok-tint); border-color: #86EFAC; } .xs-tile.done small { color: var(--ok-dark); font-weight: 600; }
.xs-tile:active, .xs-g:active, .xs-new:active { transform: scale(.98); }
.xs-new { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px dashed var(--primary); background: var(--tint); color: var(--primary-dark); }
.xs-new > span:first-child { width: 36px; height: 36px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.xs-new small { color: var(--muted); }
.xs-lead { margin: 0 2px 4px; font-size: 15px; }
.xs-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.xs-g { display: flex; gap: 8px; align-items: center; text-align: left; padding: 12px; min-height: 64px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); }
.xs-g .gdot { width: 14px; height: 14px; margin: 0; } .xs-g b { font-size: 15px; } .xs-g small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.xs-g.on { border-color: var(--primary); background: var(--tint); }
.xs-item { position: relative; display: flex; gap: 10px; align-items: center; padding: 10px 8px 10px 16px; border-radius: 14px; background: var(--ground); }
.xs-item .gstrip { top: 12px; bottom: 12px; }
.xs-amt { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 8px 0 2px; }
.xs-amt span { font-size: 26px; color: var(--muted); } .xs-amt b { font-size: 52px; line-height: 1.1; letter-spacing: -.5px; }
.xs-quick { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; } .xs-quick .chip { height: 38px; font-size: 14px; }
.xs-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: auto; }
.xs-pad button { height: 54px; border-radius: 14px; border: 0; background: var(--ground); font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; }
.xs-pad button:active { background: var(--line); }
.xs-day { flex-shrink: 0; } .xs-day .chip { height: 40px; }
.xs-foot { padding: 10px 16px 14px; border-top: 1px solid var(--line-soft); }
.xs-save { width: 100%; height: 54px; font-size: 18px; } .xs-save:disabled { opacity: .45; }
.xs-sum { display: flex; align-items: center; justify-content: space-between; gap: 12px; } .xs-sum b { font-size: 20px; } .xs-sum .btn { height: 48px; padding: 0 28px; }
@media (max-height: 700px) { .xs-pad button { height: 46px; } .xs-amt b { font-size: 42px; } }
@media (prefers-reduced-motion: reduce) { .xs-track, .xs-card, .cost-li-in { transition: none; } }
/* v21 จดของที่ซื้อ: เช็กลิสต์ → ทีละรายการ */
.xs-sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.xs-head { padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 8px; }
.xs-date { position: sticky; top: -4px; z-index: 2; background: var(--surface); padding: 4px 0 8px; margin-top: -4px; display: flex; flex-direction: column; gap: 4px; }
.xs-date .seg { padding: 4px; } .xs-date .chip { height: 44px; }
.xs-pick { position: relative; cursor: pointer; } .xs-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.xs-grp { display: flex; flex-direction: column; }
.xs-grp .xs-h { display: flex; align-items: center; margin: 8px 2px 4px; }
.xs-ck { position: relative; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.xs-ck + .xs-ck { border-top: 1px solid var(--line-soft); border-radius: 0; }
.xs-ck input { position: absolute; opacity: 0; pointer-events: none; }
.xs-box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s; }
.xs-ck.on .xs-box { background: var(--primary); border-color: var(--primary); }
.xs-ck.on .xs-box::after { content: ''; width: 7px; height: 13px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.xs-ck input:focus-visible + .xs-box { outline: 2px solid var(--primary); outline-offset: 2px; }
.xs-ck.on { background: var(--tint); }
.xs-ck-t { display: flex; flex-direction: column; min-width: 0; flex: 1; } .xs-ck-t b { font-size: 16px; } .xs-ck-t small { font-size: 13px; color: var(--muted); }
.xs-daily { font-style: normal; font-size: 11px; font-weight: 600; color: var(--primary-dark); background: var(--tint); border: 1px solid #FDBA74; padding: 2px 8px; border-radius: 999px; flex-shrink: 0; }
.xs-one { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.xs-one.in-r { animation: xsInR .22s ease; } .xs-one.in-l { animation: xsInL .22s ease; }
@keyframes xsInR { from { opacity: 0; transform: translateX(40px); } } @keyframes xsInL { from { opacity: 0; transform: translateX(-40px); } }
.xs-hist { background: var(--warn-tint); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: #713F12; }
.xs-hist summary { list-style: none; display: flex; justify-content: space-between; gap: 8px; align-items: center; cursor: pointer; }
.xs-hist summary::-webkit-details-marker { display: none; }
.xs-more { flex-shrink: 0; font-size: 13px; text-decoration: underline; }
.xs-hist[open] .xs-more { visibility: hidden; }
.xs-hrows { margin-top: 8px; display: flex; flex-direction: column; }
.xs-hrows div { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 6px; padding: 5px 0; border-top: 1px solid #FDE68A; font-variant-numeric: tabular-nums; }
.xs-hrows b { text-align: right; }
.xs-fields { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; } .xs-fields.one { grid-template-columns: 1fr; }
.xs-f { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); text-align: left; min-height: 84px; }
.xs-f small { font-size: 13px; color: var(--muted); } .xs-f b { font-size: 30px; line-height: 1.2; } .xs-f > span { font-size: 14px; }
.xs-f.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,72,15,.12); }
.xs-units { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } .xs-units .chip { height: 38px; flex-shrink: 0; font-size: 14px; padding: 0 14px; }
.xs-units .chip.on { border-color: var(--primary); background: var(--tint); color: var(--primary-dark); font-weight: 600; }
.xs-quick { min-height: 38px; justify-content: flex-start; } .xs-quick small { font-size: 12px; margin-left: 4px; }
.xs-nav { display: grid; grid-template-columns: auto 1fr; gap: 8px; } .xs-nav .btn { height: 54px; font-size: 16px; } .xs-nav .btn-outline { padding: 0 16px; }
.xs-warn { background: #FEE2E2; color: #991B1B; font-size: 14px; padding: 8px 12px; border-radius: 10px; margin-bottom: 8px; text-align: center; }
@media (prefers-reduced-motion: reduce) { .xs-one.in-r, .xs-one.in-l { animation: none; } }

/* v22 ปรับจากรีวิว: ตัวใหญ่ขึ้น ราคาก่อน จำนวนเป็นแถวเล็ก หน่วยเป็น dropdown ไม่มีปัด */
.xs-grp .xs-h { font-size: 15px; margin-top: 12px; }
.xs-ck { min-height: 66px; gap: 14px; padding: 10px 12px; }
.xs-ck-t b { font-size: 18px; line-height: 1.3; } .xs-ck-t small { font-size: 14px; }
.xs-box { width: 30px; height: 30px; border-radius: 9px; }
.xs-ck.on .xs-box::after { width: 8px; height: 15px; }
.xs-date .chip { height: 48px; font-size: 16px; } .xs-search input { height: 54px; font-size: 18px; }
.xs-hist { font-size: 15px; } .xs-hrows div { grid-template-columns: 1.4fr 1fr auto; }
.xs-price { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); text-align: left; }
.xs-price small { font-size: 14px; color: var(--muted); } .xs-price b { font-size: 40px; line-height: 1.15; }
.xs-price.on, .xs-qbox.on { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,72,15,.12); }
.xs-qty { display: grid; grid-template-columns: 1fr 96px 120px; gap: 8px; align-items: center; }
.xs-qty-l { font-size: 15px; display: flex; flex-direction: column; line-height: 1.2; } .xs-qty-l small { font-size: 12px; }
.xs-qbox { height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.xs-unit { height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; padding: 0 10px; }
.xs-newunit { display: grid; grid-template-columns: 1fr auto; gap: 8px; } .xs-newunit[hidden] { display: none; }
.xs-newunit input { height: 48px; border: 1.5px solid var(--primary); border-radius: 12px; padding: 0 12px; font-size: 16px; } .xs-newunit .btn { height: 48px; }
.xs-nav { grid-template-columns: 54px auto 1fr; } .xs-arrow { padding: 0; font-size: 26px; } .xs-arrow:disabled { opacity: .35; }
/* v23 แก้วิธีจ่ายหลังขาย + โหมดฝึก */
.ftag.ft-prac, .ft-prac { background: #EEE8FF; color: #5236B8; }
.prac-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: repeating-linear-gradient(135deg, #EEE8FF 0 14px, #E4DBFF 14px 28px); color: #3D2696; font-size: 14px; border-bottom: 1px solid #D6C9FF; }
.prac-bar.hidden { display: none; }
.prac-bar span { flex: 1; min-width: 0; }
.prac-end { flex: none; height: 40px; padding: 0 14px; border-radius: 10px; border: 1.5px solid #5236B8; background: #fff; color: #5236B8; font-weight: 700; font-size: 14px; }
.prac-txt ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; line-height: 1.45; }
.prac-txt .ftag { font-size: 13px; padding: 1px 7px; }
.od-payrow { gap: 8px; }
.od-payrow .pill { margin-left: auto; }
.od-fix { height: 36px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; }
.pf-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.pf-seg .small { grid-column: 1 / -1; }
.pf-seg button { height: 48px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 700; color: var(--ink); }
.pf-seg button.on { border-color: var(--ok, #12A150); background: #E6F9EC; color: #067A3A; }
.od-fixnote { font-size: 12px; color: var(--muted); text-align: right; }
.k-prac { outline: 3px dashed #8B6CF0; outline-offset: -3px; }

/* ===== v24 ธีมลูกค้าแบบคลีน (หน้าแรกรูปเต็มจอ + แถบล่าง) =====
   สีเข้มแบบพริกแห้ง/น้ำตาลเข้ม บนพื้นเทาอุ่น · ตัวอักษรหัวข้อตัวหนาใหญ่ · ใช้เฉพาะหน้าลูกค้า (body.c) */
body.c {
  --primary: #B3301C; --primary-dark: #852212; --primary-bright: #C2391F;
  --tint: #FAEAE5; --tint-2: #F3D3CA; --ground: #F3F1EE; --surface: #FFFFFF;
  --ink: #33190F; --muted: #6F5F58; --faint: #9C8E88; --line: #E6E0DA; --line-soft: #EFEBE7;
  --c-display: 'Google Sans', 'Kanit', system-ui, sans-serif;
  background: var(--ground);
}
body.c .page { background: var(--ground); }
body.c .topbar { background: var(--surface); border-bottom-color: transparent; }
body.c .topbar h1 { font-family: var(--c-display); font-weight: 700; letter-spacing: -.01em; }
body.c .btn-primary { background: var(--primary); }
body.c .btn-primary:active { background: var(--primary-dark); }
body.c .section-title { font-family: var(--c-display); font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
body.c .tabs { background: var(--surface); }
body.c .tab.on { color: var(--primary); }
body.c .fcard .thumb, body.c .lrow .thumb { border-radius: 14px; }
body.c .lrow { background: var(--surface); border-radius: 16px; border: 0; padding: 10px; margin-bottom: 10px; }
body.c .fcard { background: var(--surface); border-radius: 18px; padding: 8px 8px 12px; }
body.c .fcard .name { padding: 0 4px; }
body.c .fcard .row { padding: 0 4px; }

/* แถบล่าง: ตัวหนังสือล้วน อ่านง่าย แตะง่าย */
.ctabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 0 8px env(safe-area-inset-bottom, 0px); display: flex; justify-content: center; }
.ctabs-in { display: flex; width: 100%; max-width: 560px; }
.ctabs a { flex: 1; white-space: nowrap; display: flex; align-items: center; justify-content: center; height: 62px; font-family: var(--c-display); font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; position: relative; }
.ctabs a[aria-current="page"] { color: var(--primary); }
.ctabs a[aria-current="page"]::after { content: ''; position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); width: 28px; height: 3px; border-radius: 2px; background: var(--primary); }
.ctabs .n { margin-left: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }
body.has-ctabs .page { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
body.has-ctabs .bottom { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }

/* ---- หน้าแรก ---- */
.ch { position: relative; height: 100svh; min-height: 600px; display: flex; flex-direction: column; overflow: hidden; background: #2A140C; color: #fff; }
.ch-photo { position: absolute; inset: 0; background: #2A140C center / cover no-repeat; }
.ch-photo.fallback { background: radial-gradient(120% 70% at 50% 100%, #7A2A16 0%, #3A170D 55%, #24110A 100%); }
.ch-art { position: relative; z-index: 2; flex: 1; min-height: 0; display: grid; place-items: center; padding: 20px 24px 0; }
.ch-art img { max-width: min(100%, 460px); max-height: 100%; min-height: 0; border-radius: 18px; display: block; }
.ch-art + .ch-card { margin-top: 16px; }
.ch-photo::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,8,4,.72) 0%, rgba(20,8,4,.35) 30%, rgba(20,8,4,0) 50%, rgba(20,8,4,0) 62%, rgba(20,8,4,.55) 100%); z-index: 1; }
.ch-top { position: relative; z-index: 2; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 0; }
.ch-logo { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.55); font-family: var(--c-display); font-weight: 700; font-size: 18px; color: #fff; backdrop-filter: blur(6px); }
.ch-mode { justify-self: center; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 22px; border: 1.5px solid rgba(255,255,255,.75); color: #fff; text-decoration: none; font-family: var(--c-display); font-weight: 700; font-size: 15px; background: rgba(20,8,4,.18); backdrop-filter: blur(6px); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-bag { position: relative; width: 44px; height: 44px; display: grid; place-items: center; color: #fff; justify-self: end; }
.ch-bag svg { width: 26px; height: 26px; }
.ch-bag .n { position: absolute; top: 2px; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }
.ch-head { position: relative; z-index: 2; text-align: center; padding: 34px 20px 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ch-status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; letter-spacing: .02em; color: #fff; padding: 5px 12px; border-radius: 16px; background: rgba(20,8,4,.35); }
.ch-status i { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); }
.ch-status.off i { background: #F87171; box-shadow: 0 0 0 3px rgba(248,113,113,.25); }
.ch-head h1 { margin: 0; font-family: var(--c-display); font-weight: 700; font-size: clamp(38px, 11vw, 60px); line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 2px 18px rgba(0,0,0,.35); white-space: pre-line; }
.ch-shop { margin: 0; font-size: 15px; opacity: .9; }
.ch-card { position: relative; z-index: 2; margin: auto 16px calc(78px + env(safe-area-inset-bottom, 0px)); align-self: center; width: min(calc(100% - 32px), 460px); background: var(--surface); color: var(--ink); border-radius: 20px; padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 14px; text-align: center; box-shadow: 0 18px 40px rgba(20,8,4,.28); }
.ch-notice { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.ch-kick { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--primary); }
.ch-ntitle { font-family: var(--c-display); font-weight: 700; font-size: 23px; line-height: 1.2; color: var(--ink); text-wrap: balance; }
.ch-ntext { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.5; }
.ch-cta { height: 56px; font-size: 18px; border-radius: 14px; }
.ch-steps { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.ch-demo { font-size: 13px; color: var(--faint); }
.ch-demo a { color: var(--muted); }
@media (min-width: 700px) { .ch-head { padding-top: 60px; } .ch-card { margin-bottom: 100px; } }

/* ---- ออเดอร์ของฉัน ---- */
.myo { padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.myo h1 { font-family: var(--c-display); font-weight: 700; font-size: 30px; margin: 8px 0 4px; letter-spacing: -.01em; }
.myo-row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center; background: var(--surface); border-radius: 16px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.myo-no { grid-row: span 2; font-family: var(--c-display); font-weight: 700; font-size: 24px; min-width: 64px; }
.myo-st { font-weight: 700; font-size: 15px; }
.myo-st.live { color: var(--primary); }
.myo-meta { grid-column: 2; font-size: 13px; color: var(--muted); }
.myo-go { grid-row: 1 / span 2; grid-column: 3; color: var(--faint); font-size: 22px; }
.myo-empty { text-align: center; padding: 48px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 14px; align-items: center; }
/* ตั้งค่าหน้าแรกลูกค้า: พรีวิวมือถือ + ฟอร์ม */
.hp { display: grid; grid-template-columns: 168px 1fr; gap: 18px; align-items: start; }
@media (max-width: 560px) { .hp { grid-template-columns: 1fr; } .hp-phone { justify-self: center; } }
@media (min-width: 561px) { .hp-phone { position: sticky; top: 96px; } }
.hp-phone { position: relative; width: 168px; aspect-ratio: 9 / 18; border-radius: 22px; overflow: hidden; background: #24110A; border: 5px solid #1B1B1B; display: flex; flex-direction: column; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.hp-photo { position: absolute; inset: 0; background: center / cover no-repeat; }
.hp-photo.none { background: radial-gradient(120% 70% at 50% 100%, #7A2A16 0%, #3A170D 55%, #24110A 100%); }
.hp-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,8,4,.7) 0%, rgba(20,8,4,0) 50%, rgba(20,8,4,.5) 100%); }
.hp-photo.none::before { content: 'ยังไม่มีรูป'; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.5); font-size: 12px; z-index: 1; }
.hp-txt { position: relative; z-index: 1; padding: 30px 10px 0; text-align: center; color: #fff; }
.hp-h { font-size: 17px; line-height: 1.1; font-weight: 700; white-space: pre-line; display: block; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.hp-card { position: relative; z-index: 1; margin: auto 8px 10px; background: #fff; border-radius: 10px; padding: 9px 8px 8px; display: flex; flex-direction: column; gap: 3px; text-align: center; color: #33190F; }
.hp-k { font-size: 8px; font-weight: 700; letter-spacing: .1em; color: #B3301C; }
.hp-k:empty, .hp-t:empty { display: none; }
.hp-t { font-size: 11px; line-height: 1.2; }
.hp-btn { margin-top: 3px; height: 22px; border-radius: 6px; background: #B3301C; color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center; }
.hp-pick { position: relative; cursor: pointer; }
.hp-pick.busy { opacity: .5; pointer-events: none; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg3 label { position: relative; }
.seg3 input { position: absolute; opacity: 0; inset: 0; }
.seg3 span { display: grid; place-items: center; height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; }
.seg3 input:checked + span { border-color: var(--primary); background: var(--tint); color: var(--primary-dark); }
.seg3 input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.chip.on { border-color: var(--primary); background: var(--tint); color: var(--primary-dark); }
/* ---- หน้าแรกแบบคลิปเมนู (ปักตะกร้า) ---- */
body.feed { overflow: hidden; background: #000; }
.cf { height: 100svh; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.cf::-webkit-scrollbar { display: none; }
.cf > .cf-s, .cf > .ch { height: 100svh; scroll-snap-align: start; scroll-snap-stop: always; }
.cf > .ch { min-height: 0; }
.cf-s { position: relative; overflow: hidden; background: #111; }
.cf-s video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #111; }
.cf-s.fit video { object-fit: contain; background: transparent; }
.cf-s.fit::before { content: ''; position: absolute; inset: -40px; background: #111 var(--poster, none) center / cover no-repeat; filter: blur(28px) brightness(.7); }
.cf-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 26%, rgba(0,0,0,0) 62%, rgba(0,0,0,.55) 100%); }
body.feed .ch-top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding-bottom: 8px; }
body.feed .ch > .ch-top { display: none; }
.cf-status { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); top: calc(118px + env(safe-area-inset-top, 0px)); white-space: nowrap; }
body.feed:not(:has(.cf-notice)) .cf-status { top: calc(70px + env(safe-area-inset-top, 0px)); }
.cf-s .ch-head { position: absolute; left: 0; right: 0; top: calc(64px + env(safe-area-inset-top, 0px)); padding-top: 18px; color: #fff; }
.cf-s .ch-head h1 { font-size: clamp(32px, 9vw, 52px); }
body.feed .cf-s .ch-head { top: calc(108px + env(safe-area-inset-top, 0px)); }
body.feed:not(:has(.cf-notice)) .cf-s .ch-head { top: calc(64px + env(safe-area-inset-top, 0px)); }
.cf-notice { position: fixed; z-index: 20; top: calc(64px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), 520px); display: flex; gap: 8px; align-items: baseline; text-align: left; padding: 9px 14px; border: 0; border-radius: 12px; background: rgba(255,255,255,.94); color: var(--ink); font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.cf-notice b { color: var(--primary); flex: none; font-size: 13px; letter-spacing: .04em; }
.cf-notice span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cf-notice.open span { white-space: normal; }
.cf-sound { position: fixed; z-index: 21; right: 14px; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); }
body.feed:has(.cf-end.on) .cf-sound { display: none; }
body.feed .cf-end .ch-notice { display: none; } /* มีแถบประกาศด้านบนแล้ว */
body.feed .cf-end .ch-card { margin-top: auto; }
.cf-play { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; }
.cf-play[hidden] { display: none; }
.cf-hint { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); bottom: calc(156px + env(safe-area-inset-bottom, 0px)); color: rgba(255,255,255,.85); font-size: 13px; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.5); animation: cfhint 2.4s ease-in-out 3; }
@keyframes cfhint { 50% { transform: translate(-50%, -6px); } }
@media (prefers-reduced-motion: reduce) { .cf-hint { animation: none; } }
/* ป้ายตะกร้า: ติดล่างซ้ายตลอดคลิป · แตะ = ดูเมนู/เลือกตัวเลือก · + = ใส่ตะกร้าเลย */
.cf-tag { position: absolute; z-index: 3; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 480px; }
@media (min-width: 560px) { .cf-tag { left: 50%; transform: translateX(-50%); width: 456px; right: auto; } }
.cf-tag-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.cf-cart { width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.cf-cart svg { width: 18px; height: 18px; }
.cf-tag-main img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; background: var(--tint); }
.cf-tag-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cf-tag-t b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-tag-t span { font-size: 15px; font-weight: 700; color: var(--primary); }
.cf-tag.out .cf-tag-t span { color: var(--muted); }
.cf-tag.out img { filter: grayscale(1); opacity: .6; }
.cf-add { flex: none; min-width: 48px; height: 48px; padding: 0 14px; border-radius: 12px; border: 0; background: var(--primary); color: #fff; font-size: 26px; font-weight: 700; display: grid; place-items: center; text-decoration: none; }
.cf-pick { font-size: 16px; }
/* ตั้งค่า: คลิปเมนู */
.clips { display: flex; flex-direction: column; gap: 8px; }
.clip-row { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.clip-th { width: 54px; height: 96px; border-radius: 8px; object-fit: cover; background: #222; }
.clip-row select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; font-size: 15px; }
.clip-row select.bad { border-color: #DC2626; }
.clip-tools { display: flex; flex-direction: column; gap: 4px; }
.clip-tools button { width: 40px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 14px; }
.clip-up { font-size: 13px; color: var(--muted); }
.hp-tag { position: relative; z-index: 1; margin: auto 8px 6px; background: #fff; border-radius: 8px; padding: 5px 6px; display: flex; align-items: center; gap: 5px; font-size: 9px; color: #33190F; }
.hp-tag i { width: 12px; height: 12px; border-radius: 3px; background: #B3301C; flex: none; }
.hp-tag b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-mode { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.save-mode.on { background: var(--ok-tint); color: var(--ok-dark); }
.save-mode.off { background: var(--warn-tint); color: var(--warn-dark); }
/* ความคืบหน้าตอนเพิ่มคลิป */
.clip-busy { border-color: var(--primary); background: var(--tint); }
.clip-busy.bad { border-color: #DC2626; background: #FEF2F2; }
.clip-busy.bad .cb-title { color: #B91C1C; }
.clip-busy .cb-title { font-size: 15px; }
.clip-busy .cb-step { color: var(--ink); font-weight: 600; font-size: 14px; }
.clip-th-wait { display: grid; place-items: center; background: #3a2a24; }
.clip-busy.bad .clip-th { display: grid; place-items: center; background: #FECACA; color: #B91C1C; font-weight: 700; font-size: 22px; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cb-bar { height: 10px; border-radius: 5px; background: rgba(0,0,0,.08); overflow: hidden; }
.cb-bar i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--primary); transition: width .25s ease; }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } .cb-bar i { transition: none; } }
.clip-row.just-added { border-color: var(--ok, #15803D); box-shadow: 0 0 0 3px var(--ok-tint, #DCFCE7); }
[data-cadd].busy { opacity: .55; pointer-events: none; }
/* ===== v25 หน้าแรกหน้าเดียว: หน้าร้าน → คลิป → เมนู (ไม่มีแถบล่าง) ===== */
html.snap { scroll-snap-type: y mandatory; }
html.is-open, html.is-open body { overflow: hidden; }
body.home { background: var(--surface); }
body.home .hs { height: 100svh; scroll-snap-align: start; scroll-snap-stop: always; position: relative; overflow: hidden; }
body.home .ch { min-height: 0; }
body.home .hm { scroll-snap-align: start; max-width: 480px; margin: 0 auto; min-height: 100svh; background: #fff; padding-bottom: 96px; }
body.home .ch-top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding-bottom: 8px; transition: opacity .2s ease; }
body.home.in-menu .ch-top { opacity: 0; pointer-events: none; }
body.home .ch-head { padding-top: calc(78px + env(safe-area-inset-top, 0px)); }
body.home .ch-card { margin-bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }
body.home .ch > .cf-hint { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
body.home .cf-s .cf-hint { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
body.home .cf-tag { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
body.home .cf-tag-main { border: 0; background: none; padding: 0; text-align: left; font: inherit; cursor: pointer; }
body.home .cf-sound { display: none; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
body.home.on-clip .cf-sound { display: grid; }
body.home .mv-cart { transition: transform .2s ease; }
body.home:not(.in-menu) .mv-cart { transform: translateY(110%); pointer-events: none; }
body.home .hm .topbar { top: 0; }
/* ป๊อปอัปใส่ตะกร้า */
.isheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.is-back { position: absolute; inset: 0; background: rgba(20,10,6,.5); opacity: 0; transition: opacity .2s ease; }
.is-card { position: relative; width: 100%; max-width: 520px; max-height: 88svh; display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .22s ease; box-shadow: 0 -10px 30px rgba(0,0,0,.2); }
.isheet.on .is-back { opacity: 1; } .isheet.on .is-card { transform: none; }
@media (prefers-reduced-motion: reduce) { .is-card, .is-back { transition: none; } }
.is-grab { height: 26px; flex: none; display: grid; place-items: center; cursor: grab; touch-action: none; }
.is-grab::before { content: ''; width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.is-x { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ground); color: var(--ink); display: grid; place-items: center; }
.is-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 16px; }
.is-head { display: flex; gap: 14px; align-items: center; padding-right: 44px; }
.is-head img { width: 76px; height: 76px; border-radius: 14px; object-fit: cover; flex: none; background: var(--tint); }
.is-name { font-family: var(--c-display); font-size: 21px; line-height: 1.2; }
.is-price { font-weight: 700; color: var(--primary); font-size: 18px; }
.is-desc { line-height: 1.4; }
.is-note { padding: 10px 12px; border-radius: 12px; font-size: 15px; background: var(--warn-tint); color: var(--warn-dark); }
.is-note.out { background: #FEE2E2; color: #991B1B; }
.is-foot { flex: none; display: flex; gap: 12px; align-items: center; padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line-soft); }
body.c .topbar { min-height: calc(60px + env(safe-area-inset-top, 0px)); box-sizing: border-box; } /* ให้แถบหมวดติดชิดใต้หัวพอดี ไม่มีช่องโหว่ */
/* ===== v26 ลำดับ: คลิป → หน้าร้าน (เปิดมาที่นี่) → เมนู · แถบล่างสีขาวเฉพาะหน้าร้าน/คลิป ===== */
.hbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #fff; border-top: 1px solid var(--line-soft); padding: 0 8px env(safe-area-inset-bottom, 0px); display: flex; justify-content: center; transition: opacity .12s linear; }
.hbar-in { display: flex; width: 100%; max-width: 560px; }
.hbar a { flex: 1; height: 62px; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--c-display); font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; position: relative; }
.hbar a[aria-current="page"] { color: var(--primary); }
.hbar a[aria-current="page"]::after { content: ''; position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%); width: 28px; height: 3px; border-radius: 2px; background: var(--primary); }
body.home.past-bar .hbar { opacity: 0; pointer-events: none; }
body.home .ch-card { margin-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
body.home .cf-tag { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
body.home .cf-sound { bottom: calc(156px + env(safe-area-inset-bottom, 0px)); }
body.home .hm { padding-top: 0; }
body.home .hm .topbar { border-bottom-color: transparent; }
.up-hint { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); top: calc(70px + env(safe-area-inset-top, 0px)); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; font-weight: 600; color: #fff; padding: 5px 12px; border-radius: 14px; background: rgba(20,8,4,.35); backdrop-filter: blur(4px); }
.up-hint.hidden { display: none; }
.up-hint svg { animation: uphint 2.4s ease-in-out 3; }
@keyframes uphint { 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .up-hint svg { animation: none; } }
body.home .ch-head { padding-top: calc(108px + env(safe-area-inset-top, 0px)); }
body.home:not(:has(.cf-s)) .ch-head { padding-top: calc(78px + env(safe-area-inset-top, 0px)); }
/* v27 แถบสีขาวเลื่อนไปกับการปัด: ติดล่างจอ (sticky) จนถึงตำแหน่งจริงเหนือเมนู แล้วพาเมนูขึ้นมา */
body.home .hbar { position: sticky; bottom: 0; transition: none; border-top: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 18px rgba(0,0,0,.12); padding-top: 4px; flex-direction: column; align-items: center; }
body.home .hbar a { height: 54px; }
.hbar-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin-top: 4px; flex: none; }
body.home #shop { height: calc(100svh - 63px - env(safe-area-inset-bottom, 0px)); } /* เหลือที่ให้แถบ (ขอบบนของเมนู) โผล่ใต้หน้าร้านพอดี */
body.home .ch-card { margin-bottom: 20px; }
body.home .hm { margin-top: 0; }
body.home.pulling .ch-top { opacity: 0; pointer-events: none; }
/* ===== v28 หน้าร้าน → คลิป (ปัดซ้าย-ขวา หน้าเดียว) → เมนู ===== */
body.home .ch-head, body.home:not(:has(.cf-s)) .ch-head { padding-top: calc(78px + env(safe-area-inset-top, 0px)); }
body.home:has(#clipsSec) #shop { height: 100svh; }
body.home:has(#clipsSec) .ch-card { margin-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
body.home #clipsSec { height: calc(100svh - 63px - env(safe-area-inset-bottom, 0px)); background: #111; }
.cf-row { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.cf-row::-webkit-scrollbar { display: none; }
.cf-row:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.cf-row > .cf-s { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; position: relative; overflow: hidden; }
body.home .cf-row .cf-tag { bottom: 14px; }
body.home .cf-sound { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
.cf-pill { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); top: calc(70px + env(safe-area-inset-top, 0px)); display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; padding: 8px 16px; border-radius: 20px; background: rgba(20,8,4,.5); color: #fff; backdrop-filter: blur(6px); pointer-events: none; }
.cf-pill b { font-family: var(--c-display); font-size: 16px; }
.cf-swipe { display: inline-flex; opacity: .9; animation: cfswipe 1.8s ease-in-out 4; }
@keyframes cfswipe { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .cf-swipe { animation: none; } }
.cf-dots { position: absolute; z-index: 4; left: 50%; transform: translateX(-50%); top: calc(114px + env(safe-area-inset-top, 0px)); display: flex; gap: 6px; pointer-events: none; }
.cf-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.45); transition: width .2s ease, background .2s ease; }
.cf-dots i.on { width: 20px; border-radius: 4px; background: #fff; }
body.home.pulling .cf-sound { display: none; }
/* v29 ไม่มีป้ายรับเอง/จัดส่งบนหน้าร้าน · ป้ายข้อความคลิปอยู่ตำแหน่งกลางแถบบน · วงกลมมุมซ้ายเป็นปุ่มได้ */
.cf-pill { top: calc(12px + env(safe-area-inset-top, 0px)); height: 44px; box-sizing: border-box; padding: 0 18px; max-width: calc(100% - 136px); }
.cf-pill b { overflow: hidden; text-overflow: ellipsis; }
.cf-dots { top: calc(66px + env(safe-area-inset-top, 0px)); }
a.ch-logo { text-decoration: none; }
a.ch-logo:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* v30 ป้ายเปิด/ปิดอยู่กลางแถบบน (ที่ว่างเดิมของป้ายรับเอง/จัดส่ง) · บนคลิปตรงนี้เป็นข้อความคลิปแทน */
.ch-top .ch-status { justify-self: center; height: 36px; box-sizing: border-box; padding: 0 14px; border-radius: 18px; background: rgba(20,8,4,.38); backdrop-filter: blur(6px); white-space: nowrap; transition: opacity .15s ease; }
body.home.on-clip .ch-top .ch-status { opacity: 0; }
body.home .ch-head, body.home:not(:has(.cf-s)) .ch-head { padding-top: calc(84px + env(safe-area-inset-top, 0px)); }
/* ===== v31 ป้ายตะกร้าบนคลิป (แบบร้านค้าในคลิปสั้น): การ์ดสินค้า + ปุ่มแดง · เลื่อนเข้ามาหลังคลิปเริ่ม ===== */
body.home .cf-row .cf-tag { left: 12px; right: 12px; bottom: 14px; padding: 10px; gap: 10px; border-radius: 16px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: 456px; margin: 0 auto; }
.cf-s .cf-tag { opacity: 0; transform: translateY(26px) scale(.96); }
.cf-s.on .cf-tag { animation: cfpop .55s cubic-bezier(.2, 1.35, .4, 1) .6s both; }
@keyframes cfpop { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
.cf-img { position: relative; flex: none; width: 64px; height: 64px; }
.cf-img img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--tint); display: block; }
.cf-badge { position: absolute; left: -6px; top: -6px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #FF8A00, #F04A1C); box-shadow: 0 3px 8px rgba(240,74,28,.5); border: 2px solid #fff; }
.cf-badge svg { width: 14px; height: 14px; }
.cf-s.on .cf-badge { animation: cfbounce 2.8s ease-in-out 1.4s infinite; }
@keyframes cfbounce { 0%, 70%, 100% { transform: none; } 78% { transform: translateY(-5px) rotate(-8deg); } 86% { transform: translateY(0) rotate(4deg); } 92% { transform: rotate(0); } }
body.home .cf-tag-main { gap: 12px; }
.cf-tag-t { gap: 1px; }
.cf-meta { font-size: 12px; font-weight: 600; color: #E5591C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-tag-t b { font-size: 16px; line-height: 1.25; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cf-price { font-family: var(--c-display); font-size: 20px; font-weight: 700; color: #E11D48; line-height: 1.15; }
.cf-tag.out .cf-price { color: var(--muted); text-decoration: line-through; }
.cf-tag.out .cf-meta { color: var(--muted); }
.cf-buy { position: relative; overflow: hidden; flex: none; height: 48px; padding: 0 16px; border: 0; border-radius: 12px; display: inline-flex; align-items: center; gap: 6px; font-family: var(--c-display); font-weight: 700; font-size: 16px; color: #fff; background: linear-gradient(180deg, #F43F5E, #E11D48); box-shadow: 0 4px 12px rgba(225,29,72,.4); }
.cf-buy:active { transform: scale(.97); }
.cf-buy::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-18deg); }
.cf-s.on .cf-buy::after { animation: cfshine 3.2s ease-in-out 1.6s infinite; }
@keyframes cfshine { 0%, 60% { left: -60%; } 85%, 100% { left: 130%; } }
.fly { position: fixed; z-index: 80; border-radius: 12px; object-fit: cover; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
@media (prefers-reduced-motion: reduce) { .cf-s.on .cf-tag, .cf-s.on .cf-badge, .cf-s.on .cf-buy::after { animation: none; } .cf-s .cf-tag { opacity: 1; transform: none; } }
.cf-tag-t b { order: -1; } /* ชื่ออาหารก่อน แล้วค่อยคำโปรย แล้วราคา */
body.home .cf-sound { bottom: calc(176px + env(safe-area-inset-bottom, 0px)); }
.cf-meta { color: var(--muted); font-weight: 500; } .cf-meta.hot { color: #E5591C; font-weight: 700; }
/* ===== v32 แถบล่าง 2 แบบ: ขอบเมนูบางๆ (ตะกร้าว่าง) / แถบตะกร้า (มีของ) · ไม่มีไอคอนตะกร้ามุมขวาบน ===== */
:root { --hb: 40px; }
body.home .hbar { padding: 4px 12px calc(6px + env(safe-area-inset-bottom, 0px)); gap: 2px; }
body.home .hbar-in { align-items: center; gap: 10px; }
body.home .hbar a { height: auto; flex: none; }
body.home .hbar .hb-menu { flex: 1; height: 26px; gap: 6px; font-size: 15px; color: var(--ink); justify-content: center; }
body.home .hbar .hb-menu::after, body.home .hbar .hb-cart::after { display: none; }
body.home .hbar.has-cart .hb-menu { flex: none; height: 48px; padding: 0 6px; font-size: 15px; }
.hb-cart { flex: 1 !important; height: 48px !important; padding: 0 16px; border-radius: 14px; gap: 8px !important; justify-content: flex-start !important; color: #fff !important; background: var(--primary); font-size: 16px !important; }
.hb-cart[hidden] { display: none !important; }
.hb-cart b { font-weight: 700; }
.hb-sep { opacity: .6; }
.hb-go { margin-left: auto; font-size: 15px; }
body.home:has(#clipsSec) #shop { height: 100svh; }
body.home #clipsSec { height: calc(100svh - var(--hb)); }
body.home #shop { height: calc(100svh - var(--hb)); }
body.home:has(#clipsSec) .ch-card { margin-bottom: calc(var(--hb) + 16px); }
body.home .cf-sound { bottom: calc(var(--hb) + 116px); }
.save-mode.bad { background: #FEE2E2; color: #991B1B; align-items: center; }
.hp-thumb { width: 72px; height: 96px; border-radius: 10px; background: #EEE center/cover no-repeat; border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.hp-thumb span { font-size: 12px; color: var(--muted); text-align: center; padding: 4px; }
.hp-clipsec { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 4px; }
/* ===== v33 แถบล่างแบบใส: ไล่เงาดำบนรูป/คลิป ตัวอักษรขาว · พอดึงเมนูขึ้น แถบค่อยๆ กลายเป็นขอบบนสีขาวของเมนู (--p 0→1) ===== */
body.home .hbar { --p: 0; background: transparent; box-shadow: none; border-radius: 0; margin-top: calc(-1 * var(--hb)); isolation: isolate;
  color: color-mix(in srgb, var(--ink) calc(var(--p) * 100%), #fff); }
body.home .hbar::after { content: ''; position: absolute; z-index: -2; left: 0; right: 0; bottom: 0; top: -44px; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,5,2,0) 0%, rgba(10,5,2,.42) 38%, rgba(10,5,2,.78) 100%); opacity: calc(1 - var(--p)); }
body.home .hbar::before { content: ''; position: absolute; z-index: -1; inset: 0; pointer-events: none; background: #fff; border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,.18); opacity: var(--p); }
body.home .hbar .hb-menu { color: inherit; text-shadow: 0 1px 6px rgba(0,0,0, calc(.45 * (1 - var(--p)))); }
body.home .hbar .hbar-grip { background: currentColor; opacity: calc(.55 - var(--p) * .3); }
body.home .hbar .hb-cart { box-shadow: 0 6px 18px rgba(0,0,0,.28); }
body.home #shop, body.home:has(#clipsSec) #shop, body.home #clipsSec { height: 100svh; }
body.home .cf-row .cf-tag { bottom: calc(var(--hb) + 12px); }
body.home .cf-dots, body.home .cf-pill { z-index: 4; }
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }
body.home .hbar { transition: --p .22s ease; }
body.home .hbar.lift { --p: 1; }
@media (prefers-reduced-motion: reduce) { body.home .hbar { transition: none; } }
/* ===== v34 แถบล่างกลับเป็นสีขาว + รายละเอียดสีแดงเลือดหมู · วางทับขอบล่างของรูป/คลิป ให้มุมโค้งเห็นภาพด้านหลัง (ไม่เห็นมุมเหลี่ยม) ===== */
body.home .hbar, body.home .hbar.lift { --p: 1; transition: none; color: var(--primary); }
body.home .hbar::before { box-shadow: 0 -4px 16px rgba(40,10,4,.16); }
body.home .hbar .hb-menu { color: var(--primary); text-shadow: none; }
body.home .hbar .hbar-grip { background: var(--primary); opacity: .3; }
/* ===== v35 หน้าร้าน: แถบใส "เมนูแนะนำ · ปัดขึ้น" อยู่ในหน้าร้าน (เลื่อนไปกับนิ้ว) · แถบขาวเมนู/ตะกร้าอยู่ใต้คลิป ไม่ติดค้างบนหน้าร้าน ===== */
body.home:has(#clipsSec) .hbar { position: relative; }
.sh-hint { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; border: 0; background: none; color: #fff; font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
.sh-hint::before { content: ''; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; top: -44px; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,5,2,0) 0%, rgba(10,5,2,.42) 38%, rgba(10,5,2,.78) 100%); }
.sh-hint .hbar-grip { background: #fff; opacity: .55; margin-top: 0; }
.sh-hint-t { display: inline-flex; align-items: center; gap: 6px; height: 26px; font-family: var(--c-display); font-weight: 700; font-size: 15px; text-shadow: 0 1px 6px rgba(0,0,0,.45); white-space: nowrap; max-width: 100%; }
.sh-hint-t b { overflow: hidden; text-overflow: ellipsis; }
.sh-sep { opacity: .7; }
.sh-hint svg { flex: none; animation: uphint 2.4s ease-in-out 3; }
.sh-hint:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
@media (prefers-reduced-motion: reduce) { .sh-hint svg { animation: none; } }
body.home:has(#clipsSec) .ch-card { margin-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
/* ===== v36 รอยต่อหน้าร้าน → คลิป: ต่อกันด้วยสีเข้มเดียวกัน + หน้าร้านจมลง/มืดลงตอนปัด คลิปเลื่อนทับขึ้นมา ===== */
body.home:has(#clipsSec) #shop { z-index: 0; will-change: transform; }
body.home:has(#clipsSec) #shop::after { content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none; background: #120A06; opacity: calc(var(--k, 0) * .7); }
body.home #clipsSec { position: relative; z-index: 1; background: #120A06; box-shadow: 0 -18px 40px rgba(0,0,0,.45); }
body.home #clipsSec::before { content: ''; position: absolute; z-index: 3; left: 0; right: 0; top: 0; height: 150px; pointer-events: none;
  background: linear-gradient(180deg, rgba(18,10,6,.85) 0%, rgba(18,10,6,.35) 55%, rgba(18,10,6,0) 100%); }
.sh-hint::before { background: linear-gradient(180deg, rgba(18,10,6,0) 0%, rgba(18,10,6,.5) 40%, rgba(18,10,6,.9) 100%); }
body.home .hbar { z-index: 25; }
body.home .hm { position: relative; z-index: 1; }
/* ===== v37 ยกเลิกคลิปเลื่อนทับ · กลับเป็นเลื่อนต่อกันธรรมดาแบบคลิปสั้น: รอยต่อเป็นสีเข้มทั้งสองฝั่ง ไม่เห็นเส้นตัด ===== */
body.home:has(#clipsSec) #shop { will-change: auto; }
body.home:has(#clipsSec) #shop::after { display: none; }
body.home #clipsSec { box-shadow: none; z-index: auto; }
.sh-hint::before { top: -64px; background: linear-gradient(180deg, rgba(18,10,6,0) 0%, rgba(18,10,6,.55) 45%, #120A06 100%); }
body.home #clipsSec::before { height: 140px; background: linear-gradient(180deg, #120A06 0%, rgba(18,10,6,.55) 45%, rgba(18,10,6,0) 100%); }
/* ===== v38 คำบรรยายแต่ละคลิป (ตัวอักษรวิ่งเมื่อยาว) · ลูกศรขอบจอ + คลิปขยับให้รู้ว่าปัดได้ ===== */
.cf-pill { width: auto; max-width: calc(100% - 136px); }
.cf-cap { display: block; overflow: hidden; min-width: 0; max-width: 100%; }
.cf-track { display: flex; width: max-content; }
.cf-track b { font-family: var(--c-display); font-size: 16px; white-space: nowrap; flex: none; }
.cf-track.run { gap: 48px; animation: cfmarq var(--dur, 8s) linear infinite; animation-play-state: paused; }
body.home.on-clip .cf-track.run { animation-play-state: running; }
.cf-pill:has(.cf-track.run) { width: calc(100% - 136px); }
.cf-cap:has(.cf-track.run) { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
@keyframes cfmarq { 0%, 14% { transform: none; } 100% { transform: translateX(calc(-1 * var(--dist))); } }
@media (prefers-reduced-motion: reduce) {
  .cf-track.run { animation: none; width: 100%; } .cf-track.run b + b { display: none; }
  .cf-track.run b { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
  .cf-cap:has(.cf-track.run) { -webkit-mask-image: none; mask-image: none; }
}
.cf-edge { position: absolute; z-index: 4; top: 34%; bottom: 40%; width: 34px; border: 0; padding: 0; display: grid; place-items: center; color: rgba(255,255,255,.85); cursor: pointer; }
.cf-edge[hidden] { display: none; }
.cf-edge.r { right: 0; background: linear-gradient(270deg, rgba(0,0,0,.32), rgba(0,0,0,0)); border-radius: 16px 0 0 16px; }
.cf-edge.l { left: 0; background: linear-gradient(90deg, rgba(0,0,0,.32), rgba(0,0,0,0)); border-radius: 0 16px 16px 0; }
.cf-edge svg { filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.cf-edge:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.cf-track.run { padding-left: 14px; }
.cf-edge.r, .cf-edge.l { border-radius: 0; top: 26%; bottom: 34%; width: 40px; }
.cf-edge.r { background: linear-gradient(270deg, rgba(0,0,0,.24), rgba(0,0,0,0)); }
.cf-edge.l { background: linear-gradient(90deg, rgba(0,0,0,.24), rgba(0,0,0,0)); }
/* v39 คำบรรยายคลิปสั้นๆ อยู่นิ่ง (ไม่วิ่ง) · ยาวเกินป้ายตัดด้วย … */
.cf-track { width: 100%; }
.cf-track b { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
/* v40 คำบรรยายคลิปไม่เกิน 60 ตัว แสดงครบ 1–2 บรรทัด (ไม่ตัดด้วย …) · ป้ายกว้างขึ้นเต็มที่ว่างข้างโลโก้ */
.cf-pill { height: auto; min-height: 44px; padding: 8px 16px; border-radius: 22px; max-width: calc(100% - 92px); white-space: normal; }
.cf-pill:has(.cf-track b:not(:only-child)), .cf-pill { width: auto; }
.cf-cap { overflow: visible; }
.cf-track { display: block; width: auto; }
.cf-track b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; text-align: center; font-size: 15px; line-height: 1.4; text-overflow: clip; }
.cf-pill { left: 46px; right: 46px; margin: 0 auto; transform: none; width: fit-content; max-width: none; }
.cf-pill { left: 70px; right: 16px; }
/* ===== v41 รับออเดอร์ · โหมดจดไว (วงล้อเหมือนเลือกวันที่) ===== */
.pm-switch { margin: 0 0 10px; }
.pm-switch .chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pos.pm-quick .pos-menu { display: flex; flex-direction: column; }
.pq { display: flex; flex-direction: column; gap: 12px; padding-bottom: 120px; }
.pq-wheels { display: grid; grid-template-columns: 0.95fr 1.25fr 0.9fr; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 6px; }
.pq-col.none { visibility: hidden; }
.wh { position: relative; height: calc(44px * 5); }
.wh-band { position: absolute; left: 0; right: 0; top: 88px; height: 44px; border-radius: 12px; background: var(--tint); border: 1.5px solid var(--primary); pointer-events: none; }
.wh-list { position: relative; height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; padding: 88px 0; box-sizing: border-box; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.wh-list::-webkit-scrollbar { display: none; }
.wh-list:focus-visible { outline: none; }
.wh:focus-within .wh-band { box-shadow: 0 0 0 3px rgba(185,50,30,.25); }
.wh-i { height: 44px; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 4px; text-align: center; font-size: 15px; line-height: 1.15; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; user-select: none; }
.wh-i small { font-size: 11px; color: var(--faint, #9a8f88); }
.wh-i.on { color: var(--ink); font-weight: 700; font-size: 16px; }
.wh-i.on small { color: var(--primary); font-weight: 600; }
.wh-i.off { text-decoration: line-through; opacity: .5; }
.pq-g { display: flex; gap: 8px; align-items: flex-start; }
.pq-gl { flex: none; width: 64px; padding-top: 9px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pq-g .chips, .pq-note .chips { gap: 6px; }
.pq .chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pq-note { display: flex; flex-direction: column; gap: 8px; }
.pq-note input { height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; font-size: 16px; background: #fff; }
.pq-add { display: flex; gap: 10px; align-items: center; position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 3; background: var(--ground, #F3F1EE); padding: 6px 0; }
.pq-add .btn { height: 54px; font-size: 18px; }
.pq-ticket { background: #FFFDF6; border: 1px dashed #D9CFC2; border-radius: 14px; padding: 10px 12px; }
.pq-ticket ol { margin: 6px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 2px; }
.pq-ticket li { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.pq-ticket li::marker { color: var(--muted); font-weight: 700; }
.pq-ticket li.new { animation: pqnew 1s ease; }
@keyframes pqnew { from { background: var(--tint); } to { background: transparent; } }
.pq-l { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 8px 0; font: inherit; color: var(--ink); cursor: pointer; }
.pq-l span { color: var(--primary-dark, #8f2717); } .pq-l i { color: var(--muted); font-style: normal; }
.pq-p { font-size: 14px; color: var(--muted); }
.pq-x { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 20px; }
.pq-empty { list-style: none; margin-left: -22px; color: var(--muted); font-size: 14px; padding: 6px 0; }
@media (min-width: 901px) { .pq-add { bottom: 0; } }
/* แถบเลือกแถวกลางแถบเดียวพาดทุกคอลัมน์ (แบบวงล้อเลือกวันที่) */
.pq-wheels { position: relative; }
.pq-wheels::before { content: ''; position: absolute; left: 6px; right: 6px; top: calc(6px + 88px); height: 44px; border-radius: 12px; background: var(--tint); border: 1.5px solid var(--primary); pointer-events: none; }
.wh-band { display: none; }
.pq-col { position: relative; }
.pq-col + .pq-col::before { content: ''; position: absolute; left: -3px; top: 20px; bottom: 20px; width: 1px; background: var(--line-soft, #eee); }
/* v42 คอลัมน์วงล้อกว้างคงที่ ไม่ขยายตามชื่อเมนู */
.pq-wheels { grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr) minmax(0, .95fr); }
.pq-col, .wh, .wh-list { min-width: 0; }
.wh-i { align-items: stretch; padding: 0 6px; }
.wh-t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ===== v43 ฝั่งร้าน จอแนวนอน (แท็บเล็ต) แบบ Trackoo: แถบบนเม็ดยา · แถบออเดอร์ที่กำลังทำ · การ์ดเมนู · แผงรายละเอียดออเดอร์ ===== */
.nav-shop, .nav-main, .nav-ctl { display: contents; }
.ol, .pm-head .pm-title, .pm-search, .pc-head, .pc-types, .pi-addbtn, .pi-ok { display: none; }
@media (min-width: 901px) {
  .m-page { flex-direction: column; --ground: #F3F2EF; }
  .m-nav { position: sticky; top: 0; z-index: 30; width: auto; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 14px 24px; background: var(--ground); border: 0; }
  .m-nav .logo { margin: 0; width: 44px; height: 44px; border-radius: 14px; font-size: 20px; color: #fff; }
  .nav-shop { display: block; font-size: 18px; font-weight: 700; color: var(--ink); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
  .nav-main { display: flex; gap: 4px; margin: 0 auto; padding: 6px; background: var(--surface); border-radius: 999px; box-shadow: 0 1px 2px rgba(40,20,10,.06); }
  .nav-main button { width: auto; height: 44px; flex-direction: row; gap: 8px; padding: 0 18px; border-radius: 999px; font-size: 15px; color: var(--muted); }
  .nav-main button svg { width: 20px; height: 20px; }
  .nav-main button.on { background: var(--primary); color: #fff; font-weight: 600; }
  .nav-main button.on svg { color: #fff; }
  .nav-main button:hover:not(.on) { background: var(--ground); color: var(--ink); }
  .nav-ctl { display: flex; gap: 8px; align-items: center; }
  .m-nav .nav-sep { display: none; }
  .m-nav .nav-mini, .m-nav .nav-a.nav-mini { width: auto; height: 40px; flex-direction: row; padding: 0 12px; border-radius: 999px; background: var(--surface); font-size: 13px; }
  .m-nav #whoBadge { margin: 0 !important; padding: 6px 12px !important; background: var(--surface); border-radius: 999px; font-size: 13px !important; color: var(--ink) !important; white-space: nowrap; }
  .m-nav #logoutBtn { width: auto; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface); font-size: 13px; }
  .m-head .head-pos { display: none; }
  body[data-mview="pos"] .m-head { display: none; }
  body[data-mview="pos"] #view-admin { padding: 4px 24px 24px !important; }
  .pos { grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; }
  /* แถบออเดอร์ที่กำลังทำ */
  .ol { display: block; margin-bottom: 18px; }
  .ol-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .ol-head b { font-size: 20px; } .ol-head b span { color: var(--muted); font-weight: 400; }
  .ol-nav { display: flex; gap: 8px; }
  .ol-nav button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 20px; color: var(--primary); }
  .ol-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
  .ol-row::-webkit-scrollbar { display: none; }
  .ol-card { flex: 0 0 calc((100% - 24px) / 3); min-width: 220px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 0; border-radius: 18px; background: var(--surface); text-align: left; font: inherit; color: var(--ink); cursor: pointer; box-shadow: 0 1px 2px rgba(40,20,10,.05); }
  .ol-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .ol-top b { font-size: 16px; }
  .ol-tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--primary); color: var(--primary); white-space: nowrap; }
  .ol-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ol-n { font-size: 13px; color: var(--muted); }
  .ol-bar { position: relative; display: block; height: 30px; margin-top: 6px; border-radius: 999px; background: var(--ground); overflow: hidden; }
  .ol-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: repeating-linear-gradient(-45deg, var(--c) 0 10px, color-mix(in srgb, var(--c) 82%, #fff) 10px 20px); }
  .ol-bar em { position: relative; display: block; padding: 0 12px; line-height: 30px; font-size: 13px; font-style: normal; font-weight: 600; color: #fff; }
  .ol-bar.t-warn { --c: #D97706; } .ol-bar.t-wait { --c: #9CA3AF; } .ol-bar.t-cook { --c: #EA7A1F; } .ol-bar.t-ok { --c: #15A34A; }
  .ol-bar.t-wait em { color: var(--ink); }
  .ol-empty { padding: 18px; color: var(--muted); background: var(--surface); border-radius: 18px; width: 100%; }
  /* หัวเมนู + ค้นหา + จดไว/ดูรูป */
  .pm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
  .pm-head .pm-title { display: block; font-size: 20px; margin-right: auto; } .pm-title span { color: var(--muted); font-weight: 400; }
  .pm-search { display: flex; align-items: center; gap: 10px; width: min(360px, 40%); height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-size: 15px; cursor: pointer; }
  .pm-head .pm-switch { margin: 0; width: 200px; }
  .pos-cats { padding: 6px; background: var(--surface); border-radius: 999px; border: 1px solid var(--line-soft); margin-bottom: 14px; }
  .pos-cats .cat-find { display: none; }
  .pos-cats .chip { height: 42px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; font-size: 15px; }
  .pos-cats .chip.on { background: var(--primary); color: #fff; }
  /* การ์ดเมนู */
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
  .pos-item { padding: 10px; gap: 6px; border: 1.5px solid transparent; border-radius: 18px; box-shadow: 0 1px 2px rgba(40,20,10,.05); display: grid; grid-template-columns: 1fr auto; }
  .pos-item img { grid-column: 1 / -1; aspect-ratio: 4 / 3; border-radius: 12px; }
  .pos-item .pi-info { display: contents; }
  .pos-item .n { padding: 4px 0 0; font-size: 16px; font-weight: 500; }
  .pos-item .p { padding: 4px 0 0; font-size: 15px; }
  .pos-item .pi-addbtn { grid-column: 1 / -1; display: block; height: 40px; border: 1.5px solid var(--primary); border-radius: 10px; background: var(--surface); color: var(--primary); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
  .pos-item .pi-step { grid-column: 1 / -1; display: none; position: static; align-items: center; gap: 8px; }
  .pos-item.in { border-color: var(--primary); }
  .pos-item.in .pi-addbtn { display: none; }
  .pos-item.in .pi-step { display: flex; }
  .pos-item .pi-ok { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; margin-right: auto; }
  .pos-item .pi-step button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--ground); font-size: 20px; color: var(--ink); }
  .pos-item .pi-step .pi-add { background: var(--primary); border-color: var(--primary); color: #fff; }
  .pos-item .pi-q { min-width: 22px; text-align: center; font-weight: 600; font-size: 16px; }
  .pos-item:active { background: var(--surface); }
  /* แผงรายละเอียดออเดอร์ */
  .pos-cart { top: 86px; max-height: calc(100vh - 110px); padding: 20px; gap: 12px; border-radius: 22px; border: 0; box-shadow: 0 1px 3px rgba(40,20,10,.06); }
  .pos-cart .pc-handle { display: none; }
  .pc-head { display: flex; flex-direction: column; gap: 2px; }
  .pc-head b { font-size: 20px; } .pc-head span { font-size: 14px; color: var(--muted); }
  .pc-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .pc-types button { height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
  .pc-types button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
  .pc-tools #posTypeChip { flex: 1; }
  .pos-lines { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px; }
  .pos-lines .pl { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "t step" "p step" "note note"; gap: 4px 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; align-items: center; }
  .pl .pl-t { grid-area: t; } .pl .pl-t span { display: none; }
  .pl .pl-t b { font-size: 17px; font-weight: 600; }
  .pl .pl-p { grid-area: p; color: var(--primary); font-size: 17px; }
  .pl .stepper { grid-area: step; }
  .pl .pl-note { grid-area: note; display: block; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--ground); text-align: left; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
  .pos-sum { padding-top: 12px; border-top: 1px dashed var(--line); font-size: 18px; }
  #posCheckout { height: 56px; font-size: 18px; border-radius: 14px; }
}
.pl-note { display: none; }
@media (min-width: 901px) {
  .nav-main button { white-space: nowrap; padding: 0 16px; }
  .m-nav .nav-mini, .m-nav .nav-a.nav-mini, .m-nav #logoutBtn { display: none; }
  .m-nav #whoBadge { cursor: pointer; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px !important; font-size: 14px !important; box-shadow: 0 1px 2px rgba(40,20,10,.06); }
  .m-nav #whoBadge::after { content: '▾'; color: var(--muted); }
  .m-nav #whoBadge:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
  .pos-item { grid-template-areas: none; }
  .pos-item img { order: 1; } .pos-item .n { order: 2; } .pos-item .p { order: 3; } .pos-item .pi-step, .pos-item .pi-addbtn { order: 4; }
  .pos-item .pi-step { grid-area: auto; margin: 0; background: none !important; }
  .pc-tools #posTypeChip { display: none; }
  .pc-tools .bills-btn, .pc-tools #posClear { flex: 1; }
  .pos-cart { top: 84px; }
  .pm-head .pm-switch { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 999px; padding: 4px; }
  .pm-head .pm-switch .chip { border: 0; border-radius: 999px; height: 38px; }
  .pm-head .pm-switch .chip.on { background: var(--ink); color: #fff; }
}
@media (min-width: 901px) {
  .pos-item { grid-template-columns: minmax(0, 1fr) auto; }
  .pos-item img, .pos-item .n, .pos-item .p, .pos-item .pi-step, .pos-item .pi-addbtn { grid-area: auto; }
  .pos-item img { grid-column: 1 / -1; }
  .pos-item .pi-step, .pos-item .pi-addbtn { grid-column: 1 / -1; }
  .pos-item .n { min-width: 0; }
}
@media (min-width: 901px) { .pos > .pc-scrim { display: none; } .pos-cart { grid-column: 2; grid-row: 1; } }
@media (min-width: 901px) { .pos-cart { top: 12px; } }
@media (min-width: 901px) { body[data-mview="pos"] #view-admin { overflow: visible !important; } .pos-cart { top: 84px; max-height: calc(100vh - 100px); } }
/* v44 หัวเมนู + แถบหมวด ติดด้านบนใต้แถบนำทาง (จอแนวนอน) · มือถือ: กล่องนี้ไม่มีผล แถบหมวดติดเองแบบเดิม */
.pm-stick { display: contents; }
@media (min-width: 901px) {
  .pm-stick { display: block; position: sticky; top: 84px; z-index: 20; background: var(--ground); padding: 2px 0 10px; margin-bottom: 4px; }
  .pm-stick .pos-cats { position: static; margin-bottom: 0; }
}
/* v45 มุมมอง "รายการ" (จอแนวนอน): แถวละเมนู รูปเล็ก ชื่อ ราคา ปุ่มเพิ่ม/ตัวนับ · แบ่ง 2 คอลัมน์ */
@media (min-width: 901px) {
  .pm-head .pm-switch { width: 270px; }
  .pos.pm-list .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pos.pm-list .pos-item { grid-template-columns: 56px minmax(0, 1fr) auto auto; align-items: center; column-gap: 12px; padding: 8px 12px 8px 8px; border-radius: 14px; }
  .pos.pm-list .pos-item img { grid-column: 1; width: 56px; height: 56px; aspect-ratio: 1; border-radius: 10px; }
  .pos.pm-list .pos-item .n { grid-column: 2; padding: 0; font-size: 16px; }
  .pos.pm-list .pos-item .p { grid-column: 3; padding: 0; }
  .pos.pm-list .pos-item .pi-addbtn { grid-column: 4; width: 76px; height: 40px; }
  .pos.pm-list .pos-item .pi-step { grid-column: 4; gap: 6px; }
  .pos.pm-list .pos-item .pi-ok { display: none; }
  .pos.pm-list .pos-sec { grid-column: 1 / -1; }
}
@media (min-width: 901px) { .pos.pm-list .pos-item > *, .pos.pm-list .pos-item .n, .pos.pm-list .pos-item .p { align-self: center; margin: 0; } }
/* v46 ช่องค้นหาแบบกรองเมนูบนจอ (จอแนวนอน) */
@media (min-width: 901px) {
  .pm-search { cursor: text; }
  .pm-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(185,50,30,.15); }
  .pm-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); }
  .pos-cats .chips.dim .chip.on { background: transparent; color: inherit; }
  .pos-noq { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 16px; }
}
.pos-noq[hidden] { display: none; }
/* v47 มุมมองรายการ = แถวเต็ม 1 คอลัมน์ · ปุ่มจัดลำดับเมนู */
@media (min-width: 901px) { .pos.pm-list .pos-grid { grid-template-columns: 1fr; } .pos.pm-list .pos-item { grid-template-columns: 64px minmax(0, 1fr) auto auto; padding: 8px 14px 8px 8px; } .pos.pm-list .pos-item img { width: 64px; height: 64px; } }
.sort-tools { display: flex; gap: 6px; }
.sort-tools .chip { min-width: 44px; height: 40px; justify-content: center; font-size: 17px; }
.m-sorting .admin-grid { grid-template-columns: 1fr !important; max-width: 720px; gap: 6px; }
.m-sorting .sold-sw { display: none; }
.m-sorting .mrow { padding-block: 6px; }
/* v48 ปุ่มเรียงเมนูบนจอรับออเดอร์ · ลากจัดลำดับในหน้าจัดการเมนู */
.pm-sort { display: none; position: relative; }
@media (min-width: 901px) {
  .pm-sort { display: block; }
  .pm-sort-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
  .pm-sort-btn.on { border-color: var(--primary); color: var(--primary); background: var(--tint); }
  .pm-sort-menu { position: absolute; right: 0; top: 52px; z-index: 40; min-width: 200px; padding: 6px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; box-shadow: 0 8px 24px rgba(40,20,10,.14); display: flex; flex-direction: column; }
  .pm-sort-menu[hidden] { display: none; }
  .pm-sort-menu button { height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: none; text-align: left; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; }
  .pm-sort-menu button:hover { background: var(--ground); }
  .pm-sort-menu button[aria-checked="true"] { color: var(--primary); font-weight: 700; }
  .pm-sort-menu button[aria-checked="true"]::after { content: ' ✓'; }
}
.admin-grid .mrow, .cat-row { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mrow.dragging, .cat-row.dragging { position: relative; z-index: 5; transform: scale(1.02); box-shadow: 0 10px 28px rgba(40,20,10,.2); outline: 2px solid var(--primary); background: var(--surface); }
html.is-dragging, html.is-dragging * { cursor: grabbing !important; }
.drag-h { display: grid; place-items: center; width: 32px; height: 40px; font-size: 20px; color: var(--muted); cursor: grab; touch-action: none; }
/* ===== v49 ดูออเดอร์: แถวสั้น อ่านง่าย · จอแนวนอน = รายการซ้าย + ออเดอร์ที่เลือกเต็มขวา · ย้ายขั้นแล้วย้อนกลับได้ 4 วิ ===== */
.oc2-sum { display: none; }
.oc2 .oc2-items { display: none; }
.oc2 .oc2-sum { display: block; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc2-h .ot { margin-left: auto; font-weight: 700; }
.oc2-h .ot.late { color: #fff; background: #DC2626; padding: 1px 8px; border-radius: 999px; }
@media (min-width: 901px) {
  #view-orders.ov { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 14px 18px; padding: 8px 24px 24px; align-items: start; }
  #view-orders.ov.hidden { display: none; }
  #view-orders .ov-tabs { grid-column: 1 / -1; display: flex; gap: 6px; padding: 6px; background: var(--surface); border-radius: 999px; width: max-content; max-width: 100%; overflow-x: auto; }
  #view-orders .ov-tabs button { height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 15px; color: var(--muted); display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
  #view-orders .ov-tabs button.on { background: var(--primary); color: #fff; font-weight: 600; }
  #view-orders .ov-tabs button.on .tn { background: #fff; color: var(--primary); }
  #view-orders .ov-tabs .tn:empty { display: none; }
  #view-orders .ov-tabs .tn { font-size: 13px; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--ground); color: var(--ink); text-align: center; }
  #view-orders .ov-tabs .tn.hot { background: var(--primary); color: #fff; }
  #view-orders .ov-board { display: block; position: sticky; top: 92px; max-height: calc(100vh - 170px); overflow-y: auto; padding: 2px; }
  #view-orders .ov-col { display: none; } #view-orders .ov-col.on { display: block; }
  #view-orders .ov-col h2 { display: none; }
  #view-orders .oc2 { padding: 12px 14px; border-color: transparent; box-shadow: 0 1px 2px rgba(40,20,10,.05); }
  #view-orders .oc2.sel { border-color: var(--primary); background: var(--tint); }
  #view-orders .oc2 .oc2-go, #view-orders .oc2 .oc2-pay { display: none; }
  .ov-detail { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; background: var(--surface); border-radius: 22px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(40,20,10,.06); }
  .ov-detail .od, .ov-detail > article { border: 0; box-shadow: none; padding: 0; }
  .odp-empty { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 16px; }
}
@media (max-width: 900px) { .ov-detail { display: none; } }
.undo-bar { position: fixed; z-index: 80; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 18px; border-radius: 14px; background: #17201C; color: #fff; font-size: 15px; box-shadow: 0 8px 24px rgba(0,0,0,.25); overflow: hidden; }
.undo-bar button { height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: #fff; color: #17201C; font: inherit; font-weight: 700; cursor: pointer; }
.undo-bar i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--primary-bright, #F97316); animation: undoT 4s linear forwards; }
@keyframes undoT { from { width: 100%; } to { width: 0; } }
.odp-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.odp-head b { font-size: 26px; } .odp-head span { font-size: 16px; } .odp-head .odp-t { margin-left: auto; font-size: 14px; color: var(--muted); }
@media (min-width: 901px) { .undo-bar { left: 24px; transform: none; } }
/* ===== v50 รายละเอียดออเดอร์: อาหารที่ต้องทำเด่นสุด → ปุ่มขั้นต่อไป → ข้อมูลอื่น (จาง) ===== */
.od-cook { margin: 10px 0 4px; }
.od-cook-h { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; letter-spacing: .02em; }
.od .od-lines { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.od .od-lines li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.od .od-lines .lq { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 24px; font-weight: 800; }
.od .od-lines .ld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.od .od-lines .ld > b { font-size: 21px; line-height: 1.3; color: var(--ink); }
.od .od-lines .opl { display: inline-block; width: max-content; max-width: 100%; font-size: 16px; font-weight: 600; color: var(--primary-dark, #8f2717); }
.od .od-lines .opl.sp { padding: 2px 10px; border-radius: 999px; background: #FDE7DF; color: #B42318; }
.od .od-lines .opl.note { padding: 6px 10px; border-radius: 8px; background: #FEF3C7; color: #78350F; font-weight: 700; }
.od .od-lines .lp { font-size: 14px; color: var(--muted); padding-top: 4px; }
.od-callout { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: #FEF3C7; color: #78350F; font-size: 17px; font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.od-callout b { font-size: 13px; }
.od-top { gap: 8px; }
.od-more { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 10px; opacity: .92; }
.od-more .od-meta { font-size: 14px; }
.od-more .od-sum .od-total b { font-size: 18px; }
@media (min-width: 901px) {
  .ov-detail .od-foot { position: sticky; bottom: -18px; margin: 12px -20px 0; padding: 12px 20px 18px; background: var(--surface); border-top: 1px solid var(--line-soft); }
  .ov-detail .od-foot .act { width: 100%; height: 58px; font-size: 19px; }
}
/* ===== v51 บัญชี: แถบเปิดกะ · ป้ายโหมด · หน้าบัญชี · ตัวสลับไฟล์ ===== */
.shift-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 8px 16px; padding: 10px 14px; border-radius: 14px; background: var(--warn-tint); color: var(--warn-dark); }
.shift-bar label { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.shift-bar input { width: 110px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; font-size: 16px; background: #fff; }
@media (min-width: 901px) { .shift-bar { margin: 4px 24px 8px; } }
.acct-pill { display: none; }
@media (min-width: 901px) { .acct-pill { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; } .acct-pill.test { background: #FEF3C7; color: #92400E; } .acct-pill.real { background: #DCFCE7; color: #166534; } }
.acc-mode { display: flex; gap: 10px; padding: 12px 16px; border-radius: 14px; background: #FEF3C7; color: #78350F; }
.acc-mode.real { background: #DCFCE7; color: #14532D; }
.acc-li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.acc-tbl { overflow-x: auto; margin-top: 8px; }
.acc-tbl table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.acc-tbl th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.acc-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.acc-tbl tr.neg td { color: #B42318; }
.acct-set.real { border: 1.5px solid #86EFAC; }
.acct-ask { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--warn-tint); display: flex; flex-direction: column; gap: 8px; color: var(--warn-dark); }
.cc-res { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 10px; color: var(--ink); }
.cc-res b.neg { color: #B42318; }

/* v52 ค้นหาบนมือถือ: ช่องพิมพ์แทนแถบหมวด กรองรายการบนจอ */
.pos-cats .cat-q { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 4px 0 16px; border: 1.5px solid var(--primary); border-radius: 999px; background: var(--surface); }
.pos-cats .cat-q[hidden] { display: none; }
.pos-cats .cat-q input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.pos-cats .cat-q input::-webkit-search-cancel-button { display: none; }
.cat-q-x { flex-shrink: 0; width: 38px; height: 38px; border: 0; border-radius: 999px; background: var(--tint); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.pos-cats.finding .cat-find, .pos-cats.finding #posCats { display: none; }
.pos-grid .pos-sec[hidden] { display: none; }

/* v53 คืนเงินบางส่วน */
.rf-card { width: min(440px, 100%); max-height: calc(100dvh - 24px); overflow: auto; color: var(--ink); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.rf-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; } .rf-h b { font-size: 18px; }
.rf-sub { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.rf-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rf-lines li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.rf-lines li.on { border-color: var(--primary); background: var(--tint); }
.rf-n { flex: 1; min-width: 0; display: flex; flex-direction: column; } .rf-n b { font-size: 15px; }
.rf-step { display: flex; align-items: center; gap: 4px; } .rf-step span { min-width: 22px; text-align: center; font-weight: 700; }
.rf-step button { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; color: var(--ink); }
.rf-amt, .rf-why-in { height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font: inherit; font-size: 18px; color: var(--ink); background: var(--surface); }
.rf-why-in { font-size: 15px; height: 44px; }
.rf-via { display: flex; gap: 8px; } .rf-via button { flex: 1; }
.rf-why .chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.od-refund span:last-child { color: var(--danger, #B3261E); }
.od-rfbtn { color: var(--ink) !important; }

/* v54 จัดการเมนูใหม่: รายการ + แผ่นแก้เมนู + กลุ่มท็อปปิ้ง */
.mm { max-width: 1100px; }
.mm-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mm-tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 999px; padding: 4px; gap: 2px; }
.mm-tabs button { height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-size: 15px; font-weight: 600; color: var(--muted); }
.mm-tabs button span { font-weight: 400; margin-left: 2px; }
.mm-tabs button.on { background: var(--ink); color: #fff; }
.mm-add { height: 46px; margin-left: auto; padding: 0 20px; font-size: 16px; }
.mm-filter { position: sticky; top: var(--mm-stick, 0px); z-index: 3; background: var(--ground); padding: 2px 0 10px; display: flex; flex-direction: column; gap: 10px; }
.mm-search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); max-width: 420px; }
.mm-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(217,72,15,.15); }
.mm-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }
.mm-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mm-cats::-webkit-scrollbar { display: none; }
.mm-cats .chip { flex-shrink: 0; height: 38px; }
.mm-cats .chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.mm-sec { margin-top: 8px; }
.mm-sec h3 { font-size: 15px; margin: 10px 2px 8px; color: var(--ink); } .mm-sec h3 span { color: var(--faint); font-weight: 400; }
.mm-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.mm-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mm-row:hover { border-color: var(--line); } .mm-row:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mm-row img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: #F3E6DD; }
.mm-row.off img { filter: grayscale(1); opacity: .55; } .mm-row.off .mm-t b { color: var(--muted); }
.mm-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mm-t b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.mm-meta em { font-style: normal; font-weight: 700; color: var(--ink); font-size: 15px; }
.mm-meta small { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--ground); border: 1px solid var(--line-soft); }
.mm-meta i { font-style: normal; color: #991B1B; }
.mm-row.dragging { position: relative; z-index: 5; transform: scale(1.02); box-shadow: 0 10px 28px rgba(40,20,10,.2); outline: 2px solid var(--primary); }
.mm-hint, .mm-lead { font-size: 13px; color: var(--muted); margin: 14px 2px; }
.mm-lead { margin-top: 0; font-size: 14px; }
.mm-empty { font-size: 14px; color: var(--faint); margin: 4px 2px; }
.mm-more { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.mm-more .chip { height: 40px; }
.mm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.mm-group { text-align: left; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; font: inherit; color: var(--ink); }
button.mm-group:hover { border-color: var(--line); }
.mm-gh { display: flex; flex-direction: column; } .mm-gh b { font-size: 17px; } .mm-gh span { font-size: 13px; color: var(--muted); }
.mm-gf { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.mm-go { color: var(--primary); font-weight: 700; font-size: 14px; }

/* ป้ายราคา: ชื่อ | +ราคา แบบป้ายติดของ */
.ptags { display: flex; flex-wrap: wrap; gap: 6px; }
.ptag { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; line-height: 26px; overflow: hidden; }
.ptag { padding-left: 9px; padding-right: 9px; }
.ptag b { margin: 0 -9px 0 8px; padding: 0 8px; border-left: 1px dashed var(--line); color: var(--primary-dark); background: var(--ground); font-weight: 700; }
.ptag.def { border-color: var(--ink); font-weight: 600; }

/* แผ่นแก้ไข */
.mm-wrap { background: rgba(23,32,28,.5); align-items: stretch; justify-content: center; }
.mm-sheet { width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--ground); color: var(--ink); }
@media (min-width: 700px) { .mm-wrap { align-items: center; padding: 16px; } .mm-sheet { width: min(640px, 100%); height: auto; max-height: min(92vh, 900px); border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(30,15,5,.25); } }
.mm-sh { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.mm-sh b { font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-sb { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }
.mm-err { margin: 0 16px 8px; padding: 10px 12px; border-radius: 10px; background: #FEE2E2; color: #991B1B; font-size: 14px; }
.mm-sf { display: flex; align-items: center; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line-soft); }
.mm-sf .btn { height: 50px; font-size: 16px; } .mm-sf [data-save] { margin-left: auto; min-width: 140px; }
.mm-sf .btn-outline { padding: 0 16px; }
.mm-del { color: #991B1B !important; padding: 0 10px; }
.ie-hero { display: flex; gap: 14px; align-items: center; }
.ie-photo { position: relative; flex-shrink: 0; width: 104px; height: 104px; border-radius: 16px; overflow: hidden; background: #F3E6DD; cursor: pointer; }
.ie-photo img { width: 100%; height: 100%; object-fit: cover; }
.ie-photo span { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 0 5px; text-align: center; font-size: 12px; font-weight: 600; color: #fff; background: rgba(23,32,28,.6); }
.ie-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ie-name { width: 100%; border: 0; border-bottom: 2px solid var(--line); background: transparent; font-size: 22px; font-weight: 700; padding: 6px 2px; color: var(--ink); border-radius: 0; }
.ie-name:focus, .ie-price input:focus { outline: 0; border-color: var(--primary); }
.ie-price { display: flex; align-items: baseline; gap: 4px; }
.ie-price span { font-size: 26px; font-weight: 700; color: var(--primary); }
.ie-price input { width: 140px; border: 0; border-bottom: 2px solid var(--line); background: transparent; font-size: 30px; font-weight: 700; padding: 2px; color: var(--ink); border-radius: 0; -moz-appearance: textfield; }
.ie-price input::-webkit-inner-spin-button, .ge-cp input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ie-sec { display: flex; flex-direction: column; gap: 8px; }
.ie-lbl { font-size: 14px; font-weight: 700; color: var(--ink); } .ie-lbl small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.ie-cats .chip { height: 40px; } .ie-cats .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ie-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; }
.ie-line > div { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ie-line b { font-size: 15px; } .ie-line small { font-size: 13px; color: var(--muted); }
.m-sw { flex-shrink: 0; width: 52px; height: 32px; border-radius: 999px; border: 0; background: #D9D4CF; position: relative; padding: 0; transition: background .15s; }
.m-sw i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.m-sw.on { background: var(--ok); } .m-sw.on i { transform: translateX(20px); }
.m-sw:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ie-groups { display: flex; flex-direction: column; gap: 8px; }
.ie-g { padding: 12px 14px; background: var(--surface); border: 1.5px solid var(--line-soft); border-radius: 14px; display: flex; flex-direction: column; gap: 10px; }
.ie-g:not(.on) .ptags { opacity: .5; } .ie-g.on { border-color: var(--ok); }
.ie-gh { display: flex; align-items: center; gap: 12px; } .ie-gh > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ie-gh b { font-size: 15px; } .ie-gh small { font-size: 12px; color: var(--muted); }
.ie-gedit { align-self: flex-start; border: 0; background: transparent; color: var(--primary); font-weight: 700; font-size: 14px; padding: 2px 0; }
.ie-plus { align-self: flex-start; height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px dashed var(--line); background: transparent; color: var(--primary-dark); font-weight: 600; font-size: 14px; }
.ie-adv { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; }
.ie-adv summary { list-style: none; cursor: pointer; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.ie-adv summary::-webkit-details-marker { display: none; }
.ie-adv summary b::after { content: ' ▾'; color: var(--muted); } .ie-adv[open] summary b::after { content: ' ▴'; }
.ie-adv summary small { font-size: 13px; color: var(--muted); }
.ie-advb { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.ie-advb .ie-line { background: var(--ground); }
.ie-advb .field input, .ie-advb select, .ie-bundle select, .ie-bundle input { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; width: 100%; font-size: 15px; }
.ie-sub { display: flex; flex-direction: column; gap: 6px; } .ie-sub > small { font-size: 13px; color: var(--muted); margin-top: -4px; }
.ie-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ie-ings { display: flex; flex-direction: column; gap: 6px; }
.ie-ing { display: flex; align-items: center; gap: 8px; } .ie-ing > span { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; background: var(--ground); border: 1px solid var(--line-soft); border-radius: 12px; padding: 3px; gap: 3px; }
.seg2 button { min-height: 38px; border: 0; border-radius: 9px; background: transparent; font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; }
.seg2 button small { font-weight: 400; font-size: 12px; }
.seg2 button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(40,20,10,.15); }
.ge-type button { min-height: 54px; font-size: 15px; } .ge-type button.on { background: var(--ink); color: #fff; } .ge-type button.on small { color: rgba(255,255,255,.75); }
.ie-x { flex-shrink: 0; width: 38px; height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.ie-ingadd .chip { height: 36px; font-size: 14px; }
.ie-bundle { padding: 10px; border: 1px dashed var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.ge-list { display: flex; flex-direction: column; gap: 8px; }
.ge-c { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; padding: 8px; }
.ge-cr { display: flex; align-items: center; gap: 6px; }
.ge-cl { flex: 1; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-size: 16px; background: #fff; }
.ge-cp { display: flex; align-items: center; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); padding-left: 8px; flex-shrink: 0; }
.ge-cp span { font-size: 13px; font-weight: 700; color: var(--primary-dark); }
.ge-cp input { width: 52px; height: 100%; border: 0; background: transparent; font-size: 16px; font-weight: 700; padding: 0 6px; -moz-appearance: textfield; }
.ge-cl:focus, .ge-cp:focus-within { outline: 0; border-color: var(--primary); }
.ge-def { flex-shrink: 0; height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--muted); }
.ge-def.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ge-more { flex-shrink: 0; width: 36px; height: 44px; border: 0; background: transparent; font-size: 20px; color: var(--muted); }
.ge-x { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; padding: 10px 4px 2px; }
.ge-x label { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.ge-x select { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; background: #fff; font-size: 15px; color: var(--ink); }
.ge-rm { height: 40px; border: 0; background: transparent; color: #991B1B; font-weight: 600; }
.ge-use { display: flex; flex-direction: column; gap: 6px; }
.ge-cat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden; }
.ge-ch { display: flex; align-items: center; }
.ge-all { flex-shrink: 0; width: 26px; height: 26px; margin: 0 4px 0 14px; border-radius: 7px; border: 2px solid var(--line); background: #fff; position: relative; padding: 0; }
.ge-all.on { background: var(--ok); border-color: var(--ok); } .ge-all.on::after { content: ''; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.ge-all.some { border-color: var(--ok); } .ge-all.some::after { content: ''; position: absolute; left: 5px; right: 5px; top: 10px; height: 2.5px; background: var(--ok); border-radius: 2px; }
.ge-ct { flex: 1; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px 0 8px; border: 0; background: transparent; text-align: left; font-size: 15px; color: var(--ink); }
.ge-ct b { flex: 1; } .ge-ct span { color: var(--muted); font-size: 14px; } .ge-ct::after { content: '▾'; color: var(--muted); } .ge-cat.open .ge-ct::after { content: '▴'; }
.ge-items { display: none; padding: 0 10px 10px 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 10px; }
.ge-cat.open .ge-items { display: grid; }
.ge-it { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; }
.ge-it input { width: 20px; height: 20px; accent-color: var(--ok); flex-shrink: 0; }
@media (max-width: 520px) { .ie-3 { grid-template-columns: 1fr 1fr; } .ie-3 .field:first-child { grid-column: 1 / -1; } .mm-add { width: 100%; margin-left: 0; } .mm-tabs { width: 100%; } .mm-tabs button { flex: 1; padding: 0 8px; } .ie-ing { flex-wrap: wrap; } .ie-ing .seg2 { order: 3; width: 100%; } }
.mm-sh .icon-btn { color: var(--ink); background: var(--ground); }

/* v55 หมวดด้านบน · เลือกหลายเมนู */
.mm-frow { display: flex; gap: 8px; align-items: center; }
.mm-frow .mm-search { flex: 1; }
.mm-selbtn { height: 46px; flex-shrink: 0; } .mm-selbtn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.mm-catbar { display: flex; gap: 8px; align-items: center; }
.mm-catbar .mm-cats { flex: 1; min-width: 0; }
.mm-catedit { flex-shrink: 0; height: 38px; display: inline-flex; align-items: center; gap: 4px; border-style: dashed; color: var(--primary-dark); font-weight: 700; }
.mm-cats .chip.uncat { border-color: #FCA5A5; color: #991B1B; }
.mm-cats .chip.uncat.on { background: #991B1B; border-color: #991B1B; color: #fff; }
.mm-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px; margin: 4px 0 8px; border-radius: 12px; background: var(--warn-tint); color: var(--warn-dark); font-size: 14px; }
.mm-warn span { flex: 1; min-width: 200px; } .mm-warn .chip { height: 36px; }
.mm-sec h3 { display: flex; align-items: center; gap: 6px; } .mm-sec h3 .ge-all { margin: 0 4px 0 0; }
.mm-row.sel { border-color: var(--ok); background: #F3FBF5; }
.mm-check { flex-shrink: 0; width: 24px; height: 24px; border-radius: 999px; border: 2px solid var(--line); background: #fff; position: relative; }
.mm-row.sel .mm-check { background: var(--ok); border-color: var(--ok); } .mm-row.sel .mm-check::after { content: ''; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.mm.selecting .mm-rows { padding-bottom: 4px; } .mm.selecting { padding-bottom: 90px; }
.mm-bulk { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 4px; padding: 6px; background: var(--ink); color: #fff; border-radius: 18px; box-shadow: 0 12px 32px rgba(20,10,5,.3); max-width: calc(100vw - 20px); }
.mm-bn { padding: 0 10px 0 8px; font-size: 14px; white-space: nowrap; } .mm-bn b { font-size: 18px; }
.mm-bulk button { height: 46px; padding: 0 12px; border: 0; border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; }
.mm-bulk button.danger { background: #B42318; } .mm-bulk button:disabled { opacity: .35; }
@media (max-width: 520px) { .mm-bulk { left: 8px; right: 8px; transform: none; justify-content: space-between; } .mm-bulk button { padding: 0 9px; font-size: 13px; } .mm-bn { padding: 0 4px; } }
.mm-pick { display: flex; flex-direction: column; gap: 8px; }
.mm-pick button { text-align: left; display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 0 16px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); font-size: 16px; font-weight: 600; color: var(--ink); }
.mm-pick button span { font-size: 13px; font-weight: 400; color: var(--muted); }
.mm-gbtns { display: flex; gap: 8px; } .mm-gbtns .chip { height: 40px; } .mm-gbtns .chip:disabled { opacity: .4; }
.mm-dlist { margin: 0; padding-left: 20px; columns: 2; font-size: 14px; color: var(--ink); }
.mm-danger { background: #B42318 !important; }
.mm-frow .mm-search { min-width: 0; max-width: none; }
.mm-frow .mm-search input { width: 100%; }
body:has(.mm-bulk) #toastBox, body:has(.mm-bulk) .toast-box { bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important; }
body:has(.mm-bulk) .mnotify { bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important; }

/* v56 แถบค้นหา/หมวดติดบนเสมอ · แถบเลือกหลายเมนูมีปุ่มเสร็จ */
body[data-mview="menu"] #view-admin { overflow: visible !important; }
.mm-filter { top: var(--mm-stick, 0px); margin: 0 -16px; padding: 8px 16px 10px; box-shadow: 0 6px 10px -10px rgba(40,20,10,.35); }
@media (min-width: 901px) { .mm-filter { margin: 0 -24px; padding-inline: 24px; } }
.mm-bulk { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; width: min(620px, calc(100vw - 16px)); }
.mm-bh { display: flex; align-items: center; gap: 8px; }
.mm-bh .mm-bn { flex: 1; }
.mm-bulk .mm-bdone { background: #fff; color: var(--ink); font-weight: 700; padding: 0 18px; }
.mm-bulk .mm-bclr { background: transparent; color: rgba(255,255,255,.8); text-decoration: underline; }
.mm-bacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mm-bacts button { padding: 0 4px; }
@media (max-width: 520px) { .mm-bulk { left: 8px; right: 8px; width: auto; transform: none; } .mm-bulk button { font-size: 13px; } }
.mm.selecting { padding-bottom: 140px; }
body:has(.mm-bulk) .mnotify { bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important; }

/* v57 แถบติดบน/ล่างให้บางที่สุด เหลือที่ให้รายการเมนู */
.mm-acts { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.mm-acts .mm-add { margin-left: 0; }
.mm-acts .mm-selbtn { height: 46px; }
.mm-filter { gap: 8px; }
.mm-qbtn, .mm-qx { display: none; flex-shrink: 0; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); align-items: center; justify-content: center; padding: 0; }
.mm-bulk { flex-direction: row; align-items: center; gap: 6px; }
.mm-bh { flex-shrink: 0; }
.mm-bacts { flex: 1; }
.mm-bmore { display: none; }
@media (max-width: 699px) {
  .mm-acts { width: 100%; } .mm-acts .mm-add { flex: 1; width: auto; } .mm-acts .mm-selbtn { flex-shrink: 0; }
  .mm-filter { padding-top: 6px; padding-bottom: 6px; }
  .mm-frow { display: none; } .mm-filter.q-open .mm-frow { display: flex; } .mm-filter.q-open .mm-catbar { display: none; }
  .mm-qbtn, .mm-qx { display: inline-flex; }
  .mm-frow .mm-search { height: 40px; }
  .mm-catedit { padding: 0 10px; }
  .mm-bacts { display: none; }
  .mm-bulk { flex-direction: row; } .mm-bh { flex: 1; }
  .mm-bulk .mm-bmore { display: block; background: var(--primary); padding: 0 16px; }
  .mm.selecting { padding-bottom: 80px; }
  body:has(.mm-bulk) .mnotify { bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important; }
}
.mm-pick .danger { color: #991B1B; }
@media (min-width: 700px) { .mm-filter { flex-direction: row; align-items: center; } .mm-frow { flex: 0 0 280px; } .mm-catbar { flex: 1; min-width: 0; } }

/* v58 ราคาโปร + คำอธิบายตัวเลือก (ฝั่งลูกค้า) */
s.was { color: var(--faint); font-weight: 400; font-size: .82em; margin-left: 6px; }
.opt .lbl .opt-desc { display: block; font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 1px; }

/* v59 หน้าแก้เมนู: หมวด dropdown · ราคาโปร · ตัวเลือกแบบ Grab */
.ie-catsel { display: flex; align-items: center; gap: 12px; padding: 0 6px 0 14px; height: 54px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; }
.ie-catsel span { font-weight: 700; font-size: 15px; }
.ie-catsel select { flex: 1; min-width: 0; height: 42px; border: 0; background: transparent; font-size: 16px; font-weight: 600; color: var(--ink); text-align: right; text-align-last: right; padding-right: 6px; cursor: pointer; }
.ie-sale { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; }
.ie-sale .ie-line { border: 0; background: transparent; }
.ie-sale.on { border-color: var(--primary); }
.ie-saleb { display: none; gap: 10px; align-items: center; padding: 0 14px 14px; }
.ie-sale.on .ie-saleb { display: flex; }
.ie-saleb .seg2 { flex: 1; }
.ie-salev { display: flex; align-items: center; gap: 4px; height: 46px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.ie-salev:focus-within { border-color: var(--primary); }
.ie-salev span { font-weight: 700; color: var(--primary); }
.ie-salev input { width: 70px; border: 0; outline: 0; font-size: 20px; font-weight: 700; -moz-appearance: textfield; background: transparent; }
.ie-net { color: var(--primary); font-size: 15px; } [data-saletxt] s { color: var(--faint); }
.mm-meta s.was { font-size: 12px; }
ul.ov { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
ul.ov li { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-top: 1px solid var(--line-soft); font-size: 14px; }
ul.ov li:first-child { border-top: 0; }
.ov-b { flex-shrink: 0; width: 18px; height: 18px; border: 2px solid #C9C2BB; background: #fff; position: relative; }
.ov-b.r { border-radius: 999px; } .ov-b.c { border-radius: 5px; }
ul.ov li.def .ov-b { border-color: var(--ink); } ul.ov li.def .ov-b.r::after { content: ''; position: absolute; inset: 3px; border-radius: 999px; background: var(--ink); }
ul.ov li.def .ov-b.c { background: var(--ink); } ul.ov li.def .ov-b.c::after { content: ''; position: absolute; left: 4px; top: 0; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ov-l { flex: 1; min-width: 0; } .ov-l small { display: block; font-size: 12px; color: var(--muted); }
.ov-p { flex-shrink: 0; font-size: 13px; color: var(--muted); } 
ul.ov li .ov-p:not(:empty) { font-variant-numeric: tabular-nums; }
.ov-more { color: var(--muted); font-size: 13px; justify-content: center; }
.ie-g:not(.on) ul.ov { opacity: .55; }
.mm-ov { display: block; }
.ge-cd { width: 100%; margin-top: 6px; height: 38px; border: 1px dashed var(--line); border-radius: 10px; padding: 0 12px; font-size: 14px; background: var(--ground); }
.ge-cd:focus { outline: 0; border-style: solid; border-color: var(--primary); background: #fff; }
.ie-salev input::-webkit-inner-spin-button, .ie-salev input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* v60 แถมฟรี */
.pk-free { margin-top: 4px; }
.pl-free { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--ok-tint); color: var(--ok-dark); font-size: 13px; font-weight: 700; }
.lp-free { color: var(--ok-dark); font-weight: 700; }

/* v97 ปิดกะใหม่ (22 พ.ย. 2026): ผล ตรง/ขาด/เกิน · นับซ้ำ · ทิ้งไว้ในลิ้นชัก/ใส่ซอง */
.shift-bar.ok { background: var(--ok-tint); color: var(--ok-dark); }
.cc-head { display: flex; flex-direction: column; gap: 4px; } .cc-head b { font-size: 20px; } .cc-head span { line-height: 1.6; }
.cc-in { width: 90px; height: 46px; font-size: 18px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; text-align: right; }
.cc-bar { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 12px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--ground); border-top: 1px solid var(--line-soft); }
.cc-bar .btn { height: 52px; flex: 1; font-size: 17px; }
.cc-sum { display: flex; flex-direction: column; line-height: 1.2; } .cc-sum span { font-size: 13px; color: var(--muted); } .cc-sum b { font-size: 26px; font-variant-numeric: tabular-nums; }
.cc-sum + .btn { flex: 0 1 220px; }
.cc-verdict { font-size: 34px; font-weight: 700; text-align: center; padding: 14px; border-radius: 14px; font-variant-numeric: tabular-nums; }
.cc-verdict.ok { background: var(--ok-tint); color: var(--ok-dark); }
.cc-verdict.short { background: #FEE2E2; color: #991B1B; }
.cc-verdict.over { background: var(--warn-tint); color: var(--warn-dark); }
.cc-res-card { display: flex; flex-direction: column; gap: 12px; }
.cc-dim { opacity: .75; }
.cc-keep { height: 50px; font-size: 22px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font-variant-numeric: tabular-nums; }
.cc-env { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--tint); }
.cc-env b { font-size: 22px; font-variant-numeric: tabular-nums; } .cc-env b.bad { color: #B42318; font-size: 15px; }
.cc-env.big b { font-size: 30px; }
.cc-done { display: flex; flex-direction: column; gap: 8px; }
.cc-err { padding: 10px 14px; border-radius: 12px; background: #FEE2E2; color: #991B1B; font-weight: 600; }
.cc-err[hidden] { display: none; }
@media (max-width: 900px) { /* แถบเงินทอนที่ยกมา: บรรทัดเดียว ไม่กินจอ */
  .shift-bar.ok { flex-wrap: nowrap; gap: 8px; padding: 6px 8px 6px 12px; font-size: 14px; line-height: 1.3; }
  .shift-bar.ok > span { flex: 1; min-width: 0; } .shift-bar.ok .small { display: block; font-size: 12px; }
  .shift-bar.ok .btn { height: 36px !important; padding: 0 12px; font-size: 14px; flex-shrink: 0; }
}
body[data-mview="count"] #view-admin { overflow: visible !important; } /* ให้แถบปุ่มปิดกะติดล่างจอ */
