.text-adjust-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}.text-adjust-row label{min-width:0}.text-adjust output{float:right;color:var(--blue)}.text-adjust input[type=range]{padding:0!important;accent-color:var(--blue);height:30px}.text-adjust-actions{display:flex;gap:8px}.text-adjust-actions button{border:1px solid #cdd4ec;border-radius:6px;background:white;color:var(--blue);padding:10px;font-size:12px;min-height:40px}.text-adjust-actions button[aria-pressed=true]{background:var(--blue);color:white}#textDragHint{font-size:11px;line-height:1.5;color:#626779;margin:8px 0}.dragging-text canvas{cursor:move!important}
/* A bounded workspace keeps the product and purchase action in view. */
#customDialog{width:1180px;height:min(860px,94dvh);max-height:94dvh;padding:0;overflow:hidden}
#customForm{height:100%;display:grid;grid-template:64px minmax(0,1fr) auto / minmax(0,1fr);gap:0}
.studio-header{padding:18px 64px 14px 24px;border-bottom:1px solid var(--line)}
.studio-header h2{margin:0;font-size:21px;letter-spacing:-.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.studio-workspace{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(350px,1fr);min-height:0;overflow:hidden}
#customForm .preview-side{padding:16px 22px;border-radius:0;display:flex;flex-direction:column;align-items:center;min-height:0;overflow:hidden;gap:8px}
#customForm .view-tabs{margin:0;align-self:stretch;flex-shrink:0}
#customForm .preview{width:min(100%,calc(94dvh - 350px),490px);max-width:none;flex-shrink:1;min-height:100px;aspect-ratio:1;margin:0 auto}
#customForm .edit-tools{width:100%;text-align:center}
#customForm #editHint{margin:0;font-size:11px;line-height:1.5}
#customForm .edit-tools .edit-actions{justify-content:center;margin-top:5px}
#customForm .preview-options{margin:0;gap:5px;flex-direction:row;flex-wrap:wrap;justify-content:center}
#customForm .preview-options span{font-size:10px;padding:4px 7px}
#customForm #mockupStatus{margin:0;font-size:10px;line-height:1.4;text-align:center}
.studio-tools{display:flex;flex-direction:column;min-height:0;background:white;border-left:1px solid var(--line)}
.studio-tabs{display:flex;gap:6px;padding:12px 18px;border-bottom:1px solid var(--line);flex-shrink:0}
.studio-tabs button{flex:1;background:#f1f3fa;color:#687087;border-radius:7px;padding:11px;font-size:13px}
.studio-tabs button[aria-selected=true]{background:var(--navy);color:white}
.studio-panels{overflow:auto;overscroll-behavior:contain;min-height:0;padding:4px 20px 18px;scrollbar-gutter:stable}
#customForm .studio-panel>label{margin:12px 0}
#customForm .studio-panel fieldset{margin:14px 0}
#customForm .text-palette .swatches{gap:10px}
#customForm .font-sample{font-size:21px;line-height:1.4;margin:6px 0}
#customForm select{font:inherit;width:100%;padding:9px;border:1px solid #d9dce6;border-radius:5px;background:white}
.studio-fold{border-top:1px solid var(--line);margin-top:14px;padding-top:12px;font-size:12px}
.studio-fold summary{cursor:pointer;font-weight:600;padding:4px 0 10px;color:var(--navy)}
#customForm #wrapTools{padding:0;border:0;margin-top:10px}
#customForm #wrapStrip{max-height:200px;object-fit:contain}
#customForm #tumblerSpecs{padding:0;background:none;border:0;margin:0}
#customForm #tumblerSpecs strong{display:none}
.studio-panel>p{font-size:12px;line-height:1.7;color:var(--muted)}
.studio-footer{padding:12px 24px;border-top:1px solid var(--line);background:white;display:grid;grid-template-columns:1fr auto;gap:4px 24px;align-items:center}
.studio-footer .purchase-row{justify-content:start;gap:24px}
.studio-footer .purchase-row strong{font-size:21px;margin-top:3px}
.studio-footer .unit-price strong{font-size:15px}
.studio-footer>.button{width:auto;min-width:230px;padding:15px 22px}
.studio-footer .error{grid-column:1/-1;margin:0;font-size:12px;max-height:40px;overflow:auto}
@media(max-width:700px){
 #customDialog{width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;border-radius:0}
 #customForm{grid-template-rows:48px minmax(0,1fr) auto}
 .studio-header{padding:13px 52px 10px 16px}.studio-header h2{font-size:17px}
 .studio-workspace{grid-template: minmax(170px,34dvh) minmax(0,1fr) / minmax(0,1fr)}
 #customForm .preview-side{padding:7px 12px;gap:4px}
 #customForm .preview{width:min(100%,calc(34dvh - 87px));min-height:70px;max-width:none;margin:0}
 #customForm .view-tabs{width:100%;max-width:390px;align-self:center}
 #customForm .view-tabs button{padding:6px;font-size:11px}
 #customForm #editHint{font-size:9px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #customForm .preview-options,#customForm #mockupStatus{display:none}
 #customForm .edit-tools .edit-actions{margin:2px 0 0;gap:4px}
 #customForm .edit-tools .edit-actions button{padding:4px 8px;font-size:10px}
 .studio-tools{border-left:0;border-top:1px solid var(--line)}
 .studio-tabs{padding:7px 12px;gap:6px}.studio-tabs button{padding:8px;font-size:12px}
 .studio-panels{padding:0 16px 14px}
 .studio-footer{padding:9px 12px max(9px,env(safe-area-inset-bottom));gap:3px 10px}
 .studio-footer .unit-price{display:none}.studio-footer .purchase-row strong{font-size:18px}
 .studio-footer>.button{min-width:0;font-size:12px;padding:13px 14px}
 #customForm .studio-panel>label{margin:10px 0}
}
@media(max-width:700px){
 .studio-workspace{grid-template-rows:clamp(160px,27dvh,225px) minmax(0,1fr)}
 #customForm .preview-side{display:grid;grid-template-columns:minmax(0,1fr) 110px;grid-template-rows:1fr auto;gap:4px 8px;padding:6px 12px}
 #customForm .preview{grid-column:1;grid-row:1/3;width:min(100%,calc(27dvh - 12px),213px);height:auto;min-height:0;justify-self:center;align-self:center}
 #customForm .view-tabs{grid-column:2;grid-row:1;display:flex;flex-direction:column;gap:4px;width:100%;margin:0;align-self:center}
 #customForm .view-tabs button{flex:none;min-height:36px;padding:7px 4px;font-size:11px}
 #customForm .edit-tools{grid-column:2;grid-row:2;align-self:end}
 #customForm #editHint{display:none}
 #customForm .edit-tools .edit-actions{display:grid;grid-template-columns:1fr 1fr;gap:3px;margin:0}
 #customForm .edit-tools .edit-actions button{min-height:28px;padding:4px 2px;font-size:9px}
 #customForm #resetView{grid-column:1/-1}
 #customForm .studio-panel>label{margin:8px 0;font-size:12px}
 #customForm .studio-panel input:not([type=radio]):not([type=range]):not([type=checkbox]),#customForm .studio-panel select{font-size:16px;min-height:42px;padding:8px 10px;margin-top:5px}
 #customForm .studio-panel input[type=file]{font-size:12px;min-height:44px}
 #customForm .studio-panel fieldset{margin:8px 0}
 #customForm .text-palette .swatches{gap:0 2px;display:grid;grid-template-columns:repeat(6,44px);justify-content:space-between}
 #customForm .text-palette .swatches label{width:44px;height:40px;display:grid;place-items:center;margin:0}
 #customForm .text-palette .swatches span{width:27px;height:27px}
 #customForm .font-sample{display:none}
 .studio-tabs{padding:5px 12px}.studio-tabs button{min-height:40px}
 .studio-footer>.button{min-height:44px}
}
@media(max-width:700px) and (max-height:550px){
 .studio-workspace{grid-template: minmax(0,1fr) / 38% minmax(0,1fr)}
 #customForm .preview-side{display:flex;padding:6px;gap:5px;justify-content:center}
 #customForm .view-tabs{flex-direction:row;max-width:100%;gap:2px}
 #customForm .view-tabs button{flex:1;min-height:32px;font-size:9px}
 #customForm .preview{width:min(100%,calc(100dvh - 235px))}
 #customForm .edit-tools .edit-actions{display:flex;justify-content:center}
 .studio-panels{padding:0 10px 10px}
 #customForm .text-palette .swatches{grid-template-columns:repeat(6,minmax(24px,1fr))}
 #customForm .text-palette .swatches label{width:100%}
}
@media(max-width:700px) and (min-height:551px){
 .studio-workspace{grid-template-rows:clamp(190px,29dvh,235px) minmax(0,1fr)}
 #customForm .preview-side{grid-template-rows:minmax(0,1fr) 60px}
 #customForm .preview{width:min(100%,calc(29dvh - 12px),223px)}
 #customForm .view-tabs button{min-height:32px;padding:5px 4px}
}
/* Product-first preview: controls sit below the image, leaving its full width. */
#customDialog{width:1280px;height:min(960px,96dvh);max-height:96dvh}
.studio-workspace{grid-template-columns:minmax(0,1.55fr) minmax(350px,1fr)}
#customForm .preview-side{position:relative!important;padding:12px 18px;gap:6px}
#customForm .preview{width:min(100%,calc(96dvh - 280px),620px)}
.preview-enlarge{position:absolute;top:60px;left:26px;z-index:8;background:#ffffffeb;color:var(--navy);border:1px solid #d8ddef;border-radius:8px;padding:9px 11px;font-size:12px;min-height:40px}
#customForm.preview-expanded .studio-workspace{grid-template: minmax(0,1fr) / minmax(0,1fr)}
#customForm.preview-expanded .studio-tools{display:none}
#customForm.preview-expanded .preview{width:min(100%,calc(96dvh - 255px),760px)}
#customForm.preview-expanded .view-tabs{max-width:520px;align-self:center;width:100%}
@media(max-width:700px) and (min-height:551px){
 #customDialog{width:100%;height:100dvh;max-height:100dvh}
 #customForm .studio-workspace{grid-template: minmax(230px,43dvh) minmax(0,1fr) / minmax(0,1fr)}
 #customForm .preview-side{display:flex;flex-direction:column;justify-content:center;padding:6px 10px;gap:5px}
 #customForm .preview{order:0;width:min(calc(100vw - 20px),calc(43dvh - 55px));margin:0;flex-shrink:0}
 #customForm .view-tabs{order:1;display:flex;flex-direction:row;align-self:center;max-width:420px;width:100%;gap:5px}
 #customForm .view-tabs button{flex:1;min-height:38px;padding:7px 4px}
 #customForm .edit-tools{position:absolute;right:12px;top:8px;width:auto;max-width:78px}
 #customForm .edit-tools .edit-actions{display:flex;flex-direction:column;gap:4px}
 #customForm .edit-tools .edit-actions button{min-height:30px;padding:6px;font-size:9px}
 .preview-enlarge{top:8px;left:12px;font-size:10px;padding:7px;min-height:34px}
 #customForm.preview-expanded .studio-workspace{grid-template:minmax(0,1fr) / minmax(0,1fr)}
 #customForm.preview-expanded .preview{width:min(calc(100vw - 20px),calc(100dvh - 230px))}
 #customForm.preview-expanded .preview-side{justify-content:center}
 #customForm.preview-expanded .preview-enlarge{font-size:12px}
}
@media(max-width:700px) and (max-height:550px){
 #customDialog{height:100dvh;max-height:100dvh}
 #customForm .preview{width:min(100%,calc(100dvh - 225px))}
 .preview-enlarge{top:3px;left:5px;font-size:9px;min-height:28px;padding:5px}
 #customForm.preview-expanded .preview{width:min(100%,calc(100dvh - 230px))}
}
.product-image.reference-shirt,#previewBase.reference-shirt{background-image:none!important;position:relative;background-color:#f5f5f5}.product-image.reference-shirt::before{content:'';position:absolute;inset:0 16.6667%;background-image:url('assets/shirt-supplier-front-back.jpg');background-size:200% 100%;background-position:var(--shirt-face,0%) 0}
.size-table{width:100%;border-collapse:collapse;font-size:12px;margin:16px 0}.size-table caption{text-align:left;font-weight:700;font-size:14px;margin-bottom:10px}.size-table th,.size-table td{padding:8px 4px;border-bottom:1px solid #e2e5ef;text-align:center}.size-table thead{background:#f0f2fd}.size-table button{background:#edf0ff;border-radius:5px;color:var(--blue);min-width:38px;min-height:38px;padding:5px;font:inherit}.size-table button[aria-pressed=true]{background:var(--blue);color:white}#studio-panel-size h3{font-size:17px;margin:12px 0}#studio-panel-size p{font-size:12px;line-height:1.6}#sizeChosen{color:var(--blue);font-weight:600}#studio-panel-size img{width:100%;height:auto}.has-size-guide .studio-tabs{display:grid;grid-template-columns:1fr 1fr 1fr 1.5fr;gap:4px}.has-size-guide .studio-tabs button{font-size:11px;padding:6px 4px;min-height:44px}.size-table tr:has([aria-pressed=true]){background:#f2f4ff}
@media(max-width:400px){.size-table{font-size:10px}.size-table th,.size-table td{padding:6px 2px}.size-table button{min-width:34px;min-height:40px}}
.size-table thead th{position:sticky;top:0;z-index:1;background:#f0f2fd}

/* Keep the dialog's header, workspace and checkout in distinct bounded rows. */
#customForm{min-width:0;min-height:0;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
#customForm>.studio-header,#customForm>.studio-footer{min-width:0;position:relative;z-index:2}
#customForm>.studio-workspace{min-width:0;min-height:0;align-items:stretch;overflow:hidden}
#customForm .preview-side{align-self:stretch;min-width:0;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto auto auto;grid-template-areas:"views" "canvas" "tools" "options" "status";overflow:auto;overscroll-behavior:contain}
#customForm .view-tabs{grid-area:views;order:initial;align-self:stretch;max-width:none;width:100%}
#customForm .studio-preview-stage{grid-area:canvas;min-width:0;min-height:0;align-self:stretch;justify-self:stretch;container-type:size;display:grid;place-items:center;overflow:hidden}
#customForm .studio-preview-stage .preview{width:min(100cqw,100cqh,760px);height:min(100cqw,100cqh,760px);max-width:100%;max-height:100%;min-height:0;margin:0;aspect-ratio:1;grid-area:auto;align-self:center;justify-self:center;order:initial}
#customForm .edit-tools{grid-area:tools;position:static;width:100%;max-width:none;align-self:stretch}
#customForm .edit-tools .edit-actions{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center}
#customForm .preview-options{grid-area:options;align-self:stretch}
#customForm #mockupStatus{grid-area:status;align-self:stretch}
#customForm .studio-tools{min-width:0;min-height:0;overflow:hidden}
#customForm .studio-panels{flex:1 1 0;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding-block:12px}
#customForm .preview-enlarge{top:60px}
.studio-upsell{grid-column:1/-1;min-width:0;background:#e8f4f0;border:1px solid #b8d9d0;border-radius:12px;text-align:center}
.studio-upsell-link{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px 12px;width:100%;border:0;border-radius:11px;background:none;color:var(--teal,var(--blue));font-size:13px;font-weight:600;line-height:1.5;padding:9px 12px;min-height:44px;max-width:100%;white-space:normal;cursor:pointer}
.studio-upsell-link span{padding:5px 12px;border-radius:999px;background:#005b63;color:#fff;font-size:12px;font-weight:700;white-space:nowrap}
.studio-upsell-link:hover{background:#dceee7}
.studio-upsell-link:focus-visible{outline:3px solid #ff650a;outline-offset:3px}
.studio-upsell-link:disabled{opacity:.65;cursor:wait}
#upsellStatus{margin:0;padding:0 10px 7px;font-size:11px;color:#a34422}
#upsellStatus:empty{display:none}
@media(max-width:700px){
 #customForm>.studio-workspace{grid-template:minmax(180px,42%) minmax(0,1fr)/minmax(0,1fr)}
 #customForm .preview-side{display:grid;grid-template-rows:minmax(0,1fr) auto auto;grid-template-areas:"canvas" "views" "tools";padding:6px 10px;gap:4px}
 #customForm .view-tabs{display:flex;flex-direction:row;max-width:none;width:100%;align-self:stretch}
 #customForm .view-tabs button{min-height:36px;padding:5px 4px}
 #customForm .edit-tools .edit-actions{display:flex;gap:4px;margin:0}
 #customForm .edit-tools .edit-actions button{min-height:30px;padding:4px 7px;font-size:10px}
 #customForm .preview-enlarge{top:8px;left:12px}
 #customForm.preview-expanded>.studio-workspace{grid-template:minmax(0,1fr)/minmax(0,1fr)}
}
@media(max-width:700px) and (max-height:550px){
 #customForm>.studio-workspace{grid-template:minmax(0,1fr)/minmax(0,42%) minmax(0,1fr)}
 #customForm .preview-side{padding:5px;gap:3px}
 #customForm .view-tabs button{font-size:9px;min-height:30px}
 #customForm .edit-tools .edit-actions button{font-size:9px;min-height:28px;padding:3px}
 #customForm .preview-enlarge{top:5px;left:5px}
}
.image-tool-buttons{display:flex;gap:8px;margin:8px 0 14px}.image-tool-buttons button,.image-edit-actions button,.image-edit-footer>button:not(.primary){padding:10px 14px;border:1px solid #ced5ef;border-radius:6px;background:white;color:var(--blue);font-size:13px;min-height:42px}button:disabled{opacity:.45;cursor:default}#imageEditDialog{width:780px;max-height:96dvh;padding:18px;overflow:auto}.image-edit-title{display:flex;justify-content:space-between;align-items:center}.image-edit-title h2{font-size:21px;margin:0}.image-edit-title button{font-size:28px;background:none;min-width:44px;min-height:44px}#imageEditDialog>p{font-size:12px;line-height:1.6}.crop-stage{display:flex;justify-content:center;align-items:center;min-height:80px;background:repeating-conic-gradient(#e4e7ee 0% 25%,white 0% 50%) 50% / 20px 20px;border:1px solid #d9dce6;border-radius:6px;overflow:hidden}#cropCanvas{display:block;max-width:100%;max-height:55dvh;width:auto;height:auto;touch-action:none;cursor:crosshair}.image-edit-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.image-edit-footer{display:flex;justify-content:flex-end;gap:8px;position:sticky;bottom:0;background:white;padding:10px 0 0}#imageEditStatus{min-height:36px;color:var(--navy)}@media(max-width:700px){#imageEditDialog{max-width:100%;width:100%;max-height:100dvh;margin:auto 0;padding:14px}.image-edit-actions button{font-size:11px;padding:8px}.image-edit-footer .button{font-size:12px;padding:12px}.image-edit-footer{padding-bottom:env(safe-area-inset-bottom)}}

/* Keep mobile editing space available; secondary content scrolls with the tools. */
.studio-upsell-link .studio-upsell-question{padding:0;background:none;color:inherit;border-radius:0;font:inherit;white-space:normal}
@media(max-width:700px){
 body #customDialog #customForm>.studio-footer{grid-template-columns:minmax(0,1fr) auto;padding:7px 12px max(7px,env(safe-area-inset-bottom));gap:0 10px;align-items:center}
 body #customDialog .studio-footer .purchase-row{gap:0;margin:0;min-width:0}
 body #customDialog .studio-footer .purchase-row small{display:block;font-size:12px!important;line-height:1.3;white-space:nowrap}
 body #customDialog .studio-footer .purchase-row strong{font-size:18px;line-height:1.3;margin-top:2px}
 body #customDialog .studio-footer>.button{min-width:140px;min-height:44px;padding:10px 12px;font-size:13px!important;line-height:1.3;gap:0}
 body #customDialog .studio-footer>.error:empty{display:none}
 body #customDialog .studio-header{padding:10px 52px 8px 16px}
 body #customDialog .studio-header :is(#draftStatus,#conceptNotice,#readyTemplateNote){font-size:12px!important;line-height:1.35;margin:4px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body #customDialog .history-actions{padding:0 8px}
 body #customDialog .history-actions button{margin:2px;min-height:44px;padding:6px 9px;font-size:12px!important}
 body #customDialog .history-actions small{display:none}
 body #customDialog .studio-tabs{padding:4px 10px}
 body #customDialog .studio-tabs button{padding:6px;min-height:44px}
 body #customDialog .studio-mobile-fees{margin:10px 0;border-top:1px solid var(--line)}
 body #customDialog .studio-mobile-fees>summary{display:flex;align-items:center;min-height:44px;font-size:13px;cursor:pointer}
 body #customDialog .studio-mobile-fees #modalFeeNote{display:block;font-size:12px!important;line-height:1.5;padding-bottom:10px}
 body #customDialog .studio-upsell{margin:8px 0 0;background:transparent;border:0;border-top:1px solid var(--line);border-radius:0}
 body #customDialog .studio-upsell-link{min-height:44px;padding:5px 0;justify-content:flex-start;flex-wrap:nowrap;gap:0;text-align:left}
 body #customDialog .studio-upsell-link .studio-upsell-question{display:none}
 body #customDialog .studio-upsell-link>span:last-child{padding:0;background:none;color:var(--teal,var(--blue));border-radius:0;font-size:12px!important;white-space:normal}
 body #customDialog .studio-upsell #upsellStatus{font-size:12px!important;line-height:1.4;padding:0 0 8px}
}
@media(max-width:700px) and (min-height:551px){
 body #customDialog #customForm>.studio-workspace{grid-template:clamp(160px,29dvh,210px) minmax(0,1fr)/minmax(0,1fr)}
}


/* Larger default mobile preview, with editing tools and compact purchase bar retained. */
@media(max-width:700px) and (min-height:551px){
 body #customDialog #customForm:not(.preview-expanded)>.studio-workspace{
  grid-template:clamp(210px,40dvh,340px) minmax(0,1fr)/minmax(0,1fr)
 }
}


/* Expanded preview must occupy the whole workspace, including on short mobile screens. */
body #customDialog #customForm.preview-expanded>.studio-workspace{
 grid-template:minmax(0,1fr)/minmax(0,1fr)
}
body #customDialog #customForm.preview-expanded>.studio-workspace>.preview-side{
 grid-area:1/1;min-height:0;align-self:stretch;justify-self:stretch
}
