/* ───────────── Fire Music · forêt de nuit / clairière de jour ───────────── */
:root {
  --bg: #0b1410; --bg2: #0f1c16;
  --sky1: #08121a; --sky2: #0d1c17;
  --panel: rgba(18, 33, 26, .66); --panel2: rgba(27, 46, 36, .72); --panel-solid: #14241c;
  --line: rgba(196, 224, 180, .10); --line2: rgba(196, 224, 180, .18);
  --text: #ecf0e2; --muted: #9db09a; --faint: #6c8069;
  --moss: #8fbf6a; --fern: #c3df93; --ember: #ffb35c; --ember2: #ff7b47; --berry: #e2687a;
  --stone: #8c9a8b;
  --h3: #12251d; --h2: #0e1f18; --h1: #0a1712; --pine: #0b1a13;
  --glow: rgba(255, 179, 92, .35);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .65);
  --r: 18px; --r-sm: 11px;
  --player-h: 92px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef0e1; --bg2: #e6eAd6;
  --sky1: #dcebe4; --sky2: #f1eedc;
  --panel: rgba(255, 255, 247, .70); --panel2: rgba(255, 255, 250, .86); --panel-solid: #fbfaf1;
  --line: rgba(47, 74, 44, .11); --line2: rgba(47, 74, 44, .2);
  --text: #1d2b20; --muted: #5a6d58; --faint: #8b9a88;
  --moss: #4b7d36; --fern: #6c9c3e; --ember: #d6772b; --ember2: #c75424; --berry: #b8405a;
  --stone: #7d8a7b;
  --h3: #c9dbbf; --h2: #aecb9d; --h1: #8fb27e; --pine: #6f9861;
  --glow: rgba(214, 119, 43, .25);
  --shadow: 0 20px 45px -24px rgba(40, 60, 30, .45);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--text); font-size: 14.5px; line-height: 1.45;
  background: linear-gradient(180deg, var(--sky1), var(--sky2) 60%, var(--bg));
  background-attachment: fixed; overflow: hidden; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 20px; height: 20px; flex: none; }
::selection { background: var(--moss); color: #0b1410; }
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }

/* ───── background scenery ───── */
#sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.scenery { position: fixed; left: 0; right: 0; bottom: 0; height: 42vh; z-index: 0; pointer-events: none; opacity: .95; }
.scenery svg { width: 100%; height: 100%; }
.scenery .h3 { fill: var(--h3); } .scenery .h2 { fill: var(--h2); } .scenery .h1 { fill: var(--h1); }
.scenery .pines { fill: var(--pine); }

/* ───── layout ───── */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 252px 1fr; height: calc(100vh - var(--player-h)); height: calc(100dvh - var(--player-h)); }
.sidebar {
  display: flex; flex-direction: column; gap: 6px; padding: 22px 14px 14px; min-height: 0;
  background: linear-gradient(180deg, var(--panel), transparent 120%); border-right: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 16px; }
