:root {
  --fractal-bg-0: #05070f;
  --fractal-bg-1: #0d1224;
  --fractal-panel: rgba(8, 12, 26, 0.82);
  --fractal-panel-border: rgba(126, 196, 255, 0.22);
  --fractal-text: #f1f5ff;
  --fractal-muted: #a8b4d0;
  --fractal-accent: #47b0ff;
  --fractal-positive: #7dff9e;
  --fractal-error: #ff7b7b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--fractal-text);
  background:
    radial-gradient(1200px 700px at 12% 0%, rgba(60, 126, 212, 0.2), transparent 60%),
    radial-gradient(900px 680px at 88% 100%, rgba(57, 207, 192, 0.18), transparent 55%),
    linear-gradient(155deg, var(--fractal-bg-0), var(--fractal-bg-1));
  overflow: hidden;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(4, 8, 20, 0.65);
  border-bottom: 1px solid rgba(126, 196, 255, 0.2);
}

.navbar a {
  display: inline-block;
  padding: 10px 16px;
  color: var(--fractal-text);
  text-decoration: none;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.navbar a:hover {
  color: #ffffff;
  background: rgba(71, 176, 255, 0.2);
}

.carousel {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 44px;
}

.carousel-button {
  margin: 0 10px;
}

#container {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 44px);
  overflow: hidden;
}

#container canvas {
  border-radius: 16px;
  border: 1px solid rgba(126, 196, 255, 0.28);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(126, 196, 255, 0.08);
}

#overlayImage {
  z-index: 4;
}

#shaderTransitionOverlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  contain: layout paint;
  will-change: opacity;
}

.shader-transition-band {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -30%;
  width: 30%;
  opacity: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(123, 214, 255, 0.12) 22%, rgba(255, 255, 255, 0.42) 50%, rgba(137, 232, 255, 0.14) 72%, rgba(255, 255, 255, 0) 100%);
  will-change: transform, opacity;
}

#shaderTransitionOverlay.is-animating {
  opacity: 1;
}

#shaderTransitionOverlay.is-right .shader-transition-band {
  animation: shaderTransitionSweepRight 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

#shaderTransitionOverlay.is-left .shader-transition-band {
  animation: shaderTransitionSweepLeft 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

#uiLayer {
  position: absolute;
  inset: 0;
  z-index: 10;
  color: var(--fractal-text);
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, rgba(3, 5, 13, 0.28), rgba(3, 5, 13, 0.62));
}

body.waveform-modal-open #uiLayer {
  overflow-y: hidden;
}

.ui-inner {
  width: min(100%, 1100px);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 16px 16px 32px;
  display: grid;
  gap: 12px;
  overflow-x: clip;
}

.panel {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--fractal-panel);
  border: 1px solid var(--fractal-panel-border);
  overflow: hidden;
}

#title {
  margin: 0;
  text-align: center;
  font-size: 1.35rem;
}

.panel-title {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fractal-muted);
}

.control-section,
.shader-controls,
.waveform-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.control-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fractal-muted);
}

.control-label {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.audio-source-select {
  min-width: 230px;
}

.audio-visual-mode-select {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 100%;
  width: 100%;
}

.audio-visual-mode-native {
  display: none;
}

.audio-file-select {
  min-width: 240px;
}

.audio-library-select {
  min-width: 320px;
}

#audio_source_mode {
  min-width: 210px;
  border: 1px solid rgba(126, 196, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 12, 26, 0.95);
  color: var(--fractal-text);
  padding: 6px 8px;
}

.audio-visual-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 760px);
}

.audio-visual-mode-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 88px;
  padding: 16px 18px 15px;
  border-radius: 16px;
  border: 1px solid rgba(126, 196, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(14, 21, 39, 0.95), rgba(8, 12, 26, 0.98)),
    radial-gradient(circle at 18% 18%, rgba(71, 176, 255, 0.18), transparent 40%);
  color: var(--fractal-text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    filter 140ms ease;
}

.audio-visual-mode-option::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(71, 176, 255, 0.08), transparent 45%);
  opacity: 0.55;
  pointer-events: none;
}

.audio-visual-mode-option:hover {
  transform: translateY(-1px);
  border-color: rgba(126, 196, 255, 0.3);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(71, 176, 255, 0.12) inset;
}

.audio-visual-mode-option:active {
  transform: translateY(0);
}

