/* ==========================================================================
   AETHERMASTER GLOBAL STYLES & VARIABLE DEFINITIONS
   ========================================================================== */

:root {
  --bg-color: #080a10;
  --panel-bg: rgba(15, 20, 32, 0.65);
  --panel-border: rgba(255, 255, 255, 0.06);
  --panel-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  /* Neon Accents */
  --accent-cyan: #00f2fe;
  --accent-cyan-glow: rgba(0, 242, 254, 0.4);
  --accent-purple: #9d4edd;
  --accent-purple-glow: rgba(157, 78, 221, 0.4);
  --accent-green: #06d6a0;
  --accent-green-glow: rgba(6, 214, 160, 0.4);
  --accent-red: #ff0055;
  --accent-red-glow: rgba(255, 0, 85, 0.5);
  --accent-orange: #f77f00;
  --accent-orange-glow: rgba(247, 127, 0, 0.4);
  
  --font-ui: 'Outfit', sans-serif;
  --font-tech: 'JetBrains Mono', monospace;
  
  --transition-speed: 0.25s;
}

body {
  overflow-x: hidden;
  max-width: 100%;
}

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

body {
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(157, 78, 221, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.08) 0%, transparent 40%),
    linear-gradient(180deg, #05060a 0%, #0c0e18 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-ui);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  padding: 20px;
}

/* APP CONTAINER */
.app-container {
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-anchor: none;
}

/* HEADER */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--panel-shadow);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-icon {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px var(--accent-cyan-glow));
}

.logo-text h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #fff 30%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text .subtitle {
  font-size: 0.7rem;
  font-family: var(--font-tech);
  color: var(--text-secondary);
  letter-spacing: 2px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-tech);
  font-size: 0.75rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-secondary);
}

.status-indicator.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 2s infinite;
}

.status-indicator.processing {
  background-color: var(--accent-purple);
  box-shadow: 0 0 10px var(--accent-purple);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* DASHBOARD GRID */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.full-width {
  grid-column: span 3;
}

.span-2 {
  grid-column: span 2;
}

/* Header Wrapper on Desktop/Tablet (Sticky only when track is loaded) */
.app-sticky-header-wrapper {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: stretch;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-anchor: none;
}

body.has-track .app-sticky-header-wrapper {
  position: sticky;
  top: 15px;
  z-index: 1000;
}

/* Visualizer Panel (non-sticky on desktop, inherits sticky from wrapper) */
.visualizer-panel {
  flex: 1.6;
  min-width: 0;
  background: rgba(10, 14, 26, 0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 242, 254, 0.2) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-panel, .player-panel {
  flex: 1;
  min-width: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-panel .drop-zone {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 160px;
}

.upload-panel .track-info, .player-panel .track-info {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

/* PANELS (GLASSMORPHISM) */
.panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--panel-shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: border var(--transition-speed) ease;
}

.panel:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title i {
  color: var(--accent-cyan);
}

/* UPLOAD PANEL & PLAYER */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.15);
  transition: all var(--transition-speed) ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.03);
  box-shadow: inset 0 0 15px rgba(0, 242, 254, 0.05);
}

.upload-icon {
  font-size: 2.2rem;
  color: var(--text-secondary);
  transition: color var(--transition-speed);
}

.drop-zone:hover .upload-icon {
  color: var(--accent-cyan);
}


.browse-btn {
  color: var(--accent-cyan);
  text-decoration: underline;
  font-weight: 600;
}

.upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hidden-input {
  display: none;
}

/* ACTIVE TRACK PLAYBACK CONTROL */
.track-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 12px 20px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.track-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.track-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.track-meta {
  font-family: var(--font-tech);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.player-controls {
  display: none;
  align-items: center;
  gap: 12px;
}

body.has-track .player-controls {
  display: flex;
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.9rem;
  transition: all var(--transition-speed);
}

.ctrl-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.ctrl-btn:active:not(:disabled) {
  transform: translateY(0);
}

.ctrl-btn.play-btn {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border: none;
  width: 48px;
  height: 48px;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.ctrl-btn.play-btn:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.45);
}

.ctrl-btn.toggle-btn.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  box-shadow: 0 0 10px var(--accent-purple-glow);
}

