.image-selection {
  width: 100%;
  min-width: 0;
}
.image-selection-stage {
  position: relative;
  width: 100%;
  border-radius: 10px;
  line-height: 0;
  background: #edf1ef;
  isolation: isolate;
}
.image-selection-stage[data-editable="true"] {
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.image-selection-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: inherit;
  object-fit: contain;
  -webkit-user-drag: none;
}
.image-selection-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
}
.image-selection-mask svg {
  display: block;
}
.image-selection-rect {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #fff;
  outline: 2px solid #118477;
  box-shadow: inset 0 0 0 1px #118477;
  z-index: 1;
}
.image-selection-stage[data-editable="true"] .image-selection-rect {
  cursor: move;
}
.image-selection-rect:focus-visible {
  outline: 3px solid #1365d7;
}
.image-selection-handle {
  position: absolute;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  touch-action: none;
}
.image-selection-handle::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid #fff;
  border-radius: 3px;
  background: #118477;
  box-shadow: 0 0 0 1px #118477;
}
.image-selection-handle-nw { left: 0; top: 0; cursor: nwse-resize; }
.image-selection-handle-ne { left: 100%; top: 0; cursor: nesw-resize; }
.image-selection-handle-sw { left: 0; top: 100%; cursor: nesw-resize; }
.image-selection-handle-se { left: 100%; top: 100%; cursor: nwse-resize; }
.image-selection-instructions {
  margin: 12px 0 0;
  color: #596763;
  font-size: 12px;
  line-height: 1.6;
}
.image-selection [hidden] {
  display: none !important;
}
.image-selection-enlarge{margin:12px;min-height:44px}
.selection-large-dialog{width:min(1120px,96vw);max-width:96vw;max-height:94dvh;padding:0;border:1px solid #ddd7ca;border-radius:18px;background:#faf9f5;color:#252922;overflow:hidden}
.selection-large-dialog[open]{display:flex;flex-direction:column}
.selection-large-dialog::backdrop{background:rgba(25,28,24,.64)}
.selection-large-header,.selection-large-tools,.selection-large-footer{display:flex;flex-shrink:0;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px}
.selection-large-header h3{margin:0;font-size:20px}
.selection-large-tools{flex-wrap:wrap;border-top:1px solid #e7e2d8}
.selection-large-tools label{display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:14px}
.selection-large-tools input{width:min(220px,36vw);accent-color:#80543c}
.selection-large-tools span{min-width:3em;font-variant-numeric:tabular-nums}
.selection-large-viewport{height:55dvh;min-height:0;overflow:auto;overscroll-behavior:contain;background:#eae8e1}
.selection-large-image{width:100%;margin-inline:auto}
.selection-large-viewport .image-selection-instructions{display:none}
.selection-large-dialog button{min-height:44px}
.selection-large-footer p{margin:0;font-size:13px;line-height:1.6;max-width:60ch}
@media(max-width:600px){.selection-large-dialog{width:98vw;max-width:98vw;max-height:96dvh;border-radius:12px}.selection-large-header,.selection-large-tools,.selection-large-footer{padding:10px 12px}.selection-large-footer{align-items:stretch;flex-direction:column}.selection-large-viewport{height:50dvh}}
@media(pointer:coarse){.image-selection-handle{width:44px;height:44px}.image-selection-handle::after{inset:16px}}
