/* V1.6.4.7 — worksheet writing lines and non-destructive image crop. */
.paper-element.is-writing{cursor:grab;touch-action:none;overflow:visible}
.sw-writing-rule{position:absolute;left:0;right:0;height:0;pointer-events:none;box-sizing:border-box}
.paper-element.is-line{min-height:0!important;cursor:grab;touch-action:none}
.sw-line-hit{position:absolute;left:0;right:0;top:-22px;height:44px;min-width:44px;cursor:grab;touch-action:none;background:transparent}
.paper-element.is-line.selected .sw-line-hit{background:rgba(37,99,235,.06);outline:1px dashed #b0cdfc;border-radius:6px}
.paper-element.is-line .drag-handle{z-index:12}
.sw-crop-window{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.paper-element.is-image .sw-crop-window img.sw-cropped-image{position:absolute;display:block;max-width:none;max-height:none;object-fit:fill;pointer-events:none}
.sw-writing-props{margin:12px 0;padding:12px;border:1px solid #d9e5f4;border-radius:12px;background:#f7faff}
.sw-writing-props h4{margin:0 0 7px;font-size:13px;color:#173b66}
.sw-writing-props .grid-2 label{margin-top:5px}
#swCropButton{margin:12px 0;border-color:#94b8ed;color:#1853a4;background:#eef5ff}
.sw-quick-crop{background:#eef5ff!important;border-color:#9bbff1!important;color:#1655ab!important;white-space:nowrap;font-weight:700}
.sw-crop-dialog{border:0;border-radius:18px;max-width:min(95vw,680px);width:680px;padding:0;background:#fff;box-shadow:0 18px 70px #0e1f405a;color:#162b46}
.sw-crop-dialog::backdrop{background:rgba(9,20,39,.68)}
.sw-crop-panel{padding:18px 20px;max-height:92dvh;overflow:auto}
.sw-crop-panel h2{font-size:19px;margin:0 0 7px}
.sw-crop-panel p{font-size:12px;color:#5f728d;margin:0 0 12px;line-height:1.5}
.sw-crop-stage{position:relative;width:max-content;max-width:100%;margin:0 auto;background:repeating-conic-gradient(#f3f5f9 0 25%,#dfe6f1 0 50%) 50%/18px 18px;overflow:visible;touch-action:none;user-select:none}
.sw-crop-stage>img{display:block;width:auto;max-width:100%;max-height:50dvh;object-fit:contain;user-select:none;pointer-events:none}
.sw-crop-selection{position:absolute;z-index:2;border:2px solid #2563eb;box-shadow:0 0 0 9999px #071b3e66,inset 0 0 0 1px #fff8;cursor:move;touch-action:none;box-sizing:border-box}
.sw-crop-grab{position:absolute;background:#fff;border:3px solid #2563eb;width:24px;height:24px;border-radius:7px;box-shadow:0 1px 7px #1234;touch-action:none}
.sw-crop-nw{top:-13px;left:-13px;cursor:nwse-resize}.sw-crop-se{bottom:-13px;right:-13px;cursor:nwse-resize}
.sw-crop-controls{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:15px 0 12px;font-size:12px;color:#61748e}
.sw-crop-controls select{min-height:40px;padding:7px 10px;border:1px solid #cad8eb;border-radius:8px;margin-left:8px;background:#fff}
.sw-crop-actions{display:flex;gap:8px;flex-wrap:wrap}.sw-crop-actions button{flex:1;min-height:43px;padding:9px;border-radius:9px;background:#f3f6fa;border:1px solid #cbd8e8;color:#314661;font-weight:700;font-size:13px}
#swCropDone{background:#2563eb;color:#fff;border-color:#2563eb}
.sw-crop-panel small{display:block;margin-top:9px;font-size:10px;color:#8a98aa;text-align:center}
@media(max-width:680px){.sw-crop-panel{padding:16px 14px}.sw-crop-stage>img{max-height:45dvh}.sw-crop-actions button{min-width:28%}.sw-crop-panel p{font-size:11px}.sw-writing-props{padding:10px}}
@media print{.sw-line-hit,.sw-crop-dialog,.sw-crop-grab{display:none!important}}
