/* ============================================================
   DJ Sync — Refonte « Studio »
   Thème SOMBRE pro · vert menthe (primaire) + violet (accent)
   Space Grotesk (titres/UI) + JetBrains Mono (numéros/labels)
   ============================================================ */

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

:root {
  /* ███ ACCENTS ███ */
  --mint:        #2FE6A0;   /* primaire — actions, succès */
  --mint-2:      #7CF3C4;   /* highlight clair */
  --mint-deep:   #14B47B;
  --mint-soft:   rgba(47,230,160,.14);

  --brand:       #B255CA;   /* violet — logo, progression, accent secondaire */
  --brand-2:     #D183E2;
  --brand-deep:  #8E3AA8;
  --violet-soft: rgba(178,85,202,.16);

  /* Fonds & surfaces */
  --bg:         #070B0C;
  --surface:    #0C1213;
  --surface-2:  #101819;
  --surface-3:  #16201F;

  /* Encre / texte */
  --ink:        #ECF2F0;
  --ink-2:      #8C9B97;
  --ink-3:      #5A6B67;

  /* Bannière dépendances */
  --dep-bg:     rgba(255,138,91,.12);
  --dep-border: rgba(255,138,91,.35);

  /* Lignes */
  --line:       #1B2524;
  --line-2:     #28332F;

  /* Couleurs d'appoint (covers playlists — gardées vivantes mais maîtrisées) */
  --pink:       #FF6FA5;  --pink-soft:  rgba(255,111,165,.14);
  --coral:      #FF8359;  --coral-soft: rgba(255,131,89,.14);
  --yellow:     #FFCB5C;  --yellow-soft:rgba(255,203,92,.14);
  --sky:        #5BB5FF;  --sky-soft:   rgba(91,181,255,.14);
  --violet:     var(--brand);

  /* Marques sources */
  --spotify:    #1DB954;  --spotify-soft:rgba(29,185,84,.14);
  --soundcloud: #FF5500;  --soundcloud-soft:rgba(255,85,0,.14);

  /* Rayons — plus serrés = plus pro */
  --r-xl: 20px; --r-lg: 16px; --r: 13px; --r-sm: 10px; --pill: 999px;

  /* Ombres + glows */
  --sh-sm: 0 4px 14px -6px rgba(0,0,0,.6);
  --sh:    0 16px 38px -16px rgba(0,0,0,.7);
  --sh-lg: 0 36px 80px -28px rgba(0,0,0,.85);
  --glow-mint:  0 0 26px -2px rgba(47,230,160,.5);
  --glow-brand: 0 0 26px -2px rgba(178,85,202,.5);

  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 26px;
  background:
    radial-gradient(46% 50% at 8% 4%,   rgba(47,230,160,.16), transparent 68%),
    radial-gradient(50% 55% at 96% 100%, rgba(178,85,202,.20), transparent 70%),
    var(--bg);
  overflow: hidden;
}

/* Grille technique de fond (très subtile) */
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 54px 54px; mask-image: radial-gradient(80% 80% at 50% 40%, #000, transparent); }
.ambient .bubble { display: none; }

/* ============================================================
   FENÊTRE APP
   ============================================================ */
.window {
  position: relative; z-index: 1;
  width: 1180px; max-width: 100%;
  height: 760px; max-height: calc(100vh - 52px);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg), 0 0 0 1px rgba(47,230,160,.06);
  display: flex; flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-2);
}

