/* ═══════════════════════════════════════════════════════════════════════════
   Spatial Audio Renderer — FilmProcessor Design System
   Object-based audio rendering with VBAP speaker panning
   Merged with Surround Mixer features — matches Transcoder card pattern
   ═══════════════════════════════════════════════════════════════════════════ */

/* Import Fonts */
@font-face {
  font-family: "FilmProcessorFavorit";
  src: url("/assets/fonts/FilmProcessorFavorit-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "FilmProcessorFavorit";
  src: url("/assets/fonts/FilmProcessorFavorit-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: block;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-LatinExt.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: block;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* Design System Variables */
:root {
  --background-black: #000000;
  --heading-cyan: #00b9c7;
  --film-purple: #b40096;
  --title-white: #fffedc;
  --film-card-blue: #2563eb;
  --dcp-success: #22c55e;
  --error-red: #ef4444;
  --warning-orange: #f59e0b;
  --film-gray-900: #111111;
  --film-gray-800: #1a1a1a;
  --film-gray-700: #2a2a2a;
  --field-gray: #333333;
  --film-gray-500: #666666;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*:focus {
  outline: none;
}

*:focus-visible {
  outline: 1px solid var(--heading-cyan);
  outline-offset: 2px;
}

body {
  font-family: "FilmProcessorFavorit", "Inter", sans-serif;
  background: var(--background-black);
  color: var(--title-white);
  font-weight: 300;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

/* ─── Container ──────────────────────────────────────────────────────────── */

.container {
  padding: 0 150px 2rem 150px;
  max-width: 100%;
  overflow-x: hidden;
}

.page-title {
  font-family: "FilmProcessorFavorit", "Inter", sans-serif;
  font-size: 3.7rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--title-white);
  margin-bottom: 1rem;
  text-align: center;
}

.page-subtitle {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--heading-cyan);
  text-align: center;
  margin-bottom: 3rem;
}

/* ─── Grid Layout ─────────────────────────────────────────────────────────── */

.spatial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  overflow: hidden;
  align-items: start;
}

/* ─── Cards (matching transcoder pattern) ─────────────────────────────────── */

.card {
  background: #000000;
  border: 1px solid var(--field-gray);
  border-radius: 0;
  padding: 0.75rem 1.5rem 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
  animation: fadeIn 0.5s ease-out;
  min-width: 0;
  overflow: hidden;
}

.card:hover {
  border-color: var(--dcp-success);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Section Titles (matching transcoder pattern) ────────────────────────── */

.section-title {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--film-purple);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0;
  font-family: "JetBrains Mono", monospace;
  border-bottom: 1px solid var(--film-purple);
  padding-bottom: 0.5rem;
}

.section-title-with-icon {
  justify-content: space-between;
}

.compatibility-atlas-link {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--film-purple);
  text-decoration: none;
  transition: color 0.2s ease;
  transform: translateX(3px);
}

.compatibility-atlas-link:hover {
  color: var(--heading-cyan);
}

/* ─── Source Mode Selector ────────────────────────────────────────────────── */

.source-mode-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.ai-split-selector {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.ai-split-selector .source-select-pink {
  margin-bottom: 0;
}

#sourceContent {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

#sourceContent > * {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* ─── Upload Zone ─────────────────────────────────────────────────────────── */

.upload-zone {
  border: 1px dashed var(--heading-cyan);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: rgba(17, 17, 17, 0.3);
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.upload-zone:hover {
  border-color: var(--heading-cyan);
  background: rgba(0, 185, 199, 0.05);
}

.upload-zone.dragover {
  border-color: var(--film-purple);
  background: rgba(180, 0, 150, 0.1);
}

.upload-zone.has-file {
  border-color: var(--heading-cyan);
  border-style: solid;
  padding: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
}

.upload-zone.has-file .waveform-canvas {
  height: 100px;
  display: block;
}

.upload-zone > * {
  max-width: 100%;
}

.upload-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--film-purple);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.75rem;
}

.upload-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--title-white);
  margin-bottom: 0.5rem;
  font-weight: 400;
  pointer-events: none;
  overflow-wrap: anywhere;
}

.upload-hint {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--film-gray-500);
}

.file-input {
  display: none;
}

/* Waveform canvas inside upload zone */
.waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #000000;
  max-width: 100%;
}

.waveform-filename-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--heading-cyan);
  background: #000;
  padding: 0.4rem 0.6rem;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.waveform-filename-box .filename-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--title-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.waveform-filename-box .filename-play,
