/* Camera Lab — the lab view: viewport, HUD, dials, tools, activity cards. */

:root {
  --viewport-bg: #07080c;
  --ok: #6bffb0;
  --bad: #ff6b81;
}

.topbar-note {
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

/* Labs get a wider page than the floor. */
main:has(.stage-lab:not([hidden])) {
  max-width: 1280px;
}
.stage-lab .stage-header {
  margin-bottom: 0.9rem;
}
.stage-lab .stage-body {
  padding: clamp(0.6rem, 2vw, 1.25rem);
}

.lab {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 900px) {
  .lab {
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
    align-items: start;
  }
  .lab-main {
    position: sticky;
    top: 5rem;
  }
}

/* ---------- viewport ---------- */

.viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--viewport-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  container-type: inline-size;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 18px 40px -20px #000;
  user-select: none;
  -webkit-user-select: none;
}

/* On phones the picture stays pinned while you scroll the controls. */
@media (max-width: 899px) {
  body:has(.stage-lab:not([hidden])) .topbar {
    position: static;
  }
  .viewport {
    position: sticky;
    top: 0;
    z-index: 5;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
  }
}

.viewport-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: manipulation;
}

.viewport-hint {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  font-size: clamp(0.7rem, 2.4cqw, 0.9rem);
  pointer-events: none;
  animation: hint-fade 6s ease forwards;
}
@keyframes hint-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

