/* crop.css — 자르기·회전·분할 전용 */
.cr-filebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 8px; min-width: 0; }
.cr-filebar .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cr-stage { padding: 18px; min-height: 280px; }
.cr-view, .cr-split { position: relative; display: inline-block; line-height: 0; max-width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.cr-view canvas, .cr-split canvas { display: block; max-width: 100%; max-height: 68vh; width: auto; height: auto; }

/* 크롭 박스 — 바깥은 어둡게(기능적 마스크) */
.cr-box { position: absolute; box-sizing: border-box; border: 2px solid #fff; outline: 1px solid rgba(0,0,0,.55); box-shadow: 0 0 0 9999px rgba(0,0,0,.52); cursor: move; touch-action: none; }
.cr-box:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.cr-third { position: absolute; background: rgba(255,255,255,.55); pointer-events: none; }
.cr-third.v1, .cr-third.v2 { top: 0; bottom: 0; width: 1px; }
.cr-third.h1, .cr-third.h2 { left: 0; right: 0; height: 1px; }
.cr-third.v1 { left: 33.333%; } .cr-third.v2 { left: 66.666%; }
.cr-third.h1 { top: 33.333%; } .cr-third.h2 { top: 66.666%; }
.cr-box.no-thirds .cr-third { display: none; }
.cr-h { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #fff; border: 1px solid rgba(0,0,0,.6); border-radius: 3px; touch-action: none; }
.cr-h::before { content: ''; position: absolute; inset: -12px; } /* 터치 영역 38px */
.cr-h[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.cr-h[data-h="n"]  { left: 50%; top: 0; cursor: ns-resize; }
.cr-h[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.cr-h[data-h="e"]  { left: 100%; top: 50%; cursor: ew-resize; }
.cr-h[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.cr-h[data-h="s"]  { left: 50%; top: 100%; cursor: ns-resize; }
.cr-h[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.cr-h[data-h="w"]  { left: 0; top: 50%; cursor: ew-resize; }
@media (pointer: coarse) { .cr-h { width: 20px; height: 20px; margin: -10px 0 0 -10px; } }
.cr-size { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); padding: 2px 7px; border-radius: 5px; background: rgba(0,0,0,.66); color: #fff; font-size: .72rem; line-height: 1.5; white-space: nowrap; pointer-events: none; }
.cr-box.dragging .cr-size { background: rgba(0,0,0,.8); }

/* 분할 미리보기 */
.cr-grid { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.cr-grid .dim { fill: rgba(0,0,0,.55); }
.cr-grid .cell { fill: none; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.cr-grid text { fill: #fff; stroke: rgba(0,0,0,.55); stroke-width: 3; paint-order: stroke; vector-effect: non-scaling-stroke; font-weight: 800; text-anchor: middle; dominant-baseline: central; font-family: var(--font); }

/* 사이드 */
.cr-tabs { display: flex; width: 100%; margin-bottom: 16px; }
.cr-tabs button { flex: 1; }
.cr-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.cr-custom { flex-wrap: nowrap; }
.cr-custom .input { width: 80px; }
.cr-rot-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cr-rot-btns .btn { padding: 0 8px; }
.cr-rot-btns .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.cr-tileinfo { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface-2); font-size: .84rem; }
.cr-results:not(:empty) { margin-top: 16px; }
@media (max-width: 480px) {
  .cr-stage { padding: 10px; min-height: 220px; }
  .cr-tabs button { padding: 7px 6px; }
}