.audio-visual-mode-option.is-active {
  border-color: rgba(71, 176, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(18, 31, 58, 0.98), rgba(8, 12, 26, 0.98)),
    radial-gradient(circle at 18% 18%, rgba(71, 176, 255, 0.3), transparent 42%);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(71, 176, 255, 0.22) inset,
    0 0 18px rgba(71, 176, 255, 0.16);
}

.audio-visual-mode-option:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 0 0 2px rgba(71, 176, 255, 0.3),
    0 16px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(71, 176, 255, 0.22) inset;
}

.audio-visual-mode-title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.audio-visual-mode-copy {
  font-size: 0.78rem;
  line-height: 1.3;
  color: var(--fractal-muted);
}

.tab-capture-status {
  font-size: 0.8rem;
  color: var(--fractal-muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  min-height: 1.15rem;
}

.tab-capture-status.status-ok {
  color: var(--fractal-positive);
}

.tab-capture-status.status-error {
  color: var(--fractal-error);
}

.tab-capture-status.status-neutral {
  color: var(--fractal-muted);
}

input[type="range"] {
  accent-color: var(--fractal-accent);
}

.smoothing-knob-control {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.smoothing-knob {
  --smoothing-angle: -135deg;
  --smoothing-fill: 5%;
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.smoothing-knob:active {
  cursor: grabbing;
}

.smoothing-knob-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(126, 196, 255, 0.22);
  background:
    repeating-conic-gradient(from -135deg, rgba(255, 255, 255, 0.14) 0 0.9deg, transparent 0.9deg 12deg),
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.18), transparent 30%),
    radial-gradient(circle at center, rgba(13, 20, 38, 0.92) 45%, rgba(8, 12, 26, 0.98) 46%),
    conic-gradient(
      from -135deg,
      rgba(71, 176, 255, 0.96) 0 var(--smoothing-fill),
      rgba(126, 196, 255, 0.14) var(--smoothing-fill) 270deg,
      rgba(8, 12, 26, 0.82) 270deg 360deg
    );
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.36),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 10px 18px rgba(255, 255, 255, 0.04),
    inset 0 -16px 22px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.smoothing-knob-face::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.08), rgba(8, 12, 26, 0.96) 70%);
  border: 1px solid rgba(126, 196, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.smoothing-knob-pointer {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(71, 176, 255, 0.88));
  box-shadow: 0 0 12px rgba(71, 176, 255, 0.38);
  transform-origin: center bottom;
  transform: translate(-50%, -100%) rotate(var(--smoothing-angle));
  z-index: 1;
}

.smoothing-knob-value {
  position: absolute;
  inset: auto 0 18px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fractal-text);
  text-shadow: 0 0 10px rgba(71, 176, 255, 0.28);
  z-index: 2;
}

.smoothing-knob > input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
  z-index: 3;
  touch-action: none;
}

.smoothing-knob > input[type="range"]:focus-visible + .smoothing-knob-face {
  box-shadow:
    0 0 0 2px rgba(71, 176, 255, 0.32),
    0 12px 24px rgba(0, 0, 0, 0.36),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 10px 18px rgba(255, 255, 255, 0.04),
    inset 0 -16px 22px rgba(0, 0, 0, 0.32);
}

#audio_file_input {
  border: 1px solid rgba(126, 196, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 12, 26, 0.95);
  color: var(--fractal-text);
  padding: 6px 8px;
  width: 100%;
  max-width: 320px;
}

#audio_library_select {
  min-width: 220px;
  border: 1px solid rgba(126, 196, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 12, 26, 0.95);
  color: var(--fractal-text);
  padding: 6px 8px;
}

.audio-library-status {
  width: 100%;
  font-size: 0.8rem;
  color: var(--fractal-muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  min-height: 1.15rem;
}

.audio-library-status.status-ok {
  color: var(--fractal-positive);
}

.audio-library-status.status-error {
  color: var(--fractal-error);
}

.audio-library-status.status-neutral {
  color: var(--fractal-muted);
}

#shaderPickerSearch {
  min-width: 260px;
  border: 1px solid rgba(126, 196, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 12, 26, 0.95);
  color: var(--fractal-text);
  padding: 6px 8px;
}

.hot-reload-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  color: var(--fractal-muted);
}

.shader-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.83rem;
}

.scene-name-live-panel[hidden] {
  display: none !important;
}

