.tool-page[data-lab="image-stitch"] .workspace-stitch .workspace-header{justify-content:space-between}
.tool-page[data-lab="image-stitch"] .workspace-stitch .workspace-layout{grid-template-columns:minmax(290px,.84fr) minmax(0,1.16fr)}
.workspace-stitch .workspace-input,.workspace-stitch .workspace-result{padding:19px 23px}
.workspace-stitch .workspace-pane-heading{margin-bottom:11px}
.workspace-stitch .workspace-pane-heading h3{font-size:16px}
.workspace-stitch .upload{min-height:71px;display:flex;align-items:center;justify-content:space-between;gap:6px;text-align:left;padding:11px 12px}
.workspace-stitch .upload strong{font-size:14px}.workspace-stitch .upload small{margin-top:1px}
.workspace-stitch .upload .button{margin:0;white-space:nowrap;min-height:36px;font-size:12px;padding:6px 10px}
.stch-list-head{display:flex;justify-content:space-between;margin:12px 0 5px;font-size:13px}
.stch-link{border:0;background:none;color:var(--accent);padding:0;text-decoration:underline;cursor:pointer;font:inherit}
.stch-list{list-style:none;margin:0;padding:0;display:grid;gap:5px;max-height:215px;overflow:auto}
.stch-list .file{display:flex;align-items:center;gap:8px;min-height:41px;padding:3px 6px;border:1px solid var(--line);border-radius:6px;background:var(--sheet)}
.stch-list .handle{cursor:grab;color:var(--muted)}.stch-list img{width:28px;height:30px;object-fit:cover;border:1px solid var(--line);border-radius:3px}
.stch-list .name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;font-weight:650}
.stch-list .name small{display:block;font-size:10px;font-weight:400;color:var(--muted)}
.stch-list button{background:none;border:0;color:var(--accent);cursor:pointer;padding:0 3px;min-width:26px;min-height:29px;border-radius:5px}
.stch-list button:hover{background:var(--mint)}.stch-list button:disabled{opacity:.35;cursor:default}
.workspace-stitch .stch-options{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:9px 0}
.workspace-stitch .stch-options input,.workspace-stitch .stch-options select{width:100%;min-height:36px;margin:0;padding:4px 8px}
.workspace-stitch details{font-size:12px;color:var(--muted)}.workspace-stitch summary{cursor:pointer}
.stch-pill{border:1px solid var(--rule);color:var(--accent);border-radius:20px;padding:3px 8px;font:650 10px/1.5 ui-monospace,monospace;white-space:nowrap}
.stch-preview{position:relative;min-height:310px;height:clamp(310px,42vh,422px);padding:12px;display:grid;place-items:center;background-color:#eeeee3;background-image:radial-gradient(#bbc7b6 .8px,transparent .8px);background-size:12px 12px;border:1px solid var(--line);border-radius:7px}
.stch-preview canvas{display:block;max-width:100%;max-height:100%;min-width:0;min-height:0;object-fit:contain;box-shadow:0 4px 15px #162a253d;border-radius:2px;width:auto;height:auto}
.stch-empty{text-align:center;color:var(--muted);font-size:13px}.stch-empty p{margin:4px 0 0}
.stch-export{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:11px}.stch-export strong{font-variant-numeric:tabular-nums;font-size:14px}.stch-export small{display:block;font-size:11px;color:var(--muted)}
.stch-actions{display:flex;align-items:center;gap:6px}.stch-actions select{padding:5px 8px;min-height:40px;margin:0;width:auto}.stch-actions .button{white-space:nowrap;background:var(--accent);color:white;border-color:var(--accent);min-height:40px}
.stch-warning{border:1px solid #c4a66d;background:#fcf4e2;border-radius:7px;padding:9px 11px;margin-top:9px;font-size:12px;color:#624c22}.stch-warning p{margin:1px 0 6px}.stch-warning .button{min-height:33px;padding:4px 9px}
.workspace-stitch #status,.workspace-stitch #inputHint{font-size:11px;margin:5px 0 0;min-height:1.4em}
@media(max-width:760px){.tool-page[data-lab="image-stitch"] .workspace-stitch .workspace-layout{grid-template-columns:1fr}.workspace-stitch .workspace-result{border-left:0;border-top:1px solid var(--line)}.workspace-stitch .workspace-input,.workspace-stitch .workspace-result{padding:13px}.workspace-stitch .workspace-header{padding:11px 13px}.stch-preview{min-height:275px;height:330px}.stch-list button{min-width:32px;min-height:34px}}
@media(max-width:380px){.stch-actions .button{padding-inline:7px}.stch-export strong{font-size:12px}.stch-preview{height:278px}}
.free-canvas{touch-action:none;user-select:none;cursor:grab;outline-offset:2px}
.free-help{margin:-4px 0 7px;font-size:12px;color:var(--muted)}
.free-layer{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;margin-top:7px;color:var(--muted)}
.free-layer>span{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.free-layer>div{display:flex;gap:5px;flex-shrink:0}
.free-layer .button{padding:5px 8px;min-height:32px;font-size:11px}
.stch-list .name[role=button]{cursor:pointer}.stch-list .name[role=button]:hover{text-decoration:underline}
@media(max-width:420px){.workspace-stitch .choice-option{padding-inline:7px}.workspace-stitch .choice-option span{font-size:11px}}
.free-help{display:flex;justify-content:space-between;align-items:center;gap:6px}
.free-help label{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;white-space:nowrap;cursor:pointer}
.free-help input{width:15px;height:15px;min-height:0;padding:0;margin:0;accent-color:var(--accent)}

.workspace-stitch .stch-mode-picker{margin:0 0 12px;padding:0;border:0;min-width:0}
.stch-mode-picker .choice-set{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%}
.stch-mode-picker .choice-option{padding-inline:7px;text-align:center}
.stch-mode-picker .choice-option span{white-space:nowrap}
.stch-mode-picker .choice-option:has(input[value=free]:not(:checked)){border-left:1px solid var(--rule);border-radius:0 5px 5px 0}
.stch-mode-picker>p{margin:5px 0 0;font-size:11px}
.preview-actions{display:flex;align-items:center;gap:6px}
#gap-field{grid-template-columns:minmax(90px,160px)}
@media(max-width:450px){.stch-mode-picker .choice-set{grid-template-columns:repeat(2,minmax(0,1fr))}.stch-mode-picker .choice-option span{font-size:12px}.preview-actions{gap:3px}}

.workspace-stitch .stch-preview{display:block;overflow:auto;padding:0;overscroll-behavior:contain}
.stch-viewport-content{width:max-content;min-width:100%;min-height:100%;padding:12px;display:grid;align-content:center;justify-items:center}
.workspace-stitch .stch-preview canvas{max-height:none;max-width:none;flex:none}
.zoom-tools{display:inline-flex;align-items:center;gap:2px;border:1px solid var(--rule);background:var(--sheet);border-radius:6px;padding:2px}
.zoom-tools button{border:0;border-radius:4px;background:transparent;color:var(--accent);cursor:pointer;font-size:13px;min-width:29px;min-height:29px;padding:1px 5px}
.zoom-tools button:hover:not(:disabled),.zoom-tools button[aria-pressed=true]{background:var(--mint)}
.zoom-tools button:disabled{opacity:.42}
.free-canvas.hand-mode{touch-action:pan-x pan-y}.free-tools{display:flex;align-items:center;gap:8px;flex-shrink:0}.free-tools button{background:var(--sheet);border:1px solid var(--rule);border-radius:5px;color:var(--accent);padding:3px 7px;cursor:pointer}.free-tools button[aria-pressed=true]{background:var(--mint)}
.zoom-tools output{min-width:40px;text-align:center;font-size:11px;font-variant-numeric:tabular-nums}
@media(max-width:540px){.workspace-stitch .preview-actions .stch-pill{display:none}.zoom-tools button{min-width:31px;min-height:32px}.zoom-tools output{min-width:34px}}
.workspace-stitch #preview-stage{position:relative;overflow:hidden;touch-action:none}
.stch-viewport-content{display:contents}
.workspace-stitch #preview-stage canvas{position:absolute;display:block;max-width:none;max-height:none;touch-action:none;border-radius:0}
.workspace-stitch #preview-stage .stch-empty{position:absolute;inset:0;display:grid;place-content:center}
#preview-stage.is-panning,#preview-stage.is-panning canvas{cursor:grabbing!important}
.stch-mode-picker .choice-option:has(input[value=free]:not(:checked)){border-left:0;border-radius:5px}


.size-control{position:relative;min-width:0}
.size-control small{margin-left:1px;margin-top:3px}
.size-edit{display:inline-flex;gap:7px;align-items:center;max-width:100%;padding:5px 8px;color:var(--ink);background:var(--sheet);border:1px solid var(--line);border-radius:7px;cursor:pointer;white-space:nowrap}
.size-edit svg{color:var(--accent);flex-shrink:0}
.size-edit:not(:disabled):hover,.size-edit[aria-expanded=true]{background:var(--mint);border-color:var(--accent)}
.size-edit:disabled{background:none;border:0;padding:0;cursor:default}
.size-edit:disabled svg{display:none}
.size-pop{position:absolute;z-index:5;bottom:calc(100% + 8px);left:0;width:258px;max-width:calc(100vw - 64px);border:1px solid var(--rule);border-radius:10px;background:var(--sheet);box-shadow:0 8px 24px #182b2250;padding:12px;margin:0}
.size-pop>strong{display:block;margin-bottom:8px}
.size-fields{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:5px}
.size-fields label{display:flex;align-items:center;gap:4px;margin:0;padding:0 6px;color:var(--muted);border:1px solid var(--line);border-radius:6px;background:var(--linen);font-size:11px}
.size-fields label:focus-within{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.size-fields label input,.workspace .size-fields label input{flex:1 1 0;width:100%;min-width:0;margin:0;padding:5px 0;min-height:30px;font-size:13px;border:0;box-shadow:none;background:none;color:var(--ink);font-variant-numeric:tabular-nums}
.size-fields label input:focus-visible{outline:none}
.size-times{color:var(--muted)}
.size-error{color:#a23521;font-size:11px;margin:6px 0 0}
.size-pop-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:10px}
.size-pop-actions .button{min-height:32px;padding:4px 9px}
.size-pop-actions button[type=submit]{background:var(--accent);color:#fff;border-color:var(--accent)}
.workspace-stitch .stch-list button.name {text-align: start; min-width: 0; padding-inline: 2px}
