/* Sillon — feuille de style unique */

:root {
  --bg: #14171d;
  --bg-2: #1a1e26;
  --surface: #20252e;
  --surface-2: #282e39;
  --line: #2e3440;
  --ink: #eceae4;
  --ink-2: #a9adb6;
  --ink-3: #737985;
  --accent: #e8a33d;
  --accent-ink: #1b1406;
  --accent-soft: rgba(232, 163, 61, .14);
  --danger: #e5675a;
  --ok: #7cc39a;
  --tint: 232, 163, 61;           /* couleur de la pochette en cours (r, g, b) */
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --side: 248px;
  --player: 84px;
  --font: 'Plex', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3f2ee;
  --bg-2: #ebe9e3;
  --surface: #ffffff;
  --surface-2: #f1efe9;
  --line: #dddad2;
  --ink: #1c1e23;
  --ink-2: #555963;
  --ink-3: #868a93;
  --accent: #a96a0b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(169, 106, 11, .1);
  --danger: #c0392b;
  --ok: #2e8b57;
  --shadow: 0 18px 50px rgba(40, 35, 20, .16);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f2ee;
    --bg-2: #ebe9e3;
    --surface: #ffffff;
    --surface-2: #f1efe9;
    --line: #dddad2;
    --ink: #1c1e23;
    --ink-2: #555963;
    --ink-3: #868a93;
    --accent: #a96a0b;
    --accent-ink: #ffffff;
    --accent-soft: rgba(169, 106, 11, .1);
    --danger: #c0392b;
    --ok: #2e8b57;
    --shadow: 0 18px 50px rgba(40, 35, 20, .16);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body, #root { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
img { display: block; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[dir="auto"] { unicode-bidi: plaintext; text-align: start; }

/* ---------------------------------------------------------------- boutons & champs */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-s);
  background: var(--surface-2); color: var(--ink); font-weight: 500; font-size: 14px;
  border: 1px solid var(--line); white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn .i { width: 18px; height: 18px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-grid; place-items: center; color: var(--ink-2);
  transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn.on { color: var(--accent); }
.icon-btn:disabled { opacity: .4; cursor: default; }

.play-fab {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  transition: transform .15s;
}
.play-fab:hover { transform: scale(1.04); }
.play-fab .i { width: 24px; height: 24px; }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-s);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 14px; resize: vertical; min-height: 80px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--ink-3); }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------------------------------------------------------------- écran de connexion */

.auth {
  height: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr);
}
.auth-art {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 20% 110%, rgba(232, 163, 61, .22), transparent 60%), var(--bg-2);
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
  border-right: 1px solid var(--line);
}
.auth-art svg.grooves { position: absolute; right: -22%; bottom: -30%; width: 115%; height: auto; opacity: .9; }
.auth-art .brand { position: relative; }
.auth-art blockquote { position: relative; margin: 0; max-width: 26ch; font-size: clamp(26px, 3vw, 38px); line-height: 1.15; letter-spacing: -.02em; font-weight: 500; }
.auth-art blockquote span { display: block; margin-top: 14px; font-size: 15px; letter-spacing: 0; color: var(--ink-2); font-weight: 400; }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; overflow-y: auto; }
.auth-form { width: 100%; max-width: 360px; display: grid; gap: 18px; }
.auth-form h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.auth-form p.lead { margin: -8px 0 6px; color: var(--ink-2); }
.form-error { color: var(--danger); font-size: 14px; min-height: 1px; }
.auth-switch { font-size: 14px; color: var(--ink-2); text-align: center; }
.auth-switch button { color: var(--accent); font-weight: 500; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 19px; letter-spacing: -.01em; }
.brand svg { width: 30px; height: 30px; }

@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-art { padding: 24px; min-height: 180px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-art blockquote { font-size: 22px; margin-top: 24px; }
  .auth-art blockquote span { display: none; }
  .auth-art svg.grooves { right: -50%; bottom: -80%; width: 140%; }
}

/* ---------------------------------------------------------------- coquille de l'app */

