@font-face{font-family:NotoThai;src:url('/static/fonts/NotoSansThai-SemiBold.ttf');font-weight:400;font-style:normal}@font-face{font-family:Scto;src:url('/static/fonts/Scto Grotesk B Bold.otf');font-weight:400;font-style:normal}
@font-face{font-family:SctoRegular;src:url('/static/fonts/Scto Grotesk B Regular.otf');font-weight:400;font-style:normal}
/* the artwork faces ship one weight each: never let a browser fake-bold them, or the JPG and the canvas disagree */
.artboard,.artboard *{font-synthesis:none;-webkit-font-smoothing:antialiased}
:root{--bg:#f3f4f6;--panel:#fff;--panel-raised:#fff;--ink:#171719;--muted:#626772;--line:#767c85;--accent:#f50a3c;--action:#c5002a;--selection:#2463eb;--danger:#b42318;--warning:#a15c00;--ok:#146c43;--canvas-scale:.5}
/* body font comes from ui-base.css. This file must not name a UI font: "Segoe UI" alone
   left Thai UI text with no font at all on machines without it. Artwork keeps its own
   families (Scto/NotoThai) declared per element, so export is unaffected. */
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink)}button,input,select,textarea{font:inherit}button{min-height:36px;border:1px solid var(--line);background:var(--panel);color:var(--ink);border-radius:7px;padding:6px 10px;cursor:pointer;transition:transform var(--dur-1,120ms) var(--ease-out,ease),background var(--dur-1,120ms) var(--ease-out,ease)}button:hover{background:#eef0f3}button:active:not(:disabled){transform:scale(.97)}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[contenteditable]:focus-visible{outline:3px solid var(--focus-ring);outline-offset:2px}.primary{background:var(--action);color:#fff;border-color:var(--action)}.danger{color:var(--danger)}label{display:grid;gap:5px;color:var(--muted)}input,select,textarea{width:100%;border:1px solid var(--line);border-radius:7px;background:var(--panel);color:var(--ink);padding:7px}textarea{resize:vertical}.app-head{height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;background:#171719;color:#fff;position:sticky;top:0;z-index:50}.app-head>div{display:flex;align-items:center;gap:12px}.app-head button{background:#2a2a2e;color:#fff;border-color:#555}.app-head .primary{background:#f50a3c}.head-actions{flex-wrap:wrap}.workspace{display:grid;grid-template-columns:230px minmax(500px,1fr) 245px;gap:14px;padding:14px;align-items:start}.rail,.inspector,.sku-dock{background:var(--panel);border:1px solid #d3d6dc;border-radius:12px;padding:12px}.rail,.inspector{display:grid;gap:12px;position:sticky;top:72px;max-height:calc(100vh - 86px);overflow:auto}.promo-list{display:grid;gap:6px}.promo-card{display:grid;gap:2px;text-align:left}
.promo-card{cursor:pointer;padding:6px 8px;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
.promo-card:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}
.promo-card.promo-holding{background:#2463eb1f;animation:promoHold 180ms linear both}
@keyframes promoHold{from{box-shadow:inset 0 0 0 0 #2463eb38}to{box-shadow:inset 24px 0 0 0 #2463eb38}}
.promo-card.promo-dragging{position:fixed;z-index:40;box-sizing:border-box;margin:0;cursor:grabbing;transform:scale(1.02);outline:2px solid #2463ebb8;box-shadow:0 14px 32px #00000057;transition:transform 140ms var(--ease-out,ease),box-shadow 140ms var(--ease-out,ease)}
.promo-card.promo-dragging.promo-snapping{transform:scale(1);box-shadow:0 0 0 transparent;transition:top 210ms var(--ease-out,ease),left 210ms var(--ease-out,ease),transform 210ms var(--ease-out,ease),box-shadow 210ms var(--ease-out,ease)}
.promo-placeholder{box-sizing:border-box;border:2px dashed #2463eb85;border-radius:8px;background:#2463eb0f}
.promo-card{transition:transform 180ms var(--ease-out,ease)}
@media (prefers-reduced-motion:reduce){.promo-card,.promo-card.promo-holding,.promo-card.promo-dragging,.promo-placeholder{animation:none!important;transition:none!important}}
.promo-card-head{display:flex;align-items:center;gap:4px;min-width:0}
.promo-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700;cursor:text}
.promo-name-input{flex:1;min-width:0;font-weight:700;padding:1px 4px;border:1px solid var(--selection);border-radius:5px;background:var(--panel);color:var(--ink)}
.promo-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;min-height:32px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--muted);font-size:15px;line-height:1}
.promo-icon:hover:not(:disabled){background:#2463eb18;color:var(--ink)}
.promo-icon-danger:hover:not(:disabled),.promo-icon-danger:focus-visible{color:var(--danger)}
.promo-icon:disabled{opacity:.35;cursor:not-allowed}
.promo-export{width:100%;margin-top:6px;min-height:32px;font-size:12px}.value-input{justify-self:start}.value-row .value-input{flex:none}.value-row button{flex:1;min-width:0;min-height:30px;padding:0 6px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.promo-card.active{border:2px solid var(--selection);background:#edf3ff}.promo-card small,.hint,#skuDetail{color:var(--muted)}.editor-area{display:grid;gap:8px;justify-items:center;min-width:0}.canvas-toolbar{width:450px;display:flex;justify-content:space-between;gap:12px;color:var(--muted)}.artboard{width:450px;height:600px;position:relative;background:#fff;color:#000;overflow:hidden;box-shadow:0 8px 26px #0002;container-type:size}.logo-box{position:absolute;left:62px;top:60px;width:241px;height:50px;display:flex;align-items:center;justify-content:center;font:700 24px Scto,NotoThai}.campaign-text{position:absolute;left:0;top:122px;width:332px;text-align:center;font:20px Scto}.date-text{position:absolute;left:0;top:152px;width:332px;text-align:center;font:15px NotoThai}.locked-text{cursor:text;border-radius:3px}.locked-text:hover{box-shadow:0 0 0 1px #2463eb88}.sku-zone{position:absolute;left:38px;top:194px;width:257px;height:286px;display:flex;justify-content:center;align-items:flex-end}.sku-zone img{max-width:100%;max-height:100%;object-fit:contain;cursor:grab;touch-action:none}.sku-zone img.is-moving{cursor:grabbing}.sku-zone img:not([src]){display:none}.sku-zone span{color:#777}
.logo-box.is-empty,.sku-zone.is-empty{outline:1px dashed #9aa0aa;outline-offset:-1px;border-radius:2px}
.logo-box.is-empty::after,.sku-zone.is-empty::after{content:attr(data-dim);position:absolute;left:50%;top:50%;translate:-50% 15px;font:600 8px "Segoe UI",sans-serif;color:#9aa0aa;letter-spacing:.3px;white-space:nowrap;pointer-events:none}
.template-image{position:absolute;left:0;top:0;width:450px;height:600px;object-fit:fill;pointer-events:none;z-index:0}
.artboard.mode-template .logo-box,.artboard.mode-template .campaign-text,.artboard.mode-template .date-text,.artboard.mode-template .gwp-panel,.artboard.mode-template .footnote{display:none!important}
.artboard.mode-template .sku-zone{z-index:2}
.artboard.mode-template.template-drop-ready{outline:3px dashed var(--selection);outline-offset:-3px}
.template-drop{display:grid;gap:2px;width:100%;margin-top:8px;padding:12px 10px;border:1px dashed var(--line);border-radius:9px;background:transparent;color:var(--muted);text-align:center;cursor:pointer}
.template-drop:hover,.template-drop.drag-over{border-color:var(--selection);border-style:solid;color:var(--ink);background:#2463eb10}
.template-drop strong{font-size:13px}
.template-drop small{font-size:11px}
body.export-mode .is-empty{outline:none!important}
body.export-mode .is-empty::after{content:none!important}.gwp-panel{position:absolute;left:318px;top:60px;width:120px;background:#eeeced;border-radius:6px;min-height:80px}.tier{position:relative}.tier-title{min-height:26px;background:#000;color:#fff;border-radius:5px;display:grid;place-items:center;text-align:center;padding:3px 6px;font:12px NotoThai;cursor:text}.tier-reward{text-align:center;padding:5px 4px 4px;font:9px NotoThai;min-height:18px;cursor:text}.gift-row{position:relative;width:100px;margin:0 auto 5px;min-height:48px;display:flex;align-items:flex-end;justify-content:center;gap:5px;border:1px dashed transparent;border-radius:5px;padding:3px}.gift-row.active{border-color:var(--selection);background:#2463eb10}.gift-row.disabled{min-height:24px;align-items:center;border-color:#999;color:#666}.gift-row.drag-over{border:2px solid var(--selection);background:#dbe8ff}.row-tools{display:flex;justify-content:space-between;align-items:center;font-size:8px;padding:0 10px 2px;color:#555}.row-tools button{min-height:20px;padding:0 5px;border-radius:4px;font-size:8px}.gwp-item{position:relative;flex:none;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;transform-origin:center bottom;cursor:grab}.gwp-item.dragging{opacity:.35}.gwp-item.selected{filter:drop-shadow(0 0 2px var(--selection))}.gwp-item img{display:block;max-width:100%;max-height:100%;object-fit:contain;pointer-events:none}.gwp-label{font:8px Scto;white-space:nowrap;margin:0}.gwp-labels{display:flex;width:100%;justify-content:space-around;align-items:flex-end;gap:2px;margin-top:3.65px}.gwp-labels.top{order:-1;margin:0 0 3.65px}.gwp-labels.hidden,.gwp-labels:empty,.gwp-label.hidden{display:none}.gwp-label.free{position:absolute;cursor:grab;z-index:3}.gwp-item:has(.gwp-label.free){z-index:2}.gwp-item.selected:has(.gwp-label.free){z-index:3}.gwp-label.free:active{cursor:grabbing}.gwp-label.label-selected{outline:1px solid var(--selection);outline-offset:1px;border-radius:2px;background:#2463eb1f}body.export-mode .gwp-label.label-selected{outline:none;background:none}.resize-dot{position:absolute;right:-3px;top:-3px;width:8px;height:8px;border-radius:50%;background:var(--selection);border:1px solid #fff;display:none}.gwp-item.selected .resize-dot{display:block}.footnote{position:absolute;left:318px;top:470px;width:120px;text-align:center;font:9px NotoThai}.issues{display:grid;gap:6px}.issue{padding:7px;border-radius:6px;background:#fff4e5;color:#6b3b00}.issue.error{background:#fff0ef;color:#8a1c13}.sku-dock{margin:0 14px 18px;display:grid;gap:12px}.sku-entry{display:grid;grid-template-columns:minmax(260px,1fr) 160px 120px;gap:12px;align-items:end}.sku-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px}/* head, title, gallery, upload: the gallery row absorbs the spare height so every card lines up
   whatever number of thumbnails it holds */
.sku-card{border:1px solid #d3d6dc;border-radius:9px;padding:9px;display:grid;gap:8px;grid-template-rows:auto auto 1fr auto;align-content:stretch}.sku-card-head{display:flex;justify-content:space-between;gap:6px}.gallery-grid{display:grid;grid-template-columns:repeat(4,1fr);grid-auto-rows:62px;align-content:start;gap:5px;overflow-y:auto}.gallery-choice{min-height:0;height:62px;padding:2px;overflow:hidden}.gallery-choice img{width:100%;height:100%;object-fit:contain}.gallery-choice.active{border:3px solid var(--selection)}.empty-thumb{height:54px;display:grid;place-items:center;background:#eee;color:#666}.panel-overflow{box-shadow:0 0 0 3px var(--danger)}
@media(max-width:1050px){.workspace{grid-template-columns:190px minmax(470px,1fr)}.inspector{position:static;grid-column:1/-1;max-height:none;grid-template-columns:repeat(3,1fr)}}
@media(max-width:760px){.app-head{height:auto;min-height:58px;align-items:flex-start;padding:10px}.workspace{grid-template-columns:1fr}.rail,.inspector{position:static;max-height:none}.inspector{grid-template-columns:1fr}.canvas-toolbar{width:min(450px,100%)}.editor-area{overflow:auto;justify-items:start}.sku-entry{grid-template-columns:1fr}.head-actions{justify-content:flex-end}.artboard{transform-origin:top left}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
.row-tools{height:19px;position:absolute;right:2px;top:2px;z-index:6;justify-content:flex-end;gap:3px;padding:1px;border-radius:4px;background:#fffffff2;box-shadow:0 1px 4px #0002;opacity:0;pointer-events:none;transform:translateY(-2px)}
.gift-row:not(.disabled):hover .row-tools,.gift-row.active .row-tools,.gift-row:not(.disabled):focus-within .row-tools{opacity:1;pointer-events:auto}.gift-row.disabled .row-tools{pointer-events:none!important}.row-placeholder{display:block;width:100%;text-align:center;color:#777;font-size:7px;line-height:12px;position:relative;z-index:7;cursor:pointer}
.row-tools button{min-height:17px;padding:0 4px;font-size:7px;opacity:.78}
.gift-row.disabled{min-height:14px;height:14px;margin-bottom:3px;font-size:7px}
#panelMeter.has-error{color:var(--danger);font-weight:700}.locked-text.has-error{box-shadow:inset 0 0 0 2px var(--danger);background:#fff0ef;color:#8a1c13}.tier-title.locked-text.has-error{background:#6f1510;color:#fff}.artboard.has-overflow{box-shadow:0 8px 26px #0002,inset 0 0 0 4px var(--danger)}
.gwp-item{display:block}.gwp-item img{position:absolute;left:0}.gwp-labels{position:absolute;left:0;width:100%;margin:0}.gwp-labels.top{order:initial;margin:0}.resize-dot{top:auto}
.logo-box img{display:block;max-width:100%;max-height:100%;object-fit:contain}.logo-controls{display:grid;gap:8px;padding:10px;border:1px solid var(--line);border-radius:9px}.inline-check{display:flex;align-items:center;gap:7px}.inline-check input{width:auto}.sku-card.active{box-shadow:0 0 0 3px var(--selection)}.sku-preview{min-height:28px;padding:2px 6px}body.export-mode{background:#fff}body.export-mode .app-head,body.export-mode .workspace>aside,body.export-mode .canvas-toolbar,body.export-mode .sku-dock{display:none!important}body.export-mode .workspace{display:block;padding:0}body.export-mode .editor-area{display:block}body.export-mode .artboard{box-shadow:none}body.export-mode .row-tools,body.export-mode .resize-dot,body.export-mode .gift-row.disabled{display:none!important}body.export-mode .gift-row,body.export-mode .locked-text{outline:none!important;box-shadow:none!important;border-color:transparent!important}body.export-mode .gwp-panel{box-shadow:none!important}body.export-mode .gwp-item{filter:none!important}
/* rule: Thai and the baht sign come from Noto Sans Thai, Latin and digits from Scto. Scto carries no
   Thai glyph at all (checked against its cmap), so listing Noto second is what enforces it. */
.campaign-text{font-family:SctoRegular,NotoThai;font-weight:400;letter-spacing:.7px}.logo-box{left:66px;width:190px;height:48px}.campaign-text{width:323px}.date-text{left:31.5px;width:260px}.tier-title{font-size:13px;padding-left:2px;padding-right:2px;white-space:pre-line;overflow-wrap:anywhere;word-break:break-word;overflow:hidden}.tier-reward{height:21px;min-height:21px;padding:2px 3px;line-height:17px}.tier-title,.tier-reward,.date-text,.footnote,.gwp-label{font-family:Scto,NotoThai}.gift-row{padding:0 3px}.sku-zone{left:37.5px;top:194px;width:257.5px;height:286px}
.sku-zone img{transform-origin:center bottom}.sku-scales{display:grid;grid-template-columns:1fr 1fr;gap:10px}.sku-scales label{grid-template-columns:1fr auto;align-items:center}.sku-scales input{grid-column:1/-1}#resetSkuOffsetX{justify-self:start}
.row-separator{height:15px;display:flex;align-items:center;justify-content:center;gap:6px;font:9px Scto,NotoThai;color:inherit}.row-separator::before,.row-separator::after{content:"";flex:1;min-width:8px;border-top:1px solid currentColor}.row-gift-tag{right:-5px}

/* Shared Central Creative Tools shell. Artwork colors remain isolated in #artboard. */
:root{--brand-accent:#f50a3c;color-scheme:light}
:root[data-theme="dark"]{--bg:#16171a;--panel:#1e2024;--panel-raised:#25272c;--ink:#eef0f2;--muted:#b9bdc3;--line:#44474e;--selection:#5b8bff;--danger:#ff8098;color-scheme:dark}
.suite-header{display:flex;align-items:center;gap:28px;height:52px;padding:0 24px;background:#202124;color:#fff;border-bottom:1px solid rgb(255 255 255 / 6%)}
.suite-brand{flex:0 0 260px;min-width:260px;display:flex;align-items:baseline;gap:6px}.suite-kicker{font-size:14px;font-weight:720;letter-spacing:.2px;white-space:nowrap}.suite-brand h1,.suite-brand p{display:none}
#buildVersion{display:inline-flex;align-items:center;min-width:78px;min-height:44px;justify-content:flex-start;white-space:nowrap;font-size:11px;opacity:.6;font-weight:400;background:transparent!important;border:0!important;color:inherit;cursor:pointer;padding:0 2px;text-decoration:underline dotted;border-radius:0!important;box-shadow:none!important}
.suite-nav{flex:1;display:flex;align-self:stretch;align-items:stretch;gap:6px;min-width:0;overflow-x:auto;scrollbar-width:none}.suite-nav::-webkit-scrollbar{display:none}.suite-nav a,.suite-nav>span{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border:0;border-bottom:3px solid transparent;padding:0 14px;background:transparent;color:#b9bdc3;font-size:14px;font-weight:500;text-decoration:none;white-space:nowrap}.suite-nav a:hover{color:#fff;background:rgb(255 255 255 / 3%)}.suite-nav .active{color:#fff;border-color:var(--brand-accent);background:#292b2e}
.theme-button{margin-left:auto;align-self:center;min-height:32px;display:inline-flex;align-items:center;gap:7px;border:1px solid #44464b;border-radius:7px;padding:6px 10px;background:#2a2c30;color:#fff}.theme-button:active{transform:scale(.97)}.theme-icon{display:grid;width:18px;height:18px;place-items:center}.theme-icon-svg{grid-area:1/1;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}:root[data-theme="dark"] .theme-icon-moon{display:none}:root[data-theme="light"] .theme-icon-sun{display:none}
.version-modal{position:fixed;inset:0;z-index:70;display:none;align-items:center;justify-content:center;padding:16px;background:rgba(10,11,13,.72)}.version-modal.open,.version-modal.closing{display:flex}.version-dialog{width:min(420px,100%);max-width:460px;max-height:calc(100vh - 32px);overflow:auto;background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:24px;box-shadow:0 20px 60px #0006;text-align:left}.version-dialog strong{display:block;font-size:18px}.version-body{max-height:60vh;overflow-y:auto;margin:10px 0;font-size:13px;line-height:1.55}.version-entry-title{font-weight:600;margin:8px 0 4px}.version-entry-list{margin:0;padding-left:18px}.version-actions{display:flex;justify-content:flex-end;gap:10px}.version-actions button{min-height:36px;background:var(--action);color:#fff;border-color:var(--action)}
.version-modal.open{animation:fade-in .16s ease-out}.version-modal.open .version-dialog{animation:modal-in .18s ease-out}.suite-nav a,.theme-button{transition:background-color .16s ease,color .16s ease,border-color .16s ease,transform .12s ease}@keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes modal-in{from{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:none}}
.rail,.inspector,.sku-dock{border-color:var(--line)}:root[data-theme="dark"] button:hover{background:#30333a}:root[data-theme="dark"] .promo-card.active{background:#273247}:root[data-theme="dark"] .issue{background:#49371e;color:#ffe2b6}:root[data-theme="dark"] .issue.error{background:#4b2928;color:#ffd5d2}:root[data-theme="dark"] .empty-thumb{background:#292b30;color:#c7c9cd}
.app-head{position:sticky;top:0;height:58px}.artboard{background:#fff;color:#000;filter:none!important;mix-blend-mode:normal}
@media(max-width:760px){.suite-header{height:auto;min-height:76px;padding:13px 16px;flex-wrap:wrap;gap:11px}.suite-brand{min-width:0;flex-basis:100%}.suite-nav{width:100%;margin-left:0;flex-wrap:wrap;overflow-x:visible;gap:6px 8px}.suite-nav>*{flex:0 0 auto}.suite-nav a,.suite-nav>span,.theme-button{min-height:40px}.theme-button{margin-left:auto}.app-head{height:auto;min-height:58px;padding:10px 14px;align-items:flex-start;gap:10px;flex-direction:column}.app-head>div{width:100%}.app-head>div:first-child{min-height:28px}.app-head .head-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.app-head .head-actions button{min-width:0;padding-inline:5px;white-space:nowrap}.workspace{padding-top:14px}.editor-area{width:100%;overflow-x:auto;justify-items:start}.canvas-toolbar,.artboard{margin-inline:auto}}
@media(prefers-reduced-motion:reduce){.suite-nav a,.theme-button,.version-modal,.version-dialog{animation:none!important;transition:none!important}}
body.export-mode .suite-header,body.export-mode #feedback-root{display:none!important}
.sku-entry{grid-template-columns:minmax(260px,1fr) 160px minmax(120px,220px)}.sku-actions{display:grid;gap:6px}.sku-card.trimmed{box-shadow:inset 0 0 0 2px #28a66a}
.tier:first-child .tier-title{border-radius:12px 12px 0 0}.tier:not(:first-child) .tier-title{border-radius:0}
.artboard{zoom:var(--canvas-zoom,1)}body.export-mode .canvas-toolbar,body.export-mode .artboard{zoom:1}
@media(min-width:761px){.workspace{grid-template-columns:230px auto 245px;justify-content:center;gap:20px}}.sku-gallery{display:flex;overflow-x:auto;scroll-snap-type:x proximity;padding-bottom:8px}.sku-card{flex:0 0 240px;min-width:240px;max-width:240px;scroll-snap-align:start;cursor:pointer}
.sku-entry{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.sku-entry .sku-actions{display:flex;flex:0 0 auto;gap:6px;margin-left:auto}
.sku-entry .sku-actions button{height:36px;min-height:36px;white-space:nowrap}
.sku-list-field{flex:1 1 0;min-width:180px;display:grid}.sku-search{width:100%;min-width:0;max-width:none;height:36px;min-height:36px;padding:0 14px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--ink);resize:vertical;line-height:34px;white-space:pre;overflow:hidden}/* the dock is one row high at rest; the SKU list only grows while it is being written */.sku-search:focus{height:126px;padding:8px 14px;line-height:19px;overflow:auto}
.sku-summary{flex:0 0 auto;white-space:nowrap;font-size:12px;color:var(--muted)}
.sku-title-tier{flex:0 0 auto;display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}
.sku-title-tier .tier-count-switch{grid-auto-flow:column;grid-template-columns:none;grid-auto-columns:max-content}
.sku-title-tier button{height:36px;min-height:36px;padding:0 10px}
/* macOS system fonts are a few pixels wider than Segoe UI. Keep each dynamic Tier label at
   its intrinsic width so the shared segmented-switch ellipsis is never reached. */
.sku-title-tier .tier-count-switch button{min-width:max-content;overflow:visible;text-overflow:clip}
input.sku-code{flex:1;min-width:0;width:100%;padding:1px 3px;border:1px solid transparent;border-radius:5px;background:transparent;color:inherit;font:inherit;font-weight:700;text-overflow:ellipsis}input.sku-code:hover{border-color:var(--line)}input.sku-code:focus{border-color:var(--selection);background:var(--panel);outline:none}
.sku-order{flex:none;display:grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:var(--line);color:var(--panel);font-size:11px;font-weight:700}
.sku-dup-badge{flex:none;padding:1px 6px;border-radius:999px;font-size:11px;font-weight:700;color:#fff;background:var(--dup-color)}
.sku-card.sku-duplicate{border-color:var(--dup-color);box-shadow:inset 0 0 0 2px var(--dup-color)}
.sku-card.sku-duplicate .sku-order{background:var(--dup-color)}
.sku-card-head{min-height:34px;align-items:center}
.sku-card.active{border-color:var(--selection);box-shadow:inset 0 0 0 3px var(--selection)}
.sku-download{flex:0 0 28px;width:28px;min-width:28px;height:28px;min-height:28px;align-self:center;padding:0;display:grid;place-items:center;border-radius:7px;font-size:17px;line-height:1}
.sku-upload{width:100%;min-height:34px;border-style:dashed;font-size:12px}
.sku-card.sku-drop{outline:3px solid var(--selection);outline-offset:2px;background:#2463eb10}
.sku-card[data-status="error"] .sku-upload{border-color:var(--selection);color:var(--selection)}
.sku-title-field{display:grid;gap:4px}.sku-title-field span{font-size:11px;color:var(--muted)}.sku-title-input{width:100%;min-height:48px;padding:7px 8px;resize:vertical;border:1px solid var(--line);border-radius:7px;background:var(--panel);color:var(--ink);font:12px/1.35 Scto,NotoThai}.sku-title-input:focus{outline:2px solid var(--selection);outline-offset:1px}
.sku-resize{display:block;right:auto;top:auto;width:9px;height:9px;cursor:nwse-resize;z-index:4}
.sku-resize[hidden]{display:none}
body.export-mode .sku-resize{display:none!important}
.sku-gallery{cursor:grab;scrollbar-width:thin}
.sku-gallery.dragging{cursor:grabbing;scroll-snap-type:none;user-select:none}
.sku-gallery.dragging .gallery-choice{pointer-events:none}
@media(max-width:760px){.sku-dock{margin-inline:14px;min-width:0}.sku-entry{grid-template-columns:minmax(0,1fr)}.sku-entry>*,.sku-gallery{min-width:0;width:100%}.sku-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.sku-actions button{min-width:0}.sku-card{flex-basis:min(240px,calc(100vw - 54px))}}

/* Focused editor workspace */
.utility-popover{position:fixed;z-index:40;top:118px;left:50%;translate:-50% 0;width:min(760px,calc(100vw - 28px));max-height:calc(100vh - 140px);overflow:auto;padding:14px;background:var(--panel);border:1px solid var(--line);border-radius:0 0 12px 12px;box-shadow:0 18px 45px #0005}.utility-popover[hidden]{display:none}.utility-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.utility-close{min-width:36px;padding:0;font-size:20px}.utility-grid{display:grid;grid-template-columns:1fr 1fr 1.3fr;gap:12px}.logo-controls{grid-template-columns:1fr 1fr;align-items:end;border:0;padding:0}.logo-controls .logo-file,.logo-controls>small{grid-column:1/-1}.logo-file{border:1px dashed var(--line);border-radius:9px;padding:10px}.logo-file.drag,.logo-box.logo-drag{outline:3px solid var(--selection);background:#dbe8ff}.logo-file span{font-size:12px}.logo-draft-actions{display:flex;gap:8px}.logo-draft-actions button{flex:1}
.rail{align-content:start}.workspace{grid-template-columns:190px auto 270px}.canvas-toolbar{align-items:center}.zoom-controls{display:flex;align-items:center;gap:5px}.zoom-controls button{min-height:30px;padding:2px 8px}.zoom-controls output{min-width:40px;text-align:center;font-variant-numeric:tabular-nums}.canvas-viewport{max-width:calc(100vw - 516px);max-height:calc(100vh - 158px);overflow:auto;padding:2px;overscroll-behavior:contain}.canvas-viewport.panning{cursor:grabbing;user-select:none}.artboard{transform-origin:top left}
.tier{cursor:default}.tier.tier-selected{box-shadow:inset 0 0 0 1px #2463eb99}.gift-row{border:0;background:transparent}.gift-row.disabled{display:none}.row-tools,.row-placeholder{display:none!important}.gift-row.drop-ready{outline:1px dashed var(--selection);background:#2463eb10}.gift-row.drag-over{outline:2px solid var(--selection);border:0}.row-layout-switch{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:10px 0}.row-layout-switch button{display:grid;place-items:center;gap:2px}.row-layout-switch button span{font-size:18px;line-height:1}.row-layout-switch button[aria-pressed="true"]{border-color:var(--selection);box-shadow:inset 0 0 0 1px var(--selection);background:#edf3ff;color:#173f96}.inspector #tierInspector,.inspector #gwpInspector{display:grid;gap:10px}.inspector [hidden]{display:none!important}.issues:not(:empty){border-top:1px solid var(--line);padding-top:10px}
body.export-mode .tier.tier-selected{box-shadow:none}.logo-box{transition:outline-color .12s ease,background-color .12s ease}.tier{transition:box-shadow .12s ease}.gift-row{transition:outline-color .12s ease,background-color .12s ease}
@media(max-width:1050px){.workspace{grid-template-columns:170px minmax(0,1fr)}.canvas-viewport{max-width:calc(100vw - 226px)}.inspector{grid-column:1/-1}}
@media(max-width:760px){.utility-popover{top:auto;bottom:0;left:0;translate:0;width:100%;max-height:78vh;border-radius:14px 14px 0 0}.utility-grid,.logo-controls{grid-template-columns:1fr}.workspace{grid-template-columns:1fr}.rail{position:static}.canvas-viewport{max-width:100%;max-height:none;width:100%}.canvas-toolbar{width:100%}.zoom-controls{order:2}.app-head .head-actions{grid-template-columns:repeat(3,minmax(0,1fr))}}
body.dragging-gwp .gift-row:not(.disabled){outline:1px dashed var(--selection);background:#2463eb10}
body.export-mode .canvas-viewport{max-width:none;max-height:none;overflow:visible;padding:0}body.export-mode .utility-popover{display:none!important}
.tier-count-control{display:grid;gap:7px;padding-bottom:10px;border-bottom:1px solid var(--line)}.tier-count-switch{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}.tier-count-switch button[aria-pressed="true"]{border-color:var(--selection);box-shadow:inset 0 0 0 1px var(--selection);background:#edf3ff;color:#173f96}.gwp-panel[data-tier-count="1"]{left:256px;top:226px;width:181px;min-height:199px}.artboard:has(.gwp-panel[data-tier-count="1"]) .footnote{left:256px;width:181px}.gwp-panel[data-tier-count="1"] .gift-row{width:169px}.gwp-panel[data-tier-count="1"] .tier-title{font-size:13px}.gwp-panel[data-tier-count="1"] .tier-reward{font-size:10px}
.artboard:has(.gwp-panel[data-tier-count="1"]) .logo-box{left:130px}.artboard:has(.gwp-panel[data-tier-count="1"]) .campaign-text{width:450px}.artboard:has(.gwp-panel[data-tier-count="1"]) .date-text{left:95px}.artboard:has(.gwp-panel[data-tier-count="1"]) .sku-zone{left:20px;width:216px}
:root[data-theme="dark"] .tier-count-switch button[aria-pressed="true"],:root[data-theme="dark"] .row-layout-switch button[aria-pressed="true"]{background:#273247;color:#fff}

/* Illustrator-measured export geometry (900x1200 values authored at 50%). */
.logo-box{left:45.75px;width:241px;height:50px}
.campaign-text{width:332.5px;letter-spacing:1.2px}
.date-text{left:36.25px;width:260px}
.gwp-panel{left:317.5px;border-radius:8px}
.footnote{left:317.5px}
.gwp-item{z-index:1}
.gwp-gift-tag{position:absolute;right:-3px;top:15px;width:20px;height:23.5px;z-index:0;object-fit:contain;pointer-events:none}
.gwp-gift-tag{pointer-events:auto;cursor:grab}.gwp-gift-tag.tag-front{z-index:4}.gwp-item{z-index:1}.gwp-gift-tag:active{cursor:grabbing}.gwp-gift-tag.selected{filter:drop-shadow(0 0 2px #2463eb) drop-shadow(0 0 1px #fff)}.tag-choices{display:grid;gap:6px}.tag-choices:empty{display:none}.tag-choice{display:flex;gap:5px;min-width:0}.tag-choice-select{flex:1;min-width:0}.tag-choice-eye{flex:none;width:38px;padding:0;font-size:14px;line-height:1;display:grid;place-items:center}.tag-choices .tag-choice-eye[aria-pressed="true"],:root[data-theme="dark"] .tag-choices .tag-choice-eye[aria-pressed="true"]{border-color:var(--line);box-shadow:none;background:var(--panel-raised);color:var(--muted)}.tag-choice-select:disabled{opacity:.55}.tag-choices button[aria-pressed="true"]{border-color:var(--selection);box-shadow:inset 0 0 0 1px var(--selection);background:#edf3ff;color:#173f96}.inspector #tagInspector{display:grid;gap:10px}
body.export-mode .gwp-gift-tag.selected{filter:none}
.artboard:has(.gwp-panel[data-tier-count="1"]) .logo-box{left:104.5px}
.gwp-panel[data-tier-count="1"] .gwp-gift-tag{right:7px;top:15px;width:27.5px;height:33.5px}
.head-actions{gap:8px!important}.action-group{display:flex;align-items:center;gap:5px;padding-left:8px;border-left:1px solid #555}.action-group:first-child{padding-left:0;border-left:0}.action-group.compact button{min-width:36px;padding-inline:7px}.review-actions{margin-left:auto}.issue{width:100%;min-height:0;text-align:left;border:0;cursor:default}.issue[data-navigable="true"]{cursor:pointer}.issue[data-navigable="true"]::after{content:"ไปแก้ →";float:right;margin-left:8px;font-size:11px;font-weight:700}.issue[data-navigable="true"]:hover{filter:brightness(.97)}
.issue-action{display:grid;gap:8px}.issue-action .issue-fix{width:100%;min-height:44px;background:var(--action-primary-bg);border-color:var(--action-primary-bg);font-weight:700}.issue-action .issue-fix:hover{background:var(--action-primary-bg-hover);border-color:var(--action-primary-bg-hover)}
@media(max-width:760px){.app-head .head-actions{display:flex;overflow-x:auto;align-items:stretch}.action-group{flex:none}.review-actions{margin-left:0}}
.resize-dot{right:-11px;width:24px;height:24px;border:0;background:transparent}.resize-dot::after{content:"";position:absolute;left:8px;top:8px;width:8px;height:8px;border-radius:50%;background:var(--selection);border:1px solid #fff}.gwp-item:focus-visible{outline:2px solid var(--focus-ring);outline-offset:3px}.ml-list{display:grid;gap:6px}.ml-row{display:flex;align-items:center;gap:6px;padding:4px;border:1px solid transparent;border-radius:8px}.ml-row-selected{border-color:var(--selection);background:#2463eb14}.ml-row input[type="text"]{flex:1;min-width:52px;padding:0 6px}.ml-tools{display:flex;gap:1px;flex:none}.ml-icon{min-height:32px;width:25px;padding:0;font-size:12px;line-height:1;display:grid;place-items:center}.ml-icon[aria-pressed="true"]{border-color:var(--selection);box-shadow:inset 0 0 0 1px var(--selection);background:#edf3ff;color:#173f96}:root[data-theme="dark"] .ml-icon[aria-pressed="true"]{background:#273247;color:#dbe8ff}.ml-icon-danger:not(:disabled){color:var(--danger)}.gwp-move-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.gwp-move-actions button{min-height:32px;padding:0;font-size:15px;line-height:1}
.field{display:grid;gap:5px}.field-label{color:var(--muted)}.label-fields{display:grid;gap:8px;align-items:start}.label-fields label,.label-fields .field{min-width:0}
.label-position-switch,.tag-layer-switch{display:grid;gap:4px}.label-position-switch{grid-template-columns:repeat(3,minmax(0,1fr))}.tag-layer-switch{grid-template-columns:repeat(2,minmax(0,1fr))}
.label-position-switch button,.tag-layer-switch button{min-height:32px;padding:0 4px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.label-position-switch button[aria-pressed="true"],.tag-layer-switch button[aria-pressed="true"]{border-color:var(--selection);box-shadow:inset 0 0 0 1px var(--selection);background:#edf3ff;color:#173f96}
:root[data-theme="dark"] .label-position-switch button[aria-pressed="true"],:root[data-theme="dark"] .tag-layer-switch button[aria-pressed="true"],:root[data-theme="dark"] .tag-choices button[aria-pressed="true"],:root[data-theme="dark"] .row-layout-switch button[aria-pressed="true"],:root[data-theme="dark"] .tier-count-switch button[aria-pressed="true"]{background:#273247;color:#dbe8ff}/* app dialogs use the shared .dialog shell from ui-base.css; only their widths differ.
   .version-modal/.version-dialog stays reserved for the changelog, per SHARED_HEADER.md. */
.shortcut-dialog{width:min(520px,100%)}.shortcut-grid{display:grid;grid-template-columns:max-content 1fr;gap:9px 14px;margin:18px 0;align-items:center}.shortcut-grid kbd{font:600 12px Scto;padding:5px 7px;border:1px solid var(--line);border-bottom-width:2px;border-radius:6px;background:var(--panel-raised)}.export-cancel-floating{position:fixed;right:18px;top:18px;z-index:60;min-height:44px;box-shadow:0 8px 28px #0007}body:not(.export-mode) .export-cancel-floating{display:none!important}@media(max-width:520px){.shortcut-grid{grid-template-columns:1fr}.shortcut-grid span{margin-bottom:5px}.export-cancel-floating{right:12px;top:12px}}
.inspector{min-width:0}.inspector>div,.asset-inspector,.section-head{min-width:0}.section-head strong,.asset-inspector strong,#gwpTitle,#skuInspectorTitle{min-width:0;overflow-wrap:anywhere;word-break:break-word}.asset-inspector{display:grid;gap:10px}.link-switch{display:grid;grid-template-columns:1fr 1fr;gap:6px}.link-switch button[aria-pressed="true"]{background:var(--selection);border-color:var(--selection);color:#fff}.canvas-selectable.selected{outline:2px solid var(--selection);outline-offset:2px}.canvas-selectable{border-radius:3px}.sku-zone img{transform-origin:center bottom}.zoom-controls{display:flex;align-items:center;gap:5px;flex-wrap:nowrap;min-width:0}
body.export-mode .canvas-selectable.selected{outline:none}
.preview-overlay{position:fixed;inset:0;z-index:80;display:flex;flex-direction:column;gap:10px;padding:12px;background:#0d0e11}
.preview-overlay[hidden]{display:none}
.preview-head{flex:none;display:flex;align-items:center;gap:12px;color:#fff}
.preview-head strong{font-size:16px}
.preview-head .hint{color:#c7cad1}
.preview-head button{margin-left:auto;min-height:34px;background:#2a2c30;color:#fff;border-color:#55585f}
.preview-grid{flex:1;min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden}
.preview-track{display:grid;grid-template-columns:repeat(var(--preview-cols,1),1fr);grid-auto-rows:max-content;gap:10px;width:var(--preview-track-w,100%);max-width:100%}
.preview-tile{display:grid;gap:3px;width:100%;min-width:0;margin:0;align-content:start}
.preview-label{display:flex;gap:6px;align-items:baseline;color:#fff;font-size:12px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.preview-label b{flex:none;min-width:18px;height:18px;display:grid;place-items:center;padding:0 4px;border-radius:999px;background:#f50a3c;color:#fff;font-size:11px}
.preview-label span{overflow:hidden;text-overflow:ellipsis}
.preview-tile img{width:100%;aspect-ratio:3/4;object-fit:contain;background:#fff;border-radius:3px}
.preview-empty{color:#fff;text-align:center;align-self:center;justify-self:center}
@font-face{font-family:SctoMedium;src:url('/static/fonts/Scto Grotesk B Medium.otf')}
.split-dialog{width:min(560px,100%)}
.split-list{display:grid;gap:8px;max-height:52vh;overflow:auto;margin:12px 0}
.split-row{display:grid;grid-template-columns:auto 78px minmax(0,1fr);gap:10px;align-items:center;border:1px solid var(--line);border-radius:9px;padding:8px}
.split-row img{width:78px;height:100px;object-fit:contain;background:#f3f4f6;border-radius:6px}
.split-row input[type=checkbox]{width:auto}
.split-fields{display:grid;gap:5px;min-width:0}
.split-fields label{display:grid;gap:3px;font-size:12px}
.split-warn{color:var(--warning);font-size:12px}
:root[data-theme="dark"] .split-row img{background:#26282d}
.split-row img.split-label-shot{width:auto;max-width:100%;height:26px;object-fit:contain;object-position:left center;background:#fff;border:1px solid var(--line);border-radius:5px;padding:2px 4px}

/* Saved jobs list: checkbox multi-select, matching the overlay and strip banner tools. */
.saved-jobs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-height:min(52vh,420px);padding:2px;overflow:auto}
.saved-jobs-head,.saved-jobs-foot{display:flex;align-items:center;gap:9px;padding:9px 10px;border-radius:8px;background:var(--panel-raised)}
.saved-jobs-head{margin-bottom:8px;cursor:pointer}
.saved-jobs-foot{margin-top:8px;justify-content:space-between}
.saved-jobs-count{color:var(--muted);font-size:12px;font-weight:700}
.saved-job-row{display:grid;grid-template-columns:24px minmax(0,1fr) 28px;align-items:center;gap:4px;padding:6px;border:1px solid var(--line);border-radius:9px;background:var(--panel)}
.saved-job-row.active{border-color:var(--selection);box-shadow:inset 0 0 0 1px var(--selection)}
.saved-job-row:hover{background:var(--panel-raised)}
.saved-job-check,#savedJobsSelectAll{width:16px;height:16px;margin:auto;accent-color:var(--selection)}
.saved-job-load{display:grid;gap:2px;min-width:0;min-height:0;padding:8px 4px;border:0;background:transparent;color:var(--ink);text-align:left}
.saved-job-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
.saved-job-time{color:var(--muted);font-size:11px}
.saved-job-delete{width:28px;height:28px;min-height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--muted);font-size:15px;line-height:1}
.saved-job-delete:hover{background:#f50a3c1a;color:var(--danger)}
.saved-jobs-empty{padding:22px 10px;color:var(--muted);text-align:center}
.job-name-input{min-width:200px;max-width:260px;height:36px;padding:0 10px;border:1px solid #555;border-radius:8px;background:#2a2a2e;color:#fff;font-weight:700}
.job-name-input::placeholder{color:#9aa0aa}
.job-name-input:focus-visible{outline:2px solid var(--focus-ring);outline-offset:1px}
@media(max-width:760px){.job-name-input{min-width:0;max-width:none;width:100%}}

/* Logo may exceed its frame: some uploads carry their own padding. */
.logo-box img{flex:none;max-width:none;max-height:none;width:100%;height:100%}
.logo-box img[hidden],.logo-box img:not([src]){display:none}
/* Condition copy takes up to two lines. */
.tier-reward{height:auto;min-height:21px;max-height:30px;line-height:13px;white-space:pre-wrap;overflow:hidden;display:grid;align-content:center}
.preview-head #previewCols{margin-left:auto}
.preview-head #previewSheet{margin-left:0}
.preview-head #previewCols[aria-pressed="true"]{border-color:var(--selection);box-shadow:inset 0 0 0 1px var(--selection)}
.preview-overlay.cols-fixed .preview-grid{align-items:flex-start;overflow-y:auto}
.app-head button{white-space:nowrap}
@media(max-width:1050px){.saved-jobs{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.saved-jobs{grid-template-columns:1fr}}
.action-group.compact #shortcutHelpBtn{padding-inline:10px;font-weight:600}
/* A promo without a campaign name lifts the date into its place. */
.campaign-text[hidden]{display:none}
.artboard.campaign-off .date-text{top:122px}
.campaign-switch{display:grid;grid-template-columns:1fr 1fr;gap:4px}
.campaign-switch[hidden]{display:none}
.confirm-dialog{width:min(420px,100%)}
.confirm-message{margin:14px 0 0;white-space:pre-line;color:var(--muted)}
/* .toast-dock, .toast, .toast-action and .toast-close now come from ui-base.css */
body.export-mode .toast-dock{display:none}
.drop-caret{position:absolute;top:2px;bottom:2px;width:2px;border-radius:2px;background:var(--selection);box-shadow:0 0 0 1px #fff;pointer-events:none;z-index:5}
.zoom-input{width:58px}
.snap-guide{position:absolute;top:0;bottom:0;width:1px;background:#ff2d95;pointer-events:none;z-index:6}
body.export-mode .snap-guide{display:none}
/* The rail is a fixed 190px and this row was running at 159 of 166 usable px, so any font that
   measures wider than Segoe UI pushed the hint out. Thai has few break opportunities, so the
   flex item's automatic min-width was larger than the space available and it refused to shrink.
   min-width:0 lets it shrink, and wrapping catches whatever is left. */
.layers-head{margin-top:4px}
.layers-head strong{flex:none}
.layers-head .hint{flex:1 1 auto;min-width:0;font-size:10px;text-align:right;overflow-wrap:anywhere}
.layers-tree{display:grid;gap:2px;max-height:280px;overflow:auto;padding-right:2px}
.layer-row{display:flex;align-items:center;gap:2px;border-radius:6px;min-width:0}
.layer-row.depth-1{padding-left:10px}
.layer-row.depth-2{padding-left:20px}
.layer-row.layer-muted .layer-name{opacity:.55}
.layer-row.layer-selected{background:#2463eb1f;box-shadow:inset 0 0 0 1px var(--selection)}
.layer-name{flex:1;min-width:0;min-height:28px;padding:2px 6px;border:0;background:transparent;text-align:left;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.layer-eye,.layer-remove{flex:none;width:26px;min-height:26px;padding:0;border:0;background:transparent;font-size:12px;line-height:1;color:var(--muted)}
.layer-eye:hover,.layer-remove:hover{background:#2463eb18;border-radius:6px}
.layer-remove:hover{color:var(--danger)}
.gwp-item.selected-extra{filter:drop-shadow(0 0 2px var(--selection)) drop-shadow(0 0 4px var(--selection))}
.separator-switch{display:grid;grid-template-columns:1fr 1fr;gap:4px}
.separator-switch button{min-height:32px;font-size:12px}
.separator-switch button[aria-pressed="true"]{border-color:var(--selection);box-shadow:inset 0 0 0 1px var(--selection);background:#edf3ff;color:#173f96}
:root[data-theme="dark"] .separator-switch button[aria-pressed="true"]{background:#273247;color:#dbe8ff}
#separatorText{margin-top:6px}
.tier-move{display:grid;grid-template-columns:1fr 1fr;gap:4px}
.tier-move button{min-height:32px;font-size:12px}
.layer-move{flex:none;width:22px;min-height:26px;padding:0;border:0;background:transparent;color:var(--muted);font-size:11px;line-height:1}
.layer-move:hover:not(:disabled){background:#2463eb18;border-radius:6px;color:var(--ink)}
.layer-move:disabled{opacity:.3}
.promo-export-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:6px}
.promo-export-actions .promo-export{margin-top:0}
.promo-export-svg{width:100%;min-height:32px;font-size:12px}

/* ---- CCT-0117 ----
   Row separator: the rule lines belong to the GWP drop frame, not the whole panel.
   The frame is 100px normally and 169px in the one-tier layout, so both the frame and
   the separator read the same custom property and cannot drift apart. */
.gwp-panel{--gwp-row-w:100px}
.gwp-panel[data-tier-count="1"]{--gwp-row-w:169px}
.row-separator{width:var(--gwp-row-w);margin-inline:auto}

/* Segmented switches adopt the Strip Banner pill: one rounded track with the active
   segment filled in the action colour. Same value Strip Banner uses, via ui-base. */
.tier-count-switch,
.row-layout-switch,
.separator-switch,
.tag-layer-switch,
.label-position-switch,
.link-switch,
.campaign-switch{
  display:flex;
  gap:0;
  /* the track used to be padded 3px and outlined in the same red as the filled segment, so the
     pressed pill and the track edge merged into one shape and read as two buttons colliding. */
  padding:4px;
  border:1.5px solid var(--line);
  border-radius:999px;
  background:var(--panel-raised);
  box-shadow:inset 0 1px 2px rgb(0 0 0 / 6%);
  overflow:hidden;
}
.tier-count-switch button,
.row-layout-switch button,
.separator-switch button,
.tag-layer-switch button,
.label-position-switch button,
.link-switch button,
.campaign-switch button{
  flex:1 1 0;
  min-width:0;
  min-height:32px;
  padding:5px 6px;
  border:0;
  border-radius:999px;
  background:transparent;
  color:var(--muted);
  font-weight:700;
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  box-shadow:none;
  transition:color var(--dur-1,120ms) var(--ease-out,ease),background var(--dur-1,120ms) var(--ease-out,ease);
}
.tier-count-switch button:hover:not(:disabled),
.row-layout-switch button:hover:not(:disabled),
.separator-switch button:hover:not(:disabled),
.tag-layer-switch button:hover:not(:disabled),
.label-position-switch button:hover:not(:disabled),
.link-switch button:hover:not(:disabled),
.campaign-switch button:hover:not(:disabled){background:transparent;color:var(--ink)}
/* the pressed segment, in both themes: the dark-theme rules further up target the same
   selector, so these have to come last to win */
.tier-count-switch button[aria-pressed="true"],
.row-layout-switch button[aria-pressed="true"],
.separator-switch button[aria-pressed="true"],
.tag-layer-switch button[aria-pressed="true"],
.label-position-switch button[aria-pressed="true"],
.link-switch button[aria-pressed="true"],
.campaign-switch button[aria-pressed="true"],
:root[data-theme="dark"] .tier-count-switch button[aria-pressed="true"],
:root[data-theme="dark"] .row-layout-switch button[aria-pressed="true"],
:root[data-theme="dark"] .separator-switch button[aria-pressed="true"],
:root[data-theme="dark"] .tag-layer-switch button[aria-pressed="true"],
:root[data-theme="dark"] .label-position-switch button[aria-pressed="true"],
:root[data-theme="dark"] .link-switch button[aria-pressed="true"],
:root[data-theme="dark"] .campaign-switch button[aria-pressed="true"]{
  background:var(--action-primary-bg);
  color:var(--action-primary-fg);
  border-color:transparent;
  box-shadow:none;
}
.tier-count-switch button:disabled,
.row-layout-switch button:disabled,
.separator-switch button:disabled,
.tag-layer-switch button:disabled,
.label-position-switch button:disabled,
.link-switch button:disabled,
.campaign-switch button:disabled{opacity:.4}
.row-layout-switch button span{font-size:14px;line-height:1}

/* Canvas toolbar: one row at every width.
   It used to inherit the canvas zoom, so at 140% it enlarged its own text until the row
   wrapped, and at the mobile fit zoom it shrank its buttons to 23px. It is UI, not artwork,
   so only .artboard scales now and these sizes stay fixed. Placed at the end of the file
   on purpose: the earlier width and wrap rules live inside @media(max-width:760px). */
.canvas-toolbar{width:min(700px,100%);flex-wrap:nowrap;gap:8px;font-size:12px}
.canvas-toolbar button{min-height:30px;padding:2px 9px;font-size:12px;white-space:nowrap;flex:none}
.zoom-controls{flex-wrap:nowrap;gap:4px;min-width:0}
.zoom-controls .value-input{width:52px}
#panelMeter{white-space:nowrap;flex:none;text-align:right}

/* One row is right where there is room for one. At phone widths there is not: the zoom controls, the
   two export buttons and the meter measure 497px together and refuse to shrink, so the toolbar pushed
   past a 390px viewport and the canvas area grew its own sideways scrollbar to hide it (Bird's Kerastase
   job at 390px, document.scrollWidth 437). Below the mobile breakpoint the row is allowed to become two
   and its parts are allowed to shrink; nothing above that breakpoint changes. */
@media(max-width:760px){
  .canvas-toolbar{flex-wrap:wrap;row-gap:6px;max-width:100%}
  .canvas-toolbar>*{min-width:0}
  .zoom-controls{flex:1 1 100%;flex-wrap:wrap}
  #panelMeter{flex:1 1 100%;text-align:left}
}

/* Rail hardening: the rail is a fixed 190px and its flex/grid children default to
   min-width:auto, so Thai text — which offers few break opportunities — refused to shrink
   and pushed straight out of the panel instead. Everything here just allows shrinking.
   Found by sweeping the rail at increasing font widths: it used to break from 120%. */
.section-head strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.section-head button{flex:0 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* the promo icons are fixed 32px squares; at very large fonts the name has to give way
   before they do, otherwise the row cannot fit inside a 190px rail at all */
.promo-card-head .promo-name{flex:1 1 0}
.promo-list{min-width:0}
.promo-card{min-width:0;overflow:hidden}
.promo-export-actions{min-width:0}
.promo-export-actions>*{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* the rail is 190px wide: two buttons side by side leave ~48px for text after the shared 12px padding, and Mac fonts run wider, so "All JPG" clipped to "All…" */
.promo-export-actions>button{padding-left:4px;padding-right:4px}
.layers-tree{min-width:0}
.template-drop{min-width:0;overflow:hidden}
.template-drop strong,.template-drop small{overflow-wrap:anywhere}

/* ---- Secondary toolbar (SHARED_SECONDARY_TOOLBAR.md) ----
   This bar is the pattern that contract describes, so it has to match it: same 58px height,
   the same #202124 as the Shared Header rather than its own darker #171719, and the same
   hairline divider. It sticks at top:0, not below the header: the Shared Header is not
   sticky in any tool, so anchoring at 52px would leave an empty band once it scrolls away.
   The 58px height is fixed by contract because the rail, canvas viewport and utility
   popover all compute their offsets from 52+58. */
.app-head{background:#202124;position:sticky;top:0;z-index:50;box-shadow:inset 0 -1px 0 rgb(255 255 255 / 6%)}

/* ---- Shared command-button metrics (SHARED_UI_BASE.md) ----
   Scoped to the chrome containers, never the bare element: everything on the artboard —
   .row-tools, .gwp-*, the resize dots — lives inside #artboard and cannot be reached from
   here, which is the invariant the contract protects.

   :where() keeps the specificity at 0,0,1, the same as a bare element selector, so every
   control that declares its own size further up this file still wins without needing an
   opt-out list. An earlier attempt used an explicit opt-out block with `revert`, which is
   wrong: `revert` drops to the user-agent value rather than the previous author rule, so it
   would have wiped those sizes rather than restoring them. */
:where(.app-head, .rail, .inspector, .sku-dock, .utility-popover) button{
  min-height:36px;
  border-radius:7px;
  padding:8px 12px;
  font-weight:650;
}

/* 1-Tier balance: the whole block sat 60 artwork px from the top and 240 from the bottom, so it
   read as pinned to the ceiling. Shifting every 1-Tier element down 30 (=60 artwork px) leaves
   90/90 above and below. Only the 1-Tier layout moves; 2- and 3-Tier keep their approved geometry. */
.artboard:has(.gwp-panel[data-tier-count="1"]) .logo-box{top:90px}
.artboard:has(.gwp-panel[data-tier-count="1"]) .campaign-text{top:152px}
.artboard:has(.gwp-panel[data-tier-count="1"]) .date-text{top:182px}
.artboard:has(.gwp-panel[data-tier-count="1"]) .sku-zone{top:224px}
.gwp-panel[data-tier-count="1"]{top:256px}

/* the locked 1-Tier frame only holds if the product may draw outside it: max-height:100% would
   clamp an enlarged product back to the frame instead of letting it overflow. */
.gwp-panel[data-tier-count="1"] .gwp-item img{max-height:none}

/* with the campaign name off, the date takes the campaign's slot - the 1-Tier layout needs its
   own value because its whole block sits 30 lower than the 2/3-Tier one. */
.artboard.campaign-off:has(.gwp-panel[data-tier-count="1"]) .date-text{top:152px}

/* First Image context sections consume shared fields/buttons without redefining primitives. */
.inspector .inspector-context{display:grid;gap:10px;border-top:1px solid var(--line);padding-top:12px;margin-top:12px}
.inspector .inspector-context .hint{margin:0}
.inspector #textInspectorTitle,.inspector #tagInspectorTitle{white-space:normal;overflow-wrap:anywhere}
.gift-row.row-selected{outline:1px solid var(--selection);outline-offset:-1px}
body.export-mode .gift-row.row-selected{outline:none}

#splitOriginal{margin-right:auto}
.tier-delete{flex:none;min-height:28px;padding:0 10px;font-size:12px}
.tier-delete:hover:not(:disabled){border-color:var(--danger,#e5484d);color:var(--danger,#e5484d)}
.tier-delete:disabled{opacity:.35}

/* CCT-0198 First Image Stack ------------------------------------------------------------------
   Artboard units are half of the 900x1200 output. Sample: panel x575 w300 r16, title bars 51px,
   left column centred on x287.5 so the wider panel fits. Height ceiling = spec panel.max_h. */
.artboard.mode-stack .logo-box{left:23.25px}
.artboard.mode-stack .campaign-text{left:13.75px;width:260px}
.artboard.mode-stack .date-text{left:13.75px;width:260px}
.artboard.mode-stack .sku-zone{left:29px;width:229.5px}
.artboard.mode-stack .gwp-panel{left:287.5px;top:60px;width:150px;min-height:0;border-radius:8px;background:#eeeced;display:flex;flex-direction:column}
.artboard.mode-stack .footnote{left:287.5px;width:150px}
.stack-step{display:flex;flex-direction:column}
.stack-bar{height:25.5px;flex:none;background:#000;display:grid;place-items:center;border-radius:0}
.stack-step:first-child .stack-bar{border-radius:8px 8px 0 0}
.stack-bar-text{color:#fff;font:13px Scto,NotoThai;line-height:1;white-space:nowrap}
.stack-body{display:flex;flex-direction:column;align-items:center;padding:4px 6px 5px;gap:2px}
.stack-value{display:flex;align-items:flex-start;justify-content:center;line-height:1}
.stack-value-lead,.stack-value-number,.stack-final-lead,.stack-final-number{font:25px Scto,NotoThai;line-height:25px;color:#000;white-space:nowrap}
.stack-value-star{font:10px Scto,NotoThai;line-height:10px;color:#000;margin-left:1px}
.stack-value-empty{font:10px NotoThai;line-height:25px;color:#9aa0aa}
.stack-sub,.stack-gift-text{font:9px Scto,NotoThai;line-height:12px;color:#333;text-align:center}
.stack-banks{display:flex;align-items:center;justify-content:center;gap:3px;margin-top:4px;height:8.5px}
.stack-bank{height:8.5px;width:auto;display:block}
.stack-gift{position:relative;width:100%;height:56px;display:flex;align-items:center;justify-content:center}
.stack-gift-image{max-width:80px;max-height:56px;object-fit:contain;display:block}
.stack-gift-empty{font:9px NotoThai;color:#9aa0aa;outline:1px dashed #9aa0aa;padding:18px 10px;border-radius:2px}
.stack-gift-tag{position:absolute;left:calc(50% + 28px);top:7px;width:20px;height:23.5px}
.stack-final-lead,.stack-final-number{color:#e4002b}
.stack-full{position:relative;display:flex;justify-content:center}
.stack-full-text{font:9px Scto,NotoThai;line-height:12px;color:#333}
.stack-strike{position:absolute;left:0;right:0;top:50%;height:.75px;background:#333;display:block}
body.export-mode .stack-value-empty,body.export-mode .stack-gift-empty{visibility:hidden}
/* inspector: the GWP tier tools mean nothing for a stack */
.app-stack .sku-title-tier,.app-stack .sku-title-field,.app-stack .tier-count-control,.app-stack #tierInspector,.app-stack #gwpInspector,.app-stack #tagInspector{display:none!important}
.stack-inspector{display:grid;gap:8px;padding-bottom:10px;border-bottom:1px solid var(--line)}
.stack-inspector[hidden]{display:none}
.stack-card{display:grid;gap:8px;padding:8px 10px;border:1px solid var(--line);border-radius:9px}
.stack-card.is-off{opacity:.7}
.stack-card-body{display:grid;gap:8px}
.stack-field{display:grid;gap:4px}
.stack-amount{display:grid;grid-template-columns:1fr auto;gap:6px;align-items:center}
.stack-unit{display:grid;grid-template-columns:1fr 1fr;gap:4px}
.stack-unit button{min-width:34px;min-height:30px;padding:0 8px}
.stack-unit button[aria-pressed="true"]{border-color:var(--selection);box-shadow:inset 0 0 0 1px var(--selection);background:#edf3ff;color:#173f96}
.stack-unit-fixed{padding:0 10px;font-weight:600}
.stack-toggle{display:flex;align-items:center;gap:8px;cursor:pointer;position:relative;user-select:none}
.stack-toggle input{position:absolute;opacity:0;width:1px;height:1px}
.stack-toggle-track{flex:none;width:30px;height:17px;border-radius:9px;background:var(--line);position:relative;transition:background-color .12s ease}
.stack-toggle-track::after{content:"";position:absolute;left:2px;top:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0004;transition:transform .12s ease}
.stack-toggle input:checked+.stack-toggle-track{background:var(--selection)}
.stack-toggle input:checked+.stack-toggle-track::after{transform:translateX(13px)}
.stack-toggle input:focus-visible+.stack-toggle-track{outline:2px solid var(--selection);outline-offset:2px}
.stack-toggle input:disabled+.stack-toggle-track{opacity:.5;cursor:not-allowed}
.stack-card-head .stack-toggle-label{font-weight:700}
.stack-banks-switch{display:grid;grid-template-columns:1fr 1fr;gap:6px 10px}
.stack-gift-pick{display:flex;gap:6px;flex-wrap:wrap}
.app-mode-switch{display:inline-flex;gap:2px;margin:0 8px;padding:2px;border:1px solid var(--line);border-radius:8px;vertical-align:middle}
.app-mode-switch a{padding:2px 10px;border-radius:6px;color:inherit;text-decoration:none;font-size:12px}
:root:not(.app-stack) .app-mode-switch [data-app-mode="first"],.app-stack .app-mode-switch [data-app-mode="stack"]{background:var(--selection);color:#fff}

/* CCT-0198 Template promo in a Stack job: price block laid over the template's own stack */
.app-stack .artboard.mode-template .sku-zone{left:29px;width:229.5px}
.template-price{position:absolute;inset:0;pointer-events:none;z-index:3}
.template-price[hidden]{display:none}
.tpl-cover{position:absolute;background:#fff}
.tpl-price-panel{position:absolute;border-radius:0 0 8px 8px;display:flex;flex-direction:column}
.tpl-price-panel .stack-bar{border-radius:0}
.tpl-remark{position:absolute;text-align:center;font:9px NotoThai;line-height:12px;color:#000}
.sku-price-fields{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:4px 0}
.sku-price-fields label{display:grid;gap:2px;font-size:11px}
.sku-price-fields input{min-width:0}

/* CCT-0198 one colour per Stack step, shared by the inspector card and the step on the canvas (editor only) */
.stack-card[data-kind="cart"],.stack-step[data-kind="cart"]{--step-color:#2463eb}
.stack-card[data-kind="coupon"],.stack-step[data-kind="coupon"]{--step-color:#ea580c}
.stack-card[data-kind="card"],.stack-step[data-kind="card"]{--step-color:#7c3aed}
.stack-card[data-kind="gift"],.stack-step[data-kind="gift"]{--step-color:#db2777}
.stack-card[data-kind="price"],.stack-step[data-kind="price"],.stack-card[data-kind="template-price"]{--step-color:#059669}
.stack-card{border-left:4px solid var(--step-color,var(--line));transition:box-shadow .15s ease,background-color .15s ease}
.stack-card .stack-card-head{color:var(--step-color)}
.stack-card .stack-toggle input:checked+.stack-toggle-track{background:var(--step-color,var(--selection))}
.stack-card.is-focused{box-shadow:0 0 0 2px var(--step-color);background:color-mix(in srgb,var(--step-color) 10%,transparent)}
.gwp-panel .stack-step{cursor:pointer;position:relative}
.gwp-panel .stack-step:hover::after,.gwp-panel .stack-step.is-focused::after{content:"";position:absolute;inset:0;border:1.5px solid var(--step-color);border-left-width:4px;pointer-events:none}
.gwp-panel .stack-step:not(.is-focused):hover::after{opacity:.55}
body.export-mode .gwp-panel .stack-step::after{display:none!important}
/* room below the last section so any section can be scrolled to the top of the panel */
.app-stack .inspector::after{content:"";display:block;flex:none;height:85vh}