.waveform-filename-box .filename-close {
  background: none;
  border: none;
  color: var(--film-purple);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.waveform-filename-box .filename-play {
  width: 1.2rem;
  height: 0.75rem;
}

.waveform-filename-box .filename-play.active {
  color: var(--title-white);
}

.waveform-filename-box .filename-play:hover,
.waveform-filename-box .filename-close:hover {
  color: var(--title-white);
}

/* ─── Speaker Layout Selector ─────────────────────────────────────────────── */

.layout-select {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--heading-cyan);
  border-radius: 0;
  background: transparent;
  color: var(--title-white);
  cursor: pointer;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2300b9c7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 10px 6px;
}

.layout-select:hover {
  border-color: var(--accent-purple);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23b40096'/%3E%3C/svg%3E");
}

.layout-select option {
  background: var(--film-gray-800);
  color: var(--title-white);
}

/* ─── Output Mode Toggle ──────────────────────────────────────────────────── */

.output-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
}

.mode-btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--field-gray);
  background: transparent;
  color: var(--film-gray-500);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
  min-width: 0;
}

.mode-btn:hover {
  border-color: var(--heading-cyan);
  color: var(--heading-cyan);
}

.mode-btn.active {
  background: transparent;
  border-color: var(--heading-cyan);
  color: var(--heading-cyan);
}

/* ─── Device Info ─────────────────────────────────────────────────────────── */

.device-info {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--film-gray-500);
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--field-gray);
  line-height: 1.6;
}

.device-info .label {
  color: var(--heading-cyan);
}

.device-warning {
  color: var(--film-purple);
  font-weight: 500;
  margin-top: 0.4rem;
}

/* ─── Programme Info ──────────────────────────────────────────────────────── */

.programme-info {
  background: transparent;
  border: 1px solid var(--film-purple);
  padding: 1rem;
  margin-bottom: 1rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
}

.programme-name {
  color: var(--title-white);
  font-weight: 500;
  margin-bottom: 0.5rem;
  overflow-wrap: anywhere;
}

.programme-meta {
  color: var(--film-gray-500);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.programme-meta .value {
  color: var(--heading-cyan);
  overflow-wrap: anywhere;
}

/* ─── Object List ─────────────────────────────────────────────────────────── */

.object-list {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--field-gray) transparent;
}

.object-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--film-gray-800);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  transition: background 0.15s ease;
}

.object-item:hover {
  background: var(--film-gray-900);
}

.object-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.object-dot.bed {
  background: var(--heading-cyan);
}

.object-dot.object {
  background: var(--film-purple);
}

.object-name {
  flex: 1;
  color: var(--title-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.object-position {
  color: var(--film-gray-500);
  white-space: nowrap;
  font-size: 0.65rem;
}

.object-controls {
  display: flex;
  gap: 2px;
}

.obj-btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  font-weight: 500;
  padding: 1px 4px;
  border: 1px solid var(--field-gray);
  background: transparent;
  color: var(--film-gray-500);
  cursor: pointer;
  transition: all 0.2s ease;
}

.obj-btn:hover {
  border-color: var(--heading-cyan);
  color: var(--heading-cyan);
}

.obj-btn.solo-active {
  background: var(--heading-cyan);
  border-color: var(--heading-cyan);
  color: var(--background-black);
}

.obj-btn.mute-active {
  background: var(--film-purple);
  border-color: var(--film-purple);
  color: var(--title-white);
}

/* Per-object gain and LFE controls */
.object-gain-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.object-gain-slider,
.object-lfe-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 50px;
  height: 3px;
  background: var(--field-gray);
  outline: none;
  cursor: pointer;
}

.object-gain-slider::-webkit-slider-thumb,
.object-lfe-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 8px;
  height: 8px;
  background: var(--heading-cyan);
  border-radius: 0;
  cursor: pointer;
}

.object-lfe-slider::-webkit-slider-thumb {
  background: var(--film-purple);
}

.object-gain-value {
  font-size: 0.55rem;
  color: var(--film-gray-500);
  min-width: 24px;
  text-align: right;
}

/* ─── Speaker Canvas (Overhead View) ──────────────────────────────────────── */

.canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--field-gray);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.renderer-card {
  padding-bottom: 1rem;
}

.speaker-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.renderer-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.view-toggle-btn {
  width: 22px;
  height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.2s;
  opacity: 1;
}

