/* Evotic Edge — Karaks UX overrides (Phase 13.5.2 polish).
   Loaded AFTER karak-legacy.css. Refonte FX panel (mobile-friendly vertical layout)
   + progress bars + loading skeletons. Pas de modif du CSS legacy. */

/* ════════════════════════════════════════════════════════════════════════════
   CARD COMPACT — réduit l'espace vide (legacy réservait 220px contain-intrinsic)
   ════════════════════════════════════════════════════════════════════════════ */

.kk-card {
  /* Kill legacy content-visibility hint that reserved 220px of vertical space */
  content-visibility: visible !important;
  contain-intrinsic-size: auto !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 10px !important;
  /* Don't stretch to grid row height */
  align-self: start !important;
  display: block !important;
}

.kk-card-row {
  margin-bottom: 6px !important; /* compact spacing between cover-row and foot */
}

.kk-card-foot {
  margin-top: 0 !important;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, .04);
  min-height: 0 !important;
}

/* Tighter grid + don't auto-stretch rows */
.kk-grid {
  gap: 8px !important;
  padding: 8px 12px 100px !important;
  grid-auto-rows: min-content !important;
  align-items: start !important;
}

/* Phase 13.5.4 — fav button cache status indicators */
.kk-card-fav.caching::after {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  border: 2px solid rgba(167, 139, 250, .4);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: kkSpin .8s linear infinite;
  margin-left: 6px;
}
.kk-card-fav.cached::after {
  content: '\f019';   /* fa-download */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 8px;
  color: #10B981;
  margin-left: 4px;
  vertical-align: top;
}
.kk-card-fav.error::after {
  content: '!';
  font-size: 9px;
  color: #EF4444;
  font-weight: 900;
  margin-left: 4px;
  vertical-align: top;
}

/* ════════════════════════════════════════════════════════════════════════════
   FX PANEL — refonte mobile-first
   ════════════════════════════════════════════════════════════════════════════ */

#kk-pl-fx {
  display: block !important;
  width: 100%;
  margin: 8px 0;
  background: linear-gradient(180deg, rgba(15, 6, 32, .6), rgba(20, 8, 40, .85));
  border: 1px solid rgba(167, 139, 250, .18);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

.kk-fx-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(167, 139, 250, .12), rgba(236, 72, 153, .08));
  border: 0;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .3px;
  cursor: pointer;
  transition: background .2s;
}

.kk-fx-toggle:active { background: rgba(167, 139, 250, .2); }
.kk-fx-toggle > i:first-child { color: #a78bfa; margin-right: 8px; font-size: 14px; }
.kk-fx-toggle > .kk-fx-chev { color: rgba(255, 255, 255, .6); font-size: 12px; transition: transform .2s; }

.kk-fx-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 45vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Critical: respect HTML `hidden` attribute against class-selector specificity */
.kk-fx-body[hidden],
[hidden] { display: none !important; }

.kk-fx-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kk-fx-row > label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, .85);
  letter-spacing: .3px;
}

.kk-fx-row > label .kk-fx-val {
  font-size: 11px;
  font-weight: 800;
  color: #ec4899;
  font-variant-numeric: tabular-nums;
  background: rgba(236, 72, 153, .12);
  padding: 2px 8px;
  border-radius: 6px;
  min-width: 42px;
  text-align: center;
}

.kk-fx-row > input[type="range"] {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, .08);
  border-radius: 6px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}

.kk-fx-row > input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  border: 2px solid rgba(20, 8, 40, .9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  cursor: pointer;
}
.kk-fx-row > input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  border: 2px solid rgba(20, 8, 40, .9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  cursor: pointer;
}

.kk-fx-row > select {
  width: 100%;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(167, 139, 250, .25);
  color: #fff;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Sub-grouping headers inside FX panel */
.kk-vp-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.kk-vp-row::-webkit-scrollbar { display: none; }
.kk-vp-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 58px; padding: 8px 6px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 1.5px solid transparent; color: #fff;
  transition: border-color .15s, background .15s;
}
.kk-vp-chip .kk-vp-emoji { font-size: 22px; line-height: 1; }
.kk-vp-chip .kk-vp-name { font-size: 11px; opacity: .85; white-space: nowrap; }
.kk-vp-chip.on { border-color: #A78BFA; background: rgba(167,139,250,.18); }
.kk-vp-chip.on .kk-vp-name { opacity: 1; font-weight: 700; }

.kk-fx-section {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: rgba(167, 139, 250, .8);
  margin-bottom: -4px;
  text-transform: uppercase;
}

/* Hide the legacy `display:flex` rule when FX active during recording — we manage display ourselves now */
#kk-player.recording #kk-pl-fx { display: block !important; }

/* ════════════════════════════════════════════════════════════════════════════
   PROGRESS BAR (indeterminate + determinate)
   ════════════════════════════════════════════════════════════════════════════ */

.kk-progress {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, .08);
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
}