.ctrl-btn.bypass-btn {
  width: auto;
  border-radius: 20px;
  padding: 0 20px;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.ctrl-btn.bypass-btn.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-orange-glow);
}

.ctrl-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
}

/* VISUALIZER PANELS */
.visualizer-tabs {
  display: flex;
  gap: 5px;
  background: rgba(0, 0, 0, 0.2);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
}

.visualizer-content {
  position: relative;
  height: 220px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  overflow: hidden;
}

.visualizer-container {
  width: 100%;
  height: 100%;
  position: relative;
}

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

.freq-labels {
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  font-family: var(--font-tech);
  font-size: 0.65rem;
  color: var(--text-muted);
  pointer-events: none;
}

.waveform-legend {
  position: absolute;
  top: 10px;
  right: 15px;
  display: flex;
  gap: 15px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-item.dry .legend-color {
  background-color: var(--text-muted);
}

.legend-item.wet .legend-color {
  background-color: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan-glow);
}

.hidden {
  display: none !important;
}

/* HARDWARE METERS */
.meters-container {
  display: flex;
  justify-content: space-around;
  height: 190px;
  padding: 10px 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.meter-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 25%;
}

.meter-track {
  width: 16px;
  height: 140px;
  background: #040608;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  gap: 2px;
  padding: 1px;
}

.meter-fill {
  flex: 1;
  background: linear-gradient(0deg, var(--accent-green) 0%, var(--accent-orange) 75%, var(--accent-red) 95%);
  height: 100%;
  transform: scaleY(0);
  transform-origin: bottom;
  align-self: flex-end;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(6, 214, 160, 0.2);
}

.gr-meter .meter-track {
  width: 12px;
  background: #0d0600;
}

.gr-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent-orange) 0%, var(--accent-red) 100%);
  height: 100%;
  transform: scaleY(0);
  transform-origin: top;
  align-self: flex-start;
  box-shadow: 0 0 6px rgba(247, 127, 0, 0.3);
}

.meter-label {
  font-family: var(--font-tech);
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.correlation-panel {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.corr-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 700;
}

.corr-track {
  height: 6px;
  background: #040608;
  border-radius: 3px;
  position: relative;
}

.corr-pointer {
  width: 6px;
  height: 12px;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  border-radius: 3px;
  position: absolute;
  top: -3px;
  left: 50%; /* -1(0%) to +1(100%), default 50% */
  transform: translateX(-50%);
  transition: left 0.1s ease-out;
}

.corr-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-tech);
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-top: 5px;
  padding: 0 2px;
}

/* GENERAL CONTROL SLIDERS & LABELS */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

/* SELECT CONTAINER */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--text-secondary);
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.8rem;
}

select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 15px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all var(--transition-speed);
}

select:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
}

select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

select option {
  background-color: #0c0e18;
  color: #fff;
}

/* SLIDER ROWS */
.control-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-row .control-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.control-row input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  outline: none;
  margin: 10px 0;
}

.control-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  cursor: pointer;
  transition: transform 0.1s, background-color 0.1s;
}

.control-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #fff;
}

.value-readout {
  align-self: flex-end;
  font-family: var(--font-tech);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* SPECIFIC CONTROL ROW SPLITS */
.input-output-gains {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 5px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* SWITCH ON/OFF SLIDER */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 20px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--accent-cyan);
}

input:checked + .slider-round:before {
  transform: translateX(16px);
}

/* EQ BANDS styling */
.eq-band {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.eq-band-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.band-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.eq-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.eq-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.eq-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
  cursor: pointer;
}

.freq-input-group {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 2px 6px;
  width: 72px;
}

.freq-input-group input[type="number"] {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-tech);
  font-size: 0.72rem;
  text-align: right;
  outline: none;
}

/* Remove spin buttons */
.freq-input-group input::-webkit-outer-spin-button,
.freq-input-group input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.freq-input-group .unit {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-left: 2px;
  font-weight: 700;
}

/* COMPRESSOR VERTICAL SLIDERS */
.flex-sliders {
  display: flex;
  justify-content: space-around;
  gap: 20px;
  margin-top: 5px;
  padding: 10px 0;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.slider-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 45%;
}

.slider-col .control-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.slider-col input[type="range"].vertical {
  -webkit-appearance: none;
  writing-mode: vertical-lr;
  direction: rtl; /* bottom to top */
  width: 6px;
  height: 80px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  outline: none;
}

