/* Musique : design v3.
   PC : en-tête global (accueil + recherche + compte), bibliothèque à gauche, page au centre, barre de lecture.
   Mobile : onglets en bas, mini-lecteur teinté par la pochette, lecteur plein écran avec carte de paroles.
   La couleur des pages et du lecteur (--tint, --np-tint) est tirée des pochettes par ui.js. */

@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(../fonts/inter-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #121212;
  --panel: #181818;
  --panel-2: #1f1f1f;
  --elev: #242424;
  --hover: #2a2a2a;
  --line: #2e2e2e;
  --text: #fff;
  --muted: #b3b3b3;
  --dim: #727272;
  --accent: #1ed760;
  --accent-2: #3be477;
  --danger: #f15e6c;
  --radius: 8px;
  --head-h: 64px;
  --player-h: 72px;
  --tab-h: 54px;
  --mini-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.3, .7, .4, 1);
  --np-tint: #3a3a3a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: #000; color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow: hidden; overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; }
h1 { font-size: 32px; font-weight: 700; letter-spacing: -.03em; margin: 8px 0 20px; line-height: 1.15; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h3 { font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 48px 16px; }
.ic { fill: currentColor; flex: none; }
[hidden] { display: none !important; }

/* Barres de défilement discrètes (sans flèches) : fine pastille arrondie, visible au survol de la zone */
::-webkit-scrollbar { width: 12px; height: 12px; background: transparent; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; min-height: 40px; }
:hover::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,.22); }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.4); }
::-webkit-scrollbar-thumb:active { background-color: rgba(255,255,255,.55); }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; } }
/* Paroles et lecteur plein écran : défilement sans barre, comme les apps de streaming */
.np-lyrics, .np-body, .np-lyrics *, .menu { scrollbar-width: none; }
.np-lyrics::-webkit-scrollbar, .np-body::-webkit-scrollbar, .menu::-webkit-scrollbar { display: none; width: 0; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.m-only { display: none !important; }

/* =====================================================================
   Mise en page PC
   ===================================================================== */
.app {
  display: grid; height: 100dvh; gap: 8px; padding: 0 8px;
  grid-template-columns: var(--side-w, 300px) minmax(0, 1fr) auto;
  grid-template-rows: var(--head-h) minmax(0, 1fr) var(--player-h);
  grid-template-areas: "head head head" "side main queue" "player player player";
}
.panel { background: var(--bg); border-radius: var(--radius); }

/* En-tête global */
.gh { grid-area: head; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 4px; min-width: 0; }
.gh-nav, .gh-right { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.gh-right { justify-content: flex-end; }
.gh-center { display: flex; align-items: center; gap: 8px; flex: 0 1 560px; min-width: 0; }
.gh-home { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2);
  color: var(--muted); transition: transform .15s, color .15s, background .15s; }
.gh-home:hover { color: var(--text); transform: scale(1.04); background: var(--hover); }
.gh-home.active { color: var(--text); }
.gh-search { flex: 1; min-width: 0; height: 48px; border-radius: 999px; background: var(--panel-2); display: flex; align-items: center; gap: 12px;
  padding: 0 18px 0 14px; color: var(--muted); font-size: 15px; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.gh-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gh-search:hover { background: var(--hover); border-color: #3a3a3a; color: var(--text); }
.gh-search.active { visibility: hidden; }
.gh-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--panel-2);
  color: var(--muted); font-weight: 700; font-size: 13px; transition: color .15s, transform .15s; }
.gh-pill:hover, .gh-pill.active { color: var(--text); transform: scale(1.03); }
.avatar-btn { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--panel-2); flex: none;
  transition: transform .15s; }
.avatar-btn:hover { transform: scale(1.05); }
.avatar-btn .avatar { width: 32px; height: 32px; font-size: 14px; }
.avatar-btn.active .avatar { box-shadow: 0 0 0 2px var(--text); }
.nav-btn { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.7); color: var(--text);
  transition: transform .1s, opacity .2s; flex: none; }
.nav-btn:hover:not(:disabled) { transform: scale(1.06); }
.nav-btn:disabled { opacity: .35; cursor: default; }

