/* ==========================================================================
   Apple Pro Audio Design System - Slowed + Reverb Studio
   Aesthetic: Refined Apple Dark Mode, SF Pro typography, frosted glass, zero emoji
   ========================================================================== */

:root {
  --bg-black: #000000;
  --bg-deep: #0a0a0c;
  --bg-card: rgba(22, 22, 26, 0.72);
  --bg-card-hover: rgba(30, 30, 36, 0.85);
  --bg-surface: rgba(255, 255, 255, 0.04);
  --bg-surface-active: rgba(255, 255, 255, 0.12);

  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --border-focus: rgba(10, 132, 255, 0.6);

  --text-primary: #ffffff;
  --text-secondary: rgba(235, 235, 245, 0.62);
  --text-tertiary: rgba(235, 235, 245, 0.38);

  --apple-blue: #0a84ff;
  --apple-blue-glow: rgba(10, 132, 255, 0.25);
  --apple-green: #30d158;
  --apple-green-glow: rgba(48, 209, 88, 0.25);
  --apple-red: #ff453a;

  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-pill: 9999px;

  --transition-smooth: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 16px 36px -10px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.08);
  --shadow-button: 0 4px 14px rgba(0, 0, 0, 0.35);
}

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

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-black);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Lighting */
.app-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.16;
}

.glow-top {
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 750px;
  height: 450px;
  background: radial-gradient(circle, #5e5ce6 0%, #0a84ff 50%, transparent 80%);
}

.glow-bottom {
  bottom: -250px;
  right: -100px;
  width: 600px;
  height: 500px;
  background: radial-gradient(circle, #bf5af2 0%, #30d158 60%, transparent 80%);
}

/* App Shell Layout */
.app-shell {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(18, 18, 22, 0.6);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Status Capsule */
.status-capsule {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-hairline);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--apple-green);
  box-shadow: 0 0 8px var(--apple-green-glow);
  transition: var(--transition-smooth);
}

.status-capsule.processing .status-dot {
  background-color: var(--apple-blue);
  box-shadow: 0 0 8px var(--apple-blue-glow);
  animation: pulseDot 1.4s infinite ease-in-out;
}

.status-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Apple Cards */
.apple-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  box-shadow: var(--shadow-card);
  padding: 22px;
  transition: border-color 0.2s ease;
}

.apple-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Card Header & Section Title */
.card-header {
  margin-bottom: 18px;
}

.card-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-hairline);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.section-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.param-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 4px;
}

.param-link-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.param-link-btn.active {
  background: rgba(10, 132, 255, 0.18);
  border-color: rgba(10, 132, 255, 0.4);
  color: var(--apple-blue);
}

.pro-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #af52de, #5856d6);
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 2px;
}

/* Apple Segmented Control */
.segmented-control {
  display: flex;
  background: rgba(118, 118, 128, 0.18);
  padding: 3px;
  border-radius: var(--radius-pill);
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.segment-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.segment-tab:hover {
  color: var(--text-primary);
}

.segment-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-weight: 600;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Drop Zone */
.drop-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--apple-blue);
  background: rgba(10, 132, 255, 0.04);
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.drop-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.drop-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.drop-hint {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 420px;
}

/* TikTok Input Module */
.tiktok-input-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tiktok-field-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 4px 6px 4px 16px;
  transition: var(--transition-smooth);
}

.tiktok-field-wrapper:focus-within {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px var(--apple-blue-glow);
  background: rgba(255, 255, 255, 0.08);
}

.tiktok-field-icon {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  margin-right: 12px;
}

.apple-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.apple-input::placeholder {
  color: var(--text-tertiary);
}

.tiktok-quick-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  padding-left: 16px;
}

.tiktok-media-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  animation: fadeIn 0.3s ease;
}

.tiktok-cover-wrap {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #111;
  flex-shrink: 0;
}

.tiktok-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tiktok-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tiktok-track-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tiktok-track-author {
  font-size: 12px;
  color: var(--text-secondary);
}

.tiktok-track-stats {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Demo Box */
.demo-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  gap: 16px;
}

.demo-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.demo-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Active Track Banner */
.track-banner {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
}

.track-banner-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.track-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-meta {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

/* Visualizer & Player Card */
.player-card {
  padding: 18px 22px 22px;
}

.visualizer-container {
  position: relative;
  width: 100%;
  height: 80px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  overflow: hidden;
  margin-bottom: 12px;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.visualizer-container:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.55);
}

#visualizerCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.visualizer-overlay-info {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(8px);
}

.time-sep {
  opacity: 0.4;
  margin: 0 4px;
}

/* Scrubber Timeline */
.timeline-container {
  padding: 8px 0 16px;
}

