:root {
  color-scheme: dark;
  --bg: #050607;
  --panel: #0a0c0d;
  --panel-raised: #0e1112;
  --line: rgba(223, 255, 250, 0.09);
  --line-strong: rgba(223, 255, 250, 0.17);
  --text: #e9efee;
  --muted: #727b7b;
  --faint: #474e4e;
  --signal: #8ff7eb;
  --signal-bright: #dffffa;
  --signal-dim: rgba(143, 247, 235, 0.12);
  --warning: #ffb75d;
  --danger: #ff5d61;
  --radius: 8px;
  --mono: "SFMono-Regular", "Roboto Mono", "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(91, 195, 184, 0.08), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
label,
select,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
label:has(input:focus-visible) {
  outline: 1px solid var(--signal);
  outline-offset: 2px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.app-shell {
  min-height: 100dvh;
}

.topbar {
  position: relative;
  z-index: 5;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 10, 0.94);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.brand {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 35px;
  height: 35px;
  color: var(--signal);
}

.brand-mark circle {
  fill: currentColor;
  stroke: none;
}

.brand-mark path {
  opacity: 0.55;
}

.brand span {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.15em;
}

.brand small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.025em;
}

.topbar-centre {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
}

.pulse-dot,
.live-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 12px rgba(143, 247, 235, 0.7);
}

.pulse-dot {
  animation: pulse 2.1s ease-in-out infinite;
}

.topbar-separator {
  width: 1px;
  height: 13px;
  background: var(--line-strong);
}

.local-badge {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 29px;
  padding: 0 10px;
  border: 1px solid rgba(143, 247, 235, 0.14);
  border-radius: 99px;
  color: #9fd4cd;
  background: rgba(143, 247, 235, 0.045);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.11em;
}

.local-badge svg {
  width: 14px;
  height: 14px;
}

.lab-grid {
  height: calc(100dvh - 64px);
  display: grid;
  grid-template-columns: 270px minmax(420px, 1fr) 330px;
  overflow: hidden;
}

.panel {
  min-width: 0;
  overflow: auto;
  background: rgba(9, 11, 12, 0.94);
  scrollbar-color: #2b3333 transparent;
  scrollbar-width: thin;
}

.source-panel {
  border-right: 1px solid var(--line);
}

.control-panel {
  border-left: 1px solid var(--line);
}

.panel-section {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 16px;
}

.section-heading.compact-heading {
  margin-bottom: 12px;
}

.section-number {
  color: var(--signal);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 19px;
  letter-spacing: 0.08em;
}

.section-heading h2,
.control-header h2 {
  margin: 0;
  color: #dfe6e5;
  font-size: 13px;
  font-weight: 590;
  letter-spacing: 0.015em;
}

.section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.file-card {
  position: relative;
  min-height: 58px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  padding: 9px 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.file-card:hover,
.file-card.dragging {
  border-color: rgba(143, 247, 235, 0.34);
  background: rgba(143, 247, 235, 0.055);
  transform: translateY(-1px);
}

.file-card-primary {
  border-color: rgba(143, 247, 235, 0.18);
  background: linear-gradient(110deg, rgba(143, 247, 235, 0.065), rgba(255, 255, 255, 0.014));
}

.file-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(143, 247, 235, 0.14);
  border-radius: 6px;
  color: var(--signal);
  background: rgba(143, 247, 235, 0.055);
}

.file-icon.depth-icon {
  color: #ad9aff;
  border-color: rgba(173, 154, 255, 0.14);
  background: rgba(173, 154, 255, 0.055);
}

.file-icon svg {
  width: 17px;
  height: 17px;
}

.file-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.file-copy strong,
.file-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy strong {
  color: #d8dfde;
  font-size: 10.5px;
  font-weight: 560;
}

.file-copy small {
  color: var(--muted);
  font-size: 8.5px;
}

.file-action {
  color: var(--faint);
  font-size: 18px;
  font-weight: 200;
  text-align: center;
}

.depth-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 0 0;
}

.depth-state > div {
  display: grid;
  gap: 3px;
}

.mini-label,
.eyebrow {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
}

.depth-state strong {
  color: #a4aca9;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.mini-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.mini-toggle input,
.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mini-toggle span {
  position: relative;
  width: 25px;
  height: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #080a0b;
  transition: 150ms ease;
}

.mini-toggle span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5a6262;
  transition: 150ms ease;
}

.mini-toggle input:checked + span {
  border-color: rgba(143, 247, 235, 0.36);
  background: rgba(143, 247, 235, 0.1);
}

.mini-toggle input:checked + span::after {
  left: 13px;
  background: var(--signal);
}

.preset-list {
  display: grid;
  gap: 6px;
}

.preset-card {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: 150ms ease;
}