.scene-name-live-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 154, 84, 0.18);
  background:
    radial-gradient(circle at top left, rgba(255, 133, 71, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(17, 16, 24, 0.96), rgba(8, 10, 17, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 18px 38px rgba(0, 0, 0, 0.22);
}

.scene-name-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.scene-name-live-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #fff1e5;
}

.scene-name-live-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 160, 92, 0.14);
  color: #ffc894;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scene-name-live-field {
  display: grid;
  gap: 6px;
}

#sceneFloatingNameInput {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 182, 118, 0.24);
  border-radius: 10px;
  background: rgba(7, 9, 15, 0.94);
  color: #fff7f0;
  padding: 10px 12px;
  font: inherit;
  font-family: "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.03em;
  box-shadow: inset 0 0 22px rgba(255, 140, 84, 0.04);
}

#sceneFloatingNameInput:focus-visible {
  outline: none;
  border-color: rgba(255, 196, 133, 0.62);
  box-shadow:
    0 0 0 2px rgba(255, 173, 98, 0.12),
    0 0 0 4px rgba(255, 123, 69, 0.18),
    inset 0 0 22px rgba(255, 140, 84, 0.08);
}

.scene-name-live-hint {
  color: rgba(236, 221, 207, 0.72);
  font-size: 0.77rem;
  line-height: 1.45;
}

.shader-browser-panel {
  gap: 12px;
  min-width: 0;
}

.shader-browser-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.shader-browser-copy {
  display: grid;
  gap: 4px;
}

.shader-picker-filter-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(126, 196, 255, 0.18);
  background: rgba(9, 13, 28, 0.92);
}

.shader-picker-filter-pill {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(176, 198, 226, 0.78);
  padding: 6px 10px;
  font-size: 0.74rem;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.shader-picker-filter-pill:hover {
  color: #f4fbff;
}

.shader-picker-filter-pill:focus-visible {
  outline: 2px solid rgba(126, 196, 255, 0.78);
  outline-offset: 2px;
}

.shader-picker-filter-pill.is-active {
  background: linear-gradient(180deg, rgba(105, 212, 255, 0.24), rgba(60, 132, 255, 0.18));
  color: #f4fbff;
  box-shadow: inset 0 0 0 1px rgba(132, 222, 255, 0.28);
}

.shader-picker-search-group {
  margin-left: auto;
}

.shader-picker-count {
  font-size: 0.8rem;
  color: var(--fractal-muted);
  font-family: "Cascadia Mono", Consolas, monospace;
}

.shader-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 10px;
  min-width: 0;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  align-items: start;
}

.shader-picker-button,
.shader-picker-empty {
  border-radius: 12px;
  border: 1px solid rgba(126, 196, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(12, 18, 36, 0.98) 0%, rgba(6, 10, 22, 0.98) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.shader-picker-button {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 12px;
  color: var(--fractal-text);
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  grid-auto-rows: max-content;
  gap: 8px;
  align-content: start;
  align-items: start;
  justify-items: stretch;
  text-align: left;
  white-space: normal;
  overflow: hidden;
  isolation: isolate;
  appearance: none;
  -webkit-appearance: none;
  background-clip: padding-box;
  font: inherit;
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.shader-picker-button > * {
  min-width: 0;
}

.shader-picker-button:hover {
  transform: translateY(-1px);
  border-color: rgba(126, 196, 255, 0.38);
  box-shadow:
    inset 0 0 0 1px rgba(149, 213, 255, 0.06),
    0 14px 28px rgba(0, 0, 0, 0.28);
}

.shader-picker-button:focus-visible {
  outline: 2px solid rgba(126, 196, 255, 0.78);
  outline-offset: 2px;
}

.shader-picker-button.is-active {
  border-color: rgba(126, 196, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(20, 40, 72, 0.96) 0%, rgba(8, 14, 30, 0.98) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(149, 213, 255, 0.16),
    0 18px 36px rgba(0, 0, 0, 0.3);
}

.shader-picker-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.shader-picker-title {
  display: -webkit-box;
  min-width: 0;
  max-width: 100%;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.4;
  color: #ffffff;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.shader-picker-index {
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(170, 227, 255, 0.2);
  background: rgba(71, 176, 255, 0.12);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #dff5ff;
  text-align: center;
  white-space: nowrap;
  justify-self: end;
  align-self: start;
}

.shader-picker-subtitle {
  display: -webkit-box;
  min-width: 0;
  max-width: 100%;
  color: var(--fractal-muted);
  font-size: 0.78rem;
  line-height: 1.5;
  font-family: "Cascadia Mono", Consolas, monospace;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.shader-picker-empty {
  padding: 16px;
  color: var(--fractal-muted);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
}

#shaderHud {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  display: grid;
  gap: 8px;
  min-width: 220px;
  max-width: min(420px, calc(100vw - 28px));
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(150, 214, 255, 0.42);
  background:
    linear-gradient(180deg, rgba(10, 18, 40, 0.95) 0%, rgba(4, 9, 23, 0.98) 100%);
  box-shadow:
    0 22px 40px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(0, 0, 0, 0.45),
    inset 0 0 0 1px rgba(187, 231, 255, 0.08);
  backdrop-filter: blur(18px) saturate(125%);
  pointer-events: none;
}

.shader-hud-position {
  justify-self: start;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(170, 227, 255, 0.24);
  background: rgba(120, 198, 255, 0.16);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: #f3fbff;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.8),
    0 0 10px rgba(116, 194, 255, 0.18);
}

.shader-hud-name {
  color: #ffffff;
  font-size: 1.04rem;
  font-weight: 800;
  line-height: 1.4;
  word-break: break-word;
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.98),
    0 0 2px rgba(0, 0, 0, 0.92);
}

#shaderReloadStatus.status-error {
  color: var(--fractal-error);
}

#shaderReloadStatus.status-ok {
  color: var(--fractal-positive);
}

.waveform-section {
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.waveform-viewport-shell {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.waveform-viewport-shell.is-waveform-expanded .waveform-canvas-host {
  display: none;
}

.waveform-viewport-shell.is-waveform-expanded .waveform-hint {
  opacity: 0;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
}

.waveform-fullscreen-overlay.is-waveform-active {
  align-content: stretch;
}

.waveform-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.8rem;
}

.waveform-header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
  min-width: 0;
}

#waveformTrackName {
  color: #d3def5;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#waveformTime {
  color: #89e8ff;
  min-width: 0;
}