.kk-progress-bar {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: linear-gradient(90deg, #a78bfa, #ec4899);
  border-radius: 4px;
  transition: width .25s ease-out;
  width: 0;
  box-shadow: 0 0 8px rgba(236, 72, 153, .5);
}

/* Indeterminate: shimmer animation */
.kk-progress.indeterminate .kk-progress-bar {
  width: 35% !important;
  animation: kkShimmer 1.2s ease-in-out infinite;
}

@keyframes kkShimmer {
  0%   { left: -35%; }
  100% { left: 100%; }
}

/* Loading container: spinner + label + optional progress */
.kk-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 16px;
  color: rgba(255, 255, 255, .7);
}

.kk-loading-state .kk-spinner-ring {
  width: 36px; height: 36px;
  border: 3px solid rgba(167, 139, 250, .2);
  border-top-color: #a78bfa;
  border-right-color: #ec4899;
  border-radius: 50%;
  animation: kkSpin .8s linear infinite;
}

.kk-loading-state .kk-loading-msg {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .3px;
}

.kk-loading-state .kk-progress {
  max-width: 240px;
}

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

/* Inline rec status with progress bar (shown under player controls during upload) */
#kk-pl-rec-status {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 4px 0;
  min-height: 18px;
  color: rgba(255, 255, 255, .85);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#kk-pl-rec-status .kk-progress { max-width: 200px; }

/* Import modal status with progress */
#kk-imp-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}

#kk-imp-status .kk-progress { max-width: 240px; }

#kk-imp-submit {
  position: relative;
}

#kk-imp-submit.loading::before {
  content: '';
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: kkSpin .8s linear infinite;
}

/* ════════════════════════════════════════════════════════════════════════════
   PERF ROW polish (sheet + comments + actions)
   ════════════════════════════════════════════════════════════════════════════ */

.kk-perf-row-x {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  padding: 12px !important;
  background: rgba(255, 255, 255, .03);
  border-radius: 12px;
  margin-bottom: 8px;
}

.kk-perf-row-x .kk-perf-head {
  display: flex; align-items: center; gap: 10px;
}

.kk-perf-row-x .kk-perf-info { flex: 1; min-width: 0; }
.kk-perf-row-x .kk-perf-title { font-size: 13px; font-weight: 800; color: #fff; }
.kk-perf-row-x .kk-perf-meta { font-size: 10.5px; color: rgba(255, 255, 255, .55); margin-top: 2px; }
.kk-perf-row-x .kk-sh-audio { width: 100%; height: 36px; }
/* Sprint H 2026-05-22 — perf vidéo : aspect 9:16 cappé, background dark */
.kk-perf-row-x .kk-sh-video {
  width: 100%;
  max-height: 480px;
  background: #000;
  border-radius: 10px;
  display: block;
}

.kk-perf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.kk-like-btn, .kk-comment-btn, .kk-opencall-btn, .kk-join-btn {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .85);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .2s, transform .1s;
}

.kk-like-btn:active, .kk-comment-btn:active, .kk-opencall-btn:active, .kk-join-btn:active { transform: scale(.96); }
.kk-like-btn.liked { color: #EF4444; border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .08); }
.kk-opencall-btn.on { color: #10B981; border-color: rgba(16, 185, 129, .35); background: rgba(16, 185, 129, .08); }
.kk-join-btn { color: #fff; background: linear-gradient(135deg, #a78bfa, #ec4899); border-color: transparent; }

.kk-badge-oc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(167, 139, 250, .25), rgba(236, 72, 153, .2));
  color: #c4b5fd;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 4px;
}

.kk-perf-collabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, .5);
  margin-left: 4px;
}

/* ════════════════════════════════════════════════════════════════════════════
   COMMENTS panel polish
   ════════════════════════════════════════════════════════════════════════════ */

.kk-cm-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
}

.kk-cm-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 12px;
  flex-shrink: 0;
}
.kk-cm-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.kk-cm-bubble {
  flex: 1;
  background: rgba(255, 255, 255, .04);
  border-radius: 12px;
  padding: 8px 12px;
}

.kk-cm-pseudo {
  font-size: 11px;
  font-weight: 800;
  color: #c4b5fd;
  margin-bottom: 2px;
}
.kk-cm-time { color: rgba(255, 255, 255, .4); font-weight: 600; margin-left: 4px; font-size: 10px; }
.kk-cm-text { font-size: 13px; color: rgba(255, 255, 255, .9); line-height: 1.4; word-break: break-word; }

