/* VocalTune Studio — Dark Modern Web DAW Stylesheet */
:root {
  --bg-deep: #090d16;
  --bg-surface: #0f1522;
  --bg-panel: #141c2d;
  --bg-elevated: #1b253b;
  --bg-hover: #23304c;
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --cyan: #22d3ee;
  --cyan-glow: rgba(34, 211, 238, 0.35);
  --purple: #a855f7;
  --purple-glow: rgba(168, 85, 247, 0.35);
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.45);

  --track-h: 92px;
  --header-col-w: 270px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

input, select, textarea, button {
  font-family: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* Custom sleek scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0b101b;
}
::-webkit-scrollbar-thumb {
  background: #283552;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a4c73;
}

/* Custom Range Sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: #222e47;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid #090d16;
  box-shadow: 0 0 8px var(--cyan-glow);
  transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

/* Shell Layout */
.studio-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==================== TOP TRANSPORT BAR ==================== */
.topbar {
  height: 54px;
  min-height: 54px;
  background: linear-gradient(180deg, #131b2c 0%, #0e1422 100%);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  gap: 7px;
  z-index: 20;
  overflow-x: auto;
  overflow-y: hidden;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 148px;
  flex-shrink: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(34, 211, 238, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-sub {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.11em;
  color: var(--cyan);
}

.project-name-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  padding: 1px 4px;
  margin-left: -4px;
  width: 112px;
  user-select: text;
}
.project-name-input:hover, .project-name-input:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
  outline: none;
}

/* Transport Buttons */
.transport-group {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #0a0f1a;
  padding: 4px 6px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.t-btn {
  width: 32px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.t-btn:hover {
  background: var(--bg-elevated);
}
.t-btn.active {
  background: rgba(34, 211, 238, 0.18);
  border-color: var(--cyan);
  color: var(--cyan);
}
.t-btn-play.playing {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--emerald);
  color: #34d399;
}
.t-btn-rec {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.35);
}
.t-btn-rec:hover {
  background: rgba(244, 63, 94, 0.25);
}
.t-btn-rec .rec-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 8px var(--rose-glow);
}
.t-btn-rec.recording {
  background: var(--rose);
  border-color: #fda4af;
  animation: recPulse 1s infinite;
}
.t-btn-rec.recording .rec-dot {
  background: #fff;
}
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); }
  50% { box-shadow: 0 0 0 7px rgba(244, 63, 94, 0); }
}

/* LCD Time Display */
.lcd-display {
  background: #070b13;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 8px;
  padding: 3px 8px;
  min-width: 96px;
  text-align: center;
  flex-shrink: 0;
}
.lcd-time {
  font-family: 'Consolas', 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.03em;
}
.lcd-bar {
  font-size: 9.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Musical Settings (BPM, Metronome, Key) */
.musical-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.mini-field {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #0b111d;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 2px 5px;
}
.mini-field label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.mini-field input[type="number"] {
  width: 40px;
  background: transparent;
  border: none;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  color: var(--text-main);
  outline: none;
}

.chip-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}
.chip-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}
.chip-btn.active {
  background: rgba(34, 211, 238, 0.18);
  border-color: var(--cyan);
  color: var(--cyan);
}
.chip-btn.chip-accent {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(34, 211, 238, 0.22));
  border-color: rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
}
.chip-btn.chip-accent:hover {
  filter: brightness(1.18);
}

.key-selector-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #0b111d;
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 8px;
  padding: 2px 5px;
}
.key-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #c084fc;
}

.studio-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 3px 6px;
  height: 26px;
  font-size: 11.5px;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  white-space: nowrap;
}
#global-scale {
  max-width: 118px;
  text-overflow: ellipsis;
}
.studio-select.compact {
  padding: 2px 6px;
  height: 24px;
  font-size: 11px;
}
.studio-select.full {
  width: 100%;
}
.studio-select option {
  background: #141c2d;
  color: #f1f5f9;
}

