/* css/enhance.css
   Owns: Enhance (js/stage/enhance.js), an xl dialog (.dlg.enh-dlg) in two steps, Pick (.enh-pick) and Adjust
   (.enh-adjust): the picture (.enh-pic, a zoom surface of js/stage/zoom.js) and the row under it (.enh-under: the
   note, the hint and the picture's .zoombar, which sat over the picture's corner and its burned-in clock until step
   21), the region box, and the controls column (.enh-side, the one part that scrolls) with the result's sliders.
   Phones: css/mobile.css. (UI plan step 20f.)
   Wide, the dialog's body never scrolls: the picture is as large as the kit dialog's 86vh allows. --enh-chrome is what
   the dialog keeps of that height for itself (head 39 + body padding 28 + foot 63 + borders 2) plus the row under the
   picture (4 + --enh-row-h: 26, a finger's 40 on a touch screen) and a margin; --enh-frame the same without that row,
   for the controls column. --ar is the picture's
   shape: a fixed 16:9 in Pick (the sub-stream thumbnail is no guide, its pixels are often squeezed: P8), the result's
   own in Adjust (set on .enh-view by enhance.js). aspect-ratio is Chromium 88: the TV never shows Enhance. */

.enh-dlg { --enh-side: 320px; --enh-row-h: var(--ctl-h-sm); --enh-chrome: calc(138px + var(--enh-row-h)); --enh-frame: 134px; --ar: 1.7778; }
@media (hover: none) and (pointer: coarse) { .enh-dlg { --enh-row-h: 40px; } }   /* the row of a finger-sized bar */
.enh-dlg .dlg-body { overflow: hidden; }
.enh-dlg .enh { display: grid; grid-template-columns: minmax(0, 1fr) var(--enh-side); gap: var(--s4); align-items: start; }
.enh-view { display: flex; flex-direction: column; align-items: center; gap: var(--s1); min-width: 0;
  --enh-pic-w: min(100%, calc((86vh - var(--enh-chrome)) * var(--ar))); }
/* The picture's edge is a ring, not a border: a border would take its 2 px out of the picture's shape. */
.enh-pic { position: relative; flex: none; width: var(--enh-pic-w); aspect-ratio: var(--ar); overflow: hidden;
  touch-action: none; user-select: none; background: var(--black); box-shadow: 0 0 0 1px var(--line); border-radius: var(--radius); }
.enh-pick .enh-pic { cursor: crosshair; }
.enh-result.zoomed { cursor: grab; }
.enh-pic.grabbing { cursor: grabbing; }
.enh-inner, .enh-result canvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; transform-origin: 0 0; }
.enh-inner img { display: block; width: 100%; height: 100%; object-fit: fill; user-select: none; }   /* fill: the box is the frame's 16:9 */
.enh-result canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }   /* the actual pixels, not a browser guess */
/* Drawn over the zoomed picture (never scaled with it); the rest of the picture dimmed. */
.enh-box { position: absolute; z-index: 2; pointer-events: none; border: 1px solid var(--accent);
  background: var(--region-fill); box-shadow: 0 0 0 9999px var(--region-dim); }
.enh-loading { position: absolute; left: var(--s2); bottom: var(--s2); z-index: var(--z-pane-ui); pointer-events: none;
  padding: 3px var(--s2); font-size: var(--fs-xs); color: var(--text); background: var(--scrim); border-radius: var(--radius-lg); }
/* One line of a fixed height (P21): the note changes on every move of a box being drawn, and a row that wrapped would
   change the dialog's height, which the layer centres: the picture would move under the drag. */
.enh-under { display: flex; align-items: center; gap: var(--s3); flex: none; width: var(--enh-pic-w); height: var(--enh-row-h);
  font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.enh-note { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.enh-hint { flex: 0 1 auto; min-width: 0; margin-left: auto; overflow: hidden; text-overflow: ellipsis; }
/* The zoom bar at the row's right end, under the picture's right edge: the row's height (a definite one, so the buttons'
   100% is the row's and not the text's on a phone, where the row wraps), and a Fit button wide enough for "8.0×", so a
   changing scale never moves the hint or the note. */
.enh-under .zoombar { position: static; flex: none; height: var(--enh-row-h); background: var(--panel-2);
  border-color: var(--line-2); border-radius: var(--radius); }
.enh-under .zoombar button { height: 100%; }
.enh-under .zoombar [data-z="fit"] { width: 52px; }
.enh-hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .enh-hint-mouse { display: none; } .enh-hint-touch { display: inline; } }

.enh-side { display: grid; align-content: start; gap: var(--s3); min-width: 0; max-height: calc(86vh - var(--enh-frame));
  overflow-y: auto; padding-right: var(--s1); }
.enh-side .about { margin: 0; }
.enh-side .notice { margin: 0; }
.enh-report { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.enh-variants { display: flex; flex-wrap: wrap; gap: var(--s1); }
.enh-variants button { height: var(--ctl-h-sm); padding: 0 var(--s3); border: 1px solid var(--line-2); border-radius: var(--radius-pill);
  background: var(--panel-2); color: var(--text-2); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.enh-variants button:hover { color: var(--text); }
.enh-variants button[aria-checked="true"] { background: var(--accent-bg); border-color: var(--accent); color: var(--text); }
.enh-sliders { display: grid; gap: var(--s2); }
.enh-slider { display: grid; gap: 2px; font-size: var(--fs-sm); color: var(--muted); }
.enh-slider output { margin-left: var(--s1); font-family: var(--font-mono); color: var(--text); }
.enh-slider input { width: 100%; }
.enh-tools { display: flex; flex-wrap: wrap; gap: var(--s2); }
/* ID Vehicle beside the Label it fills (stage/identify.js). */
.enh-label.with-idv { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); align-items: end; }
