@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500..800&family=Inter:wght@400;500;600;700;800&display=swap');

:root{
  --bg: #191414;
  --surface: #282828;
  --surface-2: #333333;
  --border: #404040;
  --text: #EDEDF2;
  --text-muted: #8A8A98;
  --violet: #1DB954;
  --violet-2: #1ed760;
  --violet-soft: rgba(29,185,84,0.14);
  --accent-2: #1DB954;            /* vert Spotify */
  --glow: rgba(29,185,84,0.45);   /* halo des éléments accentués */
  --pink: #1DB954;                /* vert Spotify pour favoris */
  --display: 'Bricolage Grotesque', var(--font); /* police des titres */
  --cached: #4ADE80;
  --cached-soft: rgba(74,222,128,0.14);
  --ondemand: #FFB84D;
  --ondemand-soft: rgba(255,184,77,0.14);
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Encoches et indicateur home iOS — valent 0px hors iPhone */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  --player-h: 84px;
  --tabbar-h: 64px;
  /* Hauteur totale occupee sous la zone de contenu */
  --bottom-bar: calc(var(--player-h) + var(--safe-bottom));
}

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

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

button{ font-family: inherit; cursor:pointer; border:none; background:none; color:inherit; }
input{ font-family: inherit; }

.app{
  display:grid;
  grid-template-columns: 240px 1fr;
  height: calc(100vh - var(--bottom-bar));
  height: calc(100dvh - var(--bottom-bar));
}

/* SIDEBAR */
.sidebar{
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display:flex;
  flex-direction:column;
}

.brand{ display:flex; align-items:center; gap:10px; padding: 4px 8px 28px; }
.brand-mark{
  width: 22px; height: 22px; border-radius: 7px;
  background: #000;
  box-shadow: 0 0 16px rgba(29,185,84,0.5);
}
.brand-name{ font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }

.nav{ display:flex; flex-direction:column; gap: 2px; }
.nav-item{
  display:flex; align-items:center; gap:12px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  text-align:left;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover{ background: var(--surface-2); color: var(--text); }
.nav-item.is-active{ background: var(--violet-soft); color: var(--violet-2); }
.nav-icon{ width:16px; text-align:center; font-size:14px; opacity:.9; }

/* MAIN */
.main{
  overflow-y:auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: calc(24px + var(--safe-top)) calc(32px + var(--safe-right)) 40px calc(32px + var(--safe-left));
}

.topbar{ margin-bottom: 28px; }
.search-box{
  display:flex; align-items:center; gap:10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  max-width: 460px;
  transition: border-color .15s ease;
}
.search-box:focus-within{ border-color: var(--violet); }
.search-icon{ color: var(--text-muted); font-size: 15px; }
.search-box input{
  background:none; border:none; outline:none; color: var(--text);
  font-size: 14px; width:100%;
}
.search-box input::placeholder{ color: var(--text-muted); }

/* Masquage générique. Elle manquait : seules trois variantes ciblées
   (.view, .access-gate, .queue-badge) existaient, donc sur tous les autres
   éléments la classe .is-hidden posée par app.js n'avait aucun effet. */
.is-hidden{ display: none !important; }

.view.is-hidden{ display:none; }
.view-title{ font-size: 24px; font-weight: 800; letter-spacing:-0.02em; margin-bottom: 6px; }
.view-sub{ color: var(--text-muted); font-size: 13.5px; margin-bottom: 24px; max-width: 620px; line-height:1.5; }

.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}

.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor:pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  position: relative;
}
.card:hover{ transform: translateY(-3px); border-color: var(--violet); background: var(--surface-2); }