/* Right Action Buttons */
.actions-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.14s;
}
.action-btn:hover {
  background: var(--bg-hover);
}
.action-btn.action-primary {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.3);
}
.action-btn.action-primary:hover {
  filter: brightness(1.1);
}
.action-btn.full-center {
  width: 100%;
  justify-content: center;
  padding: 9px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
}
.status-dot.connected {
  background: #10b981;
  box-shadow: 0 0 7px #10b981;
}

/* ==================== WORKSPACE TOOLBAR ==================== */
.workspace-toolbar {
  height: 40px;
  min-height: 40px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 10px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tool-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}
.tool-btn:hover {
  background: var(--bg-hover);
}
.tool-btn.active {
  background: rgba(34, 211, 238, 0.18);
  border-color: var(--cyan);
  color: var(--cyan);
}
.tool-btn-accent {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.45);
  color: #e9d5ff;
}
.tool-btn-cyan {
  background: rgba(34, 211, 238, 0.18);
  border-color: rgba(34, 211, 238, 0.5);
  color: #a5f3fc;
}
.tool-btn-danger {
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}
.tool-btn-danger:hover {
  background: rgba(244, 63, 94, 0.25);
}

.divider-v {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 115px;
}

.toolbar-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-sel-badge {
  background: rgba(34, 211, 238, 0.14);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--cyan);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-mini-slider {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 3px 7px;
}
.clip-mini-slider label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 600;
}
.clip-mini-slider input[type="range"] {
  width: 58px;
}

/* ==================== ARRANGEMENT (TRACKS + TIMELINE) ==================== */
.arrangement-area {
  flex: 1;
  min-height: 170px;
  display: flex;
  overflow: hidden;
  background: var(--bg-deep);
}

.track-headers-col {
  width: var(--header-col-w);
  min-width: var(--header-col-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.track-headers-top {
  height: 34px;
  min-height: 34px;
  background: #111622;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.hint-mini {
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-dim);
}

.track-headers-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.track-header {
  height: var(--track-h);
  border-bottom: 1px solid var(--border-subtle);
  border-left: 4px solid var(--track-color, #22d3ee);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #101624;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.track-header:hover {
  background: #141c2e;
}
.track-header.selected {
  background: #182338;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.25);
}

.th-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.th-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.th-icon {
  font-size: 14px;
  flex-shrink: 0;
}
.th-name {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  width: 100%;
  padding: 1px 3px;
  user-select: text;
}
.th-name:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--cyan);
  outline: none;
}

.th-del-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
}
.th-del-btn:hover {
  color: var(--rose);
  background: rgba(244, 63, 94, 0.15);
}

.th-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.th-btn {
  height: 22px;
  min-width: 24px;
  padding: 0 5px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: #0c1220;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.th-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}
.th-btn.arm.active {
  background: var(--rose);
  border-color: #fda4af;
  color: #fff;
  box-shadow: 0 0 8px var(--rose-glow);
}
.th-btn.mon.active {
  background: rgba(34, 211, 238, 0.25);
  border-color: var(--cyan);
  color: var(--cyan);
}
.th-btn.mute.active {
  background: rgba(245, 158, 11, 0.28);
  border-color: var(--amber);
  color: #fde68a;
}
.th-btn.solo.active {
  background: rgba(16, 185, 129, 0.28);
  border-color: var(--emerald);
  color: #6ee7b7;
}
.th-btn.fx-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 0 6px;
}
.th-btn.fx-badge.tune-on {
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.55);
  color: #e9d5ff;
}

.th-sliders {
  display: flex;
  align-items: center;
  gap: 8px;
}
.th-vol-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
}
.th-vol-wrap span {
  font-size: 10px;
  color: var(--text-dim);
}
.th-meter {
  width: 54px;
  height: 6px;
  background: #080c15;
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}
.th-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #22d3ee 65%, #f59e0b 85%, #f43f5e 100%);
  transition: width 0.04s linear;
}

