:root {
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --bg: #000;
  --surface: #171717;
  --raised: #242424;
  --hover: #2e2e2e;
  --text: #fff;
  --muted: #9e9e9e;
  --danger: #ef4444;
  --radius: 8px;
  --player-h: 88px;
  --sidebar-w: 232px;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app { height: 100%; }
.splash { display: grid; place-items: center; height: 100%; }
.splash img { width: 72px; height: 72px; border-radius: 16px; opacity: .8; }

/* Layout */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: minmax(0, 1fr) var(--player-h);
  grid-template-areas: "side main" "player player";
  height: 100%;
  gap: 8px;
  padding: 8px 8px 0;
}
.sidebar { grid-area: side; background: var(--surface); border-radius: var(--radius); padding: 16px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 18px; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 6px; color: var(--muted); font-weight: 600; }
.nav a:hover { color: var(--text); text-decoration: none; background: var(--raised); }
.nav a.active { color: var(--text); background: var(--raised); }
.nav svg { width: 20px; height: 20px; flex: none; }
.sidebar .spacer { flex: 1; }
.sidebar .me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 6px; cursor: pointer; background: none; border: 0; text-align: left; width: 100%; }
.sidebar .me:hover, .sidebar .me.active { background: var(--raised); }
.sidebar a:hover { text-decoration: none; }
.sidebar .me .lines { display: flex; flex-direction: column; min-width: 0; font-weight: 600; }
.sidebar .me .lines .muted { font-size: 12px; font-weight: 400; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; color: #fff; }

.main { grid-area: main; background: var(--surface); border-radius: var(--radius); overflow-y: auto; position: relative; }
.page { padding: 24px 28px 48px; max-width: 1600px; }
.page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1 { font-size: 30px; flex: 1; }
.section { margin-top: 32px; }
.section > h2 { font-size: 22px; margin-bottom: 14px; display: flex; align-items: baseline; gap: 12px; }
.section > h2 small { font-size: 13px; font-weight: 400; color: var(--muted); }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 8px 18px; font-weight: 700; background: var(--raised); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px currentColor; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: none; padding: 6px; border-radius: 50%; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--text); }
.icon-btn.on { color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.play-fab { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.play-fab:hover { transform: scale(1.04); }
.play-fab svg { width: 24px; height: 24px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 0; border-radius: 999px; padding: 6px 14px; background: var(--raised); font-weight: 600; cursor: pointer; }
.chip.on { background: var(--accent); color: #fff; }

/* Cards and grids */
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 18px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px; }
.card { position: relative; padding: 10px; margin: -10px; border-radius: var(--radius); cursor: pointer; min-width: 0; }
.card:hover { background: var(--raised); }
.card .art { position: relative; }
.card .art img, .card .art .ph { width: 100%; aspect-ratio: 1; border-radius: 6px; object-fit: cover; box-shadow: 0 6px 16px rgba(0,0,0,.45); }
.card.round .art img, .card.round .art .ph { border-radius: 50%; }
.card .title { font-weight: 600; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .badge { position: absolute; top: 8px; right: 8px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.card .hover-play { position: absolute; right: 8px; bottom: 8px; width: 44px; height: 44px; opacity: 0; transform: translateY(6px); transition: .15s; }
.card:hover .hover-play { opacity: 1; transform: none; }
.ph { display: grid; place-items: center; color: rgba(255,255,255,.75); font-weight: 800; font-size: 28px; text-transform: uppercase; }
.genre { aspect-ratio: 16/9; border-radius: var(--radius); padding: 14px; display: flex; align-items: flex-end; font-weight: 800; font-size: 18px; cursor: pointer; background-size: cover; position: relative; overflow: hidden; }
.genre span { position: relative; }

/* Detail headers */
.hero { display: flex; gap: 24px; align-items: flex-end; padding: 32px 28px 24px; margin: -24px -28px 0; }
.hero .cover { width: 220px; height: 220px; border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.55); object-fit: cover; flex: none; }
.hero.round .cover { border-radius: 50%; }
.hero .kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.hero h1 { font-size: clamp(28px, 4.5vw, 64px); line-height: 1.05; margin: 6px 0 10px; }
.hero .meta { color: rgba(255,255,255,.8); }
.hero .meta a { font-weight: 700; color: #fff; }
.actions { display: flex; align-items: center; gap: 14px; padding: 20px 0 8px; flex-wrap: wrap; }
.bio { color: var(--muted); max-width: 820px; line-height: 1.6; }
.members { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.member { flex: 0 0 200px; background: var(--raised); border-radius: 10px; padding: 12px 14px; color: inherit; text-decoration: none; }
.member.past { opacity: .7; }
a.member:hover { background: var(--hover); }
.member .title, .missing-row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .sub, .missing-row .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.progress { height: 6px; border-radius: 3px; background: var(--raised); max-width: 520px; overflow: hidden; margin-bottom: 14px; }
.progress > div { height: 100%; background: var(--accent); }
.missing-list { max-width: 720px; }
.missing-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hover); }
a.chip { color: inherit; text-decoration: none; }

/* Track lists */
.tracks { width: 100%; border-collapse: collapse; }
.tracks th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--raised); padding: 6px 10px; }
.tracks td { padding: 6px 10px; vertical-align: middle; }
.tracks tr.row { cursor: default; }
.tracks tr.row:hover td { background: var(--raised); }
.tracks tr.row td:first-child { border-radius: 6px 0 0 6px; }
.tracks tr.row td:last-child { border-radius: 0 6px 6px 0; }
.tracks .num { width: 44px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.tracks .dur, .tracks .count { width: 70px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.tracks .act { width: 80px; text-align: right; white-space: nowrap; }
.tracks .act .icon-btn { opacity: 0; }
.tracks tr.row:hover .act .icon-btn, .tracks .act .icon-btn.on { opacity: 1; }
.tracks .t { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tracks .t img, .tracks .t .ph { width: 40px; height: 40px; border-radius: 4px; flex: none; font-size: 14px; }
.tracks .t .lines { min-width: 0; }
.tracks .t .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracks .t .by { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracks tr.playing .name, .tracks tr.playing .num { color: var(--accent); }
.tracks .album { color: var(--muted); max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hires { font-size: 9px; font-weight: 800; background: var(--gradient); color: #000; border-radius: 2px; padding: 1px 4px; margin-right: 6px; vertical-align: 1px; }
.day-head td { padding: 18px 10px 6px; font-weight: 700; color: var(--muted); }

/* Player bar */
.player { grid-area: player; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(180px, 1fr); align-items: center; gap: 16px; padding: 0 12px; }
.np { display: flex; align-items: center; gap: 12px; min-width: 0; }
.np img, .np .ph { width: 56px; height: 56px; border-radius: 4px; flex: none; font-size: 18px; }
.np .lines { min-width: 0; }
.np .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np .by { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controls { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.controls .buttons { display: flex; align-items: center; gap: 14px; }
.controls .pp { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; color: #000; display: grid; place-items: center; cursor: pointer; }
.controls .pp:hover { transform: scale(1.06); }
.controls .pp svg { width: 18px; height: 18px; }
.progress { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress span { width: 40px; text-align: center; }
.right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.quality { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: var(--gradient); color: #000; cursor: help; white-space: nowrap; }
.quality.lossy { background: var(--raised); color: var(--muted); }
[hidden] { display: none !important; }
/* Spotify Connect: covers the player bar while Spotify plays here. */
.player { position: relative; }
.connect-bar { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(320px, 2fr) minmax(180px, 1fr); align-items: center; gap: 16px; padding: 0 12px; background: linear-gradient(90deg, rgba(29,185,84,.22), transparent 60%), var(--bg); }
.connect-bar .spotify, .icon-btn.on .spotify { color: #1db954; font-weight: 700; }
.connect-bar .right .icon-btn.on { color: #1db954; }
.connect-bar .track-line { flex: 1; height: 4px; border-radius: 2px; background: #4d4d4d; overflow: hidden; }
.connect-bar .track-line .fill { height: 100%; background: #fff; width: 0; transition: width .5s linear; }
.connect-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
.connect-targets { display: flex; flex-direction: column; gap: 4px; }
.connect-target { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; border: 0; background: var(--surface); color: var(--text); padding: 10px 12px; border-radius: 8px; cursor: pointer; font: inherit; }
.connect-target:hover { background: var(--hover, #333); }
.connect-target.on { outline: 1px solid #1db954; color: #1db954; }
.connect-target .muted { font-size: 12px; }
/* Another device playing: the bar is its remote. */
.cast-bar { background: linear-gradient(90deg, rgba(139,92,246,.25), transparent 60%), var(--bg); }
.cast-bar .right .icon-btn.on { color: var(--accent); }
.cast-where { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-where svg { width: 14px; height: 14px; flex: none; }
.cast-targets .connect-target.on { outline-color: var(--accent); color: var(--accent); }
.connect-target:disabled { opacity: .5; cursor: default; }
.connect-warning { font-size: 12px; margin-top: 16px; }
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; height: 16px; flex: 1; cursor: pointer; --p: 0%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, #fff var(--p), #4d4d4d var(--p)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, #fff var(--p), #4d4d4d var(--p)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; margin-top: -4px; opacity: 0; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; opacity: 0; }
input[type=range]:hover::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--accent) var(--p), #4d4d4d var(--p)); }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:hover::-moz-range-thumb { opacity: 1; }
.volume { width: 110px; flex: none; }

/* Queue drawer */
.drawer { position: fixed; top: 8px; right: 8px; bottom: calc(var(--player-h)); width: 360px; background: var(--surface); border-radius: var(--radius); box-shadow: -12px 0 32px rgba(0,0,0,.5); z-index: 20; display: flex; flex-direction: column; }
.drawer header { display: flex; align-items: center; padding: 16px; font-weight: 700; font-size: 16px; }
.drawer header h2 { flex: 1; font-size: 18px; }
.drawer .list { overflow-y: auto; padding: 0 8px 16px; }
.drawer h3 { font-size: 13px; color: var(--muted); padding: 12px 8px 6px; }
.qrow { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.qrow:hover { background: var(--raised); }
.qrow img, .qrow .ph { width: 40px; height: 40px; border-radius: 4px; flex: none; font-size: 14px; }
.qrow .lines { flex: 1; min-width: 0; }
.qrow .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow .by { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qrow.current .name { color: var(--accent); }
.qrow .by .rec svg { width: 11px; height: 11px; margin-right: 4px; vertical-align: -1px; color: var(--accent); }
.queue-tools { display: flex; gap: 8px; padding: 0 16px 8px; flex-wrap: wrap; }
.qrow .icon-btn { opacity: 0; }
.qrow:hover .icon-btn { opacity: 1; }

/* Menus, dialogs, toasts */
.menu { position: fixed; z-index: 40; min-width: 200px; background: var(--raised); border-radius: 6px; padding: 4px; box-shadow: 0 12px 32px rgba(0,0,0,.6); }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 4px; cursor: pointer; }
.menu button:hover { background: var(--hover); }
.menu hr { border: 0; border-top: 1px solid var(--hover); margin: 4px 0; }
dialog { background: var(--raised); color: var(--text); border: 0; border-radius: 12px; padding: 24px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(0,0,0,.6); }
dialog h2 { font-size: 20px; margin-bottom: 16px; }
dialog .buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field select, .search-box input { background: var(--surface); border: 1px solid var(--hover); border-radius: 6px; padding: 9px 12px; }
.field input:focus, .field select:focus, .search-box input:focus { border-color: var(--accent); outline: none; }
.field input[type=range] { background: transparent; border: 0; padding: 0; }
.field input[type=range]::-webkit-slider-thumb { opacity: 1; }
.field input[type=range]::-moz-range-thumb { opacity: 1; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--player-h) + 16px); transform: translateX(-50%); background: #fff; color: #000; font-weight: 600; padding: 10px 18px; border-radius: 8px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.search-box { position: relative; max-width: 420px; flex: 1; }
.search-box input { width: 100%; border-radius: 999px; padding-left: 40px; background: var(--raised); }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.top-hit { background: var(--raised); border-radius: var(--radius); padding: 20px; cursor: pointer; display: flex; flex-direction: column; gap: 14px; }
.top-hit img, .top-hit .ph { width: 96px; height: 96px; border-radius: 6px; box-shadow: 0 6px 16px rgba(0,0,0,.45); }
.top-hit.round img, .top-hit.round .ph { border-radius: 50%; }
.top-hit .title { font-size: 28px; font-weight: 800; }
.two-col { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 24px; }

/* Login */
.login { display: grid; place-items: center; height: 100%; background: radial-gradient(ellipse at top, rgba(139,92,246,.35), transparent 60%); padding: 16px; }
.login form { background: var(--surface); border-radius: 16px; padding: 32px; width: min(380px, 100%); }
.login .brand { justify-content: center; padding: 0 0 24px; font-size: 22px; }
.login .brand img { width: 44px; height: 44px; border-radius: 10px; }
.login .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }

/* Stats and admin */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.tile { background: var(--raised); border-radius: 10px; padding: 14px 16px; }
.tile .v { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .l { color: var(--muted); font-size: 12px; margin-top: 2px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; margin-top: 18px; }
.chart div { flex: 1; background: var(--gradient); border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
.chart div:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px); background: #fff; color: #000; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.chart.dense { gap: 1px; }
.chart div.none { background: repeating-linear-gradient(135deg, transparent 0 4px, rgba(255, 255, 255, 0.05) 4px 6px); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; margin: 16px 0; }
.stat-chart h3 small { margin-left: auto; font-size: 12px; font-weight: 500; }
.stat-chart .chart { height: 120px; margin-top: 8px; }
.stat-table { margin: 16px 0; }
.stat-table .avatar, .data-table .avatar { width: 28px; height: 28px; font-size: 11px; }
.ranked { margin: 0; padding-left: 20px; line-height: 2; }
.ranked.plain { list-style: none; padding-left: 0; line-height: 1.6; }
.ranked.plain li { padding: 4px 0; }
.disk { margin-bottom: 12px; }
.disk-l { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.meter { height: 8px; border-radius: 4px; background: var(--hover); overflow: hidden; }
.meter div { height: 100%; background: var(--gradient); border-radius: 4px; }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; }
.panel { background: var(--raised); border-radius: 12px; padding: 18px 20px; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.spaced { margin-top: 16px; }
.footnote { margin-top: 24px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 14px; }
.panel dt { color: var(--muted); }
.panel dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.panel .row { display: flex; gap: 8px; flex-wrap: wrap; }
.panel .btn:not(.primary) { background: var(--hover); }
.panel .btn:not(.primary):hover { background: #3a3a3a; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; display: inline-block; }
.dot.busy { background: var(--accent); animation: pulse 1s infinite alternate; }
.dot.bad { background: var(--danger); }
@keyframes pulse { to { opacity: .3; } }
/* Tables in settings and statistics: scroll sideways on narrow screens. */
.table-wrap { overflow-x: auto; background: var(--raised); border-radius: 12px; padding: 6px 12px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 8px; border-bottom: 1px solid var(--hover); white-space: nowrap; }
.data-table td { padding: 10px 8px; border-bottom: 1px solid var(--hover); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.eq-bands td { padding: 6px 8px; }
.eq-bands input, .eq-bands select { background: var(--surface); border: 1px solid var(--hover); border-radius: 6px; padding: 6px 8px; }
.eq-bands input:focus, .eq-bands select:focus { border-color: var(--accent); outline: none; }
.data-table td.end { text-align: right; width: 1%; }
.data-table .who { display: flex; align-items: center; gap: 10px; }
.data-table .state { display: inline-flex; align-items: center; gap: 8px; }
.dot.off { background: #555; }
.outside .art img, .outside .art .ph, tr.outside .t img, tr.outside .t .ph { filter: saturate(.35); opacity: .75; }
tr.outside .name { color: var(--muted); }
.tracks tr.highlight { background: var(--hover); }
.tracks tr.highlight .name { color: var(--text); font-weight: 700; }
.icon-btn.on { color: var(--accent); }
.tag { font-size: 11px; font-weight: 700; background: var(--hover); padding: 2px 8px; border-radius: 999px; }

/* Narrow screens: sidebar becomes a bottom tab bar above the player. */
@media (max-width: 760px) {
  :root { --player-h: 128px; }
  .shell { grid-template-columns: 1fr; grid-template-areas: "main" "player"; padding: 0; gap: 0; }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; height: 56px; flex-direction: row; padding: 0; border-radius: 0; z-index: 10; background: #000; justify-content: space-around; }
  .sidebar .brand, .sidebar .spacer, .sidebar .nav .wide { display: none; }
  .sidebar .nav { display: contents; }
  .nav a { flex-direction: column; gap: 2px; font-size: 10px; padding: 6px; background: none !important; }
  .sidebar .me { width: auto; padding: 6px; }
  .sidebar .me .lines { display: none; }
  .main { border-radius: 0; }
  .page { padding: 16px; }
  .hero { flex-direction: column; align-items: flex-start; margin: -16px -16px 0; padding: 24px 16px 16px; }
  .hero .cover { width: 160px; height: 160px; }
  .player { grid-template-columns: 1fr auto; grid-template-rows: auto auto; padding: 8px 12px 64px; gap: 6px 12px; background: #111; }
  .player .controls { grid-column: 1 / -1; grid-row: 2; }
  .player .right { grid-row: 1; grid-column: 2; }
  .player .right .volume, .player .right .quality { display: none; }
  .connect-bar { grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; padding: 12px 12px 64px; gap: 8px; background: #0f2a18; }
  .player .connect-bar .controls, .player .connect-bar .right { grid-column: auto; grid-row: auto; }
  .connect-bar .controls .buttons { gap: 6px; }
  .connect-bar .progress { display: none; }
  .cast-bar { background: #1c1430; }
  .cast-bar .right .volume, .cast-bar .buttons button[title=Shuffle], .cast-bar .buttons button[title=Repeat] { display: none; }
  .tracks .album, .tracks th.album-h { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .drawer { left: 8px; width: auto; }
  .shelf { grid-auto-columns: 140px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Server settings */
.env-group + .env-group { margin-top: 16px; }
.env-group .setting:last-child, .panel .setting:last-child { border-bottom: 0; padding-bottom: 4px; }
.panel .setting:first-of-type { padding-top: 4px; }
.setting { display: grid; grid-template-columns: 1fr minmax(220px, 320px); gap: 8px 24px; padding: 14px 0; border-bottom: 1px solid var(--hover); align-items: start; }
.setting label { font-weight: 600; }
.setting.new { background: linear-gradient(90deg, rgba(139,92,246,.12), transparent); margin: 0 -12px; padding: 14px 12px; border-radius: 8px; }
.setting label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.setting code { font-size: 13px; font-weight: 600; }
.setting .desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.setting .desc.note { color: var(--warning, #f59e0b); }
.setting-input input:not([type=checkbox]), .setting-input select { width: 100%; background: var(--surface); border: 1px solid var(--hover); border-radius: 6px; padding: 8px 10px; color: inherit; }
.setting-input input:focus, .setting-input select:focus { border-color: var(--accent); outline: none; }
.setting-input input:disabled { opacity: .6; }
.setting-input .check { margin: 0 12px 0 0; cursor: pointer; }
.tag.accent { background: var(--accent); color: #fff; }
.notice { background: var(--raised); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.notice.accent { border-left: 3px solid var(--accent); flex-direction: row; align-items: center; justify-content: space-between; }
.notice .cmd { display: flex; align-items: center; gap: 10px; }
.notice .cmd code { background: var(--surface); padding: 6px 10px; border-radius: 6px; }
.save-bar { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 10px; justify-content: flex-end; background: var(--raised); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.5); margin-top: 16px; z-index: 5; }
.save-bar span { margin-right: auto; font-weight: 600; }
@media (max-width: 700px) {
  .setting { grid-template-columns: 1fr; }
  .notice.accent { flex-direction: column; align-items: flex-start; }
}

/* Audio visualizer */
.viz { display: block; width: 100%; height: 130px; background: var(--surface); border-radius: 10px; }
.viz.tall { height: 220px; margin: 12px 0 8px; }
.viz-label { font-size: 12px; font-weight: 700; margin: 10px 0 6px; }
.meters { display: grid; gap: 4px; margin: 8px 0 4px; }
.meter { position: relative; height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--gradient); border-radius: 999px; }
.meter.gray i { background: #6b6b6b; }
.meter b { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -2px; background: #fff; }
.meter b.over { background: var(--danger); }

/* Lyrics drawer */
.drawer .lyrics { padding: 8px 20px 40vh; scroll-behavior: smooth; }
.drawer .lyrics p { margin: 0 0 6px; font-size: 16px; line-height: 1.5; color: #ddd; }
.drawer .lyrics .line { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 6px 0; font: inherit; font-size: 22px; font-weight: 800; line-height: 1.3; color: rgba(255, 255, 255, 0.45); cursor: pointer; transition: color .25s; }
.drawer .lyrics .line.past { color: rgba(255, 255, 255, 0.3); }
.drawer .lyrics .line.now { color: #fff; }
.drawer .lyrics .line:hover { color: rgba(255, 255, 255, 0.8); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

/* Library health */
.chip .count { opacity: .7; font-variant-numeric: tabular-nums; }
.health-help { max-width: 760px; margin-bottom: 16px; font-size: 13px; }
.health-list { display: flex; flex-direction: column; gap: 8px; }
.health-item { display: flex; gap: 14px; align-items: center; background: var(--raised); border-radius: 10px; padding: 12px 14px; }
.health-item > a img, .health-item > a .ph { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.health-item .what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.health-item .title { font-weight: 600; }
.health-item .title a, .health-item .copy a { color: inherit; }
.health-item .path { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-item .copy { padding-left: 10px; border-left: 2px solid var(--hover); margin-top: 4px; font-size: 13px; }
.health-item .issues { display: flex; gap: 6px; flex-wrap: wrap; }
.health-item .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.health-item .actions .btn:not(.primary) { background: var(--hover); }
.muted.small, .small.muted { font-size: 12px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
@media (max-width: 700px) {
  .health-item { flex-wrap: wrap; }
  .health-item .actions { width: 100%; justify-content: flex-start; }
}

/* Party guests */
.party { max-width: 560px; margin: 0 auto; padding: 24px 16px 60px; overflow-y: auto; height: 100%; }
.party .brand { padding: 0 0 18px; }
.party .brand img { width: 32px; height: 32px; border-radius: 8px; }
.party h1 { font-size: 28px; margin-bottom: 4px; }
.party > p.muted { margin-bottom: 18px; }
.party h2 { font-size: 17px; margin: 22px 0 8px; }
.party .search-box { max-width: none; margin: 18px 0 8px; }
.party .search-box input { width: 100%; padding: 12px 14px; font-size: 16px; }
.party .field input { font-size: 16px; }
.party-now { margin-top: 8px; }
.party-now .label { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.party-list { display: flex; flex-direction: column; }
.party-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.party-row > img, .party-row > .ph { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.party-row .what { flex: 1; min-width: 0; }
.party-row .title, .party-row .what .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-row .what .muted { font-size: 13px; }
.party-row .add { background: var(--raised); border-radius: 50%; width: 38px; height: 38px; flex: none; }
.party-row .add.on { background: var(--accent); color: #fff; }
.party-ended { text-align: center; }
.party-ended .brand { justify-content: center; }

/* New releases on Home */
.card .release-date { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: #fff; }
.card .release-date.soon { background: rgba(0,0,0,.6); backdrop-filter: blur(6px); }

/* Settings: one place for your settings and, for admins, the server's.
   A section list beside the page; on phones, a row of tabs above it. */
.settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; align-items: start; }
.settings-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 18px; }
.settings-nav .settings-group { display: flex; flex-direction: column; gap: 2px; }
.settings-nav h4 { margin: 0 0 4px; padding: 0 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.settings-nav a:hover { color: var(--text); background: var(--raised); text-decoration: none; }
.settings-nav a.active { color: var(--text); background: var(--raised); box-shadow: inset 3px 0 0 var(--accent); }
.settings-nav svg { width: 18px; height: 18px; flex: none; }
.settings-nav .mark { margin-left: auto; font-size: 10px; }
.settings-body { min-width: 0; max-width: 1180px; }
.settings-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.settings-head .what { min-width: 0; max-width: 720px; }
.settings-head h1 { font-size: 30px; margin-bottom: 6px; }
.settings-head p { margin: 0; line-height: 1.5; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-body > .section:first-child, .settings-body > div > .section:first-child { margin-top: 0; }
.settings-body .section > h2 { font-size: 18px; }
.settings-stack { display: flex; flex-direction: column; gap: 16px; }
.settings-body .section > h2 { flex-wrap: wrap; row-gap: 2px; }
.notice .btn:not(.primary), .table-wrap .btn:not(.primary) { background: var(--hover); }
.notice .btn:not(.primary):hover, .table-wrap .btn:not(.primary):hover { background: #3a3a3a; }
.panel > p.muted:first-of-type { margin-top: 0; }
.panel .connect-h { margin: 16px 0 8px; font-size: 11px; }
.panel .connect-target { background: var(--surface); }
.panel .connect-target:hover:not(:disabled) { background: var(--hover); }
.connect-target svg { width: 18px; height: 18px; flex: none; }
.account { display: flex; align-items: center; gap: 14px; }
.account .avatar { width: 44px; height: 44px; font-size: 15px; }
.account .what { flex: 1; min-width: 0; }
.account .name { font-weight: 700; font-size: 16px; }
.account + p { margin: 14px 0 0; }
@media (max-width: 760px) {
  .settings { grid-template-columns: 1fr; gap: 16px; }
  .settings-nav { position: static; flex-direction: row; gap: 6px; overflow-x: auto; margin: -4px -16px 0; padding: 4px 16px 8px; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav .settings-group { display: contents; }
  .settings-nav h4 { display: none; }
  .settings-nav a { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--raised); font-size: 13px; }
  .settings-nav a.active { background: var(--accent); color: #fff; box-shadow: none; }
  .settings-nav a svg { display: none; }
  .settings-nav .mark { margin-left: 6px; }
  .settings-head h1 { font-size: 24px; }
  .settings-head { margin-bottom: 16px; }
  .panel { padding: 16px; }
  .account { flex-wrap: wrap; }
}
/* "Playing on Living Room": another of your devices plays; click to control it. */
.elsewhere { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 5px 16px; border: 0; background: var(--accent); color: #000; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; }
.elsewhere svg { width: 14px; height: 14px; flex: none; }
.elsewhere .what { font-weight: 400; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.elsewhere .go { text-decoration: underline; }