.waveform-mode-switcher[hidden] {
  display: none !important;
}

.waveform-mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(128, 146, 170, 0.14);
  background: rgba(8, 12, 19, 0.9);
}

.waveform-mode-pill {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(184, 194, 210, 0.8);
  padding: 6px 11px;
  font-size: 0.72rem;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  transition:
    background 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease;
}

.waveform-mode-pill.is-active {
  background: rgba(96, 214, 255, 0.14);
  color: #edf7ff;
  box-shadow: inset 0 0 0 1px rgba(118, 220, 255, 0.22);
}

.waveform-mode-pill:disabled {
  opacity: 0.38;
  cursor: default;
}

.waveform-expand-btn {
  appearance: none;
  border: 1px solid rgba(124, 146, 170, 0.18);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(8, 13, 20, 0.9);
  color: #d6e2f2;
  font: inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    transform 120ms ease,
    background 120ms ease;
}

.waveform-expand-btn:hover {
  border-color: rgba(144, 170, 198, 0.26);
  background: rgba(10, 16, 24, 0.96);
  transform: translateY(-1px);
}

.waveform-expand-btn:focus-visible {
  outline: none;
  border-color: rgba(120, 216, 255, 0.46);
  box-shadow:
    0 0 0 2px rgba(5, 9, 20, 0.95),
    0 0 0 4px rgba(108, 205, 255, 0.16);
}

.waveform-canvas-host {
  position: relative;
  width: 100%;
  min-height: 136px;
  min-width: 0;
  overflow: hidden;
  contain: layout paint;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(12, 16, 24, 0.96), rgba(4, 8, 13, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(122, 140, 164, 0.12),
    inset 0 12px 36px rgba(20, 28, 40, 0.22);
  transition: min-height 180ms ease;
}

#waveformCanvas {
  width: 100%;
  max-width: 100%;
  height: 136px;
  min-width: 0;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(118, 138, 162, 0.14);
  background:
    linear-gradient(180deg, rgba(8, 12, 18, 0.98), rgba(3, 6, 10, 0.99));
  cursor: pointer;
  overscroll-behavior: contain;
  user-select: none;
  transition:
    height 180ms ease,
    border-radius 180ms ease,
    border-color 180ms ease;
}

.waveform-viewport-shell.is-waveform-dj #waveformCanvas {
  border-color: rgba(178, 132, 92, 0.18);
  background:
    linear-gradient(180deg, rgba(9, 11, 15, 0.99), rgba(4, 6, 8, 0.99));
}