/* Bibliothèque (colonne de gauche) */
.sidebar { grid-area: side; display: flex; flex-direction: column; min-height: 0; padding: 8px 8px 0; position: relative; }
.lib-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 12px 12px; }
.lib-head { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 700; font-size: 16px; transition: color .15s;
  background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.lib-head:hover, .lib-head.active { color: var(--text); }
.round-btn { width: 32px; height: 32px; background: var(--panel-2); }
.round-btn:hover { background: var(--hover); }
.side-lists { list-style: none; margin: 0; padding: 0 0 8px; overflow-y: auto; flex: 1; }
.side-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 6px; transition: background .15s; }
.side-item:hover { background: #1a1a1a; }
.side-item.active { background: var(--panel-2); }
.side-item.active:hover { background: var(--hover); }
.side-art { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; background: var(--elev); display: grid; place-items: center; color: var(--dim); flex: none; }
.side-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.side-title { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item.active .side-title { color: var(--accent); }
.side-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.liked-art { background: linear-gradient(135deg, #450af5, #c4efd9) !important; color: #fff !important; display: grid; place-items: center; }
.dl-art { background: linear-gradient(135deg, #0b6b37, #1ed760) !important; color: #fff !important; display: grid; place-items: center; }
.device-art { background: linear-gradient(135deg, #1e3a8a, #60a5fa) !important; color: #fff !important; display: grid; place-items: center; }

/* Zone centrale : son fond prend la couleur de la pochette de la page (--tint) */
.main {
  grid-area: main; overflow-y: auto; overflow-x: hidden; position: relative; container-type: inline-size;
  --tint: #2a2a2a;
  background: linear-gradient(color-mix(in srgb, var(--tint) 88%, #121212) 0, #121212 340px) var(--bg);
  background-attachment: local;
}
.main:has(.greeting) { --tint: #1d3a2b; }
.main:has(.search-title) { --tint: #121212; }
.main:has(.hero-grad.liked) { --tint: #4b2fa8; }
.main:has(.hero-grad.dl) { --tint: #0f6a38; }
.main:has(.hero-grad.device) { --tint: #1e3a8a; }
.main:has(.account-card), .main:has(.stat-grid) { --tint: #26302b; }
.page > .hero-grad, .page > .hero-bg { display: none; }

/* Barre du haut de la page : posée sur le contenu, opaque (couleur de la page) au défilement */
.topbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 8px; height: 64px; margin-bottom: -64px;
  padding: 0 24px; pointer-events: none; transition: background .25s; }
.topbar .nav-btn { display: none; pointer-events: auto; }
.topbar.scrolled { background: color-mix(in srgb, var(--tint) 55%, #121212); }
.topbar-title { font-weight: 700; font-size: 22px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 70%; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s var(--ease); }
.topbar.titled .topbar-title { opacity: 1; transform: none; }

.page { --pt: 20px; padding: var(--pt) 24px 48px; position: relative; animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 40px 0 16px; }
.page-head h1 { margin: 0; }
.page-head-actions { display: flex; align-items: center; gap: 8px; }

/* File d'attente */
.queue { grid-area: queue; width: 340px; overflow: hidden; display: flex; flex-direction: column; }
.queue-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 8px 16px; }
.queue-head h2 { font-size: 16px; }
.queue-body { overflow-y: auto; padding: 0 8px 16px; }
.queue-body h3 { padding: 0 8px; font-size: 15px; }
.queue-empty { color: var(--dim); padding: 8px; }

/* =====================================================================
   Boutons et curseurs
   ===================================================================== */
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); position: relative;
  transition: color .15s, transform .1s, background .15s; }
.icon-btn:hover { color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.toggle.on { color: var(--accent); }
.icon-btn.toggle.on::after { content: ""; position: absolute; bottom: -3px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.icon-btn .one { display: none; position: absolute; top: 2px; right: 1px; font-size: 9px; background: var(--accent); color: #000; border-radius: 50%;
  width: 12px; height: 12px; line-height: 12px; text-align: center; }
.icon-btn.repeat-one .one { display: block; }
.icon-btn.big { width: 48px; height: 48px; color: var(--text); }
.icon-btn.lg { width: 40px; height: 40px; }
.icon-btn.lg svg { width: 24px; height: 24px; }
.play-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: #000; transition: transform .1s; flex: none; }
.play-btn:hover { transform: scale(1.06); }
.play-btn:active { transform: scale(.95); }
.play-btn.huge { width: 64px; height: 64px; }
.play-btn.accent { width: 56px; height: 56px; background: var(--accent); box-shadow: 0 8px 18px rgba(0,0,0,.3); }
.play-btn.accent:hover { background: var(--accent-2); transform: scale(1.04); }
.play-btn.accent svg { width: 24px; height: 24px; }
.play-btn .i-pause, body.playing .play-btn .i-play { display: none; }
body.playing .play-btn .i-pause { display: block; }
.link-btn { color: var(--muted); font-weight: 600; font-size: 13px; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 24px; border-radius: 999px; background: var(--text);
  color: #000; font-weight: 700; transition: transform .1s, background .15s; }
.btn:hover { transform: scale(1.04); }
.btn.ghost { background: none; color: var(--text); }
.btn.danger { background: var(--danger); color: #000; }
.btn.small { padding: 7px 16px; font-size: 13px; border: 1px solid #555; }
.btn.small:hover { border-color: #fff; }
.btn.outline { border: 1px solid #555; }
.btn.wide { width: 100%; max-width: 520px; padding: 12px; }
.btn.accent-small { background: var(--accent); color: #000; border: 0; }
.btn.accent-small:hover { background: var(--accent-2); }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; background: transparent; margin: 0; cursor: pointer; --p: 0%; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--text) var(--p), rgba(255,255,255,.3) var(--p)); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--text) var(--p), rgba(255,255,255,.3) var(--p)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; margin-top: -4px; opacity: 0;
  transition: opacity .15s; box-shadow: 0 2px 4px rgba(0,0,0,.5); }
.range::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; opacity: 0; }
.range:hover::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent) var(--p), rgba(255,255,255,.3) var(--p)); }
.range:hover::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { opacity: 1; }
.range:hover::-moz-range-thumb { opacity: 1; }

/* =====================================================================
   Barre de lecture (PC)
   ===================================================================== */
.player { grid-area: player; display: grid; grid-template-columns: minmax(180px, 30%) 1fr minmax(180px, 30%); align-items: center;
  padding: 0 8px; gap: 12px; background: #000; }
.pl-left { display: flex; align-items: center; gap: 14px; min-width: 0; cursor: pointer; }
.pl-art { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; background: var(--panel-2); flex: none; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.player[data-empty] .pl-art { visibility: hidden; }
.pl-meta { min-width: 0; }
.pl-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-title:hover { text-decoration: underline; }
.pl-artist { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-center { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 720px; width: 100%; justify-self: center; }
.pl-buttons { display: flex; align-items: center; gap: 16px; }
.pl-progress { display: flex; align-items: center; gap: 8px; width: 100%; }
.time { font-size: 11px; color: var(--muted); min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; }
.pl-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.pl-right .volume { width: 100px; }
.i-mute, body.muted .i-vol { display: none; }
body.muted .i-mute { display: block; }
.mini-play, .mini-bar { display: none; }
.player.loading .pl-art { animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .5; } }

/* =====================================================================
   Accueil : salutation, accès rapide, rayons de cartes
   ===================================================================== */
.home-head { display: flex; align-items: center; gap: 12px; margin: 40px 0 16px; }
.greeting { margin: 0; font-size: 32px; }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@container (max-width: 980px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.quick-tile { position: relative; display: flex; align-items: center; gap: 12px; height: 64px; padding-right: 12px; border-radius: 6px; overflow: hidden;
  background: rgba(255,255,255,.08); cursor: pointer; transition: background .2s; min-width: 0; }
.quick-tile:hover { background: rgba(255,255,255,.18); }
.quick-art { width: 64px; height: 64px; flex: none; background: var(--elev); display: grid; place-items: center; color: var(--dim);
  box-shadow: 4px 0 12px rgba(0,0,0,.35); }
.quick-art img { width: 100%; height: 100%; object-fit: cover; }
.quick-title { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quick-play { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--accent); color: #000; display: grid; place-items: center;
  opacity: 0; transform: scale(.9); transition: opacity .2s, transform .2s var(--ease); box-shadow: 0 6px 12px rgba(0,0,0,.35); }
.quick-tile:hover .quick-play { opacity: 1; transform: none; }
.quick-play:hover { background: var(--accent-2); transform: scale(1.06) !important; }
.quick-tile.current .quick-title { color: var(--accent); }
.quick .q-device { display: none; }
@media (max-width: 767px) { .quick .q-device:not([hidden]) { display: flex; } }

.shelf { margin: 32px 0 4px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.shelf-head h2:hover { text-decoration: none; }
.shelf-more { color: var(--muted); font-weight: 700; font-size: 13px; white-space: nowrap; }
.shelf-more:hover { text-decoration: underline; color: var(--text); }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 0px) / 6); gap: 0; overflow-x: auto; margin: 0 -12px;
  padding: 0 0 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shelf-row::-webkit-scrollbar { display: none; }
@container (max-width: 1300px) { .shelf-row { grid-auto-columns: calc(100% / 5); } }
@container (max-width: 1050px) { .shelf-row { grid-auto-columns: calc(100% / 4); } }
@container (max-width: 800px) { .shelf-row { grid-auto-columns: calc(100% / 3); } }
.card { display: block; padding: 12px; border-radius: var(--radius); transition: background .25s; cursor: pointer; scroll-snap-align: start; min-width: 0; }
.card:hover { background: var(--panel-2); }
.card-art { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--elev); display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); color: var(--dim); margin-bottom: 10px; }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-art.round { border-radius: 50%; overflow: visible; }
.card-art.round img { border-radius: 50%; }
.card-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-play { position: absolute; right: 8px; bottom: 8px; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #000;
  display: grid; place-items: center; box-shadow: 0 8px 8px rgba(0,0,0,.3); opacity: 0; transform: translateY(8px); cursor: pointer;
  transition: opacity .25s, transform .25s var(--ease), background .15s; }
.card:hover .card-play, .top-card:hover .card-play, .card.current .card-play { opacity: 1; transform: none; }
.card-play:hover { transform: scale(1.06) !important; background: var(--accent-2); }
.card.current .card-title { color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; margin: 0 -12px; }
.collage { width: 100%; height: 100%; display: grid; grid-template-columns: 1fr 1fr; place-items: center; color: var(--dim); background: var(--elev); }
.collage img { width: 100%; height: 100%; object-fit: cover; }
.collage img.one { grid-column: 1 / -1; grid-row: 1 / -1; }
.collage:not(:has(img)) { grid-template-columns: 1fr; }

/* =====================================================================
   Listes de morceaux
   ===================================================================== */
.tracks { list-style: none; margin: 0; padding: 0; }
.track { display: grid; grid-template-columns: 40px minmax(0, 4fr) minmax(0, 3fr) 96px 32px; align-items: center; gap: 14px; padding: 6px 12px;
  border-radius: 6px; cursor: pointer; transition: background .12s; }
.tracks:has(.n) .track { grid-template-columns: 24px minmax(0, 4fr) minmax(0, 3fr) 96px 32px; }
.tracks:not(:has(.n)) .track-n { display: none; }
.track:hover, .track:focus-visible { background: rgba(255,255,255,.08); }
.track-art { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: var(--elev); }
.track-n { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; }
.track-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.track-title { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-sub, .track-album { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-sub a:hover, .track-album a:hover { color: var(--text); text-decoration: underline; }
.track-dur { color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.track-end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.track-more { opacity: 0; }
.track:hover .track-more, .track:hover .track-n .n { opacity: 1; }
.track.current .track-title { color: var(--accent); }
.track.unavailable { opacity: .4; pointer-events: none; }
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; justify-content: flex-end; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq .9s infinite ease-in-out alternate; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { from { height: 3px; } to { height: 14px; } }
.track.current .eq { display: flex; }
.track.current .n { display: none; }
body:not(.playing) .eq i { animation-play-state: paused; }
.tracks.compact .track { grid-template-columns: 40px minmax(0, 1fr) 32px; padding: 6px 8px; }
.tracks.compact .track-album, .tracks.compact .track-dur, .tracks.compact .track-n, .tracks.compact .track-end { display: none; }
.like-btn .i-on, .like-btn.liked .i-off { display: none; }
.like-btn.liked .i-on { display: block; }
.like-btn.liked { color: var(--accent); }
.track .like-btn { opacity: 0; }
.track:hover .like-btn, .track .like-btn.liked { opacity: 1; }
.pl-left .like-btn { flex: none; }
.player[data-empty] .like-btn { display: none; }

/* =====================================================================
   En-têtes album / playlist / artiste
   ===================================================================== */
.hero { display: flex; align-items: flex-end; gap: 24px; padding: 48px 0 24px; min-height: 300px; }
.hero-art { width: 232px; height: 232px; object-fit: cover; border-radius: 6px; box-shadow: 0 4px 60px rgba(0,0,0,.5); flex: none; background: var(--elev); }
.hero-art .collage { border-radius: 6px; overflow: hidden; }
.hero-art:has(.collage) { display: block; }
.hero-art.liked-art svg, .hero-art.dl-art svg, .hero-art.device-art svg { width: 80px; height: 80px; }
.hero-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hero-kind { font-size: 14px; font-weight: 600; }
.hero-title { font-size: clamp(36px, 6cqw, 88px); line-height: 1.02; letter-spacing: -.045em; margin: 4px 0 10px; font-weight: 800;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.hero-desc { color: rgba(255,255,255,.7); margin: 0; font-size: 14px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; color: rgba(255,255,255,.75); }
.hero-meta .strong { font-weight: 700; color: var(--text); }
.hero-meta a:hover { text-decoration: underline; }
.editable { cursor: pointer; }
.editable:hover { text-decoration: underline; text-decoration-thickness: 3px; }

/* Artiste : grande bannière, nom posé dessus */
.hero.artist { position: relative; isolation: isolate; overflow: hidden; margin: calc(-1 * var(--pt)) -24px 0; padding: 0 24px 28px;
  min-height: clamp(300px, 42cqw, 440px); align-items: flex-end; }
.hero-banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; z-index: -2; }
.hero.artist::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(rgba(0,0,0,.05) 30%, rgba(0,0,0,.35) 70%, rgba(0,0,0,.6)); }
.hero.artist .hero-title { font-size: clamp(44px, 8cqw, 96px); text-shadow: 0 2px 30px rgba(0,0,0,.35); margin-bottom: 4px; }
.hero.artist .hero-kind { display: inline-flex; align-items: center; gap: 6px; }
.hero.artist .hero-meta { color: #fff; font-size: 15px; }

/* Rangée d'actions sous l'en-tête */
.actions { display: flex; align-items: center; gap: 20px; padding: 20px 0 22px; }
.about { color: var(--muted); white-space: pre-line; max-width: 800px; margin: 16px 0 24px; font-size: 15px; line-height: 1.6; }

/* Discographie complète d'un artiste */
.releases-head { flex-direction: column; align-items: flex-start; gap: 10px; }
.releases-head .chips { margin: 4px 0 0; }
.releases-artist { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: 14px; }
.releases-artist:hover { color: var(--text); }
.releases-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.main:has(.releases-head) { --tint: #2b2b33; }

/* =====================================================================
   Recherche
   ===================================================================== */
.search-title { display: none; }
.search-box { position: sticky; top: 8px; z-index: 7; display: flex; align-items: center; gap: 10px; max-width: 520px; height: 48px;
  padding: 0 8px 0 14px; margin: 12px 0 24px; background: var(--elev); border-radius: 999px; border: 1px solid transparent;
  transition: border-color .2s, background .2s; color: var(--muted); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.search-box:hover { background: var(--hover); border-color: #3a3a3a; }
.search-box:focus-within { border-color: #fff; background: var(--hover); color: var(--text); }
.search-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 16px; }
.search-box input::placeholder { color: var(--muted); }
.search-box input::-webkit-search-cancel-button { display: none; }
.suggest { position: absolute; top: 54px; left: 0; right: 0; list-style: none; margin: 0; padding: 6px 0; background: #282828; border-radius: 10px;
  box-shadow: 0 16px 32px rgba(0,0,0,.6); color: var(--text); }
.suggest:empty { display: none; }
.suggest li { padding: 10px 16px; cursor: pointer; display: flex; gap: 12px; align-items: center; }
.suggest li:hover, .suggest li.sel { background: #3e3e3e; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; }
.chip { padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.08); font-weight: 500; font-size: 14px; transition: background .15s; }
.chip:hover { background: rgba(255,255,255,.16); }
.chip.active { background: var(--text); color: #000; }
.filters { position: sticky; top: 64px; z-index: 5; }
.search-top { display: grid; grid-template-columns: minmax(280px, 2fr) 3fr; gap: 24px; margin-bottom: 8px; }
.search-top h2, section > h2 { margin-bottom: 12px; }
.top-card { position: relative; display: block; padding: 20px; border-radius: var(--radius); background: var(--panel); transition: background .2s; cursor: pointer; min-height: 220px; }
.top-card:hover { background: var(--panel-2); }
.top-card img { width: 96px; height: 96px; border-radius: 6px; object-fit: cover; box-shadow: 0 8px 24px rgba(0,0,0,.5); margin-bottom: 20px; }
.top-card img.round { border-radius: 50%; }
.top-title { font-size: 30px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-sub { color: var(--muted); margin-top: 6px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #121212; color: var(--text); font-size: 12px; font-weight: 700; }
.top-card .card-play { right: 20px; bottom: 20px; }
.recent-searches { margin-bottom: 28px; }

.browse h2 { margin-bottom: 16px; }
.browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.browse-tile { position: relative; overflow: hidden; aspect-ratio: 1.6; border-radius: 8px; padding: 14px 16px; background: var(--c);
  font-weight: 800; font-size: 22px; letter-spacing: -.02em; line-height: 1.15; transition: transform .15s; }
.browse-tile span { position: relative; z-index: 1; display: block; max-width: 75%; }
.browse-tile::after { content: ""; position: absolute; width: 42%; aspect-ratio: 1; right: -6%; bottom: -8%; transform: rotate(25deg);
  border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.35);
  background: linear-gradient(135deg, rgba(255,255,255,.45), rgba(255,255,255,.08) 55%, rgba(0,0,0,.25)); }
.browse-tile:hover { transform: scale(1.02); }

/* =====================================================================
   Lecteur plein écran « En cours de lecture »
   ===================================================================== */
.np { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; overflow: hidden; padding-top: var(--safe-t);
  background: linear-gradient(color-mix(in srgb, var(--np-tint) 92%, #000) 0%, color-mix(in srgb, var(--np-tint) 45%, #000) 55%, #0b0b0b 100%);
  transform: translateY(100%); transition: transform .4s var(--ease), background .6s; visibility: hidden; }
.np.open { transform: none; visibility: visible; }
.np-bg { display: none; }
.np-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex: none; }
.np-head .icon-btn { color: var(--text); width: 40px; height: 40px; }
.np-source { text-align: center; min-width: 0; display: flex; flex-direction: column; }
.np-source small { text-transform: uppercase; letter-spacing: .12em; font-size: 10px; color: rgba(255,255,255,.75); font-weight: 600; }
.np-source span { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 480px); gap: 56px; padding: 16px 64px 32px;
  align-items: center; max-width: 1240px; width: 100%; margin: 0 auto; }
.np-art-wrap { display: grid; place-items: center; min-height: 0; height: 100%; }
.np-art { width: min(100%, 62vh); aspect-ratio: 1; object-fit: cover; border-radius: 8px; box-shadow: 0 24px 64px rgba(0,0,0,.55);
  transition: transform .35s var(--ease); background: rgba(0,0,0,.2); }
body:not(.playing) .np-art { transform: scale(.94); }
.np-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; max-height: 100%; }
.np-meta { display: flex; align-items: center; gap: 8px; }
.np-meta-text { flex: 1; min-width: 0; }
.np-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-artist { color: rgba(255,255,255,.72); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-meta .like-btn { color: rgba(255,255,255,.8); }
.np-meta .like-btn.liked { color: var(--accent); }
.np-progress .range::-webkit-slider-thumb { opacity: 1; }
.np-progress .range::-moz-range-thumb { opacity: 1; }
.np-times { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,.7); margin-top: 2px; font-variant-numeric: tabular-nums; }
.np-buttons { display: flex; align-items: center; justify-content: space-between; }
.np-buttons .icon-btn.toggle { width: 44px; height: 44px; color: rgba(255,255,255,.8); }
.np-buttons .icon-btn.toggle.on { color: var(--accent); }
.np-extra { display: flex; align-items: center; justify-content: space-between; margin-top: -4px; }
.np-extra .icon-btn { color: rgba(255,255,255,.8); width: 40px; height: 40px; }

/* Cadre des paroles : angles droits, une seule couleur (celle de la pochette), ligne chantée en blanc.
   Aucun élément plus large que le cadre : il ne défile que verticalement. */
.np-lyrics { --lyr-bg: color-mix(in srgb, var(--np-tint) 70%, #000); position: relative; border-radius: 0; padding: 0;
  overflow-x: hidden; overflow-y: auto; min-height: 140px; scroll-behavior: smooth; overscroll-behavior: contain;
  background: var(--lyr-bg); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 12px 34px rgba(0,0,0,.35); }
.lyr-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 14px 12px 20px; background: var(--lyr-bg); border-bottom: 1px solid rgba(255,255,255,.08); }
.lyr-head h3 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.85); }
.lyr-full-btn { width: 32px; height: 32px; border-radius: 0; background: rgba(255,255,255,.1); color: #fff; }
.lyr-full-btn:active { background: rgba(255,255,255,.2); }
.lyr-full-btn .i-close, .np-lyrics.full .lyr-full-btn .i-open { display: none; }
.np-lyrics.full .lyr-full-btn .i-close { display: block; }
#lyr-body { padding: 0 20px 18px; }
.lyr { padding: 12px 0 45%; }
.lyr p { margin: 0; padding: 6px 0; font-size: 22px; font-weight: 800; line-height: 1.35; color: rgba(255,255,255,.38);
  transition: color .35s; letter-spacing: -.01em; overflow-wrap: anywhere; text-align: start; }
.lyr.synced p { cursor: pointer; }
.lyr.synced p:hover { color: rgba(255,255,255,.7); }
.lyr p.past { color: rgba(255,255,255,.55); }
.lyr p.on { color: #fff; }
.lyr p.gap { font-size: 15px; letter-spacing: .4em; }
.lyr.plain p { color: #fff; font-size: 19px; font-weight: 700; cursor: default; }
.lyr-src { color: rgba(255,255,255,.55); font-size: 12px; margin-top: 18px; }
.np-lyrics .muted { color: rgba(255,255,255,.8); margin: 14px 0 18px; font-weight: 600; }
/* Plein écran */
.np-lyrics.full { position: fixed; inset: 0; z-index: 45; max-height: none !important; min-height: 0; border: 0; box-shadow: none;
  padding: 0 0 calc(24px + var(--safe-b)); animation: slideup .28s var(--ease); --lyr-bg: color-mix(in srgb, var(--np-tint) 62%, #000); }
.np-lyrics.full .lyr-head { padding: calc(var(--safe-t) + 14px) 18px 12px 26px; }
.np-lyrics.full #lyr-body { padding: 0 26px 18px; }
.np-lyrics.full .lyr p { font-size: 27px; padding: 8px 0; }

/* =====================================================================
   Bibliothèque (page)
   ===================================================================== */
.lib-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px; margin: 0 -12px 8px; }
.lib-item { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 8px; text-align: left;
  transition: background .2s; min-width: 0; width: 100%; cursor: pointer; }
.lib-item:hover { background: var(--panel-2); }
.lib-art { position: relative; width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden; display: grid; place-items: center;
  background: var(--elev); color: var(--dim); box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.lib-art img { width: 100%; height: 100%; object-fit: cover; }
.lib-art svg { width: 44px; height: 44px; }
.lib-new .lib-art { box-shadow: none; border: 2px dashed #3a3a3a; background: transparent; }
.lib-new:hover .lib-art { border-color: #777; color: var(--text); }
.lib-text { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.lib-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-play { position: absolute; right: 8px; bottom: 8px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #000;
  display: grid; place-items: center; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s var(--ease); box-shadow: 0 8px 8px rgba(0,0,0,.3); }
.lib-play svg { width: 20px !important; height: 20px !important; }
.lib-item:hover .lib-play { opacity: 1; transform: none; }

/* =====================================================================
   Menu ⋯, boîte de dialogue, notifications
   ===================================================================== */
.menu-backdrop { position: fixed; inset: 0; z-index: 80; cursor: pointer; }
.menu { position: fixed; z-index: 81; min-width: 240px; max-width: 330px; max-height: min(70vh, 480px); overflow-y: auto; padding: 4px; border-radius: 8px;
  background: #282828; box-shadow: 0 16px 24px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.05); animation: pop .14s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }
.menu button { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 11px 12px; border-radius: 4px; font-size: 14px; }
.menu button .ml { flex: 1; min-width: 0; }
.menu button:hover { background: #3e3e3e; }
.menu hr { border: 0; border-top: 1px solid #3e3e3e; margin: 4px 0; }
.menu hr:last-child, .menu hr + hr { display: none; }
.menu .chev { color: var(--muted); font-size: 18px; line-height: 1; }
.menu .mi { display: none; width: 24px; height: 24px; flex: none; fill: currentColor; color: var(--muted); }
.menu-empty { color: var(--muted); padding: 8px 12px; margin: 0; }
.menu-head { display: flex; gap: 12px; align-items: center; padding: 8px 12px 14px; border-bottom: 1px solid #3e3e3e; margin-bottom: 4px; }
.menu-head img { width: 52px; height: 52px; border-radius: 4px; object-fit: cover; }
.menu-head .t { font-weight: 700; } .menu-head .s { color: var(--muted); font-size: 13px; }
.menu button.danger-item, .menu button.danger-item .mi { color: var(--danger); }
.menu button.on-item .mi { color: var(--accent); }
/* Téléphone : feuille qui monte du bas, icônes, fermeture en glissant vers le bas */
.menu.sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; max-width: none; max-height: 82vh; border-radius: 14px 14px 0 0;
  padding: 6px 8px calc(14px + var(--safe-b)); animation: slideup .26s var(--ease); background: #242424; box-shadow: 0 -8px 30px rgba(0,0,0,.5);
  overscroll-behavior: contain; transition: transform .2s var(--ease); }
.menu.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: #5a5a5a; margin: 4px auto 10px; }
.menu.sheet .mi { display: block; }
.menu.sheet button { padding: 13px 10px; font-size: 16px; border-radius: 8px; gap: 16px; }
.menu.sheet button:hover { background: none; }
.menu.sheet button:active { background: rgba(255,255,255,.08); }
.menu.sheet hr { border-top-color: rgba(255,255,255,.06); margin: 6px 10px; }
.menu.sheet .menu-head { gap: 14px; padding: 4px 10px 16px; margin: 0 0 6px; border-bottom-color: rgba(255,255,255,.08); }
.menu.sheet .menu-head img { width: 56px; height: 56px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.menu.sheet .menu-head img.round { border-radius: 50%; }
.menu.sheet .menu-head > div { min-width: 0; }
.menu.sheet .menu-head .t { font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu.sheet .menu-head .s { margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu.sheet .menu-head .s svg { display: none; }
.menu.sheet.closing { transform: translateY(100%) !important; }
.menu-backdrop:has(+ .menu.sheet) { background: rgba(0,0,0,.6); transition: opacity .2s; }
.menu-backdrop.closing { opacity: 0; }
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }

.dlg { border: 0; border-radius: 12px; padding: 0; background: #282828; color: var(--text); width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 48px rgba(0,0,0,.6); }
.dlg::backdrop { background: rgba(0,0,0,.7); }
.dlg form { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { font-size: 22px; }
.dlg p { margin: 0; }
#dlg-text { white-space: pre-line; }
.dlg label, .stack-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dlg input, .dlg textarea, .dlg select, .stack-form input { font: inherit; font-size: 16px; color: var(--text); background: #3a3a3a; border: 1px solid transparent;
  border-radius: 6px; padding: 10px 12px; outline: 0; resize: vertical; }
.dlg input:focus, .dlg textarea:focus, .dlg select:focus, .stack-form input:focus { border-color: #999; background: #333; }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--player-h) + 24px); transform: translate(-50%, 20px); background: #fff; color: #000;
  padding: 10px 18px; border-radius: 8px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease);
  z-index: 60; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Chargement d'une page : cercle qui tourne au centre (n'apparaît que si ça dure plus de 0,25 s) */
.loadbar { position: fixed; left: 50%; top: 50%; z-index: 70; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(24,24,24,.88); box-shadow: 0 8px 24px rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transform: scale(.8); pointer-events: none;
  transition: opacity .15s, transform .15s var(--ease); }
.loadbar i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--accent);
  animation: spin .7s linear infinite; }
.loadbar.on { opacity: 1; transform: none; transition-delay: .25s; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 768px) { .loadbar { left: calc(50% + 154px); top: calc(50% + 32px); } }
.tabbar { display: none; }
.offline-banner { position: fixed; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 90; background: #e9a100; color: #000;
  font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 999px; }

/* =====================================================================
   Connexion
   ===================================================================== */
.login-page { overflow: auto; background: linear-gradient(#1d3a2b, #121212 55%); min-height: 100dvh; }
.login { max-width: 360px; margin: 0 auto; padding: calc(56px + var(--safe-t)) 24px 48px; display: flex; flex-direction: column; gap: 28px; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-logo img { border-radius: 18px; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.login-logo h1 { margin: 0; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.login-form input:not([type=checkbox]) { font: inherit; font-size: 16px; color: var(--text); background: #121212; border: 1px solid #727272; border-radius: 6px;
  padding: 12px 14px; outline: 0; transition: border-color .15s; }
.login-form input:focus { border-color: #fff; box-shadow: 0 0 0 1px #fff; }
.login-remember { flex-direction: row !important; align-items: center; font-weight: 500 !important; color: var(--muted); }
.login-remember input { accent-color: var(--accent); width: 18px; height: 18px; }
.accent-btn { background: var(--accent); padding: 14px; font-size: 16px; margin-top: 8px; }
.accent-btn:disabled { opacity: .5; transform: none; cursor: not-allowed; }
.login-error { margin: 0; padding: 12px 14px; border-radius: 6px; background: #e91429; color: #fff; font-weight: 600; }

/* =====================================================================
   Téléchargements et hors connexion
   ===================================================================== */
.dl-folder { font-size: 12px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.icon-btn.dl-all.on { color: var(--accent); }
.track.dl-done .track-sub::before, .track.dl-busy .track-sub::before {
  content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 5h2v8.2l3-3 1.4 1.4L12 17l-5.4-5.4L8 10.2l3 3z'/%3E%3C/svg%3E") center / 11px no-repeat; }
.track.dl-busy .track-sub::before { background-color: #777; animation: pulse 1s infinite alternate; }
.dl-list { list-style: none; margin: 0; padding: 0; }
.dl-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 32px; gap: 12px; align-items: center; padding: 6px 12px; border-radius: 6px; }
.dl-row .track-art { width: 40px; height: 40px; }
.dl-bar { display: block; height: 3px; background: #3a3a3a; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.dl-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s; }
.dl-row[data-dl-status=error] .dl-bar { display: none; }
.dl-err { color: var(--danger); }
/* Bouton rond « disponible hors connexion » : cercle gris vide, vert plein une fois enregistré,
   anneau vert qui se remplit pendant l'enregistrement */
.dev-btn { color: var(--muted); }
.dev-ring { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; }
.dev-ring svg { width: 20px !important; height: 20px !important; fill: currentColor; }
.dev-btn.on { color: var(--accent); }
.dev-btn.on .dev-ring { background: var(--accent); }
.dev-btn.on .dev-ring svg { fill: #000; }
.dev-btn.busy .dev-ring { border-color: rgba(255,255,255,.22); color: #fff; }
.dev-btn.busy .dev-ring::before { content: ""; position: absolute; inset: -2px; border-radius: 50%;
  background: conic-gradient(var(--accent) var(--p, 0%), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); }
/* Titre enregistré sur l'appareil : petite flèche verte devant l'artiste (comme dans la bibliothèque) */
.track.dev-done .track-sub::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px;
  border-radius: 50%; flex: none;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 5h2v8.2l3-3 1.4 1.4L12 17l-5.4-5.4L8 10.2l3 3z'/%3E%3C/svg%3E") center / 12px no-repeat; }
.notice { background: #1f2937; border: 1px solid #374151; border-radius: 10px; padding: 14px 16px; margin: 8px 0 16px; color: #d1d5db; font-size: 14px; line-height: 1.5; }
.notice code { background: #111827; padding: 1px 5px; border-radius: 4px; }

/* =====================================================================
   Comptes et administration
   ===================================================================== */
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; font-weight: 800; font-size: 15px; }
.avatar.big { width: 72px; height: 72px; font-size: 30px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.badge.role-admin { background: rgba(250, 204, 21, .15); color: #facc15; }
.badge.role-user { background: rgba(255,255,255,.08); color: var(--muted); }
.badge.state-on { background: rgba(30, 215, 96, .14); color: var(--accent); }
.badge.state-off { background: rgba(241, 94, 108, .15); color: var(--danger); }
.badge { font-weight: 700; font-size: 11px; padding: 3px 8px; }
.tag { font-size: 11px; font-weight: 700; color: #000; background: var(--text); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 6px 0 8px; }
.stat-grid.small { grid-template-columns: repeat(3, 1fr); max-width: 620px; }
.stat { background: rgba(255,255,255,.06); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-icon { color: var(--accent); display: flex; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-value small { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-grid.small .stat { align-items: center; text-align: center; padding: 12px 8px; }
.stat-grid.small .stat-value { font-size: 22px; }
.user-list { display: flex; flex-direction: column; gap: 6px; }
.user-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 36px; gap: 12px; align-items: center; background: rgba(255,255,255,.05);
  border-radius: 12px; padding: 12px 10px 12px 14px; }
.user-row .avatar { width: 40px; height: 40px; }
.user-row.inactive { opacity: .6; }
.user-row.inactive .avatar { background: #444; color: #ddd; }
.user-name { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-badges { display: flex; gap: 6px; margin: 4px 0; flex-wrap: wrap; }
.user-stats { font-size: 12.5px; line-height: 1.4; }
.small-text { font-size: 12.5px; margin-top: 18px; overflow-wrap: anywhere; }
.account-card { display: flex; align-items: center; gap: 18px; padding: 8px 0 20px; }
.account-name { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.account-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 13px; }
.settings-link { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.06); border-radius: 12px; padding: 14px; margin: 14px 0; max-width: 620px; }
.settings-link:hover { background: rgba(255,255,255,.1); }
.settings-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(250,204,21,.12); color: #facc15; flex: none; }
.settings-text { flex: 1; display: flex; flex-direction: column; font-size: 13px; }
.settings-text strong { font-size: 15px; }
.form-card { background: rgba(255,255,255,.05); border-radius: 12px; padding: 18px 16px; margin: 14px 0; max-width: 620px; }
.form-card h2 { font-size: 17px; margin-bottom: 12px; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.stack-form .btn { align-self: flex-start; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important; }
.device-list { list-style: none; margin: 0 0 12px; padding: 0; }
.device-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
.device-row:last-child { border-bottom: 0; }
.device-icon { color: var(--muted); display: flex; }
.device-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.device-text .muted { font-size: 12.5px; overflow-wrap: anywhere; }
.device-here { color: var(--accent); font-weight: 600; }
.flash { padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; margin: 0 0 12px; }
.flash.ok { background: rgba(30,215,96,.14); color: var(--accent); }
.flash.error { background: rgba(241,94,108,.15); color: #f87171; }
.logout-form { margin: 8px 0 24px; }

/* =====================================================================
   Largeur réelle de la zone centrale (file d'attente ouverte, tablette)
   ===================================================================== */
@container (max-width: 860px) {
  .search-top { grid-template-columns: 1fr; }
  .track { grid-template-columns: 40px minmax(0, 1fr) 96px 32px; }
  .tracks:has(.n) .track { grid-template-columns: 24px minmax(0, 1fr) 96px 32px; }
  .track-album { display: none; }
}

/* Tablette : bibliothèque réduite aux pochettes */
@media (max-width: 1100px) and (min-width: 768px) {
  .app { grid-template-columns: 84px minmax(0, 1fr) auto; }
  .lib-head span, .lib-top-actions, .side-text, .side-chips, .side-tools, .side-resizer { display: none; }
  .lib-top { justify-content: center; padding: 12px 0; }
  .side-item { justify-content: center; }
  .nowview { width: 300px; }
  .queue { width: 300px; }
  .gh-pill span { display: none; }
}

/* =====================================================================
   Mobile (iPhone)
   ===================================================================== */
@media (max-width: 767px) {
  .m-only { display: inline-grid !important; }
  body { background: var(--bg); }
  .app { display: block; padding: 0; height: 100dvh; }
  .gh, .sidebar { display: none; }
  .main { position: fixed; inset: 0; border-radius: 0; padding-top: 0;
    padding-bottom: calc(var(--tab-h) + var(--mini-h) + 20px + var(--safe-b));
    background: linear-gradient(color-mix(in srgb, var(--tint) 85%, #121212) 0, #121212 300px) var(--bg); background-attachment: local; }
  .main:has(.greeting) { --tint: #1f3329; }

  /* Barre du haut : chevron iOS posé sur la page, titre centré au défilement */
  .topbar { height: calc(44px + var(--safe-t)); margin-bottom: calc(-44px - var(--safe-t)); padding: var(--safe-t) 4px 0; }
  .topbar.no-back { display: flex; height: var(--safe-t); margin-bottom: calc(-1 * var(--safe-t)); padding: 0; }
  .topbar.no-back > * { display: none !important; }
  .topbar.no-back.scrolled { background: color-mix(in srgb, var(--tint) 55%, #121212); }
  .topbar .nav-btn[data-action=nav-back] { display: grid; width: 40px; height: 40px; background: rgba(0,0,0,.35); }
  .topbar.scrolled .nav-btn { background: none; }
  .topbar-title { position: absolute; left: 50%; transform: translate(-50%, 6px); max-width: 62%; font-size: 16px; }
  .topbar.titled .topbar-title { transform: translate(-50%, 0); }
  .page { --pt: calc(8px + var(--safe-t)); padding: var(--pt) 16px 24px; }
  .topbar:not(.no-back) + .page { --pt: calc(48px + var(--safe-t)); }

  h1 { font-size: 26px; }
  h2 { font-size: 21px; }
  .page-head { margin: 8px 0 16px; }
  .home-head { margin: 8px 0 14px; gap: 12px; }
  .home-head .avatar-btn { width: 34px; height: 34px; background: none; }
  .home-head .avatar { width: 34px; height: 34px; font-size: 14px; }
  .greeting { font-size: 24px; }

  /* Accès rapide : 2 colonnes */
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .quick-tile { height: 56px; gap: 10px; padding-right: 8px; border-radius: 4px; background: rgba(255,255,255,.1); }
  .quick-tile:hover { background: rgba(255,255,255,.1); }
  .quick-tile:active { background: rgba(255,255,255,.2); }
  .quick-art { width: 56px; height: 56px; }
  .quick-title { font-size: 12.5px; }
  .quick-play { display: none; }
  .quick:has(.q-device:not([hidden])) .q-dl { display: none; }

  /* Rayons */
  .shelf { margin: 26px 0 0; }
  .shelf-head { margin-bottom: 10px; }
  .shelf-head h2 { font-size: 21px; }
  .shelf-row { grid-auto-columns: 148px !important; gap: 14px; margin: 0 -16px; padding: 0 16px 4px; scroll-padding: 0 16px; }
  .card { padding: 0; }
  .card:hover { background: none; }
  .card:active { opacity: .7; }
  .card-art { margin-bottom: 8px; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
  .card-title { font-size: 13px; }
  .card-sub { font-size: 12px; }
  .card-play { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 -8px; }
  .releases-grid { gap: 18px 14px; margin: 4px 0 0; }

  /* Morceaux */
  .track, .tracks:has(.n) .track { grid-template-columns: 48px minmax(0, 1fr) 36px; padding: 6px 0; gap: 12px; border-radius: 0; }
  .tracks:has(.n) .track { grid-template-columns: 22px minmax(0, 1fr) 36px; }
  .track:hover { background: none; }
  .track:active { background: rgba(255,255,255,.08); }
  .track-art { width: 48px; height: 48px; border-radius: 2px; }
  .track-album, .track-end { display: none !important; }
  .track-n { font-size: 14px; text-align: left; }
  .track-title { font-size: 15.5px; font-weight: 500; }
  .track-sub { font-size: 13px; }
  .track-more { opacity: 1; color: var(--muted); }
  .tracks.compact .track { grid-template-columns: 48px minmax(0, 1fr) 36px; }

  /* Album / playlist : pochette centrée, texte à gauche, lecture à droite */
  .hero { flex-direction: column; align-items: stretch; text-align: left; min-height: 0; padding: 8px 0 4px; gap: 18px; }
  .hero-art { align-self: center; width: min(64vw, 270px); height: min(64vw, 270px); box-shadow: 0 12px 40px rgba(0,0,0,.55); border-radius: 4px; }
  .hero-art.liked-art svg, .hero-art.dl-art svg, .hero-art.device-art svg { width: 64px; height: 64px; }
  .hero-text { gap: 4px; }
  .hero-title { font-size: 24px; letter-spacing: -.02em; margin: 0; -webkit-line-clamp: 3; order: -1; }
  .hero-kind { font-size: 13px; color: var(--muted); font-weight: 500; }
  .hero-meta { font-size: 13px; }
  .hero-desc { font-size: 13px; }

  /* Artiste : photo pleine largeur jusqu'en haut */
  .hero.artist { margin: calc(-1 * var(--pt)) -16px 0; padding: 0 16px 16px; min-height: min(100vw, 400px); gap: 0; justify-content: flex-end; align-items: stretch; }
  .hero.artist .hero-title { font-size: 44px; letter-spacing: -.04em; order: 0; }
  .hero.artist .hero-kind { display: none; }
  .hero.artist .hero-meta { font-size: 13px; color: rgba(255,255,255,.85); }

  .actions { gap: 16px; padding: 4px 0 14px; }
  .actions .icon-btn.lg { width: 36px; height: 36px; }
  .actions .icon-btn.lg svg { width: 24px; height: 24px; }
  .actions .play-btn.accent { order: 10; margin-left: 0; width: 52px; height: 52px; }
  .actions [data-action=shuffle-all] { order: 9; margin-left: auto; margin-right: 2px; color: var(--muted); }
  .actions [data-action=shuffle-all] svg { width: 28px; height: 28px; }
  .actions .icon-btn.lg { color: var(--muted); }
  .actions .icon-btn.lg.dev-btn.on, .actions .save-btn.on { color: var(--accent); }

  /* Recherche */
  .search-title { display: block; font-size: 26px; margin: 8px 0 14px; }
  .search-box { top: calc(6px + var(--safe-t)); height: 46px; max-width: none; margin: 0 0 22px; border-radius: 6px; background: #fff; color: #121212;
    border: 0; box-shadow: 0 0 0 8px var(--bg); }
  .search-box:hover, .search-box:focus-within { background: #fff; color: #121212; }
  .search-box input { color: #121212; font-weight: 500; }
  .search-box input::placeholder { color: #535353; }
  .search-box .icon-btn { color: #535353; }
  .suggest { top: 52px; }
  .filters { top: calc(60px + var(--safe-t)); padding: 4px 0; margin: -10px -16px 12px; padding: 6px 16px; background: var(--bg); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .search-top { grid-template-columns: 1fr; gap: 20px; }
  .top-card { min-height: 0; display: flex; align-items: center; gap: 14px; padding: 12px; }
  .top-card img { width: 64px; height: 64px; margin: 0; }
  .top-title { font-size: 18px; }
  .top-card .card-play { display: none; }
  .browse h2 { font-size: 17px; margin-bottom: 12px; }
  .browse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .browse-tile { aspect-ratio: 1.75; font-size: 16px; padding: 10px 12px; border-radius: 6px; }
  .browse-tile:hover { transform: none; }
  .browse-tile:active { transform: scale(.97); }

  /* Bibliothèque en liste */
  .lib-list { grid-template-columns: 1fr; gap: 0; margin: 0 0 8px; }
  .lib-item { flex-direction: row; align-items: center; gap: 12px; padding: 7px 0; border-radius: 0; }
  .lib-item:hover { background: none; }
  .lib-item:active { background: rgba(255,255,255,.06); }
  .lib-art { width: 64px; height: 64px; flex: none; border-radius: 4px; box-shadow: none; }
  .lib-art svg { width: 26px; height: 26px; }
  .lib-new .lib-art { border-width: 1.5px; }
  .lib-title { font-size: 15.5px; font-weight: 500; }
  .lib-play { display: none; }
  .page-head .btn.small { padding: 6px 12px; font-size: 12px; }
  .page-head .btn.accent-small span { display: none; }
  .page-head .btn.accent-small { padding: 8px; border-radius: 50%; }

  /* Mini-lecteur teinté au-dessus des onglets */
  .player { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tab-h) + var(--safe-b) + 2px); height: var(--mini-h); z-index: 20;
    display: flex; align-items: center; gap: 4px; padding: 0 6px 0 8px; border-radius: 8px;
    background: color-mix(in srgb, var(--np-tint) 72%, #000); box-shadow: 0 8px 24px rgba(0,0,0,.45); overflow: hidden;
    transition: transform .3s var(--ease), opacity .3s, background .6s; }
  .player[data-empty] { transform: translateY(20px); opacity: 0; pointer-events: none; }
  .pl-left { flex: 1; gap: 10px; }
  .pl-art { width: 40px; height: 40px; box-shadow: none; }
  .pl-title { font-size: 13.5px; font-weight: 600; }
  .pl-title:hover { text-decoration: none; }
  .pl-artist { font-size: 12.5px; color: rgba(255,255,255,.72); }
  .pl-left .pl-meta { flex: 1; min-width: 0; } /* le cœur passe tout à droite, contre le bouton lecture */
  .pl-left .like-btn { color: rgba(255,255,255,.9); width: 40px; height: 40px; margin-right: -2px; }
  .pl-left .like-btn svg { width: 22px; height: 22px; }
  .pl-left .like-btn.liked { color: var(--accent); }
  .pl-center, .pl-right { display: none; }
  .mini-play { display: grid; background: none; color: var(--text); width: 40px; height: 40px; }
  .mini-play:hover { transform: none; }
  .mini-bar { display: block; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; background: rgba(255,255,255,.25); border-radius: 1px; }
  .mini-bar i { display: block; height: 100%; width: var(--p, 0%); background: #fff; border-radius: 1px; }

  /* Onglets */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; height: calc(var(--tab-h) + var(--safe-b));
    padding: 6px 0 var(--safe-b); background: rgba(8,8,8,.96); -webkit-backdrop-filter: blur(20px) saturate(1.3); backdrop-filter: blur(20px) saturate(1.3); }
  .tabbar::before { content: ""; position: absolute; inset: -40px 0 auto; height: 40px; pointer-events: none;
    background: linear-gradient(rgba(18,18,18,0), rgba(0,0,0,.55)); z-index: -1; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted);
    font-size: 10.5px; font-weight: 500; transition: color .15s; }
  .tabbar a.active { color: var(--text); font-weight: 600; }
  .tabbar a:active svg { transform: scale(.9); }
  .tabbar svg { width: 24px; height: 24px; transition: transform .1s; }

  .queue { position: fixed; inset: 0; z-index: 50; width: auto; border-radius: 0; padding-top: var(--safe-t); padding-bottom: var(--safe-b);
    animation: slideup .3s var(--ease); }

  /* Lecteur plein écran (iPhone 16 Pro Max : 430 × 932) */
  .np-head { padding: 6px 12px; }
  .np-body { display: flex; flex-direction: column; gap: 0; padding: 4px 24px calc(28px + var(--safe-b)); overflow-y: auto; align-items: stretch; }
  .np-body > * { flex: none; }
  .np-art-wrap { height: auto; padding: 3vh 0 4vh; }
  .np-art { width: 100%; max-width: 420px; border-radius: 8px; }
  .np-side { gap: 12px; max-height: none; }
  .np-title { font-size: 22px; }
  .np-artist { font-size: 15.5px; }
  .np-buttons { margin-top: -4px; }
  .np-buttons .icon-btn.big svg { width: 34px; height: 34px; }
  .np-buttons .play-btn.huge { width: 66px; height: 66px; }
  .np-extra { margin: 2px 0 14px; }
  .np-lyrics { min-height: 260px; max-height: 64vh; }
  .lyr p { font-size: 21px; }
  .np-lyrics { max-height: 62vh; }

  .toast { bottom: calc(var(--tab-h) + var(--mini-h) + 24px + var(--safe-b)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-grid.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { padding: 12px; }
  .stat-value { font-size: 24px; }
  .form-card { padding: 16px 14px; }
  .dl-row { grid-template-columns: 48px minmax(0, 1fr) auto 32px; padding: 6px 0; }
  .dl-row .track-art { width: 48px; height: 48px; }
  .account-card { padding-top: 4px; }
}

/* Téléphone avec stockage hors connexion : pas de téléchargement sur le serveur (vert), seulement « Sur cet appareil » */
@media (max-width: 767px) {
  body.device-mode .dl-all, body.device-mode .q-dl, body.device-mode .lib-item[href="/downloads"] { display: none !important; }
  body.device-mode .track.dl-done:not(.dev-done) .track-sub::before, body.device-mode .track.dl-busy:not(.dev-done) .track-sub::before { display: none; }
}

/* Petits iPhone (SE, mini) */
@media (max-width: 380px) {
  .shelf-row { grid-auto-columns: 128px !important; }
  .hero-title { font-size: 22px; }
  .hero.artist .hero-title { font-size: 36px; }
  .browse-tile { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   Bibliothèque : filtres, tri, vue liste / grille, épingles
   ===================================================================== */
.lib-page-head { margin-bottom: 10px; }
.lib-title-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lib-chips { margin: 0 0 6px; }
.lib-tools { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.lib-sort { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13px; padding: 6px 0; }
.lib-sort:hover { color: var(--text); }
.lib-tools .i-list, .lib-grid .lib-tools .i-grid { display: none; }
.lib-grid .lib-tools .i-list { display: inline; }
.lib-item.filtered-out { display: none !important; }
.lib-item .pin-mark { display: none; color: var(--accent); margin-right: 5px; vertical-align: -2px; }
.lib-item[data-pinned="1"] .pin-mark { display: inline-block; }
.lib-art.round, .lib-art.round img { border-radius: 50%; }
.lib-more { display: none; }
.side-art.round { border-radius: 50%; }
.lib-art .collage { position: absolute; inset: 0; }

/* Vue liste (par défaut) */
.lib-list:not(.grid-view) { grid-template-columns: 1fr; gap: 2px; margin: 0 -8px 8px; }
.lib-list:not(.grid-view) .lib-item { flex-direction: row; align-items: center; gap: 14px; padding: 8px; }
.lib-list:not(.grid-view) .lib-art { width: 64px; height: 64px; flex: none; border-radius: 4px; box-shadow: none; }
.lib-list:not(.grid-view) .lib-art svg { width: 26px; height: 26px; }
.lib-list:not(.grid-view) .lib-play { display: none; }
.lib-list:not(.grid-view) .lib-text { flex: 1; }
.lib-list:not(.grid-view) .lib-more { display: inline-grid; flex: none; opacity: 0; }
.lib-list:not(.grid-view) .lib-item:hover .lib-more { opacity: 1; }

/* Vue grille : 3 colonnes sur téléphone, comme les apps de streaming */
.lib-list.grid-view { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

/* Bouton « Ajouter à la bibliothèque » (cercle +, puis coche verte) */
.save-btn .i-on, .save-btn.on .i-off { display: none; }
.save-btn.on .i-on { display: block; }
.save-btn.on { color: var(--accent); }

/* Photo de profil */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit { position: relative; border-radius: 50%; flex: none; }
.avatar-cam { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: #000; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.avatar-edit:hover .avatar { filter: brightness(.85); }

/* Image d'une playlist perso : survol = « Changer l'image » */
.cover-edit { position: relative; overflow: hidden; padding: 0; cursor: pointer; }
.cover-hint { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(0,0,0,.6); color: #fff; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .2s; }
.cover-edit:hover .cover-hint, .cover-edit:focus-visible .cover-hint { opacity: 1; }

@media (max-width: 767px) {
  .lib-page-head { margin: 8px 0 12px; }
  .lib-title-row h1 { font-size: 24px; }
  .lib-title-row .avatar-btn { width: 34px; height: 34px; background: none; }
  .lib-title-row .avatar { width: 34px; height: 34px; font-size: 14px; }
  .lib-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 4px; padding: 0 16px; }
  .lib-chips .chip { white-space: nowrap; border: 1px solid #535353; background: transparent; padding: 7px 14px; }
  .lib-chips .chip.active { background: var(--accent); border-color: var(--accent); color: #000; }
  .lib-list:not(.grid-view) { margin: 0 0 8px; gap: 0; }
  .lib-list:not(.grid-view) .lib-item { padding: 7px 0; }
  .lib-list:not(.grid-view) .lib-more { display: inline-grid; opacity: 1; color: var(--muted); margin-right: -8px; }
  .lib-item, .lib-item *, .track, .track * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
  .lib-item, .track { transition: transform .45s var(--ease), background-color .2s; }
  .lib-item.pressing, .track.pressing { transform: scale(.97); background: rgba(255,255,255,.06); }
  .lib-list.grid-view { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; margin: 0 0 8px; }
  .lib-list.grid-view .lib-item { flex-direction: column; align-items: stretch; padding: 0; gap: 8px; }
  .lib-list.grid-view .lib-art { width: 100%; height: auto; aspect-ratio: 1; border-radius: 4px; }
  .lib-list.grid-view .lib-title { font-size: 13px; }
  .lib-list.grid-view .lib-sub { font-size: 12px; }
  .lib-list.grid-view .lib-play { display: none; }
  .cover-hint { opacity: 0; }
}

/* Flèche verte « téléchargé sur l'appareil » devant le sous-titre */
.dl-mark { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 5h2v8.2l3-3 1.4 1.4L12 17l-5.4-5.4L8 10.2l3 3z'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* =====================================================================
   Hors connexion
   ===================================================================== */
.offline-screen { min-height: 62vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 12px; padding: 48px 24px; }
.offline-screen h1 { margin: 8px 0 0; font-size: 26px; }
.offline-screen p { margin: 0 0 12px; color: var(--muted); max-width: 320px; line-height: 1.5; }
.offline-icon { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--elev); color: var(--muted); }
.offline-screen .accent-btn { padding: 14px 26px; margin: 0; }
.main:has(.offline-screen) { --tint: #121212; }
/* Bibliothèque hors connexion : seulement la musique de l'appareil */
.offline-mode [data-lib-chips] .chip:not([data-filter="offline"]), .offline-mode #historique, .offline-mode .lib-new,
.offline-mode .lib-item[data-kind="downloads"], .offline-mode [data-action="playlist-new"], .offline-mode a[href="/search"] { display: none !important; }
.offline-mode [data-lib-chips] .chip[data-filter="offline"] { pointer-events: none; }

/* Image impossible à charger : masquée (pas d'icône « ? »), le fond gris de la pochette reste */
img.img-broken { visibility: hidden; }

/* Bandeau « Hors connexion » : bande fine en bas, au-dessus de la barre de lecture (PC) ou des onglets (mobile) */
.offline-banner { position: fixed; left: 0; right: 0; top: auto; bottom: var(--player-h); transform: none; z-index: 25; height: 26px;
  display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 0; padding: 0;
  background: #2a2a2a; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .01em; box-shadow: 0 -1px 0 rgba(255,255,255,.05); }
.offline-banner .ic { color: var(--muted); }
@media (max-width: 767px) {
  .offline-banner { bottom: calc(var(--tab-h) + var(--safe-b)); background: rgba(34,34,34,.97); }
  body.is-offline .player { bottom: calc(var(--tab-h) + var(--safe-b) + 26px + 4px); }
  body.is-offline .main { padding-bottom: calc(var(--tab-h) + var(--mini-h) + 50px + var(--safe-b)); }
}

/* Bouton lecture des pages : pause quand cette liste est en cours */
.play-btn .pp-pause, .play-btn.is-active .pp-play { display: none; }
.play-btn.is-active .pp-pause { display: block; }

/* Playlist perso : propriétaire avec sa photo */
.hero-owner { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.hero-owner .avatar { width: 24px; height: 24px; font-size: 11px; }

/* Recherche : une catégorie entière en grille */
.search-grid { margin-top: 4px; }
.filters .chip { white-space: nowrap; }
@media (max-width: 767px) { .search-grid { gap: 18px 14px; margin: 4px 0 0; } }

/* « Afficher plus » des résultats de recherche */
.load-more { display: flex; margin: 24px auto 8px; padding: 10px 28px; font-size: 14px; }

/* Tuiles « Parcourir tout » : titre en haut à gauche, pochette inclinée en bas à droite */
.browse-tile::after { display: none; }
.browse-tile span { max-width: 62%; }
.browse-art { position: absolute; width: 46%; aspect-ratio: 1; right: -8%; bottom: -6%; transform: rotate(25deg) translate(6px, 6px);
  border-radius: 4px; object-fit: cover; box-shadow: 0 4px 14px rgba(0,0,0,.45); opacity: 0; transition: opacity .35s, transform .35s var(--ease); }
.browse-art.shown { opacity: 1; transform: rotate(25deg); }
@media (max-width: 767px) {
  .browse-tile { aspect-ratio: 1.65; }
  .browse-tile span { font-size: 15.5px; line-height: 1.2; }
}

/* Réglage du pays */
.stack-form select { font: inherit; font-size: 16px; color: var(--text); background: #2a2a2a; border: 1px solid #3a3a3a; border-radius: 8px; padding: 11px 12px; outline: 0; }
.region-help { margin: -4px 0 12px; }

/* Tirer pour actualiser (téléphone) */
.ptr { position: fixed; z-index: 60; left: 50%; top: calc(var(--safe-t) + 10px); width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: #2a2a2a; box-shadow: 0 4px 14px rgba(0,0,0,.5); color: var(--muted);
  transform: translate(-50%, -56px); opacity: 0; pointer-events: none; }
.ptr svg { width: 22px; height: 22px; fill: currentColor; }
.ptr.ready { color: var(--accent); }
.ptr.back { transition: transform .25s var(--ease), opacity .25s; }
.ptr.spin { color: var(--accent); opacity: 1; transition: transform .2s var(--ease); }
.ptr.spin svg { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (max-width: 767px) {
  .main { overscroll-behavior-y: none; } /* plus de grande zone vide quand on tire en haut */
}

/* Bouton « Mode hors connexion » (Compte, en haut à droite) */
.offline-toggle { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--muted); flex: none; }
.offline-toggle.on { background: var(--accent); color: #000; }
.offline-screen .btn.ghost { margin-top: 10px; }

/* =====================================================================
   PC : bibliothèque réductible / redimensionnable, panneau « En cours de lecture »
   ===================================================================== */
.lib-top-actions { display: flex; align-items: center; gap: 4px; }
.side-expand { opacity: 0; transition: opacity .15s, color .15s; }
.sidebar:hover .side-expand, .side-expand:focus-visible { opacity: 1; }
.side-chips { display: flex; gap: 8px; padding: 0 8px 4px; overflow-x: auto; scrollbar-width: none; flex: none; }
.side-chips::-webkit-scrollbar { display: none; }
.side-chips .chip { flex: none; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--panel-2); color: var(--text);
  font-size: 14px; font-weight: 500; border: 0; cursor: pointer; transition: background .15s; }
.side-chips .chip:hover { background: var(--hover); }
.side-chips .chip.active { background: var(--text); color: #000; }
.side-chip-clear { width: 32px; padding: 0 !important; display: grid; place-items: center; }
.side-tools { display: flex; align-items: center; gap: 6px; padding: 8px 8px 4px; flex: none; }
.side-search { flex: 1; min-width: 0; height: 32px; border-radius: 4px; border: 0; background: var(--panel-2); color: var(--text);
  padding: 0 10px; font: inherit; font-size: 13px; outline: none; }
.side-sort { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer; padding: 4px 4px 4px 8px; white-space: nowrap; transition: color .15s; }
.side-sort:hover { color: var(--text); }
.sidebar.searching .side-sort span { display: none; }
.side-sub { display: flex; align-items: center; gap: 0; }
.side-pin { fill: var(--accent); margin-right: 6px; flex: none; }
.side-dl { margin-right: 6px; }
.side-empty { color: var(--muted); font-size: 14px; padding: 16px 12px; }
.side-resizer { position: absolute; top: 0; bottom: 0; right: -6px; width: 8px; cursor: col-resize; z-index: 3; }
.side-resizer::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: 3px; width: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
.side-resizer:hover::after, body.resizing .side-resizer::after { background: rgba(255,255,255,.3); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing * { pointer-events: none; }

/* Bibliothèque réduite : colonne de pochettes */
.app.side-mini .lib-head span, .app.side-mini .lib-top-actions, .app.side-mini .side-text,
.app.side-mini .side-chips, .app.side-mini .side-tools { display: none; }
.app.side-mini .lib-top { justify-content: center; padding: 12px 0; }
.app.side-mini .side-item { justify-content: center; }

/* Panneau « En cours de lecture » (à la place de la file d'attente) */
.nowview { grid-area: queue; width: var(--right-w, 340px); position: relative; overflow: hidden; display: flex; flex-direction: column;
  background: linear-gradient(color-mix(in srgb, var(--np-tint, #2a2a2a) 45%, #121212) 0, #121212 420px) var(--bg); }
.nowview[hidden] { display: none; }
.nv-resizer { position: absolute; top: 0; bottom: 0; left: 0; width: 8px; cursor: col-resize; z-index: 3; }
.nv-resizer::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: 0; width: 2px; border-radius: 2px; transition: background .15s; }
.nv-resizer:hover::after, body.resizing .nv-resizer::after { background: rgba(255,255,255,.3); }
.nv-head { display: flex; align-items: center; gap: 4px; padding: 14px 10px 8px 16px; flex: none; }
.nv-source { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 20px; }
.nv-art { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--elev);
  box-shadow: 0 8px 28px rgba(0,0,0,.45); }
.nowview.empty .nv-art { visibility: hidden; height: 0; aspect-ratio: auto; }
.nv-meta { display: flex; align-items: center; gap: 12px; margin: 16px 0 18px; }
.nv-text { flex: 1; min-width: 0; }
.nv-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-artist { color: var(--muted); font-size: 15px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowview.empty .like-btn { display: none; }
.nv-lyrics-slot .np-lyrics { max-height: 380px; margin-bottom: 18px; }
.nv-lyrics-slot .lyr p { font-size: 18px; }
.nv-lyrics-slot .lyr { padding-bottom: 30%; }
.nowview.empty .nv-lyrics-slot { display: none; }
.nv-next { background: rgba(255,255,255,.06); border-radius: 8px; padding: 12px 8px 8px; }
.nv-next-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 6px; }
.nv-next-head h3 { margin: 0; font-size: 15px; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--text); text-decoration: underline; }
.nv-next .tracks.compact .track { cursor: pointer; }
@media (max-width: 767px) {
  .nowview, .side-resizer, [data-action=nowview-toggle] { display: none !important; }
}

/* Accueil : filtres, flèches des rangées */
.home-chips { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.home-chips .chip { border: 0; color: var(--text); cursor: pointer; font-family: inherit; }
.home-chips .chip.active { background: var(--text); color: #000; }
.page[data-home-filter] .quick { display: none; }
.card.f-hide, .shelf.f-hide { display: none !important; }
.shelf-head { align-items: center; }
.shelf-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.shelf-head > h2 { flex: 1; min-width: 0; }
.row-arrows { display: flex; gap: 6px; }
.row-arrow { width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.45); color: var(--text); display: grid; place-items: center;
  border: 0; cursor: pointer; transition: background .15s, opacity .15s; }
.row-arrow:hover:not(:disabled) { background: var(--hover); }
.row-arrow:disabled { opacity: .3; cursor: default; }
.shelf-row { scroll-behavior: smooth; }

/* Plein écran, mini-lecteur, raccourcis */
.np-head-right { display: flex; align-items: center; gap: 4px; }
.d-only { }
.gh-keys { width: 40px; height: 40px; }
.keys-dlg { width: min(520px, calc(100vw - 32px)); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 4px 0; align-items: center; }
.keys dt { white-space: nowrap; color: var(--muted); font-size: 13px; }
.keys dd { margin: 0; font-size: 14px; }
kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 4px; background: #3e3e3e; color: #fff; font: 600 12px/1.4 inherit;
  text-align: center; box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); }
.dlg-actions { display: flex; justify-content: flex-end; }
@media (max-width: 767px) {
  .home-chips, .row-arrows, .d-only, .gh-keys, [data-action=pip] { display: none !important; }
}

/* Boutons-pilules : « S'abonner » (artiste, playlist partagée), « Ajouter une copie » */
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px; border-radius: 999px; border: 1px solid #7c7c7c;
  background: none; color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, transform .1s; }
.pill-btn:hover { border-color: var(--text); transform: scale(1.03); }
.pill-btn svg { fill: currentColor; }
.follow-pill .i-on, .follow-pill.on .i-off { display: none !important; }
.follow-pill.on .i-on { display: inline !important; }
.follow-pill.on { color: var(--text) !important; border-color: var(--text); }
.share-hint { margin: -6px 0 14px; font-size: 13px; }
.hero-owner-name b { color: var(--text); }

/* Boîte « Partager la playlist » */
.share-dlg { width: min(460px, calc(100vw - 32px)); }
.share-name { margin-top: -8px; font-weight: 600; }
.share-code-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 10px;
  background: rgba(255,255,255,.07); }
.share-code { font: 800 26px/1 ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: .08em; color: var(--accent); user-select: all; }
.share-link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }
.share-link svg { fill: currentColor; }
.share-modes { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.share-modes legend { font-weight: 700; font-size: 14px; margin-bottom: 6px; padding: 0; }
.share-dlg .share-modes label { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  color: var(--text); font-size: 14px; font-weight: 400; }
.share-modes label:hover { background: rgba(255,255,255,.05); }
.share-dlg .share-modes input { accent-color: var(--accent); margin: 3px 0 0; padding: 0; width: 16px; height: 16px; flex: none; background: none; border: 0; }
.share-modes span { display: flex; flex-direction: column; gap: 2px; }
.share-modes b { font-size: 14px; }
.share-modes small { color: var(--muted); font-size: 12.5px; }
.share-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.share-foot .btn { margin-left: auto; }
.link-btn.danger { color: #f87171; }
@media (max-width: 767px) {
  .share-code { font-size: 22px; }
  .share-code-box { flex-direction: column; align-items: stretch; text-align: center; }
  .actions .pill-btn { order: 1; }
}
