:root{--black:#0b0b0c;--panel:#151516;--panel-soft:#1c1c1d;--line:#323233;--white:#f8f8f6;--muted:#a5a5a6;--yellow:#ffd12a;--yellow-hover:#ffe064;--font:'IBM Plex Sans Thai',sans-serif}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--black);color:var(--white);font-family:var(--font);font-size:14px}
button,input{font:inherit}
button{cursor:pointer}
button:focus-visible,input:focus-visible,a:focus-visible{outline:2px solid var(--yellow);outline-offset:3px}
button:disabled{cursor:not-allowed;opacity:.48}
[hidden]{display:none!important}
.shell{min-height:100vh;background:radial-gradient(circle at 79% 2%,#ffd12a0b,transparent 29%),var(--black)}
.topbar{height:72px;display:flex;align-items:center;justify-content:space-between;padding:0 clamp(22px,4vw,68px);border-bottom:1px solid #282829}
.logo{display:flex;align-items:center;gap:11px;color:var(--white);text-decoration:none;font:800 12px Manrope,sans-serif;letter-spacing:.09em}
.logo-mark{width:36px;height:36px;display:grid;place-items:center;border-radius:9px;background:var(--yellow);color:#111;font-size:23px;letter-spacing:-.12em}
.logo-mark span{color:#80630b}.logo-light{font-weight:500;color:#aaa;margin-left:3px}
.topbar-right{display:flex;align-items:center;gap:18px}.local-pill{font-size:11px;color:#aaa}.local-pill i{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--yellow);box-shadow:0 0 10px #ffd12a88;margin-right:5px}
.avatar{height:32px;width:32px;display:grid;place-items:center;border-radius:50%;background:#f5f5f2;color:#141414;font:800 12px Manrope,sans-serif}
.main{max-width:1480px;margin:auto;padding:42px clamp(22px,4vw,68px) 65px}
.intro{display:flex;justify-content:space-between;align-items:center;margin-bottom:30px}.eyebrow{display:flex;align-items:center;gap:9px;color:var(--yellow);font:800 10px Manrope,sans-serif;letter-spacing:.18em}.eyebrow span{width:20px;height:2px;background:var(--yellow)}
h1,h2,p{margin:0}h1{font-size:clamp(38px,3.8vw,56px);line-height:1.15;letter-spacing:-.06em;margin:11px 0 12px}h1 em{font-style:normal;color:var(--yellow)}.intro p{max-width:650px;color:#aaa;line-height:1.65;font-size:14px}.intro-symbol{font:500 130px Manrope,sans-serif;color:#ffd12a0d;line-height:.8;padding-right:20px}
.dashboard{display:grid;grid-template-columns:minmax(440px,1.12fr) minmax(400px,.88fr);gap:20px;align-items:start}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:16px;overflow:hidden;min-width:0;box-shadow:0 15px 40px #0003}
.panel-heading{height:69px;padding:0 21px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.panel-heading>div{display:flex;align-items:center;gap:12px}.section-number{color:var(--yellow);font:800 11px Manrope,sans-serif}h2{font-size:15px;letter-spacing:-.02em}
.count-chip,.live-chip{border-radius:30px;padding:5px 9px;background:#242424;border:1px solid #424242;color:#e4e4e3;font-size:10px}.live-chip.active{background:#332a0e;border-color:#b68e20;color:var(--yellow)}
.panel-subtitle{color:var(--muted);font-size:11px;margin:19px 21px 15px}.product-controls{display:flex;gap:10px;margin:0 21px 17px}
.add-button{height:40px;padding:0 15px;flex:none;border:0;border-radius:8px;background:var(--yellow);color:#151515;font-size:11px;font-weight:700}.add-button:hover,.url-field button:hover,.submit-button:hover{background:var(--yellow-hover)}.add-button span{font-size:16px;vertical-align:-1px;margin-right:4px}
.search{height:40px;min-width:0;flex:1;display:flex;align-items:center;gap:5px;padding:0 10px;border:1px solid #444;background:#202021;border-radius:8px;color:#ccc}.search span{font-size:25px;line-height:1}.search input{min-width:0;width:100%;border:0;outline:0;background:transparent;color:#fff;font-size:11px}.search input::placeholder{color:#858585}
.product-list{min-height:430px;max-height:646px;overflow:auto;padding:0 21px 21px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:12px;scrollbar-color:#666 transparent;scrollbar-width:thin}
.product-item{display:block;min-width:0;padding:10px;background:#1e1e1f;border:1px solid #393939;border-radius:11px;transition:border-color .2s,background .2s}.product-item:hover{border-color:#a98a27}.product-item.active{border-color:var(--yellow);background:#262317;box-shadow:inset 0 0 0 1px #ffd12a3d}
.product-item img{display:block;width:100%;height:165px;object-fit:contain;background:#101011;border-radius:7px;margin-bottom:10px}.product-info{min-width:0;display:flex;flex-direction:column;gap:2px;padding:0 3px 2px}.product-info strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.product-info b{font:800 16px Manrope,sans-serif;color:#fff}.product-info small{font-size:10px;color:#aaa}.product-buttons{display:flex;gap:7px;margin-top:8px}
.show-button,.delete-button{border-radius:6px;padding:8px 9px;font-size:10px;font-weight:700}.show-button{flex:1;border:1px solid var(--yellow);background:var(--yellow);color:#181818}.show-button:hover{background:var(--yellow-hover)}.product-item.active .show-button{background:#7b631c;border-color:#997d24;color:#fff}.delete-button{border:1px solid #4b4b4b;background:#2b2b2c;color:#d2d2d2;padding:8px 10px}.delete-button:hover{border-color:#c5c5c5;color:#fff}
.empty-products{grid-column:1/-1;text-align:center;border:1px dashed #484848;border-radius:11px;margin:2px 0;padding:78px 16px;color:#aaa}.empty-products span{display:block;font-size:42px;color:var(--yellow);margin-bottom:6px}.empty-products strong{display:block;color:#fff;font-size:14px;margin-bottom:4px}.empty-products p{font-size:11px}
.output-stage{position:relative;aspect-ratio:16/10;background:#242424;overflow:hidden;display:grid;place-items:center}.stage-grid{position:absolute;inset:0;background-image:linear-gradient(45deg,#303030 25%,transparent 25%),linear-gradient(-45deg,#303030 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#303030 75%),linear-gradient(-45deg,transparent 75%,#303030 75%);background-size:28px 28px;background-position:0 0,0 14px,14px -14px,-14px 0}.stage-label{position:absolute;top:15px;left:15px;z-index:3;padding:6px 9px;border:1px solid #7d6a2a;border-radius:6px;background:#1b180fd9;color:#ffe17b;font-size:10px}
.stage-empty{position:relative;z-index:1;text-align:center;display:flex;align-items:center;flex-direction:column}.stage-empty span{width:67px;height:67px;display:grid;place-items:center;border:1px solid #776422;background:#2d2817;border-radius:17px;color:var(--yellow);font-size:31px;margin-bottom:13px}.stage-empty strong{font-size:13px}.stage-empty small{font-size:10px;color:#aaa;margin-top:5px}
.stage-product{position:absolute;inset:0;z-index:2;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:transparent;border:0;padding:0}.stage-product img{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;background:transparent;border:0;filter:drop-shadow(0 18px 22px #0007)}
.output-actions{display:flex;align-items:center;justify-content:space-between;padding:14px 21px;border-bottom:1px solid var(--line)}.hide-button{border:1px solid #616161;border-radius:7px;background:#292929;color:#eee;font-size:11px;padding:8px 12px}.hide-button:hover{background:#353535}.preview-link{color:var(--yellow);text-decoration:none;font-size:11px}.preview-link:hover{text-decoration:underline}
.obs-area{padding:21px}.obs-heading{display:flex;align-items:center;gap:11px}.obs-symbol{width:41px;height:41px;display:grid;place-items:center;background:var(--yellow);color:#151515;border-radius:10px;font-size:25px}.obs-heading>div{display:flex;flex-direction:column;gap:2px}.obs-heading strong{font-size:12px}.obs-heading small{font-size:10px;color:#aaa}.url-field{display:flex;gap:8px;margin:17px 0 10px}.url-field input{flex:1;min-width:0;height:39px;border-radius:8px;border:1px solid #555;background:#0e0e0f;color:#eee;padding:0 11px;font:500 10px Manrope,sans-serif}.url-field button,.submit-button{border:0;border-radius:8px;background:var(--yellow);color:#171717;padding:0 14px;font-size:11px;font-weight:700;white-space:nowrap}.obs-area p{font-size:10px;color:#aaa;line-height:1.6}.obs-area p strong{color:#fff}
.bottom-hint{display:flex;align-items:center;gap:10px;margin-top:23px;padding:15px 18px;border:1px solid #3c3c3c;border-radius:11px;background:#181819;color:#aaa;font-size:11px}.bottom-hint span{color:var(--yellow);font-size:20px}
dialog{width:min(470px,calc(100% - 26px));border:1px solid #555;border-radius:17px;background:#181819;color:#fff;padding:28px;box-shadow:0 25px 80px #000b}dialog::backdrop{background:#000b;backdrop-filter:blur(5px)}dialog form{position:relative}.dialog-close{position:absolute;top:-7px;right:-2px;border:0;background:none;color:#aaa;font-size:25px}.dialog-eyebrow{font:800 10px Manrope,sans-serif;letter-spacing:.17em;color:var(--yellow)}dialog h2{font-size:23px;margin:10px 0 4px}.dialog-intro{color:#aaa;font-size:11px;margin-bottom:19px}.form-field{display:flex;flex-direction:column;gap:6px;margin:13px 0;font-size:11px;color:#ddd}.form-field input{height:40px;min-width:0;padding:0 10px;border:1px solid #555;border-radius:8px;background:#242425;color:#fff}.form-field input[type=file]{padding:8px}.form-field small{font-size:9px;color:#999}.form-row{display:grid;grid-template-columns:1fr 1.4fr;gap:11px}.submit-button{height:42px;width:100%;margin-top:11px}
.delete-dialog{width:min(450px,calc(100% - 28px));padding:0;border:1px solid #4a4a4a;border-radius:18px;background:#121213;color:#fff;box-shadow:0 30px 90px #000c}.delete-dialog::backdrop{background:#000c;backdrop-filter:blur(7px)}.delete-dialog-inner{position:relative;padding:29px}.delete-dialog .dialog-close{top:16px;right:20px;width:30px;height:30px;display:grid;place-items:center;border:1px solid #555;border-radius:50%;color:#ccc;font-size:21px;line-height:1}.delete-mark{width:46px;height:46px;display:grid;place-items:center;border-radius:12px;background:var(--yellow);color:#151515;font:800 25px Manrope,sans-serif;margin-bottom:20px}.delete-eyebrow{color:var(--yellow);font:800 10px Manrope,sans-serif;letter-spacing:.15em}.delete-dialog h2{font-size:25px;margin:8px 0 7px}.delete-dialog p{font-size:12px;line-height:1.65;color:#aaa}.delete-target{display:flex;align-items:center;gap:12px;margin:21px 0 24px;padding:9px;background:#222;border:1px solid #424242;border-radius:10px}.delete-target img{width:55px;height:55px;object-fit:contain;border-radius:6px;background:#111}.delete-target strong{font-size:13px;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.delete-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px}.delete-actions button{height:42px;border-radius:8px;font-size:12px;font-weight:700}#cancelDeleteButton{background:#282828;border:1px solid #666;color:#fff}#confirmDeleteButton{background:var(--yellow);border:1px solid var(--yellow);color:#151515}#cancelDeleteButton:hover{background:#383838}#confirmDeleteButton:hover{background:var(--yellow-hover)}
.toast{position:fixed;z-index:20;left:auto;right:24px;top:24px;bottom:auto;width:min(370px,calc(100vw - 32px));min-height:76px;display:flex;align-items:center;gap:12px;padding:13px 13px 13px 14px;border:1px solid #555;border-left:4px solid var(--yellow);border-radius:12px;background:#171718;color:#fff;box-shadow:0 20px 60px #000a;transform:translate(20px,-12px);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}.toast.show{transform:translate(0,0);opacity:1;pointer-events:auto}.toast-icon{width:37px;height:37px;flex:none;display:grid;place-items:center;border-radius:9px;background:var(--yellow);color:#151515;font:800 19px Manrope,sans-serif}.toast-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.toast-copy strong{font-size:12px}.toast-copy small{font-size:11px;line-height:1.45;color:#ccc;overflow-wrap:anywhere}.toast>button{align-self:flex-start;margin-left:auto;width:22px;height:22px;border:0;background:transparent;color:#aaa;font-size:21px;line-height:1}.toast.error{border-left-color:#fff}.toast.error .toast-icon{background:#fff;color:#151515}
@media(max-width:1040px){.dashboard{grid-template-columns:1fr}.product-list{min-height:270px;max-height:640px}}
@media(min-width:821px) and (max-width:1040px){.dashboard{grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr)}.product-item img{height:145px}}
@media(max-width:820px){.dashboard{grid-template-columns:1fr}}
@media(max-width:640px){.topbar{height:63px}.local-pill{display:none}.main{padding-top:28px}.intro{margin-bottom:26px}.intro-symbol{display:none}h1{font-size:39px}.intro p{font-size:12px}.panel-heading{height:59px;padding:0 15px}.panel-subtitle{margin:16px 15px 12px}.product-controls{margin:0 15px 14px;flex-direction:column}.product-list{padding:0 15px 15px;grid-template-columns:1fr 1fr;gap:8px}.product-item img{height:120px}.product-info strong{font-size:11px}.product-info b{font-size:13px}.product-buttons{flex-direction:column}.delete-button{width:100%}.output-actions{padding:12px 15px}.obs-area{padding:16px}.url-field{flex-direction:column}.url-field button{height:37px}.form-row{grid-template-columns:1fr}.toast{top:12px;right:12px}.delete-dialog-inner{padding:22px}}
@media(max-width:430px){.product-list{grid-template-columns:1fr}.product-item{display:flex;gap:10px}.product-item img{width:94px;height:104px;margin:0;flex:none}.product-info{flex:1;min-width:0}.product-buttons{flex-direction:row;margin-top:auto}}
/* Display controls and aspect-aware preview */
.display-settings{padding:18px 21px 5px;border-bottom:1px solid var(--line)}
.settings-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.settings-title strong{font-size:13px}.settings-title small{color:var(--yellow);font-size:10px}
.setting-row{min-height:62px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid #333}.setting-row>div:first-child{min-width:0}.setting-row strong,.setting-row small{display:block}.setting-row strong{font-size:11px}.setting-row small{font-size:10px;color:#969696;margin-top:3px}
.ratio-options{display:flex;gap:5px;flex:none;padding:4px;border:1px solid #494949;border-radius:9px;background:#101011}.ratio-options button{min-width:82px;padding:6px 7px;border:1px solid transparent;border-radius:6px;background:transparent;color:#aaa;font:800 12px Manrope,sans-serif}.ratio-options button span{display:block;margin-top:2px;font:500 9px var(--font)}.ratio-options button[aria-pressed=true]{background:var(--yellow);color:#141414;border-color:var(--yellow)}
.switch{position:relative;display:block;width:43px;height:25px;flex:none}.switch input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}.switch-track{display:block;width:100%;height:100%;border-radius:20px;background:#484848;border:1px solid #646464;transition:background .2s}.switch-track:after{content:"";position:absolute;top:4px;left:4px;width:17px;height:17px;border-radius:50%;background:#eee;transition:transform .2s}.switch input:checked+.switch-track{background:var(--yellow);border-color:var(--yellow)}.switch input:checked+.switch-track:after{transform:translateX(18px);background:#151515}.switch input:focus-visible+.switch-track{outline:2px solid var(--yellow);outline-offset:3px}
.preview-header{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:13px 21px;background:#111112;font-size:11px;font-weight:700}.preview-header small{color:#aaa;font:600 10px Manrope,sans-serif}.preview-shell{display:flex;justify-content:center;align-items:center;padding:0;background:#101011;min-height:220px}.output-stage{width:100%;aspect-ratio:16/9}.output-stage.ratio-portrait{width:min(100%,280px);aspect-ratio:9/16}.stage-product{flex-direction:column;align-items:stretch;justify-content:stretch}.stage-image-frame{display:flex;align-items:center;justify-content:center;flex:1;min-height:0;width:100%}.stage-image-frame img{width:100%;height:100%;object-fit:contain}.stage-meta{display:flex;align-items:center;justify-content:center;gap:10px;max-width:100%;padding:8px 15px 12px;min-height:0;position:relative}.stage-meta strong{font-size:clamp(12px,1.5vw,20px);color:#fff;text-shadow:0 2px 7px #000,0 1px 3px #000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.stage-meta span{flex:none;background:var(--yellow);color:#111;border-radius:7px;padding:4px 8px;font:800 clamp(11px,1.4vw,18px) Manrope,sans-serif;box-shadow:0 2px 10px #0008}.ratio-portrait .stage-meta{flex-direction:column;gap:5px;padding:6px 10px 12px}.ratio-portrait .stage-meta strong{max-width:100%;font-size:15px}.ratio-portrait .stage-meta span{font-size:14px}
@media(max-width:640px){.display-settings{padding:15px 15px 5px}.preview-header{padding:12px 15px}.settings-title{align-items:flex-start}.settings-title small{text-align:right}.setting-row{gap:8px}.ratio-options button{min-width:65px}.setting-row small{font-size:9px}}
/* Keep the optional name and price together directly below the image. */
.stage-product.has-meta .stage-image-frame{align-items:flex-end}
.stage-meta{padding:3px 10px 7px;gap:8px}
.ratio-portrait .stage-meta{flex-direction:row;gap:7px;padding:3px 8px 7px}
.ratio-portrait .stage-meta strong{min-width:0;max-width:100%;font-size:14px}
.ratio-portrait .stage-meta span{font-size:13px}
.stage-image-frame img{width:auto;height:auto;max-width:100%;max-height:100%}
