/* REVERSAL//CASCADE: the shared lab layout (../assets/theme.css) carries the page. Only what belongs to this page lives
   here: the pointer on the stage, the amber κ handle on the boundary ring, violet readouts, legend swatches and the
   scene chips on narrow stages. Colours come from the tokens (var(--cyan) …), never from literal colour values. */
#stage { container-type: inline-size; }

/* the stage turns under the pointer; a still (cover, printed figure) does not take the pointer at all */
.stage:not(.still) #cv { cursor: grab; touch-action: none; }
.stage:not(.still) #cv:active { cursor: grabbing; }
.stage.still #cv { cursor: default; touch-action: auto; }

/* the book's colour rule: the tagline and the drawer's bold leads are not "now" */
.tagline em { color: var(--cyan); }
.sheet li b { color: var(--cyan); }

/* violet readouts: volume, the diagonal path */
dl.ro .v dd { color: var(--violet); }

/* the quick dimension chips under the injection slider */
#stageChips { flex-wrap: wrap; gap: 4px; margin: -2px 0 10px; }
#stageChips .chip { padding: 4px 7px; font-size: 10.5px; }

/* legend swatches */
.sw.dash { background: repeating-linear-gradient(90deg, var(--dim) 0 4px, transparent 4px 7px); }
.sw.dash.cy { background: repeating-linear-gradient(90deg, var(--cyan) 0 4px, transparent 4px 7px); }
.sw.ring { width: 10px; height: 10px; border-radius: 50%; background: transparent; border: 2px solid var(--amber); }
.sw.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }

/* the stage's own labels: numbers and names keep their case */
.stage .tag.c-vi { color: var(--violet); }
.stage .tag.num.small { font-size: 10.5px; }

/* the κ handle: an amber ring on the boundary ring of the cut; dragging it along the ring sets κ₋ */
#cutHandle {
  position: absolute; z-index: 3; left: 0; top: 0; width: 30px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--amber); border-radius: 50%;
  background: color-mix(in srgb, var(--void) 78%, transparent); color: var(--amber);
  font-family: var(--font-data); font-size: 14px; line-height: 1; letter-spacing: 0; text-transform: none;
  box-shadow: 0 0 12px color-mix(in srgb, var(--amber) 35%, transparent);
  transform: translate(-50%, -50%); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
#cutHandle.dragging, #cutHandle:active { cursor: grabbing; }
#cutHandle:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
#cutHandle[hidden] { display: none; }

/* scene chips and title on a narrow stage */
@container (max-width: 600px) {
  .hud-tr { gap: 3px; }
  .hud-tr .chip { padding: 3px 6px; font-size: 9.5px; letter-spacing: 0.05em; }
  .hud-tl { left: 14px; max-width: calc(100% - 28px); }
  .hud-tl .big { font-size: 12px; }
  .hud-tl .sub { font-size: 11px; line-height: 1.3; }
  .hud-bl { left: 12px; right: 12px; bottom: 9px; gap: 2px 10px; font-size: 10.5px; }
  .stage .tag.num { font-size: 10.5px; }
  #cutHandle { width: 28px; height: 28px; font-size: 13px; }
}

/* phones: a taller stage, so that the solid and its labels both have room */
@media (max-width: 520px) {
  :root:not([data-embed]):not([data-thumb-mode]) .lab .center { grid-template-rows: minmax(min-content, max(480px, 66vh)) auto auto; }
}

/* the tour bar selects the card (and with it the scene) in a narrow cited figure */
@media (max-width: 480px) {
  :root[data-embed][data-figure] .stage .hud-tr { display: none; }
}