.reticle {
  position: absolute;
  width: 11cqw;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border: 2px solid #ffd166;
  border-radius: 4px;
  opacity: 0;
}
.reticle.pulse {
  animation: reticle 1.2s ease forwards;
}
@keyframes reticle {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
  25% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.rec-btn {
  position: absolute;
  right: 2.5%;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(30px, 7cqw, 44px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.35);
  color: #ff3b4e;
  font-size: clamp(14px, 3.5cqw, 22px);
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.rec-btn.on {
  background: #ff3b4e;
  color: #fff;
  animation: rec-blink 1s steps(2) infinite;
}
@keyframes rec-blink {
  50% { box-shadow: 0 0 0 4px rgba(255, 59, 78, 0.4); }
}

.gl-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  line-height: 1.6;
  color: var(--text-dim);
}

/* ---------- HUD ---------- */

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: #fff;
  font-size: clamp(9px, 2.6cqw, 17px);
  text-shadow: 0 0 3px #000, 0 1px 2px #000;
  font-variant-numeric: tabular-nums;
}
.hud small {
  font-size: 0.75em;
  opacity: 0.8;
}
.hud-slot {
  position: absolute;
  display: flex;
  gap: 0.9em;
  align-items: center;
  white-space: nowrap;
}
.hud-tl { top: 4%; left: 3%; }
.hud-tr { top: 4%; right: 3%; }
.hud-bl { bottom: 4%; left: 3%; }
.hud-br { bottom: 4%; right: 3%; }
.hud-top { top: 4%; left: 50%; transform: translateX(-50%); }
.hud-bottom { bottom: 4%; left: 50%; transform: translateX(-50%); gap: 1.4em; }
.hud-left { left: 3%; top: 50%; transform: translateY(-50%); flex-direction: column; align-items: flex-start; gap: 0.35em; }
.hud-rec { color: #ff4455; font-weight: 700; }
.hud-stby { color: #7dff9a; }
.hud-box { border: 1.5px solid currentColor; padding: 0 0.35em; border-radius: 3px; }
.hud-meter { position: relative; display: inline-block; font-size: 0.7em; letter-spacing: 0.02em; padding-bottom: 0.9em; }
.hud-meter-caret { position: absolute; bottom: -0.2em; transform: translateX(-50%); color: #ffd166; }

/* Each style evokes (not copies) that maker's display. */
.hud-style-lab { font-family: "Share Tech Mono", ui-monospace, monospace; }
.hud-style-lab .hud-strip {
  display: flex;
  gap: 1.1em;
  background: rgba(0, 0, 0, 0.55);
  padding: 0.2em 0.8em;
  border-radius: 4px;
  text-shadow: none;
}
.hud-style-lab .hud-top { top: 2.5%; }
.hud-style-lab .hud-tl { top: 13%; }
.hud-style-sony { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 600; font-size: clamp(10px, 3.1cqw, 20px); }
.hud-style-canon { font-family: "Helvetica Neue", Arial, sans-serif; font-weight: 500; }
.hud-style-canon .hud-left { gap: 0.2em; background: rgba(0, 0, 0, 0.25); padding: 0.3em 0.5em; border-radius: 3px; }
.hud-style-lumix { font-family: "Nunito", "Arial Rounded MT Bold", sans-serif; font-weight: 800; }
.hud-style-lumix .hud-bottom { background: rgba(0, 0, 0, 0.45); padding: 0.25em 1em; border-radius: 999px; bottom: 3%; }
.hud-style-alpha { font-family: system-ui, -apple-system, sans-serif; font-weight: 600; }
.hud-style-alpha .hud-bottom span:nth-child(3) { color: #ffd166; }

/* ---------- tool chips & panels ---------- */

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.75rem 0 0;
}
.tool-chips .chip {
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  min-height: 36px;
}

.tool-panels {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  margin-top: 0.75rem;
}
.tool-panel {
  margin: 0;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem 0.7rem;
}
.tool-panel figcaption {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.tool-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--text);
}
.tool-panel canvas {
  display: block;
  width: 100%;
  height: 100px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}
.tool-panel canvas[height="130"] { height: 120px; }
.tool-panel canvas[height="96"] { height: 96px; }

.meter-scale {
  position: relative;
  height: 44px;
  margin: 0.2rem 0.6rem 0;
}
.meter-zone {
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3a4fd9 0%, #6b7cff 30%, #6bffb0 45%, #6bffb0 55%, #ffb36b 70%, #ff5a6e 100%);
  opacity: 0.8;
}
.meter-mark {
  position: absolute;
  top: 22px;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.meter-needle {
  position: absolute;
  top: 0;
  width: 4px;
  height: 26px;
  margin-left: -2px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 6px #000;
  transition: left 0.15s ease;
}
.meter-text {
  margin: 0.2rem 0 0;
  font-weight: 700;
  text-align: center;
}

.shutter-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}
.shutter-disc {
  width: 64px;
  height: 64px;
  flex: none;
}
.shutter-bg { fill: rgba(255, 255, 255, 0.1); }
.shutter-open { fill: var(--accent, var(--accent-default)); opacity: 0.85; }
.shutter-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
.shutter-text span {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.tool-debug {
  grid-column: 1 / -1;
}
.tool-debug pre {
  margin: 0;
  font: 11px/1.45 ui-monospace, Menlo, monospace;
  white-space: pre-wrap;
  color: #cfe8ff;
}

/* ---------- dials ---------- */

.controls {
  display: grid;
  gap: 0.6rem;
}
.dial {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.6rem 0.6rem;
}
.dial-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0 0.3rem 0.3rem;
}
.dial-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
}
.dial-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--accent, var(--accent-default));
  font-variant-numeric: tabular-nums;
}
.dial-delta {
  margin-left: auto;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: rgba(255, 255, 255, 0.1);
}
.dial-delta.show { opacity: 1; }
.dial-delta.up { background: rgba(255, 209, 102, 0.22); color: #ffd98a; }
.dial-delta.down { background: rgba(124, 155, 255, 0.22); color: #b8c8ff; }
.dial-body {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.dial-step {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.dial-step:active { transform: scale(0.94); }
.dial-step:disabled { opacity: 0.35; cursor: default; }
.dial-window {
  position: relative;
  flex: 1;
  height: 54px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  cursor: grab;
  touch-action: pan-y;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.dial-window:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.dial.dragging .dial-window { cursor: grabbing; }
.dial-tape {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  transition: transform 0.12s ease-out;
  will-change: transform;
}
.dial.dragging .dial-tape { transition: none; }
.dial-tick {
  position: absolute;
  bottom: 0;
  width: 2px;
  height: 9px;
  margin-left: -1px;
  background: rgba(255, 255, 255, 0.28);
}
.dial-tick.fine { height: 6px; background: rgba(255, 255, 255, 0.16); }
.dial-tick.major { height: 16px; background: rgba(255, 255, 255, 0.6); }
.dial-tick span {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dial-tick.current span { color: var(--text); }
.dial-needle {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--accent, var(--accent-default));
  box-shadow: 0 0 8px var(--accent, var(--accent-default));
}
.dial-hint {
  margin: 0.35rem 0.3rem 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.dial.locked { opacity: 0.55; }
.dial.locked .dial-label::after { content: " 🔒 locked"; letter-spacing: 0; text-transform: none; }
.dial.locked .dial-window { cursor: not-allowed; }

.control-note {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 0.6rem 0.8rem;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
}

/* camera-style function tabs when there are many controls */
.control-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr));
  gap: 0.4rem;
}
.control-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  min-width: 0;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}
.control-tab span {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.control-tab strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.control-tab.active {
  border-color: var(--accent, var(--accent-default));
  background: color-mix(in srgb, var(--accent, var(--accent-default)) 20%, transparent);
}
.controls .tab-hidden { display: none; }

/* ---------- activity ---------- */

.lab-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 0.8rem;
  align-content: start;
}
.step-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--accent, var(--accent-default));
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}
.step-card p { margin: 0 0 0.5rem; line-height: 1.45; }
.step-card .intro { color: var(--text-dim); font-size: 0.92rem; }
.step-count {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent, var(--accent-default));
  font-weight: 700;
}
.step-text { font-size: 1.05rem; }
.step-text strong, .step-text em { color: var(--text); }
.step-feedback {
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  line-height: 1.45;
}
.step-feedback.pass { background: rgba(107, 255, 176, 0.1); }
.step-feedback.fail { background: rgba(255, 107, 129, 0.12); }
.ok-mark { color: var(--ok); font-weight: 800; }
.fail-mark { color: var(--bad); font-weight: 800; }
.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.step-actions .btn { padding: 0.6rem 1.1rem; font-size: 0.95rem; }
.step-hint { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.5rem !important; }
.goal-list { margin: 0 0 0.7rem; padding-left: 1.2rem; line-height: 1.5; color: var(--text-dim); }
.result-head { font-weight: 800; margin-top: 0.8rem !important; }
.result-head.pass { color: var(--ok); }
.result-head.fail { color: var(--bad); }
.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.result-list li { font-size: 0.92rem; line-height: 1.4; }
.result-list li.pass span { color: var(--ok); }
.result-list li.fail span { color: var(--bad); }
.result-note { color: var(--text-dim); font-size: 0.88rem; margin-top: 0.6rem !important; }

