.hero {
  --hero-pad-top: 96px;
  position: relative;
  padding: var(--hero-pad-top) var(--gutter) var(--sp-6);
  color: var(--white);
  background: linear-gradient(180deg, rgba(var(--tint), 0.9) 0%, rgba(var(--tint), 0.55) 100%);
  transition: background 0.4s;
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 260px; background: linear-gradient(rgba(var(--tint), 0.42), transparent); pointer-events: none; }
.hero a { color: var(--white); }
.hero a:hover { text-decoration: underline; }
.hero-inner { position: relative; z-index: var(--z-raised); display: flex; align-items: flex-end; gap: var(--sp-6); }
.hero-cover { width: clamp(150px, 20vw, 232px) !important; height: auto !important; aspect-ratio: 1; box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5); border-radius: var(--r-sm); }
.hero.round .hero-cover { border-radius: 50%; }
.hero-text { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.hero-kind { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-caption); font-weight: 700; }
.hero-title { font-size: clamp(34px, 6.2vw, 92px); font-weight: 850; letter-spacing: -0.045em; line-height: 0.98; overflow-wrap: anywhere; padding-bottom: var(--sp-2); }
.hero-title.medium { font-size: clamp(30px, 4.6vw, 64px); }
.hero-title.long { font-size: clamp(26px, 3.4vw, 46px); letter-spacing: -0.03em; line-height: 1.05; }
.hero-desc { color: rgba(255, 255, 255, 0.78); font-size: var(--fs-caption); max-width: 72ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-size: var(--fs-caption); color: rgba(255, 255, 255, 0.85); }
.hero-owner { font-weight: 700; color: var(--white); }
.hero-meta .dot { opacity: 0.6; }
.hero.with-banner { min-height: clamp(300px, 42vh, 440px); display: flex; align-items: flex-end; background: rgb(var(--tint)); }
.hero-banner { position: absolute; inset: 0; background-size: cover; background-position: center 25%; }
.hero-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 30%, var(--scrim-strong) 100%); }
.verified { display: inline-grid; color: #3d91f4; --verified-check: var(--white); }
.liked-hero { --tint: 72, 50, 170; }
.page-body { position: relative; z-index: var(--z-raised); padding: 0 var(--gutter); }
.view-content[data-route="home"] { background: linear-gradient(180deg, rgba(var(--home-tint, 31, 92, 62), 0.55) 0, transparent 340px); }
.home-head { padding: 92px var(--gutter) var(--sp-5); }
.home-head h1 { font-size: var(--fs-title); font-weight: 850; letter-spacing: -0.03em; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: var(--sp-3); padding: 0 var(--gutter); }
.quick-tile { position: relative; display: flex; align-items: center; gap: var(--sp-4); height: 64px; padding-right: var(--sp-3); border-radius: var(--r-sm); background: var(--tile-bg); overflow: hidden; transition: background 0.2s; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.quick-tile:hover { background: color-mix(in srgb, var(--tile-bg) 85%, var(--text)); }
.quick-tile .cover { border-radius: 0; box-shadow: 4px 0 12px rgba(0, 0, 0, 0.25); }
.quick-tile .cover.round { border-radius: 50%; margin-left: var(--sp-2); width: 52px; height: 52px; }
.quick-link { flex: 1; min-width: 0; font-weight: 700; font-size: var(--fs-body); }
.quick-link span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-link::after { content: ""; position: absolute; inset: 0; z-index: var(--z-raised); }
.quick-tile .play-fab { width: 40px; height: 40px; opacity: 0; transform: none; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.quick-tile .play-fab .icon { width: 18px; height: 18px; }
.quick-tile:hover .play-fab, .quick-tile:focus-within .play-fab, .quick-tile .play-fab[aria-label="Pause"] { opacity: 1; }
.shelves { padding: 0 var(--gutter); }
.search-head { position: sticky; top: 0; z-index: var(--z-sticky); padding: 76px var(--gutter) var(--sp-1); background: linear-gradient(var(--bg-2) 82%, transparent); }
.search-box { display: flex; align-items: center; gap: var(--sp-3); max-width: 640px; height: 50px; padding: 0 var(--sp-2) 0 var(--sp-4); border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-3); border: 2px solid transparent; transition: border-color 0.15s, background 0.15s; }
.search-box:hover { background: var(--surface-3); }
.search-box:focus-within { border-color: var(--text-1); color: var(--text-1); }
.search-results { padding: 0 var(--gutter); }
.search-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--sp-5); margin-top: var(--sp-5); }
.search-top h2, .search-history h2 { font-size: var(--fs-section); font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--sp-4); }
.search-tracks .tracklist { --cols: minmax(0, 1fr) 40px 52px 36px; }
.search-tracks .tl-head, .search-tracks .tl-num { display: none; }
.top-title { font-size: var(--fs-title); font-weight: 850; letter-spacing: -0.03em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-result { position: relative; display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-5); border-radius: var(--radius); background: var(--surface); transition: background 0.2s; min-height: 236px; }
.top-result:hover { background: var(--surface-2); }
.top-result .cover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
a.top-title::after { content: ""; position: absolute; inset: 0; }
.top-sub { display: flex; align-items: center; gap: var(--sp-3); color: var(--text-2); font-size: var(--fs-caption); }
.top-result .play-fab { position: absolute; right: 20px; bottom: 20px; opacity: 0; transform: translateY(8px); }
.top-result:hover .play-fab, .top-result:focus-within .play-fab { opacity: 1; transform: none; }
.search-history { margin: var(--sp-5) 0 var(--sp-2); }
.history-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.history-chip { display: inline-flex; align-items: center; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.history-q { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-1) var(--sp-2) var(--sp-4); border: 0; background: none; color: var(--text-1); font-size: var(--fs-caption); }
.history-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: none; color: var(--text-3); }
.history-x:hover, .history-q:hover { color: var(--text-1); }
.about-card { position: relative; max-width: 760px; padding: var(--sp-6); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; gap: var(--sp-4); }
.about-card::before { content: ""; position: absolute; inset: 0; background-image: var(--about-img); background-size: cover; background-position: center 20%; opacity: 0.16; filter: blur(2px); }
.about-card > * { position: relative; }
.about-stats { display: flex; flex-wrap: wrap; gap: var(--sp-5); font-size: var(--fs-caption); color: var(--text-2); }
.about-stats strong { display: block; font-size: var(--fs-section); color: var(--text-1); letter-spacing: -0.02em; }
.bio { line-height: 1.65; color: var(--text-2); white-space: pre-line; }
.bio.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.library-grid { margin-top: var(--sp-2); }
.liked-card { grid-column: span 2; position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 240px; margin: var(--sp-3); padding: var(--sp-5); border-radius: var(--radius); color: var(--white); background: linear-gradient(135deg, #4a1fd8 0%, #7b6cf6 55%, #9fd3f5 100%); box-shadow: 0 10px 30px rgba(74, 31, 216, 0.25); transition: transform 0.2s; }
.liked-card:hover { transform: translateY(-2px); }
.liked-card h3 { font-size: var(--fs-title); font-weight: 850; letter-spacing: -0.03em; }
.liked-card p { color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.liked-card-icon { position: absolute; top: 20px; right: 20px; opacity: 0.9; }
@media (max-width: 1099px) {
  .search-top { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .quick-link { font-size: var(--fs-caption); }
  .top-title { font-size: var(--fs-section); }
  .hero { padding-bottom: var(--sp-5); --hero-pad-top: calc(64px + var(--safe-top)); }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
  .hero-cover { width: min(62vw, 250px) !important; align-self: center; }
  .hero-kind { font-size: var(--fs-caption); }
  .hero-title { font-size: clamp(28px, 9vw, 44px); }
  .hero-title.medium, .hero-title.long { font-size: clamp(24px, 7vw, 32px); }
  .hero.with-banner { min-height: 300px; }
  .search-tracks .tracklist { --cols: minmax(0, 1fr) 36px; }
  .home-head { padding-top: calc(72px + var(--safe-top)); }
  .quick-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
  .quick-tile { height: 56px; gap: var(--sp-3); }
  .quick-tile .cover { --size: 56px !important; width: 56px; height: 56px; }
  .quick-tile .cover.round { width: 44px; height: 44px; }
  .quick-tile .play-fab { display: none; }
  .liked-card { grid-column: span 2; min-height: 150px; }
  .search-head { padding-top: calc(64px + var(--safe-top)); }
  .top-result { min-height: 0; }
}
.quick-tile, .browse-tile { animation: rise 0.35s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
.top-search { display: flex; align-items: center; gap: var(--sp-3); width: min(420px, 38vw); height: 44px; margin: 0 auto; padding: 0 var(--sp-3) 0 var(--sp-4); border: 2px solid transparent; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-caption); transition: background 0.15s, border-color 0.15s; }
.top-search:hover { background: var(--surface-3); border-color: var(--line-strong); }
.top-search span { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search kbd { font-size: var(--fs-caption); }
body[data-route="search"] .top-search { visibility: hidden; }
.topbar.show-title .top-search { display: none; }
.browse { margin-top: var(--sp-6); }
.browse h2 { font-size: var(--fs-section); font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--sp-4); }
.browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-4); }
.browse-tile { position: relative; height: 112px; padding: var(--sp-4); border-radius: var(--r-sm); overflow: hidden; color: var(--white); background: hsl(var(--h) 55% 38%); }
.browse-name { position: relative; z-index: var(--z-raised); display: block; max-width: 70%; font-size: var(--fs-section); font-weight: 700; line-height: 1.15; }
.browse-tile .cover { position: absolute; right: -14px; bottom: -6px; border-radius: 4px; transform: rotate(25deg); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); transition: transform 0.25s var(--ease); }
.browse-tile:hover .cover { transform: rotate(18deg) scale(1.04); }
.search-tip { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-6); color: var(--text-3); font-size: var(--fs-caption); }
@media (max-width: 1099px) {
  .top-search { width: 44px; padding: 0; justify-content: center; margin: 0 0 0 auto; }
  .top-search span, .top-search kbd { display: none; }
}
@media (max-width: 767px) {
  .top-search { display: none; }
  .browse-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .browse-tile { height: 96px; padding: var(--sp-3); }
  .browse-name { font-size: var(--fs-body); }
  .browse-tile .cover { --size: 70px !important; width: 70px; height: 70px; }
}
.library-head { flex-direction: row; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.create-btn { height: 40px; }
.hero-title.editable { cursor: pointer; border-radius: var(--r-sm); }
.hero-title.editable:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (max-width: 767px) {
  .library-head { flex-wrap: nowrap; align-items: center; }
  .library-head .create-btn { flex: none; width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; background: var(--surface-2); color: var(--text-1); border-color: transparent; box-shadow: none; }
  .library-head .create-btn .icon { width: 24px; height: 24px; }
  .library-head .create-btn:active { transform: scale(0.92); }
  .create-label { display: none; }
}
.downloads-card { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 45%, var(--surface)), color-mix(in srgb, var(--accent) 75%, var(--surface)) 60%, var(--accent)); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 22%, transparent); }
@media (max-width: 767px) {
  .library-grid .liked-card { grid-column: span 1; min-height: 120px; padding: var(--sp-4); }
  .library-grid .liked-card h3 { font-size: var(--fs-section); }
  .library-grid .liked-card p { font-size: var(--fs-caption); }
  .library-grid .liked-card-icon { top: 14px; right: 14px; }
  .library-grid .liked-card-icon .icon { width: 22px; height: 22px; }
}
.page-sub { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); color: var(--text-2); font-size: var(--fs-caption); }
.ptr { position: fixed; top: calc(var(--safe-top) + 8px); left: 50%; z-index: var(--z-panel); transform: translate(-50%, 0); opacity: 0; pointer-events: none; will-change: transform; }
.ptr.animate { transition: transform 0.3s var(--ease), opacity 0.3s; }
.ptr-circle { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); transition: color 0.15s, background 0.15s; }
.ptr.ready .ptr-circle, .ptr.busy .ptr-circle { color: var(--accent); }
.ptr.busy .ptr-circle { animation: spin 0.8s linear infinite; }
.quick-grid:has(> .quick-tile:only-child) { grid-template-columns: 1fr; }
.shelves .shelf { margin-top: var(--sp-6); }
.shelves .shelf-head h2 { margin-bottom: calc(var(--sp-3) - var(--sp-4)); } /* la carte ajoute déjà --sp-4 de marge interne */
.shelves .row-scroll { margin-bottom: calc(var(--sp-4) * -1); padding-bottom: 0; }
.list-tools .list-filter, .list-tools .list-sort { height: 44px; }
.list-tools .list-sort select { font-size: var(--fs-caption); font-weight: 400; }
.list-tools { gap: var(--sp-3); }