.waveform-viewport-shell.is-waveform-dj .waveform-diagnostic-panel {
  padding: 4px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.waveform-viewport-shell.is-waveform-dj .waveform-poi-pill {
  border-color: rgba(176, 138, 102, 0.16);
  background: rgba(12, 14, 18, 0.84);
}

.waveform-fullscreen-overlay[hidden] {
  display: none !important;
}

.waveform-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: stretch;
  padding: 56px 28px 28px;
  background:
    radial-gradient(960px 520px at 18% 16%, rgba(78, 118, 158, 0.12), transparent 60%),
    radial-gradient(820px 520px at 84% 86%, rgba(56, 88, 118, 0.08), transparent 58%),
    rgba(2, 4, 10, 0.94);
  overscroll-behavior: contain;
}

.waveform-fullscreen-shell {
  width: min(100%, 1600px);
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  contain: layout paint size;
}

.waveform-fullscreen-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(116, 136, 162, 0.16);
  background: rgba(6, 10, 16, 0.78);
}

.waveform-fullscreen-copy {
  display: grid;
  gap: 8px;
}

.waveform-fullscreen-title {
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fractal-muted);
}

.waveform-fullscreen-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
}

#waveformFullscreenTrackName {
  color: #d3def5;
}

#waveformFullscreenTime {
  color: #89e8ff;
}

.waveform-fullscreen-hint {
  color: var(--fractal-muted);
  font-size: 0.8rem;
  line-height: 1.45;
  max-width: 980px;
}

.waveform-fullscreen-canvas-host {
  width: 100%;
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: stretch;
  overflow: hidden;
  contain: layout paint size;
}

#waveformFullscreenCanvas {
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: none;
  align-self: stretch;
  justify-self: stretch;
  height: 100%;
  box-sizing: border-box;
  border-radius: 18px;
  border: 1px solid rgba(116, 136, 162, 0.16);
  background:
    linear-gradient(180deg, rgba(8, 12, 18, 0.99), rgba(3, 6, 10, 0.99));
  display: block;
}

.waveform-fullscreen-overlay.is-waveform-dj {
  background:
    radial-gradient(980px 540px at 18% 12%, rgba(128, 88, 60, 0.14), transparent 62%),
    radial-gradient(900px 560px at 82% 88%, rgba(74, 116, 124, 0.1), transparent 58%),
    rgba(2, 4, 10, 0.92);
}

.waveform-fullscreen-overlay.is-waveform-dj .waveform-fullscreen-toolbar {
  border-color: rgba(172, 132, 96, 0.16);
  background: rgba(10, 12, 16, 0.84);
}

.waveform-fullscreen-overlay.is-waveform-dj #waveformFullscreenCanvas {
  border-color: rgba(170, 132, 96, 0.18);
  background:
    linear-gradient(180deg, rgba(8, 9, 11, 0.99), rgba(3, 5, 7, 0.99));
}

.waveform-close-btn {
  flex: 0 0 auto;
}

.waveform-diagnostic-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.waveform-poi-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.waveform-poi-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(118, 138, 162, 0.14);
  background: rgba(8, 13, 20, 0.72);
  color: #c8d5e8;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.waveform-poi-pill::before {
  content: "";
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.waveform-poi-pill.is-transient {
  color: rgb(114, 231, 255);
}

.waveform-poi-pill.is-low {
  color: rgb(84, 189, 255);
}

.waveform-poi-pill.is-mid {
  color: rgb(255, 194, 96);
}

.waveform-poi-pill.is-high {
  color: rgb(255, 126, 164);
}

.waveform-poi-pill.is-inactive {
  opacity: 0.34;
  filter: saturate(0.25);
}

.waveform-poi-stats {
  flex: 1 1 280px;
  min-width: 240px;
  color: #a9bbd5;
  text-align: right;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.waveform-hint {
  text-align: right;
  font-size: 0.75rem;
  color: var(--fractal-muted);
}

.input-gain-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d3def5;
  font-size: 0.86rem;
}

#audio_loudness_damp_id {
  width: 220px;
}

#inputGainValue {
  min-width: 52px;
  text-align: right;
  color: #89e8ff;
  font-family: "Cascadia Mono", Consolas, monospace;
}

#normalizeInputBtn[disabled] {
  opacity: 0.55;
}

#fft_group {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.fft-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fft-label {
  color: #d3def5;
  font-size: 0.84rem;
}

.fft-node-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d3def5;
  font-size: 0.75rem;
}

.fft-node-label {
  color: rgba(211, 222, 245, 0.9);
  white-space: nowrap;
}

