/* ธีม MEW Bill — ตระกูลเดียวกับ Mewlet: พื้นครีม ขอบเข้ม เงาแข็ง ม่วงชมพู ไอคอน 3D */
:root {
  color-scheme: light;
  --bg: #fff8ef;
  --card: #ffffff;
  --soft: #f6f0ff;
  --text: #1f1a33;
  --ink: #1f1a33;
  --muted: #5a5170;
  --line: #ebe4f5;
  --dash: #d9d0ea;
  --accent: #7c5cff;
  --accent-ink: #5b3fd6;
  --accent-soft: #f1ecff;
  --pink: #e0559a;
  --yellow: #ffd166;
  --coral: #ff6b6b;
  --on-accent: #ffffff;
  --warn: #8a5a00;
  --warn-soft: #fff3d1;
  --good: #15803d;
  --good-soft: #e6f9ed;
  --danger: #b42318;
  --danger-soft: #ffe5e5;
  --shadow: 3px 3px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --radius: 20px;
  --num: 'Inter', 'IBM Plex Sans Thai', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', 'Noto Sans Thai', 'Leelawadee UI', sans-serif;
}
#app { max-width: 540px; margin: 0 auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
#app.has-bar { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
h1 { font-size: 24px; margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
p { margin: 0; }
.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.row > .grow, .grow { flex: 1; min-width: 0; }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.stack > * + * { margin-top: 12px; }
a { color: var(--accent-ink); }
img.e3d { width: 32px; height: 32px; display: block; }

/* ---------- หัวหน้าเว็บ ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 4px 2px 6px; }
.topbar img { width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--ink); box-shadow: var(--shadow-sm); }
.topbar .muted { margin-top: 0; }
.brand { font-family: var(--num); font-weight: 900; letter-spacing: -0.03em; font-size: 28px; }
.brand b { color: var(--accent); font-weight: 900; }

.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.howto div {
  background: var(--card); border: 2px solid var(--ink); border-radius: 16px; padding: 10px 8px;
  text-align: center; font-size: 13px; line-height: 1.35; color: var(--muted); box-shadow: var(--shadow-sm);
}
.howto b { display: block; font-size: 22px; line-height: 1.2; margin-bottom: 2px; }

/* ---------- ชวนเก็บเป็นไอคอนบนมือถือ ---------- */
.install {
  position: relative; margin-top: 14px; padding: 14px 16px 16px; border-radius: var(--radius);
  background: var(--yellow); color: var(--ink);
  border: 2px solid var(--ink); box-shadow: var(--shadow);
}
.install > * + * { margin-top: 12px; }
.install .row { align-items: flex-start; gap: 12px; padding-right: 26px; margin-top: 0; }
.install img { width: 52px; height: 52px; border-radius: 14px; flex: none; border: 2px solid var(--ink); }
.install b { font-size: 16.5px; line-height: 1.35; }
.install p { font-size: 14px; margin-top: 2px; }
.install-close { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border: 0; background: none; color: inherit; opacity: 0.7; font-size: 16px; margin: 0; }
.install-visual { display: flex; align-items: flex-start; justify-content: center; gap: 4px; background: #fff; border: 2px solid var(--ink); border-radius: 16px; padding: 12px 6px; }
.install-visual > div { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 13px; line-height: 1.35; }
.install-visual .arrow { font-size: 20px; opacity: 0.6; flex: none; margin-top: 16px; }
.install-list { background: #fff; border: 2px solid var(--ink); border-radius: 16px; padding: 6px 12px; }
.install-list > div { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 15px; line-height: 1.35; }
.install-list > div + div { border-top: 1.5px dashed var(--dash); }
.install-list b { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12.5px; }
.install-list .icon-tile { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.install-list .icon-tile svg { width: 24px; height: 24px; }
.install .install-note { font-size: 13px; text-align: center; margin-top: 8px; }
.install-visual b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; }
.icon-tile { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: #fff; color: #0a7aff; border: 1.5px solid var(--ink); }
.icon-tile svg { width: 32px; height: 32px; }
.install-steps { margin: 12px 0 0; padding: 10px 12px 10px 32px; background: #fff; border: 2px solid var(--ink); border-radius: 14px; font-size: 14.5px; line-height: 1.5; }
.install-steps li + li { margin-top: 4px; }
.install-steps b { font-size: inherit; }

/* ---------- การ์ด ---------- */
.card {
  background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 16px; margin-top: 14px; box-shadow: var(--shadow);
}
.step {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-family: var(--num); font-size: 14px; font-weight: 800;
  border: 2px solid var(--ink);
}
h2 .hint { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: auto; text-align: right; }

/* ---------- ช่องกรอก ---------- */
.input {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: inherit;
  background: #fff; border: 2px solid var(--ink); border-radius: 14px; outline: none;
  transition: box-shadow 0.15s;
}
.input::placeholder { color: var(--muted); opacity: 0.8; }
.input:focus { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 5px var(--accent); }
.input.small { width: 88px; flex: none; text-align: right; }
.price-wrap { position: relative; flex: none; width: 118px; }
.price-wrap .input { text-align: right; padding-left: 28px; font-family: var(--num); font-weight: 700; font-variant-numeric: tabular-nums; }
.price-wrap::before { content: '฿'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
label.field.row { display: flex; }
label.field.row .input { margin-top: 0; }
.date-input { width: auto; flex: none; min-width: 160px; }
label.field { display: block; font-size: 14px; color: var(--muted); }
label.field .input { margin-top: 6px; color: var(--text); }

/* ---------- ปุ่ม ---------- */
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 16px; border-radius: 14px; border: 2px solid var(--ink);
  background: #fff; font-weight: 700; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
/* ปุ่มหลักสีแดงอมส้ม ตัวหนังสือเข้ม (ขาวบนสีนี้อ่านยาก) */
.btn.primary { background: var(--coral); color: var(--ink); box-shadow: var(--shadow); }
.btn.outline { color: var(--accent-ink); background: var(--accent-soft); }
.btn.block { display: flex; width: 100%; }
.item-hint { font-size: 13.5px; color: var(--muted); min-height: 1.2em; }
.btn.big { min-height: 56px; font-size: 18px; border-radius: 16px; }
.btn.dashed { border-style: dashed; color: var(--muted); background: transparent; box-shadow: none; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); font-weight: 500; box-shadow: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.icon-btn { width: 36px; height: 48px; flex: none; border: 0; background: none; color: var(--muted); font-size: 18px; border-radius: 10px; }

/* ---------- ป้ายเลือก ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 5px 14px; border-radius: 999px; border: 2px solid var(--ink);
  background: #fff; font-size: 15px; font-weight: 500; white-space: nowrap; transition: background 0.12s, opacity 0.12s;
}
.chip.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.chip.danger { background: var(--danger); color: #fff; font-weight: 600; }
.chip.no-friends { white-space: normal; text-align: left; border-radius: 14px; font-size: 14px; line-height: 1.4; padding: 8px 12px; }
.chip.add { border-style: dashed; color: var(--muted); }
.chip .x { display: inline-block; margin: -6px -10px -6px 0; padding: 6px 10px; opacity: 0.6; }
.chip.person { padding-left: 5px; }
.chip.person:not(.on) { color: var(--muted); border-color: #cfc6e0; text-decoration: line-through; }
/* สัดส่วน: ชื่อที่ติ๊กแล้วมีปุ่ม − ×n + ติดอยู่ เป็นก้อนเดียวกัน */
.share { display: inline-flex; align-items: stretch; border: 2px solid var(--ink); border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.share .chip { border: 0; border-radius: 0; background: transparent; }
.share-btn { min-width: 38px; min-height: 40px; border: 0; border-left: 1.5px solid var(--ink); background: #fff; color: var(--ink); font-size: 20px; font-weight: 700; padding: 0; }
.share-btn:disabled { opacity: 0.35; }
.share-n { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; border-left: 1.5px solid var(--ink); background: var(--yellow); font-family: var(--num); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.share.more { background: var(--warn-soft); }
.share.more .chip.on { color: var(--warn); }
.share-note { font-size: 13px; color: var(--muted); margin-top: -2px; }
.chip.pay.on { background: var(--warn-soft); color: var(--warn); text-decoration: none; }
.chip.pay:not(.on) { text-decoration: none; color: var(--ink); border-color: var(--ink); }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative;
  padding: 10px 4px 8px; border-radius: 16px; border: 2px solid var(--ink); background: #fff;
  font-size: 13.5px; font-weight: 500; line-height: 1.3; min-height: 80px; justify-content: center;
}
.cat b { font-size: 28px; line-height: 1.15; font-weight: 400; }
.cat.on { background: var(--yellow); font-weight: 700; box-shadow: var(--shadow-sm); }
.cat .x { position: absolute; top: 0; right: 0; padding: 4px 9px; opacity: 0.6; font-size: 13px; }

.av {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: var(--ink); line-height: 1; text-decoration: none; overflow: hidden;
  border: 1.5px solid var(--ink);
}
.av.lg { width: 40px; height: 40px; font-size: 14px; border-width: 2px; }
.av0 { background: #c9b8ff; } .av1 { background: #ffc7dd; } .av2 { background: #bfe9ff; } .av3 { background: #ffe08a; }
.av4 { background: #c7f0c9; } .av5 { background: #ffd0b5; } .av6 { background: #d7d2ff; } .av7 { background: #e3e0ea; }

.seg { display: inline-flex; background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; min-height: 34px; font-size: 14px; color: var(--muted); border-radius: 10px; font-weight: 600; }
.seg button.on { background: var(--accent); color: #fff; font-weight: 700; }

/* ---------- รายการ ---------- */
.item { background: #fff; border: 2px solid var(--ink); border-radius: 16px; padding: 12px; margin-top: 10px; }
.item .input { background: #fff; }
.tag { align-self: center; font-size: 13px; color: var(--muted); width: 100%; margin-bottom: -4px; }

.sum-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1.5px dashed var(--dash); }
.sum-row:last-child { border-bottom: 0; }
.sum-row b { white-space: nowrap; font-family: var(--num); font-variant-numeric: tabular-nums; }
.sum-row .who-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sum-total { font-size: 18px; font-weight: 700; border-bottom: 0; padding-top: 12px; }
.warn { background: var(--warn-soft); color: var(--warn); border: 2px solid var(--ink); border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.breakdown { background: var(--bg); border: 2px solid var(--ink); border-radius: 16px; padding: 10px 14px 4px; }
.breakdown-title { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.breakdown .sum-row { padding: 7px 0; font-size: 15px; }
.breakdown .sum-total { font-size: 16px; padding-top: 8px; border-top: 1.5px dashed var(--dash); }
.item-name { display: block; }
.item-who { display: block; font-size: 13.5px; }
.name-check { background: var(--warn-soft); color: var(--warn); border: 2px solid var(--ink); border-radius: 14px; padding: 10px 12px; font-size: 14.5px; text-align: center; }
.receipt-box { margin-top: 14px; padding-top: 12px; border-top: 1.5px dashed var(--dash); }
.receipt-title { font-size: 14px; color: var(--muted); font-weight: 600; }
.receipt-inline { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; border: 2px solid var(--ink); background: #fff; cursor: zoom-in; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 14px; overflow: hidden; border: 2px solid var(--ink); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(31, 26, 51, 0.75); color: #fff; font-size: 13px; }
.note-box { background: var(--bg); border: 2px solid var(--ink); border-radius: 16px; padding: 12px; }
.note-box > * + * { margin-top: 8px; }
.warn-text { color: var(--warn); font-size: 14px; }
details > summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 15px; }
details[open] > summary { margin-bottom: 10px; }

/* ---------- แถบล่างหน้าสร้างบิล ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: #fff; border-top: 2px solid var(--ink); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.bar-inner { max-width: 508px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bar .total { line-height: 1.25; min-width: 0; color: var(--muted); font-size: 13px; }
.bar .total b { display: block; font-family: var(--num); font-size: 22px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar .btn { flex: 1; }

/* ---------- หน้าดูบิล ---------- */
.hero {
  background: linear-gradient(135deg, var(--accent), var(--pink)); color: var(--on-accent);
  border: 2.5px solid var(--ink); border-radius: 24px; padding: 20px; box-shadow: 4px 4px 0 var(--ink);
}
.hero .emoji { font-size: 40px; line-height: 1; }
.hero .emoji img.e3d { width: 52px; height: 52px; }
.hero h1 { margin-top: 8px; }
.hero .meta { font-size: 15px; margin-top: 2px; }
.progress { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.3); border: 2px solid var(--ink); margin-top: 14px; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--yellow); transition: width 0.4s; }
.hero .expires { font-size: 13px; margin-top: 8px; }
.hero .progress-label { font-size: 13.5px; margin-top: 6px; }

.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.who {
  text-align: left; padding: 10px; border-radius: 16px; border: 2px solid var(--ink); background: #fff;
  display: flex; align-items: center; gap: 10px; min-height: 64px;
}
.who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.who.on { background: var(--accent-soft); box-shadow: var(--shadow-sm); }
.who .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .amt { font-size: 13.5px; color: var(--muted); font-family: var(--num); }
.who.paid .amt { color: var(--good); font-weight: 700; }

.amount { font-family: var(--num); font-size: 52px; font-weight: 800; line-height: 1.05; text-align: center; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.amount small { font-family: 'IBM Plex Sans Thai', sans-serif; font-size: 18px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.qr { display: block; width: 100%; max-width: 330px; margin: 0 auto; border-radius: 18px; border: 2px solid var(--ink); box-shadow: var(--shadow); }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.35; }
.steps3 b { display: grid; place-items: center; width: 26px; height: 26px; margin: 0 auto 4px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); color: var(--ink); font-family: var(--num); font-size: 12px; }
.paid-banner { background: var(--good-soft); color: var(--good); border: 2px solid var(--ink); border-radius: 14px; padding: 12px; text-align: center; font-weight: 700; }
.link-box { background: var(--bg); border: 2px solid var(--ink); border-radius: 14px; padding: 12px 14px; word-break: break-all; font-weight: 600; }
.transfer + .transfer { border-top: 1.5px dashed var(--dash); padding-top: 16px; }

.overlay {
  position: fixed; inset: 0; z-index: 20; background: rgba(31, 26, 51, 0.9); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px;
}
.overlay img { max-width: 100%; max-height: 85vh; border-radius: 10px; }

#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 15px; max-width: 90vw;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 30; text-align: center;
  box-shadow: 3px 3px 0 var(--accent);
}
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- จำนวนต่อรายการ / เมนูที่จำไว้ / บัญชีธนาคาร ---------- */
.item-options { align-items: center; }
.seg.qty { align-items: center; padding: 0; overflow: hidden; }
.seg.qty span { min-width: 36px; align-self: stretch; display: grid; place-items: center; text-align: center; font-family: var(--num); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.seg.qty button { min-width: 36px; font-size: 18px; font-weight: 700; color: var(--ink); border-radius: 0; }
.seg.qty button:disabled { opacity: 0.3; }
.menu-box { margin-top: 12px; padding-top: 12px; border-top: 1.5px dashed var(--dash); }
.small-note { font-size: 12.5px; }
.chip.sober.on { background: var(--warn-soft); color: var(--warn); }
.payee-name { font-weight: 600; }
.bank-box { text-align: center; }
.bank-name { font-weight: 700; font-size: 17px; }
.bank-no { font-family: var(--num); font-size: 26px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; word-break: break-all; }
select.input { appearance: auto; }
.back-link { display: inline-block; padding: 6px 2px 12px; font-weight: 600; text-decoration: none; }
.section-head { margin: 18px 2px 10px; }
.keep-box { margin-top: 14px; padding: 12px; border: 2px dashed var(--ink); border-radius: 16px; background: var(--warn-soft); }
.keep-title { font-weight: 700; color: var(--warn); }
.chip.keep { white-space: normal; text-align: left; }
.chip.keep.on { background: var(--yellow); color: var(--ink); font-weight: 700; }
/* แถบจำ/ไม่จำ: สีเหลืองทึบ ขอบเข้ม ให้เห็นชัดบนมือถือ (เจ้าของเคยหาไม่เจอ ห้ามทำเล็กหรือซ่อน) */
.keep-row { padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--yellow); border: 2px solid var(--ink); color: var(--ink); font-size: 15px; font-weight: 700; }
.keep-row.on { background: #ffb300; }
.keep-seg { flex: none; display: inline-flex; gap: 6px; }
.keep-seg button { min-height: 38px; padding: 6px 14px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font: inherit; font-size: 14.5px; font-weight: 700; }
.keep-seg button.on { background: var(--ink); color: var(--yellow); }

/* หน้าใส่รายการ: เมนูที่เสร็จย่อเป็นบรรทัดเดียว เมนูที่แก้เปิดเต็มใบ */
.item.editing { border: 2.5px solid var(--accent); outline: 2px solid var(--ink); padding: 16px; background: #fff; box-shadow: var(--shadow); }
.item-compact { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 64px; margin-top: 10px; padding: 10px 14px; text-align: left; background: #fff; border: 2px solid var(--ink); border-radius: 16px; }
.item-compact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-compact-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-compact small { font-size: 12px; color: var(--muted); font-weight: 400; }
.item-compact-price { display: flex; flex-direction: column; align-items: end; flex: none; font-family: var(--num); }
.item-price-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.item-price-grid .price-wrap { width: 100%; margin-top: 6px; }
.item-price-grid .seg.qty { width: 100%; min-height: 48px; margin-top: 6px; justify-content: space-between; }
.item-price-grid .seg.qty button { flex: 1; }
.item-price-grid .seg.qty span { align-self: stretch; }
.item-total { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--yellow); border: 2px solid var(--ink); color: var(--ink); }
.item-total b { font-family: var(--num); font-size: 20px; font-weight: 800; white-space: nowrap; }
.payer-choice { margin-top: 8px; }
.payer-choice p { margin-bottom: 8px; }
.payer-seg { width: 100%; }
.payer-seg button { flex: 1; min-height: 48px; font-size: 15px; }
.btn.add-menu { margin-top: 14px; min-height: 60px; font-size: 17px; background: var(--accent); color: #fff; }
.menu-box .chip.add { border-style: solid; background: var(--yellow); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }
.pending-banner { background: var(--warn-soft); color: var(--warn); border: 2px solid var(--ink); border-radius: 14px; padding: 12px; text-align: center; font-weight: 700; }
.payment-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.payment-actions > * { flex: 1; min-width: 120px; }
.owner-payment-row { flex-wrap: wrap; }
.owner-payment-row .payment-actions { flex-basis: 100%; }
.payment-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; font-size: 12px; text-align: center; }
.payment-steps span { padding: 7px 4px; border: 2px solid var(--dash); border-radius: 12px; background: #fff; color: var(--muted); line-height: 1.25; }
.payment-steps span.active { border-color: var(--ink); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; box-shadow: var(--shadow-sm); }
@media (max-width: 380px) { .item-price-grid { grid-template-columns: 1fr; } }

/* วงแหวนได้เงินคืน (หน้าคนสร้างบิล) */
.ring-card { display: flex; align-items: center; gap: 16px; }
.ring-wrap { position: relative; width: 92px; height: 92px; flex: none; }
.ring-wrap svg { width: 100%; height: 100%; display: block; }
.ring-wrap b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--num); font-weight: 800; font-size: 20px; }
.ring-amt { font-family: var(--num); font-weight: 800; font-size: 28px; letter-spacing: -0.02em; line-height: 1.2; }
.ring-amt small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.ring-chip { display: inline-block; margin-top: 6px; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 700; }

/* ก๊วนประจำ: ปุ่มใหญ่ แตะทีเดียวใส่ชื่อครบ */
.gang-box { background: var(--accent-soft); border: 2px solid var(--ink); border-radius: 16px; padding: 10px 12px 12px; }
.gang-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.gang { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-height: 52px; padding: 7px 34px 7px 12px; border: 2px solid var(--ink); border-radius: 14px; background: var(--yellow); box-shadow: var(--shadow-sm); }
.gang b { font-size: 15px; line-height: 1.3; }
.gang small { font-size: 12.5px; color: var(--ink); opacity: 0.8; }
.gang.on { background: #fff; box-shadow: none; }
.gang .x { position: absolute; top: 2px; right: 2px; padding: 4px 9px; opacity: 0.6; font-size: 13px; }