/* --- liste de titres : tri, colonne « Ajouté le », poignée de déplacement --- */
.tracklist.tl-v2 { --c1: 40px; --cols: var(--c1) minmax(0, 1fr) 40px 56px 40px; }
.tracklist.tl-v2.with-album { --cols: var(--c1) minmax(0, 5fr) minmax(0, 3fr) 40px 56px 40px; }
.tracklist.tl-v2.with-added { --cols: var(--c1) minmax(0, 1fr) 110px 40px 56px 40px; }
.tracklist.tl-v2.with-album.with-added { --cols: var(--c1) minmax(0, 5fr) minmax(0, 3fr) 110px 40px 56px 40px; }
.tracklist.with-reorder { --c1: 56px; }
.tracklist.with-reorder .tl-num { padding-left: 20px; }
.tl-added { font-size: var(--fs-caption); color: var(--text-2); white-space: nowrap; }
.tl-sort { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.tl-sort:hover, [aria-sort="ascending"] .tl-sort, [aria-sort="descending"] .tl-sort { color: var(--text); }
.tl-arrow { font-size: 9px; }
.tl-head .tl-dur .tl-sort { margin-left: auto; }
.tl-row { position: relative; }
.drag-handle { position: absolute; left: 2px; top: 50%; width: 24px; height: 32px; margin-top: -16px; padding: 0; display: grid; place-items: center; border: 0; background: none; color: var(--text-3); cursor: grab; opacity: 0; }
.tl-row:hover .drag-handle, .drag-handle:focus-visible { opacity: 1; }
.tracklist.is-sorted .drag-handle { display: none; }
@media (hover: none) { .drag-handle { opacity: 1; } }
@media (max-width: 767px) {
  .tracklist.tl-v2, .tracklist.tl-v2.with-album, .tracklist.tl-v2.with-added, .tracklist.tl-v2.with-album.with-added { --cols: minmax(0, 1fr) 36px; }
  .tl-added { display: none !important; }
  .tracklist.with-reorder .tl-row { padding-left: 28px; }
  .drag-handle { left: 2px; opacity: 1; }
}

/* Playlist : pochette modifiable, visibilité, remise à l'ordre personnalisé */
.hero-cover-edit { position: relative; display: inline-block; align-self: flex-end; }
.cover-edit-btn { position: absolute; inset: auto 8px 8px 8px; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-3); border: 0; border-radius: var(--r-pill); background: rgba(0, 0, 0, 0.72); color: var(--white); font: inherit; font-size: var(--fs-caption); font-weight: 650; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.hero-cover-edit:hover .cover-edit-btn, .cover-edit-btn:focus-visible { opacity: 1; }
@media (hover: none) { .cover-edit-btn { opacity: 1; } }
/* Téléphone : l'en-tête passe en colonne, le bloc « Changer l'image » se centre comme les autres pochettes */
@media (max-width: 767px) { .hero-cover-edit { align-self: center; } }
.hero-title-end { white-space: nowrap; }
.hero-vis { display: inline-flex; vertical-align: middle; margin-left: 0.2em; color: var(--text-2); font-weight: 400; opacity: 0.85; }
.hero-vis svg { width: min(0.42em, 28px); height: min(0.42em, 28px); }

/* Bouton « Trier » (téléphone uniquement : l'en-tête est masqué) */
.tl-sort-bar { display: none; }
@media (max-width: 767px) {
  .tl-sort-bar { display: flex; justify-content: flex-end; margin-bottom: var(--sp-2); }
  .tl-sort-mobile { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-3); border: 0; background: none; color: var(--text-2); font: inherit; font-size: var(--fs-caption); font-weight: 650; cursor: pointer; }
}

