/* MCR Operator Monitoring Panel.
 *
 * Builds on techex.css tokens (--bg, --surface, --border, --text, --muted,
 * --accent, --accent-2, --warn, --danger, --radius...). Dark is the default via
 * theme.js. House rules: no left-edge accent strips anywhere; differentiate with
 * full borders, background tint, and heading colour only. Target wall is a
 * 2560x1440 monitor; the card grid is sized for five games + one system tile.
 */

/* --- MCR-specific tokens, defined for both themes --- */
:root {
  --mcr-header-h: 48px;
  --mcr-gap: 12px;
  --lamp-ok: #2f6b46;        /* calm green, reads as "fine" not "look at me" */
  --lamp-ok-text: #9fe7bd;
  --lamp-active: var(--danger);
  --lamp-latched: var(--warn);
  --lamp-off: #33405f;
  --ok: #16a34a;
  --live: #16a34a;
  --poll: #f59e0b;
  --downcol: #dc2626;
}

:root:not([data-theme="dark"]) {
  --lamp-ok: #cfe9d8;
  --lamp-ok-text: #1a6b3d;
  --lamp-off: #dfe3ea;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Fira Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header strip ===== */
.mcr-header {
  height: var(--mcr-header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.mcr-header .brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}
.view-switcher {
  flex: 0 0 auto; width: auto; max-width: 200px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 3px 8px; margin-left: 4px; cursor: pointer;
}
.view-switcher:hover { border-color: var(--accent); }
.mcr-header .brand .mark {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.mcr-header .spacer { flex: 1; }
.mcr-header .clock {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.mcr-header .clock b { color: var(--text); font-weight: 600; }
.mcr-header a { color: var(--muted); text-decoration: none; }
.mcr-header a:hover { color: var(--accent); }

.hdr-user { display: flex; flex-direction: column; line-height: 1.15; }
.hdr-user .u { font-weight: 600; font-size: 13px; }
.hdr-user .r { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }

/* status dot (WS link / instance health) */
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block; flex: 0 0 auto;
  background: var(--muted);
}
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.down { background: var(--danger); }
.dot.pulse { animation: dotpulse 1.6s ease-in-out infinite; }
@keyframes dotpulse { 50% { opacity: 0.35; } }

/* transport badge */
.badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em;
  padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.badge.live { color: #fff; background: var(--live); border-color: var(--live); }
.badge.poll { color: #3a2c05; background: var(--poll); border-color: var(--poll); }
.badge.down { color: #fff; background: var(--downcol); border-color: var(--downcol); }

/* small icon button (theme toggle, header actions) */
.iconbtn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.iconbtn:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Wall ===== */
.wall {
  height: calc(100dvh - var(--mcr-header-h));
  padding: var(--mcr-gap);
  display: grid;
  gap: var(--mcr-gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
/* 4-or-fewer games collapse to a tighter grid */
.wall[data-count="1"] { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.wall[data-count="2"] { grid-template-columns: repeat(2, 1fr); grid-template-rows: 1fr; }
.wall[data-count="3"],
.wall[data-count="4"] { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }

/* ===== Game card ===== */
.game {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  /* title | video (absorbs slack) | sources+meters | lamps|scte | health */
  grid-template-rows: auto minmax(120px, 1fr) auto auto auto;
  min-height: 0;
  min-width: 0;
}
.game.break-active { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.game.degraded { border-color: var(--danger); }

.game .g-title {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  min-height: 32px;
}
.game .g-title .name { font-weight: 600; font-size: 13.5px; }
.game .g-title .net {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--muted); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px; text-transform: uppercase;
}
.game .g-title .inst {
  font-size: 10px; font-weight: 600;
  color: var(--muted); border: 1px solid var(--border);
  background: var(--surface);
  padding: 1px 8px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 140px; min-width: 0;
  text-decoration: none;
}
.game .g-title .inst[href] { cursor: pointer; }
.game .g-title .inst[href]:hover { border-color: var(--accent); color: var(--accent); }
.game .g-title .spacer { flex: 1; }

/* video: fills the flexible grid row; contain keeps 16:9 letterboxed */
.g-video {
  position: relative;
  background: #000;
  min-height: 0;
  cursor: pointer;
  overflow: hidden;
}
.g-video video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.g-video .vph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; gap: 6px; flex-direction: column;
  background: repeating-linear-gradient(45deg, #0b0b0f, #0b0b0f 12px, #101018 12px, #101018 24px);
}
.g-video .v-overlay {
  position: absolute; left: 6px; bottom: 6px; right: 6px;
  display: flex; gap: 6px; align-items: center; pointer-events: none;
}
.v-chip {
  font-size: 10.5px; font-weight: 600;
  background: rgba(0,0,0,0.55); color: #eaeaea;
  padding: 2px 6px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.v-chip.err { background: rgba(220,38,38,0.85); color: #fff; }
.v-chip.ok { background: rgba(22,163,74,0.8); color: #fff; }

/* source buttons */
.g-avrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 5px 8px; border-bottom: 1px solid var(--border); min-width: 0;
}
.g-sources {
  display: flex; gap: 6px; align-items: center; flex: 0 0 auto;
}
.g-sources .lbl { font-size: 11px; color: var(--muted); margin-right: 2px; }
.src-btn {
  font: inherit; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); border-radius: 7px; padding: 5px 12px; cursor: pointer;
  position: relative; min-width: 52px;
}
.src-btn:hover:not(:disabled) { border-color: var(--accent); }
.src-btn.active {
  background: var(--accent-2); border-color: var(--accent-2); color: #fff;
}
.src-btn.pending {
  border-color: var(--warn); color: var(--warn);
  animation: srcpulse 1s ease-in-out infinite;
}
.src-btn.unconfirmed { border-color: var(--warn); color: var(--warn); border-style: dashed; }
.src-btn.slate.active { background: var(--warn); border-color: var(--warn); color: #241a02; }
.src-btn:disabled { opacity: 0.6; cursor: not-allowed; }
@keyframes srcpulse { 50% { background: color-mix(in srgb, var(--warn) 18%, var(--surface-2)); } }

/* ETR-290 P1 lamps */
.g-lampscte { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.g-lamps { padding: 6px 10px 6px 8px; display: grid; gap: 4px; flex: 0 0 auto; border-right: 1px solid var(--border); }
.lamp-row { display: flex; align-items: center; gap: 6px; }
.lamp-row .leg {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em;
  color: var(--muted); width: 34px; flex: 0 0 auto; text-transform: uppercase;
}
.lamp-row .clr {
  margin-left: auto; font-size: 10px; color: var(--muted);
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 5px; padding: 1px 6px; cursor: pointer;
}
.lamp-row .clr:hover { border-color: var(--accent); color: var(--accent); }
.lamps { display: flex; gap: 4px; }
.lamp {
  position: relative;
  width: 40px; height: 26px; border-radius: 5px;
  background: var(--lamp-off);
  display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 700; color: var(--muted);
  border: 1px solid transparent;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: filter .1s ease;
}
.lamp:hover { filter: brightness(1.2); }
.lamp.ok { background: var(--lamp-ok); color: var(--lamp-ok-text); }
.lamp.active { background: var(--lamp-active); color: #fff; border-color: #fff2; }
.lamp.latched { background: var(--lamp-off); border-color: var(--lamp-latched); color: var(--lamp-latched); }
.lamp .cnt {
  position: absolute; top: -5px; right: -4px;
  background: var(--text); color: var(--bg);
  font-size: 8.5px; padding: 0 3px; border-radius: 6px; min-width: 12px; text-align: center;
}

/* Audio meters (PCMMonitor: per-channel true-peak bars + loudness) */
.g-meters {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 6px;
  margin-left: auto; min-width: 0;
}
.g-meters .muted { font-size: 11px; }
.ameter {
  display: flex; align-items: flex-end; gap: 5px;
  padding: 3px 6px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 5px;
}
.ameter.clipped { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.am-lbl {
  align-self: center; min-width: 20px;
  font-size: 9.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em;
}
.am-bars { display: flex; align-items: flex-end; gap: 1.5px; height: 22px; }
.am-none { width: 12px; }
.am-ch {
  width: 4px; height: 100%; background: var(--border); border-radius: 1px;
  display: flex; align-items: flex-end; overflow: hidden;
}
.am-ch i { display: block; width: 100%; height: 0; background: var(--ok); transition: height 0.25s ease; }
.am-ch.low i  { background: #2f8f57; }
.am-ch.ok i   { background: var(--ok); }
.am-ch.hot i  { background: var(--warn); }
.am-ch.clip i { background: var(--danger); }
.am-lufs {
  align-self: center; font-size: 10px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.am-lufs i { font-size: 7.5px; font-weight: 600; font-style: normal; color: var(--muted); margin-left: 2px; }
.ameter.clipped .am-lufs { color: var(--danger); }

/* SCTE ticker */
.g-scte {
  padding: 6px 8px 6px 10px;
  display: grid; gap: 3px; min-height: 0; overflow: hidden;
  align-content: start; flex: 1 1 auto; min-width: 0;
}
.g-scte .scte-hd { display: flex; align-items: center; gap: 8px; }
.g-scte .scte-hd .t { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.brk-countdown {
  margin-left: auto; font-size: 11px; font-weight: 700;
  color: #241a02; background: var(--warn); padding: 1px 8px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.scte-line {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 11.5px; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scte-line .ts { color: var(--muted); }
.scte-line .kind { font-weight: 700; width: 30px; }
.scte-line .kind.out { color: var(--warn); }
.scte-line .kind.in { color: var(--accent-2); }
.scte-line .kind.sig { color: var(--accent); }
.scte-line .src { color: var(--muted); font-size: 10px; margin-left: auto; }
.g-scte .empty { color: var(--muted); font-size: 11px; font-style: italic; }

/* health strip */
.g-health {
  padding: 6px 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  background: var(--surface-2);
}
.hchip {
  font-size: 10.5px; display: inline-flex; gap: 5px; align-items: center;
  border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}
.hchip .k { color: var(--muted); }
.hchip.alarm { border-color: var(--danger); color: var(--danger); }
.hchip.warn { border-color: var(--warn); color: var(--warn); }

/* breaks tray (future) */
.g-tray { padding: 6px 8px; border-top: 1px solid var(--border); }
.g-tray summary { font-size: 11px; color: var(--muted); cursor: pointer; }
.g-tray .tray-body { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* system tile (6th cell) */
.system {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto;
}
.system h2 { font-size: 13px; font-weight: 650; margin: 0; }
.system .sys-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.system .sys-sec { border-top: 1px solid var(--border); padding-top: 8px; }
.system .audit-line { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ===== enlarge modal ===== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  max-width: 90vw; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
}
.modal .m-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.modal .m-head .spacer { flex: 1; }
.modal video { max-width: 88vw; max-height: 72vh; background: #000; }
.modal .m-meters { display: flex; gap: 10px; padding: 8px 12px; flex-wrap: wrap; }

/* ===== login ===== */
.login-wrap {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: 340px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-lift);
}
.login-card h1 { font-size: 18px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.login-card input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.login-card button { width: 100%; margin-top: 18px; }
.login-card .brand { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-weight: 700; }
.login-card .brand .mark { color: var(--accent); font-size: 20px; }

/* ===== admin ===== */
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 20px; }
.admin-nav { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-nav a {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 13px; background: var(--surface);
}
.admin-nav a:hover { border-color: var(--accent); color: var(--accent); }
.admin-nav a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h2 { font-size: 15px; margin: 0 0 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.tbl th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-grid label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-grid input, .form-grid select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit;
}
.form-grid .full { grid-column: 1 / -1; }
.row-actions { display: flex; gap: 6px; }

.toast-host { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; font-size: 13px; box-shadow: var(--shadow-lift); max-width: 360px;
}
.toast.ok { border-color: var(--accent-2); }
.toast.err { border-color: var(--danger); }
.toast.warn { border-color: var(--warn); }

.muted { color: var(--muted); }
.hidden { display: none !important; }

/* --- PID monitor (Services + Packets, colored moving bitrate graphs) --- */
.pids-btn { padding: 1px 8px; font-size: 11px; }
.modal.wide { width: min(1080px, 94vw); }
.pm-host { padding: 8px 10px 12px; max-height: 78vh; overflow: hidden; display: flex; }
.pidmon { display: flex; flex-direction: column; gap: 6px; width: 100%; min-height: 0; }

.pm-legs { display: flex; gap: 6px; align-items: center; }
.pm-leg {
  font: inherit; font-size: 12px; padding: 3px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.pm-leg:hover { border-color: var(--accent); color: var(--text); }
.pm-leg.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pm-live { width: 6px; height: 6px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.25); }

.pm-scroll { overflow-y: auto; min-height: 0; padding-right: 4px; }
.pm-sec {
  position: sticky; top: 0; z-index: 2; background: var(--surface);
  font-weight: 650; font-size: 12px; letter-spacing: .02em; text-transform: uppercase;
  color: var(--muted); padding: 8px 2px 4px; border-bottom: 1px solid var(--border);
}
.pm-muxbr { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text); margin-left: 8px; }
.pm-svc { display: flex; gap: 8px; align-items: baseline; padding: 6px 4px 3px; font-size: 12.5px; }
.pm-svc .muted { font-size: 11.5px; }

.pm-cols, .pm-row {
  display: grid;
  grid-template-columns: 50px 18px minmax(120px, 1fr) 42px 96px 150px 52px;
  align-items: center; gap: 8px;
}
.pm-cols { padding: 2px 6px; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .03em; color: var(--muted); }
.pm-cols span:nth-child(4), .pm-cols span:nth-child(5), .pm-cols span:nth-child(7) { text-align: right; }

.pm-row { padding: 3px 6px; border-radius: 7px; font-size: 12.5px; }
.pm-row:hover { background: var(--surface-2); }
.pm-row.stale { opacity: .42; }
.pm-pid {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px;
  text-align: center; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 0;
}
.pm-dot { text-align: center; font-size: 12px; line-height: 1; }
.pm-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pm-lock { font-size: 10px; }
.pm-cc { text-align: right; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px; color: var(--muted); }
.pm-cc.bad { color: var(--warn); font-weight: 600; }
.pm-bps { text-align: right; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.pm-spark { height: 26px; }
.pm-spark canvas { width: 100%; height: 26px; display: block; }
.pm-pct { text-align: right; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pm-empty { padding: 24px 8px; text-align: center; }

/* Admin views: game / view picker lists.
   Selectors are .pick-list-scoped to outrank the generic .form-grid label/input
   rules (which force block labels and full-width inputs). */
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; padding: 4px 2px; }
.pick-list .pick { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0; color: var(--text); }
.pick-list .pick > span { min-width: 170px; flex: 0 0 auto; }
.pick-list .pick input[type="checkbox"],
.pick-list .pick input[type="radio"] { width: auto; margin: 0; flex: 0 0 auto; }
.pick-list .pick .ord { width: 54px; flex: 0 0 auto; padding: 3px 6px; }
.pick-list .pick .def { color: var(--muted); font-size: 11px; display: inline-flex; align-items: center; gap: 3px; margin: 0 0 0 auto; }

/* Wall tile re-arranging: drag a card by its title bar onto another to swap */
.game .g-title { cursor: grab; }
.game .g-title:active { cursor: grabbing; }
.game.dragging { opacity: 0.55; }
.game.drop-target { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Admin view editor: draggable game tiles in two zones */
.vg-zone {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  min-height: 52px; padding: 10px;
  border: 1px dashed var(--border); border-radius: 8px;
}
.vg-zone.over { border-color: var(--accent); }

/* the 3x2 panel grid mirroring the wall */
.vg-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.vg-slot {
  min-height: 64px; padding: 6px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2);
}
.vg-slot.empty { border-style: dashed; background: transparent; }
.vg-slot .ph { font-size: 20px; font-weight: 700; color: var(--muted); opacity: 0.45; }
.vg-slot.over { border-color: var(--accent); border-style: solid; box-shadow: inset 0 0 0 1px var(--accent); }
.vg-slot .vg-tile {
  width: 100%; background: transparent; border: none; padding: 2px 4px;
  justify-content: flex-start;
}
.vg-slot .vg-tile .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vg-tile .net {
  font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--muted); border: 1px solid var(--border);
  padding: 0 5px; border-radius: 4px; text-transform: uppercase;
}
.vg-note { font-size: 11px; margin: 6px 0 0; }
.vg-empty { font-size: 12px; }
.vg-tile {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; font-size: 13px; user-select: none; cursor: grab;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
}
.vg-tile:active { cursor: grabbing; }
.vg-tile.dragging { opacity: 0.5; }
.vg-tile .pos {
  font-style: normal; font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-2); color: #fff;
}
.vg-tile .x {
  border: none; background: none; color: var(--muted);
  font: inherit; font-size: 18px; line-height: 1; padding: 2px 6px; cursor: pointer;
}
.vg-tile .x:hover { color: var(--danger); }
.vg-tile.add { border-style: dashed; }
.vg-tile.add .plus { font-style: normal; font-weight: 700; color: var(--accent); }

/* Closed-caption cell in the lamp row (ccmon sidecar / Darwin extractor) */
.lamp.cc { letter-spacing: 0.04em; }
.lamp.cc.warn { background: var(--warn); color: #241a02; border-color: var(--warn); }