.slider-col input[type="range"].vertical::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-purple);
  box-shadow: 0 0 6px var(--accent-purple);
  cursor: pointer;
}

.slider-col .value-readout {
  align-self: center;
  font-size: 0.72rem;
  color: var(--accent-purple);
}

/* STEREO WIDTH VISUALIZER */
.width-visualizer {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 70px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  margin-top: 5px;
  position: relative;
  overflow: hidden;
}

.width-arc {
  width: 120px;
  height: 60px;
  border-radius: 60px 60px 0 0;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  position: absolute;
  bottom: 0;
  display: flex;
  justify-content: center;
}

.width-beam {
  position: absolute;
  bottom: 0;
  width: 2px;
  height: 48px;
  background: linear-gradient(to top, transparent, var(--accent-cyan));
  transform-origin: bottom center;
  opacity: 0.3;
}

.width-beam.left {
  transform: rotate(-30deg); /* dynamic */
}

.width-beam.right {
  transform: rotate(30deg); /* dynamic */
}

.width-center-node {
  width: 6px;
  height: 6px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
  position: absolute;
  bottom: 0;
}

/* BRICKWALL LIMITER READOUTS */
.limiter-meter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 10px 15px;
  margin-top: 5px;
}

.limiter-light {
  font-family: var(--font-tech);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 1px;
  transition: all 0.1s ease;
}

.limiter-light.active {
  color: #fff;
  background: var(--accent-red);
  box-shadow: 0 0 10px var(--accent-red-glow);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

.limiter-warning {
  font-family: var(--font-tech);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-red);
  animation: flashRed 0.5s infinite;
}

@keyframes flashRed {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

/* EXPORT / PROGRESS BAR */
.export-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.action-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
  border: none;
  border-radius: 12px;
  padding: 18px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all var(--transition-speed);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.25);
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 242, 254, 0.4);
  filter: brightness(1.1);
}

.action-btn:active:not(:disabled) {
  transform: translateY(0);
}

.action-btn:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.progress-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-tech);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.progress-track {
  height: 8px;
  background: #040608;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
  height: 100%;
  width: 0%; /* Dynamic */
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 8px var(--accent-cyan);
  transition: width 0.1s ease;
}

/* FOOTER */
.app-footer {
  text-align: center;
  padding: 15px;
  font-size: 0.7rem;
  font-family: var(--font-tech);
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  margin-top: 20px;
}

.footer-links {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.75rem;
  font-family: var(--font-ui);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-speed);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-links a:hover {
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.35);
}