/* ════════════════════════════════════════════════════════════════════════════
   LRC current line styling (overrides legacy)
   ════════════════════════════════════════════════════════════════════════════ */

.kk-lrc-line {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, .4);
  line-height: 1.6;
  text-align: center;
  padding: 4px 0;
  transition: color .25s, transform .25s;
}

.kk-lrc-line.current {
  color: #fff;
  text-shadow: 0 2px 12px rgba(236, 72, 153, .55);
  transform: scale(1.05);
  font-weight: 900;
}

.kk-lrc-empty {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, .4);
  padding: 20px;
  font-style: italic;
}
/* ════════════════════════════════════════════════════════════════════════
   Karaks Audacity-style editor (refonte 2026-05-22)
   Drag horizontal sur la piste voix pour caler la phase. 2 waveforms réels
   décodés côté client. Timeline avec graduations secondes. Playhead pendant
   playback.
   ════════════════════════════════════════════════════════════════════════ */
.kk-mix-voice-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.5px;
  margin: 0 2px;
}

.kk-mix-editor {
  position: relative;
  background: rgba(10, 6, 26, 0.6);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 10px;
  padding: 8px 6px 14px;
  margin: 10px 0 12px;
  overflow: hidden;
  min-height: 180px;
}

.kk-mix-loading {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  padding: 50px 16px;
}

.kk-mix-timeline {
  position: relative;
  height: 18px;
  margin-bottom: 2px;
  padding: 0 0 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.kk-mix-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 5px;
  background: rgba(255, 255, 255, 0.18);
}
.kk-mix-tick.major {
  height: 10px;
  background: rgba(255, 255, 255, 0.35);
}
.kk-mix-tick-label {
  position: absolute;
  bottom: 12px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.45);
  transform: translateX(-50%);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.kk-mix-track {
  position: relative;
  height: 68px;
  padding-left: 50px;
  margin: 6px 0;
  overflow: hidden;
}
.kk-mix-track-label {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 3px 6px;
  border-radius: 4px;
  z-index: 2;
}
.kk-mix-track-voice {
  background: rgba(34, 211, 238, 0.06);
  border: 1px dashed rgba(34, 211, 238, 0.3);
  border-radius: 6px;
}
.kk-mix-track-voice .kk-mix-track-label {
  background: rgba(34, 211, 238, 0.2);
  color: #67e8f9;
}
.kk-mix-track-backing {
  background: rgba(167, 139, 250, 0.06);
  border: 1px dashed rgba(167, 139, 250, 0.3);
  border-radius: 6px;
}
.kk-mix-track-backing .kk-mix-track-label {
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
}

.kk-mix-canvas {
  display: block;
  width: 100%;
  height: 64px;
  cursor: grab;
  touch-action: none;
  transition: none;
}
.kk-mix-canvas:active { cursor: grabbing; }
.kk-mix-track-backing .kk-mix-canvas {
  cursor: default;
}

.kk-mix-playhead {
  position: absolute;
  top: 22px;
  bottom: 28px;
  width: 2px;
  margin-left: 50px;
  background: #6750A4;
  box-shadow: 0 0 6px rgba(103, 80, 164, 0.7);
  pointer-events: none;
  z-index: 3;
}
.kk-mix-playhead::before, .kk-mix-playhead::after {
  content: '';
  position: absolute;
  left: -3px;
  width: 8px; height: 8px;
  background: #6750A4;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(103, 80, 164, 0.9);
}
.kk-mix-playhead::before { top: -4px; }
.kk-mix-playhead::after  { bottom: -4px; }

.kk-mix-drag-hint {
  text-align: center;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 6px;
  font-style: italic;
}