.shell {
  height: 100%;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--player);
  grid-template-areas: "side main" "player player";
}
.side {
  grid-area: side; display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-2); border-right: 1px solid var(--line);
  padding: 20px 12px 12px;
}
.side .brand { padding: 0 10px 22px; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px;
  border-radius: var(--radius-s); text-decoration: none; color: var(--ink-2); font-weight: 500;
}
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a.active { color: var(--ink); background: var(--surface); }
.nav a.active .i { color: var(--accent); }
.nav a .badge { margin-left: auto; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600;
  display: inline-grid; place-items: center;
}
.side-section { display: flex; align-items: center; justify-content: space-between; margin: 26px 10px 8px; font-size: 13px; color: var(--ink-3); font-weight: 500; }
.side-lists { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.side-lists a {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-s);
  text-decoration: none; color: var(--ink-2); font-size: 14px;
}
.side-lists a:hover { background: var(--surface); color: var(--ink); }
.side-lists a.active { background: var(--surface); color: var(--ink); }
.side-lists a.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.side-lists .mini-cover { width: 36px; height: 36px; border-radius: 4px; }
.side-foot { border-top: 1px solid var(--line); margin: 10px -12px -12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--accent); flex: none; }
.side-foot .who { flex: 1; min-width: 0; font-size: 14px; }

.main { grid-area: main; min-height: 0; display: flex; flex-direction: column; position: relative; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 14px 32px;
  position: sticky; top: 0; z-index: 5;
}
.search {
  position: relative; flex: 1; max-width: 560px;
}
.search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 42px; padding-right: 64px; height: 42px; border-radius: 21px; background: var(--surface); }
.search input:not(:placeholder-shown) ~ kbd { display: none; }
.search kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font: 500 12px var(--font); color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
.topbar .spacer { flex: 1; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.page { padding: 8px 32px 48px; max-width: 1360px; }

/* ---------------------------------------------------------------- en-têtes */

.page-head { display: flex; align-items: flex-end; gap: 28px; margin: 12px 0 28px; }
.page-head h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -.03em; font-weight: 600; }
.page-head .meta { margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.page-head .desc { margin-top: 8px; color: var(--ink-2); max-width: 60ch; }
.page-head .cover-xl { width: 196px; height: 196px; border-radius: var(--radius); box-shadow: var(--shadow); flex: none; }
.page-head.hero {
  margin: -8px -32px 0; padding: 36px 32px 28px;
  background: linear-gradient(180deg, rgba(var(--page-tint, var(--tint)), .32), rgba(var(--page-tint, var(--tint)), 0) 100%);
}
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.actions .icon-btn { width: 40px; height: 40px; }

h2.section { font-size: 20px; letter-spacing: -.015em; font-weight: 600; margin: 36px 0 14px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2.section a, h2.section button { font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
h2.section a:hover, h2.section button:hover { color: var(--ink); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button {
  height: 42px; padding: 0 14px; color: var(--ink-2); font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- pochettes */

.cover { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 4px; flex: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .ph { width: 100%; height: 100%; }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; }
.mosaic img { aspect-ratio: 1; }

/* ---------------------------------------------------------------- grilles de cartes */

.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 176px); gap: 18px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px; }
.card { min-width: 0; text-align: left; scroll-snap-align: start; position: relative; text-decoration: none; display: block; }
.card .cover { width: 100%; aspect-ratio: 1; border-radius: var(--radius); }
.card .t { margin-top: 10px; font-weight: 500; font-size: 14px; }
.card .s { font-size: 13px; color: var(--ink-2); }
.card .hover-play {
  position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.card:hover .hover-play, .card:focus-within .hover-play { opacity: 1; transform: none; }
.card.playing .t { color: var(--accent); }

/* ---------------------------------------------------------------- liste de morceaux */

.tracklist { width: 100%; }
.tl-head, .tl-row {
  display: grid; align-items: center; gap: 16px;
  grid-template-columns: 36px minmax(0, 4fr) minmax(0, 2.4fr) minmax(0, 1.4fr) 92px 84px;
  padding: 0 12px;
}
.tl-head { height: 36px; border-bottom: 1px solid var(--line); margin-bottom: 8px; font-size: 13px; color: var(--ink-3); }
.tl-head button { color: inherit; text-align: left; display: inline-flex; align-items: center; gap: 4px; }
.tl-head button:hover { color: var(--ink); }
.tl-head button.sorted { color: var(--ink); }
.tl-head .r, .tl-row .r { text-align: right; justify-content: flex-end; }
.tl-row { height: 58px; border-radius: var(--radius-s); color: var(--ink-2); font-size: 14px; user-select: none; }
.tl-row:hover, .tl-row.menu-open { background: var(--surface); }
.tl-row.selected { background: var(--surface-2); }
.tl-row.dragging { opacity: .4; }
.tl-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.tl-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.tl-idx { position: relative; width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-3); }
.tl-idx .n { font-size: 14px; }
.tl-idx button { position: absolute; inset: 0; display: none; place-items: center; color: var(--ink); }
.tl-row:hover .tl-idx .n { visibility: hidden; }
.tl-row:hover .tl-idx button { display: grid; }
.tl-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tl-main .cover { width: 42px; height: 42px; }
.tl-main .txt { min-width: 0; }
.tl-main .t { color: var(--ink); font-weight: 500; font-size: 15px; }
.tl-main .a { font-size: 13px; }
.tl-row.playing .tl-main .t { color: var(--accent); }
.tl-act { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.tl-act .icon-btn { width: 32px; height: 32px; }
.tl-act .icon-btn .i { width: 18px; height: 18px; }
.tl-act .fav:not(.on), .tl-act .more { opacity: 0; }
.tl-row:hover .tl-act .fav, .tl-row:hover .tl-act .more, .tl-row.menu-open .tl-act .more, .tl-act .icon-btn:focus-visible { opacity: 1; }
.tl-act .fav.on .i { fill: var(--accent); stroke: var(--accent); }
@media (min-width: 1101px) {
  .tracklist.no-album .tl-head, .tracklist.no-album .tl-row { grid-template-columns: 36px minmax(0, 6fr) 0 minmax(0, 1.4fr) 92px 84px; }
  .tracklist.no-album .tl-col-album { visibility: hidden; }
}
.tl-col-album, .tl-col-date { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.35s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
.eq.paused i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 14px; } }

.tl-row .grip { cursor: grab; color: var(--ink-3); }

/* ---------------------------------------------------------------- états vides */

.empty {
  border: 1px dashed var(--line); border-radius: var(--radius-l); padding: 44px 28px;
  display: grid; justify-items: center; text-align: center; gap: 10px; color: var(--ink-2);
}
.empty h3 { margin: 0; color: var(--ink); font-size: 18px; font-weight: 600; }
.empty p { margin: 0 0 8px; max-width: 46ch; }
.empty svg.grooves-sm { width: 72px; height: 72px; margin-bottom: 6px; }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: var(--radius-s); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- import */

.import-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 32px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px; }
.panel h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.panel p.hint { margin: 0 0 16px; font-size: 14px; color: var(--ink-2); }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 14px; }

.results { display: grid; gap: 4px; margin-top: 14px; }
.result { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px; border-radius: var(--radius); }
.result:hover { background: var(--surface-2); }
.result .thumb { position: relative; width: 112px; aspect-ratio: 16/9; border-radius: var(--radius-s); overflow: hidden; background: var(--surface-2); }
.result .thumb img, .job .thumb img { width: 100%; height: 100%; object-fit: cover; }
.result .thumb .ph, .job .thumb .ph { width: 100%; height: 100%; }
.result .thumb .d { position: absolute; right: 5px; bottom: 5px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 11px; font-weight: 500; padding: 1px 5px; border-radius: 3px; }
.result .t { font-weight: 500; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result .s { font-size: 13px; color: var(--ink-2); }
.result .state { font-size: 13px; color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }

.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--radius-l); padding: 34px 18px;
  display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--ink-2);
  transition: border-color .15s, background .15s; cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone strong { color: var(--ink); font-weight: 500; }
