/* หน้าสั่งงาน — หน้าตาเดียวกับเว็บร้าน (ยกมาจากต้นแบบระบบสั่งออเดอร์) */
:root{box-sizing:border-box}html{scroll-padding-top:env(safe-area-inset-top,0px)}body{margin:0}img{max-width:100%}[hidden]:not([hidden=until-found i]){display:none!important}
:root {
  --bg: #ffffff; --alt: #f5f5f7; --ink: #1d1d1f; --muted: #6e6e73; --line: #d2d2d7;
  --accent: #3c2b23; --accent-ink: #ffffff; --link: #8a5532; --card: #ffffff;
  --ok: #1f7a4d; --ok-bg: #e5f3ec; --bad: #b4372b; --bad-bg: #fbe9e7; --warn: #9a5b00; --warn-bg: #fbf0dc; --info: #2f5d8a; --info-bg: #e4edf6;
  --font: "IBM Plex Sans Thai", system-ui, -apple-system, sans-serif;
  --font-mark: "Cormorant Garamond", Georgia, serif;
  --r: 18px;
  --i0: #ffffff; --i1: #e8e8ed; --i2: #c7c7cc; --i3: #6e6e73;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--alt); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 720px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
header.top { background: var(--bg); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-block: 14px; }
.mark { font-family: var(--font-mark); font-size: 1.15rem; letter-spacing: .14em; line-height: 1.05; }
.proto { font-size: .78rem; color: var(--warn); background: var(--warn-bg); padding: 3px 10px; border-radius: 99px; }
.tabs { display: flex; gap: 6px; padding-block: 14px; overflow-x: auto; }
.tab { flex: 0 0 auto; font: inherit; font-size: .92rem; font-weight: 500; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tab:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
main { padding-bottom: 48px; }
.panel { background: var(--card); border-radius: var(--r); padding: clamp(20px, 4vw, 32px); display: grid; gap: 22px; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; line-height: 1.3; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.1rem; }
p { margin: 0; }
.muted { color: var(--muted); font-size: .92rem; }
.stepper { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.stepper li { flex: 1; min-width: 0; font-size: .8rem; color: var(--muted); border-top: 3px solid var(--line); padding-top: 6px; }
.stepper li.on { color: var(--ink); border-color: var(--accent); font-weight: 500; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: grid; gap: 2px; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-size: .95rem; }
.choice span small { color: var(--muted); font-size: .82rem; }
.choice input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: .9rem; font-weight: 500; }
.field label span { color: var(--muted); font-weight: 400; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=time], input[type=url], select, textarea {
  font: inherit; font-size: 1rem; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.check input { margin-top: 5px; }
.queue { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .88rem; background: var(--alt); padding: 10px 14px; border-radius: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.btn { font: inherit; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 99px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.line { background: #06c755; border-color: #06c755; color: #fff; }
.btn.block { width: 100%; }
.err { color: #c0392b; font-size: .88rem; }
.summary { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.summary div { display: grid; grid-template-columns: 9em 1fr; gap: 10px; padding: 9px 14px; font-size: .92rem; border-top: 1px solid var(--line); }
.summary div:first-child { border-top: 0; }
.summary dt { color: var(--muted); } .summary dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pay { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; background: var(--alt); border-radius: 14px; padding: 16px; }
.qr { width: 132px; height: 132px; background: #fff; border-radius: 10px; padding: 8px; }
.qr canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.amount { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.orderno { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .03em; }
.msg { white-space: pre-wrap; background: var(--alt); border-radius: 14px; padding: 14px; font-size: .88rem; }
.howto { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: .92rem; }
.pill { display: inline-block; font-size: .78rem; font-weight: 500; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.s-wait { color: var(--warn); background: var(--warn-bg); }
.s-paid, .s-work, .s-preview { color: var(--info); background: var(--info-bg); }
.s-done { color: var(--ok); background: var(--ok-bg); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding-bottom: 14px; position: relative; color: var(--muted); }
.timeline li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); margin-top: 6px; }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.done { color: var(--ink); }
.timeline li.done::before { background: var(--accent); border-color: var(--accent); }
.timeline li.now b::after { content: " · ตอนนี้"; color: var(--link); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--alt); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--muted); }
.list { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; text-align: left; font: inherit; color: inherit; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); cursor: pointer; }
.row .sub { font-size: .84rem; color: var(--muted); grid-column: 1 / -1; }
.row.new { border-color: var(--link); }
.detail { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar select { width: auto; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-sz { position: absolute; left: 4px; bottom: 4px; padding: 0 6px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-size: .66rem; line-height: 1.6; }
a.thumb { display: block; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font: inherit; font-size: .8rem; line-height: 1; cursor: pointer; }
.file { font: inherit; font-size: .9rem; color: var(--muted); max-width: 100%; }
.file::file-selector-button { font: inherit; font-weight: 500; margin-right: 10px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.choices-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices-3 .choice span { text-align: center; align-content: center; padding-inline: 8px; }
@media (max-width: 560px) { .choices-stack { grid-template-columns: 1fr; } .choices-stack .choice span { text-align: left; padding-inline: 14px; } }
textarea.tall { min-height: 210px; line-height: 1.7; }
.venue { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.venue-h { font-weight: 600; font-size: .92rem; }
.rsvp { display: grid; gap: 8px; }
.rsvp-opt { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; font: inherit; font-size: .95rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; cursor: pointer; }
.rsvp-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .9rem; color: var(--muted); border: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.rsvp-opt.on { background: var(--ok-bg); border-color: var(--ok); }
.rsvp-opt.on .rsvp-n { background: var(--ok); color: var(--ok-bg); border: 0; }
.rsvp-ok { font-size: .8rem; font-weight: 500; color: var(--ok); white-space: nowrap; }
.pf { font-size: .88rem; padding: 8px 12px; border-radius: 10px; background: var(--alt); }
.pf-yes { color: var(--ok); background: var(--ok-bg); }
.pf-partial { color: var(--warn); background: var(--warn-bg); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.rq { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; }
.rq-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums; }
.rq-text { display: grid; gap: 2px; min-width: 0; }
.rq-text b { font-weight: 500; font-size: .95rem; }
.rq-text span { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.rq-edit { display: grid; gap: 6px; min-width: 0; }
.rq-edit input, .rq-edit textarea { padding: 8px 10px; font-size: .92rem; min-height: 0; }
.rq-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rq-b { font: inherit; font-size: .8rem; font-weight: 500; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; white-space: nowrap; }
.rq.on { background: var(--ok-bg); border-color: var(--ok); }
.rq.on .rq-n { background: var(--ok); color: var(--ok-bg); }
.rq.on .rq-toggle { color: var(--ok); border-color: var(--ok); }
.rq.off { background: var(--bad-bg); border-color: var(--bad); }
.rq.off .rq-n { background: var(--bad); color: var(--bad-bg); }
.rq.off .rq-text b { text-decoration: line-through; color: var(--muted); }
.rq.off .rq-toggle { color: var(--bad); border-color: var(--bad); }
@media (max-width: 480px) { .rq { grid-template-columns: 30px minmax(0, 1fr); } .rq-btns { grid-column: 2; justify-content: flex-start; } }
.add-q { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.add-q .field { flex: 1 1 240px; }
.rsvp-sum { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: var(--alt); outline: none; }
.sum-h { font-weight: 600; }
.pv { display: grid; gap: 12px; padding: 18px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.pv-title { font-weight: 600; font-size: 1.1rem; text-align: center; }
.pv-sub { font-size: .85rem; color: var(--muted); text-align: center; }
.pv-q { display: grid; gap: 6px; font-size: .88rem; }
.pv-input { display: block; height: 32px; border: 1px solid var(--line); border-radius: 8px; }
.pv-input.pv-tall { height: 64px; }
.pv-opts { display: grid; gap: 4px; }
.pv-opt { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 8px; background: var(--alt); font-size: .84rem; }
.pv-box { width: 12px; height: 12px; border: 1px solid var(--muted); border-radius: 3px; flex: none; }
.pv-btn { justify-self: stretch; text-align: center; padding: 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: .88rem; font-weight: 500; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: var(--ok-bg); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.sum-ok { color: var(--ok); background: var(--ok-bg); border: 1px solid var(--ok); padding: 10px 14px; border-radius: 12px; font-weight: 500; text-align: center; }
.queue.full { background: var(--warn-bg); color: var(--warn); }
.queue.closed { background: var(--bad-bg); color: var(--bad); }
.queue.closed .dot { background: var(--bad); } .queue.full .dot { background: var(--warn); }
.choice input:disabled + span { opacity: .5; cursor: not-allowed; }
.qset { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.qset-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.meter { height: 8px; border-radius: 99px; background: var(--alt); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }
.meter span.full { background: var(--warn); }
.qset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.qset-pause { padding-bottom: 10px; }
.s-data { color: var(--warn); background: var(--warn-bg); }
.err a { color: inherit; font-weight: 600; }
.qinfo { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--info-bg); color: var(--info); }
.qinfo b { font-size: 1.05rem; }
.choice span em.tag { font-style: normal; justify-self: start; font-size: .74rem; font-weight: 500; color: var(--ok); background: var(--ok-bg); padding: 1px 8px; border-radius: 99px; margin-top: 4px; }
.choice span small.soon { color: var(--warn); }
.sub-h { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-weight: 600; font-size: .95rem; margin-top: 8px; }
.sub-h .muted { font-weight: 400; font-size: .82rem; }
.sub-n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: .78rem; flex: none; }
.cardup { display: grid; gap: 10px; padding: 16px; border: 1px dashed var(--line); border-radius: 14px; background: var(--alt); }
.cardup-h { font-weight: 600; }
.pg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.xp { position: relative; display: grid; gap: 3px; align-content: start; text-align: left; font: inherit; color: inherit; padding: 10px 10px 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.xp:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.08); }
.xp-th { display: block; padding: 12px 16px; background: var(--alt); border-radius: 12px; margin-bottom: 8px; }
.xp-th svg { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 16px rgba(0,0,0,.07); }
.ill .p0 { fill: var(--i0); } .ill .p1 { fill: var(--i1); } .ill .p2 { fill: var(--i2); } .ill .p3 { fill: var(--i3); }
.xp-n { font-weight: 600; font-size: .86rem; line-height: 1.35; }
.xp-d { font-size: .75rem; color: var(--muted); line-height: 1.4; }
.xp-cta { margin-top: 8px; justify-self: start; font-size: .76rem; font-weight: 500; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); }
.xp-check { position: absolute; top: 16px; right: 16px; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1.5px solid var(--line); color: transparent; font-size: .78rem; font-weight: 700; }
.xp.on { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.xp.on .xp-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.xp.on .xp-cta { background: var(--ok); border-color: var(--ok); color: var(--ok-bg); }
@media (max-width: 560px) {
  .pg-grid { grid-template-columns: 1fr; gap: 8px; }
  .xp { grid-template-columns: 84px minmax(0, 1fr); column-gap: 14px; align-items: center; padding: 8px 44px 8px 8px; }
  .xp-th { grid-row: 1 / span 3; padding: 7px 10px; margin: 0; }
  .xp-th svg { border-radius: 7px; }
  .xp-n, .xp-d, .xp-cta { grid-column: 2; }
  .xp-cta { margin-top: 4px; }
  .xp-check { top: 50%; right: 12px; transform: translateY(-50%); }
}
#bf-sum { min-height: 120px; }
.detail > * { min-width: 0; }
.pg-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-strip svg { display: block; width: 64px; height: auto; border-radius: 6px; border: 1px solid var(--line); }
.rsvp-forms { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.rsvp-forms .choice span { align-content: start; }
.wrap.wide { max-width: 1180px; }
/* queue calendar */
.cal-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-end; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-nav b { margin-right: auto; font-weight: 600; }
.icon-b { font: inherit; min-width: 36px; height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.cal { display: grid; gap: 10px; }
.wk { display: grid; grid-template-columns: 160px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg); }
.wk.now { border-color: var(--accent); }
.wk-side { padding: 12px; display: grid; gap: 8px; align-content: start; background: var(--alt); }
.wk-t { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: .84rem; }
.tag { font-size: .68rem; font-weight: 500; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }
.wk-num { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.wk-count { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.wk-st { font-size: .72rem; font-weight: 500; padding: 1px 8px; border-radius: 99px; color: var(--ok); background: var(--ok-bg); }
.wk.full .wk-st { color: var(--warn); background: var(--warn-bg); }
.wk.over .wk-st, .wk.closed .wk-st { color: var(--bad); background: var(--bad-bg); }
.wk.over .meter span { background: var(--bad); }
.wk-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.mini { font: inherit; font-size: .74rem; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.mini[aria-pressed="true"] { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day { min-height: 118px; border-left: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 5px; min-width: 0; transition: background .12s; }
.day-n { font-size: .72rem; color: var(--muted); }
.day.today .day-n b { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 6px; }
.day.wkend { background: color-mix(in srgb, var(--alt) 55%, transparent); }
.day.past { background: var(--alt); }
.day.past .day-n { opacity: .55; }
.day.over { background: var(--warn-bg); box-shadow: inset 0 0 0 2px var(--link); }
.cal.moving .day:not(.past) { cursor: copy; }
.cal.moving .day:not(.past):hover { background: var(--warn-bg); }
.job { display: grid; gap: 1px; padding: 6px 8px; border-radius: 10px; font-size: .74rem; line-height: 1.3; cursor: grab; background: var(--info-bg); border: 1px solid transparent; border-left: 3px solid var(--info); user-select: none; min-width: 0; }
.job b { font-weight: 600; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job span { color: var(--muted); overflow-wrap: anywhere; }
.job em { font-style: normal; font-size: .7rem; color: var(--warn); }
.job em.bad { color: var(--bad); }
.job.s-wait { background: var(--warn-bg); border-left-color: var(--warn); }
.job.s-done { background: var(--ok-bg); border-left-color: var(--ok); opacity: .7; }
.job.hold { background: var(--bg); border: 1px dashed var(--warn); border-left: 3px solid var(--warn); }
.job.moving { outline: 2px solid var(--link); outline-offset: 1px; box-shadow: 0 6px 16px rgba(0,0,0,.15); }
.job.dragging { opacity: .35; }
.move-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: .88rem; }
.move-bar span { margin-right: auto; }
.move-bar input[type=date] { width: auto; padding: 5px 10px; font-size: .85rem; }
.move-bar .mini { background: transparent; color: inherit; border-color: currentColor; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: .88rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
@media (max-width: 760px) {
  .wk { grid-template-columns: 1fr; }
  .wk-side { grid-template-columns: 1fr auto; align-items: center; }
  .wk-side .meter { grid-column: 1 / -1; }
  .days { grid-template-columns: 1fr; }
  .day { min-height: 0; border-left: 0; border-top: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center; padding: 7px 10px; }
  .day-n { width: 52px; flex: none; }
  .job { flex: 1 1 150px; }
}
/* public queue preview */
.pubq { width: 100%; max-width: 440px; margin: 0 auto; display: grid; gap: 14px; padding: 28px 22px; border-radius: 24px; background: var(--alt); text-align: center; }
.eyebrow { font-size: .74rem; letter-spacing: .12em; color: var(--muted); }
.pubq h2 { font-size: 1.7rem; }
.pubq-list { list-style: none; margin: 0; padding: 0; text-align: left; background: var(--bg); border-radius: 16px; overflow: hidden; }
.pubq-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.pubq-list li:first-child { border-top: 0; }
.pubq-list .wkn { font-size: .92rem; font-weight: 500; }
.pdots { display: flex; gap: 4px; grid-column: 1; }
.pdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.pdots i.free { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.pst { grid-row: 1 / span 2; grid-column: 2; font-size: .82rem; font-weight: 500; color: var(--ok); }
.pst.low { color: var(--warn); } .pst.full, .pst.closed { color: var(--muted); }
.pub-mini { display: inline-flex; gap: 8px; align-items: center; padding: 8px 16px; border-radius: 99px; background: var(--alt); font-size: .88rem; justify-self: center; }
.note { font-size: .84rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 12px; }
@media (max-width: 480px) { .pay { grid-template-columns: 1fr; justify-items: center; text-align: center; } .summary div { grid-template-columns: 1fr; gap: 0; } }
@media (prefers-reduced-motion: no-preference) { .panel { animation: in .25s ease-out; } @keyframes in { from { transform: translateY(6px); } to { transform: none; } } }

/* ---------- Storefront look (same tokens and components as website-v2/site.css) ---------- */
:root { --accent-hover: #5a4236; --gutter: clamp(16px, 4vw, 40px); --r-lg: 28px; --r-md: 20px; --header-h: 52px; --ease: cubic-bezier(.25, 1, .5, 1); color-scheme: light; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body { background: var(--bg); font-size: 17px; overflow-x: clip; }
.wrap { width: 100%; max-width: calc(760px + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.wrap.wide { max-width: calc(1180px + var(--gutter) * 2); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

.proto-bar { background: #1d1612; color: #f5f5f7; font-size: .8rem; }
.proto-in { display: flex; align-items: center; gap: 8px; max-width: calc(1120px + var(--gutter) * 2); margin-inline: auto; padding: 8px var(--gutter); overflow-x: auto; scrollbar-width: none; }
.proto-in::-webkit-scrollbar { display: none; }
.proto-lbl { color: rgba(245,245,247,.6); white-space: nowrap; }
.proto-sep { flex: none; width: 1px; height: 18px; margin-inline: 4px; background: rgba(245,245,247,.25); }
.tab { font-size: .8rem; font-weight: 500; padding: 4px 12px; border-color: rgba(245,245,247,.28); background: transparent; color: #f5f5f7; white-space: nowrap; }
.tab[aria-selected="true"] { background: #f5f5f7; color: #1d1612; border-color: #f5f5f7; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.8); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid rgba(0,0,0,.08); }
.header-inner { display: flex; align-items: center; gap: 24px; max-width: calc(1120px + var(--gutter) * 2); height: var(--header-h); margin-inline: auto; padding-inline: var(--gutter); }
.wordmark { display: inline-flex; flex-direction: column; font-family: var(--font-mark); font-size: 1.02rem; line-height: .9; letter-spacing: .12em; color: var(--ink); text-decoration: none; }
.wordmark span { padding-left: .6em; }
.desktop-nav { display: flex; gap: 30px; margin-inline: auto; font-size: .86rem; }
.desktop-nav a { color: inherit; text-decoration: none; opacity: .82; }
.desktop-nav a:hover, .desktop-nav a[aria-current] { opacity: 1; }
.header-cta { display: inline-flex; align-items: center; min-height: 30px; padding: .2em .95em; border-radius: 980px; background: var(--accent); color: #fff; font-size: .82rem; font-weight: 500; text-decoration: none; }
.menu-toggle { display: none; position: relative; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.menu-toggle span:not(.sr) { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease); }
.menu-toggle span:nth-of-type(2) { top: 16px; } .menu-toggle span:nth-of-type(3) { top: 23px; }
.menu-toggle[aria-expanded="true"] span:nth-of-type(2) { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-of-type(3) { transform: translateY(-3.5px) rotate(-45deg); }
.mobile-menu { display: grid; padding: 8px var(--gutter) 24px; background: var(--bg); }
.mobile-menu a { padding: 14px 0; border-bottom: 1px solid var(--alt); font-size: 1.3rem; font-weight: 600; color: inherit; text-decoration: none; }
@media (max-width: 1024px) { .desktop-nav { display: none; } .header-cta { margin-left: auto; } .menu-toggle { display: block; } }

.panel { background: transparent; border-radius: 0; padding: clamp(40px, 7vw, 80px) 0 clamp(56px, 8vw, 104px); gap: 28px; scroll-margin-top: 60px; }
.page-head { display: grid; justify-items: center; gap: 12px; text-align: center; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.18; letter-spacing: -.005em; }
.page-head > p:not(.kicker) { max-width: 36ch; font-size: clamp(1.02rem, 1.5vw, 1.2rem); color: var(--muted); }
.kicker { font-size: 1rem; font-weight: 500; color: var(--link); }
.order-card { display: grid; gap: 24px; padding: clamp(20px, 4vw, 40px); border-radius: var(--r-lg); background: var(--alt); min-width: 0; }
.order-card [data-step] > fieldset, .order-card .cardup, .order-card .sum-card, .order-card .done-head { background: var(--bg); border: 0; border-radius: var(--r-md); padding: clamp(18px, 3vw, 26px); }
.order-card [data-step] > fieldset > legend { float: left; width: 100%; margin-bottom: 4px; }
.order-card .queue, .order-card .pay, .order-card .msg { background: var(--bg); }
legend { font-weight: 600; font-size: 1.05rem; }
.stepper li { font-size: .88rem; border-top-width: 2px; padding-top: 10px; }
.choice span { border-radius: 16px; padding: 14px 18px; background: var(--bg); font-size: .95rem; font-weight: 500; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.choice span small { font-weight: 400; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=time], input[type=url], select { min-height: 48px; padding: 8px 16px; font-size: 16px; }
textarea { padding: 12px 16px; font-size: 16px; }
.field label { font-size: .95rem; }
.btn { min-height: 44px; padding: .55em 1.35em; border-radius: 980px; font-size: 1rem; line-height: 1.2; transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
@media (hover: hover) { .btn:not(.line):not(:disabled):hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; } }
.summary { background: var(--bg); }
.status-card { display: grid; gap: 20px; max-width: 640px; width: 100%; margin-inline: auto; }
.pubq { max-width: 520px; padding: clamp(24px, 4vw, 40px); border-radius: var(--r-lg); }
.proto-note { justify-self: center; max-width: 52ch; padding: 8px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: .82rem; text-align: center; }

.site-footer { background: var(--alt); padding-block: 32px calc(32px + env(safe-area-inset-bottom, 0px)); font-size: .82rem; color: var(--muted); }
.site-footer .wrap { max-width: calc(1120px + var(--gutter) * 2); }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: inherit; text-decoration: none; } .footer-links a:hover { color: var(--ink); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 16px; }

@media (max-width: 560px) {
  .choices:not(.choices-3) { grid-template-columns: minmax(0, 1fr); }
  #hold-week-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Back office: compact cards on grey, no storefront header or footer. */
.admin-top { display: none; background: var(--bg); border-bottom: 1px solid var(--line); }
.admin-top-in { display: flex; align-items: center; gap: 14px; max-width: calc(1180px + var(--gutter) * 2); height: var(--header-h); margin-inline: auto; padding-inline: var(--gutter); }
.admin-tag { font-size: .8rem; font-weight: 500; padding: 2px 10px; border-radius: 99px; background: var(--alt); color: var(--muted); }
body.is-admin { background: var(--alt); font-size: 16px; }
body.is-admin .site-header, body.is-admin .site-footer { display: none; }
body.is-admin .admin-top { display: block; }
body.is-admin main.wrap { max-width: calc(960px + var(--gutter) * 2); padding-block: 24px 48px; }
body.is-admin main.wrap.wide { max-width: calc(1180px + var(--gutter) * 2); }
body.is-admin .panel { background: var(--bg); border-radius: var(--r-md); padding: clamp(20px, 4vw, 32px); gap: 22px; }
@media (max-width: 760px) { body { font-size: 16px; } .footer-bottom { flex-direction: column; } }

/* ---------- เพิ่มสำหรับระบบจริง ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cardup.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.cardup.check input { margin-top: 6px; }
.qr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.queue a, .err a { color: inherit; font-weight: 600; }
.status-steps { list-style: none; margin: 0; padding: 0; }
.done-head { display: grid; gap: 2px; justify-items: center; text-align: center; }
.done-ok { font-weight: 600; color: var(--ok); background: var(--ok-bg); padding: 4px 14px; border-radius: 99px; margin-bottom: 8px; }
.done-head .orderno { font-size: 2rem; line-height: 1.2; }
.pay-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pay-steps > li { display: grid; gap: 12px; padding: 18px; border-radius: var(--r-md); background: var(--bg); }
.pay-steps h2 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.ps-n { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--accent); color: var(--accent-ink); font-size: .85rem; }
.qr-full { display: grid; gap: 10px; justify-items: center; }
.qr-full img { width: 100%; max-width: 280px; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.qr-full .btn { max-width: 280px; }
.queue { flex-wrap: nowrap; align-items: flex-start; } .queue .dot { flex: none; margin-top: 8px; }
.save-note { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: #eef6f0; color: #1f5c3a; border: 1px solid #cfe6d7; font-size: .9rem; }
.save-note b { font-size: .95rem; }
.save-state { font-size: .8rem; color: #3f7a57; }
.linkish { justify-self: start; background: none; border: 0; padding: 0; font: inherit; font-size: .82rem; color: #1f5c3a; text-decoration: underline; cursor: pointer; }
.link-note { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--info-bg); color: var(--info); font-size: .92rem; }
.link-note b { font-size: 1rem; }
.hold-link, .done-complete { display: grid; gap: 8px; padding: 16px; border-radius: var(--r-md); background: var(--info-bg); color: var(--info); font-size: .92rem; }
.hold-link input { font-size: .85rem; min-height: 40px; color: var(--ink); }
.done-complete { background: var(--ok-bg); color: var(--ok); }
.done-complete b { font-size: 1.05rem; }
.hold-link .btn.ghost { background: var(--bg); color: var(--accent); border-color: var(--accent); }

/* ทุกหัวข้อต้องอยู่ในการ์ดขาว (ขั้น 1 และ 3 เดิมหัวข้อลอยอยู่บนพื้นเทา) */
.order-card .note { background: var(--bg); border: 0; border-radius: var(--r-md); padding: 14px 18px; }
.order-card .done-head { padding-block: 22px; }
.sum-card { display: grid; gap: 12px; }
.sum-card h2 { font-size: 1.05rem; }
.order-card .sum-card .summary { background: var(--bg); }
