/* 画像の切り抜き・回転（共通部品は imgkit.css） */
.icr-error { margin: var(--az-space-3) 0 0; white-space: normal; }
.icr-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--az-space-2) var(--az-space-3); margin-bottom: var(--az-space-3); }
.icr-toolbar .az-segmented { flex-wrap: wrap; }
.icr-tools { display: flex; flex-wrap: wrap; gap: var(--az-space-2); }
.icr-tools [aria-pressed="true"] { color: var(--az-color-primary-text); background: var(--az-color-primary-subtle); border-color: var(--az-color-primary-border); }
.icr-flipx { transform: scaleX(-1); }

.icr-stage-wrap { display: grid; place-items: center; padding: var(--az-space-4); border: 1px solid var(--az-color-border-subtle); border-radius: var(--az-radius-lg); overflow: hidden; }
.icr-stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.icr-stage canvas { display: block; max-width: 100%; max-height: 65vh; width: auto; height: auto; }
.icr-box { position: absolute; box-sizing: border-box; border: 1px solid var(--az-color-bg-surface); outline: 1px dashed var(--az-color-text-strong); box-shadow: 0 0 0 100vmax var(--az-color-bg-overlay); cursor: move; touch-action: none; }
.icr-box:focus-visible { outline: 2px solid var(--az-color-focus-border); }
.icr-box::before, .icr-box::after { content: ""; position: absolute; pointer-events: none; opacity: 0.7; border: 0 solid var(--az-color-bg-surface); }
.icr-box::before { top: 0; bottom: 0; left: 33.333%; width: 33.333%; border-left-width: 1px; border-right-width: 1px; }
.icr-box::after { left: 0; right: 0; top: 33.333%; height: 33.333%; border-top-width: 1px; border-bottom-width: 1px; }
.icr-h { position: absolute; z-index: 1; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: var(--az-color-bg-surface); border: 2px solid var(--az-color-primary-default); border-radius: 3px; }
.icr-h::after { content: ""; position: absolute; inset: -12px; }
.icr-h[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.icr-h[data-h="n"] { left: 50%; top: 0; cursor: ns-resize; }
.icr-h[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.icr-h[data-h="w"] { left: 0; top: 50%; cursor: ew-resize; }
.icr-h[data-h="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.icr-h[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.icr-h[data-h="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.icr-h[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }

.icr-nums { display: flex; flex-wrap: wrap; align-items: center; gap: var(--az-space-2) var(--az-space-3); margin-top: var(--az-space-3); }
.icr-nums .az-input { width: 6em; }

.icr-result { display: flex; flex-wrap: wrap; align-items: center; gap: var(--az-space-4); margin-top: var(--az-space-5); padding: var(--az-space-4); background: var(--az-color-bg-subtle); border: 1px solid var(--az-color-border-subtle); border-radius: var(--az-radius-lg); }
.icr-result__thumb { display: grid; place-items: center; width: 8rem; height: 8rem; border: 1px solid var(--az-color-border-subtle); border-radius: var(--az-radius-md); overflow: hidden; }
.icr-result__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.icr-result__thumb img:not([src]) { display: none; }
.icr-result__body { flex: 1; min-width: 12rem; display: grid; gap: var(--az-space-2); }
.icr-result__name { margin: 0; font-weight: var(--az-font-weight-bold); color: var(--az-color-text-strong); overflow-wrap: anywhere; }
.icr-result__actions { display: flex; flex-wrap: wrap; gap: var(--az-space-2); }
.icr-result__actions label { position: relative; overflow: hidden; }
.icr-hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 640px) {
  .icr-stage-wrap { padding: var(--az-space-2); }
  .icr-stage canvas { max-height: 55vh; }
}
