/* Browser-local image workbench: keep the site's purple palette and shared rail. */
.iw-local-note{font-size:13px;color:var(--muted);line-height:1.8;margin-bottom:26px}
.iw-upload{display:flex;gap:20px;align-items:center;justify-content:space-between}.iw-upload p{margin-bottom:0}.iw-upload .button{flex-shrink:0}.iw-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:20px;align-items:start}.iw-layout[hidden]{display:none}.iw-stage-panel{min-width:0;position:sticky;top:20px}.iw-stage-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;font-size:15px}.iw-stage{position:relative;background:repeating-conic-gradient(#ece9f1 0 25%,#fff 0 50%) 0/20px 20px;border:1px solid #e4dcef;border-radius:14px;overflow:hidden;line-height:0;text-align:center;min-width:0}.iw-stage canvas{display:block;max-width:100%;max-height:65vh;width:auto;height:auto;margin:auto}.iw-stage canvas.iw-interactive{touch-action:none;cursor:crosshair}#iw-crop-box{position:absolute;pointer-events:none;border:2px solid #8152de;background:#9362e922;box-shadow:0 0 0 9999px #21163855}.iw-stage-panel .tool-hint{overflow-wrap:anywhere;line-height:1.7}.iw-settings{padding:20px;min-width:0}.iw-settings h2{font-size:18px;line-height:1.5}.iw-settings label{display:flex;flex-direction:column;gap:7px;font-size:13px;margin-top:14px;min-width:0}.iw-settings p{font-size:12px;line-height:1.8}.iw-settings input:not([type=checkbox]),.iw-settings select{width:100%;min-width:0;padding:9px;border:1px solid var(--line);background:#fff;border-radius:8px;color:var(--ink);font:inherit}.iw-settings input[type=range]{padding:0;accent-color:#7953d7}.iw-settings input[type=color]{height:40px;padding:4px}.iw-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.iw-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}.iw-actions .button{font-size:13px;justify-content:center}.iw-settings .iw-check{flex-direction:row;align-items:center}.iw-settings .iw-check input{width:auto}.iw-export{border-top:1px solid var(--line);margin-top:24px;padding-top:12px}.iw-export h3{font-size:15px}.iw-settings .button[aria-pressed=true]{background:#ede4fc;color:#6940bd;border-color:#ad8fe8}.iw-swatch{height:64px;background:repeating-conic-gradient(#eee 0 25%,#fff 0 50%) 0/16px 16px;border:1px solid var(--line);border-radius:10px;margin-top:20px}.iw-full-scroll{overflow:auto;max-height:70vh;background:repeating-conic-gradient(#eee 0 25%,white 0 50%) 0/20px 20px;margin-top:16px}.iw-full-scroll canvas{display:block;max-width:none;margin:auto}.iw-stitch-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}.iw-stitch-item{display:grid;grid-template-columns:64px minmax(0,1fr);gap:12px;border:1px solid var(--line);border-radius:12px;padding:12px;background:#fff9}.iw-stitch-item img{width:64px;height:64px;object-fit:contain;background:#f1edf7;border-radius:8px}.iw-stitch-item strong{display:block;font-size:13px;overflow-wrap:anywhere}.iw-stitch-item p{font-size:12px;margin:6px 0;color:var(--muted)}.iw-stitch-item .iw-actions{margin:6px 0 0;gap:8px}.iw-stitch-item button{font-size:12px}.iw-stitch-list:empty{display:none}#iw-stitch-stage{margin-top:20px}#iw-stitch-options input[type=color]{height:42px;padding:4px}
@media(max-width:1050px){.iw-layout{grid-template-columns:minmax(0,1fr)}.iw-stage-panel{position:static}.iw-stage canvas{max-height:55vh}.iw-settings{padding:22px}.iw-stitch-list{grid-template-columns:1fr}}
@media(max-width:600px){.iw-upload{align-items:stretch;flex-direction:column}.iw-stage-head{flex-wrap:wrap}.iw-settings{padding:16px}.iw-layout{gap:16px}.iw-stage canvas{max-height:50vh}.iw-fields{gap:10px}}
/* Direct manipulation handles remain usable with a mouse or touch. */
#iw-crop-box{pointer-events:auto;touch-action:none;cursor:move;outline:none;box-sizing:border-box}#iw-crop-box:focus-visible{outline:2px solid #fff;outline-offset:3px}.iw-crop-handle{position:absolute;width:24px;height:24px;border:0;background:transparent;padding:0;transform:translate(-50%,-50%);touch-action:none;z-index:2}.iw-crop-handle::after{content:'';position:absolute;inset:6px;background:#fff;border:2px solid #7953d7;border-radius:3px}.iw-crop-handle[data-crop-handle=nw]{left:0;top:0;cursor:nwse-resize}.iw-crop-handle[data-crop-handle=n]{left:50%;top:0;cursor:ns-resize}.iw-crop-handle[data-crop-handle=ne]{left:100%;top:0;cursor:nesw-resize}.iw-crop-handle[data-crop-handle=e]{left:100%;top:50%;cursor:ew-resize}.iw-crop-handle[data-crop-handle=se]{left:100%;top:100%;cursor:nwse-resize}.iw-crop-handle[data-crop-handle=s]{left:50%;top:100%;cursor:ns-resize}.iw-crop-handle[data-crop-handle=sw]{left:0;top:100%;cursor:nesw-resize}.iw-crop-handle[data-crop-handle=w]{left:0;top:50%;cursor:ew-resize}.iw-drawing #iw-crop-box{cursor:crosshair}.iw-dragging{user-select:none}#iw-crop-new[aria-pressed=true]{background:#efe7fc;border-color:#9875dd}#iw-watermark-box{position:absolute;border:1px dashed #7953d7;outline:1px solid #fff8;cursor:move;touch-action:none;box-sizing:border-box}.iw-stitch-grip{cursor:grab;touch-action:none;border:1px solid #ded3ef;border-radius:6px;padding:6px 10px;background:#f8f4ff;color:#7953d7;font:inherit;font-size:12px}.iw-stitch-item.iw-sort-source{opacity:.5}.iw-stitch-item.iw-sort-target{outline:2px solid #7953d7;background:#f0e8ff}
@media(pointer:coarse){.iw-crop-handle{width:32px;height:32px}.iw-crop-handle::after{inset:9px}}

#iw-watermark-box{transform-origin:center}#iw-watermark-rotate{position:absolute;right:0;top:50%;transform:translateY(-50%);width:30px;height:30px;border:2px solid #7953d7;border-radius:50%;background:#fff;color:#7953d7;font:22px/1 sans-serif;padding:0;cursor:grab;touch-action:none;box-shadow:0 2px 8px #37205725}#iw-watermark-rotate:focus-visible{outline:2px solid #7953d7;outline-offset:3px}

#iw-watermark-rotate{right:auto;transform:translate(-50%,-50%);z-index:3}

#iw-grid-result{padding:16px;border:1px solid var(--line);border-radius:14px;background:#f5f0fc}#iw-grid-result[hidden]{display:none}#iw-grid-tiles{display:grid;margin:12px auto;max-width:100%;background:transparent}#iw-grid-tiles canvas{display:block;width:100%;height:100%;min-width:0;border-radius:3px;background:repeating-conic-gradient(#eee 0 25%,#fff 0 50%) 0/12px 12px}#iw-grid-result .button{font-size:13px}#iw-stage[hidden]{display:none}

.cl-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px;align-items:start}.cl-preview{position:sticky;top:20px;min-width:0}#cl-canvas{touch-action:none;cursor:grab}#cl-templates{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:14px 0}#cl-templates button{padding:5px;border:1px solid var(--line);border-radius:8px;background:#fff;color:#bca7e6;cursor:pointer}#cl-templates button[aria-pressed=true]{border-color:#7953d7;background:#f0e8fc;color:#7953d7}#cl-templates svg{width:100%;display:block}#cl-image-options{border:1px solid var(--line);border-radius:10px;margin:16px 0;padding:10px}#cl-full{max-width:100%;height:auto}.cl-preview .tool-hint{line-height:1.8}@media(max-width:1050px){.cl-layout{grid-template-columns:1fr}.cl-preview{position:static}}

.cl-canvas-options{margin:18px 0;border:1px solid var(--line);padding:12px;border-radius:10px}.cl-canvas-options summary,.cl-advanced summary{cursor:pointer;font-size:14px;font-weight:600;line-height:1.6}.cl-canvas-options small{display:block;font-weight:400;font-size:12px;color:var(--muted);margin:4px 0 0 16px}.cl-photo-editor{border-top:1px solid var(--line);padding-top:18px;margin-top:18px}.cl-help{color:var(--muted)}#cl-thumbnails{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:14px 0}#cl-thumbnails button{position:relative;aspect-ratio:1;background:#f5f1fb;border:2px solid transparent;border-radius:9px;padding:3px;cursor:pointer;overflow:hidden}#cl-thumbnails button[aria-pressed=true]{border-color:#7953d7;background:#ede3fc}#cl-thumbnails canvas{width:100%;height:100%;display:block}#cl-thumbnails span{position:absolute;top:2px;left:2px;z-index:1;background:#7953d7;color:white;border-radius:4px;min-width:17px;font-size:11px;padding:1px 3px}#cl-thumbnails b{font-size:24px;color:#8d70c0}.cl-current{display:flex;flex-direction:column;gap:5px;background:#f4effb;padding:12px;border-radius:9px}.cl-current strong{font-size:15px;color:#6942b5}#cl-file-name{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.cl-advanced{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}.cl-advanced .button{margin-top:10px}#cl-image-options{border:0;padding:0;margin:12px 0}#cl-image-options legend{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