#fftNodeNameInput {
  min-width: 116px;
  border: 1px solid rgba(126, 196, 255, 0.28);
  border-radius: 8px;
  background: rgba(8, 12, 26, 0.95);
  color: var(--fractal-text);
  padding: 6px 8px;
  font-size: 0.75rem;
}

.fft-mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(126, 196, 255, 0.18);
  background: rgba(9, 13, 28, 0.92);
}

.fft-mode-pill {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(176, 198, 226, 0.78);
  padding: 6px 10px;
  font-size: 0.74rem;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  transition:
    background 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.fft-mode-pill.is-active {
  background: linear-gradient(180deg, rgba(105, 212, 255, 0.24), rgba(60, 132, 255, 0.18));
  color: #f4fbff;
  box-shadow: inset 0 0 0 1px rgba(132, 222, 255, 0.28);
}

#fftSelectionDebug {
  color: #89e8ff;
  font-size: 0.75rem;
  font-family: "Cascadia Mono", Consolas, monospace;
}

#fftInlineClearBtn::part(base) {
  min-height: 24px;
  padding-inline: 10px;
  font-size: 0.72rem;
}

.fft-node-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(112, 194, 255, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(52, 94, 164, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(14, 20, 40, 0.94) 0%, rgba(8, 11, 22, 0.98) 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
}

.fft-node-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.fft-node-header-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.fft-node-panel-title {
  color: #f4fbff;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.fft-active-node-summary {
  color: rgba(137, 232, 255, 0.88);
  font-size: 0.74rem;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.fft-node-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fft-node-inspector {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(280px, 1.4fr);
  gap: 12px;
  align-items: stretch;
}

.fft-node-name-field {
  min-width: 0;
}

.fft-node-name-field input {
  flex: 1 1 auto;
  min-width: 0;
}

.fft-route-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(6, 11, 22, 0.9);
  border: 1px solid rgba(126, 196, 255, 0.16);
}

.fft-route-pill {
  min-width: 54px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(176, 198, 226, 0.78);
  padding: 8px 12px;
  font-size: 0.72rem;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  transition:
    background 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}

.fft-route-pill.is-active {
  background: linear-gradient(180deg, rgba(100, 214, 255, 0.22), rgba(42, 122, 235, 0.18));
  color: #f5fbff;
  box-shadow: inset 0 0 0 1px rgba(126, 196, 255, 0.28);
}

.fft-node-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.fft-node-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(126, 196, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(10, 16, 30, 0.96), rgba(7, 10, 20, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.fft-node-stat-label {
  color: rgba(180, 198, 226, 0.74);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fft-node-stat-value {
  color: #f5fbff;
  font-size: 0.9rem;
  font-family: "Cascadia Mono", Consolas, monospace;
  line-height: 1.1;
}

.fft-node-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.fft-node-tabs::-webkit-scrollbar {
  height: 6px;
}

.fft-node-tabs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(126, 196, 255, 0.22);
}

.fft-node-tab {
  --fft-node-accent-line: rgba(120, 214, 255, 0.92);
  --fft-node-accent-fill: rgba(74, 176, 255, 0.14);
  --fft-node-live: 0;
  min-width: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(126, 196, 255, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(circle at top left, var(--fft-node-accent-fill), transparent 52%),
    linear-gradient(180deg, rgba(14, 19, 36, 0.98), rgba(8, 11, 22, 0.98));
  color: #d3def5;
  cursor: pointer;
  flex: 0 0 auto;
  text-align: left;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.015),
    0 10px 18px rgba(4, 8, 18, 0.24);
}

.fft-node-tab.is-active {
  border-color: rgba(132, 222, 255, 0.3);
  background:
    radial-gradient(circle at top left, var(--fft-node-accent-fill), transparent 50%),
    linear-gradient(180deg, rgba(30, 47, 76, 0.96), rgba(12, 22, 42, 0.98));
  box-shadow:
    0 0 0 1px rgba(132, 222, 255, 0.08),
    0 16px 30px rgba(20, 52, 84, 0.26);
}

.fft-node-tab-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fft-node-tab-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--fft-node-accent-line);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.05),
    0 0 14px rgba(126, 196, 255, 0.22);
}

.fft-node-tab-live {
  margin-left: auto;
  min-width: 38px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(4, 9, 18, 0.65);
  color: rgba(245, 251, 255, 0.88);
  font-size: 0.63rem;
  line-height: 1.2;
  font-family: "Cascadia Mono", Consolas, monospace;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(126, 196, 255, 0.12);
}