.preset-card:hover {
  background: rgba(255, 255, 255, 0.025);
}

.preset-card.active {
  border-color: rgba(143, 247, 235, 0.13);
  background: rgba(143, 247, 235, 0.045);
}

.preset-card > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.preset-card strong {
  color: #cbd2d1;
  font-size: 9.5px;
  font-weight: 560;
}

.preset-card small {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-visual {
  position: relative;
  width: 54px;
  height: 37px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  background: #050708;
}

.preset-visual::before,
.preset-visual::after,
.preset-visual i {
  content: "";
  position: absolute;
  display: block;
}

.preset-visual::before {
  inset: 0;
  opacity: 0.42;
  background-image:
    linear-gradient(31deg, transparent 45%, currentColor 46%, transparent 48%),
    linear-gradient(145deg, transparent 49%, currentColor 50%, transparent 52%);
  background-size: 16px 13px;
}

.preset-visual::after {
  top: 7px;
  left: 20px;
  width: 15px;
  height: 24px;
  border: 1px solid currentColor;
  border-radius: 48% 48% 42% 42%;
  filter: drop-shadow(0 0 5px currentColor);
  opacity: 0.7;
}

.preset-visual i {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 7px 5px currentColor, -8px 11px currentColor, 12px 18px currentColor, -13px 22px currentColor;
}

.preset-visual i:nth-child(1) { top: 5px; left: 9px; }
.preset-visual i:nth-child(2) { top: 12px; left: 30px; }
.preset-visual i:nth-child(3) { top: 27px; left: 21px; }
.preset-apparition { color: #74f6e7; }
.preset-bloom { color: #e86cce; filter: saturate(1.15); }
.preset-wire { color: #d5dcdd; }
.preset-ember { color: #ff8c4c; }
.preset-bloom::after { border-width: 5px; filter: blur(4px); opacity: 0.8; }
.preset-wire::after { border-radius: 0; transform: skew(-8deg); }
.preset-ember::before { background-size: 11px 17px; }

.performance-section {
  padding-block: 14px;
  background: rgba(0, 0, 0, 0.13);
}

.performance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 23px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.performance-row span {
  color: var(--faint);
}

.performance-row strong {
  color: #98a3a2;
  font-size: 8px;
  font-weight: 500;
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 43px minmax(260px, 1fr) 58px 31px;
  background: #030405;
}

.stage-toolbar,
.transport,
.status-strip {
  border-bottom: 1px solid var(--line);
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: #080a0b;
}

.stage-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.stage-title strong {
  color: #aab2b1;
  font-weight: 520;
}

.stage-title > span:last-child {
  padding-left: 8px;
  border-left: 1px solid var(--line-strong);
}

.stage-actions {
  display: flex;
  gap: 5px;
}

.icon-button {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
}

.icon-button svg {
  width: 15px;
  height: 15px;
}

.stage-wrap {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    #030405;
  background-size: 38px 38px;
}

.stage-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 48%, rgba(121, 231, 218, 0.045), transparent 52%);
}

.canvas-checker {
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.canvas-checker.transparent {
  background-color: #16191a;
  background-image:
    linear-gradient(45deg, #202526 25%, transparent 25%),
    linear-gradient(-45deg, #202526 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #202526 75%),
    linear-gradient(-45deg, transparent 75%, #202526 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

#signalCanvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
}

.stage-corners {
  position: absolute;
  inset: 11px;
  z-index: 2;
  pointer-events: none;
}

.stage-corners i {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: rgba(167, 216, 210, 0.25);
  border-style: solid;
}

.stage-corners i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }
.stage-corners i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }
.stage-corners i:nth-child(3) { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.stage-corners i:nth-child(4) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }

.empty-state {
  position: relative;
  z-index: 3;
  width: min(540px, calc(100% - 44px));
  display: grid;
  justify-items: center;
  padding: 38px 30px;
  text-align: center;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.empty-state.hidden {
  opacity: 0;
  transform: translateY(8px);
}

.empty-kicker {
  margin-bottom: 18px;
  color: var(--signal);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.22em;
}

.empty-state h1 {
  margin: 0;
  color: #eef5f4;
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 350;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.empty-state p {
  max-width: 450px;
  margin: 16px 0 21px;
  color: #778181;
  font-size: 11px;
  line-height: 1.65;
}

.primary-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid rgba(143, 247, 235, 0.28);
  border-radius: 5px;
  color: #dffbf7;
  background: rgba(143, 247, 235, 0.09);
  font-size: 10px;
  cursor: pointer;
  pointer-events: auto;
  transition: 160ms ease;
}

.primary-button:hover {
  border-color: rgba(143, 247, 235, 0.48);
  background: rgba(143, 247, 235, 0.14);
  transform: translateY(-1px);
}

.primary-button svg {
  width: 15px;
  height: 15px;
}

.depth-legend {
  position: absolute;
  z-index: 4;
  right: 22px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(199, 211, 209, 0.45);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
  opacity: 0;
  transition: opacity 180ms ease;
}

.stage-wrap.has-video .depth-legend {
  opacity: 1;
}

.depth-legend i {
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #6257be, #67e8f9, #e2fff9);
}

.recording-badge,
.drop-message {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  font-family: var(--mono);
  letter-spacing: 0.13em;
}

.recording-badge {
  top: 23px;
  left: 23px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 4px;
  color: #ffd8d9;
  background: rgba(85, 8, 13, 0.76);
  font-size: 7px;
  opacity: 0;
  transform: translateY(-4px);
  transition: 160ms ease;
}

.recording-badge.visible {
  opacity: 1;
  transform: translateY(0);
}

.recording-badge i,
.record-button i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 7px rgba(255, 93, 97, 0.6);
}

.drop-message {
  inset: 20px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(143, 247, 235, 0.55);
  color: var(--signal-bright);
  background: rgba(4, 13, 14, 0.85);
  font-size: 11px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.stage-wrap.dragging .drop-message {
  opacity: 1;
}

.transport {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  background: #090b0c;
}

.play-button {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(143, 247, 235, 0.18);
  border-radius: 50%;
  color: var(--signal-bright);
  background: rgba(143, 247, 235, 0.06);
  cursor: pointer;
}

.play-button:hover:not(:disabled) {
  background: rgba(143, 247, 235, 0.12);
}

.play-button:disabled,
.transport-button:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.play-button svg {
  width: 14px;
  height: 14px;
}

.play-button .pause-icon,
.play-button.playing .play-icon {
  display: none;
}

.play-button.playing .pause-icon {
  display: block;
}

.timecode {
  flex: 0 0 auto;
  color: #a7b0af;
  font-family: var(--mono);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.timecode.muted {
  color: var(--faint);
}

.timeline {
  --timeline-progress: 0%;
  min-width: 60px;
  flex: 1;
  height: 16px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.timeline::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(90deg, var(--signal) var(--timeline-progress), #252b2b var(--timeline-progress));
}

.timeline::-moz-range-track {
  height: 2px;
  background: #252b2b;
}

.timeline::-moz-range-progress {
  height: 2px;
  background: var(--signal);
}

.timeline::-webkit-slider-thumb {
  width: 8px;
  height: 8px;
  margin-top: -3px;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--signal-bright);
  box-shadow: 0 0 0 3px rgba(143, 247, 235, 0.1);
}

.timeline::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--signal-bright);
}

.transport-divider {
  width: 1px;
  height: 20px;
  flex: 0 0 auto;
  background: var(--line);
}

.transport-button {
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #8b9594;
  background: rgba(255, 255, 255, 0.018);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.transport-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: #d5dddc;
  background: rgba(255, 255, 255, 0.035);
}

.transport-button svg {
  width: 13px;
  height: 13px;
}

.record-button.recording {
  border-color: rgba(255, 93, 97, 0.26);
  color: #ffd4d5;
  background: rgba(255, 93, 97, 0.08);
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  color: var(--faint);
  background: #07090a;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.045em;
}

.status-strip > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-strip strong {
  color: #788180;
  font-weight: 450;
}

.status-ok {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #62bf91;
  box-shadow: 0 0 7px rgba(98, 191, 145, 0.48);
}

.control-header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 69px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 13, 0.96);
  backdrop-filter: blur(16px);
}

.control-header > div {
  display: grid;
  gap: 5px;
}

.control-header h2 {
  font-size: 15px;
  font-weight: 430;
}

.text-button {
  padding: 6px;
  border: 0;
  color: var(--faint);
  background: transparent;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.13em;
  cursor: pointer;
}

.text-button:hover {
  color: var(--signal);
}

.control-section {
  padding: 17px 18px 18px;
  border-bottom: 1px solid var(--line);
}

.control-section.compact-section {
  padding-block: 11px;
}

.control-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.control-title span {
  color: #b7c0bf;
  font-size: 10px;
  font-weight: 560;
}

.control-title small {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #07090a;
}

.segmented-control button {
  height: 27px;
  padding: 0 4px;
  border: 0;
  border-radius: 4px;
  color: #606968;
  background: transparent;
  font-family: var(--mono);
  font-size: 7.5px;
  cursor: pointer;
}

.segmented-control button:hover {
  color: #a8b1b0;
}

.segmented-control button.active {
  color: #d9fbf7;
  background: rgba(143, 247, 235, 0.1);
  box-shadow: inset 0 0 0 1px rgba(143, 247, 235, 0.1);
}

.select-row {
  display: grid;
  gap: 9px;
  margin-top: 13px;
}

.select-row.two-columns {
  grid-template-columns: 1fr 1fr;
}

.select-row label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.select-row label > span {
  color: var(--muted);
  font-size: 8px;
}

.select-row select {
  width: 100%;
  height: 31px;
  padding: 0 26px 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #9ba5a3;
  background: #080a0b;
  font-family: var(--mono);
  font-size: 8px;
  cursor: pointer;
}

.range-control {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.range-control:first-of-type {
  margin-top: 0;
}

.range-control > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.range-control b,
.seed-control b,
.switch-control b {
  color: #858f8e;
  font-size: 8.5px;
  font-weight: 500;
}

.range-control output {
  color: #9ca6a4;
  font-family: var(--mono);
  font-size: 7.5px;
  font-variant-numeric: tabular-nums;
}

.range-control input[type="range"] {
  --range-progress: 50%;
  width: 100%;
  height: 12px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.range-control input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--signal) var(--range-progress), #252b2b var(--range-progress));
}

.range-control input[type="range"]::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: #252b2b;
}

.range-control input[type="range"]::-moz-range-progress {
  height: 2px;
  border-radius: 2px;
  background: var(--signal);
}

.range-control input[type="range"]::-webkit-slider-thumb {
  width: 8px;
  height: 8px;
  margin-top: -3px;
  appearance: none;
  border: 1px solid #c6fff8;
  border-radius: 50%;
  background: #182322;
  box-shadow: 0 0 0 2px rgba(143, 247, 235, 0.08);
}

.range-control input[type="range"]::-moz-range-thumb {
  width: 7px;
  height: 7px;
  border: 1px solid #c6fff8;
  border-radius: 50%;
  background: #182322;
}

.seed-control,
.switch-control {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.seed-control > span,
.switch-control > span {
  display: grid;
  gap: 3px;
}

.seed-control small,
.switch-control small {
  color: var(--faint);
  font-size: 7.5px;
}

.seed-control input {
  width: 86px;
  height: 29px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #aeb7b6;
  background: #07090a;
  font-family: var(--mono);
  font-size: 8px;
  text-align: right;
}

.switch-control {
  position: relative;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.switch-control i {
  position: relative;
  width: 30px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #07090a;
  transition: 150ms ease;
}

.switch-control i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #505857;
  transition: 150ms ease;
}

.switch-control input:checked + i {
  border-color: rgba(143, 247, 235, 0.35);
  background: rgba(143, 247, 235, 0.1);
}

.switch-control input:checked + i::after {
  left: 16px;
  background: var(--signal);
}

.media-source {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toast-region {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 340px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #bdc6c5;
  background: rgba(14, 17, 18, 0.96);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4);
  font-size: 9px;
  line-height: 1.5;
  animation: toast-in 180ms ease both;
}

.toast.error {
  border-color: rgba(255, 93, 97, 0.28);
  color: #ffd3d4;
}

@keyframes pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

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

@media (max-width: 1260px) {
  .lab-grid {
    grid-template-columns: 238px minmax(390px, 1fr) 304px;
  }

  .panel-section {
    padding-inline: 16px;
  }

  .control-section,
  .control-header {
    padding-inline: 15px;
  }

  .status-note {
    display: none !important;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .lab-grid {
    height: auto;
    min-height: calc(100dvh - 64px);
    grid-template-columns: 230px minmax(0, 1fr);
    overflow: visible;
  }

  .source-panel {
    max-height: calc(100dvh - 64px);
  }

  .workspace {
    min-height: calc(100dvh - 64px);
  }

  .control-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: visible;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .control-header {
    position: static;
    grid-column: 1 / -1;
  }

  .control-section {
    border-right: 1px solid var(--line);
  }
}

@media (max-width: 700px) {
  .topbar {
    grid-template-columns: 1fr auto;
    height: 58px;
    padding-inline: 13px;
  }

  .topbar-centre {
    display: none;
  }

  .brand small,
  .local-badge span {
    display: none;
  }

  .lab-grid {
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .source-panel {
    max-height: none;
    overflow: visible;
    border-right: 0;
  }

  .preset-list {
    grid-template-columns: 1fr 1fr;
  }

  .performance-section {
    display: none;
  }

  .workspace {
    min-height: 620px;
    grid-template-rows: 43px minmax(360px, 1fr) 58px 31px;
  }

  .empty-state {
    padding-inline: 12px;
  }

  .transport {
    gap: 7px;
    padding-inline: 9px;
  }

  .transport-button span,
  .transport-divider,
  .durationTime {
    display: none;
  }

  .control-panel {
    display: block;
  }

  .control-section {
    border-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

