:root {
--ink: #17212b;
--muted: #66727c;
--paper: #f2f4f3;
--card: #ffffff;
--line: #dde3e1;
--pine: #0e5a4c;
--pine-dark: #0a443a;
--pine-soft: #e2efec;
--gold: #f5b301;
--gold-soft: #fff4d1;
--red: #c0392b;
--red-soft: #fbe9e6;
--nav: 62px;
--safe-b: env(safe-area-inset-bottom, 0px);
--safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
font-family: 'IBM Plex Sans Thai', 'Noto Sans Thai', 'Sarabun', system-ui, -apple-system, 'Segoe UI', sans-serif;
background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.45;
font-variant-numeric: tabular-nums; overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; text-align: inherit; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.hide { display: none !important; }
#app { max-width: 1180px; margin: 0 auto; }
#main { padding: 0 14px calc(var(--nav) + var(--safe-b) + 24px); }
.top { position: sticky; top: 0; z-index: 5; background: var(--paper); padding: calc(var(--safe-t) + 10px) 0 6px; }
.shop { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.shop h1 { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop .sub { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.search { width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); }
.search:focus { border-color: var(--pine); outline: none; }
.ibtn { flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 20px; }
.ibtn.pri { background: var(--pine); color: #fff; border-color: var(--pine); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 38px; padding: 0 14px; border-radius: 19px; background: var(--card); border: 1.5px solid var(--line); font-weight: 500; font-size: 15px; }
.chip.on { background: var(--pine); border-color: var(--pine); color: #fff; }
.chip .n { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; text-align: center; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #f0d27a; margin: 4px 0 8px; font-size: 14px; }
.banner.red { background: var(--red-soft); border-color: #efc2bb; }
.banner .grow { line-height: 1.35; }
.banner button { flex: none; font-weight: 600; color: var(--pine); padding: 6px 4px; }
.sell { display: grid; gap: 14px; }
@media (min-width: 860px) {
.sell { grid-template-columns: 1fr 360px; align-items: start; }
.cartbar { display: none !important; }
.cartpane { display: block !important; position: sticky; top: 12px; }
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tile { position: relative; min-height: 92px; padding: 10px 10px 8px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 6px; overflow: hidden; }
.tile:active { transform: scale(0.97); }
.tile .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.tile .nm { font-weight: 600; font-size: 15px; line-height: 1.3; word-break: break-word; }
.tile .pr { font-size: 14px; color: var(--pine); font-weight: 700; }
.tile .pr small { color: var(--muted); font-weight: 400; }
.tile .st { position: absolute; right: 6px; top: 6px; font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--pine-soft); color: var(--pine); }
.tile .st.low { background: var(--red-soft); color: var(--red); font-weight: 600; }
.tile.key { background: var(--pine-soft); border-style: dashed; border-color: var(--pine); align-items: center; justify-content: center; text-align: center; color: var(--pine); }
.tile.key .nm { font-size: 16px; }
.tile.incart { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine); }
.tile .q { position: absolute; right: 6px; bottom: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--pine); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.empty { padding: 36px 12px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.cartbar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav) + var(--safe-b)); z-index: 6; padding: 8px 12px; }
.cartbar button { width: 100%; max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 16px; border-radius: 16px; background: var(--pine); color: #fff; box-shadow: 0 6px 20px rgba(10, 68, 58, 0.35); }
.cartbar .cnt { background: rgba(255,255,255,0.18); border-radius: 12px; padding: 2px 10px; font-size: 14px; }
.cartbar .tot { margin-left: auto; font-size: 22px; font-weight: 700; }
.cartpane { display: none; }
.cart { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; }
.cart h2 { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; font-size: 17px; border-bottom: 1px solid var(--line); }
.cart h2 button { font-size: 14px; color: var(--red); font-weight: 500; }
.lines { max-height: 46vh; overflow-y: auto; }
.line { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.line .nm { font-weight: 600; line-height: 1.3; }
.line .meta { color: var(--muted); font-size: 13px; }
.line .amt { margin-left: auto; font-weight: 700; white-space: nowrap; }
.line .stp { display: flex; align-items: center; gap: 2px; flex: none; }
.line .stp button { width: 34px; height: 34px; border-radius: 10px; background: var(--paper); font-size: 20px; display: grid; place-items: center; }
.line .stp span { min-width: 26px; text-align: center; font-weight: 600; }
.sums { padding: 10px 14px; display: grid; gap: 4px; }
.sums .r { display: flex; justify-content: space-between; color: var(--muted); }
.sums .r.big { color: var(--ink); font-size: 24px; font-weight: 700; }
.sums .r button { color: var(--pine); font-weight: 600; }
.cart .pay { padding: 0 14px 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); font-weight: 600; }
.btn-primary { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn-danger { color: var(--red); border-color: #efc2bb; background: var(--red-soft); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #3b2c00; }
.btn-block { width: 100%; }
.btn-big { height: 60px; font-size: 20px; border-radius: 16px; }
.btn:disabled { opacity: 0.45; }
.btn-sm { height: 38px; padding: 0 12px; border-radius: 11px; font-size: 14px; }
.actions { display: flex; gap: 10px; margin-top: 14px; }
.actions .btn { flex: 1; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; height: calc(var(--nav) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: center; }
.nav button { flex: 1; max-width: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); position: relative; }
.nav button svg { width: 24px; height: 24px; }
.nav button.on { color: var(--pine); font-weight: 600; }
.nav .dot { position: absolute; top: 6px; left: 50%; margin-left: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.card h3 { font-size: 16px; margin-bottom: 10px; }
.list { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; }
.item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .nm { font-weight: 600; }
.item .meta { color: var(--muted); font-size: 13px; }
.item .end { margin-left: auto; text-align: right; white-space: nowrap; }
.item .end b { display: block; }
.item.void .nm, .item.void .end b { text-decoration: line-through; color: var(--muted); }
.tag { display: inline-block; padding: 0 7px; border-radius: 8px; font-size: 12px; background: var(--pine-soft); color: var(--pine); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.gold { background: var(--gold-soft); color: #7a5a00; }
.sec { margin: 18px 4px 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.ptitle { font-size: 20px; font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-size: 22px; line-height: 1.25; margin-top: 2px; }
.kpi.main { background: var(--pine); border-color: var(--pine); color: #fff; grid-column: span 2; }
.kpi.main span { color: rgba(255,255,255,0.8); }
.kpi.main b { font-size: 32px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 18px; }
.bars .b { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.bars .b i { display: block; width: 100%; max-width: 28px; border-radius: 4px 4px 0 0; background: var(--pine); min-height: 2px; }
.bars .b i.z { background: var(--line); }
.bars .b small { font-size: 10px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.bars .b em { position: absolute; top: -2px; font-style: normal; font-size: 10px; color: var(--muted); white-space: nowrap; }
.split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); margin: 8px 0 6px; }
.split i { display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--c); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.t td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
table.t .n { text-align: right; white-space: nowrap; }
.f { display: block; margin-bottom: 12px; }
.f > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.f input:not([type=checkbox]), .f select, .f textarea { width: 100%; height: 48px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); }
.f textarea { height: 80px; padding: 10px 12px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--pine); outline: none; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: center; margin: 4px 0 12px; font-size: 15px; }
.check input { width: 22px; height: 22px; accent-color: var(--pine); flex: none; }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.seg { display: flex; background: var(--paper); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; height: 42px; border-radius: 10px; font-weight: 600; color: var(--muted); text-align: center; }
.seg button.on { background: var(--card); color: var(--pine); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.swatches button.on { border-color: var(--ink); }
.ov { position: fixed; inset: 0; z-index: 20; background: rgba(15, 25, 30, 0.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 94vh; overflow-y: auto; background: var(--card); border-radius: 20px 20px 0 0; padding: 14px 16px calc(16px + var(--safe-b)); animation: up 0.18s ease-out; }
@media (min-width: 700px) { .ov { align-items: center; } .sheet { border-radius: 20px; max-height: 90vh; } }
@keyframes up { from { transform: translateY(30px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sh { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sh h2 { font-size: 19px; flex: 1; min-width: 0; }
.sh .x { width: 40px; height: 40px; border-radius: 12px; background: var(--paper); font-size: 22px; display: grid; place-items: center; flex: none; }
.disp { text-align: right; font-size: 40px; font-weight: 700; padding: 6px 12px; border-radius: 14px; background: var(--paper); min-height: 64px; line-height: 52px; overflow: hidden; white-space: nowrap; }
.disp small { font-size: 18px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.disp.ph { color: var(--muted); }
.calc { text-align: right; color: var(--muted); margin: 6px 4px 0; min-height: 22px; }
.calc b { color: var(--pine); font-size: 18px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pad button { height: 58px; border-radius: 14px; background: var(--paper); font-size: 26px; font-weight: 600; text-align: center; }
.pad button:active { background: var(--line); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.quick button { flex: 1 0 auto; min-width: 64px; height: 42px; padding: 0 10px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 600; text-align: center; }
.quick button.on { border-color: var(--pine); color: var(--pine); background: var(--pine-soft); }
.bigpay { text-align: center; margin: 4px 0 12px; }
.bigpay span { color: var(--muted); }
.bigpay b { display: block; font-size: 44px; line-height: 1.1; }
.change { text-align: center; padding: 12px; border-radius: 16px; background: var(--pine-soft); margin-top: 10px; }
.change span { color: var(--pine); }
.change b { display: block; font-size: 40px; color: var(--pine); line-height: 1.15; }
.change.bad { background: var(--red-soft); }
.change.bad span, .change.bad b { color: var(--red); }
.done { text-align: center; padding: 8px 0; }
.done .ok { width: 64px; height: 64px; border-radius: 50%; background: var(--pine); color: #fff; font-size: 34px; display: grid; place-items: center; margin: 0 auto 8px; }
.ppqr { text-align: center; }
.ppqr svg { width: 230px; height: 230px; }
.ppqr p { color: var(--muted); }
.rc { font-size: 14px; background: #fff; color: #000; border: 1px dashed var(--line); border-radius: 12px; padding: 14px; max-width: 340px; margin: 0 auto; }
.rc .c { text-align: center; }
.rc .h { font-size: 18px; font-weight: 700; }
.rc .lr { display: flex; justify-content: space-between; gap: 10px; }
.rc .lr span:last-child { white-space: nowrap; }
.rc hr { border: 0; border-top: 1px dashed #999; margin: 8px 0; }
.rc .tot { font-size: 18px; font-weight: 700; }
.rc .sm { font-size: 12px; }
.rc .void { border: 2px solid #000; display: inline-block; padding: 2px 10px; font-weight: 700; margin: 6px 0; }
.lock { position: fixed; inset: 0; z-index: 40; background: var(--pine); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.lock h2 { font-size: 22px; margin-bottom: 4px; }
.lock p { opacity: 0.8; margin-bottom: 18px; }
.lock .dots { display: flex; gap: 14px; margin-bottom: 22px; }
.lock .dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; }
.lock .dots i.on { background: #fff; }
.lock .dots.shake { animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.lock .pad { width: 100%; max-width: 300px; }
.lock .pad button { background: rgba(255,255,255,0.14); color: #fff; height: 64px; }
.cam { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .aim { position: absolute; left: 12%; right: 12%; top: 38%; bottom: 38%; border: 3px solid var(--gold); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0,0,0,0.25); }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav) + var(--safe-b) + 84px); transform: translateX(-50%); z-index: 50; background: #1d2a33; color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 15px; max-width: 92vw; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.about { text-align: center; color: var(--muted); font-size: 13px; margin: 24px 0 8px; }
#print-area { display: none; }
@media print {
@page { margin: 0; size: var(--pw, 58mm) auto; }
body { background: #fff; }
body > *:not(#print-area) { display: none !important; }
#print-area { display: block; width: var(--pw, 58mm); padding: 2mm 3mm; font-size: 11pt; }
#print-area .rc { border: 0; padding: 0; max-width: none; font-size: 10pt; }
}
@media (max-width: 859px) { body.hascart #main { padding-bottom: calc(var(--nav) + var(--safe-b) + 100px); } }
.tile .st ~ .nm { padding-right: 30px; }
.tile { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.ibtn.on { background: var(--pine); color: #fff; border-color: var(--pine); }
.grid.arr .tile[data-id] { border-style: dashed; border-color: var(--pine); cursor: grab; animation: wig 0.3s ease-in-out infinite alternate; }
.grid.arr .tile.key { opacity: 0.35; }
.grid.arr .tile:active { transform: none; }
@keyframes wig { from { transform: rotate(-0.8deg); } to { transform: rotate(0.8deg); } }
@media (prefers-reduced-motion: reduce) { .grid.arr .tile[data-id] { animation: none; } }
.drag-src { opacity: 0.25; animation: none !important; }
.drag-ghost { position: fixed; z-index: 1000; margin: 0; pointer-events: none; animation: none !important; transform: scale(1.05); opacity: 0.95; background: var(--card); border-radius: 14px; box-shadow: 0 12px 30px rgba(15, 25, 30, 0.28); }
.item.drag-ghost { border: 1.5px solid var(--pine); }
.drag-h { flex: none; touch-action: none; cursor: grab; padding: 8px 6px; margin: -8px 0 -8px -6px; color: var(--muted); font-size: 20px; line-height: 1; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.dragging, body.dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.arrbar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav) + var(--safe-b) + 10px); z-index: 8; max-width: 640px; margin: 0 auto; box-shadow: 0 6px 20px rgba(15, 25, 30, 0.18); }
body.arr-on #main { padding-bottom: calc(var(--nav) + var(--safe-b) + 100px); }
.lock.gate { z-index: 50; text-align: center; overflow-y: auto; }
.gate-box { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gate-box p { margin: 0; opacity: 0.95; line-height: 1.6; }
.gate-box .gate-note { font-size: 13px; opacity: 0.75; }
.gate-legal a { color: #fff; text-decoration: underline; }
.gate-btn { width: 100%; background: #fff; color: var(--pine); border-color: #fff; font-weight: 600; }
.gate-btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.gate-list { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.gate-link { color: #fff; opacity: 0.8; text-decoration: underline; font-size: 14px; padding: 6px; }
.gate-err { min-height: 1.4em; color: #ffd7d1; font-size: 14px; }
.gsi-btn { min-height: 44px; display: flex; justify-content: center; }
.gate-dev { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.gate-dev input { height: 44px; border-radius: 12px; border: 0; padding: 0 12px; color: var(--ink); background: #fff; }
.gate-btn.line-btn { width: 280px; max-width: 100%; height: 44px; border-radius: 22px; background: #06c755; border-color: #06c755; color: #fff; }
.gate-btn.line-btn b { font-weight: 800; margin-right: 6px; letter-spacing: 0.5px; }
.sub-terms { margin: 4px 0 12px; padding: 12px 14px; border: 1px solid var(--line, #dfe5e3); border-radius: 12px; background: rgba(14, 90, 76, 0.05); font-size: 14px; line-height: 1.6; }
.sub-terms ul { margin: 6px 0 0; padding-left: 20px; }
.sub-terms li { margin: 3px 0; }
.sub-terms .sub-en { margin: 8px 0 0; font-size: 12.5px; opacity: 0.75; }