/* Timeline Viewport */
.timeline-viewport {
  flex: 1;
  overflow: auto;
  position: relative;
  background: #0b0f19;
}

.timeline-ruler-wrap {
  position: sticky;
  top: 0;
  z-index: 12;
  height: 34px;
}
#timeline-ruler {
  display: block;
  cursor: pointer;
}

.timeline-body {
  position: relative;
  min-height: calc(100% - 34px);
}

.track-lane {
  height: var(--track-h);
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  background-image: linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  transition: background-color 0.1s;
}
.track-lane.selected {
  background-color: rgba(34, 211, 238, 0.035);
}
.track-lane.drag-over {
  background-color: rgba(168, 85, 247, 0.16);
  box-shadow: inset 0 0 0 2px var(--purple);
}

/* Audio Clips */
.audio-clip {
  position: absolute;
  top: 5px;
  height: calc(var(--track-h) - 10px);
  border-radius: 7px;
  background: color-mix(in srgb, var(--clip-color, #22d3ee) 26%, #131b2e);
  border: 1px solid color-mix(in srgb, var(--clip-color, #22d3ee) 60%, transparent);
  overflow: hidden;
  cursor: grab;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}
.audio-clip:active {
  cursor: grabbing;
}
.audio-clip.selected {
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 2px var(--clip-color, #22d3ee), 0 6px 16px rgba(0, 0, 0, 0.5);
  z-index: 4;
}
.audio-clip.recording-live {
  --clip-color: #f43f5e;
  background: rgba(244, 63, 94, 0.28);
  border: 1.5px solid #fb7185;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.35);
}

.clip-header {
  height: 18px;
  padding: 0 7px;
  background: rgba(0, 0, 0, 0.32);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  pointer-events: none;
}
.clip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clip-tune-badge {
  background: var(--cyan);
  color: #090d16;
  font-size: 8.5px;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
}

.clip-waveform {
  display: block;
  pointer-events: none;
}

.clip-fade {
  position: absolute;
  top: 18px;
  bottom: 0;
  pointer-events: none;
}
.clip-fade-in {
  left: 0;
  background: linear-gradient(to bottom right, rgba(0, 0, 0, 0.55) 49%, transparent 51%);
}
.clip-fade-out {
  right: 0;
  background: linear-gradient(to bottom left, rgba(0, 0, 0, 0.55) 49%, transparent 51%);
}

.clip-trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7px;
  cursor: ew-resize;
  z-index: 5;
}
.clip-trim-handle.left { left: 0; }
.clip-trim-handle.right { right: 0; }
.clip-trim-handle:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Playhead */
.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  pointer-events: none;
  z-index: 15;
  will-change: transform;
}
.playhead-head {
  position: absolute;
  top: -12px;
  left: -5px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 10px solid var(--cyan);
}
.playhead-line {
  width: 2px;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}

/* ==================== BOTTOM STUDIO DOCK ==================== */
.studio-dock {
  height: 300px;
  min-height: 300px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  transition: height 0.18s ease, min-height 0.18s ease;
  z-index: 18;
}
.studio-dock.collapsed {
  height: 36px;
  min-height: 36px;
}
.studio-dock.collapsed .dock-body {
  display: none;
}

.dock-header {
  height: 36px;
  min-height: 36px;
  background: #111726;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.dock-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.dock-tab {
  height: 100%;
  padding: 0 13px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.dock-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}
.dock-tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  background: rgba(34, 211, 238, 0.06);
}

.dock-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.active-track-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #e9d5ff;
}

.dock-body {
  flex: 1;
  overflow: auto;
  padding: 12px 14px;
}

.dock-panel {
  display: none;
  height: 100%;
}
.dock-panel.active {
  display: block;
}

.beat-notice {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 20px;
}

/* ==================== TAB 1: VOCAL TUNE GRID ==================== */
.tune-grid {
  display: grid;
  grid-template-columns: 300px 285px 1fr;
  gap: 12px;
  align-items: start;
}

.tune-col-left, .tune-col-mid, .tune-col-right {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.tune-power-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel);
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
}
.tune-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--cyan);
}
.tune-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Toggle Switches */
.toggle-switch {
  position: relative;
  width: 42px;
  height: 22px;
  display: inline-block;
  flex-shrink: 0;
}
.toggle-switch input { display: none; }
.toggle-switch .slider {
  position: absolute;
  inset: 0;
  background: #27324a;
  border-radius: 99px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-switch .slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s;
}
.toggle-switch input:checked + .slider {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  box-shadow: 0 0 10px var(--cyan-glow);
}
.toggle-switch input:checked + .slider::before {
  transform: translateX(20px);
}

