/* ========================================================
   A-AUDIO : MON STUDIO SONORE & PODCAST (CSS)
   Version Studio Sombre / Pourpre & Onde Sonore Claire
   Design immersif, élégant, adapté aux enfants et accessible
   ======================================================== */

:root {
  /* Nuances pourpres principales */
  --primary: #a855f7;
  --primary-hover: #c084fc;
  --primary-dark: #7c3aed;
  --primary-glow: rgba(168, 85, 247, 0.4);
  
  --record-red: #f43f5e;
  --record-red-glow: rgba(244, 63, 94, 0.45);
  --play-green: #10b981;
  --play-green-glow: rgba(16, 185, 129, 0.4);
  --amber-jingle: #f59e0b;
  --cyan-neon: #38bdf8;

  /* Arrière-plans foncés studio */
  --bg-page: #0d071c;
  --bg-card: #150d2b;
  --bg-card-header: #1d123b;
  --bg-toolbar: #130a24;
  --bg-hint: #100720;
  --bg-input: rgba(255, 255, 255, 0.08);

  /* Typographie & bordures claires */
  --text-main: #f8fafc;
  --text-muted: #a78bfa;
  --text-sub: #cbd5e1;
  --border: #2c1a4d;
  --border-light: #3d246c;
  --border-glow: rgba(168, 85, 247, 0.35);

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

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.7);

  --font-main: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-mono: 'Source Code Pro', monospace;
}

* {
  box-sizing: border-box;
}

body.aaudio-page {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-main);
  overflow-x: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.aaudio-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 980px) and (min-height: 600px) {
  body.aaudio-page {
    height: 100vh;
    overflow: hidden;
  }
  .aaudio-wrapper {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }
}

/* ========================================================
   1. BANNIÈRE SUPÉRIEURE (TOP BAR - POURPRE SOMBRE)
   ======================================================== */
.aaudio-top-bar {
  background: linear-gradient(135deg, #180a33 0%, #250f4c 50%, #341269 100%);
  color: white;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--border-glow);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 50;
  flex-shrink: 0;
}

.aaudio-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-back-site {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.btn-back-site:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.aaudio-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #f5f3ff;
  letter-spacing: 0.5px;
}

.aaudio-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.aaudio-doc-name-input {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--border-glow);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  width: 220px;
  outline: none;
  transition: all 0.2s;
}

.aaudio-doc-name-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.aaudio-doc-name-input:focus {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.35);
}

.aaudio-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.aaudio-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #f5f3ff;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.aaudio-pill-btn:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

/* ========================================================
   2. BANDEAU D'AIDE INTERACTIF AU SURVOL (HINT BAR)
   ======================================================== */
.aaudio-hint-bar {
  background: var(--bg-hint);
  border-bottom: 1px solid var(--border);
  padding: 4px 16px;
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  min-height: 29px;
  flex-shrink: 0;
}

.aaudio-hint-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.aaudio-hint-badge {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  color: white;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4);
}

.aaudio-hint-text {
  font-weight: 600;
  color: #e9d5ff;
}

/* ========================================================
   3. BARRE D'OUTILS (TOOLBAR - CONSOLE STUDIO)
   ======================================================== */
.aaudio-toolbar {
  background: var(--bg-toolbar);
  border-bottom: 1px solid var(--border);
  padding: 7px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

.aaudio-tool-unit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-right: 12px;
  border-right: 1px solid var(--border);
}

.aaudio-tool-unit:last-child {
  border-right: none;
}

.aaudio-unit-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #c084fc;
}

.aaudio-tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Boutons principaux d'outils */
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid var(--border-glow);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.tool-btn:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.25);
  border-color: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px var(--primary-glow);
}

.tool-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.tool-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

/* ========================================================
   Boutons de transport ronds professionnels (Enregistrement, Lecture & Stop)
   ======================================================== */