.brand img { filter: drop-shadow(0 4px 14px var(--glow)); }
.brand b { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; display: block; line-height: 1.05; }
.brand small { color: var(--muted); font-size: 11.5px; font-style: italic; font-family: var(--display); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; transition: .2s; position: relative; }
.nav a:hover { color: var(--text); background: var(--line); }
.nav a.on { color: var(--text); background: linear-gradient(90deg, color-mix(in srgb, var(--moss) 22%, transparent), transparent); }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--ember); box-shadow: 0 0 12px var(--ember); }
.nav a.on svg { color: var(--moss); }
.nav em { margin-left: auto; font-style: normal; font-size: 11px; background: var(--ember); color: #1a120a; border-radius: 99px; padding: 1px 7px; font-weight: 700; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 4px 2px 12px; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.side-pl { overflow-y: auto; flex: 1; min-height: 40px; display: flex; flex-direction: column; gap: 1px; }
.side-pl a { padding: 7px 12px; border-radius: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.side-pl a:hover, .side-pl a.on { color: var(--text); background: var(--line); }
.side-pl .empty { padding: 6px 12px; color: var(--faint); font-size: 12.5px; font-style: italic; }
.side-foot { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.scan-state { flex: 1; font-size: 11.5px; color: var(--faint); line-height: 1.3; }
.scan-state b { color: var(--moss); font-weight: 600; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 34px 6px; }
.search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 44px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: .2s; }
.search:focus-within { border-color: color-mix(in srgb, var(--moss) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--moss) 14%, transparent); }
.search svg { color: var(--muted); }
.search input { flex: 1; background: none; border: 0; outline: 0; min-width: 0; }
.view { flex: 1; overflow-y: auto; padding: 14px 34px 60px; scroll-behavior: smooth; }
.view > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ───── typography & blocks ───── */
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; margin: 0; }
h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.05; }
h2 { font-size: 26px; }
h3 { font-size: 19px; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--moss); font-weight: 700; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head a { color: var(--muted); font-size: 13px; font-weight: 600; }
.section-head a:hover { color: var(--ember); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card + .card { margin-top: 16px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state svg { width: 46px; height: 46px; color: var(--moss); opacity: .7; margin-bottom: 10px; }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }

/* ───── buttons ───── */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 99px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; font-weight: 600; transition: .18s; white-space: nowrap; }
.btn:hover { border-color: var(--moss); transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, var(--ember), var(--ember2)); color: #20120a; border: 0; box-shadow: 0 8px 24px -8px var(--glow); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.green { background: var(--moss); color: #0d1a10; border: 0; }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--berry); color: var(--berry); }
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; cursor: pointer; color: var(--muted); transition: .18s; position: relative; flex: none; }
.icon-btn:hover { color: var(--text); background: var(--line); }
.icon-btn.sm { width: 28px; height: 28px; } .icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.on { color: var(--moss); }
.icon-btn.on::after { content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.icon-btn .one { display: none; position: absolute; top: 5px; right: 4px; font-style: normal; font-size: 9px; font-weight: 800; }
.icon-btn.one .one { display: block; }
.heart.on, .heart.on:hover { color: var(--berry); }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 13px; }
.link-btn:hover { color: var(--ember); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line2); background: transparent; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); transition: .15s; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip i { font-style: normal; opacity: .6; font-weight: 500; }

/* ───── forms ───── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input { height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: color-mix(in srgb, var(--bg) 55%, transparent); outline: 0; transition: .15s; width: 100%; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 90px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.input:focus { border-color: var(--moss); box-shadow: 0 0 0 4px color-mix(in srgb, var(--moss) 14%, transparent); }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 160px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle:last-child { border-bottom: 0; }
.toggle small { display: block; color: var(--muted); font-size: 12.5px; }
.switch { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line2); position: relative; cursor: pointer; transition: .2s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: .2s; }
.switch:checked { background: var(--moss); }
.switch:checked::after { left: 21px; background: #fff; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: color-mix(in srgb, var(--bg) 60%, transparent); border: 1px solid var(--line); padding: 3px 8px; border-radius: 8px; word-break: break-all; }
.steps { counter-reset: step; display: grid; gap: 16px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.step::before { counter-increment: step; content: counter(step); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; background: color-mix(in srgb, var(--moss) 22%, transparent); color: var(--moss); }
.step p { margin: 4px 0 10px; color: var(--muted); }
.step.done::before { content: "✓"; background: var(--moss); color: #0d1a10; }

/* ───── artwork ───── */
.art { position: relative; overflow: hidden; border-radius: 12px; background: var(--art, linear-gradient(135deg, #3d6b3a, #1b3326)); flex: none; border: 0; padding: 0; }
.art::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(circle at 30% 30%, rgba(255,255,255,.18), transparent 45%),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-opacity='.35' stroke-width='1.2' stroke-linecap='round'%3E%3Cpath d='M5 19c0-8 5-14 15-14 0 10-6 15-14 15M5 19l7-7'/%3E%3C/svg%3E") center / 42% no-repeat; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; opacity: 0; transition: opacity .35s; }
.art img.ok { opacity: 1; }
.art.sm { width: 46px; height: 46px; border-radius: 10px; }
.art.xs { width: 40px; height: 40px; border-radius: 9px; }
.art.xl { width: 100%; aspect-ratio: 1; border-radius: 26px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.7); }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 1; border-radius: 16px; overflow: hidden; position: relative; }
.mosaic .art { border-radius: 0; width: 100%; height: 100%; }
.mosaic.single { grid-template-columns: 1fr; }

/* ───── home ───── */
.hero { position: relative; padding: 34px 34px 30px; border-radius: 28px; overflow: hidden; margin-top: 8px;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--ember) 24%, transparent), transparent 55%),
              radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--moss) 26%, transparent), transparent 60%), var(--panel);
  border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.hero h1 em { font-style: italic; color: var(--ember); font-weight: 400; }