.kk-mix-offset-readout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(167, 139, 250, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(167, 139, 250, 0.2);
}
.kk-mix-offset-label-l {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.kk-mix-offset-readout .kk-mix-offset-val {
  font-size: 18px;
  font-weight: 800;
  color: #c4b5fd;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  min-width: 80px;
  text-align: center;
}
.kk-mix-reset {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 100ms ease, color 100ms ease;
}
.kk-mix-reset:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.kk-mix-reset:active { transform: scale(.92); }

/* Cache l'ancien slider s'il était présent (legacy markup) */
.kk-mix-offset-range { display: none !important; }
.kk-mix-offset-hint { display: none !important; }
.kk-mix-offset { display: none !important; }

/* Phase A1 2026-05-22 — Volume mixer voix/instru (pattern Smule) */
.kk-mix-vol-row {
  display: flex;
  gap: 16px;
  margin: 0 0 14px;
  padding: 12px;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 10px;
}
.kk-mix-vol-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kk-mix-vol-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kk-mix-vol-label i { color: rgba(167, 139, 250, 0.9); font-size: 12px; }
.kk-mix-vol-label span {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #c4b5fd;
  font-weight: 800;
  font-size: 12px;
}
.kk-mix-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}
.kk-mix-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  cursor: grab;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.kk-mix-vol-slider.voice::-webkit-slider-thumb { background: #22d3ee; }
.kk-mix-vol-slider.backing::-webkit-slider-thumb { background: #a78bfa; }
.kk-mix-vol-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: grab;
}
.kk-mix-vol-slider.voice::-moz-range-thumb { background: #22d3ee; }
.kk-mix-vol-slider.backing::-moz-range-thumb { background: #a78bfa; }


/* Phase B 2026-05-22 — Polish studio toggle (auto compressor + EQ + reverb) */
.kk-mix-polish-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(167, 139, 250, 0.12));
  border: 1px solid rgba(236, 72, 153, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.kk-mix-polish-row:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(167, 139, 250, 0.18));
  border-color: rgba(236, 72, 153, 0.45);
}
.kk-mix-polish-row input[type="checkbox"] {
  width: 22px; height: 22px;
  accent-color: #ec4899;
  cursor: pointer;
  flex-shrink: 0;
}
.kk-mix-polish-text {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  gap: 2px;
  line-height: 1.2;
}
.kk-mix-polish-text i {
  color: #ec4899;
  margin-right: 6px;
}
.kk-mix-polish-sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-transform: none;
  letter-spacing: 0;
}

/* ════════════════════════════════════════════════════════════════════════
   Karaks Mix Preview Panel (Phase Karaks Mix 2026-05-21)
   Post-recording UI: offset slider, listen preview, Publier/Refaire.
   ════════════════════════════════════════════════════════════════════════ */