.feed {
  margin: 0;
  min-height: 2.6em;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-dim);
}

.lab-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.picker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.picker select {
  /* long names (a scene title, a lens) shrink instead of pushing off a phone */
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  text-overflow: ellipsis;
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  min-height: 40px;
}
.picker select option { background: #171b2e; }

/* ---------- phone landscape: picture left, controls right ---------- */
@media (orientation: landscape) and (max-height: 540px) {
  body:has(.stage-lab:not([hidden])) .topbar { position: static; }
  .lab { grid-template-columns: minmax(0, 1.3fr) minmax(250px, 1fr); }
  .viewport { position: relative; border-radius: var(--radius-md); }
  .lab-main { position: sticky; top: 0.5rem; }
  .lab-side { max-height: 92vh; overflow-y: auto; }
}

/* ---------- monitor wall (stations with several cameras) ---------- */

.monitor-wall {
  display: grid;
  grid-template-columns: repeat(var(--tiles, 2), minmax(0, 1fr));
  gap: 0.5rem;
  background: #050507;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.monitor-tile {
  margin: 0;
  display: grid;
  gap: 0.25rem;
}
.monitor-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  outline: 2px solid #2a2d38;
  border-radius: 4px;
  overflow: hidden;
  container-type: inline-size;
}
.monitor-screen > canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.monitor-screen > .viewport {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}
.monitor-tile.active .monitor-screen { outline-color: var(--accent, var(--accent-default)); }
.monitor-tile.selectable:not(.active) { cursor: pointer; }
.monitor-tile.selectable:not(.active):hover .monitor-screen { outline-color: #555b70; }
.monitor-tile figcaption {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.03em;
}
.monitor-name { color: var(--text); font-weight: 600; }
.monitor-tile.reference .monitor-name::after { content: " · reference"; color: var(--text-dim); font-weight: 400; }
.monitor-tile.active .monitor-name::after { content: " · your controls"; color: var(--accent, var(--accent-default)); font-weight: 400; }
/* On a phone, one monitor per row: the active one has to be big enough to
   tap its touchscreen, and color is easier to compare full width. */
@media (max-width: 560px) {
  .monitor-wall { grid-template-columns: minmax(0, 1fr); padding: 0.3rem; gap: 0.4rem; }
  /* Three or more cameras (Musco): yours full width on top, the rest in pairs. */
  .monitor-wall.many { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monitor-wall.many .monitor-tile.active { grid-column: 1 / -1; }
  .monitor-wall.many .monitor-tile:not(.active) figcaption .monitor-cam { display: none; }
}
.rig-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.rig-tab.active {
  border-color: var(--accent, var(--accent-default));
  background: color-mix(in srgb, var(--accent, var(--accent-default)) 20%, transparent);
}

/* ---------- camera body replicas (AX100) ---------- */

.body-panel {
  background: linear-gradient(180deg, #2b2c30, #1d1e22);
  border: 1px solid #3a3b42;
  border-radius: var(--radius-md);
  padding: 0.6rem;
  display: grid;
  gap: 0.6rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.body-panel-title {
  margin: 0;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
}
.body-panel-title span { font-weight: 500; letter-spacing: 0; color: var(--text-dim); }
.ax-row, .ax-menu-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
/* a fixed grid, so nothing moves when an "A" comes or goes: IRIS · GAIN ·
   SHUTTER on top, WB · MANUAL below */
.ax-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.ax-buttons .hw-btn { padding-left: 0.4rem; padding-right: 0.4rem; }
.hw-btn {
  font: 600 0.78rem/1 "Barlow Condensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.06em;
  color: #e8e8ec;
  background: linear-gradient(180deg, #3a3b42, #26272c);
  border: 1px solid #4a4b54;
  border-bottom-color: #15161a;
  border-radius: 7px;
  padding: 0.55rem 0.7rem;
  min-height: 2.4rem;
  cursor: pointer;
  box-shadow: 0 2px 0 #0d0d10;
}
.hw-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #0d0d10; }
.hw-btn.on { border-color: #ff9a3c; color: #ffb36b; }
.hw-btn[data-item]::after { content: " A"; color: #8fd0ff; visibility: hidden; }
.hw-btn.auto::after { visibility: visible; }
.hw-manual { color: #ffd166; }
.hw-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #121316;
  border-radius: 8px;
  padding: 3px;
  border: 1px solid #3a3b42;
}
.hw-switch-label { font: 600 0.7rem "Barlow Condensed", sans-serif; letter-spacing: 0.08em; padding: 0 0.4rem; color: var(--text-dim); }
.hw-switch button {
  font: 600 0.78rem "Barlow Condensed", sans-serif;
  color: #cfd0d6;
  background: transparent;
  border: 0;
  border-radius: 5px;
  padding: 0.45rem 0.55rem;
  min-width: 2.2rem;
  cursor: pointer;
}
.hw-switch button[aria-checked="true"] { background: #e8e8ec; color: #111; }
.hw-rocker {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #121316;
  border: 1px solid #3a3b42;
  border-radius: 999px;
  padding: 3px;
  font: 600 0.65rem "Barlow Condensed", sans-serif;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  touch-action: none;
}
.hw-rocker button {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid #4a4b54;
  background: linear-gradient(180deg, #3a3b42, #26272c);
  color: #fff;
  font: 700 0.9rem "Barlow Condensed", sans-serif;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.ax-ring-idle { margin: 0; font-size: 0.85rem; color: var(--text-dim); padding: 0.6rem 0.2rem; }
.ring-dial { --dial-accent: #ff9a3c; background: repeating-linear-gradient(90deg, #1a1b1f 0 3px, #22232a 3px 6px); }
.ax-wbmenu {
  background: #0d0e11;
  border: 1px solid #3a3b42;
  border-radius: 10px;
  padding: 0.5rem;
  display: grid;
  gap: 0.35rem;
}
/* WB shift: a square, a dot */
.ax-pad { display: flex; justify-content: center; }
.wb-pad { display: grid; gap: 0.4rem; width: min(100%, 15rem); }
.wb-pad-head { display: flex; align-items: center; gap: 0.5rem; font: 600 0.8rem "Barlow Condensed", sans-serif; letter-spacing: 0.06em; color: var(--text-dim); }
.wb-pad-head strong { color: #ffb36b; font-size: 1rem; letter-spacing: 0.04em; flex: 1; }
.wb-pad-head .hw-btn { min-height: 2rem; padding: 0.3rem 0.7rem; }
.wb-pad-frame { position: relative; padding: 1.3rem; }
.wb-pad-axis { position: absolute; font: 700 0.85rem "Barlow Condensed", sans-serif; }
.wb-g { top: 0; left: 50%; transform: translateX(-50%); color: #7fdc8a; }
.wb-m { bottom: 0; left: 50%; transform: translateX(-50%); color: #e07ad8; }
.wb-b { left: 0.2rem; top: 50%; transform: translateY(-50%); color: #7fb0ff; }
.wb-a { right: 0.2rem; top: 50%; transform: translateY(-50%); color: #ffb36b; }
.wb-pad-grid {
  position: relative;
  aspect-ratio: 1;
  border-radius: 4px;
  border: 1px solid #4a4b54;
  /* tinted toward each corner, with a cell grid on top */
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / calc(100% / var(--cols)) 100%,
    linear-gradient(180deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 100% calc(100% / var(--rows)),
    linear-gradient(90deg, rgba(90, 140, 255, 0.35), transparent 45%, transparent 55%, rgba(255, 160, 60, 0.35)),
    linear-gradient(180deg, rgba(90, 220, 110, 0.35), transparent 45%, transparent 55%, rgba(230, 100, 220, 0.35)),
    #15161a;
  touch-action: none;
  cursor: crosshair;
}
.wb-pad-grid::before, .wb-pad-grid::after { content: ""; position: absolute; background: rgba(255, 255, 255, 0.28); }
.wb-pad-grid::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.wb-pad-grid::after { top: 50%; left: 0; right: 0; height: 1px; }
.wb-pad-grid:focus-visible { outline: 2px solid #ff9a3c; outline-offset: 2px; }
.wb-pad-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #ff9a3c;
  border: 2px solid #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 1;
}
.ax-menu-title { margin: 0; font: 600 0.75rem "Barlow Condensed", sans-serif; letter-spacing: 0.08em; color: var(--text-dim); text-transform: uppercase; }
.ax-menu-note { margin: 0; padding: 0.5rem 0.65rem; border-radius: 8px; background: rgba(255, 209, 102, 0.12); border: 1px solid rgba(255, 209, 102, 0.45); color: var(--text); font-size: 0.85rem; line-height: 1.35; }

/* the AX100's touchscreen, drawn over the picture */
.ax-lcd {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: #fff;
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-weight: 600;
  font-size: clamp(9px, 3cqw, 19px);
  text-shadow: 0 0 3px #000, 0 1px 2px #000;
  font-variant-numeric: tabular-nums;
}
.ax-lcd > div { position: absolute; display: flex; gap: 0.6em; align-items: center; }
.ax-top { top: 3%; left: 3%; right: 3%; justify-content: space-between; }
.ax-left { left: 2.5%; top: 22%; flex-direction: column; align-items: flex-start; gap: 0.4em; }
.ax-bottom { bottom: 3%; left: 50%; transform: translateX(-50%); gap: 0.5em; }
.ax-rec { color: #ff4455; }
.ax-stby { color: #7dff9a; }
.ax-box { border: 1.5px solid currentColor; padding: 0 0.35em; border-radius: 3px; }
.ax-item {
  pointer-events: auto;
  font: inherit;
  color: inherit;
  text-shadow: inherit;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.35em;
  padding: 0.15em 0.5em;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3em;
  cursor: pointer;
  min-height: 1.9em;
}
.ax-manual { color: #ffd166; letter-spacing: 0.05em; }
.ax-item small { font-size: 0.62em; opacity: 0.75; letter-spacing: 0.05em; }
.ax-item.sel { border-color: #ff9a3c; background: rgba(255, 154, 60, 0.28); }
.ax-a { color: #8fd0ff; font-size: 0.8em; border: 1px solid #8fd0ff; border-radius: 2px; padding: 0 0.15em; line-height: 1; }

/* ---------- camera's own meter (auto exposure) ---------- */
.meter-camera {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  margin-left: -1.5px;
  background: #8fd0ff;
  border-radius: 2px;
  box-shadow: 0 0 6px #8fd0ff;
}
.meter-camera-text { margin: 0.3rem 0 0; font-size: 0.8rem; color: #8fd0ff; }
.monitor-wall[hidden], .rig-tabs[hidden], .ax-wbmenu[hidden], .ax-lcd[hidden], .meter-camera[hidden], .meter-camera-text[hidden] { display: none; }

@media (min-width: 900px) {
  .lab:has(.monitor-wall:not([hidden])) { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
}
.monitor-tile.rec .monitor-name::before { content: "● "; color: #ff4455; }

/* ---------- Salmon livestream: multiview + switcher ---------- */
.mv-frame {
  background: #050507;
  border-radius: var(--radius-md);
  padding: 0.5rem;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.mv-canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; cursor: pointer; border-radius: 4px; }
.mv-caption { margin: 0.35rem 0 0; font: 600 0.75rem "Barlow Condensed", sans-serif; letter-spacing: 0.06em; color: var(--text-dim); }
.atem-panel {
  margin-top: 0.8rem;
  background: linear-gradient(180deg, #24262d, #18191e);
  border: 1px solid #3a3b42;
  border-radius: var(--radius-md);
  padding: 0.6rem;
  display: grid;
  gap: 0.5rem;
}
.atem-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.atem-label { width: 5.2rem; font: 600 0.75rem "Barlow Condensed", sans-serif; letter-spacing: 0.08em; color: var(--text-dim); }
.atem-buttons { display: grid; grid-template-columns: repeat(9, minmax(2.1rem, 1fr)); gap: 0.3rem; flex: 1; min-width: 0; }
.atem-btn {
  font: 700 0.85rem "Barlow Condensed", sans-serif;
  color: #dfe2ea;
  background: #2e3038;
  border: 1px solid #44464f;
  border-radius: 6px;
  min-height: 2.4rem;
  cursor: pointer;
  padding: 0 0.6rem;
}
.atem-btn.lit-red { background: #d8252e; border-color: #ff6a70; color: #fff; box-shadow: 0 0 12px rgba(255, 60, 70, 0.6); }
.atem-btn.lit-green { background: #1a9c3c; border-color: #5ce089; color: #fff; box-shadow: 0 0 12px rgba(60, 220, 110, 0.5); }
.atem-actions .atem-cut, .atem-actions .atem-auto { min-width: 4.5rem; }
.atem-spacer { flex: 1; }
.atem-onair { min-width: 6rem; letter-spacing: 0.08em; }
@media (max-width: 560px) {
  .atem-label { width: 100%; }
  .atem-buttons { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 560px) {
  .monitor-tile.active { order: -1; }
}

/* ---------- Panasonic RP150 controller ---------- */
.rp-screen {
  background: #050608;
  border: 2px solid #2c2e36;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font: 600 0.78rem/1.35 "Share Tech Mono", ui-monospace, monospace;
  color: #e9edf6;
  display: grid;
  gap: 0.35rem;
}
.rp-top { display: flex; justify-content: space-between; gap: 0.5rem; color: #cfd6e6; }
.rp-main { display: flex; gap: 0.6rem; align-items: center; }
.rp-cambox { border: 2px solid #e9edf6; padding: 0.1rem 0.45rem; text-align: center; line-height: 1.05; font-size: 0.8rem; }
.rp-cambox b { display: block; font-size: 1.6rem; }
.rp-bars { display: grid; gap: 0.15rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.rp-bars i { color: #ffb36b; font-style: normal; }
.rp-bar { display: inline-block; width: 4.5em; height: 0.75em; border: 1px solid #9aa0b0; vertical-align: -0.1em; margin: 0 0.3em; }
.rp-bar > span { display: block; height: 100%; background: #36d07a; }
.rp-vals { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.rp-group { display: flex; align-items: stretch; gap: 0.25rem; }
.rp-group > span { align-self: center; color: #cfd6e6; font-size: 0.7rem; }
.rp-group > div { display: grid; min-width: 3.2em; border: 1px solid #3a3e4a; }
.rp-group em { font-style: normal; text-align: center; font-size: 0.7rem; color: #fff; }
.rp-group em.r { background: #c63a32; }
.rp-group em.b { background: #3a64c6; }
.rp-group em.m { background: #6a7080; }
.rp-group b { text-align: right; padding: 0 0.3em; }
.rp-foot { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid #3a3e4a; }
.rp-foot > div { display: grid; text-align: center; border-left: 1px solid #3a3e4a; }
.rp-foot > div:first-child { border-left: 0; }
.rp-foot span { font-size: 0.65rem; color: #9aa0b0; }
.rp-select { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.35rem; }
.rp-cam {
  position: relative;
  font: 700 0.95rem "Barlow Condensed", sans-serif;
  color: #dfe2ea;
  background: linear-gradient(180deg, #4a4c55, #33353c);
  border: 1px solid #55575f;
  border-radius: 6px;
  min-height: 2.6rem;
  cursor: pointer;
}
.rp-cam:disabled { opacity: 0.35; cursor: default; }
.rp-cam .led { position: absolute; top: 3px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #36d07a; box-shadow: 0 0 5px #36d07a; }
.rp-cam.on { background: linear-gradient(180deg, #ffad4a, #f08a1a); color: #1a1000; border-color: #ffc27a; box-shadow: 0 0 12px rgba(255, 160, 60, 0.6); }
.rp-wb { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.rp-knobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: 0.4rem; }
.rp-readonly { margin: 0; }
.knob { display: grid; justify-items: center; gap: 0.2rem; background: rgba(0, 0, 0, 0.25); border: 1px solid #3a3b42; border-radius: 10px; padding: 0.35rem 0.25rem; }
.knob.disabled { opacity: 0.45; }
.knob-label { font: 600 0.7rem "Barlow Condensed", sans-serif; letter-spacing: 0.06em; color: var(--text-dim); }
.knob-row { display: flex; align-items: center; gap: 0.2rem; }
.knob-step { width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 1px solid #4a4b54; background: #26272c; color: #fff; font-size: 1rem; cursor: pointer; }
.knob-dial {
  position: relative;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a4b52, #121316 70%);
  border: 2px solid var(--knob-color, #9aa0b0);
  touch-action: none;
  cursor: grab;
}
.knob-mark { position: absolute; left: 50%; top: 50%; width: 3px; height: 45%; margin-left: -1.5px; background: #fff; border-radius: 2px; transform-origin: 50% 0; translate: 0 -100%; }
.knob-mark { transform-origin: 50% 100%; top: 5%; translate: 0 0; }
.knob-value { font: 600 0.85rem "Share Tech Mono", monospace; }
/* which room the picture is in */
.scene-tag { margin: 0.35rem 0 0; font-size: 0.78rem; color: var(--text-dim); }
.scene-tag[hidden] { display: none; }

/* ---------- tally: program (red) and preview (green) on the multiview ---------- */
.monitor-tile.pgm .monitor-screen { outline: 3px solid #e3262f; }
.monitor-tile.pvw .monitor-screen { outline: 3px solid #22b04a; }
.monitor-tally {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 6; /* above the viewport, which is z-index 5 on phones */
  font: 700 0.7rem "Barlow Condensed", sans-serif;
  letter-spacing: 0.08em;
  padding: 0 0.35em;
  border-radius: 3px;
  pointer-events: none;
}
.monitor-tally:empty { display: none; }
.monitor-tile.pgm .monitor-tally { background: #e3262f; color: #fff; }
.monitor-tile.pvw .monitor-tally { background: #22b04a; color: #fff; }
.monitor-wall.switcher .monitor-tile.active .monitor-name::after { content: " · program"; color: #ff6a70; }
.switcher-panel { margin-top: 0; }
.switcher-panel .atem-buttons { grid-template-columns: repeat(5, minmax(2.6rem, 1fr)); }

/* ---------- RP150 joystick (PTZ stations) ---------- */
.rp-ptz { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.rp-joy {
  position: relative;
  flex: none;
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #2a2c33, #141519 70%);
  border: 1px solid #3a3b42;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
  touch-action: none;
  cursor: grab;
}
.rp-joy::before, .rp-joy::after { content: ""; position: absolute; background: #2e3038; }
.rp-joy::before { left: 50%; top: 12%; bottom: 12%; width: 1px; }
.rp-joy::after { top: 50%; left: 12%; right: 12%; height: 1px; }
.rp-joy:focus-visible { outline: 2px solid var(--accent, var(--accent-default)); outline-offset: 3px; }
.rp-joy[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.rp-joy.held { cursor: grabbing; }
.rp-joy-stick {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: 3.4rem;
  height: 3.4rem;
  margin: -1.7rem 0 0 -1.7rem;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #5a5d68, #24252b 70%);
  border: 1px solid #6a6d78;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.rp-joy.held .rp-joy-stick { border-color: #36d07a; }
.rp-ptz-side { display: grid; gap: 0.5rem; justify-items: start; flex: 1; min-width: 8rem; }
.rp-speed .knob { min-width: 7rem; }
.rp-mirror { display: none; margin: 0; flex: 1 1 100%; }
.rp-mirror canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; border-radius: 4px; outline: 2px solid #2a2d38; }
.rp-mirror.pgm canvas { outline: 3px solid #e3262f; }
.rp-mirror figcaption { font: 600 0.72rem "Barlow Condensed", sans-serif; letter-spacing: 0.04em; color: var(--text-dim); margin-top: 0.2rem; }
@media (max-width: 899px) {
  .rp-mirror { display: block; }
}
@media (orientation: landscape) and (max-height: 540px) {
  .rp-mirror { display: none; }
}