.hero p { color: var(--muted); max-width: 560px; margin: 12px 0 22px; font-size: 15.5px; }
.hero .deco { position: absolute; right: -10px; bottom: -14px; width: 230px; opacity: .9; pointer-events: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.stat { padding: 16px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.stat b { display: block; font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.ember b { color: var(--ember); } .stat.moss b { color: var(--moss); }
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 180px); gap: 16px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; }
.shelf > * { scroll-snap-align: start; }
.spot-now { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 18px; margin-top: 16px; background: var(--panel); border: 1px solid var(--line); }
.spot-now img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.spot-now .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; margin-right: 6px; }
.spot-now .eq i { width: 3px; background: var(--moss); border-radius: 2px; animation: eq 1s infinite ease-in-out; }
.spot-now .eq i:nth-child(2) { animation-delay: -.3s; } .spot-now .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 12px; } }

/* ───── tiles (playlist cards) ───── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 20px 18px; }
.tile { display: block; padding: 12px; border-radius: 20px; transition: .22s; position: relative; cursor: pointer; }
.tile:hover { background: var(--panel); }
.tile .cover { position: relative; margin-bottom: 12px; }
.tile .cover > .art, .tile .cover > .mosaic { width: 100%; aspect-ratio: 1; border-radius: 16px; box-shadow: var(--shadow); }
.tile h4 { margin: 0; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .fab { position: absolute; right: 10px; bottom: 10px; z-index: 3; opacity: 0; transform: translateY(8px); transition: .22s; }
.tile:hover .fab { opacity: 1; transform: none; }
.fab { width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #20120a; background: linear-gradient(135deg, var(--ember), var(--ember2)); box-shadow: 0 10px 24px -6px var(--glow); }
.fab svg { width: 22px; height: 22px; }
.kind { position: absolute; top: 10px; left: 10px; z-index: 3; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(8, 18, 12, .62); color: #e6f0d8; backdrop-filter: blur(6px); letter-spacing: .03em; display: inline-flex; gap: 4px; align-items: center; }
.kind svg { width: 12px; height: 12px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 22px; align-items: center; }
.tabs .spacer { flex: 1; }
.folder-tile .cover .art { aspect-ratio: 1.3; }

/* ───── page header ───── */
.phead { display: grid; grid-template-columns: 220px 1fr; gap: 30px; align-items: end; margin: 8px 0 26px; }
.phead .mosaic, .phead > .art { width: 220px; height: 220px; border-radius: 22px; box-shadow: var(--shadow); }
.phead h1 { margin: 8px 0 10px; word-break: break-word; }
.phead .meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 18px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0 18px; font-size: 13.5px; }
.crumbs a { color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.crumbs a:hover { background: var(--line); color: var(--text); }
.crumbs span { color: var(--faint); }

/* ───── track list ───── */
.tracks { display: flex; flex-direction: column; }
.thead, .tr { display: grid; grid-template-columns: 36px minmax(0, 2.4fr) minmax(0, 1.4fr) 150px 56px 76px; gap: 14px; align-items: center; padding: 0 12px; }
.thead { height: 36px; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.tr { height: 60px; border-radius: 12px; cursor: default; transition: background .12s; position: relative; }
.tr:hover { background: var(--line); }
.tr.playing { background: color-mix(in srgb, var(--moss) 13%, transparent); }
.tr.playing .t-title { color: var(--moss); }
.tr .num { color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; font-size: 13px; position: relative; }
.tr .num button { display: none; position: absolute; inset: -8px; border: 0; background: none; color: var(--text); cursor: pointer; place-items: center; }
.tr:hover .num span { visibility: hidden; } .tr:hover .num button { display: grid; }
.tr.playing .num span { visibility: hidden; }
.tr.playing .num::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px 3px var(--glow); animation: pulse 1.6s infinite; }
.tr.playing:hover .num::after { display: none; }
@keyframes pulse { 50% { transform: scale(.6); opacity: .6; } }
.t-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-txt { min-width: 0; }
.t-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-artist, .t-album { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-artist a:hover, .t-album a:hover { color: var(--text); text-decoration: underline; }
.t-dur { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.t-act { display: flex; justify-content: flex-end; gap: 2px; }
.t-act .icon-btn { width: 32px; height: 32px; opacity: 0; }
.tr:hover .t-act .icon-btn, .t-act .heart.on { opacity: 1; }
.tr.drag-over { box-shadow: inset 0 2px 0 var(--ember); }
.tr[draggable="true"] { cursor: grab; }
.sentinel { height: 40px; }

/* quality badges */
.q { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 3px 9px 3px 7px; border-radius: 99px; white-space: nowrap; border: 1px solid currentColor; line-height: 1.3; }
.q::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.q small { font-weight: 500; opacity: .8; font-size: 10.5px; }
.q.hires { color: var(--ember); background: color-mix(in srgb, var(--ember) 11%, transparent); }
.q.lossless { color: var(--moss); background: color-mix(in srgb, var(--moss) 11%, transparent); }
.q.high { color: var(--fern); }
.q.mid { color: var(--stone); }
.q.low { color: var(--berry); }
.qd { color: var(--muted); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ───── player ───── */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--player-h); z-index: 30;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 18px; padding: 0 22px;
  background: color-mix(in srgb, var(--panel-solid) 86%, transparent); border-top: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.player::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--ember) var(--prog, 0%), transparent calc(var(--prog, 0%) + 12%)); opacity: .7; }
