/* ARITH//SCHUR: the shared lab layout (../assets/theme.css) carries the page. Only what belongs to this page is
   here: the stage pointer, the amber handle, text cases for mathematics, readout colour roles and the compact HUD of
   small frames. Colours come from the tokens (var(--cyan) …), never from literal values. */
/* a size container (local-viz-cards): every child of the stage is absolutely placed and its height comes from the lab
   grid row and min-height, so size containment changes no layout; it lets the HUD read the stage's width and height */
#stage { container-type: size; isolation: isolate; }
/* the budget scene: the lit sheet of kit.solid is drawn on #sv (and on the WebGL canvas the kit puts first in the
   stage); both stay behind #cv, which keeps the current point, the gap to the boundary and the labels on top */
#stage > #sv { z-index: -1; }
.stage:not(.still) #cv { cursor: grab; touch-action: none; }
.stage:not(.still) #cv:active { cursor: grabbing; }
.stage.still #cv { cursor: default; touch-action: auto; }

.logo b { color: var(--cyan); }
.tagline em, .sheet li b { color: var(--cyan); }
.hud-tl .big { color: var(--sigma); }
.hud-tl .big, .hud-tl .sub, .strip .head h2, .strip .head span, .tau { text-transform: none; }
.hud-tl .sub { line-height: 1.4; }

.side > #infoBtn { flex: none; align-self: stretch; text-align: center; padding: 7px 9px; }
#ctlPanel .grp { display: flex; flex-direction: column; gap: 8px; }
#orderChips .chip { text-transform: none; }
dl.ro .v dd { color: var(--violet); }
dl.ro .key dd b { color: var(--ink); }
dl.ro .key.ex dd b { color: var(--magenta); }
dl.ro .mat dd { font-size: 11.5px; line-height: 1.45; white-space: pre; overflow-x: auto; }

.handle { position: absolute; left: 0; top: 0; z-index: 3; width: 28px; height: 28px; padding: 0; margin: 0; border: 2px solid var(--amber); border-radius: 50%;
  background: color-mix(in srgb, var(--amber) 12%, transparent); transform: translate(-50%, -50%); cursor: grab; touch-action: none;
  user-select: none; -webkit-user-select: none; box-shadow: 0 0 10px color-mix(in srgb, var(--amber) 55%, transparent); }
.handle:active, .handle.dragging { cursor: grabbing; background: color-mix(in srgb, var(--amber) 28%, transparent); }
.stage.still .handle { pointer-events: none; }
:root[data-thumb-mode] .handle, :root[data-shot] .handle { display: none; }

.stage .tag.raw { text-transform: none; }
.stage .tag.num { padding: 1px 3px; }
.stage .tag.num.dm { color: var(--dim); }
.stage .tag.c-cy { color: var(--cyan); }
.stage .tag.c-mg { color: var(--magenta); }
.stage .tag.c-vi { color: var(--violet); }
.stage .tag.c-am { color: var(--amber); }
.stage .tag.c-dm { color: var(--dim); }
.hud-tr .chip { text-transform: none; }

@container (max-width: 620px) {
  .hud-tr { gap: 3px; }
  .hud-tr .chip { padding: 3px 5px; font-size: 9.5px; letter-spacing: 0.03em; }
  .hud-tl { left: 12px; max-width: calc(100% - 24px); }
  .hud-tl .big { font-size: 12px; }
  .hud-tl .sub { font-size: 10.5px; line-height: 1.35; }
  .hud-bl { left: 12px; right: 12px; bottom: 9px; gap: 2px 10px; font-size: 10px; }
  .stage .tag.raw, .stage .tag.num { font-size: 10px; }
  .handle { width: 24px; height: 24px; }
}
/* short stages (a low frame in the book, a phone held sideways): the same compact HUD, read from the height */
@container (max-height: 320px) {
  .hud-tr { gap: 3px; }
  .hud-tr .chip { padding: 3px 5px; font-size: 9.5px; letter-spacing: 0.03em; }
  .hud-tl { top: 10px; }
  .hud-tl .big { font-size: 12px; }
  .hud-tl .sub { font-size: 10.5px; line-height: 1.35; }
  .hud-bl { bottom: 8px; gap: 2px 10px; font-size: 10px; }
  .stage .tag.raw, .stage .tag.num { font-size: 10px; }
}
@media (max-width: 480px) {
  :root[data-embed][data-figure] .stage .hud-tr { display: none; }
}
@media (max-width: 1080px) {
  :root:not([data-embed]):not([data-thumb-mode]):not([data-shot]) .lab .center { grid-template-rows: minmax(min-content, max(460px, 64vh)) auto auto; }
}
