/* skyfox-depth · layout over the linked house skin (redfish-style.css): the stage fills the viewport; every other
   thing is an overlay; prose lives only in the collapsible panels (rule 15d). Font floor 14px for controls. */
html, body { height: 100%; overscroll-behavior: none; }
body { font-size: 15px; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; background: #1b1d1f; }
/* v0.2.0: the raw broadcast frame behind the transparent stage in the "from the camera" overlay (signed in only) */
.raw { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; z-index: 0; }
body.rawOverlay #stage { background: transparent; }
.legendRow .sw.ring { border-radius: 50%; }
button, select, input { font: 14px var(--rf-sans); color: var(--rf-ink); }
button, select { background: var(--rf-ground); border: 1px solid var(--rf-rule); border-radius: var(--rf-radius); padding: 4px 9px; cursor: pointer; min-height: 30px; }
button:hover, select:hover { border-color: var(--rf-ink); }
button[aria-pressed="true"] { background: var(--rf-ink); color: var(--rf-ground); border-color: var(--rf-ink); }
button:disabled, input:disabled + * { opacity: .45; cursor: not-allowed; }
a { color: var(--rf-ink); }

#hdr { top: 10px; left: 10px; display: flex; align-items: center; gap: 8px; padding: 5px 8px; }
#hdr .title { font-weight: 600; font-size: 15px; white-space: nowrap; }
#hdr select { max-width: 46vw; }
#hdr .ver { color: var(--rf-ink-faint); font: 14px var(--rf-mono); }
.fabs { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 1001; }

.panels { position: absolute; top: 58px; left: 10px; z-index: 1000; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  max-height: calc(100% - 58px - 84px - var(--drawerH, 0px)); width: min(440px, calc(100vw - 20px)); pointer-events: none; }
.panel { pointer-events: auto; display: flex; flex-direction: column; align-items: flex-start; max-height: 100%; min-height: 0; width: 100%; }
.panel.rf-collapsed { display: none; }
.panel:not(.rf-collapsed) { flex: 0 1 auto; }
.panel .body { margin-top: 4px; background: var(--rf-ground); border: 1px solid var(--rf-rule); border-radius: var(--rf-radius); padding: 4px 14px;
  overflow: auto; max-height: 100%; min-height: 0; font-size: 15px; line-height: 1.5; width: 100%; }
.panel .body p { margin: 10px 0; }
.tabs .rf-min-tab[aria-expanded="true"] { color: var(--rf-ground); background: var(--rf-ink); border-color: var(--rf-ink); }
.panels .tabs { display: flex; gap: 6px; flex-wrap: wrap; pointer-events: auto; }
.scores table { border-collapse: collapse; font: 14px var(--rf-mono); margin: 6px 0 12px; }
.scores td, .scores th { padding: 2px 8px 2px 0; text-align: left; border-bottom: 1px solid var(--rf-rule); vertical-align: top; }
.legendRow { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: 14px; }
.sw { width: 14px; height: 14px; flex: none; border: 1px solid var(--rf-rule-strong); }

.inset { right: 10px; bottom: 74px; padding: 6px; width: min(420px, 46vw); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.inset.rf-collapsed { width: auto; }
.insetBody { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.insetWrap { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #1b1d1f; }
.insetWrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
#ov2d { image-rendering: auto; cursor: crosshair; }
.ramp { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; font: 14px var(--rf-mono); color: var(--rf-ink-quiet); }
.ramp canvas { width: 100%; height: 10px; }
.ramp #rampLo::after { content: ' ·'; }
.readout { font: 14px/1.35 var(--rf-mono); color: var(--rf-ink-quiet); white-space: pre-wrap; min-height: 2.7em; }
.readout b { color: var(--rf-ink); font-weight: 600; }

.drawer { left: 10px; bottom: 74px; padding: 6px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: min(520px, calc(100vw - 20px)); }
.drawerBody { display: flex; flex-direction: column; gap: 6px; }
.grp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.grp label { display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; font-size: 14px; }
.lbl { font: 600 14px var(--rf-sans); color: var(--rf-ink-faint); min-width: 3.5em; }

.bar { left: 10px; right: 10px; bottom: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px; }
.scrubWrap { position: relative; flex: 1 1 260px; height: 30px; display: flex; align-items: center; min-width: 160px; }
.scrubWrap canvas { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
#scrub { position: relative; width: 100%; margin: 0; background: transparent; accent-color: var(--rf-accent); }
.now { font: 600 14px var(--rf-mono); color: var(--rf-accent); white-space: nowrap; }
.seg { display: inline-flex; }
.seg button { border-radius: 0; }
.seg button + button { margin-left: -1px; }
.gate { font-size: 14px; color: var(--rf-ink-quiet); white-space: nowrap; }
.status { font: 14px var(--rf-mono); color: var(--rf-ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30ch; }
.foot { position: absolute; left: 12px; right: 12px; bottom: 2px; z-index: 999; font-size: 13px; line-height: 18px; color: #c9c9c9; text-shadow: 0 0 3px #000, 0 0 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot a { color: #e8e8e8; }

@media (max-width: 700px) {
  #hdr .title { display: none; }
  .inset { width: calc(100vw - 20px); bottom: 118px; }
  .inset:not(.rf-collapsed) ~ .drawer { bottom: auto; top: 58px; }
  .drawer { bottom: 118px; }
  .bar { bottom: 22px; }
  .status { max-width: 18ch; }
  .panels { max-height: calc(100% - 58px - 130px - var(--drawerH, 0px) - var(--insetH, 0px)); }
}
[hidden] { display: none !important; }
/* the video sources stay in the render tree (requestVideoFrameCallback fires only for composited elements) but unseen */
.vsrc { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: 0.01; pointer-events: none; z-index: -1; }
/* the hover readout reserves its three lines: a growing readout would move the bottom-anchored inset under the pointer */
#cellRead { min-height: calc(3 * 1.35em); }
#liveRead:empty { display: none; }