.view-toggle-btn:hover {
  opacity: 0.7;
}

.view-toggle-btn.active-3d {
  opacity: 1;
}

.view-toggle-btn.active-3d:hover {
  opacity: 0.7;
}

.cube-icon {
  width: 16px;
  height: 16px;
  color: var(--film-purple);
  transition: color 0.2s;
}

.view-toggle-btn.active-3d .cube-icon {
  color: var(--heading-cyan);
}

.meter-mode-btn {
  width: 22px;
  height: 22px;
  background: transparent;
  border: 1px solid var(--field-gray);
  color: var(--film-purple);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.2s ease;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.33rem;
  text-transform: uppercase;
  letter-spacing: 0;
  flex: 0 0 22px;
  margin-left: auto;
}

.meter-mode-btn:hover {
  border-color: var(--heading-cyan);
  color: var(--heading-cyan);
}

.meter-mode-btn.active-rms {
  border-color: var(--heading-cyan);
  color: var(--heading-cyan);
}

/* ─── Transport Controls (media player style) ────────────────────────────── */

.transport-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  padding: 0.35rem 0 0.05rem;
  margin-bottom: 0;
}

.transport-bar > .control-icon:first-child {
  margin-left: -5px;
}

.transport-bar > .control-icon:last-child {
  margin-right: -5px;
}

.control-icon {
  width: 20px;
  height: 20px;
  background: transparent;
  border: none;
  color: #b40096;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
  position: relative;
  padding: 0;
}

.control-icon:hover {
  color: #fffedc;
  transform: scale(1.1);
}

.control-icon:active {
  transform: scale(0.95);
}

.control-icon:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* Play icon (triangle) */
.play-icon::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent currentColor;
}

.play-icon.playing::before {
  content: "";
  width: 8px;
  height: 10px;
  border-width: 0;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

/* Stop icon (square) */
.stop-icon::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  background: currentColor;
}

/* ext-preview icon (arrow out of box) */
.ext-preview-icon::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  border: 1.5px solid currentColor;
  position: relative;
}

.ext-preview-icon::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

/* Progress bar */
.progress-container {
  flex: 1;
  position: relative;
  min-height: 10px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.progress-bar {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  border-radius: 0;
}

.progress-fill {
  height: 100%;
  background: rgba(255, 254, 220, 0.6);
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
  z-index: 2;
}

.progress-handle {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #fffedc;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: grab;
  z-index: 3;
}

.progress-container:hover .progress-handle {
  opacity: 1;
}

/* Timecode display */
.timecode-display {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  font-family: "JetBrains Mono", monospace;
  padding: 0;
  margin: 0;
  white-space: nowrap;
}

/* ─── VU Meters ───────────────────────────────────────────────────────────── */

.faders-container {
  display: flex;
  gap: 0;
  align-items: flex-end;
  justify-content: space-between;
  overflow-x: auto;
  min-width: 0;
}

.fader-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  width: 22px;
  flex: 0 0 22px;
}

.fader-track {
  width: 4px;
  height: 80px;
  background: var(--field-gray);
  position: relative;
}

.fader-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: var(--heading-cyan);
  transition: height 0.05s ease-out;
}

.fader-fill.height-channel {
  background: var(--film-card-blue);
}

.fader-fill.stereo-bus {
  background: var(--film-purple);
}

.fader-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--film-gray-500);
  text-transform: uppercase;
  text-align: center;
}

.fader-readout {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.4rem;
  color: var(--title-white);
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  min-height: 9px;
  text-align: center;
  line-height: 1;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.channel-controls {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
  width: 22px;
}

.channel-btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55rem;
  font-weight: 500;
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border: 1px solid var(--field-gray);
  background: transparent;
  color: var(--film-gray-500);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.channel-btn:hover {
  border-color: var(--heading-cyan);
  color: var(--heading-cyan);
}

.channel-btn.solo-active {
  background: var(--heading-cyan);
  border-color: var(--heading-cyan);
  color: var(--background-black);
}

.channel-btn.mute-active {
  background: var(--film-purple);
  border-color: var(--film-purple);
  color: var(--title-white);
}

/* ─── Console (matching transcoder exactly) ──────────────────────────────── */

pre#consoleLog {
  background: #000;
  padding: 10px;
  overflow-x: hidden;
  max-height: 300px;
  overflow-y: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: var(--title-white);
  margin: 0;
  border: 1px solid var(--field-gray);
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-all;
}

