:root {
  color-scheme: dark;
  --bg: #101214;
  --workspace: #15191e;
  --panel: #1e242b;
  --panel-soft: #28313b;
  --panel-strong: #343e49;
  --text: #eef2f4;
  --muted: #9aa7b3;
  --cable: #7f8d99;
  --preview: #35d07f;
  --program: #ff3448;
  --warning: #ffcc66;
  --button: #38424e;
  --button-hover: #465360;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

button {
  border: 0;
  font: inherit;
}

.app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  flex-direction: column;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  flex: 0 0 auto;
  margin-bottom: 12px;
}

.eyebrow,
.node-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3.3rem);
}

h2 {
  font-size: 1.16rem;
}

h3 {
  font-size: 1rem;
}

.status-pill {
  min-width: 190px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 52, 72, 0.35);
  border-radius: 999px;
  background: rgba(255, 52, 72, 0.12);
  color: #ffd4d8;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: var(--panel);
}

body.is-read-only .library-button#importSetup,
body.is-read-only #openGearLibrary {
  opacity: 0.45;
  pointer-events: none;
}

.is-hidden {
  display: none !important;
}

.audio-meter-popover {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 80;
  width: min(480px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid rgba(76, 201, 240, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(38, 45, 52, 0.96), rgba(16, 20, 24, 0.96));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  color: var(--text);
  pointer-events: auto;
}

.audio-meter-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.audio-meter-head span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.audio-meter-head strong {
  display: block;
  margin-top: 3px;
  font-size: 1.2rem;
  line-height: 1.1;
}

.audio-meter-head em {
  min-width: 58px;
  padding: 6px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.audio-meter-body {
  display: grid;
  grid-template-columns: 80px 34px 80px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.audio-meter-body.is-headphone {
  grid-template-columns: 96px minmax(0, 1fr);
}

.audio-meter-body.is-headphone .audio-meter-readout {
  min-height: 138px;
}

.audio-meter-strip {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.audio-mode-bar {
  display: block;
  width: 46px;
  height: 7px;
  border-radius: 999px;
  background: #1b1d20;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.32);
}

.audio-mode-bar.is-on {
  background: #ff222f;
  box-shadow:
    0 0 10px rgba(255, 34, 47, 0.7),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.audio-mode-bar.is-afv {
  background: #d2ad05;
  box-shadow:
    0 0 10px rgba(210, 173, 5, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.audio-mode-bar.is-off {
  background: #22262a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.34);
}

.audio-meter-strip > span,
.audio-meter-strip > strong {
  color: var(--muted);
  font-weight: 900;
}

.audio-meter-strip > strong {
  min-height: 20px;
  color: #f0dd21;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.audio-meter-strip > span {
  font-size: 0.75rem;
}

.audio-meter-track {
  position: relative;
  width: 42px;
  height: 154px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 35, 50, 0.22) 0 16.67%, rgba(255, 210, 70, 0.18) 16.67% 33.33%, rgba(55, 230, 120, 0.14) 33.33%),
    #080a0c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}

.audio-channel-strip {
  display: grid;
  grid-template-columns: 24px 42px;
  gap: 8px;
  align-items: end;
}

.audio-channel-fader {
  position: relative;
  width: 24px;
  height: 154px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: ns-resize;
  touch-action: none;
}

.audio-channel-fader-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 8px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #050607;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.audio-channel-fader-thumb {
  position: absolute;
  left: 50%;
  bottom: var(--fader-pos);
  width: 32px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, #f4f5f6, #9da3a8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 2px 6px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, 50%);
}

.audio-channel-fader:focus-visible .audio-channel-fader-thumb {
  outline: 2px solid rgba(76, 201, 240, 0.8);
  outline-offset: 2px;
}

.audio-fader-lock {
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  width: 38px;
  height: 42px;
  margin-bottom: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.audio-fader-lock:hover {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.audio-fader-lock svg {
  width: 32px;
  height: 32px;
  overflow: visible;
}

.lock-shackle {
  fill: none;
  stroke: #edf2f5;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lock-body {
  fill: #8e969d;
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 1;
}

.audio-fader-lock.is-locked .lock-body {
  fill: #e0b52d;
}

.audio-fader-lock.is-unlocked .lock-body {
  fill: #8e969d;
}

.lock-keyhole {
  fill: none;
  stroke: rgba(20, 22, 24, 0.78);
  stroke-width: 3;
  stroke-linecap: round;
}

.audio-fader-lock.is-unlocked .lock-shackle {
  stroke: #d7dde1;
}

.audio-meter-track::before {
  content: "";
  position: absolute;
  inset: 8px 18px 8px 8px;
  background: repeating-linear-gradient(
    to top,
    rgba(255, 255, 255, 0.14) 0 1px,
    transparent 1px 10px
  );
  opacity: 0.7;
}

.audio-meter-track i {
  position: absolute;
  right: 20px;
  bottom: 6px;
  left: 6px;
  height: var(--level);
  border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, #f02a34 0 16.67%, #e0d31f 16.67% 33.33%, #18c733 33.33%);
  background-size: 100% 142px;
  background-position: bottom;
  animation: meterLevelPulse 760ms ease-in-out infinite alternate;
  box-shadow: 0 0 12px rgba(24, 199, 51, 0.42);
}

.audio-meter-scale {
  position: absolute;
  top: 6px;
  right: 4px;
  bottom: 6px;
  width: 15px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.52rem;
  font-weight: 900;
  pointer-events: none;
}

.audio-meter-scale span {
  position: absolute;
  right: 0;
  transform: translateY(50%);
}

.audio-meter-popover.is-muted .audio-meter-track {
  background:
    linear-gradient(180deg, rgba(120, 126, 132, 0.24), rgba(80, 86, 92, 0.12)),
    #080a0c;
}

.audio-meter-popover.is-muted .audio-meter-track i {
  background: linear-gradient(180deg, #aeb4ba, #6f777f);
  box-shadow: none;
}

.audio-meter-popover.is-muted .audio-meter-strip > strong {
  color: #b8bec4;
}

.audio-meter-readout {
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 138px;
  padding: 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.24);
}

.audio-meter-readout span,
.audio-meter-readout small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.audio-meter-readout strong {
  font-size: 1.8rem;
  line-height: 1;
}

.audio-meter-readout b {
  color: var(--text);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.audio-meter-readout small {
  line-height: 1.25;
  text-transform: none;
}

@keyframes meterLevelPulse {
  from {
    height: var(--level-low);
  }

  to {
    height: var(--level-high);
  }
}

.audio-gain-control {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: ew-resize;
  text-align: left;
}

.audio-gain-control .mini-knob {
  width: 40px;
  height: 40px;
  justify-self: center;
  box-shadow:
    0 0 0 3px rgba(26, 216, 70, 0.82),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 8px 16px rgba(0, 0, 0, 0.32);
}

.audio-gain-control .mini-knob::after {
  top: 19px;
  width: 16px;
  height: 3px;
  transform: rotate(var(--knob-angle)) translateX(4px);
}

.audio-gain-control strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.library {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.library-button,
.gear-option,
.small-button,
.switcher-action,
.source-button,
.zoom-button {
  border-radius: 6px;
  color: var(--text);
  background: var(--button);
  cursor: pointer;
  font-weight: 900;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.library-button {
  min-height: 42px;
  padding: 0 16px;
}

.library-button:hover,
.gear-option:hover,
.small-button:hover,
.switcher-action:hover,
.source-button:hover,
.zoom-button:hover {
  transform: translateY(-1px);
  background: var(--button-hover);
}

.gear-dialog {
  width: min(780px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.gear-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.gear-dialog-card {
  display: grid;
  gap: 18px;
  margin: 0;
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.gear-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 430px;
  overflow: auto;
}

.gear-option {
  display: grid;
  gap: 5px;
  min-height: 84px;
  padding: 12px;
  text-align: left;
}

.gear-option span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.3;
}

.empty-search {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.custom-gear {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.custom-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.edit-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.custom-grid input,
.custom-grid select,
.edit-field input {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0 10px;
  background: #11161b;
  color: var(--text);
  font: inherit;
}

.align-end {
  align-self: end;
}

.dialog-actions {
  display: flex;
  justify-content: end;
}

.port-list {
  display: grid;
  max-height: 240px;
  gap: 8px;
  overflow: auto;
}

.port-row {
  display: grid;
  grid-template-columns: 72px 1fr 130px auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.port-row span,
.port-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-button {
  display: grid;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0 12px;
}

.zoom-button.wide {
  min-width: 68px;
}

.zoom-readout {
  min-width: 58px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.workspace-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #0d1013;
  box-shadow: var(--shadow);
}

.workspace-scale-shell {
  position: relative;
}

.workspace {
  position: relative;
  width: 12000px;
  height: 8000px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--workspace);
  background-size: 32px 32px;
  transform-origin: top left;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.empty-state strong {
  color: var(--text);
  font-size: 1.4rem;
}

.empty-state.is-hidden {
  display: none;
}

.selection-marquee {
  position: absolute;
  z-index: 2;
  border: 2px solid rgba(76, 201, 240, 0.95);
  border-radius: 6px;
  background: rgba(76, 201, 240, 0.14);
  box-shadow: 0 0 18px rgba(76, 201, 240, 0.24);
  pointer-events: none;
}

.selection-marquee.is-hidden {
  display: none;
}

.cable-layer,
.device-layer {
  position: absolute;
  inset: 0;
}

.device-layer {
  pointer-events: none;
}

.cable-layer {
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.cable-hit-area {
  fill: none;
  stroke: transparent;
  stroke-width: 18;
  cursor: pointer;
  pointer-events: stroke;
}

.cable-layer path {
  fill: none;
  stroke: rgba(127, 141, 153, 0.82);
  stroke-width: 3;
  pointer-events: none;
}

.cable-layer path.is-preview {
  stroke: rgba(53, 208, 127, 0.88);
  stroke-width: 4;
}

.cable-layer path.is-program {
  stroke: rgba(255, 52, 72, 0.92);
  stroke-width: 5;
}

.cable-layer path.cable-hit-area {
  stroke: transparent;
  stroke-width: 18;
  pointer-events: stroke;
}

.cable-layer path.is-selected {
  filter: drop-shadow(0 0 5px rgba(76, 201, 240, 0.95));
  stroke-width: 5;
}

.cable-layer text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.cable-layer .audio-note {
  font-size: 34px;
  font-weight: 900;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(5, 6, 7, 0.82);
  stroke-width: 5px;
  text-shadow: 0 0 10px currentColor;
}

.cable-layer .audio-note.is-fading {
  animation: audioNoteFade 900ms ease-out forwards;
}

@keyframes audioNoteFade {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.node {
  position: absolute;
  width: 270px;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.node.is-preview {
  border-color: rgba(53, 208, 127, 0.7);
}

.node.is-selected {
  outline: 2px solid rgba(76, 201, 240, 0.9);
  outline-offset: 4px;
}

.node.is-program {
  border-color: rgba(255, 52, 72, 0.78);
}

.node.is-dragging {
  z-index: 20;
}

.node.is-transitioning {
  animation: transitionPulse var(--transition-duration, 650ms) ease-in-out;
}

.node.is-file-hover {
  outline: 2px solid var(--preview);
  outline-offset: 4px;
}

.drag-handle {
  cursor: grab;
  user-select: none;
}

.node.is-dragging .drag-handle {
  cursor: grabbing;
}

.node-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
}

.node-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.node-body {
  padding: 0 14px 14px;
}

.gear-image,
.source-product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #f4f4f4;
}

.gear-image,
.source-visual .source-product-image {
  height: 150px;
}

.source-visual {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.source-visual .test-picture,
.source-visual .media-surface,
.source-product-face {
  height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.source-visual:hover .source-product-image,
.source-visual:hover .test-picture,
.source-visual:hover .media-surface,
.source-visual:hover .source-product-face {
  outline: 2px solid rgba(53, 208, 127, 0.55);
  outline-offset: 2px;
}

.source-product-face {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(76, 201, 240, 0.12)),
    #0b0f12;
  color: var(--text);
  text-align: center;
}

.source-product-face strong {
  font-size: 1.45rem;
  line-height: 1;
}

.source-product-face span {
  color: var(--muted);
  font-weight: 900;
}

.atem-image {
  height: 118px;
  background: #ffffff;
}

.simple-device-face {
  display: grid;
  min-height: 112px;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(135deg, rgba(76, 201, 240, 0.18), rgba(255, 255, 255, 0.06)),
    #10151a;
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
}

.switcher-title-face {
  min-height: 74px;
  font-size: 1.25rem;
}

.media-drop-zone,
.media-surface {
  width: 100%;
  min-height: 150px;
  border-radius: 6px;
}

.media-drop-zone {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.media-surface {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0b0f12;
}

.media-surface img,
.media-surface video {
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
}

.file-placeholder {
  gap: 8px;
  padding: 18px;
  text-align: center;
}

.file-placeholder strong {
  color: var(--text);
  font-size: 1.55rem;
}

.file-placeholder span {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.splitter-face {
  min-height: 96px;
  color: #d8f7ff;
}

.monitor-screen {
  aspect-ratio: 16 / 10;
  padding: 10px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: #050607;
}

.test-picture {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  border-radius: 5px;
  background: #111;
}

.test-picture::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 14%, transparent 14% 28%, rgba(0, 0, 0, 0.18) 28% 42%, transparent 42% 56%, rgba(255, 255, 255, 0.18) 56% 70%, transparent 70%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.32), transparent 42%);
}

.test-picture.no-signal {
  background: #111;
}

.test-picture span {
  position: relative;
  padding: 0 10px;
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 2.5rem);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.transition-picture {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 5px;
  background: #050607;
}

.transition-layer {
  position: absolute;
  inset: 0;
}

.transition-layer .test-picture,
.transition-layer .media-surface,
.transition-layer .black-picture {
  height: 100%;
  min-height: 0;
  border-radius: 5px;
}

.black-picture {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 5px;
  background: #000;
}

.pip-picture {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 5px;
  background: #050607;
}

.pip-program-layer,
.pip-program-layer .test-picture,
.pip-program-layer .media-surface {
  width: 100%;
  height: 100%;
}

.pip-slot {
  position: absolute;
  width: 28%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 4px;
  background: #050607;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.pip-slot .test-picture,
.pip-slot .media-surface {
  width: 100%;
  height: 100%;
  border-radius: 2px;
}

.pip-slot .test-picture span {
  padding: 0 4px;
  font-size: clamp(0.5rem, 1.1vw, 0.82rem);
}

.pip-slot-top-left {
  top: 8%;
  left: 8%;
}

.pip-slot-top-right {
  top: 8%;
  right: 8%;
}

.pip-slot-bottom-left {
  bottom: 8%;
  left: 8%;
}

.pip-slot-bottom-right {
  right: 8%;
  bottom: 8%;
}

.pip-slot-middle-left {
  top: 50%;
  left: 8%;
  transform: translateY(-50%);
}

.pip-slot-middle-right {
  top: 50%;
  right: 8%;
  transform: translateY(-50%);
}

.transition-layer.is-from {
  animation: fadeFrom var(--transition-duration, 650ms) ease-in-out forwards;
}

.transition-layer.is-to {
  animation: fadeTo var(--transition-duration, 650ms) ease-in-out forwards;
}

@keyframes fadeFrom {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes fadeTo {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.multiview-picture {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 5px;
  background: #050607;
}

.multiview-cell {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #fff;
}

.multiview-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), transparent 45%, rgba(0, 0, 0, 0.18));
}

.multiview-cell strong,
.multiview-cell span {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multiview-cell strong {
  font-size: 0.62rem;
}

.multiview-cell span {
  font-size: 0.74rem;
  font-weight: 900;
}

.multiview-cell.is-program {
  border-color: var(--program);
}

.multiview-cell.is-preview {
  border-color: var(--preview);
}

.node-meta,
.monitor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.08);
}

.small-button.danger {
  background: rgba(255, 52, 72, 0.18);
  color: #ffd4d8;
}

.switcher {
  width: 1894px;
  background: linear-gradient(180deg, #242b33, #171b20);
}

.switcher-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #0b0f12;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.switcher-display span {
  color: var(--muted);
  font-size: 0.84rem;
}

.switcher-display strong {
  color: #ffd4d8;
  font-size: 1rem;
}

.atem-control-panel {
  overflow: hidden;
  border-radius: 16px;
  border: 2px solid #6f7375;
  background: #c9c9c7;
  padding: 18px 20px 20px;
  color: #101214;
}

.atem-panel-label {
  color: #101214;
  font-weight: 900;
  letter-spacing: 0;
}

.atem-panel-label {
  margin-bottom: 18px;
  font-size: 1.05rem;
}

.atem-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 122px 494px;
  gap: 18px;
  align-items: end;
}

.atem-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 494px;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.atem-source-bank,
.atem-top-source-bank,
.atem-extra-bank,
.atem-transition-bank,
.atem-source-column,
.top-device-control {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.atem-source-column {
  min-width: 126px;
  grid-template-rows: 126px 126px 84px;
}

.atem-source-columns,
.atem-top-source-columns {
  display: grid;
  gap: 14px;
}

.atem-source-control-grid,
.atem-small-grid,
.top-device-buttons,
.select-bus-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(58px, 1fr));
  gap: 10px;
  align-content: start;
}

.atem-extra-sources,
.switcher-actions {
  display: grid;
  gap: 10px;
}

.atem-extra-sources {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: end;
}

.switcher-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.atem-extra-spacer,
.atem-transition-top {
  min-height: 272px;
}

.atem-transition-top {
  align-content: end;
}

.atem-transition-bank {
  justify-self: end;
  width: 422px;
}

.panel-button,
.source-button,
.switcher-action {
  display: grid;
  min-width: 0;
  place-items: center;
  border-radius: 8px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.panel-button {
  height: 32px;
  min-height: 0;
  padding: 0 8px;
  border: 2px solid #7b7f82;
  background:
    linear-gradient(#0c0d0f, #020303);
  color: #f3f5f6;
  cursor: pointer;
  font-size: 0.64rem;
  text-align: center;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.16),
    0 2px 0 rgba(0, 0, 0, 0.55);
}

.panel-button:disabled {
  opacity: 0.82;
  cursor: default;
}

.panel-button.source-extra {
  height: 37px;
  min-height: 0;
  font-size: 0.72rem;
}

.panel-button.media-source-button {
  cursor: pointer;
}

.panel-button.media-source-button.is-preview {
  border-color: #0f2719;
  background: linear-gradient(#53e493, #32cc78);
  color: #06120b;
}

.panel-button.media-source-button.is-program {
  border-color: #5d0710;
  background: linear-gradient(#ff4961, #ff263d);
  color: #fff;
}

.mini-knob {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 32%, #f8f8f8 0 18%, #cfd2d4 44%, #767d82 76%, #202326 100%);
  box-shadow:
    0 0 0 2px rgba(30, 220, 70, 0.78),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.mini-knob::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: #101214;
  transform: rotate(var(--knob-angle)) translateX(2px);
  transform-origin: left center;
}

.duration-button.is-selected,
.video-out-button.is-selected,
.pip-button.is-selected {
  border-color: #f3f5f6;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 2px 0 rgba(0, 0, 0, 0.55);
}

.pip-button {
  cursor: pointer;
}

.pip-icon-button {
  position: relative;
  display: grid;
  place-items: center;
}

.pip-icon {
  position: relative;
  display: block;
  width: 40px;
  height: 22px;
  border-radius: 2px;
  background: linear-gradient(#25282b, #17191b);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.pip-icon::before,
.pip-icon::after {
  content: "";
  position: absolute;
  border-radius: 1px;
  background: linear-gradient(#f3f5f6, #dfe3e5);
}

.pip-icon::before {
  width: 15px;
  height: 9px;
}

.pip-icon-top-left::before {
  top: 3px;
  left: 4px;
}

.pip-icon-top-right::before {
  top: 3px;
  right: 4px;
}

.pip-icon-bottom-left::before {
  bottom: 3px;
  left: 4px;
}

.pip-icon-bottom-right::before {
  right: 4px;
  bottom: 3px;
}

.pip-icon-middle-left::before {
  top: 50%;
  left: 4px;
  transform: translateY(-50%);
}

.pip-icon-middle-split::before,
.pip-icon-middle-split::after {
  top: 50%;
  width: 14px;
  height: 10px;
  transform: translateY(-50%);
}

.pip-icon-middle-split::before {
  left: 5px;
}

.pip-icon-middle-split::after {
  right: 5px;
}

.panel-button.transition-extra {
  height: 84px;
  min-height: 0;
  font-size: 1rem;
}

.audio-button.is-active,
.panel-button.is-lit {
  border-color: #ff2c38;
  background: linear-gradient(#151010, #030303);
  color: #ff4148;
  text-shadow: 0 0 7px rgba(255, 55, 66, 0.9);
  box-shadow:
    inset 0 0 0 2px rgba(255, 64, 72, 0.2),
    0 0 0 1px rgba(255, 44, 56, 0.9),
    0 0 10px rgba(255, 44, 56, 0.7),
    0 2px 0 rgba(0, 0, 0, 0.55);
}

.switcher-mode-button {
  background: #f4f7f8;
  color: #11171b;
}

.switcher-mode-button.is-cut-bus {
  background: var(--program);
  color: #fff;
}

.top-device-control {
  align-content: start;
  gap: 6px;
}

.top-device-control strong,
.select-bus-core strong {
  color: #101214;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.select-bus-core {
  display: grid;
  grid-column: 4 / -1;
  gap: 6px;
  min-width: 0;
  padding-left: 68px;
}

.select-bus-buttons {
  grid-template-columns: repeat(14, minmax(0, 1fr));
}

.select-bus-core .panel-button {
  padding: 0 3px;
  font-size: 0.5rem;
}

.atem-status-bank {
  display: grid;
  min-width: 0;
}

.atem-status-bank {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  justify-self: end;
  width: 422px;
}

.status-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.status-control .top-device-buttons {
  grid-template-columns: 1fr;
}

.status-control .panel-button {
  padding: 0 5px;
  font-size: 0.56rem;
}

.right-control-panel {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas: "cut auto ftb";
  gap: 10px;
  align-items: end;
}

.right-control-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.right-control-group strong {
  color: #101214;
  font-size: 0.52rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.right-group-buttons {
  display: grid;
  gap: 10px;
}

.right-group-buttons.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.right-control-panel .panel-button {
  padding: 0 4px;
  font-size: 0.55rem;
}

.right-master-column {
  display: grid;
  gap: 10px;
  justify-items: center;
  min-width: 0;
  width: 100%;
}

.right-master-column.cut-column {
  grid-area: cut;
  align-items: end;
  align-self: start;
}

.right-master-column.auto-column {
  grid-area: auto;
}

.right-master-column.ftb-column {
  grid-area: ftb;
}

.macro-duration-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
  width: 100%;
}

.pip-control {
  position: absolute;
  top: 0;
  right: calc(100% + 12px);
  width: 134px;
  align-self: end;
}

.macro-control {
  justify-self: center;
  width: 100%;
}

.duration-control {
  justify-self: center;
  width: 100%;
}

.effect-control {
  justify-self: center;
  width: 100%;
}

.video-out-control {
  justify-self: center;
  width: 100%;
}

.atem-mini-panel {
  --mini-small-button-width: 54px;
  --mini-small-button-gap: 8px;
  --mini-big-button-width: calc(var(--mini-small-button-width) * 2 + var(--mini-small-button-gap));
  padding: 16px 18px 18px;
}

.atem-mini-panel .atem-panel-label {
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.atem-mini-grid {
  display: grid;
  grid-template-columns: 500px var(--mini-small-button-width) 620px;
  gap: 16px;
  align-items: start;
}

.atem-mini-raster {
  display: grid;
  grid-template-columns: repeat(8, var(--mini-big-button-width));
  grid-template-rows: 82px 100px 68px;
  gap: 12px 20px;
  align-items: start;
}

.atem-mini-raster .mini-col-1 {
  grid-column: 1;
}

.atem-mini-raster .mini-col-2 {
  grid-column: 2;
}

.atem-mini-raster .mini-col-3 {
  grid-column: 3;
}

.atem-mini-raster .mini-col-4 {
  grid-column: 4;
}

.atem-mini-raster .mini-col-5 {
  grid-column: 5;
}

.atem-mini-raster .mini-col-6 {
  grid-column: 6;
}

.atem-mini-raster .mini-col-7 {
  grid-column: 7;
}

.atem-mini-raster .mini-col-8 {
  grid-column: 8;
}

.atem-mini-raster .mini-top-slot {
  grid-row: 1;
}

.atem-mini-raster .mini-source-slot {
  grid-row: 2 / 4;
}

.atem-mini-raster .mini-still-slot {
  grid-row: 3;
  align-self: stretch;
}

.atem-mini-raster .mini-pip-control {
  grid-column: 5 / span 2;
  grid-row: 1;
  justify-self: end;
  width: calc(var(--mini-small-button-width) * 3 + var(--mini-small-button-gap) * 2);
  z-index: 1;
}

.atem-mini-raster .mini-duration-control {
  grid-column: 6;
  grid-row: 2;
  padding-top: 28px;
}

.atem-mini-raster .mini-key-control {
  grid-column: 7;
  grid-row: 1;
  justify-self: end;
  width: var(--mini-small-button-width);
  z-index: 2;
}

.atem-mini-raster .mini-effect-control {
  grid-column: 7;
  grid-row: 2;
}

.atem-mini-raster .mini-record-stream-bank {
  display: grid;
  grid-column: 8;
  grid-row: 1;
  grid-template-columns: repeat(2, var(--mini-small-button-width));
  gap: var(--mini-small-button-gap);
  justify-self: start;
  width: var(--mini-big-button-width);
  z-index: 2;
}

.atem-mini-raster .mini-record-stream-bank .status-column:first-child {
  grid-column: 1;
}

.atem-mini-raster .mini-record-stream-bank .status-column:last-child {
  grid-column: 2;
}

.atem-mini-raster .mini-video-out-control {
  grid-column: 8;
  grid-row: 2;
}

.atem-mini-raster .mini-duration-control,
.atem-mini-raster .mini-effect-control,
.atem-mini-raster .mini-video-out-control {
  align-self: end;
}

.atem-mini-raster > .switcher-action {
  grid-row: 3;
  width: 100%;
}

.atem-mini-left-bank {
  display: grid;
  grid-template-rows: auto 180px;
  gap: 12px;
  min-width: 0;
}

.atem-mini-top-row,
.atem-mini-source-columns {
  display: grid;
  gap: 12px;
}

.atem-mini-top-row {
  grid-template-columns: repeat(4, calc(var(--mini-small-button-width) * 2 + var(--mini-small-button-gap)));
  align-items: start;
}

.atem-mini-source-column {
  display: grid;
  grid-template-rows: 100px 68px;
  gap: 12px;
  min-width: 0;
}

.atem-mini-still-bank {
  display: grid;
  grid-template-rows: auto 180px;
  gap: 12px;
  padding-top: 88px;
  min-width: 0;
  width: var(--mini-small-button-width);
}

.atem-mini-still-buttons {
  display: grid;
  gap: var(--mini-small-button-gap);
  align-self: end;
}

.atem-mini-right-bank {
  display: grid;
  grid-template-rows: 180px 68px;
  gap: 12px;
  align-self: start;
  min-width: 0;
}

.atem-mini-right-controls {
  display: grid;
  grid-template-columns:
    calc(var(--mini-small-button-width) * 3 + var(--mini-small-button-gap) * 2)
    calc(var(--mini-small-button-width) * 2 + var(--mini-small-button-gap))
    calc(var(--mini-small-button-width) * 2 + var(--mini-small-button-gap))
    calc(var(--mini-small-button-width) * 3 + var(--mini-small-button-gap) * 2);
  grid-template-rows: 64px 104px;
  grid-template-areas:
    "pip . key status"
    "pip duration effect video";
  gap: 10px;
  align-items: start;
}

.atem-mini-right-controls .mini-pip-control {
  grid-area: pip;
}

.atem-mini-right-controls .mini-key-control {
  grid-area: key;
}

.atem-mini-right-controls .mini-record-stream-bank {
  grid-area: status;
  display: grid;
  grid-template-columns: repeat(2, var(--mini-small-button-width));
  gap: var(--mini-small-button-gap);
  width: auto;
  justify-self: end;
}

.atem-mini-panel .mini-pip-buttons {
  grid-template-columns: repeat(3, var(--mini-small-button-width));
}

.atem-mini-right-controls .mini-duration-control {
  grid-area: duration;
}

.atem-mini-right-controls .mini-effect-control {
  grid-area: effect;
}

.atem-mini-right-controls .mini-status-bank {
  grid-area: status;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: auto;
  justify-self: stretch;
}

.atem-mini-right-controls .mini-video-out-control {
  grid-area: video;
}

.atem-mini-panel .panel-button {
  width: var(--mini-small-button-width);
  height: 28px;
  min-width: 0;
  padding: 0 4px;
  border-radius: 6px;
  font-size: 0.52rem;
}

.atem-mini-panel .top-device-buttons,
.atem-mini-panel .atem-source-control-grid,
.atem-mini-panel .right-group-buttons {
  grid-template-columns: repeat(2, var(--mini-small-button-width));
  gap: var(--mini-small-button-gap);
  align-content: start;
}

.atem-mini-panel .right-group-buttons.mini-pip-buttons {
  grid-template-columns: repeat(3, var(--mini-small-button-width));
}

.atem-mini-panel .top-device-control {
  gap: 5px;
}

.atem-mini-panel .top-device-control strong,
.atem-mini-panel .right-control-group strong {
  font-size: 0.48rem;
}

.atem-mini-panel .source-button,
.atem-mini-panel .switcher-action {
  height: 68px;
}

.atem-mini-panel .source-button {
  width: calc(var(--mini-small-button-width) * 2 + var(--mini-small-button-gap));
  border-radius: 12px;
  font-size: 1.45rem;
}

.atem-mini-panel .switcher-actions {
  gap: 10px;
}

.atem-mini-panel .mini-switcher-actions {
  grid-template-columns:
    calc(var(--mini-small-button-width) * 3 + var(--mini-small-button-gap) * 2)
    calc(var(--mini-small-button-width) * 2 + var(--mini-small-button-gap))
    calc(var(--mini-small-button-width) * 2 + var(--mini-small-button-gap))
    calc(var(--mini-small-button-width) * 3 + var(--mini-small-button-gap) * 2);
}

.atem-mini-panel .switcher-action {
  width: 100%;
  border-radius: 8px;
}

.atem-mini-panel .panel-button.source-extra {
  height: 30px;
  font-size: 0.56rem;
}

.atem-mini-panel .status-column {
  grid-template-columns: var(--mini-small-button-width);
  gap: var(--mini-small-button-gap);
}

.atem-mini-panel .status-control .top-device-buttons {
  grid-template-columns: var(--mini-small-button-width);
}

.atem-mini-raster .mini-key-control .top-device-control,
.atem-mini-raster .mini-key-control .top-device-buttons,
.atem-mini-raster .mini-record-stream-bank .status-column,
.atem-mini-raster .mini-record-stream-bank .top-device-control,
.atem-mini-raster .mini-record-stream-bank .top-device-buttons {
  width: var(--mini-small-button-width);
}

.atem-mini-panel .status-control .panel-button {
  padding: 0 3px;
  font-size: 0.48rem;
}

.atem-source-top-controls {
  display: grid;
  align-content: end;
  height: 126px;
  min-height: 0;
  gap: 16px;
}

.atem-source-top-controls .atem-source-control-grid {
  transform: translateY(-23px);
}

.source-button {
  height: 84px;
  min-height: 0;
  border: 2px solid #8b8f91;
  border-radius: 15px;
  background: linear-gradient(#f4f6f7, #d9dddf);
  color: #11171b;
  cursor: pointer;
  font-size: 1.9rem;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 2px 0 rgba(0, 0, 0, 0.38);
}

.source-button.is-preview {
  border-color: #0f2719;
  background: linear-gradient(#53e493, #32cc78);
  color: #06120b;
}

.source-button.is-program {
  border-color: #5d0710;
  background: linear-gradient(#ff4961, #ff263d);
  color: #fff;
}

.switcher-action {
  height: 84px;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  background: #f4f7f8;
  color: #11171b;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.38);
}

.switcher-action.cut:active,
.node.is-cut-flashing .switcher-action.cut,
.node.is-transitioning .switcher-action.auto {
  background: var(--program);
  color: #fff;
}

.switcher-action.ftb:active,
.node.is-fading-to-black .switcher-action.ftb {
  background: linear-gradient(#2b2d2f, #070809);
  color: #fff;
}

.node.is-transitioning .monitor-screen {
  animation: autoBlend var(--transition-duration, 650ms) ease-in-out;
}

@keyframes autoBlend {
  0% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.65);
  }

  100% {
    filter: brightness(1);
  }
}

@keyframes transitionPulse {
  0%,
  100% {
    box-shadow: var(--shadow);
  }

  50% {
    box-shadow: 0 0 0 2px rgba(53, 208, 127, 0.5), var(--shadow);
  }
}

.socket {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 3px solid var(--socket-color, rgba(255, 255, 255, 0.8));
  border-radius: 50%;
  background: #0c1014;
  cursor: crosshair;
  transform: translate(-50%, -50%);
}

.socket::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.socket.is-output {
  left: 100%;
}

.socket.is-input {
  left: 0;
}

.socket.is-selected,
.socket:hover {
  border-color: var(--preview);
}

.socket.is-selected::after,
.socket:hover::after {
  background: var(--preview);
}

.socket-label {
  position: absolute;
  top: -7px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.socket.is-input .socket-label {
  right: 22px;
}

.socket.is-output .socket-label {
  left: 22px;
}

.record-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--program);
  box-shadow: 0 0 16px rgba(255, 52, 72, 0.8);
}

@media (max-width: 760px) {
  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .zoom-controls {
    justify-content: space-between;
  }

  .switcher {
    width: min(430px, calc(100vw - 64px));
  }

  .gear-list,
  .custom-grid {
    grid-template-columns: 1fr;
  }
}