.tool-btn.btn-round {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  max-width: 42px;
  max-height: 42px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  border-width: 2px;
  border-style: solid;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.tool-btn.btn-round svg {
  display: block;
  pointer-events: none;
  transition: transform 0.15s ease;
}

/* Bouton Enregistrer (Rond rouge studio avec néon) */
.btn-record.btn-round {
  background: linear-gradient(145deg, #f43f5e 0%, #e11d48 100%);
  color: #ffffff;
  border-color: #fda4af;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 16px rgba(244, 63, 94, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.btn-record.btn-round:hover:not(:disabled) {
  background: linear-gradient(145deg, #fb7185 0%, #e11d48 100%);
  border-color: #fecdd3;
  color: #ffffff;
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 26px rgba(244, 63, 94, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.btn-record.btn-round:active:not(:disabled) {
  transform: translateY(1px) scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-record.btn-round.recording {
  background: linear-gradient(145deg, #be123c 0%, #881337 100%);
  border-color: #fda4af;
  animation: pulseRecordRound 1.1s infinite alternate ease-in-out;
}

@keyframes pulseRecordRound {
  0% {
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.85), 0 0 14px rgba(244, 63, 94, 0.6);
    transform: scale(1.0);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(244, 63, 94, 0), 0 0 28px rgba(244, 63, 94, 0.95);
    transform: scale(1.06);
  }
}

/* Bouton Lire (Rond émeraude avec néon) */
.btn-play.btn-round {
  background: linear-gradient(145deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-color: #6ee7b7;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 16px rgba(16, 185, 129, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.btn-play.btn-round svg {
  margin-left: 2px; /* Centrage optique parfait du triangle lecture */
}

.btn-play.btn-round:hover:not(:disabled) {
  background: linear-gradient(145deg, #34d399 0%, #059669 100%);
  border-color: #a7f3d0;
  color: #ffffff;
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 24px rgba(16, 185, 129, 0.75), inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.btn-play.btn-round:active:not(:disabled) {
  transform: translateY(1px) scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Bouton Pause actif (Rond ambré lumineux) */
.btn-play.btn-round.playing {
  background: linear-gradient(145deg, #f59e0b 0%, #d97706 100%);
  border-color: #fde68a;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 18px rgba(245, 158, 11, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.btn-play.btn-round.playing svg {
  margin-left: 0;
}

.btn-play.btn-round.playing:hover:not(:disabled) {
  background: linear-gradient(145deg, #fbbf24 0%, #d97706 100%);
  border-color: #fef3c7;
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 26px rgba(245, 158, 11, 0.85);
}

/* Bouton Stop (Rond studio sombre / halo rouge vif) */
.btn-stop.btn-round {
  background: linear-gradient(145deg, #1e1534 0%, #120a24 100%);
  border-color: rgba(239, 68, 68, 0.55);
  color: #ef4444;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 10px rgba(239, 68, 68, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

.btn-stop.btn-round:hover:not(:disabled) {
  background: linear-gradient(145deg, #ef4444 0%, #dc2626 100%);
  border-color: #fca5a5;
  color: #ffffff;
  transform: translateY(-2px) scale(1.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 22px rgba(239, 68, 68, 0.7), inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.btn-stop.btn-round:active:not(:disabled) {
  transform: translateY(1px) scale(0.96);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-stop.btn-round:disabled,
.btn-play.btn-round:disabled {
  opacity: 0.3;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-export {
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
  color: white;
  border: 1px solid #d8b4fe;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-export:hover:not(:disabled) {
  background: linear-gradient(135deg, #7e22ce 0%, #6b21a8 100%);
  color: white;
  box-shadow: 0 6px 18px rgba(147, 51, 234, 0.55);
}

/* Chronomètre d'enregistrement */
.record-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  padding: 6px 12px;
  background: #2b0e1b;
  color: #fecdd3;
  border-radius: var(--radius-sm);
  border: 1px solid #e11d48;
  min-width: 82px;
  justify-content: center;
}

.record-dot {
  width: 8px;
  height: 8px;
  background: #f43f5e;
  border-radius: 50%;
  opacity: 0.3;
}

.record-dot.active {
  opacity: 1;
  animation: blinkDot 0.8s infinite alternate;
}

@keyframes blinkDot {
  from { opacity: 0.2; }
  to { opacity: 1; }
}

/* ========================================================
   4. ZONE CENTRALE DE TRAVAIL (CONSOLE + RACK MONITEURS SANS SCROLL)
   ======================================================== */
.aaudio-studio-area {
  flex: 1;
  min-height: 0;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.studio-workspace-grid {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  align-items: stretch;
  width: 100%;
}

/* Zone de glisser-déposer de fichiers */
.dropzone-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 7, 28, 0.92);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
}

.dropzone-overlay.active {
  display: flex;
}

.dropzone-box {
  background: #1a0f33;
  color: var(--text-main);
  padding: 40px 60px;
  border-radius: var(--radius-lg);
  border: 3px dashed var(--primary);
  box-shadow: var(--shadow-lg);
}

.dropzone-box h3 {
  font-size: 1.6rem;
  margin: 10px 0;
  color: var(--primary-hover);
}

/* ========================================================
   4. STUDIO MULTIPISTES (2 PISTES SUPERPOSÉES)
   ======================================================== */

.multitrack-studio-container {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.multitrack-studio-container:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
}

/* Ligne supérieure de la règle temporelle */
.multitrack-ruler-row {
  display: flex;
  background: #100824;
  border-bottom: 2px solid #28164b;
  flex-shrink: 0;
}

.track-sidebar-header-space {
  width: 245px;
  min-width: 245px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-right: 1px solid #28164b;
  background: #0d061c;
}

.ruler-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: #c084fc;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ruler-lane-wrapper {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  position: relative;
  background: #140d28;
}

.ruler-lane-wrapper::-webkit-scrollbar {
  display: none;
}

.timeline-canvas {
  display: block;
  width: 100%;
  height: 26px;
  touch-action: none;
  cursor: pointer;
}

/* Lignes de pistes superposées */
.multitrack-row {
  flex: 1;
  min-height: 128px;
  display: flex;
  border-bottom: 1px solid #28164b;
  background: #0c071a;
}

.multitrack-row:last-child {
  border-bottom: none;
}

.track-row-voice {
  border-left: 5px solid var(--primary);
  transition: all 0.3s ease;
}

.track-row-voice.is-recording {
  border-left-color: #f43f5e;
  box-shadow: inset 0 0 25px rgba(244, 63, 94, 0.18);
  background: #11071e;
}

.track-row-voice.is-recording .track-num-badge {
  background: #f43f5e !important;
  color: white !important;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.8);
  animation: pulseRecDot 1s infinite alternate;
}

@keyframes pulseRecDot {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.18); opacity: 0.85; }
}

.track-row-music {
  border-left: 5px solid var(--amber-jingle);
  border-top: 2px solid #231242;
}

/* Panneau latéral de contrôle de chaque piste */
.track-sidebar {
  width: 245px;
  min-width: 245px;
  padding: 10px 12px;
  background: #130a27;
  border-right: 1px solid #28164b;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.track-sidebar-amber {
  background: #180e2b;
}

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

.track-title-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
}

.track-num-badge.badge-amber {
  background: var(--amber-jingle);
  color: #1e1103;
}

.track-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
}

.track-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-superposed {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.4);
}

/* Boutons Mute et Solo */
.track-button-group {
  display: flex;
  gap: 6px;
}

.track-btn {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glow);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.track-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.track-btn-mute.active {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.6);
}

.track-btn-solo.active {
  background: #f59e0b !important;
  color: #1e1103 !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

/* Curseur volume par piste */
.track-slider-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
}

.slider-label {
  white-space: nowrap;
}

.track-slider-group input[type="range"] {
  flex: 1;
  height: 6px;
  accent-color: var(--primary);
  cursor: pointer;
}

.track-sidebar-amber .track-slider-group input[type="range"] {
  accent-color: var(--amber-jingle);
}

/* VU-Mètre voix */
.vu-meter-unit {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.vu-meter-label {
  white-space: nowrap;
}

.vu-meter-bar {
  flex: 1;
  height: 8px;
  background: #2a1b4d;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.vu-meter-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(to right, #10b981 60%, #f59e0b 85%, #f43f5e 100%);
  transition: width 0.05s linear;
}

/* Actions rapides Piste 2 (Importer, Bruitage, Vider) */
.track-actions-grid {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.btn-lane-action {
  flex: 1;
  padding: 5px 6px;
  font-size: 0.74rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.btn-lane-action:hover {
  background: rgba(245, 158, 11, 0.3);
  color: #ffffff;
  border-color: #f59e0b;
}

.btn-lane-danger {
  flex: 0 0 32px;
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
}

.btn-lane-danger:hover {
  background: rgba(244, 63, 94, 0.3);
  color: #ffffff;
  border-color: #f43f5e;
}

/* Auto-Ducking */
.ducking-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #fef3c7;
  cursor: pointer;
  background: rgba(245, 158, 11, 0.12);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  margin-top: 2px;
}

.ducking-checkbox-label input[type="checkbox"] {
  accent-color: var(--amber-jingle);
  cursor: pointer;
}

/* Couloirs de pistes (Lane Area) */
.track-lane-wrapper {
  flex: 1;
  position: relative;
  background: #0c071a;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.45) #0c071a;
  cursor: crosshair;
  min-height: 128px;
  display: flex;
  flex-direction: column;
}

.track-row-voice .track-lane-wrapper {
  scrollbar-width: none;
}

.track-row-voice .track-lane-wrapper::-webkit-scrollbar {
  display: none;
}

.track-row-music .track-lane-wrapper {
  background: #0f081f;
}

/* Canvas des formes d'onde */
.waveform-canvas {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 128px;
  background: transparent;
  touch-action: none;
}

/* Curseur de lecture vertical (Cyan néon éclatant) */
.playback-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--cyan-neon);
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.95);
}

.playback-cursor::after {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  width: 12px;
  height: 10px;
  background: var(--cyan-neon);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.playback-cursor-2::after {
  display: none; /* Le triangle supérieur n'apparaît que sur la piste du haut */
}

/* Pilule d'actions flottante contextuelle au-dessus de la sélection */
.selection-action-pill {
  position: absolute;
  top: 12px;
  display: none;
  background: #221244;
  border: 1px solid var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-full);
  padding: 4px 8px;
  gap: 6px;
  z-index: 25;
  animation: popIn 0.15s ease-out;
}

.selection-action-pill.visible {
  display: flex;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.selection-action-pill button {
  background: none;
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.selection-action-pill button:hover {
  background: rgba(168, 85, 247, 0.35);
  color: #ffffff;
}

.selection-action-pill button.btn-cut-danger {
  color: #fca5a5;
}

.selection-action-pill button.btn-cut-danger:hover {
  background: rgba(244, 63, 94, 0.3);
  color: #ffffff;
}

/* Pilule d'actions pour le bruitage sélectionné (Piste 2) */
.clip-action-pill {
  position: absolute;
  top: 12px;
  display: none;
  background: #2b1805;
  border: 1px solid #f59e0b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75), 0 0 15px rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  gap: 6px;
  z-index: 26;
  align-items: center;
  animation: popIn 0.15s ease-out;
}

.clip-action-pill.visible {
  display: flex;
}

.clip-action-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fbbf24;
  padding: 2px 6px;
  border-right: 1px solid rgba(245, 158, 11, 0.3);
  margin-right: 2px;
}

.clip-action-pill button {
  background: none;
  border: none;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fef3c7;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.clip-action-pill button:hover {
  background: rgba(245, 158, 11, 0.35);
  color: #ffffff;
}

.clip-action-pill button.btn-cut-danger {
  color: #fca5a5;
}

.clip-action-pill button.btn-cut-danger:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
}

/* ========================================================
   COLONNE DROITE ULTRA-FINE : VU-MÈTRE VERTICAL dB
   ======================================================== */
.live-monitor-section.studio-rack-aside {
  width: 106px;
  min-width: 106px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: transparent;
  border-top: none;
}

.monitor-card {
  flex: 1;
  min-height: 0;
  background: #140b2a;
  border: 1.5px solid #2d1a52;
  border-radius: var(--radius-md);
  padding: 8px 8px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.monitor-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.monitor-title-block {
  display: flex;
  align-items: center;
  gap: 5px;
}

.monitor-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
  animation: pulseMonitorDot 1.4s infinite ease-in-out;
}

.monitor-pulse-dot.pulse-amber {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.monitor-pulse-dot.pulse-red {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: pulseMonitorDot 0.6s infinite ease-in-out;
}

@keyframes pulseMonitorDot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.monitor-title {
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.monitor-status {
  font-size: 0.64rem;
  font-weight: 700;
  color: #94a3b8;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-canvas-box {
  width: 100%;
  flex: 1;
  min-height: 200px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #080314;
}

.vumeter-canvas-box {
  border: 1.5px solid #3d246c;
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.6);
}

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

/* Barre de pied du studio (intégrée au bas du bloc multipistes) */
.studio-bottom-footer {
  background: #110924;
  padding: 7px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.footer-stats-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-stat-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-stat-box strong {
  color: #ffffff;
}

.footer-hint-center {
  font-size: 0.78rem;
  color: #c084fc;
}

.status-school-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  text-decoration: none;
  font-family: 'Fredoka', var(--font-main);
  font-size: 0.78rem;
  font-weight: 700;
  user-select: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.status-school-brand:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(192, 132, 252, 0.4);
}

.status-school-logo {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.status-school-copy {
  letter-spacing: 0.2px;
  font-weight: 700;
  color: #c084fc;
}

/* Responsive : sur écrans très étroits (< 768px) */
@media (max-width: 768px) {
  .studio-workspace-grid {
    flex-direction: column;
  }
  .live-monitor-section.studio-rack-aside {
    width: 100%;
    min-width: 100%;
  }
  .monitor-canvas-box {
    min-height: 120px;
    height: 120px;
  }
  .multitrack-row {
    flex-direction: column;
  }
  .track-sidebar {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid #28164b;
  }
  .track-sidebar-header-space {
    width: 100%;
    min-width: 100%;
  }
  .multitrack-ruler-row {
    flex-direction: column;
  }
}

/* ========================================================
   6. MODALES (JINGLES, CONSEILS, SILENCE, PWA)
   ======================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 3, 14, 0.78);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  background: #180e30;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScale 0.25s ease;
  color: #f8fafc;
}

@keyframes modalScale {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 22px;
  background: #221344;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #f5f3ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #cbd5e1;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.modal-body {
  padding: 22px;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e2e8f0;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #140b28;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Grille des jingles */
.jingles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.jingle-card {
  background: #20123d;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.jingle-card:hover {
  background: #2f1857;
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.jingle-icon {
  font-size: 2rem;
}

.jingle-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
}

.jingle-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
  width: 100%;
}

.jingle-actions button {
  width: 100%;
  padding: 5px 8px;
  font-size: 0.76rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.jingle-actions .btn-jingle-test {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

.jingle-actions .btn-jingle-test:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.jingle-actions .btn-jingle-superpose {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.jingle-actions .btn-jingle-superpose:hover {
  background: var(--amber-jingle);
  color: #1a0f02;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.jingle-actions .btn-jingle-insert {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #e9d5ff;
}

.jingle-actions .btn-jingle-insert:hover {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Grille Atelier d'Effets Vocaux & Fondus Studio */
.fx-section-title {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: #c084fc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fx-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.fx-card-btn {
  background: #20123d;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  color: #f8fafc;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.fx-card-btn:hover {
  background: #2f1857;
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.fx-card-btn.fx-card-fun {
  border-color: rgba(245, 158, 11, 0.35);
}

.fx-card-btn.fx-card-fun:hover {
  border-color: #fbbf24;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

.fx-card-icon {
  font-size: 1.7rem;
  line-height: 1.1;
}

.fx-card-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #ffffff;
}

.fx-card-sub {
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.25;
}

/* Toast de notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #20113d;
  border: 1px solid var(--primary);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* Décompte 3, 2, 1 */
.countdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 8, 28, 0.92);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 9rem;
  font-weight: 900;
  animation: countdownPulse 1s infinite alternate;
}

.countdown-overlay.active {
  display: flex;
}

@keyframes countdownPulse {
  from { transform: scale(0.9); }
  to { transform: scale(1.1); }
}

/* Responsive */
@media (max-width: 900px) {
  .aaudio-toolbar {
    gap: 8px;
    padding: 8px 12px;
  }
  .aaudio-tool-unit {
    padding-right: 8px;
  }
  .tool-btn {
    padding: 6px 10px;
    font-size: 0.82rem;
  }
  .waveform-canvas {
    height: 140px;
  }
}
