:root {
  --bg: #111318; --panel: #1a1d24; --panel2: #22262f; --line: #2d323d;
  --text: #e7e9ee; --muted: #8b92a1; --accent: #5865f2; --green: #23a55a; --red: #da373c;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.muted { color: var(--muted); font-weight: normal; }

.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font: inherit; text-decoration: none; display: inline-block; }
.btn:hover { border-color: #444b59; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: transparent; border-color: var(--red); color: #ff8a8d; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
input, select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.login { min-height: 100vh; display: grid; place-items: center; }
.login-card { background: var(--panel); padding: 40px; border-radius: 16px; max-width: 420px; text-align: center; border: 1px solid var(--line); }
.login-card p { color: var(--muted); line-height: 1.5; margin: 14px 0 24px; }

.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { padding: 18px; font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 7px; }
.login-logo { border-radius: 18px; margin-bottom: 14px; }
.guilds { flex: 1; overflow-y: auto; padding: 0 8px; }
.guild-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px;
  background: none; border: 0; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.guild-item:hover { background: var(--panel2); }
.guild-item.active { background: var(--panel2); box-shadow: inset 3px 0 var(--accent); }
.guild-item img, .guild-item .ph { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.guild-item .ph { background: var(--line); display: grid; place-items: center; font-size: 12px; }
.guild-item .gname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.nav-note { padding: 0 10px; }
.addable-box { max-height: 40vh; overflow-y: auto; padding: 6px 8px 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.nav-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px 4px; }
a.guild-item { color: inherit; text-decoration: none; }
.guild-item.addable { opacity: .7; }
.guild-item.addable:hover { opacity: 1; }
.guild-item .plus { font-size: 18px; color: var(--accent); flex: none; }
.add-any { margin: 6px 10px 0; text-align: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.me { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.me img { width: 28px; height: 28px; border-radius: 50%; }
.me span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { padding: 24px; min-width: 0; }
.empty { color: var(--muted); margin-top: 20vh; text-align: center; }
.guild-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.guild-head img { width: 40px; height: 40px; border-radius: 50%; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--panel2); color: var(--muted); }
.pill.on { background: rgba(35,165,90,.15); color: #6fdc9b; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.now, .card.queue { grid-column: span 2; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }

.np { display: flex; gap: 16px; align-items: center; }
.np img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; flex: none; }
.np-info { flex: 1; min-width: 0; }
#np-title { font-size: 18px; font-weight: 600; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#np-title[href]:hover { text-decoration: underline; }
#np-meta { margin: 4px 0 12px; }
.progress { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; }
#np-bar { height: 100%; width: 0; background: var(--accent); transition: width .9s linear; }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.inline { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); margin-left: 8px; }
.vol input { width: 140px; padding: 0; accent-color: var(--accent); }
#vol-val { width: 38px; color: var(--text); font-variant-numeric: tabular-nums; }

.add form { display: grid; gap: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row select { flex: 1; min-width: 120px; }

.list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .n { width: 26px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.list .t { flex: 1; min-width: 0; }
.list .t a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.list .t a:hover { text-decoration: underline; }
.list .t small { color: var(--muted); }
.list .acts { display: flex; gap: 4px; flex: none; }
.list .empty-row { color: var(--muted); justify-content: center; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; color: var(--muted); }
.form label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.form .btn { justify-self: start; }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--panel2); border: 1px solid var(--line);
  padding: 12px 16px; border-radius: 8px; max-width: 420px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.error { border-color: var(--red); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .guilds { display: flex; overflow-x: auto; padding-bottom: 8px; }
  .guild-item { width: auto; }
  .grid { grid-template-columns: 1fr; }
  .card.now, .card.queue { grid-column: auto; }
  .np img { width: 80px; height: 60px; }
}
.roles { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; margin: 0; }
.roles legend { padding: 0 6px; color: var(--text); }
.hint { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.role-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 160px; overflow-y: auto; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 99px; cursor: pointer; color: var(--text); }
.role-chip:has(input:checked) { border-color: var(--accent); background: rgba(88,101,242,.15); }
.role-chip input { margin: 0; accent-color: var(--accent); }
.progress { cursor: pointer; height: 8px; }
.vote { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.controls.modes { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.inline.check { gap: 6px; color: var(--text); }
.inline.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.lyrics-body { max-height: 360px; overflow-y: auto; white-space: pre-line; line-height: 1.7; }
.lyrics-body .ly { display: block; color: var(--muted); transition: color .2s; }
.lyrics-body .ly.on { color: var(--text); font-weight: 600; }
.playlists .row { margin-bottom: 8px; }
.playlists .row input { flex: 1; }