pre#consoleLog::-webkit-scrollbar {
  width: 10px;
}

pre#consoleLog::-webkit-scrollbar-track {
  background: #000;
  border-left: 1px solid #333;
}

pre#consoleLog::-webkit-scrollbar-thumb {
  background: #b40096;
  border-radius: 0;
}

pre#consoleLog::-webkit-scrollbar-thumb:hover {
  background: #d400b0;
}

pre#consoleLog {
  scrollbar-width: thin;
  scrollbar-color: #b40096 #000;
}

/* ─── Form Inputs (transcoder pattern) ────────────────────────────────────── */

.source-input-pink {
  background: transparent;
  border: 1px solid var(--film-purple);
  color: var(--title-white);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  width: 100%;
  margin-bottom: 0.75rem;
}

.source-input-pink::placeholder {
  color: rgba(255, 254, 220, 0.5);
}

.source-select-pink {
  display: block;
  background: #000;
  border: 1px solid var(--film-purple);
  border-radius: 0;
  color: var(--title-white);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  width: 100%;
  margin-bottom: 0.75rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23b40096' viewBox='0 0 16 16'%3e%3cpath d='m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 10px;
  outline: none;
}

.source-select-pink:focus {
  border-color: var(--heading-cyan);
}

.source-select-pink option {
  background: #1a1a2e;
  color: var(--title-white);
}

/* ─── Checkbox (normalization) ────────────────────────────────────────────── */

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--film-gray-500);
  margin-top: 0.5rem;
}

.custom-checkbox {
  display: none;
}

.checkbox-custom {
  width: 14px;
  height: 14px;
  border: 1px solid var(--film-purple);
  background: transparent;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
}

.custom-checkbox:checked + .checkbox-custom {
  background: var(--film-purple);
}

.custom-checkbox:checked + .checkbox-custom::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%);
  background: var(--title-white);
}

.checkbox-text {
  color: var(--film-gray-500);
  transition: color 0.2s ease;
}

.checkbox-label:hover .checkbox-text {
  color: var(--title-white);
}

/* ─── Export Mode Toggle ──────────────────────────────────────────────────── */

.export-mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.export-info {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: var(--film-gray-500);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--field-gray);
  margin-bottom: 0.75rem;
  line-height: 1.6;
  word-break: break-word;
}

.export-info .filename {
  color: var(--heading-cyan);
}

.export-info .filename-list {
  display: grid;
  gap: 0.18rem;
}

.export-info .filename-entry {
  display: block;
}

.export-info .export-summary {
  margin-top: 0.4rem;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--heading-cyan);
  background: transparent;
  color: var(--heading-cyan);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
}

.btn:hover {
  border-color: var(--heading-cyan);
  background: transparent;
  color: var(--heading-cyan);
}

.btn:disabled {
  opacity: 1;
  border-color: var(--field-gray);
  background: transparent;
  color: var(--film-gray-500);
  cursor: not-allowed;
}

.btn:disabled:hover {
  border-color: var(--field-gray);
  background: transparent;
  color: var(--film-gray-500);
}

.btn-secondary {
  border-color: var(--field-gray);
  color: var(--film-gray-500);
}

.btn-secondary:hover {
  border-color: var(--heading-cyan);
  background: transparent;
  color: var(--heading-cyan);
}

/* ─── Parse / Separation Progress ─────────────────────────────────────────── */

.parse-progress,
.separation-progress {
  display: none;
}

.parse-progress-bar,
.separation-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--film-gray-800);
  border: 1px solid var(--field-gray);
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.parse-progress-fill,
.separation-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--heading-cyan), var(--film-purple));
  transition: width 0.3s ease;
}

.parse-progress-text,
.separation-progress-text {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: var(--film-gray-500);
  text-align: center;
}

/* ─── Spatial Effects Detail ──────────────────────────────────────────────── */

.preset-detail {
  margin-top: 0.6rem;
  border-top: 1px solid var(--field-gray);
  padding-top: 0.6rem;
}

.preset-detail-desc {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: var(--film-gray-500);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.preset-params {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}

.preset-param {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0.4rem;
  background: rgba(0, 185, 199, 0.04);
}

.preset-param-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55rem;
  color: var(--film-gray-500);
  text-transform: uppercase;
}

.preset-param-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.55rem;
  color: var(--heading-cyan);
  font-weight: 600;
}

/* ─── Patch Bay Matrix ────────────────────────────────────────────────────── */