.kk-mix-preview {
  position: fixed; inset: 0;
  background: rgba(10, 6, 26, .82);
  backdrop-filter: blur(8px);
  z-index: 9100;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .18s ease-out;
  padding: 12px;
}
.kk-mix-preview.on { opacity: 1; }
@media (min-width: 640px) {
  .kk-mix-preview { align-items: center; }
}
.kk-mix-card {
  background: linear-gradient(180deg, #2a1850 0%, #1a0b2e 100%);
  background-color: #1a0b2e; /* fallback if gradient fails */
  color: #fff;
  border-radius: 20px 20px 12px 12px;
  padding: 22px 20px 18px;
  width: 100%; max-width: 480px;
  /* Defensive : on small mobile, prevent card overflowing screen and clipping
     the action buttons at the bottom. 92vh + scroll = always reach Publier. */
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -8px 28px rgba(167, 139, 250, .25);
  border: 1px solid rgba(167, 139, 250, .25);
  transform: translateY(20px);
  transition: transform .22s cubic-bezier(.25,.8,.3,1);
}
.kk-mix-preview.on .kk-mix-card { transform: translateY(0); }
.kk-mix-title {
  margin: 0 0 6px;
  font-size: 18px; font-weight: 900;
  background: linear-gradient(90deg, #a78bfa, #ec4899);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex; align-items: center; gap: 8px;
}
.kk-mix-title i { color: #a78bfa; -webkit-text-fill-color: #a78bfa; }
.kk-mix-help {
  margin: 0 0 16px;
  font-size: 13px; color: rgba(255,255,255,.7); line-height: 1.45;
}
.kk-mix-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.kk-mix-btn-play, .kk-mix-btn-stop {
  background: rgba(167, 139, 250, .15);
  color: #fff;
  border: 1px solid rgba(167, 139, 250, .35);
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 14px; font-weight: 800; font-family: inherit;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.kk-mix-btn-stop {
  background: rgba(236, 72, 153, .2);
  border-color: rgba(236, 72, 153, .45);
}
.kk-mix-btn-play:active, .kk-mix-btn-stop:active { transform: scale(.96); }
.kk-mix-offset { margin: 8px 0 16px; }
.kk-mix-offset-label {
  display: block; font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,.85); margin-bottom: 8px;
}
.kk-mix-offset-val {
  display: inline-block; min-width: 48px; text-align: right;
  font-variant-numeric: tabular-nums; color: #ec4899;
}
.kk-mix-offset-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: linear-gradient(90deg, rgba(167,139,250,.2), rgba(236,72,153,.5), rgba(167,139,250,.2));
  border-radius: 999px; outline: none;
  cursor: pointer;
}
.kk-mix-offset-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  cursor: pointer;
}
.kk-mix-offset-range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  cursor: pointer;
}
.kk-mix-offset-hint {
  margin-top: 6px;
  font-size: 11px; color: rgba(255,255,255,.5); text-align: center;
}
.kk-mix-status {
  font-size: 13px; color: rgba(167, 139, 250, .9);
  padding: 8px 10px; margin: 0 0 12px;
  background: rgba(167, 139, 250, .08);
  border-radius: 8px; border: 1px solid rgba(167, 139, 250, .2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.kk-mix-actions { display: flex; gap: 10px; }
.kk-mix-cancel, .kk-mix-publish {
  flex: 1;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px; font-weight: 800; font-family: inherit;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none;
}
.kk-mix-cancel {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.15);
}
.kk-mix-publish {
  background: #ec4899; /* solid fallback first — visible if gradient fails on old Android WebView */
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(236, 72, 153, .3);
}
.kk-mix-publish:not(:disabled) {
  /* Belt-and-suspenders : force vibrant state when not disabled, in case some
     parent CSS sneaks an opacity rule onto buttons inside overlays. */
  opacity: 1;
  cursor: pointer;
}
.kk-mix-publish:disabled {
  opacity: .55; cursor: not-allowed; box-shadow: none;
}
.kk-mix-cancel:active, .kk-mix-publish:active { transform: scale(.97); }

/* ════════════════════════════════════════════════════════════════════════
   Phase B 2026-05-22 — Polish design des boutons + card mix preview
   Le design d'origine paraissait basique sur device-réel (boutons text-only,
   pas assez d'épaisseur). Refonte avec gradients, ombres, et hiérarchie
   visuelle plus marquée. Override les styles déplacés depuis karaks.css.
   ════════════════════════════════════════════════════════════════════════ */

/* Card : plus de présence, plus de respiration */
.kk-mix-card {
  background: linear-gradient(180deg, #2a1850 0%, #150823 100%) !important;
  border: 1px solid rgba(167, 139, 250, 0.35) !important;
  border-radius: 22px !important;
  padding: 24px 22px 22px !important;
  max-width: 540px !important;
  width: 100% !important;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 -8px 32px rgba(236, 72, 153, 0.15) inset !important;
}

.kk-mix-title {
  font-size: 20px !important;
  font-weight: 900 !important;
  margin: 0 0 4px !important;
  letter-spacing: -0.3px;
}
.kk-mix-help {
  font-size: 13px !important;
  color: rgba(255, 255, 255, 0.65) !important;
  margin: 0 0 16px !important;
  line-height: 1.45;
}

/* ─── Bouton Écouter (vert moderne, gros, central) ─── */
.kk-mix-btn-play {
  display: inline-flex !important;
  align-items: center; justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px !important;
  border: none !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: #fff !important;
  font-family: inherit;
  font-size: 15px !important;
  font-weight: 800 !important;
  cursor: pointer;
  box-shadow:
    0 6px 18px rgba(34, 197, 94, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
  letter-spacing: 0.3px;
}
.kk-mix-btn-play:hover {
  background: linear-gradient(135deg, #26d066 0%, #18b350 100%) !important;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.45);
}
.kk-mix-btn-play:active { transform: scale(.97); }
.kk-mix-btn-play i { font-size: 18px; }

/* ─── Bouton Stop (rouge moderne) ─── */
.kk-mix-btn-stop {
  display: inline-flex !important;
  align-items: center; justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px !important;
  border: none !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #fff !important;
  font-family: inherit;
  font-size: 15px !important;
  font-weight: 800 !important;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
  transition: transform .12s ease;
}
.kk-mix-btn-stop:active { transform: scale(.97); }

.kk-mix-row {
  margin: 0 0 14px !important;
}

/* ─── Footer actions : Refaire + Publier ─── */
.kk-mix-actions {
  display: flex !important;
  gap: 12px !important;
  margin-top: 4px;
}

/* Refaire : ghost button, subtle */
.kk-mix-cancel {
  flex: 1 !important;
  padding: 14px 18px !important;
  border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  font-family: inherit;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .1s ease;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
}
.kk-mix-cancel:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}
.kk-mix-cancel:active { transform: scale(.97); }

/* Publier : gros, gradient orange/rose, l'action principale */
.kk-mix-publish {
  flex: 2 !important;
  padding: 14px 22px !important;
  border: none !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #6750A4 0%, #ec4899 100%) !important;
  color: #fff !important;
  font-family: inherit;
  font-size: 15px !important;
  font-weight: 900 !important;
  cursor: pointer;
  display: inline-flex !important; align-items: center; justify-content: center;
  gap: 10px !important;
  box-shadow:
    0 8px 24px rgba(236, 72, 153, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: transform .12s ease, box-shadow .15s ease;
  letter-spacing: 0.3px;
}
.kk-mix-publish:hover:not(:disabled) {
  box-shadow: 0 10px 32px rgba(236, 72, 153, 0.55);
}
.kk-mix-publish:active:not(:disabled) { transform: scale(.97); }
.kk-mix-publish:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed;
  box-shadow: none !important;
}
.kk-mix-publish i { font-size: 16px; }

/* Status pendant upload : monospace, plus visible */
.kk-mix-status {
  margin: 12px 0 !important;
  padding: 12px 14px !important;
  background: rgba(34, 197, 94, 0.1) !important;
  border: 1px solid rgba(34, 197, 94, 0.25) !important;
  border-radius: 10px !important;
  color: #86efac !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   Sprint H 2026-05-22 — Mode vidéo karaoke
   - Toggle dans le header (#kk-pl-video-toggle)
   - Overlay stage : caméra live + lyrics overlay durant rec
   - Player post-record : <video> au lieu de waveform voix
   ═══════════════════════════════════════════════════════════════════════ */
#kk-pl-video-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
#kk-pl-video-toggle:hover { background: rgba(255, 255, 255, 0.14); }
#kk-pl-video-toggle.on {
  background: linear-gradient(135deg, #FF1744 0%, #6750A4 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 12px rgba(255, 23, 68, 0.55);
}

/* Sprint H PR10 (Smule-style) — Overlay vidéo plein écran sous le header.
   Les contrôles flottent au-dessus en bas, le panel FX devient une sheet
   slide-up au-dessus de la vidéo (z-index gardé propre).
   Précédente version (PR4 contenu 9:16) abandonnée car le FX panel se
   retrouvait masqué quand il s'expand. */
#kk-pl-video-stage {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  display: none;
  z-index: 2;
  overflow: hidden;
}
#kk-pl-video-stage.on { display: block; }
#kk-pl-video-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  /* Caméra avant : effet miroir pour que le user se voie "naturellement" */
  transform: scaleX(-1);
}
/* En playback (post-record), pas de miroir — on regarde son propre enregistrement */
#kk-pl-video-stage.playback video {
  transform: none;
}
/* Dégradé en bas pour lisibilité des contrôles flottants par-dessus la vidéo */
#kk-pl-video-stage.on::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 220px;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Overlay paroles TikTok-style — fonts ajustées au cadre contenu */
#kk-pl-video-lyrics {
  position: absolute;
  left: 0; right: 0;
  bottom: 12%;
  text-align: center;
  padding: 0 12px;
  pointer-events: none;
  color: #fff;
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 800;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9), 0 0 14px rgba(0,0,0,0.6);
  z-index: 6;
}
#kk-pl-video-lyrics .kk-vl-prev,
#kk-pl-video-lyrics .kk-vl-next {
  font-size: 12px;
  opacity: 0.55;
  line-height: 1.3;
  min-height: 16px;
  margin: 3px 0;
}
#kk-pl-video-lyrics .kk-vl-cur {
  font-size: 18px;
  line-height: 1.2;
  color: #fff;
  margin: 5px 0;
  letter-spacing: 0.2px;
  min-height: 22px;
}
@media (min-width: 600px) {
  #kk-pl-video-lyrics .kk-vl-cur { font-size: 22px; }
  #kk-pl-video-lyrics .kk-vl-prev,
  #kk-pl-video-lyrics .kk-vl-next { font-size: 14px; }
}

