
/* Layout: one mobile column (max 460px) centred on a tinted backdrop; sticky header, sticky action bar, bottom sheets */
:root{
  color-scheme:light;
  --bg:#EEF3EE; --surface:#FFFFFF; --surface-2:#F2F5F1; --ink:#16201A; --muted:#647268; --line:#E1E8E1;
  --accent:#17A957; --accent-ink:#FFFFFF; --accent-soft:#E2F5E9; --accent-line:#9ADBB4;
  --sale:#E1453A; --sale-soft:#FDECEA; --warn-bg:#FFF6D9; --warn-line:#EBCB6B; --stage:#F4F6F3; --shadow:rgba(22,32,26,.08);
  --f-display:"Mitr","Noto Sans Thai",system-ui,sans-serif;
  --f-body:"Noto Sans Thai",system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-letter:"Arial Rounded MT Bold","Arial Black",sans-serif;
  --gl:max(16px, env(safe-area-inset-left, 0px)); --gr:max(16px, env(safe-area-inset-right, 0px));
  --r-card:20px; --r-pill:999px;
}
/* the shop is always the bright theme (it used to follow the device dark mode) */
:root[data-theme="dark"]{
  --bg:#0C110E; --surface:#151C17; --surface-2:#1D261F; --ink:#E7EEE9; --muted:#93A298; --line:#29342C;
  --accent:#2CC86C; --accent-ink:#06210F; --accent-soft:#183524; --accent-line:#2E6A45;
  --sale:#FF6A5E; --sale-soft:#3A1D1B; --warn-bg:#2C2613; --warn-line:#6E5C23; --stage:#1B231D; --shadow:rgba(0,0,0,.4); color-scheme:dark }

*{box-sizing:border-box}
html,body{margin:0}
[hidden]{display:none!important}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:15px;line-height:1.55}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:30;background:var(--surface)}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none;padding:0}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:8px}
h1,h2,h3{font-family:var(--f-display);font-weight:500;margin:0;text-wrap:balance;line-height:1.3}

.app{max-width:460px;margin:0 auto;background:var(--surface);min-height:100vh;padding-left:var(--gl);padding-right:var(--gr);padding-bottom:120px;position:relative}
.proto{font-size:12px;color:var(--muted);text-align:center;padding-block:6px;background:var(--surface-2);margin-inline:calc(-1*var(--gl)) calc(-1*var(--gr));letter-spacing:.02em}

/* header */
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:20;background:var(--surface);display:flex;align-items:center;gap:8px;padding-block:10px;margin-inline:calc(-1*var(--gl)) calc(-1*var(--gr));padding-left:var(--gl);padding-right:var(--gr);border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:8px;margin-right:auto;font-family:var(--f-display);font-weight:600;font-size:17px;white-space:nowrap}
.brand svg{width:34px;height:34px;flex:none}
.link{font-size:12.5px;color:var(--muted);padding:6px 2px;white-space:nowrap}
@media (max-width:380px){.brand span{display:none}}
.ro .mini svg{width:22px;height:22px}
.ro img{width:60px;height:60px;display:block}
.lang{display:flex;background:var(--surface-2);border-radius:var(--r-pill);padding:3px}
.lang button{font-size:12px;font-weight:700;padding:4px 9px;border-radius:var(--r-pill);color:var(--muted)}
.lang button[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink)}
.cartbtn{position:relative;width:38px;height:38px;display:grid;place-items:center;border-radius:12px}
.cartbtn svg{width:24px;height:24px}
.badge{position:absolute;top:2px;right:0;min-width:18px;height:18px;border-radius:9px;background:var(--sale);color:#fff;font-size:11px;font-weight:700;display:grid;place-items:center;padding:0 4px}

/* tabs */
.tabs{display:flex;gap:6px;overflow-x:auto;padding-block:12px;scrollbar-width:none;margin-inline:calc(-1*var(--gl)) calc(-1*var(--gr));padding-left:var(--gl);padding-right:var(--gr)}
.tabs::-webkit-scrollbar{display:none}
.tab{flex:none;font-size:13.5px;padding:8px 14px;border-radius:var(--r-pill);background:var(--surface-2);color:var(--muted);font-weight:500;position:relative}
.tab[aria-selected="true"]{background:var(--accent);color:var(--accent-ink)}
.tab .new{position:absolute;top:3px;right:5px;width:7px;height:7px;border-radius:50%;background:var(--sale)}

/* preview */
.preview{background:var(--stage);border-radius:24px;padding:14px 12px 12px;display:flex;flex-direction:column;align-items:center;gap:10px;position:relative;overflow:hidden}
.preview .cap{align-self:flex-start;font-size:12px;color:var(--muted)}
.sample{position:absolute;top:12px;right:12px;font-size:11px;font-weight:700;background:var(--warn-bg);border:1px solid var(--warn-line);padding:2px 8px;border-radius:var(--r-pill)}
.stage{width:100%;height:250px;display:grid;place-items:center;touch-action:none;user-select:none;-webkit-user-select:none}
.stage svg{width:100%;height:100%;max-height:230px}
.hint{font-size:12px;color:var(--muted);background:var(--surface);border:1px solid var(--line);padding:3px 12px;border-radius:var(--r-pill)}
.seg{display:flex;background:var(--surface-2);border-radius:14px;padding:4px;gap:4px}
.seg.on-stage{background:var(--surface)}
.seg button{flex:1;padding:9px 10px;border-radius:11px;font-size:14px;color:var(--muted);font-weight:500;line-height:1.25;white-space:nowrap}
.seg button small{display:block;font-size:11px;font-weight:400}
.seg button[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink)}
.seg.on-stage button{padding:6px 14px;font-size:13px}
.seg.on-stage button[aria-pressed="true"]{background:var(--surface-2);color:var(--ink);box-shadow:0 0 0 1px var(--line)}