.dropzone .i { width: 28px; height: 28px; color: var(--accent); }

.jobs { display: grid; gap: 2px; }
.job { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; }
.job + .job { border-top: 1px solid var(--line); }
.job .cover, .job .thumb { width: 52px; height: 52px; border-radius: var(--radius-s); overflow: hidden; background: var(--surface-2); }
.job .thumb img { width: 100%; height: 100%; object-fit: cover; }
.job .t { font-size: 14px; font-weight: 500; }
.job .s { font-size: 12.5px; color: var(--ink-2); }
.job .s.err { color: var(--danger); }
.job .s.ok { color: var(--ok); }
.bar { height: 3px; border-radius: 2px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.bar.indet > i { width: 30% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

/* ---------------------------------------------------------------- lecteur */

.player {
  grid-area: player; position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; gap: 20px;
  padding: 0 20px; border-top: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(var(--tint), .16), rgba(var(--tint), .04) 45%, transparent), var(--bg-2);
  transition: background .6s;
}
.np { display: flex; align-items: center; gap: 14px; min-width: 0; }
.np .cover { width: 56px; height: 56px; border-radius: var(--radius-s); cursor: pointer; }
.np .txt { min-width: 0; }
.np .t { font-weight: 500; font-size: 14.5px; }
.np .a { font-size: 13px; color: var(--ink-2); }
.np .a button:hover, .np .t button:hover { text-decoration: underline; }
.np .fav.on .i { fill: var(--accent); stroke: var(--accent); }
.transport { display: grid; justify-items: center; gap: 4px; }
.transport .btns { display: flex; align-items: center; gap: 10px; }
.transport .pp { width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; transition: transform .12s; }
.transport .pp:hover { transform: scale(1.05); }
.transport .pp .i { width: 20px; height: 20px; }
.seek { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 620px; font-size: 12px; color: var(--ink-3); }
.seek .num { width: 40px; }
.seek .num:first-child { text-align: right; }
.extra { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.extra input[type=range].vol { flex: 0 0 110px; width: 110px; }
.icon-btn .dot { position: absolute; }

input[type=range].slider {
  -webkit-appearance: none; appearance: none; flex: 1; height: 16px; background: transparent; cursor: pointer;
  --p: 0%;
}
input[type=range].slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--ink) var(--p), var(--line) var(--p));
}
input[type=range].slider:hover::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--accent) var(--p), var(--line) var(--p)); }
input[type=range].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: var(--ink); opacity: 0; transition: opacity .12s; }
input[type=range].slider:hover::-webkit-slider-thumb, input[type=range].slider:focus-visible::-webkit-slider-thumb { opacity: 1; }
input[type=range].slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
input[type=range].slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ink); }
input[type=range].slider:hover::-moz-range-progress { background: var(--accent); }
input[type=range].slider::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--ink); }