.patch-matrix-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2px;
}

.patch-cells {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.patch-cell {
  width: 20px;
  height: 19px;
  border: 1px solid #333;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

/* Cross-highlight — row and column glow on hover */
.patch-matrix-row.patch-row-highlight .patch-cell {
  border-color: #555;
}

.patch-cell.patch-col-highlight {
  border-color: #555;
}

/* Floor speakers — orange stroke */
.patch-cell.patch-floor:hover  { border-color: var(--warning-orange); }
.patch-cell.patch-floor.active { border-color: var(--warning-orange); background: transparent; }

/* Height speakers — indigo stroke */
.patch-cell.patch-height:hover  { border-color: #2563eb; }
.patch-cell.patch-height.active { border-color: #2563eb; background: transparent; }

/* LFE — orange stroke */
.patch-cell.patch-lfe:hover  { border-color: var(--warning-orange); }
.patch-cell.patch-lfe.active { border-color: var(--warning-orange); background: transparent; }

/* Stem rows — cells use the stem's own colour for hover and active state */
.patch-stem-row .patch-cell:hover  { border-color: var(--stem-color, var(--warning-orange)) !important; }
.patch-stem-row .patch-cell.active { border-color: var(--stem-color, var(--warning-orange)) !important; background: transparent; }

/* Tooltip */
.patch-tooltip {
  position: absolute;
  pointer-events: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: #fffedc;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 10;
}

/* Stem-based patch bay rows */
.patch-stem-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.patch-stem-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.6rem;
  font-weight: 500;
  color: #fffedc;
  white-space: nowrap;
  width: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
}

.patch-stem-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Live Input ─────────────────────────────────────────────────────────── */
.live-input-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.live-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  align-items: center;
}

.live-capture-btn,
.monitor-btn,
.live-record-btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--field-gray);
  background: transparent;
  color: var(--film-gray-500);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.live-capture-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.monitor-btn:hover {
  border-color: #f59e0b;
  color: #f59e0b;
}

.live-record-btn:hover {
  border-color: var(--film-purple);
  color: var(--film-purple);
}
@keyframes capture-pulse {
  0%, 100% { border-color: #ef4444;              color: #ef4444; }
  50%       { border-color: rgba(239,68,68,0.2); color: rgba(239,68,68,0.2); }
}

.live-capture-btn.live-capture-active {
  border-color: #ef4444;
  color: #ef4444;
  animation: capture-pulse 2.4s ease-in-out infinite;
}

.monitor-btn.monitor-active {
  border-color: #f59e0b;
  color: #f59e0b;
}

.live-record-btn.live-record-active {
  border-color: var(--film-purple);
  color: var(--film-purple);
}
.live-signal-indicator {
  grid-column: 1 / -1;
  height: 4px;
  background: #00b9c7;
  opacity: 0.15;
  transform: scaleX(0.1);
  transform-origin: left center;
  transition: opacity 0.05s, transform 0.05s;
}


/* ─── Download Queue Modal ────────────────────────────────────────────────── */

.download-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-modal {
  background: var(--background-black);
  border: 1px solid var(--film-purple);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.download-modal h3 {
  font-family: "FilmProcessorFavorit", sans-serif;
  font-size: 1.2rem;
  color: var(--title-white);
  margin-bottom: 1rem;
}

.download-modal p {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--film-gray-500);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.download-modal .file-list {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.65rem;
  color: var(--heading-cyan);
  text-align: left;
  margin-bottom: 1.5rem;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.8;
}

/* ─── Status Messages ─────────────────────────────────────────────────────── */

.status-bar {
  display: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  color: var(--film-gray-500);
  padding: 0.4rem 0;
  text-align: center;
}

.status-bar.success {
  color: var(--dcp-success);
}

.status-bar.error {
  color: var(--film-purple);
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

/* Match header breakpoint: header uses 150px padding until 768px */
@media (max-width: 1200px) {
  .spatial-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 2rem 2rem 2rem;
  }


  .faders-container {
    justify-content: flex-start;
    gap: 0;
  }

  .ai-split-selector {
    flex-wrap: wrap;
  }

  .fader-channel {
    min-width: 2.5rem;
    flex-shrink: 0;
  }

  .fader-track {
    height: 60px;
  }

  .fader-label {
    font-size: 0.55rem;
  }

  .transport-bar {
    gap: 8px;
  }

  .progress-container {
    margin: 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 2rem 2rem 2rem;
  }

}