/* Barre titre macOS */
.titlebar {
  height: 38px; flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: #0A1011;
  border-bottom: 1px solid var(--line);
}
.traffic { display: flex; gap: 8px; }
.traffic i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.traffic .r { background: #FF5F57; }
.traffic .y { background: #FEBC2E; }
.traffic .g { background: #28C840; }
.titlebar-title {
  font-family: var(--font-mono); font-weight: 500; font-size: 11.5px;
  color: var(--ink-3); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  position: absolute; left: 50%; transform: translateX(-50%);
}

/* ============================================================
   HEADER APP
   ============================================================ */
.appbar {
  height: 68px; flex-shrink: 0;
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-mark { width: 56px; height: 56px; flex-shrink: 0; display: block; }
.logo-mark svg { width: 100%; height: 100%; display: block; }
.logo-img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)) drop-shadow(0 0 12px rgba(178,85,202,.35)); }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: -.02em; line-height: 1.25; padding-bottom: 2px; white-space: nowrap; background: linear-gradient(100deg, var(--mint) 0%, var(--brand) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-name b { font-weight: 700; }
.brand-tag { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); font-weight: 500; margin-top: 5px; letter-spacing: .08em; }

/* motif égaliseur (covers) */
.eq { display: flex; align-items: flex-end; gap: 2.5px; height: 18px; }
.eq span { width: 3px; background: #fff; border-radius: 2px; animation: eqbar 1.1s ease-in-out infinite; }
.eq span:nth-child(1) { height: 40%; animation-delay: 0s; }
.eq span:nth-child(2) { height: 95%; animation-delay: .2s; }
.eq span:nth-child(3) { height: 60%; animation-delay: .4s; }
.eq span:nth-child(4) { height: 80%; animation-delay: .15s; }
@keyframes eqbar { 0%,100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }

/* Onglets segmentés */
.tabs { margin: 0 auto; display: flex; gap: 3px; padding: 4px; background: #0A1011; border-radius: var(--pill); border: 1px solid var(--line); }
.tab {
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  border: none; background: transparent; color: var(--ink-2);
  padding: 9px 20px; border-radius: var(--pill); cursor: pointer;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  transition: all .18s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.tab.active .ic { color: var(--mint); }
.tab .ic { width: 18px; height: 18px; }

.appbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.status {
  display: flex; align-items: center; gap: 8px;
  background: var(--mint-soft); color: var(--mint);
  padding: 7px 14px; border-radius: var(--pill);
  font-family: var(--font-mono); font-weight: 600; font-size: 11.5px; white-space: nowrap;
  border: 1px solid rgba(47,230,160,.22); letter-spacing: .02em;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47,230,160,.55); } 70% { box-shadow: 0 0 0 7px rgba(47,230,160,0); } 100% { box-shadow: 0 0 0 0 rgba(47,230,160,0); } }
.status.busy { background: var(--yellow-soft); color: var(--yellow); border-color: rgba(255,203,92,.22); }
.status.busy .dot { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); animation: pulse-y 1.2s infinite; }
@keyframes pulse-y { 0% { box-shadow: 0 0 0 0 rgba(255,203,92,.6); } 70% { box-shadow: 0 0 0 7px rgba(255,203,92,0); } 100% { box-shadow: 0 0 0 0 rgba(255,203,92,0); } }

.icon-btn {
  width: 40px; height: 40px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--ink-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s ease;
}
.icon-btn:hover { color: var(--mint); border-color: rgba(47,230,160,.4); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }

/* ============================================================
   BODY / PANELS
   ============================================================ */
.body { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.panel { position: absolute; inset: 0; display: none; }
.panel.active { display: flex; }

/* ── MA MUSIQUE ──────────────────────────────────────────── */
.music { width: 100%; display: flex; min-height: 0; }
.rail {
  width: 318px; flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  padding: 18px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}

/* Cartes d'action */
.action {
  display: flex; align-items: center; gap: 14px;
  padding: 15px; border-radius: var(--r-lg);
  border: 1px solid transparent; cursor: pointer; text-align: left;
  width: 100%; transition: transform .15s ease, box-shadow .2s ease, opacity .2s, border-color .2s;
  font-family: var(--font-body);
}
.action:hover:not(:disabled) { transform: translateY(-2px); }
.action:active:not(:disabled) { transform: translateY(0) scale(.99); }
.action + .action { margin-top: 7px; }
.action:disabled,
.action.is-busy { opacity: .42; cursor: not-allowed; pointer-events: none; filter: saturate(.55); box-shadow: none !important; transform: none !important; }
.action-check:disabled,
.action-check.is-busy { background: var(--surface-2); color: var(--ink-2); }
.action-sync:disabled,
.action-sync.is-busy { border-color: var(--line-2); background: var(--surface-3); color: var(--ink-2); }
.action-sync.ready:disabled,
.action-sync.ready.is-busy { border-color: var(--line-2); background: var(--surface-3); box-shadow: none; }
.action-check { background: linear-gradient(135deg, var(--mint), var(--mint-deep)); color: #04130E; box-shadow: 0 8px 22px -12px rgba(47,230,160,.55); }
.action-check:hover:not(:disabled) { box-shadow: 0 10px 26px -10px rgba(47,230,160,.6); }
.action-sync  { background: var(--surface-3); color: var(--ink); border-color: var(--line-2); }
.action-sync.ready { border-color: var(--mint); background: var(--mint-soft); box-shadow: 0 8px 22px -14px rgba(47,230,160,.5); }
.action-ic { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(4,19,14,.18); }
.action-sync .action-ic { background: var(--surface-2); color: var(--ink-2); }
.action-sync.ready .action-ic { background: var(--mint-soft); color: var(--mint); }
.action-ic svg { width: 23px; height: 23px; }
.action-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.action-title { font-family: var(--font-head); font-weight: 700; font-size: 15.5px; line-height: 1.1; }
.action-sub { font-size: 12.5px; opacity: .8; font-weight: 500; }
.action-check .action-sub { color: #06281C; opacity: .85; }

.rail-sep { height: 1px; background: var(--line); margin: 2px 0; }

/* Jauge de complétude — style niveau de mixage */
.health { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 13px; }
.health-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.health-pct { font-family: var(--font-mono); font-weight: 700; font-size: 30px; line-height: .9; color: var(--mint); display: flex; align-items: baseline; }
.health-pct small { font-size: 15px; color: var(--ink-3); margin-left: 2px; font-weight: 600; }
.health-meter { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.health-meter i { flex: 1; border-radius: 2px; background: #0E1716; transition: background .5s ease, box-shadow .5s ease; }
.health-meter i.on { background: var(--mint); box-shadow: 0 0 7px -1px rgba(47,230,160,.7); }
.health-meter i.hot { background: var(--brand-2); box-shadow: 0 0 7px -1px rgba(178,85,202,.7); }
.health-info { display: flex; flex-direction: column; gap: 3px; }
.health-title { font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.health-sub { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }

/* Stats */
.stats-card { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 18px; }
.stats-head { font-family: var(--font-mono); font-weight: 600; font-size: 10.5px; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 10px; }
.stat-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; }
.stat-row + .stat-row { border-top: 1px solid var(--line); }
.stat-k { display: flex; align-items: center; gap: 9px; font-weight: 500; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.stat-chip { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.stat-chip svg { width: 15px; height: 15px; }
.stat-v { font-family: var(--font-mono); font-weight: 700; font-size: 15.5px; }
.stat-v.warn { color: var(--coral); }

/* Historique */
.hist { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.hist-toggle { width: 100%; border: none; background: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; font-family: var(--font-head); font-weight: 600; font-size: 13.5px; color: var(--ink); }
.hist-toggle .arrow { transition: transform .2s; color: var(--ink-3); }
.hist.open .hist-toggle .arrow { transform: rotate(180deg); }
.hist-body { display: none; padding: 0 18px 14px; }
.hist.open .hist-body { display: block; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.hist-ic { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--mint-soft); color: var(--mint); }
.hist-ic svg { width: 15px; height: 15px; }
.hist-txt { flex: 1; min-width: 0; }
.hist-main { font-weight: 600; font-size: 13px; }
.hist-date { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); font-weight: 500; }
.hist-empty .hist-main { font-weight: 600; color: var(--ink-2); }
.hist-empty { opacity: .75; }

/* Zone centrale */
.stage { flex: 1; min-width: 0; overflow-y: auto; padding: 32px 38px; }

/* Accueil */
.welcome { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.welcome-art { position: relative; margin-bottom: 14px; }
.welcome-disc {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, var(--surface-3), var(--surface));
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 60px -10px rgba(178,85,202,.6), inset 0 0 30px -10px rgba(47,230,160,.25);
}
.welcome-disc::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 120deg, transparent, rgba(47,230,160,.6), transparent 40%, rgba(178,85,202,.6), transparent 80%);
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 57%);
          mask: radial-gradient(circle, transparent 56%, #000 57%);
  animation: spin 8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.welcome-disc::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-2); box-shadow: 0 0 14px var(--brand); }
.welcome h1 { font-family: var(--font-head); font-weight: 700; font-size: 30px; margin-top: 8px; letter-spacing: -.01em; }
.welcome p { font-size: 15px; color: var(--ink-2); max-width: 430px; line-height: 1.6; font-weight: 500; }
.welcome-hints { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; width: 100%; max-width: 450px; }
.whint { display: flex; align-items: center; gap: 14px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-align: left; transition: transform .15s, border-color .15s; }
.whint:hover { transform: translateX(3px); border-color: var(--line-2); }
.whint-ic { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.whint-ic svg { width: 20px; height: 20px; }
.whint-txt b { font-family: var(--font-head); font-weight: 700; font-size: 14.5px; display: block; }
.whint-txt span { font-size: 13px; color: var(--ink-2); font-weight: 500; }

/* Scan / résultat */
.stage-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.stage-head .big { width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.stage-head .big svg { width: 25px; height: 25px; }
.stage-head .txt { flex: 1; min-width: 0; }
.stage-head h2 { font-family: var(--font-head); font-weight: 700; font-size: 22px; line-height: 1.15; letter-spacing: -.01em; }
.stage-head p { font-size: 14px; color: var(--ink-2); font-weight: 500; margin-top: 3px; }

.scan-list { display: flex; flex-direction: column; gap: 9px; }
.scan-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: var(--r); padding: 13px 16px;
  opacity: 0; transform: translateY(8px); animation: rise .4s ease forwards;
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.scan-cover { width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: center; gap: 2.5px; padding: 8px; }
.scan-cover span { width: 3.5px; border-radius: 2px; background: rgba(255,255,255,.92); }
.scan-info { flex: 1; min-width: 0; }
.scan-name { font-family: var(--font-head); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 9px; }
.scan-meta { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.scan-state { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.scan-state.ok { color: var(--mint); }
.scan-state.miss { color: var(--coral); }
.scan-state.scanning { color: var(--brand-2); }
.spinner { width: 15px; height: 15px; border: 2.5px solid var(--violet-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
.badge-pill { font-family: var(--font-mono); padding: 4px 10px; border-radius: var(--pill); font-size: 11.5px; font-weight: 600; }
.badge-pill.ok { background: var(--mint-soft); color: var(--mint); }
.badge-pill.miss { background: var(--coral-soft); color: var(--coral); }

/* Bandeau résumé */
.result-banner {
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(135deg, rgba(255,131,89,.12), rgba(255,203,92,.08));
  border: 1px solid rgba(255,131,89,.22);
  border-radius: var(--r-lg); padding: 20px 24px; margin-bottom: 18px;
}
.result-banner.allok { background: linear-gradient(135deg, var(--mint-soft), var(--violet-soft)); border-color: rgba(47,230,160,.22); }
.result-num { font-family: var(--font-mono); font-weight: 700; font-size: 44px; line-height: 1; color: var(--coral); }
.result-banner.allok .result-num { color: var(--mint); }
.result-banner h3 { font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.result-banner p { font-size: 13.5px; color: var(--ink-2); font-weight: 500; margin-top: 3px; }
.result-cta { margin-left: auto; }

/* Boutons */
.btn {
  font-family: var(--font-head); font-weight: 700; font-size: 14.5px;
  border: none; border-radius: var(--pill); cursor: pointer; white-space: nowrap;
  padding: 12px 24px; display: inline-flex; align-items: center; gap: 9px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--mint); color: #04130E; box-shadow: var(--glow-mint); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 34px -2px rgba(47,230,160,.7); }
.btn-mint { background: var(--mint); color: #04130E; box-shadow: var(--glow-mint); }
.btn-mint:hover { transform: translateY(-2px); box-shadow: 0 0 34px -2px rgba(47,230,160,.7); }
.btn-ghost { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--mint); color: var(--mint); }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* Progression téléchargement */
.sync-hero { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px; margin-bottom: 16px; }
.sync-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.sync-big { font-family: var(--font-mono); font-weight: 700; font-size: 38px; line-height: 1; color: var(--mint); }
.sync-big small { font-size: 19px; color: var(--ink-3); }
.sync-label { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); font-weight: 500; }
.pbar { height: 12px; border-radius: var(--pill); background: #0A1011; overflow: hidden; }
.pbar-fill { height: 100%; border-radius: var(--pill); background: linear-gradient(90deg, var(--mint), var(--brand)); width: 0%; transition: width .4s ease; box-shadow: 0 0 16px rgba(47,230,160,.6); }
.sync-now { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 500; font-size: 13.5px; color: var(--ink-2); }
.sync-now .dl { color: var(--mint); }

.sync-pl-head { font-family: var(--font-mono); font-weight: 600; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 4px 0 12px; }
.scan-item.sync-pl { animation: none; opacity: 1; transform: none; transition: border-color .25s, box-shadow .25s; }
.scan-item.sync-pl.dl-active { border-color: var(--mint); box-shadow: 0 0 0 1px var(--mint), 0 0 22px -8px rgba(47,230,160,.6); }
.scan-item.sync-pl .pbar-mini i { transition: width .35s ease; }

/* Waveform animée */
.wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 60px; margin: 8px 0; }
.wave span { width: 5px; border-radius: 3px; background: linear-gradient(to top, var(--mint), var(--brand)); animation: wv 1s ease-in-out infinite; }
@keyframes wv { 0%,100% { height: 16%; } 50% { height: 100%; } }

/* Célébration */
.done-card { text-align: center; padding: 24px; }
.done-check { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 18px; background: linear-gradient(145deg, var(--mint), var(--mint-deep)); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 34px -12px rgba(47,230,160,.6); animation: pop .42s cubic-bezier(.3,1.05,.5,1) both; }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.done-check svg { width: 48px; height: 48px; color: #04130E; }
.done-card h2 { font-family: var(--font-head); font-weight: 700; font-size: 27px; letter-spacing: -.01em; }
.done-card p { font-size: 15px; color: var(--ink-2); font-weight: 500; margin-top: 6px; }
.done-stats { display: flex; gap: 14px; justify-content: center; margin: 24px 0; }
.done-stat { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 24px; }
.done-stat b { font-family: var(--font-mono); font-weight: 700; font-size: 28px; display: block; line-height: 1; }
.done-stat span { font-size: 12px; color: var(--ink-2); font-weight: 500; }

/* ============================================================
   MES PLAYLISTS
   ============================================================ */
.lib { width: 100%; display: flex; flex-direction: column; min-height: 0; }
.lib-bar { display: flex; align-items: center; gap: 14px; padding: 20px 28px; flex-shrink: 0; }
.search { flex: 1; max-width: 380px; position: relative; }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.search input {
  width: 100%; border: 1px solid var(--line-2); background: var(--surface-2);
  border-radius: var(--pill); padding: 11px 16px 11px 44px;
  font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { border-color: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.lib-stat-tag { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-weight: 500; font-size: 12px; color: var(--ink-2); margin-left: auto; }
.lib-stat-tag b { color: var(--mint); font-weight: 700; }
.lib-add-btn { padding: 10px 18px; font-size: 14px; }
.lib-add-btn svg { width: 17px; height: 17px; }

.lib-grid { flex: 1; overflow-y: auto; padding: 4px 28px 28px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; align-content: start; }

.pcard { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; gap: 16px; align-items: center; transition: transform .15s ease, box-shadow .2s ease, border-color .2s; position: relative; }
.pcard:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--sh); }
.pcover { width: 64px; height: 64px; border-radius: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px -8px rgba(0,0,0,.6); }
.pcover-mono { font-family: var(--font-head); font-weight: 700; font-size: 28px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.3); line-height: 1; }
.pcover span { width: 5px; border-radius: 3px; background: rgba(255,255,255,.92); }
.pcard-body { flex: 1; min-width: 0; }
.pcard-name { font-family: var(--font-head); font-weight: 700; font-size: 16.5px; display: flex; align-items: center; gap: 10px; }
.pdot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 10px -1px currentColor; }
.pdot.c-mint { background: #2FE6A0; color: #2FE6A0; }
.pdot.c-violet { background: #B255CA; color: #B255CA; }
.pdot.c-sky { background: #5BB5FF; color: #5BB5FF; }
.pdot.c-pink { background: #FF6FA5; color: #FF6FA5; }
.pdot.c-coral { background: #FF8359; color: #FF8359; }
.pdot.c-yellow { background: #FFCB5C; color: #FFCB5C; }
.pcard-meta { display: flex; align-items: center; gap: 8px; margin: 6px 0 9px; flex-wrap: wrap; }
.tag-src { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--pill); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; }
.tag-src .d { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.tag-src.sp { background: var(--spotify-soft); color: #34d36c; }
.tag-src.sp .d { background: var(--spotify); color: var(--spotify); }
.tag-src.sc { background: var(--soundcloud-soft); color: #ff7a3d; }
.tag-src.sc .d { background: var(--soundcloud); color: var(--soundcloud); }
.tag-src.add { background: transparent; border: 1px dashed var(--line-2); color: var(--ink-3); cursor: pointer; font-family: var(--font-mono); transition: all .15s; }
.tag-src.add svg { width: 11px; height: 11px; }
.tag-src.add.sp:hover { border-color: rgba(29,185,84,.5); color: #34d36c; border-style: solid; background: var(--spotify-soft); }
.tag-src.add.sc:hover { border-color: rgba(255,85,0,.5); color: #ff7a3d; border-style: solid; background: var(--soundcloud-soft); }
.pcard-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); font-weight: 500; }
.pcard-foot { display: flex; align-items: center; gap: 10px; }
.pbar-mini { flex: 1; height: 7px; border-radius: var(--pill); background: #0A1011; overflow: hidden; }
.pbar-mini i { display: block; height: 100%; border-radius: var(--pill); }
.pcard-status { font-family: var(--font-mono); font-size: 11px; font-weight: 600; white-space: nowrap; }
.pcard-status.ok { color: var(--mint); }
.pcard-status.miss { color: var(--coral); }
.pcard-menu { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px; border: none; background: transparent; color: var(--ink-3); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.pcard-menu:hover { background: var(--surface); color: var(--ink); }
.pcard-actions { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; }
.pcard-act { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-3); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.pcard-act svg { width: 16px; height: 16px; }
.pcard-act:hover { background: var(--surface); color: var(--ink); }
.pcard-act.del:hover { color: var(--coral); border-color: rgba(255,131,89,.4); background: rgba(255,131,89,.08); }
.pcard-excl { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-2); background: var(--violet-soft); border: 1px solid rgba(178,85,202,.32); padding: 2px 8px; border-radius: var(--pill); white-space: nowrap; }
.pcard-excl::before { content: '◈'; font-size: 8px; }

/* Carte ajout */
.pcard-add { border: 1.5px dashed var(--line-2); background: transparent; cursor: pointer; align-items: center; justify-content: center; color: var(--ink-2); font-family: var(--font-head); font-weight: 600; font-size: 14.5px; flex-direction: column; gap: 8px; min-height: 100px; }
.pcard-add:hover { border-color: var(--mint); color: var(--mint); background: var(--mint-soft); transform: translateY(-3px); }
.pcard-add .plus { width: 44px; height: 44px; border-radius: 13px; background: var(--mint-soft); color: var(--mint); display: flex; align-items: center; justify-content: center; }
.pcard-add:hover .plus { background: var(--mint); color: #04130E; }
.pcard-add svg { width: 24px; height: 24px; }

/* Formulaire ajout */
.add-form-card { grid-column: 1 / -1; background: var(--surface-2); border: 1px solid var(--mint); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--glow-mint); display: none; }
.add-form-card.open { display: block; animation: rise .3s ease; }
.aff-title { font-family: var(--font-head); font-weight: 700; font-size: 18px; margin-bottom: 16px; }
.aff-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.aff-row label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--ink-2); text-transform: uppercase; }
.aff-row input { border: 1px solid var(--line-2); background: var(--surface-3); border-radius: var(--r-sm); padding: 12px 14px; font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--ink); outline: none; }
.aff-row input::placeholder { color: var(--ink-3); }
.aff-row input:focus { border-color: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.aff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.aff-grid-3 { grid-template-columns: 1.3fr 1fr 1fr; }
.aff-excl { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.excl-toggle { display: inline-flex; align-items: center; gap: 11px; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--pill); padding: 8px 16px 8px 10px; cursor: pointer; font-family: var(--font-body); transition: all .18s; }
.excl-toggle:hover { border-color: var(--line-2); }
.excl-toggle[data-active="true"] { border-color: var(--mint); background: var(--mint-soft); }
.excl-track { width: 38px; height: 22px; border-radius: var(--pill); background: #0A1011; border: 1px solid var(--line-2); position: relative; flex-shrink: 0; transition: background .2s, border-color .2s; }
.excl-toggle[data-active="true"] .excl-track { background: var(--mint); border-color: var(--mint); }
.excl-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink-2); transition: transform .22s cubic-bezier(.3,.8,.3,1), background .2s; }
.excl-toggle[data-active="true"] .excl-thumb { transform: translateX(16px); background: #04130E; }
.excl-label { font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--ink); }
.excl-val { font-family: var(--font-mono); font-weight: 600; font-size: 11px; letter-spacing: .08em; color: var(--ink-3); }
.excl-toggle[data-active="true"] .excl-val { color: var(--mint); }
.excl-hint { position: relative; }
.excl-hint-q { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-3); color: var(--ink-2); font-family: var(--font-mono); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; cursor: help; }
.excl-bubble { position: absolute; left: 30px; top: 50%; transform: translateY(-50%) scale(.95); width: 280px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 13px 15px; box-shadow: var(--sh); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 5; }
.excl-hint:hover .excl-bubble { opacity: 1; transform: translateY(-50%) scale(1); }
.excl-bubble strong { font-family: var(--font-head); font-weight: 700; font-size: 13.5px; display: block; margin-bottom: 4px; color: var(--mint); }
.excl-bubble p { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); font-weight: 500; }
.aff-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.aff-detect { font-family: var(--font-mono); font-size: 12px; font-weight: 500; margin-top: 4px; min-height: 18px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { height: 44px; flex-shrink: 0; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
.footer-info { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.footer-replay { background: none; border: none; cursor: pointer; color: var(--ink-2); font-family: var(--font-body); font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--pill); transition: all .15s; }
.footer-replay:hover { background: var(--mint-soft); color: var(--mint); }
.footer-replay svg { width: 15px; height: 15px; }

/* Bouton « Logs » — masqué par défaut ; déverrouillé via réglages (studio-logs.js) */
.footer-logs-btn { position: relative; background: none; border: none; cursor: pointer; color: var(--ink-3); font-family: var(--font-mono); font-weight: 600; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; display: none; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--pill); transition: all .15s; }
.footer-logs-btn.is-unlocked { display: inline-flex; }
.about-version { user-select: none; }
.footer-logs-btn:hover { background: var(--surface); color: var(--ink); }
.footer-logs-btn.active { background: var(--mint-soft); color: var(--mint); }
.footer-logs-btn svg { width: 14px; height: 14px; }
.footer-logs-dot { position: absolute; top: 2px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); opacity: 0; transform: scale(.4); transition: all .2s; }
.footer-logs-dot.on { opacity: 1; transform: scale(1); animation: logDot 1.3s ease-in-out infinite; }
@keyframes logDot { 50% { opacity: .35; } }

/* Tiroir Logs temps réel */
.logcon { position: absolute; left: 0; right: 0; bottom: 44px; height: 42%; min-height: 220px; max-height: 60%;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -18px 44px -18px rgba(0,0,0,.55);
  display: flex; flex-direction: column; z-index: 60;
  transform: translateY(calc(100% + 44px)); transition: transform .28s cubic-bezier(.4,0,.2,1);
  pointer-events: none; }
.logcon.open { transform: translateY(0); pointer-events: auto; }
.logcon-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.logcon-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.logcon-title svg { width: 15px; height: 15px; color: var(--mint); }
.logcon-spacer { flex: 1; }
.logcon-btn { background: none; border: none; cursor: pointer; color: var(--ink-3); font-family: var(--font-body); font-weight: 600; font-size: 12px; padding: 5px 11px; border-radius: var(--pill); transition: all .15s; }
.logcon-btn:hover { background: var(--surface-2); color: var(--ink); }
.logcon-body { flex: 1; overflow-y: auto; padding: 10px 16px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55; color: var(--ink-2); background: var(--bg); }
.logcon-line { white-space: pre-wrap; word-break: break-word; padding: 1px 0; }
.logcon-line.evt { color: var(--ink-3); margin: 7px 0 2px; letter-spacing: .03em; }
.logcon-line.ok { color: var(--mint); font-weight: 600; }
.logcon-line.err { color: var(--coral); font-weight: 600; }
.logcon-empty { color: var(--ink-3); opacity: .7; }

/* ============================================================
   PANNEAU RÉGLAGES
   ============================================================ */
.overlay { position: absolute; inset: 0; background: rgba(3,6,6,.66); backdrop-filter: blur(4px); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.settings { position: absolute; top: 0; right: 0; bottom: 0; width: 460px; max-width: 92%; background: var(--surface); z-index: 50; transform: translateX(100%); transition: transform .3s cubic-bezier(.3,.8,.3,1); display: flex; flex-direction: column; box-shadow: var(--sh-lg); border-left: 1px solid var(--line-2); visibility: hidden; pointer-events: none; }
.settings.show { transform: translateX(0); visibility: visible; pointer-events: auto; }
.set-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.set-head h2 { font-family: var(--font-head); font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.set-head .gic { width: 36px; height: 36px; border-radius: 10px; background: var(--mint-soft); color: var(--mint); display: flex; align-items: center; justify-content: center; }
.set-close { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-3); color: var(--ink-2); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.set-close:hover { background: var(--surface-2); color: var(--ink); }
.set-tabs { display: flex; gap: 4px; padding: 14px 24px 0; flex-shrink: 0; }
.set-tab { font-family: var(--font-head); font-weight: 600; font-size: 13px; border: none; background: none; color: var(--ink-2); padding: 9px 14px; border-radius: var(--r-sm); cursor: pointer; transition: all .15s; }
.set-tab.active { background: var(--mint-soft); color: var(--mint); }
.set-body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.set-pane { display: none; }
.set-pane.active { display: block; }
.set-section-t { font-family: var(--font-mono); font-weight: 600; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.set-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 16px; margin-bottom: 22px; }
.set-item { display: flex; align-items: center; gap: 14px; padding: 15px 0; }
.set-item + .set-item { border-top: 1px solid var(--line); }
.set-item-ic { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.set-item-ic svg { width: 20px; height: 20px; }
.set-item-body { flex: 1; min-width: 0; }
.set-item-title { font-family: var(--font-head); font-weight: 700; font-size: 14.5px; }
.set-item-desc { font-size: 12.5px; color: var(--ink-2); font-weight: 500; margin-top: 2px; line-height: 1.4; }
.set-item-val { font-family: var(--font-mono); font-weight: 600; font-size: 13px; color: var(--mint); white-space: nowrap; }
.set-btn { font-family: var(--font-head); font-weight: 600; font-size: 13px; border: 1px solid var(--line-2); background: var(--surface-3); color: var(--ink); border-radius: var(--pill); padding: 9px 16px; cursor: pointer; white-space: nowrap; transition: all .15s; }
.set-btn:hover { border-color: var(--mint); color: var(--mint); }
.set-badge-soon { font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--ink-3); background: var(--surface); padding: 5px 10px; border-radius: var(--pill); letter-spacing: .04em; text-transform: uppercase; }

/* Connexion source */
.connect-card { border-radius: var(--r); padding: 13px 15px; margin-bottom: 13px; border: 1px solid var(--line); }
.connect-card.sp { background: var(--spotify-soft); border-color: rgba(29,185,84,.22); }
.connect-card.sc { background: var(--soundcloud-soft); border-color: rgba(255,85,0,.22); }
.connect-card.yt { background: rgba(255,59,48,.07); border-color: rgba(255,59,48,.20); }
.brand-ico-yt { width: 26px; height: 26px; display: block; }
.connect-opt-badge { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line-2); padding: 5px 10px; border-radius: var(--pill); flex-shrink: 0; }
.connect-rec-badge { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .04em; color: var(--mint); background: rgba(47, 230, 160, .1); border: 1px solid rgba(47, 230, 160, .28); padding: 5px 10px; border-radius: var(--pill); flex-shrink: 0; }
.connect-state.off { color: var(--ink-2); }
.yt-why { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; margin-bottom: 14px; }
.yt-why-title { font-family: var(--font-head); font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.yt-why p { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); font-weight: 500; margin: 0; }
.yt-why p + p { margin-top: 8px; }
.yt-why p strong { color: var(--ink); font-weight: 700; }
.yt-why-muted { color: var(--ink-3) !important; }
.yt-row-left { margin-bottom: 12px; }
.yt-row-label { font-family: var(--font-head); font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.yt-row-desc { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); font-weight: 500; }
.yt-controls { display: flex; gap: 10px; align-items: stretch; }
.set-select { flex: 1; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); padding: 11px 14px; font-family: var(--font-body); font-size: 13.5px; font-weight: 500; color: var(--ink); outline: none; cursor: pointer; transition: border-color .15s, box-shadow .15s; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6B67' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.set-select:focus { border-color: #FF6B5C; box-shadow: 0 0 0 4px rgba(255,59,48,.12); }
.btn-yt { background: #FF3B30; color: #fff; flex-shrink: 0; }
.btn-yt:hover { transform: translateY(-1px); }
.connect-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.connect-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-sm); }
.connect-logo svg { width: 24px; height: 24px; }
.brand-ico-sp { width: 26px; height: 26px; display: block; }
.brand-ico-sc { height: 15px; width: auto; display: block; }
.onb-chip .brand-ico-sp { width: 20px; height: 20px; }
.onb-chip .brand-ico-sc { height: 13px; width: auto; }
.connect-name { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.connect-state { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; }
.connect-state.on { color: #34d36c; }
.connect-state.off { color: var(--ink-2); }
.connect-card p { font-size: 12.5px; color: var(--ink-2); font-weight: 500; line-height: 1.42; margin-bottom: 10px; }
.connect-card .btn { width: 100%; justify-content: center; }
.connect-card .yt-controls .btn { width: auto; }
.btn-sp { background: var(--spotify); color: #fff; }
.btn-sc { background: var(--soundcloud); color: #fff; }

/* Formulaire identifiants Spotify */
.set-tuto-btn { font-family: var(--font-head); font-weight: 600; font-size: 12.5px; border: 1px solid rgba(29,185,84,.4); background: rgba(29,185,84,.12); color: #34d36c; border-radius: var(--pill); padding: 7px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: all .15s; flex-shrink: 0; }
.set-tuto-btn:hover { background: rgba(29,185,84,.2); }
.set-tuto-btn svg { width: 15px; height: 15px; }
.creds-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.creds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.creds-grid .creds-input { min-width: 0; }
.creds-input { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); padding: 9px 13px; font-family: var(--font-mono); font-size: 13px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.creds-input::placeholder { color: var(--ink-3); font-family: var(--font-body); }
.creds-input:focus { border-color: #34d36c; box-shadow: 0 0 0 4px rgba(29,185,84,.14); }
.creds-save { width: 100%; justify-content: center; margin-top: 2px; }
.creds-status { font-family: var(--font-mono); font-size: 12px; font-weight: 500; margin-top: 8px; min-height: 0; }
.creds-status.ok { color: #34d36c; }
.creds-status.err { color: var(--coral); }
.creds-status.testing { color: var(--brand-2); }
.sp-oauth-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(29,185,84,.18); }
.sp-oauth-hint { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; margin-bottom: 10px; }
.sp-oauth-btn { width: 100%; margin-top: 4px; }

/* Modal tuto Spotify */
.sptuto { position: fixed; inset: 0; z-index: 200; display: none; }
.sptuto.show { display: block; }
.sptuto-overlay { position: absolute; inset: 0; background: rgba(3,6,6,.74); backdrop-filter: blur(5px); animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sptuto-modal { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 600px; max-width: calc(100% - 40px); max-height: calc(100% - 60px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--sh-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop-modal .3s cubic-bezier(.2,1,.4,1); }
@keyframes pop-modal { from { opacity: 0; transform: translate(-50%,-46%) scale(.97); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
.sptuto-hdr { display: flex; align-items: center; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.sptuto-hdr-ic { width: 44px; height: 44px; border-radius: 12px; background: rgba(29,185,84,.14); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sptuto-hdr-ic img { width: 24px; height: 24px; }
.sptuto-hdr-txt { flex: 1; min-width: 0; }
.sptuto-title { font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.sptuto-sub { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); font-weight: 500; margin-top: 3px; }
.sptuto-body { flex: 1; overflow-y: auto; padding: 22px; }
.sptuto-lead { font-size: 14px; line-height: 1.6; color: var(--ink-2); font-weight: 500; margin-bottom: 22px; }
.sptuto-lead strong { color: var(--ink); font-weight: 700; }
.sptuto-step { display: flex; gap: 16px; padding-bottom: 22px; position: relative; }
.sptuto-step:not(:last-of-type)::before { content: ''; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px; background: var(--line); }
.sptuto-step-n { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background: var(--mint-soft); color: var(--mint); font-family: var(--font-mono); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; border: 1.5px solid rgba(47,230,160,.4); position: relative; z-index: 1; }
.sptuto-step-body { flex: 1; min-width: 0; padding-top: 4px; }
.sptuto-step-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.sptuto-step-body p { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); font-weight: 500; }
.sptuto-step-body p + p { margin-top: 6px; }
.sptuto-step-body a { color: var(--mint); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(47,230,160,.4); }
.sptuto-step-body a:hover { border-bottom-color: var(--mint); }
.sptuto-step-body strong { color: var(--ink); font-weight: 700; }
.sptuto-hint { color: var(--ink-3) !important; font-size: 12.5px !important; }
.sptuto-fields { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 8px 0 2px; }
.sptuto-fields li { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); font-weight: 500; padding-left: 16px; position: relative; }
.sptuto-fields li::before { content: ''; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); }
.sptuto-f { font-family: var(--font-head); font-weight: 700; color: var(--ink); }
.sptuto-uri { display: inline-block; font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 7px; padding: 3px 9px; margin-top: 5px; color: var(--brand-2); user-select: all; }
.sptuto-note { font-size: 12.5px; line-height: 1.6; color: var(--ink-3); font-weight: 500; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-top: 6px; }
.sptuto-note strong { color: var(--ink-2); font-weight: 700; }
.sptuto-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); flex-shrink: 0; }
.sptuto-footer .btn svg { width: 16px; height: 16px; }

.about { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.about-logo-mark { width: 52px; height: 52px; flex-shrink: 0; display: block; }
.about-logo-mark svg { width: 100%; height: 100%; display: block; }
.about-logo-img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.about b { font-family: var(--font-head); font-weight: 700; font-size: 16px; display: block; }
.about span { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); font-weight: 500; }

/* ============================================================
   ONBOARDING
   ============================================================ */
/* Voile de démarrage — couvre tout (au-dessus de l'onboarding) tant que le
   boot n'a pas décidé quoi afficher. Supprime le flash du menu au 1er lancement. */
/* Le chrome de l'app (barre, header, contenu, footer) reste MASQUÉ par défaut.
   Il n'apparaît qu'une fois la classe body.app-ready ajoutée explicitement
   (utilisateur configuré, ou fin d'onboarding). Onboarding et contrat sont des
   overlays séparés qui s'affichent par-dessus → aucun flash du menu possible. */
.titlebar, .appbar, .body, .footer { visibility: hidden; }
body.app-ready .titlebar,
body.app-ready .appbar,
body.app-ready .body,
body.app-ready .footer { visibility: visible; }

.boot-veil { position: fixed; inset: 0; z-index: 9999; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .42s ease; }
.boot-veil.hide { opacity: 0; pointer-events: none; }
/* Dès qu'on retire le voile, le logo disparaît immédiatement : seul le fond
   (couleur de l'app) se fond, jamais le logo → pas de clignotement. */
.boot-veil.hide .boot-veil-logo { animation: none; opacity: 0; transition: none; }
.boot-veil-logo { width: 84px; height: 84px; object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(0,0,0,.5)) drop-shadow(0 0 22px rgba(178,85,202,.4));
  /* Le logo n'apparaît qu'après un délai : si le démarrage est rapide, le voile
     (de la même couleur que le fond de l'app) est retiré avant → aucun flash de
     logo. Sinon, fondu d'entrée puis pulsation douce. */
  opacity: 0;
  animation: bootFadeIn .5s ease .45s both, bootPulse 1.8s ease-in-out .95s infinite; }
@keyframes bootFadeIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes bootPulse {
  0%, 100% { opacity: .72; transform: scale(.975); }
  50%      { opacity: 1;   transform: scale(1); }
}

/* ── Contrat d'utilisation (porte 1er lancement) ────────────────────────── */
.agree { position: absolute; inset: 0; z-index: 120; background: var(--bg);
  display: none; align-items: center; justify-content: center; overflow: hidden; padding: 28px; }
.agree.show { display: flex; }
.agree-bg { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(42% 46% at 4% 0%, rgba(47,230,160,.14), transparent 66%),
    radial-gradient(50% 54% at 100% 100%, rgba(178,85,202,.20), transparent 70%); }
.agree-card { position: relative; z-index: 2; width: min(640px, 100%);
  max-height: calc(100vh - 56px); display: flex; flex-direction: column;
  background: var(--surface-2, #11201C); border: 1px solid var(--line-2, #25332F);
  border-radius: 22px; padding: 30px 32px 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55); animation: rise .45s ease; }
.agree-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.agree-ic { flex: none; width: 52px; height: 52px; border-radius: 15px;
  display: grid; place-items: center; color: var(--mint);
  background: var(--mint-soft); box-shadow: inset 0 0 0 1px rgba(47,230,160,.3); }
.agree-ic svg { width: 26px; height: 26px; }
.agree-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.agree-card h1 { font-family: var(--font-head); font-size: 26px; line-height: 1.15;
  letter-spacing: -.02em; margin: 0; color: var(--ink); }
.agree-intro { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin: 0 0 16px; }
.agree-intro b { color: var(--ink); }
.agree-body { flex: 1; min-height: 0; overflow-y: auto; padding-right: 6px;
  display: flex; flex-direction: column; gap: 12px; }
.agree-body:focus { outline: none; }
.agree-clause { display: flex; gap: 13px; align-items: flex-start;
  background: rgba(255,255,255,.025); border: 1px solid var(--line, #1E2A28);
  border-radius: 14px; padding: 13px 15px; font-size: 13.5px; line-height: 1.5;
  color: var(--ink-2); }
.agree-clause b { color: var(--ink); }
.agree-clause-ic { flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; color: var(--brand-2);
  background: rgba(178,85,202,.12); }
.agree-clause-ic svg { width: 17px; height: 17px; }
.agree-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  margin: 18px 0 16px; padding: 13px 15px; border-radius: 14px;
  background: var(--mint-soft); border: 1px solid rgba(47,230,160,.22);
  user-select: none; transition: border-color .15s; }
.agree-check:hover { border-color: rgba(47,230,160,.45); }
.agree-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.agree-check-box { flex: none; width: 22px; height: 22px; border-radius: 7px;
  border: 2px solid var(--ink-3); display: grid; place-items: center;
  color: var(--bg); transition: all .15s; margin-top: 1px; }
.agree-check-box svg { width: 15px; height: 15px; opacity: 0; transform: scale(.6); transition: all .15s; }
.agree-check input:checked + .agree-check-box { background: var(--mint); border-color: var(--mint); }
.agree-check input:checked + .agree-check-box svg { opacity: 1; transform: scale(1); }
.agree-check input:focus-visible + .agree-check-box { box-shadow: 0 0 0 3px rgba(47,230,160,.35); }
.agree-check-txt { font-size: 13.5px; line-height: 1.5; color: var(--ink); font-weight: 600; }
.agree-nav { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.agree-nav #agree-back { margin-right: auto; }
.agree-nav .btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.3); }

.onb { position: absolute; inset: 0; z-index: 100; background: var(--bg); display: none; flex-direction: column; overflow: hidden; }
.onb.show { display: flex; animation: onbReveal .55s cubic-bezier(.22,.61,.36,1) both; }
@keyframes onbReveal {
  from { opacity: 0; transform: scale(.99) translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.onb-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(40% 44% at 6% 2%, rgba(47,230,160,.14), transparent 66%),
    radial-gradient(48% 52% at 98% 100%, rgba(178,85,202,.20), transparent 70%); }
.onb-bg::after { content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 58px 58px; mask-image: radial-gradient(75% 75% at 50% 40%, #000, transparent); }
.onb-blob { display: none; }

.onb-top { display: flex; align-items: center; justify-content: space-between; padding: 24px 30px; z-index: 2; }
.onb-prog { display: flex; align-items: center; gap: 0; }
.onb-prog i { width: 9px; height: 9px; border-radius: 50%; background: #1E2A28; transition: all .3s; position: relative; }
.onb-prog i + i { margin-left: 34px; }
.onb-prog i + i::before { content: ''; position: absolute; right: 9px; top: 50%; width: 34px; height: 2px; background: #1E2A28; transform: translateY(-50%); }
.onb-prog i.on { background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.onb-prog i.on + i::before, .onb-prog i.done + i::before { background: var(--brand); }
.onb-skip { background: none; border: none; cursor: pointer; color: var(--ink-2); font-family: var(--font-body); font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: var(--pill); transition: all .15s; display: inline-flex; align-items: center; gap: 6px; }
.onb-skip:hover { color: var(--ink); }

.onb-stage { flex: 1; min-height: 0; position: relative; z-index: 2; display: flex; }
.onb-screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 40px; }
.onb-screen.active { display: flex; animation: rise .45s ease; }

.onb-logo-hero { width: 104px; height: 104px; margin-bottom: 22px; display: block; }
.onb-logo-hero svg { width: 100%; height: 100%; display: block; }
.onb-logo-img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 10px 28px rgba(0,0,0,.5)) drop-shadow(0 0 22px rgba(178,85,202,.4)); }
.onb-kicker { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .34em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 22px; }
.onb h1 { font-family: var(--font-head); font-weight: 700; font-size: 46px; line-height: 1.08; width: 100%; max-width: 820px; letter-spacing: -.02em; }
.onb h1 .grad { background: linear-gradient(100deg, var(--mint) 10%, var(--brand-2) 92%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.onb .lead { font-size: 16.5px; color: var(--ink-2); font-weight: 500; width: 100%; max-width: 560px; line-height: 1.65; margin-top: 20px; }
.onb .lead b { color: var(--ink); font-weight: 700; }
.onb .fine { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); font-weight: 500; margin-top: 18px; letter-spacing: .02em; }
.onb-srcs { display: flex; align-items: center; gap: 12px; margin-top: 30px; }
.onb-srcs .lbl { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.onb-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--pill); padding: 9px 16px; font-family: var(--font-head); font-weight: 700; font-size: 14px; }
.onb-chip svg { width: 20px; height: 20px; }

/* Étapes */
.onb-steps { display: flex; align-items: stretch; gap: 16px; margin-top: 46px; }
.onb-step { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 24px; width: 252px; text-align: left; position: relative; overflow: hidden; }
.onb-step::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--mint), var(--brand)); opacity: .8; }
.onb-step-n { font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--mint); width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(47,230,160,.45); display: flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.onb-step-ic { position: absolute; top: 24px; right: 24px; color: var(--ink-3); }
.onb-step-ic svg { width: 22px; height: 22px; }
.onb-step h3 { font-family: var(--font-head); font-weight: 700; font-size: 18px; margin-bottom: 9px; letter-spacing: -.01em; }
.onb-step p { font-size: 13.5px; color: var(--ink-2); font-weight: 500; line-height: 1.55; }
.onb-step-arrow { display: flex; align-items: center; color: var(--ink-3); flex-shrink: 0; }
.onb-step-arrow svg { width: 22px; height: 22px; }

.onb-folder { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 8px; width: 480px; max-width: 100%; margin-top: 38px; display: flex; align-items: center; gap: 14px; }
.onb-folder.picked { border-color: var(--mint); box-shadow: var(--glow-mint); }
.onb-folder-ic { width: 54px; height: 54px; border-radius: 14px; background: var(--violet-soft); color: var(--brand-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.onb-folder-ic svg { width: 27px; height: 27px; }
.onb-folder-info { flex: 1; min-width: 0; text-align: left; }
.onb-folder-label { font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.onb-folder-path { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); font-weight: 500; }
.onb-ready { position: relative; width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; margin-bottom: 42px; }

/* Halo conique tournant (menthe → violet, couleurs de marque) */
.onb-ready-halo { position: absolute; top: 50%; left: 50%; width: 112px; height: 112px; transform: translate(-50%,-50%); border-radius: 50%;
  background: conic-gradient(from 0deg, var(--mint), var(--brand-2), var(--brand), var(--mint));
  -webkit-mask: radial-gradient(circle, transparent 40px, #000 41px); mask: radial-gradient(circle, transparent 40px, #000 41px);
  filter: blur(5px); opacity: .5; animation: ready-spin 6s linear infinite; }
@keyframes ready-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

.onb-ready-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); border-radius: 50%; pointer-events: none; }
.onb-ready-ring.r1 { width: 80px; height: 80px; border: 1px solid rgba(47,230,160,.36); box-shadow: inset 0 0 18px -6px rgba(47,230,160,.3); animation: ready-pulse 3.2s ease-in-out infinite; }
.onb-ready-ring.r2 { width: 102px; height: 102px; border: 1px solid rgba(178,85,202,.22); animation: ready-pulse 3.2s ease-in-out infinite .4s; }
@keyframes ready-pulse { 0%,100% { opacity: .5; transform: translate(-50%,-50%) scale(1); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.04); } }

/* Points en orbite */
.onb-ready-orbit { position: absolute; top: 50%; left: 50%; width: 102px; height: 102px; transform: translate(-50%,-50%); animation: ready-spin 9s linear infinite; }
.onb-ready-orbit i { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; border-radius: 50%; margin: -3px; }
.onb-ready-orbit i:nth-child(1) { background: var(--mint); box-shadow: 0 0 9px var(--mint); transform: rotate(0deg) translateX(51px); }
.onb-ready-orbit i:nth-child(2) { background: var(--brand-2); box-shadow: 0 0 9px var(--brand); transform: rotate(130deg) translateX(51px); }
.onb-ready-orbit i:nth-child(3) { background: #fff; box-shadow: 0 0 7px rgba(255,255,255,.8); width: 4px; height: 4px; margin: -2px; transform: rotate(245deg) translateX(51px); }

.onb-ready-core {
  position: relative; width: 60px; height: 60px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #5BF3BD 0%, #25D596 44%, #10A874 100%);
  display: flex; align-items: center; justify-content: center; color: #042417;
  box-shadow:
    0 0 0 1px rgba(47,230,160,.55),
    0 14px 32px -12px rgba(47,230,160,.6),
    0 0 40px -8px rgba(47,230,160,.4),
    inset 0 7px 14px -6px rgba(255,255,255,.6),
    inset 0 -9px 16px -6px rgba(0,0,0,.38);
  animation: ready-pop .6s cubic-bezier(.2,1.5,.4,1);
}
@keyframes ready-pop { 0% { transform: scale(0); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.onb-ready-core::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(120% 70% at 50% 0%, rgba(255,255,255,.5), transparent 55%); pointer-events: none; }
.onb-ready-check { width: 31px; height: 31px; position: relative; z-index: 2; }
.onb-ready-check path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: ready-draw .5s cubic-bezier(.6,0,.3,1) .35s forwards; }
@keyframes ready-draw { to { stroke-dashoffset: 0; } }
/* Reflet qui balaie */
.onb-ready-shine { position: absolute; top: 0; left: -120%; width: 70%; height: 100%; z-index: 3; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-18deg);
  animation: ready-sweep 3.4s ease-in-out 1.1s infinite; }
@keyframes ready-sweep { 0% { left: -120%; } 26%,100% { left: 130%; } }
.onb-tips { display: flex; flex-direction: column; gap: 11px; margin-top: 32px; width: 100%; max-width: 470px; }
.onb-tip { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; text-align: left; }
.onb-tip-n { width: 32px; height: 32px; border-radius: 9px; background: var(--mint-soft); color: var(--mint); font-family: var(--font-mono); font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.onb-tip b { font-family: var(--font-head); font-weight: 700; font-size: 14.5px; display: block; }
.onb-tip span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }

.onb-nav { display: flex; align-items: center; justify-content: space-between; padding: 24px 40px 32px; z-index: 2; position: relative; }
.onb-nav .spacer { flex: 1; }
/* Waveform décorative en bas de l'onboarding */
.onb-wave { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 3px; height: 70px; opacity: .5; pointer-events: none; z-index: 1; }
.onb-wave span { width: 4px; border-radius: 2px; background: linear-gradient(to top, var(--mint), var(--brand)); animation: wv 1.4s ease-in-out infinite; }

/* Confetti */
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; width: 9px; height: 13px; border-radius: 2px; top: -24px; opacity: 0;
  transform: translateY(-10px) rotate(var(--rot, 0deg));
  animation: fall cubic-bezier(.25,.55,.4,1) forwards; will-change: transform, opacity; }
@keyframes fall {
  0%   { opacity: 0; transform: translate(0, -10px) rotate(var(--rot, 0deg)); }
  12%  { opacity: .9; }
  85%  { opacity: .9; }
  100% { opacity: 0; transform: translate(var(--drift, 0), 100vh) rotate(var(--spin, 720deg)); }
}

/* ============================================================
   PRODUCT TOUR — visite guidée premier lancement
   ============================================================ */
.tour { position: fixed; inset: 0; z-index: 120; display: none; }
.tour.show { display: block; }
/* couche qui bloque les clics (transparente — la pénombre vient du spotlight) */
.tour-overlay { position: absolute; inset: 0; background: transparent; transition: background .25s ease; }
.tour.is-center .tour-overlay { background: rgba(5,8,9,.74); }
/* Spotlight : le grand box-shadow assombrit tout autour du trou */
.tour-spotlight {
  position: absolute; border-radius: 17px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(5,8,9,.74), 0 0 0 1.5px var(--mint), 0 0 22px -2px rgba(47,230,160,.55);
  display: none;
}
.tour.has-target .tour-spotlight { display: block; }
@keyframes tour-halo { 0%,100% { box-shadow: 0 0 0 9999px rgba(5,8,9,.74), 0 0 0 1.5px var(--mint), 0 0 0 4px rgba(47,230,160,.0); } 50% { box-shadow: 0 0 0 9999px rgba(5,8,9,.74), 0 0 0 1.5px var(--mint), 0 0 0 6px rgba(47,230,160,.18); } }
.tour.has-target .tour-spotlight { box-shadow: 0 0 0 9999px rgba(5,8,9,.74), 0 0 0 1.5px var(--mint), 0 0 18px -2px rgba(47,230,160,.45); }

.tour-popover {
  position: absolute; width: 348px; max-width: calc(100% - 32px);
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  padding: 22px 22px 18px; z-index: 2;
  /* Reste invisible tant que la position n'est pas calculée (évite le flash en
     haut à gauche au tout 1er affichage), puis apparaît en fondu. */
  opacity: 0; transition: opacity .28s ease;
}
.tour-popover.is-placed { opacity: 1; }
.tour-popover.tour-popover-center { width: 420px; }
.tour-pop-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.tour-pop-ic { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--mint-soft); color: var(--mint); }
.tour-pop-ic svg { width: 22px; height: 22px; }
.tour-pop-tag { font-family: var(--font-mono); font-weight: 600; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-2); }
.tour-pop-title { font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: -.01em; margin-top: 3px; }
.tour-pop-body { font-size: 14px; line-height: 1.6; color: var(--ink-2); font-weight: 500; }
.tour-pop-body strong { color: var(--ink); font-weight: 700; }
.tour-pop-foot { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.tour-pop-dots { display: flex; align-items: center; gap: 6px; flex: 1; }
.tour-pop-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); transition: all .25s; }
.tour-pop-dot.on { background: var(--mint); box-shadow: 0 0 8px var(--mint); width: 20px; border-radius: var(--pill); }
.tour-pop-dot.done { background: var(--brand); }
.tour-btn { font-family: var(--font-head); font-weight: 600; font-size: 13.5px; border: none; border-radius: var(--pill); cursor: pointer; padding: 9px 16px; display: inline-flex; align-items: center; gap: 6px; transition: transform .15s, background .2s, color .2s; }
.tour-btn:active { transform: scale(.96); }
.tour-btn-back { background: transparent; color: var(--ink-2); padding: 9px 10px; }
.tour-btn-back:hover { color: var(--ink); }
.tour-btn-next { background: var(--mint); color: #04130E; box-shadow: var(--glow-mint); }
.tour-btn-next:hover { transform: translateY(-1px); }
.tour-skip { position: absolute; top: 16px; right: 18px; background: none; border: none; cursor: pointer; color: var(--ink-3); font-family: var(--font-body); font-weight: 600; font-size: 12px; padding: 5px 8px; border-radius: var(--pill); transition: color .15s; }
.tour-skip:hover { color: var(--ink); }
.tour-target-pulse { position: relative; z-index: 121; transform: none !important; }

/* ============================================================
   SECTION DOUBLONS (résultats d'analyse)
   ============================================================ */
.doublons-section { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 22px; }
.doublons-section-hdr { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 6px; }
.doublons-section-title { display: flex; align-items: center; gap: 11px; font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.doublons-section-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--violet-soft); color: var(--brand-2); display: flex; align-items: center; justify-content: center; }
.doublons-section-ic svg { width: 19px; height: 19px; }
.doublons-section-badge { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--line); padding: 6px 12px; border-radius: var(--pill); white-space: nowrap; }
.doublons-section-intro { font-size: 13px; color: var(--ink-2); font-weight: 500; line-height: 1.5; margin-bottom: 14px; max-width: 560px; }
.doublons-blocks { display: flex; flex-direction: column; gap: 9px; }
.doublons-block { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.doublons-hdr { width: 100%; border: none; background: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; text-align: left; font-family: var(--font-body); }
.doublons-hdr-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.doublons-hdr-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doublons-pl-name { font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--ink); }
.doublons-pl-sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); font-weight: 500; }
.doublons-hdr-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.doublons-count { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--brand-2); }
.doublons-chevron { color: var(--ink-3); transition: transform .22s ease; }
.doublons-block.open .doublons-chevron { transform: rotate(180deg); }
.doublons-tracks { display: none; padding: 2px 16px 12px; flex-direction: column; gap: 2px; }
.doublons-block.open .doublons-tracks { display: flex; animation: rise .25s ease; }
.doublons-track { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-top: 1px solid var(--line); }
.doublons-arrow { color: var(--ink-3); font-size: 14px; flex-shrink: 0; width: 16px; text-align: center; }
.doublons-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doublons-reason { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); padding: 4px 9px; border-radius: var(--pill); white-space: nowrap; flex-shrink: 0; }

/* Morceaux manquants (résultat analyse) */
.studio-miss-section { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 22px; }
.studio-miss-section-hdr { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.studio-miss-section-title { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--ink); }
.studio-miss-section-badge { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--brand-2); background: var(--violet-soft); border: 1px solid var(--line); padding: 6px 12px; border-radius: var(--pill); }
.studio-miss-blocks { display: flex; flex-direction: column; gap: 9px; }
.studio-miss-block { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.studio-miss-hdr { width: 100%; border: none; background: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; text-align: left; font-family: var(--font-body); }
.studio-miss-hdr-left { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.studio-miss-pl { font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--ink); }
.studio-miss-sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); font-weight: 500; }
.studio-miss-toggle { color: var(--ink-3); font-size: 12px; flex-shrink: 0; transition: transform .22s ease; }
.studio-miss-block.open .studio-miss-toggle { transform: rotate(180deg); }
.studio-miss-tracks { display: none; padding: 2px 16px 12px; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; }
.studio-miss-block.open .studio-miss-tracks { display: flex; animation: rise .25s ease; }
.studio-miss-track { display: flex; align-items: center; gap: 11px; padding: 8px 0; border-top: 1px solid var(--line); }
.studio-miss-arrow { color: var(--brand-2); font-size: 13px; flex-shrink: 0; width: 16px; }
.studio-miss-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-miss-name.muted { color: var(--ink-3); font-style: italic; }

/* Scrollbars */
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: var(--pill); border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: padding-box; }

/* Covers playlists */
.c-violet { background: linear-gradient(145deg, #B255CA, #8E3AA8); }
.c-pink   { background: linear-gradient(145deg, #FF6FA5, #E84B86); }
.c-coral  { background: linear-gradient(145deg, #FF8359, #F2602F); }
.c-yellow { background: linear-gradient(145deg, #FFCB5C, #F0A91E); }
.c-mint   { background: linear-gradient(145deg, #2FE6A0, #14B47B); }
.c-sky    { background: linear-gradient(145deg, #5BB5FF, #2E84E0); }
.bg-violet-soft { background: var(--violet-soft); color: var(--brand-2); }
.bg-pink-soft { background: var(--pink-soft); color: var(--pink); }
.bg-coral-soft { background: var(--coral-soft); color: var(--coral); }
.bg-yellow-soft { background: var(--yellow-soft); color: var(--yellow); }
.bg-mint-soft { background: var(--mint-soft); color: var(--mint); }
.bg-sky-soft { background: var(--sky-soft); color: var(--sky); }

@media (max-width: 720px) {
  .lib-grid { grid-template-columns: 1fr; }
  .onb-steps { flex-direction: column; }
  .onb h1 { font-size: 34px; }
}

/* Bannière dépendances (bootstrap) */
#panel-music.active { flex-direction: column; }
#panel-music .dep-banner {
  flex-shrink: 0;
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}
#panel-music .music { flex: 1; min-height: 0; }
.dep-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 20px 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--dep-bg);
  border: 1px solid var(--dep-border);
  font-size: 13px;
  color: var(--ink);
}
.dep-banner[data-mode="error"] {
  background: rgba(255,107,107,.12);
  border-color: rgba(255,107,107,.35);
}

/* Bibliothèque enrichie */
.pcard-stack { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.pcard-stack.expanded { grid-column: 1 / -1; }
.pcard-stack .pcard.open { border-color: var(--mint); box-shadow: 0 0 0 1px rgba(47,230,160,.15); }
.pcard-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 2; }
.pcard-act { width: 30px; height: 30px; border: none; border-radius: 8px; background: var(--surface); color: var(--ink-2); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pcard-act:hover { color: var(--ink); background: var(--surface-2); }
.pcard-act.danger:hover { color: var(--coral); }
.pcard.empty-state { justify-content: center; text-align: center; min-height: 100px; border-style: dashed; cursor: default; }
.tag-src.off { opacity: .45; filter: grayscale(.4); }
.plib-expand, .plib-edit { background: var(--surface-2); border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--r-lg) var(--r-lg); padding: 16px 18px; margin-top: -8px; animation: rise .22s ease; }
.plib-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; margin-bottom: 14px; }
.plib-k { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.plib-v { font-size: 13px; color: var(--ink); word-break: break-all; }
.plib-section-title { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--ink-2); margin: 12px 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.plib-missing,
.plib-disk {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.plib-missing .plib-section-title { color: var(--coral); }
.plib-disk .plib-section-title { margin-top: 0; }
.plib-track-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.plib-track {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}
.plib-track:last-child { border-bottom: none; }
.plib-track-mark {
  flex-shrink: 0;
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
}
.plib-track-txt { flex: 1; min-width: 0; }
.plib-track.dim { color: var(--ink-3); font-style: italic; }
.plib-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.plib-edit-err { color: var(--coral); font-size: 12px; margin: 8px 0; min-height: 16px; }
.plib-sources-edit { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }

/* Feedback modal */
.fb-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 900; opacity: 0; pointer-events: none; transition: opacity .25s; }
.fb-overlay.show { opacity: 1; pointer-events: auto; }
.fb-modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.96); width: min(520px, calc(100vw - 32px)); max-height: min(88vh, 720px); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); z-index: 901; display: none; flex-direction: column; box-shadow: var(--sh-lg); opacity: 0; transition: transform .28s ease, opacity .28s ease; }
.fb-modal.show { display: flex; opacity: 1; transform: translate(-50%, -50%) scale(1); }
.fb-hdr { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.fb-title { font-family: var(--font-head); font-weight: 700; font-size: 17px; }
.fb-body { padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.fb-kind-row { display: flex; gap: 16px; }
.fb-kind { font-size: 13px; color: var(--ink-2); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.fb-label { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.fb-req { color: var(--coral); }
.fb-textarea, .fb-input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); font-family: var(--font-body); font-size: 14px; resize: vertical; }
.fb-textarea--sm { min-height: 56px; }
.fb-checks { display: flex; flex-direction: column; gap: 8px; }
.fb-check { font-size: 12px; color: var(--ink-2); cursor: pointer; display: flex; gap: 8px; line-height: 1.4; }
.fb-legal { font-size: 11px; color: var(--ink-3); line-height: 1.45; margin: 0; }
.fb-status { font-size: 12px; white-space: pre-wrap; min-height: 18px; color: var(--ink-2); }
.fb-status--ok { color: var(--mint); }
.fb-status--err { color: var(--coral); }
.fb-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }

/* ── Modales exclusif / longs sets / confirm sync ── */
.excl-modal-overlay {
  position: fixed; inset: 0; z-index: 950;
  background: rgba(0,0,0,.62); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.excl-modal {
  width: min(520px, 100%); max-height: min(85vh, 640px);
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column;
  box-shadow: var(--sh-lg);
}
.excl-modal-title { font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--coral); margin-bottom: 10px; }
.excl-modal-intro { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin-bottom: 14px; }
.excl-modal-body { flex: 1; overflow-y: auto; margin-bottom: 16px; }
.excl-modal-section { margin-bottom: 12px; padding: 10px 12px; background: var(--surface); border-radius: var(--r-sm); border: 1px solid var(--line); }
.excl-modal-pl { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.excl-modal-count { font-size: 11px; color: var(--coral); font-weight: 600; }
.excl-modal-file { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); padding: 2px 0; word-break: break-all; }
.excl-modal-more { font-size: 11px; color: var(--ink-3); font-style: italic; margin-top: 4px; }
.excl-modal-actions { display: flex; gap: 10px; }
.excl-modal-actions .btn-cancel, .ls-toolbar .btn-cancel {
  flex: 1; padding: 11px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line-2);
}
.excl-modal-actions .btn-danger {
  flex: 1.5; padding: 11px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700;
  cursor: pointer; background: rgba(255,131,89,.14); color: var(--coral); border: 1px solid rgba(255,131,89,.35);
}
.excl-modal-actions .btn-danger:disabled { opacity: .5; cursor: wait; }
.ls-toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.ls-row { padding: 8px 10px; border-radius: var(--r-sm); margin-bottom: 4px; background: var(--surface); border: 1px solid var(--line); }
.ls-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.ls-title { display: block; font-size: 13px; color: var(--ink); }
.ls-meta { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.confirm-overlay {
  position: fixed; inset: 0; z-index: 940; display: none;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 20px;
}
.confirm-overlay.visible { display: flex; }
.confirm-box {
  width: min(440px, 100%); background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-lg);
}
.confirm-title { font-family: var(--font-head); font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.confirm-stats { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.confirm-stat { font-size: 13px; color: var(--ink-2); }
.confirm-stat.add { color: var(--mint); font-weight: 600; }
.confirm-stat.ok { color: var(--mint); }
.confirm-stat.muted { color: var(--ink-3); font-size: 12px; }
.confirm-yt-warn, .confirm-excl-warn {
  font-size: 12px; color: var(--ink-2); background: var(--yellow-soft);
  border: 1px solid rgba(255,203,92,.25); border-radius: var(--r-sm);
  padding: 10px 12px; margin-bottom: 12px; line-height: 1.5;
}
.confirm-excl-warn { background: var(--violet-soft); border-color: rgba(178,85,202,.25); }
.confirm-note { font-size: 12px; color: var(--ink-3); margin-bottom: 18px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn-cancel {
  flex: 1; padding: 11px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line-2);
}
.confirm-actions .btn-launch {
  flex: 1.4; padding: 11px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700;
  cursor: pointer; background: var(--mint-soft); color: var(--mint); border: 1px solid rgba(47,230,160,.35);
}

/* Résultats sync enrichis */
.warn-banner { background: rgba(255,203,92,.08) !important; border-color: rgba(255,203,92,.22) !important; margin-top: 16px; }
.warn-row { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.warn-list { margin: 6px 0 0 18px; font-size: 12px; color: var(--ink-3); }
.studio-excl-section { margin-top: 20px; }
.excl-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.excl-card { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.excl-card-hdr { display: flex; align-items: center; gap: 8px; }
.excl-meter-lbl { font-size: 12px; color: var(--ink-3); }
.excl-clean-btn {
  margin-top: 10px; padding: 8px 12px; font-size: 12px; font-weight: 600;
  background: rgba(255,131,89,.12); color: var(--coral); border: 1px solid rgba(255,131,89,.3);
  border-radius: var(--r-sm); cursor: pointer; width: 100%; text-align: left;
}
.excl-note { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.sync-results { margin: 16px 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.sync-result-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: baseline; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sync-result-row .sres-icon { font-weight: 700; }
.sync-result-row.ok .sres-icon { color: var(--mint); }
.sync-result-row.warn .sres-icon { color: var(--yellow); }
.sync-result-row.err .sres-icon { color: var(--coral); }
.sync-result-row .sres-name { color: var(--ink); font-weight: 600; }
.sync-result-row .sres-sub { color: var(--ink-3); font-size: 11px; text-align: right; }

.failed-tracks-section { margin-top: 18px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.failed-tracks-hdr { padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.failed-tracks-tag { font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--coral); }
.failed-tracks-hint { font-size: 10px; color: var(--ink-3); }
.failed-track-row { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.failed-track-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.failed-track-name { font-size: 12px; font-weight: 600; color: var(--ink); font-family: var(--font-mono); }
.failed-track-playlist, .failed-track-reason { font-size: 11px; color: var(--ink-3); }
.failed-track-reason { color: var(--coral); }
.failed-track-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-ft-retry, .btn-ft-force {
  font-size: 11px; padding: 5px 10px; border-radius: 8px; cursor: pointer;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line-2);
}
.failed-force-form { display: none; flex-direction: column; gap: 8px; margin-top: 8px; }
.failed-force-input {
  width: 100%; padding: 8px 10px; font-size: 12px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.btn-ft-submit {
  align-self: flex-start; padding: 6px 14px; font-size: 12px; font-weight: 600;
  background: var(--mint-soft); color: var(--mint); border: 1px solid rgba(47,230,160,.3);
  border-radius: 8px; cursor: pointer;
}
.skipped-track-row { padding: 8px 12px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }

.studio-toast {
  position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%) translateY(12px);
  z-index: 999; padding: 10px 18px; border-radius: var(--pill); font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink);
  box-shadow: var(--sh); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.studio-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.studio-toast.ok { border-color: rgba(47,230,160,.4); color: var(--mint); }
.studio-toast.err { border-color: rgba(255,131,89,.4); color: var(--coral); }

/* ── Mode app native (pywebview) : plein écran, pas de faux cadre navigateur ── */
html.native-shell,
body.native-shell {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}
body.native-shell {
  display: block;
  padding: 0;
  background: var(--surface);
}
body.native-shell .window {
  width: 100%;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  border: none;
}
body.native-shell .titlebar { display: none; }

/* ── Mode intégré (iframe sur le site) : la fenêtre remplit le cadre, pas de bureau noir autour ── */
html.embed { height: 100%; min-height: 100%; overflow: hidden; background: var(--surface); }
html.embed body {
  display: block; padding: 0; margin: 0;
  min-height: 100vh; background: var(--surface);
}
html.embed .window {
  width: 100%; min-height: 100vh; height: 100vh;
  max-width: none; max-height: none;
  border-radius: 0; box-shadow: none; border: none; margin: 0;
}
html.embed .ambient { display: none; }