/* Bouton fermer overlay (post-record uniquement) */
#kk-pl-video-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  z-index: 7;
}
#kk-pl-video-stage.playback #kk-pl-video-close { display: inline-flex; }

/* Pendant rec en mode vidéo : marqueur rouge pulsant */
#kk-pl-video-stage.recording::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #FF1744;
  box-shadow: 0 0 12px rgba(255,23,68,0.85);
  z-index: 7;
  animation: kk-vl-pulse 1.2s ease-in-out infinite;
}
@keyframes kk-vl-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* Sprint H PR10 — Smule layout : quand le video stage est ON (rec OU playback),
   on masque avatar/waveform/lyrics-inline, et on bascule la foot en bottom-sheet
   flottante par-dessus la vidéo. */
#kk-player.video-mode.recording #kk-pl-waves,
#kk-player.video-mode.recording #kk-pl-avatar-wrap,
#kk-player.video-mode.recording #kk-pl-lyrics-wrap,
#kk-player.video-mode.video-playback #kk-pl-waves,
#kk-player.video-mode.video-playback #kk-pl-avatar-wrap,
#kk-player.video-mode.video-playback #kk-pl-lyrics-wrap {
  display: none !important;
}

/* Foot bascule en bottom-sheet flottant quand video stage actif.
   Z-index 10 > video stage (z-index 2) : controles + FX toujours accessibles. */