/* 3D name */
.s3{perspective:900px;width:100%;height:100%;display:grid;place-items:center;cursor:grab}
.s3:active{cursor:grabbing}
.obj{position:relative;transform-style:preserve-3d;width:300px;height:220px}
.ly{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;font-family:var(--f-letter);line-height:.86;letter-spacing:-.02em;white-space:pre;pointer-events:none;stroke-linejoin:round}
.ring{position:absolute;left:50%;width:26px;height:26px;margin-left:-13px;border-radius:50%;border:6px solid;pointer-events:none}
.lyi{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;-webkit-user-drag:none}
.lyi.asm{transition:transform .9s cubic-bezier(.2,.8,.2,1)}
.mring{position:absolute;width:34px;height:34px;border-radius:50%;border:5px solid #AEB5BB;box-shadow:inset 0 0 0 1px #E3E7EA,0 1px 2px rgba(0,0,0,.25);pointer-events:none}
.posterimg{max-width:100%;max-height:100%;display:block;margin:auto}
.stage canvas{max-width:100%;max-height:230px;display:block}
.th img{max-width:100%;max-height:100%;display:block}
.cthumb img{max-width:52px;max-height:52px}
.stylopts{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:6px}
.so{border:1.5px solid var(--line);border-radius:14px;padding:8px 4px;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11.5px}
.so span{font-size:24px;line-height:1.1;color:var(--sale)}
.so[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.disc{position:absolute;left:50%;top:50%;width:210px;height:210px;margin:-105px 0 0 -105px;border-radius:50%;pointer-events:none}

/* proof + title */
.proof{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:13px;color:var(--muted);margin-top:14px;align-items:center}
.live{display:inline-flex;align-items:center;gap:6px}
.live i{width:8px;height:8px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.live b{color:var(--ink)}
.ptitle{font-size:23px;margin-top:6px}
.pdesc{color:var(--muted);margin:6px 0 0;font-size:14.5px}
.promo{display:flex;align-items:center;gap:8px;margin-top:12px;background:var(--sale-soft);border-radius:12px;padding:8px 10px;font-size:13px}
.pill{font-size:11.5px;font-weight:700;padding:2px 8px;border-radius:var(--r-pill);background:var(--sale);color:#fff;white-space:nowrap}
.timer{margin-left:auto;font-variant-numeric:tabular-nums;color:var(--sale);font-weight:700;white-space:nowrap}
.shipdate{font-size:13px;color:var(--accent);font-weight:500;margin-top:8px}

/* steps */
.steps{display:flex;align-items:flex-start;justify-content:space-between;margin:18px 6px 4px}
.st{display:flex;flex-direction:column;align-items:center;gap:4px;width:76px;text-align:center}
.st .ic{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;background:var(--surface);border:2px solid var(--line);font-family:var(--f-letter);font-size:20px;color:var(--sale)}
.st .ic svg{width:24px;height:24px}
.st.on .ic{border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-soft)}
.st.done .ic{border-color:var(--sale)}
.st small{font-size:10.5px;color:var(--muted);line-height:1}
.st span{font-size:12px;font-weight:500;line-height:1.2}
.dash{flex:1;border-top:2px dashed var(--line);margin-top:24px}

/* cards */
.card{border:1px solid var(--line);border-radius:var(--r-card);padding:14px;margin-top:12px;background:var(--surface)}
.chead{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:10px}
.chead h3{font-size:15.5px}
.chead .note{font-size:12px;color:var(--muted);text-align:right}
.field{display:flex;gap:8px}
.txt{width:100%;min-width:0;border:2px solid var(--line);border-radius:14px;padding:11px 14px;background:var(--surface);font-size:16px}
.txt:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-soft)}
.txt.big{font-family:var(--f-letter);letter-spacing:.12em;font-size:20px;text-transform:uppercase}
.txt.err{border-color:var(--sale)}
.rule{font-size:12.5px;color:var(--muted);margin-top:8px}
.errtxt{font-size:12.5px;color:var(--sale);margin-top:6px}
.btn{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;padding:13px 16px;border-radius:14px;background:var(--accent);color:var(--accent-ink);font-family:var(--f-display);font-size:16px;font-weight:500}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.ghost{background:var(--surface);color:var(--ink);border:1.5px solid var(--line)}
.btn.soft{background:var(--accent-soft);color:var(--accent)}
.btn.outline{background:var(--surface);color:var(--accent);border:1.5px solid var(--accent)}
.row{display:flex;gap:8px}
.mt{margin-top:10px}

.pals{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.pal{border:1.5px solid var(--line);border-radius:14px;padding:9px 8px;display:flex;flex-direction:column;gap:6px;align-items:flex-start;font-size:12.5px}
.pal[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.dots{display:flex;gap:3px;flex-wrap:wrap}
.dots i{width:13px;height:13px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12)}
.sws{display:flex;flex-wrap:wrap;gap:10px}
.sw{width:36px;height:36px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15);position:relative}
.sw[aria-pressed="true"]{box-shadow:0 0 0 3px var(--surface),0 0 0 5px var(--accent)}
.colgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.colopt{border:1.5px solid var(--line);border-radius:14px;padding:8px 6px;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:11.5px;text-align:center;line-height:1.25}
.colopt i{width:28px;height:28px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}
.colopt[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.colopt b{font-weight:700;font-size:11px;color:var(--muted)}

.toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-block:4px}
.toggle p{margin:0;font-size:12.5px;color:var(--muted)}
.sw-tg{width:50px;height:30px;border-radius:15px;background:var(--line);position:relative;flex:none;transition:background .2s}
.sw-tg::after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .2s}
.sw-tg[aria-checked="true"]{background:var(--accent)}
.sw-tg[aria-checked="true"]::after{transform:translateX(20px)}