.p-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.p-art { width: 60px; height: 60px; cursor: pointer; border-radius: 12px; box-shadow: 0 8px 20px -8px rgba(0,0,0,.6); }
.p-meta { min-width: 0; }
.p-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-artist { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-qual { margin-top: 4px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.p-qual .qd { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.p-ctrls { display: flex; align-items: center; gap: 10px; }
.play-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #20120a; background: linear-gradient(135deg, var(--ember), var(--ember2)); box-shadow: 0 0 0 0 var(--glow); transition: transform .15s, box-shadow .3s; }
.play-btn:hover { transform: scale(1.06); }
.play-btn.playing { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ember) 16%, transparent), 0 0 30px var(--glow); }
.play-btn svg { width: 24px; height: 24px; }
.p-time { display: flex; align-items: center; gap: 12px; width: 100%; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-time span { width: 40px; text-align: center; }
.vine { flex: 1; height: 18px; position: relative; cursor: pointer; display: flex; align-items: center; }
.vine::before { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--line2); }
.vine-buf { position: absolute; left: 0; height: 4px; border-radius: 4px; background: var(--line2); width: 0; }
.vine-fill { position: absolute; left: 0; height: 4px; border-radius: 4px; width: 0;
  background: linear-gradient(90deg, var(--moss), var(--fern) 70%, var(--ember)); box-shadow: 0 0 10px color-mix(in srgb, var(--moss) 50%, transparent); }
.vine-leaf { position: absolute; right: -9px; top: -8px; width: 18px; height: 18px; fill: var(--ember); filter: drop-shadow(0 0 6px var(--glow)); transform: rotate(-20deg) scale(.85); transition: transform .2s; }
.vine:hover .vine-leaf { transform: rotate(-20deg) scale(1.15); }
.p-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 110px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--moss) var(--v, 85%), var(--line2) var(--v, 85%)); outline: 0; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }

/* ───── queue ───── */
.queue { position: fixed; right: 12px; top: 12px; bottom: calc(var(--player-h) + 12px); width: 360px; z-index: 25; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transform: translateX(calc(100% + 30px)); transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.queue.open { transform: none; }
.queue-head { display: flex; align-items: center; gap: 8px; padding: 16px 12px 10px 20px; }
.queue-head h3 { flex: 1; }
.queue-list { overflow-y: auto; padding: 0 8px 12px; }
.q-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 700; padding: 12px 12px 6px; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; cursor: pointer; }
.q-item:hover { background: var(--line); }
.q-item.cur { background: color-mix(in srgb, var(--moss) 14%, transparent); }
.q-item .t-txt { flex: 1; }
.q-item .icon-btn { opacity: 0; width: 30px; height: 30px; } .q-item:hover .icon-btn { opacity: 1; }

