/* style — the gallery's Crop pop-over (js/panel/44h-gallery-crop.js).
   Simon, 4 Nov 2026: "when we right-click a shot, we can also choose to crop
   it from gallery space". The frame -- card, head, scrub bar, read-out row,
   foot -- is Trim's (48-gallery-trim.css styles #galcrop with #galtrim);
   this is the picture and the box on it. The box is Crop Enhance's marquee
   (cropup.js #cu-marq): a one-pixel accent edge, the size in an accent chip
   under it; outside it the picture is dimmed. */
#galcrop .gcr-stage {
  position: relative; height: min(58vh, 600px); flex: 0 0 auto;
  cursor: crosshair; touch-action: none; user-select: none;
}
#galcrop .gcr-pic { position: relative; flex: 0 0 auto; }
#galcrop .gcr-media {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  object-fit: fill; pointer-events: none; image-orientation: none; background: #000;
}
/* the dimmed outside: a shadow round a box the size of the crop, clipped to
   the picture (the box with the handles is not clipped, so a handle on the
   picture's edge is whole) */
#galcrop .gcr-clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#galcrop .gcr-shade { position: absolute; box-shadow: 0 0 0 9999px rgba(4, 4, 6, .62); }
#galcrop .gcr-box {
  position: absolute; box-sizing: border-box; border: 1px solid var(--accent);
  cursor: move; z-index: 2;
}
/* still the whole picture: a drag inside it draws the first crop */
#galcrop .gcr-box.whole { cursor: crosshair; }
/* thirds, faint, stronger while the box is being dragged */
#galcrop .gcr-g { position: absolute; pointer-events: none; border: 0 solid rgba(255, 255, 255, .16); }
#galcrop .gcr-g.v { top: 0; bottom: 0; left: 33.333%; width: 33.333%; border-left-width: 1px; border-right-width: 1px; }
#galcrop .gcr-g.h { left: 0; right: 0; top: 33.333%; height: 33.333%; border-top-width: 1px; border-bottom-width: 1px; }
#galcrop .gcr-box.dragging .gcr-g { border-color: rgba(255, 255, 255, .38); }
#galcrop .gcr-h {
  position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; box-sizing: border-box;
  background: #fff; border: 1px solid var(--accent); border-radius: 2px; z-index: 3;
}
/* a bigger target than the mark */
#galcrop .gcr-h::after { content: ''; position: absolute; inset: -6px; }
#galcrop .gcr-h[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
#galcrop .gcr-h[data-h="n"] { left: 50%; top: 0; cursor: ns-resize; }
#galcrop .gcr-h[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
#galcrop .gcr-h[data-h="e"] { left: 100%; top: 50%; cursor: ew-resize; }
#galcrop .gcr-h[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
#galcrop .gcr-h[data-h="s"] { left: 50%; top: 100%; cursor: ns-resize; }
#galcrop .gcr-h[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
#galcrop .gcr-h[data-h="w"] { left: 0; top: 50%; cursor: ew-resize; }
#galcrop .gcr-sz {
  position: absolute; left: 0; top: 100%; margin-top: 4px; pointer-events: none;
  font-size: 9.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--accent); color: #fff; padding: 1px 5px; border-radius: 3px; white-space: nowrap;
}
/* at the foot of the picture the chip goes inside the box */
#galcrop .gcr-sz.in { top: auto; bottom: 4px; left: 4px; margin-top: 0; }

/* The read-out row: the ratio pill (Create's, smaller to sit in the row),
   the size in source pixels, what will be saved, and the scale-back switch. */
#galcrop .gcr-ratio { height: 28px; min-width: 132px; flex: 0 0 auto; padding: 0 10px; }
#galcrop .gcr-ratio .tb-sel { font-size: 11.5px; padding-left: 30px; }
#galcrop .gcr-up {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--text);
}
#galcrop .gcr-up input { accent-color: var(--accent); margin: 0; }
#galcrop .gcr-save:disabled { opacity: .45; cursor: default; }
#galcrop.gcr-image .gtr-read { min-height: 28px; }

/* While a crop is being written the source's tile wears Reverse's busy bar
   ("Cropping…", .gal-reversing in 48-gallery-trim.css). */

/* A clip's foot has Export still and a longer Save ("Save crop & trim")
   beside the hint (Simon, 6 Nov 2026): the buttons hold one line and the
   hint wraps instead, so Save never drops onto a row of its own. */
#galcrop.gcr-video .gtr-foot { flex-wrap: nowrap; }
#galcrop.gcr-video .gtr-foot .btn { flex: 0 0 auto; white-space: nowrap; }
