/* Independent editor surface for the Stitch workspace mode. */
#app-shell[data-mode="stitch"] .mode-placeholder.stitch-workspace{display:flex;align-items:stretch;justify-content:stretch;padding:22px 28px;background:var(--surface);overflow:auto}
#app-shell[data-mode="stitch"] .mode-sidebar-placeholder.stitch-sidebar{display:block;text-align:left;padding:4px 0 18px;color:var(--secondary)}
.stitch-sidebar{--stitch-accent:#b85f43;--stitch-ink:#263247}
.stitch-panel-head{padding:5px 0 18px;border-bottom:1px solid var(--border);margin-bottom:18px}
.stitch-eyebrow{display:block;color:var(--muted);font-size:9px;font-weight:700;letter-spacing:.15em}
.stitch-panel-head h2{margin:6px 0 7px;font-size:18px;line-height:1.25;color:var(--text)}
.stitch-panel-head p,.stitch-help{font-size:11px;line-height:1.65;color:var(--muted)}
.stitch-control-block{padding:0 0 17px;margin:0 0 16px;border-bottom:1px solid var(--border)}
.stitch-label,.stitch-label-row{display:flex;align-items:center;justify-content:space-between;color:var(--text);font-size:12px;font-weight:600;margin-bottom:9px}
.stitch-count,.stitch-label-row output{font-size:11px;color:var(--muted);font-weight:500}
.stitch-segmented{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.stitch-segmented button{height:36px;background:var(--panel-soft);border-color:var(--border);font-size:12px;color:var(--secondary)}
.stitch-segmented button.is-active{background:var(--primary-soft);border-color:var(--primary);color:var(--primary);font-weight:650}
.stitch-add-button{width:100%;height:37px;display:flex;align-items:center;justify-content:center;gap:7px;border:1px dashed color-mix(in srgb,var(--primary) 50%,var(--border));background:var(--primary-soft);color:var(--primary);font-size:12px;font-weight:600}
.stitch-add-button span{font-size:19px;font-weight:400;line-height:1}
.stitch-photo-list{display:grid;gap:6px;margin-top:9px}
.stitch-photo-row{display:grid;grid-template-columns:34px minmax(0,1fr) 25px 25px 25px;align-items:center;gap:4px;padding:4px;border:1px solid var(--border);border-radius:7px;background:var(--panel-soft);min-width:0}
.stitch-photo-row.is-dragging{opacity:.45}
.stitch-photo-row>img{width:34px;height:34px;object-fit:cover;border-radius:4px;background:var(--surface)}
.stitch-photo-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:var(--secondary);padding:0 4px}
.stitch-photo-row>button{height:25px;min-width:0;padding:0;border:0;background:transparent;color:var(--muted);font-size:14px}
.stitch-photo-row>button:hover{color:var(--primary);background:var(--control-hover)}
.stitch-photo-row>button:disabled{opacity:.3}
.stitch-upload-divider{padding:0;border:0;background:transparent;color:var(--primary);font-size:10px}
.stitch-help{margin:-3px 0 9px}
.stitch-divider-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.stitch-divider-option{min-width:0;min-height:71px;padding:5px 6px 6px;display:grid;gap:4px;justify-items:center;border:1px solid var(--border);background:var(--panel);color:var(--muted);font-size:9px;line-height:1.25;text-align:center;border-radius:6px}
.stitch-divider-option img{width:100%;height:43px;object-fit:contain;border-radius:3px;background-color:var(--panel-soft)}
.stitch-divider-option img{background-color:var(--panel-soft);background-image:linear-gradient(45deg,color-mix(in srgb,var(--muted) 9%,transparent) 25%,transparent 25%,transparent 75%,color-mix(in srgb,var(--muted) 9%,transparent) 75%),linear-gradient(45deg,color-mix(in srgb,var(--muted) 9%,transparent) 25%,transparent 25%,transparent 75%,color-mix(in srgb,var(--muted) 9%,transparent) 75%);background-position:0 0,5px 5px;background-size:10px 10px}
.stitch-divider-option span{max-width:100%;overflow-wrap:anywhere}
.stitch-divider-option.is-active{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary);color:var(--primary);background:var(--primary-soft)}
.stitch-divider-none{width:100%;height:43px;display:grid;place-items:center;border-radius:3px;background:linear-gradient(135deg,#f5f1e9 25%,#e9e3d8 25%,#e9e3d8 50%,#f5f1e9 50%,#f5f1e9 75%,#e9e3d8 75%);background-size:12px 12px;color:#6d6a62}
.stitch-custom-divider{display:flex;align-items:center;gap:7px;margin-top:8px;padding:5px;border:1px solid var(--border);border-radius:5px;font-size:10px;color:var(--secondary)}
.stitch-custom-divider[hidden]{display:none}
.stitch-custom-divider img{width:28px;height:28px;object-fit:cover;border-radius:3px}
.stitch-custom-divider span{flex:1}
.stitch-custom-divider button{border:0;background:none;color:var(--primary);font-size:10px;padding:3px}
.stitch-control-block[hidden]{display:none!important}
#stitch-gap{width:100%;margin:4px 0 0}
.stitch-range-hints{display:flex;justify-content:space-between;color:var(--muted);font-size:9px;margin-top:5px}
.stitch-color-row{display:flex;align-items:center;gap:7px}
.stitch-color-row input{width:34px;height:30px;padding:2px;border-radius:5px}
.stitch-color-row span{flex:1;font-size:10px;color:var(--muted)}
.stitch-color-row button{width:18px;height:18px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--stitch-swatch,#fff)}
.stitch-color-row button[data-stitch-bg="#f8f5ef"]{--stitch-swatch:#f8f5ef}.stitch-color-row button[data-stitch-bg="#ffffff"]{--stitch-swatch:#fff}.stitch-color-row button[data-stitch-bg="#1e293b"]{--stitch-swatch:#1e293b}.stitch-color-row button[data-stitch-bg="#dce8ed"]{--stitch-swatch:#dce8ed}
#stitch-export-size{width:100%;height:35px;font-size:11px;background:var(--panel);color:var(--secondary)}
.stitch-side-note{padding:5px 0;color:var(--muted);font-size:10px;line-height:1.8}
.stitch-side-note span{display:block}
.stitch-workbench{width:min(100%,1440px);min-height:0;display:flex;flex-direction:column;margin:auto}
.stitch-workbench-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 0 16px;border-bottom:1px solid var(--border)}
.stitch-workbench-head h1{margin:5px 0 0;color:var(--text);font-size:19px;line-height:1.3;font-weight:650;letter-spacing:-.02em}
.stitch-workbench-intro{max-width:760px;margin:7px 0 0;color:var(--muted);font-size:12px;line-height:1.65}
.stitch-head-actions{display:flex;align-items:center;gap:8px}
.stitch-quality-label{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:10px;white-space:nowrap}
.stitch-quality-label select{height:34px;width:112px;padding:4px 7px;font-size:10px;background:var(--panel);color:var(--secondary)}
.stitch-quiet-button,.stitch-export-button{height:35px;padding:0 13px;font-size:11px;white-space:nowrap}
.stitch-quiet-button{background:var(--panel);border-color:var(--border);color:var(--secondary)}
.stitch-export-button{background:var(--primary);border-color:var(--primary);color:var(--accent-contrast);font-weight:650}
.stitch-export-button:hover{background:var(--primary-hover);border-color:var(--primary-hover);color:var(--accent-contrast)}
.stitch-preview-wrap{position:relative;flex:1;min-width:0;min-height:360px;height:calc(100dvh - 260px);max-height:760px;display:flex;align-items:center;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;margin:18px 0 0;padding:24px;border:1px solid var(--border);border-radius:10px;background:var(--panel);box-shadow:var(--shadow-soft);transition:border-color .15s,background .15s;scrollbar-width:thin;scrollbar-color:var(--scroll-thumb) transparent}
.stitch-preview-wrap.is-dragging{border:2px dashed var(--primary);background:var(--primary-soft)}
#stitch-canvas{display:block;flex:0 0 auto;width:auto;height:calc(100% - 2px);max-width:none;max-height:none;object-fit:contain;box-shadow:0 3px 18px #172b4d15}
.stitch-preview-wrap.is-vertical{height:auto;min-height:300px;max-height:none;display:flex;justify-content:center;align-items:flex-start;overflow:visible}
.stitch-preview-wrap.is-vertical #stitch-canvas{width:100%;height:auto;max-width:min(100%,900px);max-height:none}
.stitch-divider-option.is-vertical img{transform:rotate(90deg);width:43px;height:100%;max-height:43px;justify-self:center}
.stitch-empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;color:var(--muted)}
.stitch-empty-mark{display:grid;place-items:center;width:52px;height:52px;margin-bottom:13px;border:1px solid var(--border);border-radius:50%;background:var(--panel-soft);color:var(--primary);font-size:25px;font-weight:300}
.stitch-empty-state h2{color:var(--text);font-size:15px;font-weight:600;margin-bottom:7px}
.stitch-empty-state p{font-size:11px;line-height:1.7}
.stitch-empty-upload{margin-top:15px;padding:9px 20px;background:var(--primary);border-color:var(--primary);color:var(--accent-contrast);font-size:11px;font-weight:600}
.stitch-empty-state>span{margin-top:9px;font-size:10px;color:var(--muted)}
.stitch-preview-footer{display:flex;justify-content:space-between;gap:12px;padding:11px 1px 0;color:var(--muted);font-size:10px}
.stitch-preview-footer b{color:var(--secondary);font-weight:600}
.stitch-preview-wrap:has(.stitch-empty-state:not([hidden])){justify-content:center;align-items:center}
.stitch-preview-wrap.is-vertical:has(.stitch-empty-state:not([hidden])){height:min(62dvh,540px);min-height:380px;align-items:center;justify-content:center;overflow:hidden}
.stitch-empty-state{width:min(100%,420px);padding:26px 24px}
.stitch-empty-state h2{margin:0 0 7px}
.stitch-empty-state p{max-width:350px;margin:0}
.stitch-empty-upload{min-width:150px;min-height:42px;border-radius:7px}
@media(max-width:680px){.stitch-workbench-intro{font-size:11px}.stitch-preview-wrap.is-vertical:has(.stitch-empty-state:not([hidden])){height:380px;min-height:340px}.stitch-empty-state{padding:18px 10px}}
@media(max-width:1024px){#app-shell[data-mode="stitch"] .mode-placeholder.stitch-workspace{padding:18px}.stitch-preview-wrap{height:calc(100dvh - 250px);max-height:760px}}
@media(max-width:680px){#app-shell[data-mode="stitch"] .mode-placeholder.stitch-workspace{padding:14px 12px}.stitch-workbench-head{align-items:flex-start;flex-direction:column}.stitch-workbench-head h1{font-size:17px}.stitch-head-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:5px}.stitch-quality-label{grid-column:1/-1;display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px}.stitch-quality-label select{width:100%}.stitch-quiet-button,.stitch-export-button{min-width:0;padding-inline:5px;font-size:10px}.stitch-preview-wrap{height:calc(100dvh - 310px);min-height:340px;max-height:620px;padding:12px}.stitch-preview-wrap.is-vertical{height:auto;min-height:240px;max-height:none}.stitch-preview-footer{font-size:9px}.stitch-panel-head h2{font-size:16px}}

/* Stitch preview uses the short edge as its scale reference. Vertical strips
   extend the document; horizontal strips keep their own horizontal scroller. */
#app-shell[data-mode="stitch"]{height:auto;min-height:calc(100dvh - var(--nav));overflow:visible;align-items:stretch}
#app-shell[data-mode="stitch"]>.workspace{height:auto;min-height:calc(100dvh - var(--nav));overflow:visible;flex:1 0 auto}
#app-shell[data-mode="stitch"] .mode-placeholder.stitch-workspace{width:100%;min-width:0;min-height:calc(100dvh - var(--nav));flex:1 0 auto;align-items:stretch;overflow:visible}
#app-shell[data-mode="stitch"]>.workspace{width:0;min-width:0;flex:1 1 0%}
#app-shell[data-mode="stitch"] .stitch-workbench{min-width:0}
#app-shell[data-mode="stitch"].stitch-vertical>.workspace,#app-shell[data-mode="stitch"].stitch-vertical .mode-placeholder.stitch-workspace{height:auto;min-height:0}
#app-shell[data-mode="stitch"].stitch-vertical .stitch-workbench{min-height:calc(100dvh - var(--nav))}
#app-shell[data-mode="stitch"].stitch-vertical .stitch-preview-wrap{flex:0 0 auto;overflow:visible}