table.price{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:14px}
table.price td{padding:7px 8px;border-bottom:1px solid var(--line)}
table.price td:nth-child(2){text-align:right}
table.price td:nth-child(3){text-align:right}
table.price s{color:var(--muted);font-size:12.5px;margin-right:6px}
table.price b{color:var(--sale)}
table.price tr.cur td{background:var(--accent-soft);font-weight:700}
.kv{display:flex;justify-content:space-between;gap:10px;font-size:14px;padding-block:4px;font-variant-numeric:tabular-nums}
.kv span:first-child{color:var(--muted)}
.kv.total{font-size:17px;font-weight:700;border-top:1px solid var(--line);margin-top:6px;padding-top:10px}
.kv.total span:first-child{color:var(--ink)}

/* design progress */
.prog{display:flex;align-items:flex-start;justify-content:space-between;margin:14px 4px 6px}
.pg{display:flex;flex-direction:column;align-items:center;gap:6px;font-size:12px;color:var(--muted);width:80px;text-align:center}
.pg i{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;border:2px solid var(--line);background:var(--surface);font-style:normal}
.pg i svg{width:16px;height:16px}
.pg.done i{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.pg.now i{border-color:var(--accent);color:var(--accent)}
.pg.now{color:var(--ink);font-weight:500}
.pline{flex:1;height:2px;background:var(--line);margin-top:15px;position:relative;overflow:hidden}
.pline.done{background:var(--accent)}
.spin{animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.tip{font-size:12.5px;color:var(--muted);background:var(--surface-2);border-radius:12px;padding:9px 12px;margin-top:8px}

.hist{display:flex;gap:10px;overflow-x:auto;padding-bottom:4px}
.th{flex:none;width:76px;height:76px;border-radius:16px;border:2px solid var(--line);display:grid;place-items:center;background:var(--stage);overflow:hidden;padding:4px}
.th[aria-pressed="true"]{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.th span{font-family:var(--f-letter);line-height:.85;text-align:center;white-space:pre;color:#fff;paint-order:stroke;-webkit-text-stroke:5px currentColor}

.confirm{display:flex;gap:10px;align-items:flex-start;background:var(--warn-bg);border:1px solid var(--warn-line);border-radius:14px;padding:10px 12px;font-size:13.5px;cursor:pointer;margin-top:10px}
.confirm input{width:22px;height:22px;accent-color:var(--accent);margin:1px 0 0;flex:none}
.confirm small{display:block;color:var(--muted);font-size:12px}
.sumcard{border:2px solid var(--accent-line)}
.sumprice{font-family:var(--f-display);font-size:24px;font-weight:600;font-variant-numeric:tabular-nums}

/* action bar */
.bar{position:fixed;left:0;right:0;bottom:0;z-index:25;pointer-events:none}
.bar-in{pointer-events:auto;max-width:460px;margin:0 auto;background:var(--surface);border-top:1px solid var(--line);display:flex;align-items:center;gap:8px;padding:10px var(--gr) calc(10px + env(safe-area-inset-bottom,0px)) var(--gl);box-shadow:0 -6px 20px var(--shadow)}
.bar .amt{display:flex;flex-direction:column;line-height:1.15;min-width:84px}
.bar .amt small{font-size:11.5px;color:var(--muted)}
.bar .amt b{font-family:var(--f-display);font-size:20px;font-weight:600;font-variant-numeric:tabular-nums}
.bar .amt s{font-size:12px;color:var(--muted)}
.bar .btn{flex:1}
.bar .mini{flex:none;width:auto;padding:13px 12px;font-size:14px}

/* toast */
.toast{position:fixed;left:50%;bottom:calc(96px + env(safe-area-inset-bottom,0px));transform:translate(-50%,20px);width:min(420px,calc(100% - 32px));background:var(--surface);border:1px solid var(--line);box-shadow:0 10px 30px var(--shadow);border-radius:16px;padding:10px 12px;display:flex;gap:10px;align-items:center;font-size:13px;opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;z-index:40}
.toast.show{opacity:1;transform:translate(-50%,0);pointer-events:auto}
.toast .tic{width:34px;height:34px;border-radius:10px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center;flex:none}
.toast .tic svg{width:18px;height:18px}
.toast small{display:block;color:var(--muted);font-size:11.5px}
.toast .x{margin-left:auto;color:var(--muted);font-size:18px;padding:2px 6px}

/* sheet */
.scrim{position:fixed;inset:0;background:rgba(8,14,10,.45);z-index:50}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:51;max-width:460px;margin:0 auto;background:var(--surface);border-radius:24px 24px 0 0;max-height:88vh;overflow:auto;padding:10px var(--gr) calc(16px + env(safe-area-inset-bottom,0px)) var(--gl);animation:up .25s ease-out}
.sheet.full{top:0;max-height:none;border-radius:0;padding-top:calc(10px + env(safe-area-inset-top,0px));display:flex;flex-direction:column}
@keyframes up{from{transform:translateY(40px);opacity:.4}}
.grab{width:42px;height:5px;border-radius:3px;background:var(--line);margin:0 auto 12px}
.shead{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.shead h2{font-size:18px}
.close{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-size:20px;color:var(--muted);background:var(--surface-2)}
.tiles{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-block:6px 14px}
.tile{width:36px;height:42px;border-radius:9px;border:1.5px solid var(--line);display:grid;place-items:center;font-family:var(--f-letter);font-size:20px;box-shadow:0 2px 0 var(--line)}
.rowopts{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.ro{border:1.5px solid var(--line);border-radius:14px;padding:8px 4px;display:flex;flex-direction:column;align-items:center;gap:4px;font-size:11.5px}
.ro .mini{height:60px;display:grid;place-items:center;font-family:var(--f-letter);color:var(--sale);line-height:.85;text-align:center;white-space:pre}
.ro[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.center{text-align:center}
.fine{font-size:12.5px;color:var(--muted)}

.citem{display:flex;gap:12px;padding-block:12px;border-bottom:1px solid var(--line)}
.cthumb{width:58px;height:58px;border-radius:14px;background:var(--stage);flex:none;display:grid;place-items:center;overflow:hidden}
.cthumb svg{width:52px;height:52px}
.cinfo{flex:1;min-width:0}
.cinfo b{font-family:var(--f-letter);font-weight:400;letter-spacing:.04em;font-size:15px;word-break:break-all}
.cinfo p{margin:2px 0 6px;font-size:12.5px;color:var(--muted)}
.cside{display:flex;flex-direction:column;align-items:flex-end;gap:6px;font-variant-numeric:tabular-nums}
.qty{display:flex;align-items:center;border:1.5px solid var(--line);border-radius:10px}
.qty button{width:30px;height:30px;font-size:16px}
.qty span{min-width:22px;text-align:center;font-weight:700}
.rm{font-size:12.5px;color:var(--sale)}
.empty{text-align:center;padding:40px 10px;color:var(--muted)}

/* checkout */
.cohead{display:flex;align-items:center;gap:10px;padding-block:12px}
.back{width:36px;height:36px;border-radius:12px;display:grid;place-items:center;background:var(--surface-2);font-size:18px}
label.lb{display:block;font-size:13.5px;font-weight:500;margin:12px 0 6px}
label.lb em{color:var(--sale);font-style:normal}
label.lb span{color:var(--muted);font-weight:400}
.sel{appearance:none;-webkit-appearance:none;background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23889' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;padding-right:36px}
.sel:disabled{opacity:.55}
.pay{border:1.5px solid var(--line);border-radius:16px;padding:12px;display:flex;gap:10px;align-items:flex-start;cursor:pointer;margin-top:8px}
.pay input{accent-color:var(--accent);width:20px;height:20px;margin:2px 0 0;flex:none}
.pay b{display:block;font-weight:500}
.pay small{color:var(--muted);font-size:12.5px;display:block}
.pay:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}
.upsell{background:var(--warn-bg);border:1px solid var(--warn-line);border-radius:16px;padding:12px;font-size:13.5px;margin-top:12px}
.upsell .row{margin-top:8px}
.upsell .btn{padding:9px;font-size:14px}
.saved{display:flex;gap:10px;align-items:center;background:var(--accent-soft);border-radius:14px;padding:10px 12px;font-size:13.5px;margin-top:12px}
.saved button{margin-left:auto;color:var(--accent);font-weight:700;white-space:nowrap}
.ok-hero{text-align:center;padding:36px 10px 10px}
.ok-hero .big{width:72px;height:72px;border-radius:50%;background:var(--accent);color:var(--accent-ink);display:grid;place-items:center;margin:0 auto 14px}
.ok-hero .big svg{width:36px;height:36px}
.ono{font-family:var(--f-display);font-size:22px;letter-spacing:.05em;font-variant-numeric:tabular-nums}
.tl{list-style:none;margin:0;padding:0}
.tl li{display:flex;gap:12px;padding-block:8px;position:relative}
.tl li::before{content:"";width:14px;height:14px;border-radius:50%;border:3px solid var(--line);background:var(--surface);flex:none;margin-top:4px}
.tl li.on::before{border-color:var(--accent);background:var(--accent)}
.tl li small{display:block;color:var(--muted);font-size:12.5px}
.foot{font-size:12px;color:var(--muted);text-align:center;margin-top:28px}

@media (prefers-reduced-motion: reduce){*{animation:none!important;transition:none!important}}

/* ---- production additions ---- */
.disc{background:radial-gradient(circle at 40% 35%,#E9ECEF,#BFC5CB);box-shadow:0 0 0 6px #D5DADF}
.page{padding-block:8px 24px}
.notice{background:var(--warn-bg);border:1px solid var(--warn-line);border-radius:14px;padding:10px 12px;font-size:13.5px;margin-top:12px}
.err-box{background:var(--sale-soft);color:var(--sale);border-radius:12px;padding:10px 12px;font-size:13.5px;margin-top:10px}
.qrbox{display:grid;place-items:center;background:#fff;border-radius:18px;padding:16px;margin:10px auto;width:min(280px,100%)}
.qrbox svg,.qrbox img{width:100%;height:auto;display:block}
.pp-head{display:flex;align-items:center;justify-content:center;gap:8px;background:#0E3B67;color:#fff;border-radius:12px 12px 0 0;padding:8px;font-weight:700;letter-spacing:.04em;width:min(280px,100%);margin:0 auto -10px}
.upl{display:flex;flex-direction:column;align-items:center;gap:8px;border:2px dashed var(--line);border-radius:16px;padding:18px;text-align:center;cursor:pointer}
.upl img{max-height:220px;border-radius:10px}
.badge-st{display:inline-block;font-size:12px;font-weight:700;padding:3px 10px;border-radius:999px;background:var(--surface-2)}
.st-awaiting_payment{background:var(--warn-bg);color:#8a6a00}
.st-slip_submitted{background:#E6F0FF;color:#1F5FC4}
.st-paid{background:var(--accent-soft);color:var(--accent)}
.st-producing{background:#F2E9FF;color:#7442C8}
.st-shipped{background:#E7F7F1;color:#177A55}
.st-cancelled{background:var(--sale-soft);color:var(--sale)}

.mockimg{width:100%;border-radius:16px;display:block;background:var(--stage)}
.mockwait{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;padding:28px 12px;background:var(--stage);border-radius:16px}
.gl3d{position:absolute;inset:0;width:100%!important;height:100%!important;max-height:none!important;display:block;touch-action:none;cursor:grab}
.gl3d:active{cursor:grabbing}
.zoom3d{position:absolute;top:10px;right:10px;z-index:3;display:flex;flex-direction:column;gap:6px}
.zoom3d button{width:36px;height:36px;border-radius:50%;border:1px solid rgba(0,0,0,.12);background:rgba(255,255,255,.92);color:#1c1c1e;font:600 20px/1 system-ui,sans-serif;display:grid;place-items:center;cursor:pointer;box-shadow:0 2px 6px rgba(0,0,0,.15);padding:0}
.zoom3d button[data-z=reset]{font-size:11px}
.zoom3d button:disabled{opacity:.35;cursor:default}
.zoom3d button[hidden]{display:none}
.bubble2d{max-width:100%;max-height:100%;display:block;margin:auto}
.stage{position:relative}
.aiwait{position:absolute;left:50%;bottom:4px;transform:translateX(-50%);display:flex;align-items:baseline;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:4px 14px;font-size:12.5px;white-space:nowrap;box-shadow:0 4px 14px var(--shadow)}
.aiwait b{font-family:var(--f-display);font-size:16px;color:var(--accent);font-variant-numeric:tabular-nums}
.aiwait span{color:var(--muted);font-variant-numeric:tabular-nums}
.tiles{flex-direction:column;align-items:center}
.tilerow{display:flex;gap:6px;justify-content:center}
.rowopts{grid-template-columns:repeat(auto-fit,minmax(0,96px));justify-content:center}
.rocircle{width:58px;height:58px;border-radius:50%;background:#fff;box-shadow:0 0 0 1px var(--line);display:grid;place-items:center;overflow:hidden}
.ro .rocircle img{width:50px;height:auto;max-height:50px;object-fit:contain}
.wand{color:var(--sale);display:grid}
.wand svg{width:28px;height:28px}

.seg.sub{width:max-content;max-width:100%;margin:10px auto 0;background:var(--surface-2)}
.seg.sub button{padding:7px 16px;font-size:13.5px}
.seg.sub button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px var(--shadow),0 0 0 1px var(--line)}
#steps2{margin:16px 6px 4px}
/* desktop: big 3D stage on the left, options on the right (like the reference) */
@media (min-width: 1000px){
  .app{max-width:1320px;padding-bottom:40px}
  .lay{display:grid;grid-template-columns:minmax(0,1fr) 440px;gap:32px;align-items:start}
  .lcol{position:sticky;top:76px}
  .preview{height:calc(100vh - 100px);min-height:560px;margin-top:16px!important;border-radius:28px;background:linear-gradient(180deg,#f4f6f7,#e9edf0)}
  .stage{flex:1;height:auto;min-height:0}
  .rcol{padding-top:16px}
  .ptitle{font-size:28px}
  body:not(.co) .bar{display:none}
  .app{padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px))}
}
/* ready-made colour sets */
.setgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(74px,1fr));gap:8px;margin-top:10px;max-height:340px;overflow-y:auto;padding:2px}
.setopt{border:1.5px solid var(--line);border-radius:14px;padding:8px 4px;display:flex;flex-direction:column;align-items:center;gap:5px;font-size:11.5px;line-height:1.2;text-align:center}
.setopt i{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font-style:normal;font:800 21px/1 var(--f-letter,'Mitr',sans-serif);box-shadow:inset 0 0 0 1px rgba(0,0,0,.14)}
.setopt[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
/* previews can't be long-pressed or dragged out */
#stage img,#stage canvas,.hist img,.cthumb img,.rowopts img{-webkit-touch-callout:none;-webkit-user-drag:none;user-select:none}

/* rope colour swatches under "ใส่เชือก" */
.ropes{display:grid;grid-template-columns:repeat(5,1fr);gap:6px 4px}
.rsw{display:flex;flex-direction:column;align-items:center;gap:4px;font-size:11px;color:var(--muted);padding:4px 0;border-radius:12px}
.rsw i{width:30px;height:30px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.18);display:block}
.rsw[aria-pressed="true"] i{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--accent)}
.rsw[aria-pressed="true"]{color:var(--ink);font-weight:600}


/* current design card + full-size popup */
.restored{margin:0 0 10px;padding:10px 14px;border:1px solid var(--line);border-radius:14px;background:var(--surface);font-size:13px;color:var(--muted)}
.curdes{display:grid;grid-template-columns:76px 1fr;gap:6px 14px;align-items:center}
.curthumb{position:relative;width:76px;height:76px;border-radius:14px;border:1.5px solid var(--line);background:#fff;overflow:hidden;padding:3px;display:grid;place-items:center;cursor:zoom-in}
.curthumb img{max-width:100%;max-height:100%;display:block}
.curthumb .mag{position:absolute;right:3px;bottom:3px;width:22px;height:22px;border-radius:50%;background:rgba(255,255,255,.95);color:#1c1c1e;display:grid;place-items:center;box-shadow:0 1px 4px rgba(0,0,0,.2)}
.curthumb .mag svg{width:14px;height:14px}
.curinfo{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0}
.curinfo .chk{font-size:12px;color:var(--muted);background:var(--surface-2);border-radius:999px;padding:3px 10px 3px 8px}
.curinfo .chk::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--muted);margin-right:6px;vertical-align:1px}
.curinfo b{font-size:20px;letter-spacing:.08em;word-break:break-all}
.curnote{grid-column:1/-1;margin:4px 0 0}
.zoombox{border:1px solid var(--line);border-radius:14px;background:#fff;padding:8px;display:grid;place-items:center}
.zoombox img{width:100%;max-width:440px;height:auto;display:block;-webkit-touch-callout:none;user-select:none;-webkit-user-drag:none}

/* PromptPay QR as an image */
.qrbox .qrimg{width:min(260px,72vw);height:auto;display:block;margin:0 auto;image-rendering:pixelated;border-radius:6px}

.st-cod{background:#FFF1DC;color:#A85A00}

/* ---------- bright & colourful theme ---------- */
:root:not([data-theme="dark"]){
  --bg:#F4F1FF; --surface:#FFFFFF; --surface-2:#F3F4FB; --ink:#1B1B33; --muted:#6B6E8A; --line:#E6E4F2;
  --accent:#12B76A; --accent-ink:#FFFFFF; --accent-soft:#DCF8EA; --accent-line:#8EE2B9;
  --pop-pink:#FF4FA3; --pop-purple:#8A5CFF; --pop-blue:#2FA8FF; --pop-yellow:#FFC233; --pop-orange:#FF8A3D;
  --stage:#F6F4FF; --shadow:rgba(76,56,160,.10);
  --grad-btn:linear-gradient(135deg,#17C77A 0%,#10B5A8 55%,#2FA8FF 100%);
  --grad-fun:linear-gradient(90deg,#FF4FA3,#FF8A3D,#FFC233,#17C77A,#2FA8FF,#8A5CFF);
}
:root:not([data-theme="dark"]) body{background:radial-gradient(1200px 600px at 10% -10%,#FFE3F1 0%,transparent 60%),radial-gradient(1000px 600px at 100% 0%,#DDF1FF 0%,transparent 55%),radial-gradient(900px 700px at 50% 110%,#E6FFF1 0%,transparent 60%),#F7F5FF;background-attachment:fixed}
:root:not([data-theme="dark"]) .app{background:rgba(255,255,255,.86);box-shadow:0 0 0 1px rgba(138,92,255,.06),0 20px 60px var(--shadow)}
:root:not([data-theme="dark"]) .top{background:rgba(255,255,255,.92);backdrop-filter:saturate(1.4) blur(8px);border-bottom:0;box-shadow:0 1px 0 var(--line)}
:root:not([data-theme="dark"]) .top::after{content:"";position:absolute;left:0;right:0;bottom:-3px;height:3px;background:var(--grad-fun);opacity:.9}
:root:not([data-theme="dark"]) .preview{background:linear-gradient(160deg,#FFF0F8 0%,#F1EDFF 45%,#E6F6FF 100%)}
:root:not([data-theme="dark"]) .ptitle{background:linear-gradient(90deg,#8A5CFF,#FF4FA3 60%,#FF8A3D);-webkit-background-clip:text;background-clip:text;color:transparent}
:root:not([data-theme="dark"]) .card{border-color:transparent;box-shadow:0 1px 0 var(--line),0 8px 24px var(--shadow)}
:root:not([data-theme="dark"]) .btn:not(.ghost):not(.soft):not(.outline){background:var(--grad-btn);box-shadow:0 6px 18px rgba(18,183,106,.28)}
:root:not([data-theme="dark"]) .btn:not(.ghost):not(.soft):not(.outline):disabled{background:#C9CBDA;box-shadow:none}
:root:not([data-theme="dark"]) .seg button[aria-pressed="true"]{background:var(--grad-btn);color:#fff;box-shadow:0 4px 12px rgba(18,183,106,.25)}
:root:not([data-theme="dark"]) .seg.on-stage button[aria-pressed="true"]{background:#fff;color:var(--ink);box-shadow:0 2px 8px var(--shadow)}
:root:not([data-theme="dark"]) .setopt[aria-pressed="true"],:root:not([data-theme="dark"]) .colopt[aria-pressed="true"]{border-color:var(--pop-purple);background:#F3EEFF}
:root:not([data-theme="dark"]) .rsw[aria-pressed="true"] i{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--pop-purple)}
:root:not([data-theme="dark"]) .th[aria-pressed="true"]{border-color:var(--pop-purple);box-shadow:0 0 0 3px #EDE5FF}
:root:not([data-theme="dark"]) .pill{background:var(--pop-orange)}
:root:not([data-theme="dark"]) .bar{background:rgba(255,255,255,.94);backdrop-filter:blur(8px)}
/* shop logo in the header */
.brand .logo{width:52px;height:52px;flex:none;display:block;object-fit:contain;margin:-6px 0;filter:drop-shadow(0 2px 4px rgba(76,56,160,.18))}
@media (min-width:1000px){.brand .logo{width:60px;height:60px;margin:-8px 0}}
/* live counter (real orders, last 24 h) */
.live{display:inline-flex;align-items:center;gap:7px;margin:4px 0 2px;font-size:12.5px;color:var(--muted)}
.live b{color:var(--ink);font-weight:700}
.live i{width:8px;height:8px;border-radius:50%;background:#17C77A;box-shadow:0 0 0 0 rgba(23,199,122,.55);animation:livepulse 1.8s ease-out infinite}
@keyframes livepulse{0%{box-shadow:0 0 0 0 rgba(23,199,122,.55)}70%{box-shadow:0 0 0 7px rgba(23,199,122,0)}100%{box-shadow:0 0 0 0 rgba(23,199,122,0)}}
@media (prefers-reduced-motion:reduce){.live i{animation:none}}
/* step icons: colourful gradient tiles with white glyphs */
.steps .st{width:84px}
.steps .st .ic{position:relative;width:54px;height:54px;border-radius:18px;border:0;color:#fff;box-shadow:0 6px 16px rgba(76,56,160,.18);transition:transform .2s, box-shadow .2s, filter .2s}
.steps .st .ic svg{width:26px;height:26px}
.steps .st .ic.g1{background:linear-gradient(140deg,#FF7AB8,#FF4F8E)}
.steps .st .ic.g2{background:linear-gradient(140deg,#9C7BFF,#4F8BFF)}
.steps .st .ic.g3{background:linear-gradient(140deg,#FFC94A,#FF8A3D)}
.steps .st .ic .letter{font-style:normal;font-family:var(--f-letter);font-size:24px;line-height:1;text-shadow:0 1px 2px rgba(0,0,0,.15)}
.steps .st.next .ic{filter:saturate(.35) brightness(1.08);opacity:.6;box-shadow:none}
.steps .st.on .ic{transform:translateY(-2px) scale(1.06);box-shadow:0 0 0 4px #fff,0 0 0 6px rgba(138,92,255,.35),0 10px 22px rgba(76,56,160,.25)}
.steps .st .ok{position:absolute;right:-6px;top:-6px;width:20px;height:20px;border-radius:50%;background:#17C77A;color:#fff;display:grid;place-items:center;box-shadow:0 0 0 2px #fff}
.steps .st .ok svg{width:12px;height:12px}
.steps .st small{margin-top:4px;font-size:10.5px;letter-spacing:.02em}
.steps .st span{font-weight:600}
.steps .st.next span{color:var(--muted)}
.steps .dash{margin-top:27px;border-top:3px dotted #DCD7F0}
.steps .dash.lit{border-top-style:solid;border-top-width:3px;border-image:linear-gradient(90deg,#FF7AB8,#9C7BFF,#FFC94A) 1}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* product tabs (header) */
.tabs{display:flex;gap:4px;background:var(--surface-2);border-radius:999px;padding:4px;overflow-x:auto;scrollbar-width:none;order:5;flex:1 0 100%;margin-top:2px}
.tabs::-webkit-scrollbar{display:none}
.tabs a{flex:1 0 auto;text-align:center;padding:8px 14px;border-radius:999px;font-size:13px;font-weight:500;color:var(--muted);white-space:nowrap;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.tabs a[aria-current="page"]{background:var(--accent);color:var(--accent-ink);box-shadow:0 3px 10px rgba(138,92,255,.25)}
.tabs .new{font-size:10px;font-weight:700;background:#FF4F8E;color:#fff;border-radius:999px;padding:1px 6px;line-height:1.5}
.top{flex-wrap:wrap}
@media (min-width:1000px){.top{flex-wrap:nowrap}.brand{margin-right:12px}.tabs{order:0;flex:0 1 auto;margin:0 auto 0 0}}
/* pencil page */
.pstage{width:100%;height:300px;display:grid;place-items:center;touch-action:none;cursor:grab}
.pstage canvas{display:block}
@media (min-width:1000px){.pstage{height:520px}}
.pemo{display:flex;flex-wrap:wrap;gap:6px}
.pemo button{border:1.5px solid var(--line);border-radius:10px;min-width:36px;height:36px;padding:0 6px;font-size:17px;line-height:1}
.pset .dots{display:flex}
.pset .dots i{width:16px;height:16px;border-radius:50%;margin-left:-4px;box-shadow:0 0 0 1.5px var(--surface),inset 0 0 0 1px rgba(0,0,0,.14)}
.pset .dots i:first-child{margin-left:0}
.pkeys{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.pkeys button{width:40px;height:40px;border-radius:11px;border:3px solid;font:700 18px/1 var(--f-letter,'Mitr',sans-serif);box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}
.pkeys button[aria-pressed="true"]{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--accent)}
.ropegrid{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-top:12px}
.ptable{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.ptable div{position:relative;border:1px solid var(--line);border-radius:12px;padding:8px 3px 6px;text-align:center;font-size:12px;line-height:1.3}
.ptable div b{display:block;font-weight:500;color:var(--muted);font-size:11px}
.ptable div span{font-weight:700}
.ptable div.cur{border-color:var(--accent);background:var(--accent-soft)}
.psum{display:flex;align-items:center;gap:12px;margin-top:14px}
.psum div{flex:none;line-height:1.2}.psum small{display:block;font-size:11.5px;color:var(--muted)}.psum b{font-size:20px;font-family:var(--f-display)}
.ptable div em{display:block;font-style:normal;font-size:10.5px;color:var(--muted);margin-top:1px}
.ptable div .save{position:absolute;top:-7px;right:-4px;font-style:normal;font-size:9.5px;font-weight:700;background:#17C77A;color:#fff;border-radius:999px;padding:0 5px;line-height:15px}
.psum .ok{color:#0f9a5c;font-weight:600}
.tgls{padding:4px 14px}
.tgl{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:12px 0;text-align:left}
.tgl+.tgl{border-top:1px solid var(--line)}
.tgl b{display:block;font-size:15px;font-weight:600}.tgl small{display:block;font-size:12px;color:var(--muted);margin-top:2px}
.tgl i{flex:none;width:46px;height:28px;border-radius:999px;background:#E3E1EC;position:relative;transition:background .2s}
.tgl i::after{content:"";position:absolute;left:3px;top:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .2s}
.tgl[aria-checked="true"] i{background:#22C55E}.tgl[aria-checked="true"] i::after{transform:translateX(18px)}