.fft-node-tab-name {
  color: #f6fbff;
  font-size: 0.78rem;
  line-height: 1.1;
}

.fft-node-tab-meta {
  color: rgba(137, 232, 255, 0.78);
  font-size: 0.68rem;
  font-family: "Cascadia Mono", Consolas, monospace;
  line-height: 1.2;
}

.fft-node-field {
  width: 100%;
}

.fft-node-field input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
}

.fft-node-slider {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.fft-node-value {
  min-width: 44px;
  text-align: right;
  color: #89e8ff;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.fft-node-advanced {
  border: 1px solid rgba(126, 196, 255, 0.12);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.94), rgba(7, 10, 20, 0.98));
  padding: 10px 12px;
}

.fft-node-advanced summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  color: rgba(180, 198, 226, 0.86);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fft-node-advanced summary::-webkit-details-marker {
  display: none;
}

.fft-node-dynamics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 12px;
  padding: 0;
}

.fft-node-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fft-node-shortcut {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(126, 196, 255, 0.12);
  background: rgba(6, 11, 22, 0.72);
  color: rgba(180, 198, 226, 0.78);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fft-node-hint {
  color: rgba(137, 232, 255, 0.78);
  font-size: 0.73rem;
  line-height: 1.4;
}

.fft-node-slider-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(126, 196, 255, 0.18);
  background: rgba(7, 14, 28, 0.82);
  color: rgba(198, 234, 255, 0.86);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fft-node-slider .fft-node-value {
  display: none;
}

#bars {
  width: 100%;
  height: 154px;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(112, 194, 255, 0.34);
  background: linear-gradient(180deg, rgba(13, 22, 42, 0.96) 0%, rgba(6, 10, 22, 0.98) 100%);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.18);
}

#bars.is-dynamic-eq {
  border-color: rgba(126, 196, 255, 0.24);
  background: linear-gradient(180deg, rgba(11, 18, 36, 0.98) 0%, rgba(6, 9, 20, 0.98) 100%);
}

#bars::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 22%, rgba(0, 0, 0, 0.16));
  pointer-events: none;
  z-index: 0;
}

#fftBarsCanvas,
#fftOverlayCanvas,
#fftNodeGraph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#fftBarsCanvas {
  z-index: 1;
}

#fftOverlayCanvas {
  z-index: 2;
}

#fftNodeGraph {
  opacity: 0;
  z-index: 3;
  overflow: visible;
}

.fft-eq-grid-line {
  stroke: rgba(157, 188, 235, 0.1);
  stroke-width: 1;
  stroke-dasharray: 2 7;
}

.fft-eq-grid-label {
  fill: rgba(180, 198, 226, 0.5);
  font-size: 10px;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.fft-eq-gain-guide {
  stroke: rgba(150, 178, 226, 0.08);
  stroke-width: 1;
}

.fft-eq-gain-guide.is-neutral {
  stroke: rgba(208, 228, 255, 0.18);
  stroke-dasharray: 0;
}

.fft-eq-gain-label {
  fill: rgba(180, 198, 226, 0.46);
  font-size: 9px;
  font-family: "Cascadia Mono", Consolas, monospace;
  text-anchor: end;
}

.fft-eq-band-fill {
  fill-opacity: 0.2;
}

.fft-eq-band-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fft-eq-band-target {
  fill: none;
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 5 5;
}

.fft-eq-band-target.is-active {
  stroke-width: 1.35;
}

.fft-eq-master-path {
  fill: none;
  stroke: rgba(240, 248, 255, 0.88);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fft-eq-focus-line {
  stroke: rgba(242, 248, 255, 0.18);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

.fft-eq-node-halo {
  fill: none;
  stroke-width: 10;
  opacity: 0.16;
}

.fft-eq-node-ring {
  fill: none;
  stroke-width: 1.5;
  opacity: 0.82;
}

.fft-eq-node-stem {
  stroke-width: 1.15;
  stroke-dasharray: 3 5;
  opacity: 0.32;
}

.fft-eq-node-stem.is-active {
  stroke-width: 1.35;
  opacity: 0.5;
}

.fft-eq-handle {
  fill: rgba(16, 25, 45, 0.96);
  stroke-width: 1.8;
}

.fft-eq-handle.is-active {
  fill: rgba(241, 248, 255, 0.96);
}

.fft-eq-node-label {
  pointer-events: none;
}

.fft-eq-node-label-bg {
  fill: rgba(6, 11, 22, 0.84);
  stroke: rgba(126, 196, 255, 0.14);
  stroke-width: 1;
}

.fft-eq-node-label-bg.is-active {
  fill: rgba(14, 26, 48, 0.96);
  stroke: rgba(202, 235, 255, 0.34);
}

.fft-eq-node-label-text {
  fill: #f5fbff;
  font-size: 10px;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.fft-eq-node-label-subtext {
  fill: rgba(137, 232, 255, 0.8);
  font-size: 9px;
  font-family: "Cascadia Mono", Consolas, monospace;
}

.code-section h2 {
  margin: 0;
  text-align: center;
  font-size: 1rem;
}

.code-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

#generated_code {
  margin: 0;
  width: 100%;
  max-width: 980px;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border-radius: 10px;
  white-space: pre-wrap;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #a9b7c6;
  background: rgba(8, 13, 24, 0.97);
  border: 1px solid rgba(143, 181, 255, 0.28);
}

#generated_code:focus {
  outline: 1px solid rgba(137, 232, 255, 0.62);
}

#parameters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#graph {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: flex-end;
}

.low {
  width: 33.3%;
  height: 0;
  background-color: red;
  transition: height 0.1s ease-out;
}

@keyframes shaderTransitionSweepRight {
  0% {
    opacity: 0;
    transform: translate3d(-115%, 0, 0) skewX(-12deg);
  }

  18% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: translate3d(420%, 0, 0) skewX(-12deg);
  }
}