.footer-links .separator {
  color: var(--text-muted);
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .full-width, .span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .full-width, .span-2 {
    grid-column: span 1;
  }
  body {
    padding: 10px;
  }
  .panel {
    padding: 14px 12px;
    border-radius: 12px;
  }
  
  /* Header Adjustments */
  .app-header {
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
    padding: 15px 10px;
  }
  .logo-area {
    flex-direction: column;
    gap: 8px;
  }
  .logo-text {
    text-align: center;
  }
  
  /* Track Info Stack */
  .track-info {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    text-align: center;
    padding: 15px;
  }
  .track-name {
    max-width: 100%;
    text-align: center;
  }
  .track-meta {
    text-align: center;
  }
  .player-controls {
    justify-content: center;
  }
  
  /* Mobile Sticky Wrapper (Non-display:contents for iOS WebKit compatibility) */
  .app-sticky-header-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  body.has-track .app-sticky-header-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  body.has-track .player-panel {
    display: none !important;
  }

  .upload-panel, .player-panel {
    border-radius: 16px !important;
    padding: 20px;
    border: 1px solid var(--panel-border) !important;
  }

  .visualizer-panel {
    position: static;
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    margin: -10px -10px 12px -10px !important;
    padding: 12px 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .visualizer-content {
    height: 115px;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
  }
  
  /* Monitor Collapsed Mode */
  .visualizer-panel.collapsed {
    padding-bottom: 8px;
    border-radius: 0 !important;
  }
  .visualizer-panel.collapsed .visualizer-content {
    height: 0;
    opacity: 0;
    margin: 0;
    border: none;
    pointer-events: none;
  }
  .visualizer-panel.collapsed .monitor-toggle-btn i {
    transform: rotate(180deg);
  }
  
  /* Monitor Toggle Button styling */
  .monitor-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--accent-cyan);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .monitor-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  
  /* Compressor Vertical Sliders to Horizontal */
  .flex-sliders {
    flex-direction: column !important;
    gap: 15px !important;
    padding: 12px !important;
  }
  .slider-col {
    width: 100% !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
  }
  .slider-col .control-label {
    min-width: 70px !important;
    text-align: left !important;
  }
  .slider-col input[type="range"].vertical {
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
    width: 100% !important;
    height: 6px !important;
    margin: 5px 0 !important;
  }
  .slider-col input[type="range"].vertical::-webkit-slider-thumb {
    width: 16px !important;
    height: 16px !important;
  }
  .slider-col .value-readout {
    min-width: 60px !important;
    text-align: right !important;
  }
  
  /* Export Panel Clean Column Stacking */
  .export-panel {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 15px !important;
  }
  .export-actions {
    width: 100% !important;
  }

  /* Shorten visualizer tab texts on mobile to make room for larger buttons */
  .visualizer-tabs .tab-btn {
    font-size: 0 !important;
    padding: 6px 10px !important;
  }
  .visualizer-tabs .tab-btn[data-target="spectrum"]::after {
    content: 'SPECTRUM';
    font-size: 0.65rem !important;
    letter-spacing: 0.5px;
  }
  .visualizer-tabs .tab-btn[data-target="waveform"]::after {
    content: 'WAVEFORM';
    font-size: 0.65rem !important;
    letter-spacing: 0.5px;
  }

  /* Compact Player Controls in Sticky Header - Enlarged for touch accessibility (v3.20.4) */
  .player-controls {
    gap: 7px !important;
    justify-content: flex-end;
  }
  .ctrl-btn {
    width: 37px !important;
    height: 37px !important;
    font-size: 0.75rem !important;
  }
  .ctrl-btn.play-btn {
    width: 37px !important;
    height: 37px !important;
    font-size: 0.8rem !important;
    box-shadow: 0 2px 8px rgba(0, 242, 254, 0.3) !important;
  }
  .ctrl-btn i {
    font-size: 0.78rem !important;
  }
  .ctrl-btn.bypass-btn {
    padding: 0 10px !important;
    border-radius: 10px !important;
  }
  .ctrl-btn.bypass-btn span {
    display: none !important;
  }
  .ctrl-btn.bypass-btn::after {
    content: 'BYP' !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
  }
}

/* PREMIUM GLASSMORPHISM TOOLTIPS */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translate(-50%, 6px) scale(0.92);
  width: 220px;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: #e2e8f0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 999;
}

@media (min-width: 769px) {
  [data-tooltip]:hover::after {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translate(-50%, 6px);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(0, 242, 254, 0.35) transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 999;
}

@media (min-width: 769px) {
  [data-tooltip]:hover::before {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Question Mark Help Icon Wrapper */
.help-icon {
  margin-left: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: help;
  transition: color var(--transition-speed), transform var(--transition-speed), filter var(--transition-speed);
  vertical-align: middle;
  display: inline-block;
  outline: none; /* remove default focus outline on focusable span */
}

.help-icon i {
  color: inherit;
  pointer-events: none; /* Let parent span handle mouse hover and tooltips */
}

/* Limit hover transformations to desktops to avoid mobile layout shifting */
@media (min-width: 769px) {
  .help-icon:hover {
    color: var(--accent-cyan);
    transform: scale(1.15);
    filter: drop-shadow(0 0 4px var(--accent-cyan-glow));
  }
}

/* MOBILE HELP BOTTOM SHEET */
.mobile-help-sheet {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-help-sheet.active {
  opacity: 1;
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 10, 0.65);
  backdrop-filter: blur(5px);
}

.sheet-content {
  position: relative;
  width: 100%;
  max-height: 55%;
  background: rgba(15, 20, 32, 0.96);
  backdrop-filter: blur(25px);
  border-top: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.6);
  padding: 20px 20px calc(45px + env(safe-area-inset-bottom)) 20px; /* extra bottom padding for mobile safe area & browser toolbars */
  display: flex;
  flex-direction: column;
  gap: 15px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94);
  z-index: 2;
}

.mobile-help-sheet.active .sheet-content {
  transform: translateY(0);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.sheet-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
}

.sheet-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.sheet-close:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.sheet-body {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-primary);
  overflow-y: auto;
  padding-top: 5px;
}

