:root {
  --bg: #0f1115; --card: #181b22; --line: #262a34; --text: #e9ebf0; --muted: #8b92a3;
  --accent: #7c5cff; --ok: #3ecf8e; --bad: #ff6b6b;
  --spotify: #1ed760; --youtube: #ff3b30; --apple: #fa57c1; --deezer: #a238ff;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; }
main { max-width: 820px; margin: 0 auto; padding: 1rem; }
.top { display: flex; justify-content: space-between; align-items: center; padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
.who { display: flex; gap: .8rem; align-items: center; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.3rem; margin: 1rem 0; }
.card.narrow { max-width: 420px; margin: 3rem auto; }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 .7rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.error { color: var(--bad); }
.ok { color: var(--ok); }
.sync { color: var(--accent); }
.flash { background: #232838; border: 1px solid var(--line); padding: .7rem 1rem; border-radius: 10px; }
input { width: 100%; background: #0d0f13; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: .65rem .8rem; font: inherit; }
input:focus { outline: 2px solid var(--accent); border-color: transparent; }
button, .button { font: inherit; cursor: pointer; border-radius: 10px; padding: .5rem .9rem; border: 1px solid var(--line); background: #222632; color: var(--text); text-decoration: none; display: inline-block; white-space: nowrap; }
button.primary { background: var(--accent); border-color: var(--accent); color: white; }
button.ghost, .button.ghost { background: transparent; }
button.link { background: none; border: none; padding: 0; color: var(--muted); text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
.stack { display: grid; gap: .8rem; }
.stack label { display: grid; gap: .3rem; color: var(--muted); }
.row { display: flex; gap: .6rem; margin-top: 1rem; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
#pname { cursor: text; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.services, .playlists { list-style: none; margin: 0; padding: 0; }
.playlists li { padding: .55rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; }
.svc, .copy { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.svc:last-child, .copy:last-child { border-bottom: none; }
.svc-main { flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.svc-spotify .dot { background: var(--spotify); }
.svc-youtube .dot { background: var(--youtube); }
.svc-apple .dot { background: var(--apple); }
.svc-deezer .dot { background: var(--deezer); }

.adder { position: relative; margin-top: 1rem; }
.results { list-style: none; margin: .4rem 0 0; padding: 0; max-height: 420px; overflow: auto; }
.results li { display: flex; align-items: center; gap: .7rem; padding: .45rem .3rem; border-bottom: 1px solid var(--line); }
.results li span { flex: 1; }
.results img { width: 40px; height: 40px; border-radius: 6px; }

.tracks { list-style: none; margin: 0; padding: 0; }
.tracks li { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.tracks li.dragging { opacity: .4; }
.tracks img, .noart { width: 52px; height: 52px; border-radius: 8px; flex: none; background: #262a34; object-fit: cover; }
.meta { flex: 1; min-width: 0; }
.meta strong { overflow-wrap: anywhere; }
.handle { cursor: grab; color: var(--muted); user-select: none; }
.remove { font-size: 1.1rem; text-decoration: none !important; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .3rem; }
.tag { font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; background: transparent; color: var(--muted); }
.tag.svc-spotify { border-color: var(--spotify); color: var(--spotify); }
.tag.svc-youtube { border-color: var(--youtube); color: var(--youtube); }
.tag.svc-apple { border-color: var(--apple); color: var(--apple); }
.tag.svc-deezer { border-color: var(--deezer); color: var(--deezer); }
.tag.missing { border-style: dashed; color: var(--bad); border-color: var(--bad); }

#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(1rem); opacity: 0; visibility: hidden; background: #2a2f3d; padding: .7rem 1.1rem; border-radius: 10px; transition: all .25s; max-width: 90vw; }
#toast.show { transform: translateX(-50%); opacity: 1; visibility: visible; }
#toast.bad { background: #4a1f24; }

@media (max-width: 560px) {
  .copy { flex-wrap: wrap; }
  .handle { display: none; }
}