.toggle-mini {
  position: relative;
  width: 30px;
  height: 16px;
  display: inline-block;
}
.toggle-mini input { display: none; }
.toggle-mini span {
  position: absolute;
  inset: 0;
  background: #27324a;
  border-radius: 99px;
  cursor: pointer;
  transition: 0.16s;
}
.toggle-mini span::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: 0.16s;
}
.toggle-mini input:checked + span {
  background: var(--cyan);
}
.toggle-mini input:checked + span::before {
  transform: translateX(14px);
}

.preset-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.preset-pill {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.preset-pill:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}
.preset-pill.active {
  background: rgba(34, 211, 238, 0.2);
  border-color: var(--cyan);
  color: var(--cyan);
}

.scale-sync-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
}
.custom-key-row {
  display: flex;
  gap: 6px;
}

/* Interactive 12-Note Piano */
.piano-wrap {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 8px;
}
.piano-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--cyan);
  font-size: 10.5px;
  cursor: pointer;
  text-decoration: underline;
}

.scale-piano {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
}
.piano-key {
  height: 30px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s;
}
.piano-key.white {
  background: #1d263b;
  color: #94a3b8;
}
.piano-key.black {
  background: #0d121f;
  color: #64748b;
}
.piano-key.active {
  background: linear-gradient(180deg, #22d3ee, #0891b2);
  color: #05111a;
  border-color: #67e8f9;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.35);
}

/* Middle Params Card */
.param-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.param-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.param-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.param-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
}
.param-val {
  font-family: 'Consolas', monospace;
  font-weight: 700;
  color: var(--cyan);
  font-size: 11.5px;
}
.param-hints {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--text-dim);
}

/* Right Tuner & Pitch Graph */
.tuner-readout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 7px 14px;
}
.tuner-note-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 66px;
}
.tuner-mini {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.tuner-note {
  font-family: 'Consolas', monospace;
  font-size: 20px;
  font-weight: 800;
}
.tuner-note.raw { color: #fb923c; }
.tuner-note.tuned { color: var(--cyan); text-shadow: 0 0 10px var(--cyan-glow); }

.tuner-meter-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.tuner-cents {
  font-family: 'Consolas', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.tuner-cents.in-tune { color: #34d399; }
.tuner-cents.off-tune { color: #fb923c; }

.cents-bar {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: #0a0f1a;
  border: 1px solid var(--border-subtle);
  position: relative;
}
.cents-center {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #34d399;
  transform: translateX(-50%);
}
.cents-needle {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 8px;
  height: 12px;
  border-radius: 4px;
  background: #64748b;
  transform: translateX(-50%);
  transition: left 0.05s linear;
}
.cents-needle.active {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.pitch-graph-wrap {
  height: 168px;
  min-height: 168px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
  background: #0b0f19;
}
#pitch-graph-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.graph-legend {
  position: absolute;
  top: 6px;
  right: 10px;
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(9, 13, 22, 0.75);
  padding: 2px 7px;
  border-radius: 99px;
}
.dot-raw, .dot-tuned {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 3px;
}
.dot-raw { background: #fb923c; }
.dot-tuned { background: #22d3ee; }

/* ==================== TAB 2: VOCAL FX RACK ==================== */
.fx-rack-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.fx-presets-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.fx-presets-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.fx-presets-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fx-cards-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(165px, 1fr));
  gap: 10px;
  flex: 1;
  overflow-x: auto;
}

.fx-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.fx-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--cyan);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
}
.fx-slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fx-slider-group > label {
  font-size: 11px;
  color: var(--text-muted);
}
.fx-sub-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--cyan);
  margin-top: 2px;
}
.fx-card-tip {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-dim);
  margin-top: auto;
}

