.piece,.piece.selected{border:0;pointer-events:none;background:none}
.piece-visual{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;background:transparent;pointer-events:auto;touch-action:pan-x pan-y;mix-blend-mode:multiply}
.piece .piece-image,.piece .crop-ghost{width:100%;height:100%;object-fit:contain;pointer-events:none}
.piece .crop-ghost{display:none;position:absolute;inset:0;opacity:.2}
.piece-frame{position:absolute;pointer-events:none;border:1px solid transparent;box-sizing:border-box}
.selected .piece-frame{border-color:var(--accent)}
.selected .piece-frame .drag-handle{pointer-events:auto;cursor:move;left:-1px;top:-1px}
.piece.crop-editing{z-index:100!important}
.crop-editing .crop-ghost{display:block}
.crop-editing .piece-visual{cursor:default}
.crop-editing .piece-frame{border:2px solid #0075be;background:linear-gradient(to right,transparent 33%,#fff6 33%,#fff6 calc(33% + 1px),transparent calc(33% + 1px),transparent 66%,#fff6 66%,#fff6 calc(66% + 1px),transparent calc(66% + 1px)),linear-gradient(to bottom,transparent 33%,#fff6 33%,#fff6 calc(33% + 1px),transparent calc(33% + 1px),transparent 66%,#fff6 66%,#fff6 calc(66% + 1px),transparent calc(66% + 1px));box-shadow:0 0 0 1px #fff9}
.crop-editing .drag-handle{display:none}
.crop-handle{position:absolute;padding:0;border:0;background:transparent;pointer-events:auto;touch-action:none;user-select:none;width:28px;height:28px;z-index:2;transform:translate(-50%,-50%)}
.crop-handle[hidden]{display:none}
.crop-handle:after{content:'';position:absolute;width:12px;height:12px;background:#fff;border:2px solid #0075be;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:2px;box-shadow:0 1px 4px #0002}
.crop-n{left:50%;top:0;cursor:ns-resize;width:calc(100% - 38px);min-width:28px}
.crop-s{left:50%;top:100%;cursor:ns-resize;width:calc(100% - 38px);min-width:28px}
.crop-e{left:100%;top:50%;cursor:ew-resize;height:calc(100% - 38px);min-height:28px}
.crop-w{left:0;top:50%;cursor:ew-resize;height:calc(100% - 38px);min-height:28px}
.crop-n:after,.crop-s:after{width:24px;height:7px}
.crop-e:after,.crop-w:after{width:7px;height:24px}
.crop-ne{left:100%;top:0;cursor:nesw-resize}
.crop-nw{left:0;top:0;cursor:nwse-resize}
.crop-se{left:100%;top:100%;cursor:nwse-resize}
.crop-sw{left:0;top:100%;cursor:nesw-resize}
.crop-instruction{font-size:11px;line-height:1.5;color:var(--muted);margin:0;flex:1 1 210px}
.crop-actions{display:flex;gap:8px;flex-wrap:wrap}
.editor .crop-done{background:var(--action);color:var(--white);border-color:var(--action)}
@media(max-width:700px){.crop-handle{width:40px;height:40px}.crop-n,.crop-s{width:calc(100% - 44px);min-width:36px}.crop-e,.crop-w{height:calc(100% - 44px);min-height:36px}.crop-handle:after{width:14px;height:14px}.crop-n:after,.crop-s:after{width:26px;height:9px}.crop-e:after,.crop-w:after{width:9px;height:26px}.crop-instruction{font-size:11px}.crop-actions button{min-height:38px}}
.piece.has-cutout .piece-visual,.piece.has-cutout .piece-image{mix-blend-mode:normal}
.piece.is-processing .piece-image{opacity:.55}
.editor button:disabled{cursor:wait;opacity:.6}
