/* Monitor Wall — confidence multiview grid. */
.mv-page { display: flex; flex-direction: column; height: 100%; }
.mv-grid {
  flex: 1; min-height: 0; overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px; padding: 4px 2px 20px;
  align-content: start;
}
.mv-tile {
  background: var(--bg-1); border-radius: var(--r-md); overflow: hidden;
  display: flex; flex-direction: column;
}
.mv-video {
  position: relative; aspect-ratio: 16/9; background: var(--bg-0);
  overflow: hidden;
}
.mv-video video, .mv-video img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mv-noise {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  color: var(--text-4); font-size: var(--fs-2xs);
  background: repeating-linear-gradient(45deg, var(--bg-0), var(--bg-0) 6px, var(--bg-1) 6px, var(--bg-1) 12px);
}
.mv-overlay {
  position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 6px;
  padding: 5px 7px; pointer-events: none;
}
.mv-top { top: 0; background: linear-gradient(to bottom, rgba(8,9,12,0.75), transparent); }
.mv-bottom { bottom: 0; background: linear-gradient(to top, rgba(8,9,12,0.75), transparent); }
.mv-title {
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.mv-sub { font-size: var(--fs-2xs); color: var(--text-2); text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.mv-overlay .badge { pointer-events: auto; }
.mv-livedot {
  position: absolute; top: 7px; right: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px var(--live-soft);
}
.mv-nownext {
  font-size: var(--fs-2xs); color: var(--text-3);
  padding: 4px 8px; border-top: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Fullscreen preview (Inspect modal) ─────────────────────────────────── */
/* .mv-preview wraps <VideoScopes> so preview + waveform + vectorscope +
   colorspace caption all enter fullscreen together. In native :fullscreen the
   wrapper fills the screen and the scopes' internal flex row is scaled up. */
.mv-preview { width: 100%; }
.mv-preview:fullscreen {
  width: 100vw; height: 100vh; background: var(--bg-0);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
/* VideoScopes root is a flex row (preview 46% left, scopes stacked right).
   In fullscreen, let it grow to fill and enlarge the internal video + canvases. */
.mv-preview:fullscreen > div { width: 100%; height: 100%; max-height: 100vh; }
.mv-preview:fullscreen video { width: 100% !important; height: auto !important; max-height: 88vh; }
/* Enlarge the scope canvases in fullscreen for legibility. */
.mv-preview:fullscreen canvas { width: auto; height: auto; }

/* Tile fullscreen-monitor button (top overlay, next to status badge). */
.mv-fsbtn {
  pointer-events: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 5px; border: none; cursor: pointer;
  background: rgba(8,9,12,0.55); color: var(--text-1);
  opacity: 0; transition: opacity 120ms ease, background 120ms ease;
}
.mv-tile:hover .mv-fsbtn { opacity: 1; }
.mv-fsbtn:hover { background: rgba(8,9,12,0.85); }

/* ── Dedicated fullscreen monitor page (MonitorFocus) ───────────────────── */
/* Full-window in-app overlay: big preview left, scopes/meters/details right.
   Also the target for native browser fullscreen (rootRef). */
.mf-root {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; gap: 12px; padding: 14px;
  background: var(--bg-0);
}
.mf-root:fullscreen { padding: 20px; }
.mf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.mf-preview {
  position: relative; flex: 1; min-height: 0; background: #000;
  border-radius: var(--r-md); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.mf-video { width: 100%; height: 100%; object-fit: contain; display: block; }
.mf-noSignal { color: var(--text-3); font-size: var(--fs-sm); }
.mf-overlay {
  position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; pointer-events: none;
}
.mf-top { top: 0; background: linear-gradient(to bottom, rgba(8,9,12,0.8), transparent); }
.mf-title { font-size: var(--fs-md); font-weight: 600; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9); }
.mf-sub { font-size: var(--fs-xs); color: var(--text-2); text-shadow: 0 1px 3px rgba(0,0,0,0.9); }
.mf-overlay .badge { pointer-events: auto; }
.mf-controls {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px;
}
.mf-vol { width: 120px; accent-color: var(--accent, #4a9eff); }
.mf-side {
  flex: 0 0 320px; display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto;
}
.mf-panel { background: var(--bg-1); border-radius: var(--r-md); padding: 10px 12px; }
.mf-scopeRow { display: flex; gap: 12px; align-items: flex-start; }
.mf-canvas { background: var(--bg-0); border-radius: 6px; display: block; }
.mf-hint { font-size: var(--fs-2xs); color: var(--text-4); text-align: center; margin-top: 4px; }
.mf-dim { font-size: var(--fs-xs); color: var(--text-3); padding: 4px 0; }
.mf-danger { font-size: var(--fs-xs); color: var(--danger); padding: 4px 0; }

/* Stack on narrow windows. */
@media (max-width: 900px) {
  .mf-root { flex-direction: column; }
  .mf-side { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; }
  .mf-side .mf-panel { flex: 1 1 240px; }
}

/* QC fault chips (black / freeze / silence) — client-side detector state.
   Sits under the top overlay so it never collides with the title or the
   status badge. */
.mv-qc-chips {
  position: absolute;
  top: 30px;
  left: 6px;
  display: flex;
  gap: 4px;
  z-index: 3;
  pointer-events: none;
}
.mv-qc-chip {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--danger);
  color: #fff;
}