/* ───── now playing overlay ───── */
.np { position: fixed; inset: 0 0 var(--player-h) 0; z-index: 20; display: grid; place-items: center; padding: 30px;
  background: radial-gradient(80% 80% at 30% 40%, color-mix(in srgb, var(--npc, #4c7a3c) 40%, transparent), transparent 70%), color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); opacity: 0; pointer-events: none; transform: translateY(30px); transition: .45s cubic-bezier(.2, .8, .2, 1); }
.np.open { opacity: 1; pointer-events: auto; transform: none; }
.np-close { position: absolute; top: 18px; right: 18px; }
.np-inner { display: grid; grid-template-columns: minmax(240px, 420px) minmax(260px, 460px); gap: 60px; align-items: center; max-width: 1000px; width: 100%; }
.np-art { position: relative; aspect-ratio: 1; }
.np-art canvas { position: absolute; inset: -22%; width: 144%; height: 144%; pointer-events: none; }
.np-art .art { position: relative; z-index: 1; }
.np-info h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.08; margin: 8px 0 6px; }
.np-artist { color: var(--muted); font-size: 18px; margin: 0 0 18px; }
.np-specs { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 22px 0 0; font-size: 13.5px; padding: 18px 20px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.np-specs dt { color: var(--muted); }
.np-specs dd { margin: 0; font-weight: 600; word-break: break-all; }
.np-specs dd.path { font-weight: 400; font-size: 12px; color: var(--muted); }

/* ───── downloads ───── */
.dl-box { display: flex; gap: 10px; flex-wrap: wrap; }
.dl-box .input { flex: 1; min-width: 240px; height: 50px; font-size: 15px; border-radius: 99px; padding: 0 22px; }
.dl-box .btn { height: 50px; padding: 0 26px; }
.hints { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); font-size: 12.5px; align-items: center; }
.job { padding: 14px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 10px; }
.job-top { display: flex; align-items: center; gap: 12px; }
.job-top .t-txt { flex: 1; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; text-transform: uppercase; letter-spacing: .06em; }
.pill.queued { background: var(--line2); color: var(--muted); }
.pill.running { background: color-mix(in srgb, var(--ember) 20%, transparent); color: var(--ember); }
.pill.done, .pill.exists { background: color-mix(in srgb, var(--moss) 20%, transparent); color: var(--moss); }
.pill.error { background: color-mix(in srgb, var(--berry) 20%, transparent); color: var(--berry); }
.pill.cancelled { background: var(--line); color: var(--faint); }
.bar { height: 4px; border-radius: 4px; background: var(--line2); margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--moss), var(--ember)); border-radius: 4px; transition: width .4s; }
.bar.indet i { width: 30%; animation: indet 1.4s infinite ease-in-out; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
details.log summary { cursor: pointer; color: var(--muted); font-size: 12.5px; margin-top: 8px; }
details.log pre { max-height: 260px; overflow: auto; font-size: 11.5px; background: color-mix(in srgb, var(--bg) 70%, transparent); padding: 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-all; margin: 8px 0 0; }

/* ───── menus, modals, toasts ───── */
.menu { position: fixed; z-index: 60; min-width: 220px; max-width: 280px; padding: 6px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line2); box-shadow: 0 24px 60px -16px rgba(0,0,0,.6); display: none; max-height: 70vh; overflow-y: auto; }
.menu.open { display: block; animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; font-size: 13.5px; }
.menu button:hover { background: var(--line); }
.menu button svg { width: 17px; height: 17px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu .m-label { padding: 6px 12px 4px; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: none; place-items: center; background: rgba(4, 10, 7, .55); backdrop-filter: blur(4px); padding: 20px; }
.modal-wrap.open { display: grid; }
.modal { width: min(420px, 100%); background: var(--panel-solid); border: 1px solid var(--line2); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); animation: pop .18s ease-out; }
.modal h3 { margin-bottom: 14px; }
.modal .btns { justify-content: flex-end; margin-top: 18px; }
.toasts { position: fixed; z-index: 80; left: 50%; bottom: calc(var(--player-h) + 18px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 11px 18px; border-radius: 99px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow); animation: toast 3.2s forwards; display: flex; gap: 8px; align-items: center; }
.toast.err { background: var(--berry); color: #fff; }
@keyframes toast { 0% { opacity: 0; transform: translateY(10px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.tabbar { display: none; }
.lib-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0 14px; }
.lib-tools .spacer { flex: 1; }
.lib-tools select { height: 34px; border-radius: 99px; padding: 0 12px; border: 1px solid var(--line2); background: var(--panel); }
.dir-list { display: flex; flex-direction: column; gap: 8px; }
.dir-item { display: flex; gap: 8px; align-items: center; }
.dir-item .ok { color: var(--moss); font-size: 12px; font-weight: 700; } .dir-item .ko { color: var(--berry); font-size: 12px; font-weight: 700; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.two-col .card + .card { margin-top: 0; }
.sync-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; margin-top: 10px; }
.sync-item { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.sync-item .t-txt { flex: 1; }

/* ───── responsive ───── */
@media (max-width: 1100px) {
  .thead, .tr { grid-template-columns: 30px minmax(0, 2fr) minmax(0, 1fr) 120px 76px; }
  .thead .c-dur, .tr .t-dur { display: none; }
  .p-right input[type=range] { width: 80px; }
}
@media (max-width: 820px) {
  :root { --player-h: 128px; }
  body { font-size: 14px; }
  .app { grid-template-columns: 1fr; height: calc(100dvh - var(--player-h) - 58px); }
  .sidebar { display: none; }
  .topbar { padding: 12px 16px 4px; }
  .view { padding: 10px 16px 40px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 58px; z-index: 31; background: var(--panel-solid); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; color: var(--muted); font-weight: 600; }
  .tabbar a.on { color: var(--ember); }
  .player { bottom: 58px; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 6px 10px; padding: 10px 14px; }
  .p-center { grid-column: 1 / -1; grid-row: 2; }
  .p-ctrls { display: none; }
  .p-right { grid-row: 1; grid-column: 2; }
  .p-right #bMute, .p-right input, .p-right #bDl { display: none; }
  .p-right::after { content: none; }
  .p-left .heart { display: none; }
  .p-art { width: 50px; height: 50px; }
  .player .m-play, .player .m-ctl { display: grid !important; }
  .player .m-play { width: 46px; height: 46px; }
  .p-right { gap: 0; }
  .p-right #bQueue { width: 34px; }
  .queue { left: 8px; right: 8px; width: auto; top: 8px; bottom: calc(var(--player-h) + 66px); }
  .np { bottom: calc(var(--player-h) + 58px); overflow-y: auto; place-items: start center; }
  .np-inner { grid-template-columns: 1fr; gap: 26px; max-width: 420px; }
  .np-art { width: min(78vw, 360px); margin: 20px auto 0; }
  .toasts { bottom: calc(var(--player-h) + 70px); }
  .thead { display: none; }
  .tr { grid-template-columns: 26px minmax(0, 1fr) auto 40px; gap: 10px; height: 64px; padding: 0 6px; }
  .tr .t-album, .tr .t-dur { display: none; }
  .tr .t-q .q small { display: none; }
  .t-act .icon-btn { opacity: 1; } .t-act .heart:not(.on) { display: none; }
  .phead { grid-template-columns: 1fr; gap: 18px; justify-items: center; text-align: center; }
  .phead .meta, .phead .btns { justify-content: center; }
  .phead .mosaic, .phead > .art { width: 200px; height: 200px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .tile { padding: 8px; } .tile .fab { opacity: 1; transform: none; width: 40px; height: 40px; }
  .hero { padding: 24px 20px; } .hero .deco { width: 140px; opacity: .5; }
}
.m-play, .m-ctl { display: none !important; }
.side-user { display: flex; align-items: center; gap: 6px; padding: 8px 4px 2px 12px; }
.who { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13px; min-width: 0; }
.who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who svg { width: 16px; height: 16px; color: var(--moss); }
.who:hover { color: var(--text); }
.mobile-only { display: none !important; }
@media (max-width: 820px) { .mobile-only { display: flex !important; } .chip svg { width: 15px; height: 15px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