.player.idle .transport, .player.idle .extra { opacity: .5; pointer-events: none; }

/* file d'attente */
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 100%); z-index: 20;
  background: var(--bg-2); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 20px; }
.drawer header h3 { margin: 0; font-size: 17px; font-weight: 600; }
.drawer .body { flex: 1; overflow-y: auto; padding: 0 8px 16px; }
.drawer .label { font-size: 13px; color: var(--ink-3); padding: 14px 12px 6px; font-weight: 500; }
.q-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 10px; border-radius: var(--radius-s); cursor: pointer; }
.q-item:hover { background: var(--surface); }
.q-item .cover { width: 40px; height: 40px; }
.q-item .t { font-size: 14px; font-weight: 500; }
.q-item .a { font-size: 12.5px; color: var(--ink-2); }
.q-item.current .t { color: var(--accent); }
.q-item .icon-btn { opacity: 0; width: 30px; height: 30px; }
.q-item:hover .icon-btn { opacity: 1; }

/* ---------------------------------------------------------------- menus, modales, toasts */

.menu {
  position: fixed; z-index: 100; min-width: 220px; max-width: 300px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 70vh; overflow-y: auto;
}
.menu button, .menu .label {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--radius-s);
  text-align: left; font-size: 14px; color: var(--ink);
}
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu button .i { width: 18px; height: 18px; color: var(--ink-2); }
.menu button.danger, .menu button.danger .i { color: var(--danger); }
.menu .label { color: var(--ink-3); font-size: 12.5px; padding-bottom: 4px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .sub-arrow { margin-left: auto; }

.overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(8, 9, 12, .55);
  display: grid; place-items: center; padding: 20px; animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 24px; display: grid; gap: 18px;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.modal p { margin: -8px 0 0; color: var(--ink-2); }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; }
.modal .cover-edit { display: flex; gap: 16px; align-items: center; }
.modal .cover-edit .cover { width: 96px; height: 96px; border-radius: var(--radius-s); }