/* Profil public et page Amis */
.profile-head { display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-6) 0 var(--sp-4); min-width: 0; }
.profile-avatar { flex: none; }
.profile-info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.profile-info h1 { margin: 0; font-size: var(--fs-title, 2rem); overflow-wrap: anywhere; }
.profile-handle { margin: 0; color: var(--text-2, var(--text-1)); }
.profile-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.profile-action, .profile-edit { min-height: 44px; display: inline-flex; align-items: center; gap: var(--sp-2); }
.follow-toggle .on-hover { display: none; }
.follow-toggle:hover .on-normal, .follow-toggle:active .on-normal { display: none; }
.follow-toggle:hover .on-hover, .follow-toggle:active .on-hover { display: inline; }
.rel-badge { flex: none; padding: 2px var(--sp-3); border-radius: var(--r-pill); background: var(--hover); font-size: var(--fs-caption); font-weight: 700; }
.friends-searchbox { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-4); border-radius: var(--r-pill); background: var(--hover); margin: var(--sp-4) 0; }
.friends-search { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; color: inherit; font: inherit; outline: none; }
.user-row { min-width: 0; }
.user-row .row-main { min-width: 0; flex: 1; }
.user-row .row-title, .user-row .row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) { .profile-head { gap: var(--sp-4); } .profile-avatar { --size: 88px !important; } }

/* Titres recommandés */
.reco { margin-top: var(--sp-6); }
.reco-refresh { background: none; border: 0; color: inherit; font: inherit; font-size: 0.85rem; cursor: pointer; text-decoration: underline; padding: var(--sp-1) var(--sp-2); opacity: 0.75; }
.reco-refresh:hover { opacity: 1; }
.reco .tl-more { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-1); }
/* « + » et « … » dans la même cellule : la dernière colonne tient les deux boutons */
.reco .tracklist:has(.reco-add) { --cols: 40px minmax(0, 1fr) 40px 56px 84px; }
@media (max-width: 767px) { .reco .tracklist:has(.reco-add) { --cols: minmax(0, 1fr) 80px; } }
.reco-sentinel { height: 1px; }