#kk-player.video-mode.recording #kk-pl-foot,
#kk-player.video-mode.video-playback #kk-pl-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  padding: 10px 12px max(env(safe-area-inset-bottom), 14px);
  background: linear-gradient(180deg, transparent 0%, rgba(15,6,32,0.55) 30%, rgba(15,6,32,0.92) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* En mode vidéo : FX panel devient un bottom-sheet slide-up au-dessus de la vidéo.
   Quand le body est expanded (pas hidden), le toggle reste au bottom et le body
   se déploie vers le HAUT (z-index 11, max-height 50vh, scrollable). */
#kk-player.video-mode.recording #kk-pl-fx .kk-fx-body:not([hidden]),
#kk-player.video-mode.video-playback #kk-pl-fx .kk-fx-body:not([hidden]) {
  position: absolute;
  left: 0; right: 0;
  bottom: 100%; /* juste au-dessus du toggle */
  z-index: 11;
  max-height: 50vh;
  background: linear-gradient(180deg, rgba(20, 8, 40, 0.96) 0%, rgba(15, 6, 32, 0.98) 100%);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.55);
  animation: kkFxSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes kkFxSlideUp {
  from { transform: translateY(10%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
/* En mode vidéo, la box FX (toggle + body) doit être en position relative
   pour que le body absolute pointe vers le HAUT du toggle */
#kk-player.video-mode.recording #kk-pl-fx,
#kk-player.video-mode.video-playback #kk-pl-fx {
  position: relative;
}
/* Sliders de volume en mode video : compactés pour réduire l'encombrement */
#kk-player.video-mode.recording #kk-pl-vol,
#kk-player.video-mode.video-playback #kk-pl-vol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px 0;
}
#kk-player.video-mode.recording #kk-pl-vol .kk-vol,
#kk-player.video-mode.video-playback #kk-pl-vol .kk-vol {
  font-size: 11px;
}

/* Filtre Audio/Vidéo/Tout dans le catalog */
.kk-media-filter {
  display: inline-flex;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 22px;
  padding: 3px;
  gap: 2px;
  margin-left: 8px;
  vertical-align: middle;
}
.kk-media-filter button {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.7);
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.kk-media-filter button:hover { color: #fff; }
.kk-media-filter button.on {
  background: linear-gradient(135deg, #6750A4 0%, #FF1744 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255,23,68,0.45);
}

/* Icône "vidéo" sur les cartes perfs vidéo */
.kk-perf-card.has-video .kk-perf-thumb::after,
.kk-perf-row.has-video::before {
  content: '\f03d'; /* fa-video */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 10px;
}

/* Sprint H PR4 — Audio/Vidéo toggle dans mode picker */
.kk-media-pick {
  display: flex;
  gap: 8px;
  margin: 14px 0 16px;
  padding: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
}
.kk-media-pick-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.7);
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.kk-media-pick-btn:hover { color: #fff; background: rgba(255,255,255,0.04); }
.kk-media-pick-btn.on {
  background: linear-gradient(135deg, #6750A4 0%, #FF1744 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,23,68,0.45);
}
.kk-media-pick-btn i { font-size: 16px; }

/* Sprint H PR4 — Upload progress overlay (vidéo + audio) */
#kk-upload-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#kk-upload-overlay.on { display: flex; }
#kk-upload-overlay .kk-up-box {
  background: linear-gradient(180deg, #1a0b2e 0%, #150622 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
#kk-upload-overlay .kk-up-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border: 4px solid rgba(255,255,255,0.12);
  border-top-color: #FF1744;
  border-right-color: #6750A4;
  border-radius: 50%;
  animation: kk-up-spin 0.9s linear infinite;
}
@keyframes kk-up-spin {
  to { transform: rotate(360deg); }
}
#kk-upload-overlay .kk-up-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}
#kk-upload-overlay .kk-up-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 14px;
  min-height: 18px;
}
#kk-upload-overlay .kk-up-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
#kk-upload-overlay .kk-up-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6750A4 0%, #FF1744 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}
#kk-upload-overlay .kk-up-bar-fill.indeterminate {
  width: 35%;
  animation: kk-up-bar-slide 1.4s ease-in-out infinite;
}
@keyframes kk-up-bar-slide {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(150%); }
  100% { transform: translateX(450%); }
}