.card-cover{
  width:100%; aspect-ratio:1; border-radius: 8px; margin-bottom: 10px;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size: 22px; color: rgba(255,255,255,0.85);
  position: relative;
  overflow:hidden;
}
.card-play{
  position:absolute; right:8px; bottom:8px;
  width: 34px; height:34px; border-radius:50%;
  background: var(--violet);
  display:flex; align-items:center; justify-content:center;
  font-size: 13px;
  opacity:0; transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.card:hover .card-play{ opacity:1; transform: translateY(0); }

.card-title-row{
  display:flex; align-items:flex-start; justify-content:space-between; gap:4px;
}
.card-title-wrap{ min-width: 0; overflow: hidden; }

.card-title{ font-size: 13.5px; font-weight:600; margin-bottom: 2px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.card-artist{ font-size: 12px; color: var(--text-muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.cache-dot{
  position:absolute; top:10px; left:10px;
  width:9px; height:9px; border-radius:50%;
  border: 2px solid var(--ondemand);
  background: transparent;
}
.cache-dot.is-cached{
  border-color: var(--cached);
  background: var(--cached);
  box-shadow: 0 0 8px rgba(74,222,128,0.6);
}

/* TRACK LIST (playlists / cached views) */
.track-list{ display:flex; flex-direction:column; gap:2px; }
.track-row{
  display:grid;
  grid-template-columns: 40px 1fr auto auto 60px;
  align-items:center;
  gap: 14px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor:pointer;
  transition: background .12s ease;
}
.track-row:hover{ background: var(--surface); }
.track-row-cover{
  width: 38px; height:38px; border-radius:6px;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:12px; color:rgba(255,255,255,.85);
}
.track-row-title{ font-size: 13.5px; font-weight:600; }
.track-row-artist{ font-size: 12px; color: var(--text-muted); }
.track-row-status{
  font-size: 10.5px; font-weight:700; letter-spacing:.03em; text-transform:uppercase;
  padding: 3px 8px; border-radius: 20px;
}
.track-row-status.cached{ color: var(--cached); background: var(--cached-soft); }
.track-row-status.ondemand{ color: var(--ondemand); background: var(--ondemand-soft); }
.track-row-duration{ font-size: 12px; color: var(--text-muted); text-align:right; }

.card.is-loading, .track-row.is-loading{
  opacity: .55; pointer-events:none; cursor:wait;
}

.load-more-btn{
  align-self: center;
  margin-top: 10px;
  padding: 10px 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s ease, background .15s ease;
}
.load-more-btn:hover{ border-color: var(--violet); background: var(--violet-soft); }
.load-more-btn:disabled{ opacity: .6; cursor: default; }

.view-header-row{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap: 16px; margin-bottom: 24px;
}
.view-header-row .view-title, .view-header-row .view-sub{ margin-bottom: 4px; }

.primary-btn{
  flex-shrink:0;
  padding: 9px 16px;
  background: var(--violet);
  color: #fff;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s ease;
}
.primary-btn:hover{ background: var(--violet-2); }

.back-btn{
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 16px;
  transition: color .15s ease;
}
.back-btn:hover{ color: var(--text); }

/* En-tête de playlist : grande pochette + nom, avec les détails en petit
   juste à côté du nom (ils passent à la ligne sur mobile). */
.playlist-hero{
  display:flex; align-items:center; gap:18px; margin-bottom: 24px;
}
.playlist-hero-cover-wrap{ position:relative; flex-shrink:0; }
.playlist-hero-cover{
  width: 104px; height: 104px; border-radius: var(--radius);
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:30px; color:rgba(255,255,255,.85);
}
.playlist-hero-text{
  display:flex; align-items:baseline; flex-wrap:wrap; gap: 4px 12px;
  flex: 1; min-width: 0;
}
.playlist-hero-text .view-title{ margin-bottom: 0; }
.playlist-meta{
  font-size: 12.5px; color: var(--text-muted); white-space: nowrap;
}

.playlist-cover-btn{
  position:absolute; right: 6px; bottom: 6px;
  width: 28px; height: 28px; border-radius: 8px;
  display:flex; align-items:center; justify-content:center;
  font-size: 13px; line-height:1;
  background: rgba(10,10,15,.72);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .15s ease, background .15s ease;
}
.playlist-hero-cover-wrap:hover .playlist-cover-btn,
.playlist-cover-btn:focus-visible{ opacity: 1; }
.playlist-cover-btn:hover{ background: rgba(123,97,255,.85); }
/* Pas de survol au doigt : le bouton reste visible sur écran tactile. */
@media (hover: none){ .playlist-cover-btn{ opacity: 1; } }

.playlist-menu-btn{
  flex-shrink:0; align-self:center;
  color: var(--text-muted);
  font-size: 18px; line-height:1;
  padding: 6px 10px; border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.playlist-menu-btn:hover{ color: var(--text); background: var(--surface-2); }

.playlist-add-btn{
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  position: relative;
  transition: color .15s ease, background .15s ease;
}
.playlist-add-btn:hover{ color: var(--violet-2); background: var(--surface-2); }

.playlist-picker{
  position: absolute;
  top: 100%; right: 0;
  margin-top: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 30;
}
.playlist-picker button{
  display:block; width:100%; text-align:left;
  padding: 8px 10px; border-radius: 6px; font-size: 12.5px; color: var(--text);
}
.playlist-picker button:hover{ background: var(--violet-soft); color: var(--violet-2); }
.playlist-picker .picker-empty{ color: var(--text-muted); padding: 8px 10px; font-size: 12px; }

.dropzone{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap: 10px;
  padding: 48px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  max-width: 560px;
}
.dropzone:hover, .dropzone.is-dragover{
  border-color: var(--violet);
  background: var(--violet-soft);
}
.dropzone.is-disabled{
  opacity: .5; cursor: not-allowed; pointer-events: none;
}
.dropzone-icon{ font-size: 28px; color: var(--violet-2); }
.dropzone-text{ font-size: 13.5px; color: var(--text-muted); text-align:center; }

.import-playlist-picker{
  display:flex; flex-direction:column; gap:8px;
  max-width: 560px;
  margin-bottom: 20px;
}
.import-playlist-label{
  font-size: 12px; letter-spacing:.04em; text-transform:uppercase;
  color: var(--text-muted);
}
.import-playlist-select, .import-new-playlist-input{
  width:100%; box-sizing:border-box;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color .15s ease;
}
.import-playlist-select:focus, .import-new-playlist-input:focus{
  border-color: var(--violet);
}

#importResult{ margin-top: 18px; max-width: 560px; }

.ctl-btn.is-active{ color: var(--violet-2); }

.empty-state{
  color: var(--text-muted); font-size: 13.5px; padding: 30px 4px;
}

/* PLAYER BAR */
.player{
  background: var(--surface);
  border-top: 1px solid var(--border);
  display:grid;
  grid-template-columns: 280px 1fr 180px;
  align-items:center;
  height: calc(var(--player-h) + var(--safe-bottom));
  padding: 0 calc(20px + var(--safe-right)) var(--safe-bottom) calc(20px + var(--safe-left));
  gap: 24px;
}

.player-track{ display:flex; align-items:center; gap:12px; min-width:0; }
.player-cover{
  width: 48px; height:48px; border-radius:7px; flex-shrink:0;
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
}
.player-meta{ min-width:0; }
.player-title{ font-size: 13.5px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.player-artist{ font-size: 12px; color: var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cache-pill{
  flex-shrink:0; font-size: 10px; font-weight:700; letter-spacing:.03em;
  padding: 3px 8px; border-radius: 20px; color: var(--text-muted); background: var(--surface-2);
}
.cache-pill.cached{ color: var(--cached); background: var(--cached-soft); }
.cache-pill.ondemand{ color: var(--ondemand); background: var(--ondemand-soft); }

.player-controls{ display:flex; flex-direction:column; align-items:center; gap:6px; }
.transport{ display:flex; align-items:center; gap:18px; }
.ctl-btn{ font-size: 15px; color: var(--text-muted); transition: color .15s ease; }
.ctl-btn:hover{ color: var(--text); }
.ctl-btn-main{
  width: 32px; height:32px; border-radius:50%;
  background: var(--text); color: var(--bg);
  display:flex; align-items:center; justify-content:center; font-size:12px;
}
.ctl-btn-main:hover{ color: var(--bg); background: var(--violet-2); }

.progress-row{ display:flex; align-items:center; gap:10px; width:100%; max-width: 480px; }
.time{ font-size: 11px; color: var(--text-muted); width: 34px; text-align:center; }
.progress-track{
  flex:1; height:4px; border-radius:3px; background: var(--border); cursor:pointer; position:relative;
}
.progress-fill{ height:100%; width:0%; border-radius:3px; background: var(--violet-2); }

.player-volume{ display:flex; align-items:center; gap:8px; justify-self:end; }
.vol-icon{ font-size: 14px; color: var(--text-muted); }
#volumeSlider{
  width: 90px; accent-color: var(--violet-2);
}

.toast{
  position: fixed; bottom: calc(100px + var(--safe-bottom)); left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 9px; font-size: 13px;
  opacity:0; pointer-events:none; transition: opacity .2s ease, transform .2s ease;
  z-index: 50;
}
.toast.is-visible{ opacity:1; transform: translateX(-50%) translateY(0); }

.mobile-tabbar{
  display:none;
  background: var(--surface);
  border-top: 1px solid var(--border);
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
  align-items:center;
  justify-content: space-around;
  z-index: 40;
}
.mobile-tabbar .nav-item{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 10px;
  flex: 1;
  min-height: 48px;
}
.mobile-tabbar .nav-item .nav-icon{ font-size: 21px; line-height: 1; }
.mobile-tabbar .nav-item.is-active{ color: var(--violet-2); }

@media (max-width: 760px){
  :root{ --bottom-bar: calc(var(--player-h) + var(--tabbar-h) + var(--safe-bottom)); }
  .app{ grid-template-columns: 1fr; }
  .sidebar{ display:none; }
  .main{
    padding: calc(20px + var(--safe-top)) calc(18px + var(--safe-right)) 32px calc(18px + var(--safe-left));
  }
  .player{
    grid-template-columns: 1fr auto;
    height: var(--player-h);
    padding: 0 calc(16px + var(--safe-right)) 0 calc(16px + var(--safe-left));
  }
  .player-volume{ display:none; }
  .mobile-tabbar{ display:flex; }
}

/* ---------------------------------------------------------------------------
   Fenêtre de renommage
   --------------------------------------------------------------------------- */
.modal-backdrop{
  position: fixed; inset: 0; z-index: 200;
  display:flex; align-items:center; justify-content:center;
  padding: 20px;
  background: rgba(8,8,12,.72);
  backdrop-filter: blur(4px);
}
.modal{
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.modal-title{ font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal-label{
  display:block; margin-bottom: 6px;
  font-size: 12px; color: var(--text-muted);
}
.modal-input{
  width: 100%; margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text); font-size: 14px;
}
.modal-input:focus{ outline: none; border-color: var(--violet); }
.modal-hint{
  font-size: 11.5px; line-height: 1.5;
  color: var(--text-muted); margin-bottom: 18px;
}
.modal-actions{ display:flex; justify-content:flex-end; gap: 8px; }
.modal-btn{
  padding: 9px 16px; border-radius: 9px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  transition: background .15s ease, color .15s ease;
}
.modal-btn:hover{ background: var(--surface-2); color: var(--text); }
.modal-btn.primary{ background: var(--violet); color: #fff; }
.modal-btn.primary:hover{ background: var(--violet-2); }
.modal-btn[disabled]{ opacity: .55; pointer-events: none; }

/* ---------------------------------------------------------------------------
   Réordonnancement d'une playlist
   --------------------------------------------------------------------------- */
.track-row[draggable="true"]{ cursor: grab; }
.track-row.dragging{ opacity: .4; cursor: grabbing; }
/* Trait d'insertion : inset au lieu d'une bordure, pour ne pas décaler la
   ligne d'un pixel au survol. */
.track-row.drop-before{ box-shadow: inset 0 2px 0 0 var(--violet); }
.track-row.drop-after{ box-shadow: inset 0 -2px 0 0 var(--violet); }

/* ---------------------------------------------------------------------------
   Playlists en cartes carrées, trois par ligne
   --------------------------------------------------------------------------- */
.playlist-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  /* La grille reste bornée : sur un écran très large, trois colonnes libres
     donneraient à nouveau des pochettes démesurées. 980px place les cartes
     autour de 310px, soit la même taille de vignette qu'avant. */
  max-width: 980px;
}
/* Sous ~1100px de viewport (240px de sidebar + marges), trois colonnes
   deviennent trop étroites : on repasse à deux. */
@media (max-width: 1100px){
  .playlist-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 620px;
  }
}
/* Sur mobile la sidebar disparaît : deux colonnes pleine largeur. */
@media (max-width: 760px){
  .playlist-grid{
    gap: 14px;
    max-width: none;
  }
}
.playlist-card{ cursor: pointer; }
.playlist-card-cover{
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  display:flex; align-items:center; justify-content:center;
  font-weight: 800; font-size: 34px;
  color: rgba(255,255,255,.85);
  transition: transform .15s ease, box-shadow .15s ease;
}
.playlist-card:hover .playlist-card-cover{
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}
.playlist-card-name{
  margin-top: 10px;
  font-size: 14px; font-weight: 600;
  /* Un nom long ne doit pas décaler la carte voisine. */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===========================================================================
   REFONTE 2026 — nouvelle identité (v25)
   Bloc ajouté en fin de feuille : il prime sur les règles ci-dessus à
   spécificité égale, sans les supprimer. On ne surcharge que l'intentionnel.
   =========================================================================== */

/* Fond : noir uni. */
body{
  background: var(--bg);
}

/* Titres en Bricolage Grotesque. */
.view-title, .brand-name, .modal-title,
.playlist-card-name, .artist-section-title,
.home-greeting, .home-sec-head h2{
  font-family: var(--display);
  letter-spacing: -0.02em;
}
.view-title{ font-size: 26px; font-weight: 700; }

/* ---- Marque ---- */
.brand{ padding: 2px 8px 22px; }
.brand-mark{
  width: 34px; height: 34px; border-radius: 10px;
  display:flex; align-items:center; justify-content:center;
  background: #000;
  box-shadow: 0 6px 20px rgba(29,185,84,.4);
}
.brand-mark svg{ width: 18px; height: 18px; }
.brand-name{ font-size: 19px; font-weight: 700; }

/* ---- Sidebar : nav SVG + section playlists défilante ---- */
.sidebar{ gap: 20px; padding: 22px 14px 14px; }
.nav-item{ gap: 13px; font-size: 14.5px; border-radius: 11px; }
.nav-icon{ width: 19px; height: 19px; display:flex; align-items:center; justify-content:center; opacity: 1; }
.nav-icon svg{ width: 19px; height: 19px; }
.nav-item.is-active{
  color: #fff;
  background: linear-gradient(90deg, rgba(139,124,246,.22), rgba(139,124,246,.05));
  box-shadow: inset 0 0 0 1px rgba(139,124,246,.28);
}

.side-section{
  display:flex; flex-direction:column; min-height: 0; flex: 1;
}
.side-section-head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 12px 4px;
}
.side-section-head span{
  font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.side-add-btn{
  width: 22px; height: 22px; border-radius: 6px;
  display:flex; align-items:center; justify-content:center;
  color: var(--text-muted); transition: color .15s, background .15s;
}
.side-add-btn:hover{ color: var(--text); background: rgba(255,255,255,.06); }
.side-add-btn svg{ width: 15px; height: 15px; }

.side-pls{ flex: 1; min-height: 0; overflow-y: auto; padding-right: 2px; }
.side-pls::-webkit-scrollbar{ width: 6px; }
.side-pls::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.07); border-radius: 3px; }
.side-pl{
  display:flex; align-items:center; gap: 11px;
  padding: 7px 12px; border-radius: 10px; cursor: pointer;
  transition: background .15s;
}
.side-pl:hover{ background: rgba(255,255,255,.05); }
.side-pl-cover{
  width: 36px; height: 36px; border-radius: 8px; flex: none;
  display:flex; align-items:center; justify-content:center;
  font-weight: 700; font-size: 12px; color: rgba(255,255,255,.85);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.side-pl-name{
  font-size: 13.5px; font-weight: 500; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-pls-empty{ padding: 6px 12px; font-size: 12px; color: var(--text-muted); }

/* ---- Topbar ---- */
.topbar{ display:flex; align-items:center; gap: 14px; }
.topbar-spacer{ flex: 1; }
.search-box{ border-radius: 99px; padding: 11px 16px; flex: 1; max-width: 460px; }
.search-box:focus-within{
  border-color: rgba(139,124,246,.55);
  box-shadow: 0 0 0 4px rgba(139,124,246,.12);
  background: var(--surface-2);
}
.topbar-btn{
  display:flex; align-items:center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 99px;
  font-weight: 600; font-size: 13.5px; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, var(--violet), var(--accent-2));
  box-shadow: 0 6px 18px var(--glow);
  transition: transform .15s, filter .15s;
}
.topbar-btn:hover{ transform: translateY(-1px); filter: brightness(1.08); }
.topbar-btn svg{ width: 16px; height: 16px; }
.user-btn{ position: static; transform: none; flex: none; }

/* ---- Accueil ---- */
.home-greeting{ font-size: 30px; font-weight: 700; margin: 12px 0 22px; }
.home-greeting .dim{ color: var(--text-muted); font-weight: 400; }

.home-quick{
  display:grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 34px;
}
.home-qtile{
  display:flex; align-items:center; gap: 14px; height: 66px;
  border-radius: 12px; overflow: hidden; cursor: pointer; position: relative;
  background: rgba(255,255,255,.045); border: 1px solid var(--border);
  transition: background .15s;
}
.home-qtile:hover{ background: rgba(255,255,255,.08); }
.home-qtile-cover{
  width: 66px; height: 66px; flex: none; border-radius: 0;
  display:flex; align-items:center; justify-content:center;
  font-weight: 700; color: rgba(255,255,255,.85);
}
.home-qtile-name{
  font-weight: 600; font-size: 14px; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-qtile-play{
  margin-left: auto; margin-right: 14px; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--violet), var(--accent-2));
  box-shadow: 0 6px 16px var(--glow);
  opacity: 0; transform: translateY(6px); transition: .18s;
}
.home-qtile:hover .home-qtile-play{ opacity: 1; transform: none; }
.home-qtile-play svg{ width: 16px; height: 16px; color: #fff; margin-left: 1px; }

.home-sec{ margin-bottom: 32px; }
.home-sec-head{
  display:flex; align-items:baseline; justify-content:space-between; margin-bottom: 14px;
}
.home-sec-head h2{ font-size: 20px; font-weight: 700; margin: 0; }

.home-rail{
  display:grid; grid-auto-flow: column; grid-auto-columns: 168px;
  gap: 18px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x proximity;
}
.home-rail::-webkit-scrollbar{ height: 8px; }
.home-rail::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.06); border-radius: 4px; }
.home-card{ scroll-snap-align: start; cursor: pointer; }
.home-card-art{
  position: relative; width: 168px; height: 168px; border-radius: 14px;
  overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  transition: transform .2s;
}
.home-card:hover .home-card-art{ transform: translateY(-4px); }
.home-card-cover{
  width: 100%; height: 100%;
  display:flex; align-items:center; justify-content:center;
  font-weight: 800; font-size: 26px; color: rgba(255,255,255,.85);
}
.home-card-play{
  position: absolute; right: 11px; bottom: 11px;
  width: 44px; height: 44px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--violet), var(--accent-2));
  box-shadow: 0 8px 22px var(--glow);
  opacity: 0; transform: translateY(8px); transition: .2s;
}
.home-card:hover .home-card-play{ opacity: 1; transform: none; }
.home-card-play svg{ width: 18px; height: 18px; color: #fff; margin-left: 2px; }
.home-card-title{
  margin-top: 11px; font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-card-sub{
  margin-top: 2px; font-size: 12.5px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Squelettes de chargement */
.skeleton{
  background: linear-gradient(100deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.04) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer{ 0%{ background-position: 200% 0; } 100%{ background-position: -200% 0; } }

/* ---- Pochettes de morceau (ombre légère) ---- */
.track-row-cover{ box-shadow: 0 2px 8px rgba(0,0,0,.35); }

/* ---- Dropzone ---- */
.dropzone{
  border-radius: 16px; padding: 54px 24px; gap: 12px;
  background: rgba(255,255,255,.02);
}
.dropzone:hover, .dropzone.is-dragover{
  border-color: var(--violet);
  background: var(--violet-soft);
  box-shadow: 0 0 0 4px rgba(139,124,246,.1) inset;
}
.dropzone-icon{ font-size: 30px; }

/* ---- Barre de lecture ---- */
.player{
  grid-template-columns: 320px 1fr 180px;
  background: linear-gradient(180deg, rgba(22,22,31,.72), rgba(12,12,19,.92));
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.player-cover{
  width: 56px; height: 56px; border-radius: 11px;
  box-shadow: 0 6px 18px rgba(0,0,0,.5);
}
.player-title{ font-size: 14px; }

/* Cœur du morceau en cours */
.player-like{
  flex: none; color: var(--text-muted); padding: 4px;
  display:flex; align-items:center; justify-content:center;
  transition: color .15s, transform .1s;
}
.player-like svg{ width: 19px; height: 19px; }
.player-like:hover{ color: var(--pink); }
.player-like:active{ transform: scale(.88); }
.player-like.is-fav{ color: var(--pink); }
.player-like.is-fav svg{ fill: var(--pink); }

/* Égaliseur signature — s'anime seulement pendant la lecture */
.player-eq{ display:flex; align-items:flex-end; gap: 2.5px; height: 17px; flex: none; margin-left: 2px; opacity: 0; transition: opacity .2s; }
.player.is-playing .player-eq{ opacity: 1; }
.player-eq span{
  width: 3px; height: 40%; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-2), var(--violet));
  transform: scaleY(.4); transform-origin: bottom;
}
.player.is-playing .player-eq span{ animation: eqbounce 1s ease-in-out infinite; }
.player-eq span:nth-child(1){ animation-delay: -.2s; }
.player-eq span:nth-child(2){ height: 90%; animation-delay: -.5s; }
.player-eq span:nth-child(3){ height: 60%; animation-delay: 0s; }
.player-eq span:nth-child(4){ height: 100%; animation-delay: -.35s; }
@keyframes eqbounce{ 0%,100%{ transform: scaleY(.35); } 50%{ transform: scaleY(1); } }

/* Transport en SVG */
.transport{ gap: 20px; }
.ctl-btn svg{ width: 19px; height: 19px; }
.ctl-btn-main{
  width: 42px; height: 42px;
  background: #fff; color: var(--bg);
  box-shadow: 0 4px 16px rgba(255,255,255,.16);
  transition: transform .14s, background .15s, color .15s;
}
.ctl-btn-main svg{ width: 20px; height: 20px; }
.ctl-btn-main:hover{ transform: scale(1.06); background:#fff; color: var(--bg); }
.ctl-btn.is-active{ color: var(--violet-2); }

/* Progression : poignée au survol + temps tabulaires */
.progress-row .time{ font-variant-numeric: tabular-nums; }
.progress-track{ height: 5px; }
.progress-fill{ position: relative; background: linear-gradient(90deg, var(--violet), var(--accent-2)); }
.progress-fill::after{
  content: ""; position: absolute; right: -6px; top: 50%;
  width: 12px; height: 12px; border-radius: 50%; background: #fff;
  transform: translateY(-50%) scale(0);
  box-shadow: 0 2px 6px rgba(0,0,0,.5); transition: transform .12s;
}
.progress-track:hover .progress-fill::after{ transform: translateY(-50%) scale(1); }

/* Accessibilité */
:focus-visible{ outline: 2px solid var(--violet-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce){
  .player-eq span, .skeleton{ animation: none !important; }
  .home-card-art, .home-qtile-play, .home-card-play{ transition: none; }
}

/* Mobile : la quick-grid passe en une colonne, rails inchangés */
@media (max-width: 760px){
  .home-quick{ grid-template-columns: 1fr; }
  .home-greeting{ font-size: 24px; }
  .player{ grid-template-columns: 1fr auto; }
}

/* Tab-bar mobile : icônes SVG un peu plus grandes que la sidebar */
.mobile-tabbar .nav-icon{ width: 22px; height: 22px; }
.mobile-tabbar .nav-icon svg{ width: 22px; height: 22px; }

/* Sidebar : la liste des playlists absorbe le débordement (scroll)
   et rien ne passe sous le lecteur. */
.sidebar{ overflow: hidden; }

/* Mobile : lecteur compact — on masque l'égaliseur et la pastille de source
   pour laisser respirer titre + cœur + transport sur écran étroit. */
@media (max-width: 760px){
  .player-eq{ display: none; }
  .player .cache-pill{ display: none; }
  .player-track{ gap: 10px; }
}

/* ===========================================================================
   Écran IMPORT redessiné (v25)
   =========================================================================== */

/* Dropzone : icône SVG, indice de formats, état désactivé plus lisible. */
.dropzone{ position: relative; }
.dropzone-icon{
  width: 46px; height: 46px; border-radius: 14px;
  display:flex; align-items:center; justify-content:center;
  background: var(--violet-soft); color: var(--violet-2);
  transition: transform .18s, background .18s;
}
.dropzone-icon svg{ width: 22px; height: 22px; }
.dropzone:hover .dropzone-icon, .dropzone.is-dragover .dropzone-icon{
  transform: translateY(-2px); background: rgba(139,124,246,.22);
}
.dropzone-text{ font-size: 14px; color: var(--text); font-weight: 500; }
.dropzone-text b{ color: var(--violet-2); font-weight: 600; }
.dropzone-hint{ font-size: 12px; color: var(--text-muted); }
.dropzone.is-disabled{ opacity: .45; }

.import-locked-note{
  max-width: 560px; margin: -8px 0 16px;
  font-size: 12.5px; color: var(--ondemand);
}
.import-locked-note.is-hidden{ display: none; }

/* Carte de progression */
.import-progress-card{
  max-width: 560px; margin: 18px 0 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px;
}
.import-progress-head{
  display:flex; align-items:center; gap: 10px; margin-bottom: 12px;
}
.import-spinner{
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid rgba(139,124,246,.25); border-top-color: var(--violet-2);
  animation: importspin .7s linear infinite;
}
@keyframes importspin{ to{ transform: rotate(360deg); } }
.import-progress-label{ font-size: 13.5px; font-weight: 600; flex: 1; min-width: 0; }
.import-progress-count{ font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.import-progress-bar{
  height: 7px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; position: relative;
}
.import-progress-fill{
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--accent-2));
  transition: width .35s ease;
}
.import-progress-bar.indeterminate .import-progress-fill{
  width: 40% !important; position: absolute; left: 0;
  animation: importslide 1.1s ease-in-out infinite;
}
@keyframes importslide{
  0%{ left: -40%; } 100%{ left: 100%; }
}

/* Récap de résultat */
.import-summary{
  display:flex; align-items:center; gap: 14px; flex-wrap: wrap;
  max-width: 560px; margin: 18px 0 12px;
  font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -.01em;
}
.import-summary-chip{
  font-family: var(--font); font-weight: 600; font-size: 12px;
  padding: 4px 10px; border-radius: 99px;
}
.import-summary-chip.ok{ color: var(--cached); background: var(--cached-soft); }
.import-summary-chip.skip{ color: var(--ondemand); background: var(--ondemand-soft); }

/* Liste (file d'attente + résultats) */
.import-list{ display:flex; flex-direction:column; gap: 4px; max-width: 560px; }
.import-row{
  display:flex; align-items:center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  background: rgba(255,255,255,.02); border: 1px solid var(--border);
}
.import-row.pending{ opacity: .7; }
.import-row.error{ border-color: rgba(255,120,120,.25); }
.import-row-cover{
  width: 40px; height: 40px; border-radius: 8px; flex: none;
  display:flex; align-items:center; justify-content:center;
  font-weight: 700; font-size: 12px; color: rgba(255,255,255,.85);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.import-row-cover.err{ background: rgba(255,120,120,.14); color: #ff9a9a; }
.import-row-main{ flex: 1; min-width: 0; }
.import-row-title{
  font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.import-row-sub{
  font-size: 12px; color: var(--text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.import-chip{
  flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 99px;
}
.import-chip.wait{ color: var(--text-muted); background: var(--surface-2); }
.import-chip.ok{ color: var(--cached); background: var(--cached-soft); }
.import-chip.skip{ color: var(--ondemand); background: var(--ondemand-soft); }
.import-row .playlist-add-btn{ flex: none; }

@media (prefers-reduced-motion: reduce){
  .import-spinner, .import-progress-bar.indeterminate .import-progress-fill{ animation: none; }
}

/* Bouton « télécharger tout l'album » posé sur le coin de la pochette.
   Autonome : ne dépend d'aucune autre règle. */
.cat-album-cover{ position: relative; }
.album-dl-btn{
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
  transition: transform .15s ease, background .15s ease, opacity .15s ease;
}
.album-dl-btn:hover{ transform: scale(1.08); background: var(--violet-2); }
.album-dl-btn:disabled{ cursor: progress; opacity: .85; transform: none; }
.album-dl-btn.is-busy{
  font-size: 12px;
  letter-spacing: -.3px;
  animation: albumDlPulse 1.2s ease-in-out infinite;
}
@keyframes albumDlPulse{
  0%,100%{ box-shadow: 0 2px 10px var(--glow); }
  50%    { box-shadow: 0 2px 22px var(--glow); }
}