@keyframes shaderTransitionSweepLeft {
  0% {
    opacity: 0;
    transform: translate3d(420%, 0, 0) skewX(12deg);
  }

  18% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: translate3d(-115%, 0, 0) skewX(12deg);
  }
}

#mid {
  background-color: green;
}

#high {
  background-color: blue;
}

@media (max-width: 860px) {
  .ui-inner {
    padding: 12px 10px 22px;
  }

  .control-section,
  .shader-controls,
  .waveform-controls {
    align-items: flex-start;
  }

  #audio_loudness_damp_id {
    width: 170px;
  }

  .smoothing-knob {
    width: 84px;
    height: 84px;
  }

  .smoothing-knob-face::after {
    inset: 15px;
  }

  .smoothing-knob-pointer {
    height: 30px;
  }

  #waveformCanvas {
    height: 124px;
  }

  .waveform-canvas-host {
    min-height: 124px;
  }

  .waveform-diagnostic-panel {
    align-items: flex-start;
  }

  .waveform-poi-stats {
    min-width: 0;
    text-align: left;
  }

  #audio_source_mode {
    min-width: 170px;
  }

  .audio-visual-mode-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .audio-visual-mode-option {
    min-height: 76px;
  }

  #audio_file_input {
    max-width: 100%;
  }

  .waveform-fullscreen-overlay {
    padding: 52px 16px 16px;
  }

  .waveform-fullscreen-toolbar {
    padding: 14px;
    flex-direction: column;
  }

  #waveformFullscreenCanvas {
    min-height: 0;
  }

  #shaderPickerSearch {
    min-width: 0;
    width: 100%;
  }

  .fft-node-toolbar,
  .fft-header-actions {
    align-items: stretch;
  }

  .fft-mode-switcher,
  .fft-node-field,
  .fft-node-header-copy {
    width: 100%;
  }

  .fft-mode-pill,
  #fftNodeNameInput {
    width: 100%;
  }

  .fft-node-inspector,
  .fft-node-stats,
  .fft-node-dynamics {
    grid-template-columns: 1fr;
  }

  .fft-route-switcher,
  .fft-node-actions,
  .fft-node-tabs {
    width: 100%;
  }

  .fft-node-tab {
    min-width: 118px;
  }

  #bars {
    height: 102px;
  }

  .shader-status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .shader-browser-header,
  .shader-picker-search-group {
    width: 100%;
  }

  .shader-picker-filter-bar {
    width: 100%;
  }

  .shader-picker-search-group {
    margin-left: 0;
  }

  .shader-picker-list {
    grid-template-columns: 1fr;
    max-height: 300px;
  }

  .shader-picker-item-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .shader-picker-index {
    justify-self: start;
  }

  #shaderHud {
    right: 12px;
    bottom: 12px;
    left: 12px;
    min-width: 0;
    max-width: none;
  }
}