.gr-meter-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: auto;
}
.gr-bar {
  flex: 1;
  height: 6px;
  background: #0a0f1a;
  border-radius: 99px;
  overflow: hidden;
}
.gr-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f59e0b, #f43f5e);
  transition: width 0.05s;
}

/* ==================== TAB 3: MIXER CONSOLE ==================== */
.mixer-strips {
  display: flex;
  gap: 10px;
  height: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.mixer-strip {
  width: 116px;
  min-width: 116px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--strip-color, #22d3ee);
  border-radius: 9px;
  padding: 9px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.mixer-strip.master {
  border-top-color: var(--purple);
  background: #181c33;
  margin-left: auto;
}
.mixer-name {
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mixer-fader-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 112px;
}
.mixer-vmeter {
  width: 8px;
  height: 100%;
  background: #080c15;
  border-radius: 99px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.mixer-vmeter-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(0deg, #10b981 0%, #22d3ee 65%, #f59e0b 85%, #f43f5e 100%);
  transition: height 0.04s linear;
}
.vertical-fader {
  writing-mode: bt-lr;
  -webkit-appearance: slider-vertical;
  width: 18px !important;
  height: 105px !important;
}
.mixer-db {
  font-family: 'Consolas', monospace;
  font-size: 10.5px;
  color: var(--cyan);
}
.mixer-pan-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  color: var(--text-dim);
}

/* ==================== TAB 4: LYRICS PAD ==================== */
.lyrics-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}
.lyrics-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.lyrics-size-btns {
  display: flex;
  gap: 5px;
}
.lyrics-textarea {
  flex: 1;
  background: #0b0f19;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.65;
  resize: none;
  outline: none;
  user-select: text;
}
.lyrics-textarea:focus {
  border-color: var(--cyan);
}

/* ==================== OVERLAYS & MODALS ==================== */
.countin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
}
.countin-card {
  background: var(--bg-panel);
  border: 1px solid rgba(244, 63, 94, 0.5);
  border-radius: 18px;
  padding: 28px 46px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}
.countin-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fda4af;
}
.countin-number {
  font-size: 76px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin: 8px 0 16px;
  text-shadow: 0 0 28px var(--rose-glow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 15, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
}
.modal-card {
  width: 500px;
  max-width: 92vw;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}
.modal-header {
  padding: 14px 18px;
  background: #101727;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-size: 15px;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-footer {
  padding: 12px 18px;
  background: #101727;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-row > label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.inline-flex {
  display: flex;
  gap: 8px;
}
.help-text {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.tip-box {
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #cffafe;
}

.mic-meter-bg, .progress-bar-bg {
  width: 100%;
  height: 9px;
  border-radius: 99px;
  background: #090d16;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.mic-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #22d3ee, #f59e0b, #f43f5e);
  transition: width 0.04s linear;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #06b6d4, #a855f7);
  transition: width 0.2s ease;
}

.export-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.export-preview audio {
  width: 100%;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  background: #172136;
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #f8fafc;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.2s ease;
}
.toast.error {
  border-color: rgba(244, 63, 94, 0.65);
  background: #2b121c;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1280px) {
  .tune-grid {
    grid-template-columns: 270px 255px 1fr;
  }
  .brand-group { min-width: 145px; }
  .project-name-input { width: 105px; }
}