#toasts { position: fixed; left: 50%; bottom: calc(var(--player) + 18px); transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-s);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow); animation: pop .2s ease; max-width: 92vw;
}
.toast.err { background: var(--danger); color: #fff; }
.toast button { color: inherit; text-decoration: underline; font-weight: 600; }

/* ---------------------------------------------------------------- réglages */

.settings { display: grid; gap: 22px; max-width: 720px; }
.users { display: grid; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.user-row + .user-row { border-top: 1px solid var(--line); }
.user-row .grow { flex: 1; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 3px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 4px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.seg button.active { background: var(--surface-2); color: var(--ink); }

/* ---------------------------------------------------------------- lecture plein écran (mobile) */

.sheet {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(var(--tint), .55), var(--bg) 70%), var(--bg);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
}
.sheet.open { transform: none; visibility: visible; }
.sheet .top { display: flex; align-items: center; justify-content: space-between; }
.sheet .top .src { font-size: 13px; color: var(--ink-2); text-align: center; flex: 1; }
.sheet .art { flex: 1; display: grid; place-items: center; min-height: 0; padding: 24px 0; }
.sheet .art .cover { width: min(86vw, 46vh, 440px); aspect-ratio: 1; border-radius: var(--radius-l); box-shadow: 0 30px 70px rgba(0, 0, 0, .5); }
.sheet .meta { display: flex; align-items: center; gap: 12px; }
.sheet .meta .txt { flex: 1; min-width: 0; }
.sheet .meta .t { font-size: 22px; font-weight: 600; letter-spacing: -.015em; }
.sheet .meta .a { color: var(--ink-2); font-size: 16px; }
.sheet .seek { max-width: none; margin-top: 18px; flex-wrap: wrap; }
.sheet .seek input { flex-basis: 100%; order: -1; }
.sheet .seek .num { width: auto; flex: 1; text-align: left !important; }
.sheet .seek .num:last-child { text-align: right !important; }
.sheet .ctrl { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.sheet .ctrl .icon-btn { width: 48px; height: 48px; }
.sheet .ctrl .icon-btn .i { width: 26px; height: 26px; }
.sheet .ctrl .pp { width: 68px; height: 68px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.sheet .ctrl .pp .i { width: 30px; height: 30px; }
.sheet .bottom { display: flex; justify-content: space-between; margin-top: 18px; }

/* ---------------------------------------------------------------- mobile */

.tabbar { display: none; }

@media (max-width: 1100px) {
  .tl-head, .tl-row { grid-template-columns: 36px minmax(0, 4fr) minmax(0, 2fr) 0 84px; }
  .tl-col-date { display: none; }
  .import-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --player: 64px; }
  body { font-size: 15px; }
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto auto;
    grid-template-areas: "main" "player" "tabs";
  }
  .side { display: none; }
  .topbar { padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--bg); }
  .topbar .desk, .topbar .spacer { display: none; }
  .search { max-width: none; }
  .panel { padding: 16px; border-radius: var(--radius); }
  .panel .row .btn .lbl { display: none; }
  .search kbd { display: none; }
  .page { padding: 4px 16px 32px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
  .page-head .cover-xl { width: 150px; height: 150px; align-self: center; }
  .page-head.hero { margin: -4px -16px 0; padding: 24px 16px 20px; }
  .tl-head { display: none; }
  .tl-head, .tl-row { grid-template-columns: minmax(0, 1fr) auto; padding: 0 4px; gap: 8px; }
  .tl-idx, .tl-col-album, .tl-col-date, .tl-col-dur { display: none !important; }
  .tl-act .fav:not(.on) { display: none; }
  .tl-act .more { opacity: 1 !important; }
  .tl-row { height: 62px; }
  .tl-row:hover { background: transparent; }
  .tl-main .cover { width: 48px; height: 48px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .shelf { grid-auto-columns: 42%; gap: 14px; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 16px; }
  .card .hover-play { display: none; }

  .player {
    margin: 0 8px 6px; border: 0; border-radius: var(--radius); padding: 0 6px 0 8px; height: 60px;
    grid-template-columns: minmax(0, 1fr) auto; gap: 8px;
    background: linear-gradient(90deg, rgba(var(--tint), .5), rgba(var(--tint), .22)), var(--surface);
  }
  .player .np .cover { width: 44px; height: 44px; }
  .player .transport { display: flex; }
  .player .transport .seek, .player .transport .opt { display: none; }
  .player .transport .pp { width: 40px; height: 40px; background: transparent; color: var(--ink); }
  .player .transport .pp .i { width: 24px; height: 24px; }
  .player .extra { display: none; }
  .player .np .fav { display: none; }
  .player .mprog { position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: rgba(255, 255, 255, .12); border-radius: 1px; overflow: hidden; }
  .player .mprog i { display: block; height: 100%; background: var(--ink); }
  .player.idle { display: none; }

  .tabbar {
    grid-area: tabs; display: grid; grid-template-columns: repeat(4, 1fr);
    background: var(--bg); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11.5px; color: var(--ink-3); text-decoration: none; font-weight: 500; position: relative; }
  .tabbar a.active { color: var(--ink); }
  .tabbar a.active .i { color: var(--accent); }
  .tabbar .badge { position: absolute; top: 2px; left: 55%; transform: scale(.85); }
  .drawer { position: fixed; z-index: 70; width: 100%; }
  #toasts { bottom: calc(var(--player) + 76px); }
  .result { grid-template-columns: 88px minmax(0, 1fr) auto; gap: 10px; padding: 6px 0; }
  .result .thumb { width: 88px; }
  .result .btn .lbl { display: none; }
  .result .btn { padding: 0 10px; }
}
@media (min-width: 761px) {
  .sheet, .player .mprog, .mobile-only { display: none !important; }
}

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