/* AUDIO SPICES CABINET */
.spice-cabinet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 10px;
  width: 100%;
}

.spice-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-speed) ease;
}

.spice-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 242, 254, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.spice-card:has(input:checked) {
  background: rgba(0, 242, 254, 0.03);
  border-color: rgba(0, 242, 254, 0.3);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
}

.spice-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  flex: 1;
}

.spice-title {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spice-sub {
  font-family: var(--font-tech);
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 2px;
}

/* STICKY COLLAPSED STATES (v3.25) */
@media (min-width: 769px) {
  .app-sticky-header-wrapper.is-sticky {
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  }

  .app-sticky-header-wrapper.is-sticky .panel {
    background: rgba(10, 14, 26, 0.97) !important;
    border-color: rgba(0, 242, 254, 0.15) !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
  }

  /* Player Panel Collapsed */
  .app-sticky-header-wrapper.is-sticky .player-panel {
    padding: 8px 16px;
    border-radius: 10px;
  }

  .app-sticky-header-wrapper.is-sticky .track-info {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    height: 100%;
    padding: 0;
  }

  .app-sticky-header-wrapper.is-sticky .track-details {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
    text-align: left;
  }

  .app-sticky-header-wrapper.is-sticky .track-name {
    font-size: 0.78rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0;
  }

  .app-sticky-header-wrapper.is-sticky .track-meta {
    font-size: 0.65rem;
    margin: 0;
  }

  .app-sticky-header-wrapper.is-sticky .player-controls {
    margin-top: 2px;
    justify-content: center;
    width: 100%;
  }

  /* Visualizer Panel Collapsed */
  .app-sticky-header-wrapper.is-sticky .visualizer-panel {
    padding: 8px 16px;
    border-radius: 10px;
  }

  .app-sticky-header-wrapper.is-sticky .visualizer-panel .panel-header {
    padding-bottom: 6px;
    gap: 4px;
  }

  .app-sticky-header-wrapper.is-sticky .visualizer-header-top {
    display: none !important; /* Hide visualizer title to save vertical height */
  }

  .app-sticky-header-wrapper.is-sticky .visualizer-header-bottom {
    margin-top: 0;
  }

  .app-sticky-header-wrapper.is-sticky .visualizer-content {
    height: 65px; /* Shrunk height */
  }
}

/* Quick Upload Button & Mobile Sticky Track Name Styles */
.upload-btn {
  background: rgba(0, 242, 254, 0.08) !important;
  border-color: rgba(0, 242, 254, 0.2) !important;
}

.upload-btn:hover {
  background: rgba(0, 242, 254, 0.18) !important;
  border-color: rgba(0, 242, 254, 0.4) !important;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.mobile-controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mobile-sticky-track-name {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  margin-top: 2px;
  display: none;
}

body.has-track .mobile-sticky-track-name {
  display: block;
}

@media (min-width: 769px) {
  .mobile-controls-container {
    display: none !important;
  }
}

/* Header Navigation Buttons */
.header-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-left: auto;
  margin-right: 20px;
}

.nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  text-decoration: none !important;
  font-family: var(--font-tech);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: all var(--transition-speed) ease;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.nav-link-btn i {
  font-size: 0.85rem;
  transition: transform var(--transition-speed) ease;
}

.nav-link-btn:hover {
  color: #fff;
  background: rgba(0, 242, 254, 0.05);
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
  text-shadow: 0 0 5px rgba(0, 242, 254, 0.5);
}

.nav-link-btn:hover i {
  transform: scale(1.1);
}

.nav-link-btn.portal-btn:hover {
  border-color: rgba(255, 0, 127, 0.4);
  background: rgba(255, 0, 127, 0.05);
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.15);
  color: #ff007f;
  text-shadow: 0 0 5px rgba(255, 0, 127, 0.5);
}

.nav-link-btn.player-btn:hover {
  border-color: rgba(0, 242, 254, 0.4);
  background: rgba(0, 242, 254, 0.05);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
}

/* Mobile responsive navigation */
@media (max-width: 768px) {
  .header-nav {
    justify-content: center;
    width: 100%;
    margin: 5px 0;
  }
  .nav-link-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
  }
}