/* ═══════════════════════════════════════════════════════════════════════
   Sprint H PR11 2026-05-22 — LRC alignment modal (user upload)
   ═══════════════════════════════════════════════════════════════════════ */

.kk-imp-align-btn {
  background: linear-gradient(135deg, #6750A4 0%, #FF1744 100%) !important;
  color: #fff !important;
}

#kk-align-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}
#kk-align-modal.on { display: flex; }
.kk-align-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 0, 20, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.kk-align-box {
  position: relative;
  width: min(94vw, 720px);
  max-height: 92vh;
  background: linear-gradient(180deg, #1a0b2e 0%, #150622 100%);
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  overflow: hidden;
}
.kk-align-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.kk-align-hdr h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  display: flex; align-items: center; gap: 10px;
}
.kk-align-hdr h3 i { color: #6750A4; }
.kk-align-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.kk-align-close:hover { background: rgba(255,255,255,0.12); color: #fff; }
.kk-align-body {
  padding: 14px 18px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kk-align-hint {
  margin: 0;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}
.kk-align-hint strong { color: #7F67BE; }
#kk-align-audio {
  width: 100%;
  border-radius: 20px;
}
.kk-align-live {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  min-height: 48px;
}
.kk-align-tools {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.kk-align-btn {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s, transform 0.1s;
}
.kk-align-btn:hover { background: rgba(255,255,255,0.12); }
.kk-align-btn:active { transform: scale(0.96); }
.kk-align-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.kk-align-btn-on {
  background: linear-gradient(135deg, #DC2626, #EF4444) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(220,38,38,0.35);
}
.kk-align-btn-primary {
  background: linear-gradient(135deg, #6750A4 0%, #FF1744 100%) !important;
  border-color: transparent !important;
}
.kk-align-btn-secondary {
  background: transparent !important;
  border-color: rgba(255,255,255,0.18) !important;
}
.kk-align-full { width: 100%; justify-content: center; }

.kk-align-banner {
  background: linear-gradient(135deg, rgba(103, 80, 164, 0.18), rgba(255, 23, 68, 0.12));
  border: 1px solid rgba(103, 80, 164, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: #FED7AA;
  display: flex; flex-direction: column; gap: 4px;
}
.kk-align-banner strong { color: #fff; }
.kk-align-banner kbd {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
}
.kk-align-banner strong i { animation: kkAlignBlink 1s ease-in-out infinite; color: #DC2626; }
@keyframes kkAlignBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.kk-align-next {
  background: rgba(0,0,0,0.3);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
}

.kk-align-offset {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.kk-align-offset-row {
  display: flex; justify-content: space-between; align-items: center;
}
.kk-align-offset-lbl { font-size: 12px; color: rgba(255,255,255,0.7); font-weight: 700; }
.kk-align-offset-val { font-size: 12px; color: #7F67BE; font-weight: 800; font-variant-numeric: tabular-nums; }
#kk-align-offset-input { width: 100%; accent-color: #6750A4; }

.kk-align-list {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}
.kk-align-list:empty::before {
  content: 'Aucune ligne synchronisée';
  display: block;
  padding: 20px;
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  font-style: italic;
}
.kk-align-row {
  display: flex; gap: 4px; align-items: center;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.kk-align-row:last-child { border-bottom: none; }
.kk-align-row:hover { background: rgba(255,255,255,0.04); }
.kk-align-row-tap {
  background: rgba(251, 146, 60, 0.15) !important;
  outline: 1.5px solid #FB923C;
}
.kk-align-row-playing {
  background: rgba(59, 130, 246, 0.18) !important;
}
.kk-align-num {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4);
  min-width: 22px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.kk-align-row button {
  padding: 4px 8px;
  font-size: 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.kk-align-row button:hover { background: rgba(255,255,255,0.12); color: #fff; }
.kk-align-mark {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #6EE7B7 !important;
}
.kk-align-mark:hover {
  background: linear-gradient(135deg, #10B981, #059669) !important;
  color: #fff !important;
}
.kk-align-row input[type="text"] {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 12px;
}
.kk-align-row input[type="text"]:focus {
  outline: none;
  border-color: #6750A4;
  box-shadow: 0 0 0 2px rgba(103, 80, 164,0.18);
}
.kk-align-stamp {
  width: 70px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  text-align: center;
  font-weight: 600;
}
.kk-align-text { flex: 1; min-width: 0; }

.kk-align-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Toast spécifique "tourne ton telephone" */
.kk-orientation-hint {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 18px 22px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  z-index: 10000;
  box-shadow: 0 12px 36px rgba(0,0,0,0.55);
}
.kk-orientation-hint i { font-size: 32px; display: block; margin-bottom: 8px; color: #6750A4; }