.scrub-bar {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: height 0.15s ease;
}

.scrub-bar:hover {
  height: 7px;
}

.scrub-progress {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: var(--text-primary);
  border-radius: var(--radius-pill);
  transition: width 0.08s linear;
}

.scrub-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.scrub-bar:hover .scrub-handle {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2);
}

/* Transport Controls */
.transport-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.transport-left, .transport-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.transport-right {
  justify-content: flex-end;
}

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

.play-button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.22);
  transition: var(--transition-smooth);
}

.play-button:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.35);
}

.play-button:active {
  transform: scale(0.96);
}

.transport-btn, .icon-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.transport-btn:hover, .icon-toggle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.icon-toggle.active {
  color: var(--apple-blue);
  background: rgba(10, 132, 255, 0.12);
}

/* Animated Mute Button (Apple Spring Animation) */
.icon-toggle.mute-btn {
  position: relative;
  overflow: visible;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-toggle.mute-btn:active {
  transform: scale(0.86);
}

.mute-svg {
  display: block;
  overflow: visible;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vol-wave {
  transform-origin: 11px 12px;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vol-cross {
  transform-origin: 19px 12px;
  stroke: #ff453a;
  stroke-width: 2.2;
  opacity: 0;
  transform: scale(0.3) rotate(-25deg);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Muted Active State */
.icon-toggle.mute-btn.is-muted {
  color: #ff453a;
  background: rgba(255, 69, 58, 0.12);
}

.icon-toggle.mute-btn.is-muted:hover {
  background: rgba(255, 69, 58, 0.2);
}

.icon-toggle.mute-btn.is-muted .mute-svg {
  transform: scale(0.96);
}

.icon-toggle.mute-btn.is-muted .vol-wave {
  opacity: 0;
  transform: scale(0.2) translateX(-4px);
  pointer-events: none;
}

.icon-toggle.mute-btn.is-muted .vol-cross {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Volume Slider */
.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 140px;
  transition: opacity 0.25s ease;
}

.volume-control.is-muted .volume-slider {
  opacity: 0.4;
}

.volume-slider {
  flex: 1;
}

/* Presets Module (Apple Pills Grid) */
.preset-pills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.preset-pill {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.preset-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.preset-pill.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* DSP Grid Core (Speed & Reverb matching slowedandreverb.studio free tier) */
.dsp-grid-core {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .dsp-grid-core {
    grid-template-columns: 1fr;
  }
}

.slider-subtext {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

.dsp-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Slider Controls */
.slider-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.2s ease;
}

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

.slider-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.slider-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-hairline);
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  padding: 0 2px;
}

.slider-caption {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* Native Range Styling (Apple Design) */
.apple-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  outline: none;
  margin: 8px 0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.apple-slider:hover {
  background: rgba(255, 255, 255, 0.18);
}

.apple-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.apple-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.65);
}

.apple-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.apple-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: grab;
}

/* Quick Speed Buttons */
.speed-quick-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.quick-chip {
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.quick-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.quick-chip.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

/* Switch Row & iOS UISwitch */
.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.switch-label {
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.apple-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

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

.slider-switch {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(120, 120, 128, 0.32);
  transition: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: var(--radius-pill);
}

.slider-switch::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.apple-switch input:checked + .slider-switch {
  background-color: var(--apple-green);
}

.apple-switch input:checked + .slider-switch::before {
  transform: translateX(18px);
}

/* Export Module */
.export-card {
  padding: 24px;
  background: linear-gradient(180deg, rgba(28, 28, 34, 0.8), rgba(20, 20, 24, 0.9));
}

.export-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.export-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.export-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.export-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 440px;
}

.export-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.format-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
}

.radio-label {
  cursor: pointer;
}

.radio-label input {
  display: none;
}

.radio-pill {
  display: block;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  transition: var(--transition-smooth);
}

.radio-label input:checked + .radio-pill {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  font-weight: 600;
}

/* Export Progress Bar */
.export-progress-wrap {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-progress-wrap[hidden] {
  display: none !important;
}

.export-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.export-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0a84ff, #5e5ce6);
  border-radius: var(--radius-pill);
  transition: width 0.1s linear;
}

.export-progress-label {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-align: right;
}

/* Buttons */
.apple-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.primary-btn {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.primary-btn:hover {
  background: #f0f0f5;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.28);
}

.primary-btn:active {
  transform: translateY(0);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.ghost-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Button Spinner */
.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Apple Toast Notification */
.apple-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(30, 30, 34, 0.88);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-icon {
  display: flex;
  align-items: center;
  color: var(--apple-blue);
}

/* Footer */
.app-footer {
  text-align: center;
  padding-top: 12px;
}

.footer-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer-dot {
  opacity: 0.4;
}

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

/* ==========================================================================
   Mobile Performance & Touch Optimization (iOS Safari, Android Chrome)
   - Eliminates GPU filter overhead (replaces 120px Gaussian blur with native radial gradients)
   - Disables costly backdrop-filter on mobile cards for rock-solid 60-120fps scrolling
   - Increases touch target sizes for sliders (24px thumbs)
   - Removes 300ms tap delay via touch-action: manipulation
   ========================================================================== */

button,
input,
.segment-tab,
.apple-slider,
.preset-pill,
.quick-chip,
.visualizer-container,
.scrub-bar {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  /* 1. Eliminate GPU compositor stall by replacing heavy blur filters with zero-cost radial gradients */
  .glow-orb {
    filter: none !important;
    opacity: 0.22;
  }

  .glow-top {
    top: -120px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100vw !important;
    height: 340px !important;
    background: radial-gradient(circle at 50% 30%, rgba(94, 92, 230, 0.25) 0%, rgba(10, 132, 255, 0.1) 45%, transparent 70%) !important;
  }

  .glow-bottom {
    bottom: -120px !important;
    right: -20px !important;
    width: 100vw !important;
    height: 320px !important;
    background: radial-gradient(circle at 70% 70%, rgba(191, 90, 242, 0.2) 0%, rgba(48, 209, 88, 0.08) 50%, transparent 70%) !important;
  }

  /* 2. Bypass expensive backdrop-filter on cards during mobile scrolling & slider dragging */
  .apple-card {
    background: rgba(20, 20, 24, 0.95) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 16px;
    border-radius: 16px;
  }

  .app-header {
    background: rgba(18, 18, 22, 0.96) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 10px 14px;
  }

  .visualizer-overlay-info {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(0, 0, 0, 0.75);
  }

  /* 3. Mobile touch-friendly sliders */
  .apple-slider {
    height: 6px;
    margin: 12px 0;
  }

  .apple-slider::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  }

  .apple-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }

  .scrub-bar {
    height: 6px;
  }

  .scrub-handle {
    width: 14px;
    height: 14px;
    opacity: 1; /* Always visible on touch screens */
  }

  .app-shell {
    padding: 12px 14px 40px;
    gap: 14px;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* 4. Fix Track Info Banner Stacking (No Overlapping/Double Text) */
  .track-banner {
    padding: 10px 14px;
    border-radius: var(--radius-md);
  }

  .track-banner-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .track-badge {
    width: 100%;
    max-width: 100%;
    font-size: 13px;
  }

  .track-meta {
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-tertiary);
    word-break: break-word;
  }

  /* 5. Player Visualizer & Time Overlay */
  .visualizer-container {
    height: 72px;
  }

  .visualizer-overlay-info {
    bottom: 8px;
    right: 8px;
    font-size: 11px;
    padding: 2px 7px;
  }

  /* 6. Transport Controls (No Horizontal Overflow / Misalignment) */
  .transport-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .transport-left {
    flex: 0 0 auto;
    gap: 6px;
  }

  .transport-center {
    flex: 0 0 auto;
  }

  .transport-right {
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .volume-control {
    width: 94px;
    gap: 4px;
  }

  .volume-slider {
    width: 54px;
    min-width: 0;
  }

  /* 7. DSP Section Titles (Speed & Pitch Headers) */
  .card-section-title {
    flex-wrap: wrap;
    gap: 8px;
  }

  .section-label {
    flex-wrap: wrap;
    gap: 6px;
  }

  .param-link-btn {
    margin-left: 0;
  }

  /* 8. Upload Segmented Controls & Drop Zone */
  .segmented-control {
    width: 100%;
  }

  .segment-tab {
    padding: 8px 6px;
    font-size: 12px;
    gap: 6px;
  }

  .drop-zone {
    padding: 24px 14px;
  }

  .drop-title {
    font-size: 14px;
  }

  .tiktok-field-wrapper {
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    border-radius: var(--radius-md);
    gap: 8px;
  }

  .apple-input {
    padding: 6px 8px;
    width: 100%;
  }

  .tiktok-field-wrapper .apple-button {
    width: 100%;
    justify-content: center;
  }

  .preset-pills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 9. Export Controls Full Width Touch-Friendly */
  .export-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .export-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
  }

  .format-selector {
    display: flex;
    width: 100%;
  }

  .radio-label {
    flex: 1;
    text-align: center;
  }

  .radio-pill {
    text-align: center;
    padding: 8px 4px;
    font-size: 11px;
    white-space: nowrap;
  }

  .export-action-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
    font-size: 14px;
  }
}
