/* The image editor (pages/image-editor.js), inside the editors' frame (editors.css).
   The phone's is components/editors/ImageEditor.tsx. */

.ie-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; box-sizing: border-box; }
.ie-frame { position: relative; overflow: hidden; touch-action: none; flex: none; }
.ie-stage.cropping .ie-frame { overflow: visible; }
.ie-inner { position: absolute; overflow: hidden; }
.ie-img { position: absolute; left: 50%; top: 50%; transform-origin: center; user-select: none; -webkit-user-drag: none; max-width: none; }
.ie-truth { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .18s; pointer-events: none; }
.ie-truth.shown { opacity: 1; }
.ie-stage.cropping .ie-truth { display: none; }
.ie-marks { position: absolute; left: 0; top: 0; overflow: hidden; pointer-events: none; }
/* The marks paint themselves (marks.mjs): none of the editors' glyph strokes. */
.ed-shell svg.ie-marks { stroke: none; fill: none; stroke-width: 1; }
.ie-stage.marking .ie-marks { pointer-events: auto; cursor: crosshair; touch-action: none; }
.ie-stage.marking[data-pen=text] .ie-marks { cursor: text; }
.ie-crop { position: absolute; box-shadow: 0 0 0 9999px rgba(0,0,0,.58); outline: 2px solid #fff; cursor: move; touch-action: none; z-index: 2; }
.ie-grid { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(90deg, transparent 33.1%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.7%, transparent 66.9%),
  linear-gradient(transparent 33.1%, rgba(255,255,255,.35) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,.35) 66.7%, transparent 66.9%); }
/* Corners: the drawn bracket is 26px, the hit area 44px around it. */
.ie-handle { position: absolute; width: 44px; height: 44px; }
.ie-handle::before { content: ''; position: absolute; width: 24px; height: 24px; border: 4px solid #fff; }
.ie-handle.nw { left: -14px; top: -14px; cursor: nwse-resize; }
.ie-handle.nw::before { left: 9px; top: 9px; border-right: 0; border-bottom: 0; }
.ie-handle.ne { right: -14px; top: -14px; cursor: nesw-resize; }
.ie-handle.ne::before { right: 9px; top: 9px; border-left: 0; border-bottom: 0; }
.ie-handle.sw { left: -14px; bottom: -14px; cursor: nesw-resize; }
.ie-handle.sw::before { left: 9px; bottom: 9px; border-right: 0; border-top: 0; }
.ie-handle.se { right: -14px; bottom: -14px; cursor: nwse-resize; }
.ie-handle.se::before { right: 9px; bottom: 9px; border-left: 0; border-top: 0; }

.ie-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ie-oops { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.ie-oops-title { font-size: 18px; font-weight: 800; }
.ie-oops-line { color: var(--ed-dim); font-size: 14px; }

/* words being typed onto the picture */
.ie-type {
  position: absolute; z-index: 4; margin: 0; padding: 0; border: 1.5px dashed rgba(255,255,255,0.85); border-radius: 6px;
  background: rgba(0,0,0,0.12); font-weight: 800; font-family: system-ui, -apple-system, sans-serif; line-height: 1.25;
  resize: none; outline: none; overflow: hidden; white-space: pre; box-sizing: content-box;
}

/* the panel's own parts */
/* Turn, flip and straighten on one line at any width: the slider gives way, its value never goes off the edge. */
.ie-crop-row { flex-wrap: nowrap; overflow: visible; }
.ie-crop-row .ed-slider { flex: 1; min-width: 0; gap: 8px; }
.ie-crop-row .ed-slider label { width: auto; flex: none; }
.ie-crop-row .ed-slider input[type=range] { min-width: 0; width: 100%; }
.ie-crop-row .ed-slider output { width: 36px; flex: none; }
.ed-chip.ie-set:not(.on) { border-color: var(--ed-c); color: #FFB3D6; }
.ed-chip.ie-set:not(.on)::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 3px; background: var(--ed-c); margin-left: 6px; vertical-align: middle; }
/* The looks are pictures: one row that scrolls sideways, with a thin bar a mouse can drag (.ed-row wraps the chips). */
.ie-looks { gap: 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.ie-look { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; border: none; background: none; padding: 0; color: var(--ed-dim); font-size: 12px; font-weight: 700; cursor: pointer; }
.ie-look img { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; border: 2.5px solid transparent; background: #222; }
.ie-look.on { color: var(--ed-ink); }
.ie-look.on img { border-color: var(--ed-c); }
.ie-sep { flex: none; width: 1px; height: 28px; background: var(--ed-border); margin: 0 2px; }
.ie-width {
  flex: none; width: 44px; height: 44px; border-radius: 16px; border: 1px solid var(--ed-border); background: var(--ed-raised);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ed-ink);
}
.ie-width.on { border-color: var(--ed-ink); box-shadow: inset 0 0 0 1px var(--ed-ink); }
.ie-width > span { border-radius: 50%; display: block; }
.ie-size b { font-weight: 900; line-height: 1; }
.ie-boxed b { font-size: 14px; font-weight: 900; padding: 3px 6px; border-radius: 6px; line-height: 1; }
.ed-panel .grow { flex: 1; }
