/* Focus Sports workspace: one layout definition for each screen size. */
body.editing-studio{overflow:hidden;background:#edf0f4}body.editing-studio>header,body.editing-studio>footer{display:none}
.pro-editor{height:100dvh;display:flex;flex-direction:column;color:#14213d;font-family:Roboto,Arial,sans-serif;overflow:hidden}
.pro-top{height:64px;flex:0 0 64px;display:flex;align-items:center;gap:14px;background:#fff;padding:8px 16px;border-bottom:1px solid #dfe4eb;z-index:5;min-width:0}
.pro-back{text-decoration:none;font-size:24px;padding:5px;flex-shrink:0}.pro-top>div:first-of-type{min-width:0}.pro-eyebrow{display:block;font-size:9px;letter-spacing:1.5px;color:#135029;font-weight:700}
.pro-top input{border:0;padding:4px 0;color:#14213d;font-weight:600;width:clamp(120px,23vw,320px);max-width:100%;background:transparent;margin:0;text-overflow:ellipsis}.pro-save{margin-left:auto;font-size:11px;color:#607184;white-space:nowrap}.pro-top-actions{display:flex;gap:5px;align-items:center;flex-shrink:0}.pro-top-actions button{min-height:40px;padding:8px 12px;border-radius:9px;white-space:nowrap}
.pro-body{min-height:0;min-width:0;flex:1;display:grid;grid-template-columns:72px 264px minmax(0,1fr);position:relative}.pro-editor[data-panel=none] .pro-body{grid-template-columns:72px minmax(0,1fr)}.pro-editor[data-panel=none] .pro-panel{display:none}
.pro-rail{min-width:0;background:#fff;border-right:1px solid #e1e5ea;display:flex;flex-direction:column;gap:4px;padding:8px 4px;overflow-y:auto;scrollbar-width:thin}.pro-rail button{display:flex;flex-direction:column;gap:5px;align-items:center;justify-content:center;border:0;font-size:10px;font-weight:500;padding:6px 2px;background:transparent;min-height:62px;flex:0 0 62px;border-radius:10px}.pro-rail button.active{background:#e8f0eb;color:#135029}.pro-rail button svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.pro-rail button small{display:block;font-size:10px;line-height:13px;white-space:nowrap;text-align:center;width:100%}.pro-rail button:focus-visible,.pro-icon-button:focus-visible{outline:2px solid #135029;outline-offset:-2px}
.pro-panel{min-width:0;background:#fff;border-right:1px solid #e1e5ea;overflow:auto;overscroll-behavior:contain;padding:0 16px 24px}.pro-panel-head{display:flex;align-items:center;justify-content:space-between;gap:8px;position:sticky;top:0;background:#fff;z-index:2;padding:14px 0;border-bottom:1px solid #edf0f4;margin-bottom:16px}.pro-panel h2{font-size:17px;line-height:1.3;margin:0;letter-spacing:-.3px;min-width:0}.pro-panel-head>button{font-size:11px;padding:7px 9px;flex-shrink:0;min-height:36px}.pro-sheet-toggle{display:none}.pro-panel p{font-size:12px;line-height:1.65}.pro-panel input,.pro-panel textarea,.pro-panel select{max-width:100%;width:100%;font-size:14px}.pro-panel label{display:block;margin:0 0 15px;font-size:12px}.pro-panel .row{display:flex;gap:10px;flex-wrap:nowrap}.pro-panel .row label{min-width:0;flex:1}.pro-panel input[type=color]{height:44px;padding:3px}.pro-panel input[type=range]{min-height:38px}.pro-panel hr{border:0;border-top:1px solid #dfe4eb;margin:22px 0}.pro-panel #proPaint,.pro-panel #proTrace,.pro-panel #proFinishTrace,.pro-panel #proStopPaint{width:100%;margin-bottom:8px}.pro-freeform-size{margin:14px 0}.pro-freeform-size summary{cursor:pointer;font-size:12px;padding:8px 0}
.pro-main{min-width:0;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr) 42px}.pro-context{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-height:48px;background:#fff;border-bottom:1px solid #dfe4eb;padding:6px 10px;min-width:0}.pro-context>*{flex-shrink:0}.pro-context button{font-size:11px;padding:6px 8px;min-height:36px;white-space:nowrap}.pro-context select,.pro-context input{margin:0;min-height:36px;border:1px solid #dfe4eb;border-radius:7px;font-size:12px;padding:4px 8px}.pro-context #proFont{width:140px;max-width:140px;flex:0 0 140px}.pro-context #proTextSize{width:54px;flex:0 0 54px}.pro-context input[type=color]{width:36px;padding:3px}.pro-context>span{font-size:11px;color:#607184;margin-right:6px}.pro-icon-button{width:36px!important;height:36px;flex:0 0 36px;display:inline-flex;align-items:center;justify-content:center;flex-direction:column;padding:6px!important;gap:4px;overflow:hidden;border-radius:8px}.pro-icon-button svg{display:block;width:22px;height:22px;flex:0 0 22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.pro-icon-button small{display:none}
.pro-viewbar{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px;flex-wrap:wrap;min-height:44px}.pro-viewbar button{padding:6px 16px;font-size:12px;border-radius:9px;min-height:32px}.pro-viewbar span{font-size:11px;color:#607184;margin-left:10px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pro-canvas-area{position:relative;overflow:hidden;min-width:0;min-height:0;background:#eef1f4;touch-action:none}.pro-canvas-area .canvas-container{position:absolute!important;left:0;top:0}.pro-canvas-area canvas{max-width:none;max-height:none}.pro-status{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 12px;border-top:1px solid #dfe4eb;background:#fff;min-width:0}.pro-status span{font-size:10px;color:#607184}.pro-status #proHint{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pro-status>div{display:flex;align-items:center;gap:5px;flex-shrink:0}.pro-status button{font-size:11px;padding:4px 8px;min-height:32px}.pro-status #proZoomLabel{min-width:34px;text-align:center;color:#14213d}
.pro-upload-card{text-align:center;border:1px dashed #b8c4d0;border-radius:14px;padding:22px 12px;margin-bottom:16px;background:#f8fafb}.pro-upload-card>span{font-size:30px;color:#135029}.pro-upload-card h3{font-size:16px;margin:10px 0 0}.pro-upload-card p{margin:8px 0 16px}.pro-wide{width:100%;font-size:12px}.pro-text-presets{display:grid;gap:10px}.pro-text-presets button{padding:18px 14px;text-align:left;overflow-wrap:anywhere}.pro-text-presets button:first-child{font-size:23px}.pro-text-presets button:nth-child(2){font-size:18px}.pro-text-presets button:last-child{font-size:15px}.pro-layers{display:grid;gap:6px}.pro-layer{display:flex;align-items:center;gap:2px;border:1px solid #e1e5ea;border-radius:8px;padding:3px;min-width:0}.pro-layer.active{border-color:#135029;background:#f0f6f2}.pro-layer button{border:0;background:transparent;padding:9px 5px;min-width:28px;font-size:12px}.pro-layer button:first-child{flex:1;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.pro-file-menu{position:fixed;right:16px;top:60px;z-index:60;background:#fff;padding:7px;border:1px solid #dbe0e5;border-radius:12px;box-shadow:0 12px 36px #14213d25;width:230px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 76px);overflow:auto}.pro-file-menu button,.pro-menu button{display:block;width:100%;border:0;text-align:left;font-size:12px;border-radius:6px;padding:11px;white-space:normal}.pro-danger{color:#a72f38!important}.pro-menu{position:absolute;z-index:50;width:180px;background:#fff;box-shadow:0 8px 28px #14213d30;border:1px solid #dbe0e5;padding:5px;border-radius:10px}#proLoading{position:absolute;inset:0;display:grid;place-items:center;background:#eef1f4d9;font-size:13px;z-index:6;pointer-events:auto}
.design-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.design-grid button{padding:8px;min-width:0}.design-grid img{width:100%;height:110px;object-fit:contain;background:repeating-conic-gradient(#eee 0% 25%,#fff 0% 50%) 0 / 14px 14px}.design-grid span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;margin-top:6px}.emoji-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.emoji-grid button{font-size:29px;min-height:50px;padding:6px}.print-size-fields{padding:12px;border:1px solid #dce4df;border-radius:12px;margin-bottom:18px;background:#f6faf7}.print-size-fields .row label{min-width:0;flex:1}.print-size-fields button{width:100%;font-size:12px}
.drawing-dialog{width:min(700px,calc(100% - 24px));max-width:700px}.drawing-dialog canvas{display:block;margin:12px auto;background-color:#f0f2f4;border:1px solid #dfe4eb;border-radius:10px;cursor:crosshair;max-width:100%;touch-action:none}.drawing-controls{display:flex;gap:8px;flex-wrap:wrap;align-items:end}.drawing-controls label{flex:1;min-width:100px}.drawing-controls button{min-height:40px}.drawing-dialog .bottom-actions{display:flex;gap:10px}.drawing-dialog .bottom-actions button{flex:1}.cleanup .row{flex-wrap:wrap;gap:8px}.cleanup .row button{flex:1;min-width:90px}.cleanup canvas{max-height:45dvh;max-width:100%;object-fit:contain;touch-action:none;display:block;margin:12px auto}.cleanup>label{display:block;font-size:12px}.cleanup .bottom-actions{display:flex;gap:8px}.cleanup .bottom-actions button{flex:1}
body.editing-studio .floating-mascot{right:12px;bottom:60px;width:62px;z-index:22}body.editing-studio .mascot-character{width:62px;height:62px}
@media(min-width:701px) and (max-width:900px){.pro-body,.pro-editor[data-panel=none] .pro-body{grid-template-columns:66px minmax(0,1fr)}.pro-panel{position:absolute;left:66px;top:0;bottom:0;width:264px;z-index:25;box-shadow:10px 0 24px #14213d18}.pro-save{display:none}.pro-top-actions{margin-left:auto}.pro-status #proHint{display:none}}
@media(max-width:700px){
.pro-top{height:54px;flex-basis:54px;display:grid;grid-template-columns:24px minmax(0,1fr) auto;gap:5px;padding:5px 8px}.pro-back{font-size:21px;padding:0}.pro-eyebrow,.pro-save{display:none}.pro-top input{width:100%;font-size:12px;padding:3px 0}.pro-top-actions{gap:3px}.pro-top-actions button{min-height:36px;width:32px;padding:5px;font-size:13px}.pro-top-actions #proFile{font-size:0}.pro-top-actions #proFile:after{content:'⋯';font-size:20px}.pro-top-actions #proNext{width:auto;min-width:76px;font-size:11px;padding:6px 9px}
.pro-body,.pro-editor[data-panel=none] .pro-body{display:block;position:relative}.pro-main{height:calc(100% - 72px - env(safe-area-inset-bottom));grid-template-rows:60px 40px minmax(0,1fr) 40px}.pro-context{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;padding:3px 8px;gap:6px;min-height:60px}.pro-context::-webkit-scrollbar,.pro-rail::-webkit-scrollbar{display:none}.pro-context>span{display:none}.pro-context .pro-icon-button{width:64px!important;height:52px;min-height:52px;flex:0 0 64px;padding:5px 3px!important}.pro-context .pro-icon-button svg{width:21px;height:21px;flex-basis:21px}.pro-context .pro-icon-button small{display:block;width:100%;font-size:9px;font-weight:500;line-height:12px;margin:0;padding:0;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pro-context select,.pro-context input{font-size:16px;min-height:44px}.pro-context #proFont{width:126px;max-width:126px;flex-basis:126px}.pro-context #proEditText,.pro-context #proBold{min-height:44px}.pro-context #proBold{min-width:42px}
.pro-viewbar{padding:3px;min-height:40px;flex-wrap:nowrap;overflow-x:auto;justify-content:center}.pro-viewbar button{min-height:34px;padding:6px 14px;font-size:12px;flex-shrink:0}.pro-viewbar span{display:none}.pro-status{height:40px;padding:3px 8px;justify-content:center}.pro-status #proHint{display:none}.pro-status button{min-height:34px;padding:4px 10px}.pro-rail{position:absolute;bottom:0;left:0;right:0;flex-direction:row;height:calc(72px + env(safe-area-inset-bottom));padding:4px 6px calc(4px + env(safe-area-inset-bottom));overflow-x:auto;overflow-y:hidden;scrollbar-width:none;border-top:1px solid #dfe4eb;border-right:0;z-index:20;gap:4px}.pro-rail button{flex:0 0 64px;min-width:64px;min-height:60px;padding:5px 3px}.pro-rail button svg{width:24px;height:24px}.pro-rail button small{font-size:10px}
.pro-panel{position:absolute;left:0;right:0;bottom:calc(72px + env(safe-area-inset-bottom));height:42dvh;max-height:calc(100% - 80px - env(safe-area-inset-bottom));border:1px solid #dfe4eb;border-radius:18px 18px 0 0;padding:0 16px 16px;box-shadow:0 -8px 32px #14213d18;z-index:25;overflow:auto}.pro-panel.expanded{height:calc(100% - 80px - env(safe-area-inset-bottom));max-height:calc(100% - 80px - env(safe-area-inset-bottom))}.pro-panel-head{padding:24px 0 10px;margin-bottom:12px;touch-action:none;cursor:ns-resize}.pro-panel-head h2{font-size:16px;pointer-events:none}.pro-panel-head #proClosePanel{min-height:40px;font-size:12px}.pro-panel-head .pro-sheet-toggle{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:25%;width:50%;height:24px;min-height:24px;border:0;background:transparent;padding:8px}.pro-sheet-toggle span{display:block;width:40px;height:4px;border-radius:5px;background:#b4bfcc}.pro-panel input,.pro-panel textarea,.pro-panel select{font-size:16px;min-height:44px}.pro-panel input[type=range]{min-height:44px}.pro-panel button{min-height:44px}.pro-file-menu{top:50px;right:8px}.pro-file-menu button{min-height:44px}
.drawing-dialog{width:100%;max-width:none;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:12px;display:flex;flex-direction:column;overflow:auto}.drawing-dialog:not([open]){display:none}.drawing-dialog h2{font-size:19px;margin:0 0 4px}.drawing-dialog>p{font-size:11px;margin:0 0 8px}.drawing-dialog .drawing-controls{gap:6px}.drawing-dialog .drawing-controls label{min-width:100px;margin:0}.drawing-dialog .drawing-controls button{min-height:42px;padding:7px 12px}.drawing-dialog canvas{max-height:48dvh;max-width:100%;margin:10px auto;touch-action:none}.drawing-dialog .bottom-actions{margin-top:auto;padding-top:8px;flex-shrink:0}.drawing-dialog .bottom-actions button{min-height:44px}
body.editing-studio .floating-mascot{right:8px;bottom:calc(156px + env(safe-area-inset-bottom));width:44px;z-index:22}body.editing-studio .mascot-character{width:44px;height:44px}
}
@media(max-width:700px) and (max-height:480px){.pro-top{height:46px;flex-basis:46px}.pro-main{grid-template-rows:52px 36px minmax(0,1fr) 34px;height:calc(100% - 60px - env(safe-area-inset-bottom))}.pro-context{min-height:52px}.pro-context .pro-icon-button{height:46px;min-height:46px}.pro-rail{height:calc(60px + env(safe-area-inset-bottom))}.pro-rail button{min-height:50px}.pro-status{height:34px}.pro-panel{bottom:calc(60px + env(safe-area-inset-bottom));height:60dvh}.pro-panel.expanded{height:calc(100% - 68px - env(safe-area-inset-bottom));max-height:calc(100% - 68px - env(safe-area-inset-bottom))}}
.color-source{display:none!important}.studio-color-button{display:flex!important;align-items:center;gap:10px;width:100%;min-height:48px;padding:8px 12px!important;text-align:left;border:1px solid #d5dce5;border-radius:10px}.studio-color-button i{width:28px;height:28px;flex:0 0 28px;border:1px solid #14213d25;border-radius:7px;background:var(--chosen-color)}.studio-color-button span{font-size:12px;font-weight:600}.studio-color-button small{margin-left:auto;font-size:10px;color:#607184}.pro-context .studio-color-button{width:auto;min-width:140px;min-height:40px}.pro-context .studio-color-button small{display:none}.color-dialog{width:min(410px,calc(100% - 24px));padding:22px;max-height:92dvh;overflow-y:auto;border-radius:18px}.color-heading{display:flex;justify-content:space-between;align-items:center;gap:14px}.color-heading h2{font-size:21px;margin:0}.color-heading button{font-size:25px;min-width:40px;padding:4px}.color-current{display:flex;align-items:center;gap:14px;margin:18px 0 0}.color-current>span{width:52px;height:52px;border:1px solid #ddd;border-radius:12px;flex-shrink:0}.color-current label{flex:1;margin:0;font-size:12px}.color-current input{font-family:monospace;font-size:16px;min-height:44px}.color-dialog canvas{width:100%;height:auto;display:block;border-radius:12px;touch-action:none;cursor:crosshair}.color-dialog #colorError{font-size:12px;color:#a12c2c;margin:5px 0;min-height:15px}.color-dialog input[type=range]{width:100%;min-height:38px}.color-hue-label{font-size:12px;margin-top:8px}.color-hue-label input{accent-color:#135029;background:linear-gradient(90deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red);border-radius:20px}.color-sliders{font-size:12px;margin:6px 0}.color-sliders summary{cursor:pointer;padding:8px 0}.color-dialog h3{font-size:13px;margin:14px 0 9px}.color-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}.color-grid button{width:100%;aspect-ratio:1;min-height:38px;padding:0;border-radius:9px;background:var(--swatch)!important;border:1px solid #14213d25;position:relative}.color-grid button[aria-pressed=true]{outline:2px solid #135029;outline-offset:2px}.color-grid button[aria-pressed=true]:after{content:'✓';position:absolute;inset:0;display:grid;place-items:center;color:white;text-shadow:0 1px 3px #000,0 0 2px #000;font-size:22px}.color-actions{display:flex;gap:10px;position:sticky;bottom:-22px;background:#fff;padding:16px 0 8px;margin-top:6px}.color-actions button{flex:1;min-height:46px}.color-dialog [hidden]{display:none!important}@media(max-width:700px){.color-dialog{padding:18px}.color-grid{gap:8px}.color-actions{bottom:-18px}.color-grid button{min-height:40px}.color-dialog h3{margin-top:12px}.studio-color-button{min-height:50px}}.pro-context .studio-color-button{width:108px;min-width:108px;min-height:36px;padding:5px 7px!important;gap:6px}.pro-context .studio-color-button i{width:22px;height:22px;flex-basis:22px}.pro-context .studio-color-button span{font-size:11px}.color-dialog.color-popover{position:fixed;margin:0;width:340px;max-height:calc(100dvh - 24px);z-index:90;box-shadow:0 12px 40px #14213d30;border:1px solid #dbe1e9}.color-dialog .color-grid button{border-radius:50%}
@media(max-width:700px){.color-dialog{margin:auto auto 0;width:100%;max-width:100%;border-radius:20px 20px 0 0;max-height:90dvh;padding:16px}.color-dialog .color-actions{bottom:-16px}.color-dialog #colorPlane{max-height:160px}.color-dialog .color-heading h2{font-size:19px}.pro-context .studio-color-button{min-height:44px}.color-dialog .color-grid button{min-height:38px}}

.pro-panel .swatches{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.pro-panel .swatches button{width:100%;height:auto;aspect-ratio:1;min-height:0;min-width:0;padding:0}.pro-panel #proFinishTrace,.pro-panel #proStopPaint{font-size:12px}
/* Keep the complete main tool rail visible on a phone. */
@media(max-width:700px){.pro-rail{padding-left:0;padding-right:0;gap:0;overflow:hidden}.pro-rail button{flex:1 1 0;min-width:0;width:auto;padding:5px 0}.pro-rail button small{font-size:9px}.pro-context{scroll-snap-type:x proximity}.pro-context>button{scroll-snap-align:start}}

/* Consistent control geometry, including wrapped mobile dialog labels. */
.pro-editor button{line-height:1.25;vertical-align:middle;touch-action:manipulation}
.pro-top-actions button{display:inline-flex;align-items:center;justify-content:center;align-self:stretch}
.pro-top-actions{align-items:stretch}
.pro-panel .row{align-items:flex-start}
.cleanup .row,.cleanup .bottom-actions,.drawing-dialog .bottom-actions,.color-actions{align-items:stretch}
.cleanup .row button,.cleanup .bottom-actions button,.drawing-dialog .bottom-actions button,.color-actions button{display:flex;align-items:center;justify-content:center;line-height:1.3;margin-top:0}
.pro-editor .primary{margin-top:0}
.pro-status button{display:inline-flex;align-items:center;justify-content:center;line-height:1}
.pro-context button[aria-pressed=true]{background:#e8f0eb;color:#135029;border-color:#a5c2af}
.pro-viewbar button.active{background:#14213d;color:#fff;border-color:#14213d}
@media(max-width:700px){.pro-back{display:grid;place-items:center;min-height:40px}.cleanup .row button{min-width:0;flex:1 1 0;font-size:12px;padding:10px 6px;min-height:48px}.cleanup .bottom-actions button{min-height:48px}.pro-top input{min-height:36px}.pro-rail button{border-radius:8px}}

/* Native dark surfaces: preserve true garment and artwork colors. */
@media(prefers-color-scheme:dark){
 :root{color-scheme:dark;--studio-surface:#172235;--studio-raised:#1d2b40;--studio-border:#35455a;--studio-text:#edf2f8;--studio-muted:#b1c0d0;--studio-accent:#83c99c}
 body,body.editing-studio{background:#0e1726;color:var(--studio-text)}
 header,.panel,.stage-footer,.showcase-card,.feature-grid article,.method-grid article,.faq-section details,.contact-card,dialog,dialog.cleanup,dialog.export-progress,.pro-top,.pro-rail,.pro-panel,.pro-panel-head,.pro-context,.pro-status,.pro-file-menu,.pro-menu,.color-actions{background:var(--studio-surface);color:var(--studio-text);border-color:var(--studio-border)}
 button,input,select,textarea,dialog input,dialog select,dialog textarea{background:var(--studio-raised);color:var(--studio-text);border-color:var(--studio-border)}
 button:hover{background:#283b53;border-color:#6c839b}
 button.primary,a.primary,.chips button.active,.pro-viewbar button.active{background:#225d3c;color:#fff;border-color:#337d53}
 button.primary:hover,a.primary:hover{background:#2c754b;color:#fff}
 .green{background:#225d3c;color:#fff}
 p,.caption small,.showcase-card>span,.badge,.brand span,nav a,.stage-footer span,.stepbar,.search-label,th,footer,dialog p,.faq-section details p,.pro-save,.pro-context>span,.pro-viewbar span,.pro-status span,.studio-color-button small{color:var(--studio-muted)}
 nav a.active,.faq-section summary,.contact-card>a,dialog h1,dialog h2,dialog h3,dialog li,dialog label,.pro-editor,.pro-top input,.pro-status #proZoomLabel{color:var(--studio-text)}
 .eyebrow,.pro-eyebrow,.feature-grid span,.contact-card>span,.contact-card .text-link,.save-status,.stepbar span.on,dialog a{color:var(--studio-accent)}
 header #helpButton,dialog button.quiet{color:var(--studio-text);background:var(--studio-raised);border-color:var(--studio-border)}
 header nav,.home-section,footer,.panel hr,.pro-panel hr,.pro-layer,.studio-color-button,.color-dialog.color-popover,th,td,.review-img{border-color:var(--studio-border)}
 input::placeholder,textarea::placeholder{color:#a2b4c8}
 .pro-rail button,.pro-layer button{background:transparent;color:var(--studio-muted)}
 .pro-rail button.active,.pro-context button[aria-pressed=true],.pro-layer.active,.layer.active{background:#224532;color:#b3e5c4;border-color:#5b9f73}
 .pro-upload-card,.print-size-fields,.note,.success{background:#1a352a;border-color:#497158;color:#c1e2ce}
 .pro-canvas-area,.stage{background:#202d40;border-color:var(--studio-border)}
 .product .picture,.showcase-card>div,.hero-board{color-scheme:light;background:#e8edf0}
 .product{background:var(--studio-surface);color:var(--studio-text);border-color:var(--studio-border)}
 .product:hover{background:var(--studio-raised)}
 .pro-viewbar{background:#121e30}
 .pro-sheet-toggle span{background:#9eb1c6}
 .pro-danger,.error,.color-dialog #colorError{color:#ffabb0!important}
 .pro-back{color:var(--studio-text)}
 #proLoading{background:#172235e6;color:var(--studio-text)}
 :focus-visible,.pro-rail button:focus-visible,.pro-icon-button:focus-visible{outline-color:var(--studio-accent)}
 .drawing-dialog canvas,.cleanup canvas,.design-grid img{color-scheme:light;background-color:#eef1f4}
 .color-grid button[aria-pressed=true]{outline-color:var(--studio-accent)}
 .layer{background:var(--studio-raised)}
 .bottom-actions{background:#0e1726;border-color:var(--studio-border)}
 .cleanup .bottom-actions,.drawing-dialog .bottom-actions{background:transparent}
 .mascot-hide{background:var(--studio-raised);color:var(--studio-text)}
}

/* Match the public shell's scoped selectors so theme colors win its overrides. */
@media(prefers-color-scheme:dark){
 body:not(.editing-studio){background:#0e1726;color:var(--studio-text)}
 body:not(.editing-studio)>header{background:var(--studio-surface);color:var(--studio-text);border-color:var(--studio-border);box-shadow:0 8px 32px #0004}
 body:not(.editing-studio)>header nav{border-color:var(--studio-border)}
 body:not(.editing-studio)>header #helpButton{background:var(--studio-raised);color:var(--studio-text);border-color:var(--studio-border)}
 body:not(.editing-studio) button.primary{background:#225d3c;color:#fff;border-color:#337d53}
 body:not(.editing-studio) button.primary:hover{background:#2c754b;color:#fff}
 body:not(.editing-studio) .header-expert{background:#225d3c;color:#fff}
 .welcome-page,.welcome-steps{background:#0e1726;color:var(--studio-text);border-color:var(--studio-border)}
 .contact-section{background:#142534;color:var(--studio-text)}
 .method-grid article{background:var(--studio-surface);border-color:var(--studio-border)}
 .detail-section{background:#14213d}
 .detail-section .feature-grid article{background:#1b2c43;border-color:#35455a}
 .mascot-bubble{background:var(--studio-raised);color:var(--studio-text);border-color:var(--studio-border)}
 .studio-loading{color:var(--studio-muted)}
 .account-dialog .button{border-color:var(--studio-border);color:var(--studio-text)}
 button:focus-visible,a:focus-visible{outline-color:var(--studio-accent)}
 .hero-board .board-label,.hero-board .board-tag{color:#14213d}
 .pro-panel .micro{color:var(--studio-muted)}
}

/* Audit refinements: selected pan state and overflow-safe view navigation. */
.pro-status button[aria-pressed=true]{background:#e8f0eb;color:#135029;border-color:#a5c2af}
.pro-viewbar{justify-content:safe center}
.pro-top-actions button:disabled{opacity:.55}
.pro-panel label,.pro-panel p,.pro-upload-card p{overflow-wrap:anywhere}
.color-current label{min-width:0}
.pro-back:focus-visible{outline:2px solid #135029;outline-offset:1px;border-radius:6px}
@media(max-width:700px){
 .pro-top{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
 .pro-status{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
 .pro-rail{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
 .pro-panel{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
}
@media(prefers-color-scheme:dark){
 .pro-status button[aria-pressed=true]{background:#224532;color:#b3e5c4;border-color:#5b9f73}
 input[type=range],input[type=checkbox]{accent-color:var(--studio-accent)}
 dialog::backdrop{background:#050a12b8}
 .pro-back:focus-visible{outline-color:var(--studio-accent)}
 .pro-panel-head{border-bottom-color:var(--studio-border)}
 .pro-panel .pro-layer.active button{color:#c5ecd2}
 .studio-color-button i,.color-current>span{border-color:#8294a9}
}

/* Explicit workspace placement isolates the tool nav from public header nav order. */
@media(min-width:701px){
 .pro-body{grid-template-rows:minmax(0,1fr)}
 .pro-body>.pro-rail{order:0;grid-column:1;grid-row:1;width:auto}
 .pro-body>.pro-panel{order:0;grid-column:2;grid-row:1}
 .pro-body>.pro-main{order:0;grid-column:3;grid-row:1}
 .pro-editor[data-panel=none] .pro-body>.pro-main{grid-column:2}
}
@media(min-width:701px) and (max-width:900px){
 .pro-body>.pro-main{grid-column:2}
 .pro-body>.pro-panel{grid-column:auto;grid-row:auto}
}
.pro-rail{justify-content:flex-start;align-items:stretch}

/* Small-screen dialog controls must not inherit full-width form submit rules. */
.cleanup [hidden],.drawing-dialog [hidden]{display:none!important}
.drawing-controls button,.drawing-dialog .drawing-controls button.primary{width:auto;margin:0;flex:none;min-height:42px}
.drawing-dialog .bottom-actions{position:static;flex:none;padding-bottom:0}
.cleanup .row{min-width:0}
.cleanup .row button{overflow-wrap:anywhere}
@media(max-width:700px){
 .drawing-dialog canvas{flex:none;max-width:min(100%,calc(44dvh * 8 / 9));max-height:none;height:auto}
 .drawing-dialog .bottom-actions{margin-top:auto;background:transparent}
 .cleanup .row:last-child{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .cleanup .row:last-child button{min-width:0;width:100%;min-height:44px}
}
.drawing-controls label{min-width:140px;min-height:0}
.drawing-controls .studio-color-button{width:100%;min-width:0;max-width:100%;gap:6px}
.drawing-controls .studio-color-button small{display:none}
@media(max-width:360px){
 .cleanup .row:first-of-type{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .cleanup .row:first-of-type #removeBg{grid-column:1/-1;width:100%;overflow-wrap:normal;min-height:44px}
}

/* Artwork tools remain touch-sized without changing image colors. */
.cleanup input[type=range]{width:100%;min-height:44px;margin:6px 0 0;accent-color:#135029}
.cleanup label{line-height:1.5}
@media(max-width:700px){.cleanup input,.cleanup select,.cleanup textarea{font-size:16px}.cleanup input:not([type=checkbox]):not([type=range]):not([type=hidden]){min-height:44px}}
@media(prefers-color-scheme:dark){.cleanup input[type=range]{accent-color:var(--studio-accent)}}

/* Crop keeps the source image proportional and separates touch controls from canvas. */
.crop-dialog{width:min(760px,calc(100vw - 24px));padding:24px;max-width:760px;max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain}
.crop-heading h2{font-size:24px;line-height:1.2;margin:0 0 8px}
.crop-heading p{margin:0 0 16px;line-height:1.5}
.crop-stage{display:grid;place-items:center;min-width:0;min-height:0;padding:12px;border:1px solid #c7d1da;border-radius:12px;background:repeating-conic-gradient(#e6e9ed 0% 25%,#fff 0% 50%) 0 / 18px 18px;overflow:hidden;color-scheme:light}
.crop-stage canvas{display:block;width:auto;height:auto;max-width:100%;max-height:38dvh;touch-action:none;cursor:crosshair}
.crop-presets{display:flex;gap:12px;align-items:flex-end;margin:16px 0}
.crop-presets label{flex:1;min-width:0;margin:0;font-size:12px}
.crop-presets select{min-height:44px;width:100%;margin:6px 0 0}
.crop-presets button{flex:none;min-height:44px;margin:0;font-size:12px}
.crop-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.crop-fields label{margin:0;min-width:0;font-size:12px;line-height:1.5}
.crop-fields input{width:100%;min-width:0;min-height:44px;margin:6px 0 0}
.crop-dialog #cropSize{margin:12px 0;line-height:1.5}
.crop-actions{display:flex;align-items:stretch;gap:12px;margin:0}
.crop-actions button,.crop-actions button.primary{flex:1;width:auto;min-height:46px;margin:0;line-height:1.3}
.crop-dialog [hidden]{display:none!important}
@media(max-width:700px){
 .crop-dialog{padding:16px;width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:16px}
 .crop-heading h2{font-size:21px}
 .crop-heading p{font-size:12px;margin-bottom:12px}
 .crop-stage{padding:10px}
 .crop-stage canvas{max-height:30dvh}
 .crop-presets{gap:10px;margin:12px 0;flex-wrap:wrap}
 .crop-presets label{flex:1 1 140px}
 .crop-presets button{flex:1 1 110px}
 .crop-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .crop-dialog input,.crop-dialog select{font-size:16px}
 .crop-actions{gap:10px}
}
@media(prefers-color-scheme:dark){.crop-stage{border-color:#7f91a7}.crop-dialog #cropSize{color:var(--studio-muted)}}
@media(max-width:700px){.crop-actions{position:sticky;bottom:-16px;z-index:2;background:#fff;padding:12px 0 4px;margin-top:8px}.crop-dialog{scroll-padding-bottom:68px}}
@media(max-width:700px) and (prefers-color-scheme:dark){.crop-actions{background:var(--studio-surface)}}

/* Image refinement controls stay usable at narrow widths. */
.cleanup-tools,.cleanup-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}
.cleanup-tools button,.cleanup-actions button,.cleanup-tools button.primary,.cleanup-actions button.primary{width:100%;margin:0;min-width:0;min-height:46px;line-height:1.3;padding:10px;overflow-wrap:anywhere}
.cleanup-options{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:end}
.cleanup-options label{min-width:0;margin:0}
.cleanup-options select{width:100%;min-width:0}
.cleanup-options button{min-height:44px;margin:0}
@media(max-width:700px){.cleanup-tools,.cleanup-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.cleanup-options{grid-template-columns:1fr}.cleanup-options input,.cleanup-options select{font-size:16px;min-height:44px}}
