/* Pubky Music web UI — design tokens, layout, components. Dark, calm, cover-first. */

:root {
  color-scheme: dark;
  --bg: #0f1014;
  --surface: #16171d;
  --surface-2: #1d1f27;
  --surface-3: #262935;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --fg: #ecedf2;
  --fg-2: #c3c6d1;
  --muted: #8d91a0;
  --accent: #8b7cf6;
  --accent-strong: #a496ff;
  --accent-soft: rgba(139, 124, 246, 0.18);
  --on-accent: #0e0b1f;
  --ok: #4fcf7f;
  --warn: #e8b24a;
  --bad: #ef6b6b;
  --info: #5aa9ff;
  --q-bit: #a496ff;
  --q-enh: #5aa9ff;
  --q-lossless: #4fcf7f;
  --q-lossy: #e8b24a;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --sidebar: 232px;
  --player: 88px;
  --topbar: 60px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --glass: rgba(22, 23, 29, 0.7);
  --play-hover: #fff;
}

/* Light: follows the system unless Settings › Appearance picks one (data-theme on <html>) */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
  color-scheme: light;
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface-2: #f0f0f5;
  --surface-3: #e4e5ed;
  --line: rgba(20, 22, 32, 0.09);
  --line-strong: rgba(20, 22, 32, 0.18);
  --fg: #15161c;
  --fg-2: #3b3f4d;
  --muted: #646979;
  --accent: #6b59e6;
  --accent-strong: #5442d1;
  --accent-soft: rgba(107, 89, 230, 0.12);
  --on-accent: #ffffff;
  --ok: #157040;
  --warn: #7a4f0c;
  --bad: #c93838;
  --info: #2468c4;
  --q-bit: #5442d1;
  --q-enh: #2468c4;
  --q-lossless: #1d8a4b;
  --q-lossy: #9a6512;
  --shadow: 0 10px 30px rgba(20, 22, 40, 0.14);
  --glass: rgba(255, 255, 255, 0.75);
  --play-hover: #000;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface-2: #f0f0f5;
  --surface-3: #e4e5ed;
  --line: rgba(20, 22, 32, 0.09);
  --line-strong: rgba(20, 22, 32, 0.18);
  --fg: #15161c;
  --fg-2: #3b3f4d;
  --muted: #646979;
  --accent: #6b59e6;
  --accent-strong: #5442d1;
  --accent-soft: rgba(107, 89, 230, 0.12);
  --on-accent: #ffffff;
  --ok: #157040;
  --warn: #7a4f0c;
  --bad: #c93838;
  --info: #2468c4;
  --q-bit: #5442d1;
  --q-enh: #2468c4;
  --q-lossless: #1d8a4b;
  --q-lossy: #9a6512;
  --shadow: 0 10px 30px rgba(20, 22, 40, 0.14);
  --glass: rgba(255, 255, 255, 0.75);
  --play-hover: #000;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 22px; line-height: 1.2; }
h3 { font-size: 16px; line-height: 1.3; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-3); color: var(--fg-2); padding: 2px 6px; border-radius: 5px; }
::selection { background: var(--accent-soft); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---- shell ---- */
.shell {
  height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  grid-template-rows: 1fr var(--player);
  grid-template-areas: "side content" "player player";
}
.sidebar {
  grid-area: side;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 12px;
  min-height: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: conic-gradient(from 210deg, #a496ff, #5aa9ff, #4fcf7f, #a496ff); box-shadow: inset 0 0 0 6px var(--surface); }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.nav { display: flex; flex-direction: column; gap: 14px; overflow: auto; min-height: 0; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0 10px 6px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer;
  color: var(--fg-2); text-align: left; transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--fg); }
.nav-item.on { background: var(--accent-soft); color: var(--accent-strong); }
.nav-item.on .ic { color: var(--accent-strong); }
.node-status { margin-top: auto; padding: 10px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); }
.node-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.upstreams { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 4px 10px; border: 0; background: none; color: var(--warn); font: inherit; font-size: 12px; cursor: pointer; border-radius: 8px; text-align: left; width: 100%; }
.upstreams:hover { background: var(--surface-2); }
.upstreams .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.upstreams .up-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-status.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(79, 207, 127, 0.18); }
.node-status.bad .dot { background: var(--bad); }
.node-status.wait .dot { background: var(--warn); animation: conn-pulse 1.2s ease-in-out infinite; }
.node-status.wait, .node-status.bad { cursor: pointer; }
@keyframes conn-pulse { 50% { opacity: 0.35; } }
/* Shown while the node is not connected; appears after 2 s so a short blip does not flash it. */
.connbar {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 60; width: max-content; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 18px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg-2); font-size: 13px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); animation: connbar-in 0.2s ease 2s both;
}
.connbar[hidden] { display: none; }
.connbar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.connbar.wait .dot { animation: conn-pulse 1.2s ease-in-out infinite; }
.connbar.bad .dot { background: var(--bad); }
.connbar-text { min-width: 0; }
.connbar-retry { flex: none; font: inherit; font-size: 12px; color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.connbar-retry:hover { border-color: var(--fg-2); }
@keyframes connbar-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.node-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { grid-area: content; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 24px;
  border-bottom: 1px solid var(--line); background: var(--bg); flex: none;
}
.topbar .menu-btn { display: inline-flex; }
.search {
  display: flex; align-items: center; gap: 8px; flex: 0 1 420px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; height: 38px;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.search:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.search .ic { color: var(--muted); width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--fg); font: inherit; outline: none; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { appearance: none; }
.search kbd { font: 11px ui-monospace, monospace; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; }
.topbar-right { margin-left: auto; font-size: 12px; color: var(--muted); }
.scanning { display: inline-flex; align-items: center; gap: 8px; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.main { flex: 1; overflow: auto; padding: 24px 24px 32px; scroll-behavior: smooth; }
.main > * + * { margin-top: 28px; }

/* ---- player bar ---- */
.player {
  grid-area: player; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 1.3fr) minmax(0, 1fr);
  align-items: center; gap: 16px; padding: 0 20px; background: var(--surface); border-top: 1px solid var(--line);
}
.player-now { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; border-radius: var(--radius-sm); padding: 6px; margin-left: -6px; }
.player-now:hover { background: var(--surface-2); }
.np-art { width: 56px; height: 56px; border-radius: 8px; flex: none; overflow: hidden; background: var(--surface-3); }
.np-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-text { min-width: 0; }
.np-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-center { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.transport { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--fg-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.1s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--fg); }
.icon-btn:active { transform: scale(0.95); }
.icon-btn.play { width: 44px; height: 44px; background: var(--fg); color: var(--bg); }
.icon-btn.play:hover { background: var(--play-hover); }
.icon-btn.play .ic { width: 22px; height: 22px; }
.seek { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px; }
.time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
input[type=range] { appearance: none; -webkit-appearance: none; height: 18px; background: none; margin: 0; cursor: pointer; width: 100%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--fill, 0%), var(--surface-3) var(--fill, 0%)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--surface-3); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: var(--fg); opacity: 0; transition: opacity 0.15s; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--fg); opacity: 0; transition: opacity 0.15s; }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:focus-visible::-webkit-slider-thumb { opacity: 1; }
input[type=range]:hover::-moz-range-thumb, input[type=range]:focus-visible::-moz-range-thumb { opacity: 1; }
.player-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.quality { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer; color: var(--fg-2); white-space: nowrap; }
.quality:hover { border-color: var(--line-strong); }
.qdot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.quality.q-bit_perfect .qdot { background: var(--q-bit); box-shadow: 0 0 8px var(--q-bit); }
.quality.q-enhanced .qdot { background: var(--q-enh); }
.quality.q-lossless .qdot { background: var(--q-lossless); }
.quality.q-lossy .qdot { background: var(--q-lossy); }
.volume { display: flex; align-items: center; gap: 6px; width: 130px; color: var(--muted); }
.zone-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); border-radius: 999px; padding: 6px 10px 6px 12px; cursor: pointer; max-width: 220px; }
.zone-btn:hover { border-color: var(--line-strong); }
.zone-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-btn .chev { width: 16px; height: 16px; color: var(--muted); }

/* ---- popover / overlay / toast / dialog ---- */
.popover {
  position: fixed; right: 20px; bottom: calc(var(--player) + 10px); width: 300px; max-height: 60vh; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; z-index: 30;
}
.popover.menu { position: fixed; z-index: 45; max-height: 60vh; }
.pop-item:disabled { opacity: 0.5; cursor: default; }
.pop-title { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 6px; }
.pop-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px; background: none; cursor: pointer; text-align: left; color: var(--fg); }
.pop-item:hover { background: var(--surface-3); }
.pop-item.on { background: var(--accent-soft); color: var(--accent-strong); }
.pop-item .sub { display: block; font-size: 12px; color: var(--muted); }
.pop-item .state { margin-left: auto; font-size: 11px; color: var(--muted); }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 25; }
.overlay {
  position: fixed; inset: 0 0 var(--player) 0; z-index: 20; overflow: auto;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(139, 124, 246, 0.16), transparent 60%), var(--bg);
  animation: rise 0.25s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.np-page { max-width: 1100px; margin: 0 auto; padding: 24px 32px 48px; }
.np-top { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.np-top .spacer { flex: 1; }
.np-hero { display: grid; grid-template-columns: minmax(220px, 420px) 1fr; gap: 40px; align-items: start; }
.np-big { width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--surface-3); box-shadow: var(--shadow); }
.np-big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-meta h1 { font-size: 34px; margin-top: 8px; }
.np-meta .artist { font-size: 18px; color: var(--fg-2); margin-top: 6px; }
.np-meta .album { color: var(--muted); margin-top: 2px; }
.np-progress { margin: 22px 0 6px; max-width: 520px; }
.path { margin-top: 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass); overflow: hidden; }
.path-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.path-row { display: grid; grid-template-columns: 14px 120px 1fr; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); align-items: baseline; font-size: 13px; }
.path-row:last-child { border-bottom: 0; }
.path-row .pd { width: 8px; height: 8px; border-radius: 50%; }
.path-row .pn { font-weight: 600; }
.path-row .pf { color: var(--muted); }
.path-row .pnote { grid-column: 3; color: var(--muted); font-size: 12px; }
.upnext { margin-top: 26px; }
.lyrics { margin-top: 26px; }
.lyrics h3 { margin-bottom: 8px; }
.lyric-lines { max-height: 320px; overflow-y: auto; padding-right: 8px; scrollbar-width: thin; }
.lyric-line { margin: 0 0 8px; color: var(--muted); font-size: 15px; line-height: 1.45; transition: color .2s, transform .2s; transform-origin: left center; }
.lyric-line.on { color: var(--fg); font-weight: 600; transform: scale(1.03); }
.upnext h3 { margin-bottom: 8px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--player) + 18px); transform: translate(-50%, 8px);
  background: var(--surface-3); color: var(--fg); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; z-index: 40;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); max-width: min(90vw, 520px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-left-color: var(--bad); }
.dialog { background: var(--surface-2); color: var(--fg); border: 1px solid var(--line-strong); border-radius: 14px; padding: 24px; width: min(92vw, 420px); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialog h2 { margin-bottom: 6px; }
.dialog p { margin-bottom: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.field { display: block; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .input { width: 100%; background: var(--surface); border: 1px solid var(--line-strong); color: var(--fg); padding: 9px 12px; border-radius: 8px; font: inherit; }
.field input:focus, .input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--fg); cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { background: none; border-color: transparent; color: var(--fg-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--fg); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.heart.on { color: #ff6b8a; border-color: rgba(255, 107, 138, 0.4); }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- page scaffolding ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .count { color: var(--muted); font-weight: 500; font-size: 14px; margin-left: 10px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.section { }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head .link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px 0; }
.section-head .link:hover { color: var(--fg); }
.back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px 4px 2px; border-radius: 8px; margin-bottom: 14px; }
.back:hover { color: var(--fg); background: var(--surface-2); }
.hero { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: end; }
.hero .art { width: 220px; box-shadow: var(--shadow); }
.hero h1 { margin-top: 6px; }
.hero .sub { font-size: 16px; color: var(--fg-2); margin-top: 6px; }
.hero .facts { color: var(--muted); margin-top: 4px; }
.hero .actions { margin-top: 16px; }
.empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; color: var(--muted); margin-bottom: 10px; }
.empty h3 { color: var(--fg); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); color: var(--fg-2); }
.notice.warn { border-color: rgba(232, 178, 74, 0.4); }
.notice.resign { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.notice.resign span { flex: 1 1 260px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px; }
.sk-grid .skeleton { aspect-ratio: 1; }

/* ---- covers & tiles ---- */
.art { position: relative; width: 100%; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.85); font-weight: 700; font-size: 28px; letter-spacing: 0.02em; }
.art > span:first-child:not([class]) { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.art.sm { font-size: 14px; border-radius: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 20px 18px; }
.strip { display: flex; gap: 18px; overflow-x: auto; padding: 4px 4px 10px; margin: -4px -4px 0; scroll-snap-type: x proximity; scrollbar-width: thin; }
.strip .tile { flex: 0 0 160px; scroll-snap-align: start; }
.tile { cursor: pointer; border-radius: var(--radius); padding: 0; background: none; border: 0; text-align: left; color: inherit; display: block; width: 100%; min-width: 0; }
.tile .art { position: relative; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.tile:hover .art { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .t { margin-top: 9px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .a { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tile-play {
  position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(6px); transition: opacity 0.15s var(--ease), transform 0.15s var(--ease); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); cursor: pointer;
}
.tile:hover .tile-play, .tile:focus-within .tile-play { opacity: 1; transform: none; }
.tile-play:hover { background: var(--accent-strong); }
.tile-play .ic { width: 20px; height: 20px; }

/* ---- track rows ---- */
.tracks { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.track {
  display: grid; grid-template-columns: 40px minmax(0, 2.2fr) minmax(0, 1.4fr) 92px 64px 112px; align-items: center; gap: 12px;
  padding: 0 10px 0 6px; height: 54px; border-bottom: 1px solid var(--line); background: var(--surface);
  transition: background 0.12s var(--ease);
}
.track:last-child { border-bottom: 0; }
.track:hover, .track:focus-within { background: var(--surface-2); }
.track.cur .title { color: var(--accent-strong); }
.track.compact { grid-template-columns: 40px minmax(0, 1fr) 92px 64px 112px; }
.track .no { position: relative; display: flex; align-items: center; justify-content: center; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.track .no .num { transition: opacity 0.1s; }
.track .no .rowplay { position: absolute; inset: 0; margin: auto; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--fg); color: var(--bg); display: flex; align-items: center; justify-content: center; opacity: 0; cursor: pointer; }
.track:hover .num, .track:focus-within .num { opacity: 0; }
.track:hover .rowplay, .track:focus-within .rowplay { opacity: 1; }
.track .rowplay .ic { width: 16px; height: 16px; }
.track .main-col { min-width: 0; }
.track .title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .by { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .album-col { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .album-col button { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; font: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.track .album-col button:hover { color: var(--fg); text-decoration: underline; }
.fmt { font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.track .dur { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.track .row-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity 0.12s; }
.track:hover .row-actions, .track:focus-within .row-actions { opacity: 1; }
.track .row-actions .icon-btn { width: 32px; height: 32px; }
.track .row-actions .icon-btn .ic { width: 18px; height: 18px; }
.track .row-actions .icon-btn.heart.on { color: #ff6b8a; opacity: 1; }
.track .row-actions .icon-btn.heart.on ~ * { }
.track .heart.on { opacity: 1; }
.track:not(:hover) .row-actions .heart.on { opacity: 1; }
.track .row-actions:has(.heart.on) { opacity: 1; }
.track .row-actions:has(.heart.on) .icon-btn:not(.heart) { opacity: 0; }
.track:hover .row-actions .icon-btn, .track:focus-within .row-actions .icon-btn { opacity: 1 !important; }

/* ---- lists & misc ---- */
.list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .sub { color: var(--muted); font-size: 12px; }
.list-row.clickable { cursor: pointer; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; font-weight: 700; color: rgba(255, 255, 255, 0.85); flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--fg-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.tabs { margin-bottom: 4px; }
.chip.on { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); font-weight: 600; }
button.chip { cursor: pointer; font: inherit; }
button.chip:hover { border-color: var(--line-strong); color: var(--fg); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card h3 { margin-bottom: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.zone-card { display: flex; flex-direction: column; gap: 12px; }
.zone-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.zone-card .zc-head { display: flex; align-items: center; gap: 10px; }
.zone-card .zc-head h3 { margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-card .zc-now { display: flex; gap: 12px; align-items: center; min-height: 56px; }
.zone-card .zc-now .art, .zone-card .zc-now .np-art { width: 56px; height: 56px; flex: none; }
.zone-card .zc-text { min-width: 0; flex: 1; }
.zone-card .zc-text .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-card .zc-text .sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-card .zc-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.zone-card .icon-btn.big { width: 40px; height: 40px; background: var(--accent); color: var(--on-accent); border-radius: 50%; }
.zone-card .icon-btn.big:hover { background: var(--accent-strong); }
.zone-card .zc-controls input[type=range] { flex: 1; min-width: 100px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .input { width: 260px; }
.file-btn input { display: none; }
/* Account pills carry names (users, servers): their case is kept */
.pill.account { text-transform: none; letter-spacing: 0; font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--fg-2); }
.pill.ok { color: var(--ok); background: rgba(79, 207, 127, 0.12); }
.pill.warn { color: var(--warn); background: rgba(232, 178, 74, 0.12); }
.pill.bad { color: var(--bad); background: rgba(239, 107, 107, 0.12); }
.qr-note { word-break: break-all; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  :root { --sidebar: 72px; }
  .brand-name, .nav-label, .nav-item span, .node-text { display: none; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .node-status { justify-content: center; }
  .player { grid-template-columns: minmax(0, 1fr) minmax(220px, 1.4fr) auto; }
  .volume { display: none; }
}
/* ☰ on desktop and tablet: the sidebar collapses to icons, or (when narrow) expands to names. */
.shell.collapsed { --sidebar: 72px; }
.shell.collapsed .brand-name, .shell.collapsed .nav-label, .shell.collapsed .nav-item span, .shell.collapsed .node-text { display: none; }
.shell.collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.shell.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.shell.collapsed .node-status { justify-content: center; }
@media (max-width: 1100px) and (min-width: 721px) {
  .shell.expanded { --sidebar: 232px; }
  .shell.expanded .brand-name, .shell.expanded .nav-label, .shell.expanded .nav-item span, .shell.expanded .node-text { display: initial; }
  .shell.expanded .brand { justify-content: flex-start; padding: 2px 10px 18px; }
  .shell.expanded .nav-item { justify-content: flex-start; padding: 8px 10px; }
  .shell.expanded .node-status { justify-content: flex-start; }
}
@media (max-width: 720px) {
  /* The player wraps to two rows on phones: its row takes the height it needs (a fixed row hid
     play, previous, next and the seek bar below the screen) */
  .shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "content" "player"; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform 0.2s var(--ease); --sidebar: 260px; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .sidebar .brand-name, .sidebar .nav-label, .sidebar .nav-item span, .sidebar .node-text { display: initial; }
  .sidebar .nav-item { justify-content: flex-start; padding: 10px; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .main { padding: 18px 14px 28px; }
  .player { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto; height: auto; padding: 8px 12px; gap: 10px; }
  .player-center { grid-column: 1 / -1; order: 3; }
  .player-right { gap: 6px; }
  .quality .qtext { display: none; }
  .zone-btn span { max-width: 90px; }
  .hero { grid-template-columns: 1fr; }
  .hero .art { width: 180px; }
  .main > .back + .hero, .main > .pagebar + .hero { margin-top: 8px; }
  /* Phones (second review #22): two covers per row, and song titles get the row's width */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .track { grid-template-columns: 26px minmax(0, 1fr) 38px 32px; gap: 8px; }
  .track .album-col, .track .fmt { display: none; }
  .track .idmark { display: none; }
  .track .dur { padding-right: 0; }
  .track .row-actions { opacity: 1; }
  .track .row-actions .icon-btn:not([data-act="more"]) { display: none; }
  .track .row-actions:has(.heart.on) .icon-btn:not(.heart) { opacity: 1; }
  .track.compact { grid-template-columns: 26px minmax(0, 1fr) 38px 32px; }
  .np-hero { grid-template-columns: 1fr; }
  .np-page { padding: 16px; }
  .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.card.genre { border: 1px solid var(--line); color: var(--fg); font: inherit; transition: transform 0.15s var(--ease), border-color 0.15s var(--ease); }
.card.genre:hover { transform: translateY(-2px); border-color: var(--line-strong); }

/* ---- queue ---- */
.list.queue .list-row { padding: 6px 10px 6px 6px; }
.list.queue .num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.list.queue .q-actions { opacity: 0; display: inline-flex; gap: 2px; transition: opacity 0.12s; }
.list.queue .list-row:hover .q-actions, .list.queue .list-row:focus-within .q-actions { opacity: 1; }
.list.queue .q-actions .icon-btn { width: 30px; height: 30px; }
.list.queue .q-actions .icon-btn .ic { width: 16px; height: 16px; }
.list.queue .ic.up { transform: rotate(180deg); }
.list.queue .icon-btn:disabled { opacity: 0.3; cursor: default; }

/* ---- DSP editor ---- */
.dsp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; align-items: end; }
.dsp-grid label span, .eq-row span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.dsp-grid label.check, label.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); }
.dsp-grid .cf-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(120px, 200px)); gap: 12px; }
.eq { display: flex; flex-direction: column; gap: 6px; }
.eq-row { display: grid; grid-template-columns: 140px 110px 90px 80px auto 36px; gap: 8px; align-items: center; }
.eq-row .input { padding: 6px 10px; }
.card.dsp select.input { appearance: auto; }
@media (max-width: 720px) { .eq-row { grid-template-columns: 1fr 1fr; } .dsp-grid .cf-fields { grid-template-columns: 1fr; } }

/* ---- artist hero ---- */
.artist-hero { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 8px; }
.artist-hero .grow { flex: 1; min-width: 0; }
.portrait { width: 140px; height: 140px; border-radius: 50%; flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 40px; color: rgba(255,255,255,0.85); box-shadow: var(--shadow); }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bio { color: var(--fg-2); max-width: 72ch; margin-top: 12px; line-height: 1.55; }
.artist-hero a { color: var(--fg-2); }
.artist-hero a:hover { color: var(--accent-strong); }
@media (max-width: 720px) { .artist-hero { flex-direction: column; } .portrait { width: 110px; height: 110px; } }

/* ---- reviews ---- */
.reviewrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.stars { display: inline-flex; gap: 2px; }
.star { position: relative; display: inline-block; width: 24px; height: 26px; font-size: 22px; line-height: 26px; color: var(--muted); }
.star .glyph { position: absolute; inset: 0; text-align: center; pointer-events: none; }
.star.f2 .glyph { color: var(--warn); }
.star.f1 .glyph { background: linear-gradient(90deg, var(--warn) 50%, var(--muted) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.star .half { position: absolute; top: 0; bottom: 0; width: 50%; background: none; border: 0; padding: 0; cursor: pointer; }
.star .half.l { left: 0; border-radius: 4px 0 0 4px; }
.star .half.r { right: 0; border-radius: 0 4px 4px 0; }
.star .half:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ratingval { color: var(--muted); font-size: 13px; margin-right: 8px; min-width: 4.5em; }
.notes { flex-basis: 100%; color: var(--fg-2); white-space: pre-wrap; max-width: 560px; }
.notes-edit { flex-basis: 100%; max-width: 560px; }
.notes-edit textarea { resize: vertical; font: inherit; }

/* ---- tags ---- */
.tagrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip.tag { padding: 0; overflow: hidden; }
.chip.tag .chiplink { background: none; border: 0; color: var(--fg-2); padding: 5px 4px 5px 10px; cursor: pointer; font: inherit; font-size: 12px; }
.chip.tag .chiplink:hover { color: var(--accent-strong); }
.chip.tag .chipx { background: none; border: 0; color: var(--muted); padding: 5px 9px 5px 4px; cursor: pointer; font: inherit; font-size: 13px; line-height: 1; }
.chip.tag .chipx:hover { color: var(--bad); }
.taginput { background: var(--surface-2); border: 1px solid var(--line); color: var(--fg); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12px; width: 130px; }
.taginput:focus { border-color: var(--accent); outline: none; }
.fmt { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.02em; background: var(--surface-3); color: var(--fg-2); vertical-align: 1px; }
.fmt.hi { background: var(--accent-soft); color: var(--accent-strong); }
.fmt.lossy { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chips .chip { cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg-2); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.chips .chip:hover { border-color: var(--line-strong); color: var(--fg); }
.chips .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.chips .chip .count { margin-left: 4px; color: var(--muted); font-size: 12px; }
.list.compact { margin-top: 8px; }
.list.compact .list-row { padding: 6px 10px; min-height: 0; }
.page-head .count[data-filtered]:not([data-filtered=''])::after { content: ' · ' attr(data-filtered); color: var(--accent-strong); }
.list-row .thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; background: var(--surface-3); margin-right: 10px; }
.src-badge { display: inline-block; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; background: var(--surface-3); color: var(--fg-2); vertical-align: 1px; margin-left: 4px; }
.src-badge.lib { background: var(--accent-soft); color: var(--accent-strong); }
.tile .art .src-badge { position: absolute; left: 8px; bottom: 8px; margin: 0; background: rgba(0,0,0,0.65); color: #fff; }
.tile .art .src-badge.lib { left: auto; right: 8px; }
.src-badge.ico { width: 24px; height: 24px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.72); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.src-badge.ico svg { width: 14px; height: 14px; fill: currentColor; display: block; }
.tile .art .src-badge.ico { left: 8px; bottom: 8px; }
.src-badges { display: inline-flex; gap: 4px; align-items: center; }
.tile .art .src-badges { position: absolute; left: 8px; bottom: 8px; }
.src-badges .src-badge.ico { position: static; margin: 0; }
.chip-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 6px; }

/* Pubky Ring sign-in: a QR tile next to the instructions. */
.qrbox { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.qrbox .qr { flex: 0 0 180px; width: 180px; height: 180px; border-radius: 12px; overflow: hidden; background: #fff; padding: 6px; box-sizing: border-box; }
.qrbox .qr svg { width: 100%; height: 100%; display: block; }
.qrbox p { margin: 0 0 10px; }

/* TIDAL's embedded player, docked above the transport bar. */
.embedpanel { position: fixed; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); width: min(440px, calc(100vw - 32px)); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); z-index: 40; overflow: hidden; }
.embedhead { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.embedhead .muted { flex: 1; }
.embedpanel iframe { width: 100%; height: 160px; border: 0; display: block; background: #000; }


/* "Plays from" chip: the resolver's answer (rows, tiles, item page). */
.plays { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--fg-2); padding: 2px 8px 2px 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.plays svg { width: 14px; height: 14px; fill: currentColor; }
.plays.none { color: var(--muted); border-style: dashed; }
.plays.none a { color: var(--accent-strong); cursor: pointer; }
.playsfrom { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.playsfrom .plays { font-size: 13px; padding: 4px 10px 4px 5px; }
.list-row > .plays { margin-right: 6px; }

/* Identification: the row mark, the Settings bar, the review view. */
.idmark { margin-left: 8px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); font-size: 11px; line-height: 1.5; cursor: pointer; vertical-align: 1px; opacity: 0; transition: opacity .12s; }
.idmark:hover { color: var(--accent-strong); border-color: var(--accent); }
.track:hover .idmark, .track:focus-within .idmark, .idmark:focus-visible { opacity: 1; }
@media (hover: none) { .idmark { opacity: .8; } }
.idbar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 6px 0 8px; }
.idbar span { display: block; height: 100%; background: var(--accent); }
.idrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; padding: 12px 14px; border-top: 1px solid var(--line); }
.idrow:first-child { border-top: 0; }
.idopts { display: flex; flex-direction: column; gap: 6px; }
.idopt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.idopt .grow { min-width: 0; flex: 1; }
@media (max-width: 720px) { .idrow { grid-template-columns: 1fr; } }

.reading { margin: 4px 0 10px; }

/* Queue drag to reorder. */
.qgrip { cursor: grab; touch-action: none; user-select: none; color: var(--muted); letter-spacing: -3px; padding: 6px 6px 6px 2px; font-size: 14px; line-height: 1; border-radius: 6px; }
.qgrip:hover, .qgrip:focus-visible { color: var(--fg); background: var(--surface-2); outline: none; }
.qdrag-active, .qdrag-active * { cursor: grabbing !important; user-select: none; }
.list.queue .list-row { position: relative; }
.qdrag-active .list.queue .list-row:not(.qdragging) { transition: transform 0.15s var(--ease); }
.list.queue .list-row.qdragging { z-index: 5; background: var(--surface-3); box-shadow: var(--shadow); border-radius: var(--radius-sm); transition: none; }

/* Identify: folder vs. MusicBrainz release, side by side. */
.alignbox { margin: 8px 0 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.alignhead, .alignrow { display: grid; grid-template-columns: 28px minmax(0, 1fr) 22px minmax(0, 1fr); gap: 10px; align-items: center; padding: 5px 0; }
.alignhead { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 4px; font-size: 13px; }
.alignrow { border-top: 1px solid var(--line); font-size: 13px; }
.alignrow .aside { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alignrow .amark { text-align: center; font-weight: 700; }
.alignrow.ok .amark { color: var(--ok); }
.alignrow.diff .amark { color: var(--warn); }
.alignrow.none { opacity: 0.6; }
@media (max-width: 720px) { .alignhead, .alignrow { grid-template-columns: 22px minmax(0, 1fr) 18px minmax(0, 1fr); gap: 6px; } }

/* One search: progress bar, scope chips, fade-in (STEWARD-UX-HOME.md "Search"). */
.search { position: relative; }
.sprog { position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.sprog > span { display: block; height: 100%; width: 8%; background: var(--accent); transition: width 0.25s var(--ease); }
.scopechips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.chip.scope { display: inline-flex; align-items: center; gap: 6px; }
.chip.scope.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.chip.scope .cnt { font-size: 11px; color: var(--muted); }
.chip.scope .bad { font-size: 11px; color: var(--bad); font-weight: 700; }
.chip.scope .spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fadein { animation: fadein 0.18s var(--ease) both; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fadein, .chip.scope .spin, .sprog > span { animation: none; transition: none; } }
.toprow { display: flex; align-items: center; gap: 16px; padding: 14px; }
.toprow .art { width: 88px; height: 88px; border-radius: 10px; overflow: hidden; background: var(--surface-3); flex: none; }
.toprow .art.round { border-radius: 50%; }
.toprow .art img { width: 100%; height: 100%; object-fit: cover; }
.toprow .name.big { font-size: 22px; font-weight: 700; }
.list-row .src-badges { margin-right: 6px; }
.snotes { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; }
.snote { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.snote .src-badge.ico { width: 18px; height: 18px; }
.chips.win { display: inline-flex; gap: 4px; margin-left: 10px; }
.chips.win .chip { padding: 2px 10px; font-size: 12px; }
.chips.win .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }

/* Classes the design lint found without a rule (tools/design-lint.js) */
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-group { display: flex; flex-direction: column; }
.placeholder { background: var(--surface-2); }
.lnk { color: inherit; cursor: pointer; text-decoration: none; background: none; border: 0; padding: 0; font: inherit; text-align: left; }
.lnk:hover { color: var(--fg); text-decoration: underline; }
.lnk:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.srow .num { width: 24px; text-align: right; flex: none; }
.input.filter { width: 200px; max-width: 100%; }
.hbody { min-height: 48px; }
.blurb { max-width: 72ch; line-height: 1.6; color: var(--fg-2); margin: 0 0 12px; }
.btn.icon-only { padding-left: 10px; padding-right: 10px; }
.idfile { min-width: 0; }
.eq-row .eq-kind { text-transform: capitalize; }
.eq-row .eq-freq, .eq-row .eq-gain, .eq-row .eq-q { font-variant-numeric: tabular-nums; }
.eq-row .eq-on { accent-color: var(--accent); }
.eq-row .eq-del { justify-self: end; }
.chip .ic { width: 14px; height: 14px; flex: none; }
.scopeswitch { gap: 6px; }
.amark .ic { width: 16px; height: 16px; color: var(--ok); }
.lyric-line .ic { width: 16px; height: 16px; opacity: 0.6; }
.chiplink { display: inline-flex; align-items: center; background: none; border: 0; padding: 2px; border-radius: 999px; color: var(--fg-2); cursor: pointer; font: inherit; }
.chiplink:hover { color: var(--accent-strong); background: var(--surface-3); }
.chiplink:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Where playlist songs play from: source chips, the summary bar, the order list */
.srcchip { flex: none; max-width: 150px; padding: 3px 8px 3px 4px; }
.srcchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srcchip .src-badge { width: 18px; height: 18px; }
.srcchip.pinned { border-color: var(--accent); }
.srcchip.pinned .ic { width: 12px; height: 12px; color: var(--accent-strong); }
.srcchip.none { color: var(--muted); border-style: dashed; padding-left: 8px; }
.list-row.unavail .grow, .list-row.unavail .thumb, .list-row.unavail [data-splay] { opacity: 0.45; }
.list-row.filtered { display: none; }
.plsummary { margin-bottom: 12px; }
.chip.warnchip { border-color: rgba(232, 178, 74, 0.4); }
.porder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.porder-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); transition: transform 0.15s var(--ease); }
.porder-row.off .grow { color: var(--muted); }
.porder-row.dragging { z-index: 2; background: var(--surface-3); box-shadow: var(--shadow); transition: none; }
.porder-grip { cursor: grab; touch-action: none; color: var(--muted); display: inline-flex; padding: 4px; border-radius: 6px; }
.porder-grip:hover, .porder-grip:focus-visible { color: var(--fg); background: var(--surface-3); outline: none; }
.porder-grip .ic { width: 16px; height: 16px; }
.pop-item.on { color: var(--accent-strong); }
.pop-item .pop-check { margin-left: auto; width: 16px; height: 16px; }
.pop-note { display: block; font-size: 11px; color: var(--muted); }
.pop-item:disabled { opacity: 0.55; cursor: default; }
@media (max-width: 600px) { .srcchip span { display: none; } .srcchip { padding: 3px; } }
.srcchip.wait { padding: 5px 9px; }
.srcchip .spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .srcchip .spin { animation: none; } }
/* Row reorder buttons outside the queue (playlist songs), and the up chevron everywhere */
.ic.up { transform: rotate(180deg); }
.q-actions { display: inline-flex; gap: 2px; flex: none; }
.q-actions .icon-btn { width: 30px; height: 30px; }
.q-actions .icon-btn .ic { width: 16px; height: 16px; }
@media (hover: hover) { .srow .q-actions { opacity: 0; transition: opacity 0.12s; } .srow:hover .q-actions, .srow:focus-within .q-actions { opacity: 1; } }
@media (max-width: 600px) { #plsongs .srow .thumb { display: none; } #plsongs .srow { gap: 6px; } #plsongs .srow .q-actions { display: none; } }
.porder-row .grow { flex: 1; min-width: 0; }
/* Choice dialog (playlist import) */
.choices { display: flex; flex-direction: column; gap: 8px; }
.btn.choice { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; height: auto; white-space: normal; border-radius: 12px; }
.choice-label { font-weight: 600; }
.choice-note { font-size: 12px; font-weight: 400; opacity: 0.8; }
/* Item pages: the back arrow and the breadcrumb on one line */
.pagebar { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: '›'; margin-right: 4px; color: var(--muted); }
.crumbs li[aria-current] { color: var(--fg-2); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .lnk { color: var(--muted); }
.np-title .lnk, .np-sub .lnk { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Appearance switch (Settings) */
.themeswitch { gap: 6px; }
/* A field the user is sent to (Sources › Search …): a short ring */
.nudge { animation: nudge 0.9s var(--ease); }
@keyframes nudge { 0% { box-shadow: 0 0 0 0 var(--accent-soft); } 40% { box-shadow: 0 0 0 6px var(--accent-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .nudge { animation: none; outline: 2px solid var(--accent); } }
a.btn { text-decoration: none; }
.sharelink { font-size: 12px; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.eyebrow code { text-transform: none; letter-spacing: 0; }
.subform { max-width: 520px; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
/* A node job's progress (copying to the homeserver) */
/* A running files job: a small chip in the player bar (details in #jobpop) */
.jobchip { display: inline-flex; align-items: center; gap: 6px; position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 5px 10px 7px; font-size: 12px; cursor: pointer; color: var(--fg-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.jobchip[hidden] { display: none; }
.jobchip:hover { border-color: var(--line-strong); }
.jobchip .ic { width: 15px; height: 15px; }
.jobchip .jc-text { line-height: 1; }
.jobchip .jc-bar { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; border-radius: 1px; background: var(--surface-3); }
.jobchip .jc-bar span { display: block; height: 100%; border-radius: 1px; background: var(--accent); transition: width 0.4s var(--ease); }
.jobchip.done { color: var(--accent-strong); }
#jobpop { width: min(340px, calc(100vw - 32px)); }
.jobpop-body { padding: 0 10px 8px; }
.jobpop-body .row-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.dialog-field { display: grid; gap: 4px; margin: 4px 0 12px; }
.list-row.broken .name { color: var(--warn, var(--fg-2)); }
.jobbar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-bottom: 8px; }
.jobbar span { display: block; height: 100%; background: var(--accent); transition: width 0.4s var(--ease); }
.jobcur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.joberr { color: var(--bad); }
/* Move from Roon */
#roonmove input[type=file] { margin: 8px 0; max-width: 100%; }
#roonmove .check { display: block; margin: 4px 0; }
.steps { padding-left: 18px; margin: 4px 0 8px; }
.roonfile { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.roonfile .name { font-weight: 600; overflow-wrap: anywhere; }
.misses { padding-left: 18px; max-height: 240px; overflow: auto; }
/* Thumb-sized player controls on phones (at least 44 px, WCAG target size) */
@media (max-width: 720px) {
  .player #prev, .player #next { width: 44px; height: 44px; }
  .player .zone-btn { min-height: 44px; }
  .player .quality { min-height: 44px; min-width: 44px; padding: 0 12px; justify-content: center; }
}
.grow-more { height: 1px; }

/* First run: Home's "Get started" card (steward next-3, item 2) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.setup-card { padding: 18px 20px; }
.setup-card .section-head { margin-bottom: 6px; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.setup-step { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.setup-step:first-child { border-top: 0; }
.setup-step .name { font-weight: 600; }
.setup-step .sub { color: var(--muted); font-size: 13px; margin: 2px 0 10px; max-width: 70ch; }
.setup-step.done .sub { margin-bottom: 0; }
.setup-step .toolbar .input { flex: 1 1 260px; min-width: 0; }
.stepmark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; background: var(--surface-3); color: var(--fg-2); }
.setup-step.done .stepmark { background: var(--accent-soft); color: var(--accent-strong); }
.setup-step.done .stepmark .ic { width: 16px; height: 16px; }
.setup-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.setup-suggest .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-step .lnk { color: var(--accent-strong); text-decoration: underline; }
.setup-card > p .lnk { color: var(--accent-strong); text-decoration: underline; }

/* Backup and restore (steward next-4, item 1) */
.stack { display: flex; flex-direction: column; gap: 8px; }
.warn-text { color: var(--warn); }
.notice.ok-notice { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
#backupcard .toolbar { margin-top: 8px; flex-wrap: wrap; }
#backupcard .toolbar .input { flex: 1 1 200px; min-width: 0; }
.scanerrs { margin-top: 10px; color: var(--fg-2); }
.scanerrs summary { cursor: pointer; color: var(--warn); }
.scanerrs ul { margin: 6px 0 0 18px; padding: 0; }

/* Fresh-eyes review: phones */
.track .dur { padding-right: 6px; }
@media (max-width: 720px) {
  .track .fmt-col { display: none; }
  .np-top { gap: 4px; margin-bottom: 16px; }
  .np-top > .muted { display: none; }
  .np-top .btn { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 600px) {
  .srow { gap: 8px; padding: 10px 8px; }
  .srow .num { display: none; }
  .srow .thumb { width: 36px; height: 36px; margin-right: 0; }
  .srow .src-badges { display: none; }
  .srow .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .search kbd, .search .kbd { display: none; }
}
@media (max-width: 420px) {
  .player .zone-btn span { display: none; }
}

/* Settings: side tabs, one topic per tab, settings as rows (STEWARD-UX-SETTINGS.md) */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.set-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; }
.set-tab { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); background: none; border: 0; color: var(--fg-2); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.set-tab .ic { width: 18px; height: 18px; flex: none; }
.set-tab:hover { background: var(--surface-2); color: var(--fg); }
.set-tab.on { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.set-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.set-tab .chev { display: none; margin-left: auto; }
.set-body-wrap { min-width: 0; max-width: 860px; }
.set-title { font-size: 20px; margin: 0 0 16px; }
.set-back { display: none; margin-bottom: 8px; }
.set-group { margin-bottom: 28px; }
.set-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; }
.set-rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 20px; padding: 14px 16px; border-top: 1px solid var(--line); min-width: 0; }
.set-rows > :first-child { border-top: 0; }
.set-label { flex: 1 1 auto; min-width: 0; }
.set-name { font-weight: 550; overflow-wrap: anywhere; }
.set-help { margin: 3px 0 0; color: var(--muted); font-size: 13px; max-width: 64ch; overflow-wrap: anywhere; }
.set-ctl { flex: 0 1 auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; min-width: 0; }
.set-block { flex-direction: column; align-items: stretch; gap: 10px; }
.set-body { min-width: 0; }
.set-body .toolbar { flex-wrap: wrap; }
.set-body .toolbar .input { flex: 1 1 220px; min-width: 0; width: auto; }
.set-list .set-item { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.set-list .set-item:first-child { border-top: 0; padding-top: 0; }
.set-list .set-item .grow { flex: 1; min-width: 0; }
.set-list .set-item .name, .set-list .set-item .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-list .set-item .sub { color: var(--muted); font-size: 12px; }
.set-rows > #pkurl:not(:empty), .set-rows > #dspbox:not(:empty), .set-rows > .set-note { padding: 0 16px 14px; }
.set-rows > .notice { margin: 0 16px 14px; }
.set-rows #pkfiles .list { margin-top: 6px; }
.nowrap { white-space: nowrap; }
code.path { font-size: 13px; overflow-wrap: anywhere; }
.pkey { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; vertical-align: middle; }
.pkey code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
@media (max-width: 720px) {
  .settings { grid-template-columns: 1fr; gap: 0; }
  .settings.no-panel .set-body-wrap { display: none; }
  .settings.has-panel .set-nav { display: none; }
  .set-nav { position: static; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; gap: 0; }
  .set-tab { padding: 14px 14px; border-radius: 0; border-top: 1px solid var(--line); font-size: 15px; }
  .set-tab:first-child { border-top: 0; }
  .set-tab.on { background: none; color: var(--fg-2); font-weight: 400; }
  .set-tab .chev { display: inline; transform: rotate(-90deg); }
  .set-back { display: inline-flex; }
  .set-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .set-ctl { max-width: none; justify-content: flex-start; }
}
.set-panel { min-width: 0; }
.set-list .set-item .caps { flex: 0 1 50%; text-align: right; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) { .set-list .set-item { flex-wrap: wrap; } .set-list .set-item .caps { flex-basis: 100%; text-align: left; } }
.set-help .spin { display: inline-block; vertical-align: -1px; margin-right: 4px; }
.reading .spin { display: inline-block; vertical-align: -1px; margin-right: 6px; }
/* Sources: the Settings layout, one tab per service with its on/off switch (STEWARD-UX-SOURCES.md) */
.src-tabrow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.src-tabrow .set-tab { flex: 1 1 auto; min-width: 0; }
.src-tabrow.off .set-tab { opacity: 0.55; }
.src-tname { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.src-t1, .src-tsub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-tsub { font-size: 12px; color: var(--fg-2); font-weight: 400; }
.src-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 700; }
.src-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); }
.src-dot.ok { background: var(--ok); box-shadow: none; }
.src-dot.bad { background: var(--bad); box-shadow: none; }
.src-dot.off { background: transparent; }
.set-adv { border-top: 1px solid var(--line); }
.set-adv > summary { padding: 12px 16px; color: var(--muted); font-size: 13px; cursor: pointer; }
.set-adv > summary:hover { color: var(--fg); }
.src-offgroup summary { padding: 9px 12px; color: var(--muted); font-size: 13px; cursor: pointer; }
.src-desc { margin: -8px 0 16px; max-width: 70ch; }
.src-noswitch { width: 34px; margin: 0 4px; flex: none; }
/* Sign in: the ways side by side, one picked (STEWARD-CREDENTIALS-REUSE.md) */
.ways { display: flex; flex-direction: column; gap: 6px; }
.way { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; min-width: 0; }
.way.on { border-color: var(--accent); background: var(--surface-2); }
.way.off { opacity: 0.6; cursor: default; }
.way input { margin: 3px 0 0; flex: none; accent-color: var(--accent); }
.way input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.way-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.way-name { font-weight: 550; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.way-note { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.way-action { margin-top: 10px; min-width: 0; }
.way-action .toolbar { flex-wrap: wrap; }
.way-action .toolbar .input { flex: 1 1 220px; min-width: 0; width: auto; }
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 34px; height: 20px; flex: none; margin: 0 4px; border-radius: 999px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--fg-2); transition: transform 0.15s, background 0.15s; }
.switch:checked { background: var(--accent); box-shadow: none; }
.switch:checked::after { transform: translateX(14px); background: #fff; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 720px) {
  .src-nav .src-tabrow { border-top: 1px solid var(--line); padding-right: 10px; }
  .src-nav .src-tabrow:first-child { border-top: 0; }
  .src-nav .src-tabrow .set-tab { border-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }
.tf-code { font-size: 22px; font-weight: 700; letter-spacing: 0.12em; padding: 4px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.set-body .notice code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; vertical-align: bottom; }
.ytpanel .ytbox { aspect-ratio: 16 / 9; background: #000; }
.ytpanel .ytbox iframe, .ytpanel #ytframe { width: 100%; height: 100%; border: 0; display: block; }
.ytpanel.small { width: min(360px, calc(100vw - 32px)); }
.ytpanel.small .embedhead .muted { display: none; }
.ytpanel #ytmin .ic { transition: transform 0.15s; }
.ytpanel.small #ytmin .ic { transform: rotate(180deg); }
@media (max-width: 720px) { .ytpanel { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); } }

/* Player bar: the cover opens Now playing; Now playing's Pubky row */
.np-artbtn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; }
.np-artbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.np-pubky { margin: 14px 0 6px; display: flex; flex-direction: column; gap: 10px; }
.np-pubky-row { display: flex; flex-wrap: wrap; gap: 8px; }
.np-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.np-tags .taginput { width: 160px; }
.fixlist .set-item .sub { white-space: normal; }
.set-warn { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0; color: var(--warn); }
/* Item pages: one instance per page, the same recording elsewhere one click away */
.alsoon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; min-width: 0; }
.alsoon .also { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; min-width: 0; }
.alsoon .also .chiplink { display: inline-flex; align-items: center; padding: 2px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; }
.alsoon .also .chiplink:hover { color: var(--accent-strong); background: var(--surface-2); }
.alsoon .also .ic { width: 14px; height: 14px; }
.opened-as { margin: 6px 0 0; }
.chip.tag.tag-link { border-style: dashed; padding-left: 6px; }
.chip.tag .chipx .ic { width: 12px; height: 12px; vertical-align: -1px; }
.tagrow select.input { width: auto; padding: 4px 8px; font-size: 12px; height: auto; }
/* Shuffle and repeat beside the transport: quieter than play, the accent when repeat is on */
.transport .mode-btn { color: var(--muted); width: 40px; height: 40px; }
.transport .mode-btn:hover { color: var(--fg); }
.transport .mode-btn.on { color: var(--accent-strong); }
/* "Find on other services": same-named candidates told apart */
.cand .cand-img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; }
.cand .cand-img.round { border-radius: 50%; }
.cand.likely { border-color: var(--accent); }
.cand .evidence { color: var(--ok, var(--accent-strong)); }
.cand .evidence .ic { width: 12px; height: 12px; vertical-align: -1px; }
.hero .art.round { background: none; box-shadow: none; border-radius: 50%; }
.alsoon .also.here { background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; padding: 3px 10px 3px 4px; gap: 6px; }
.alsoon .also.here .muted { color: inherit; opacity: 0.75; }
.tag-wait { padding: 0 6px 0 2px; font-style: italic; }
.dialog.wide { width: min(640px, calc(100vw - 32px)); }
.genre-pub { display: flex; gap: 8px; align-items: center; margin-top: 10px; color: var(--muted); }
.to-global { margin: 6px 0 0; }
.tagged-by { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; color: var(--accent-strong); }
.hero .art.monogram { display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.88); font-size: 64px; font-weight: 700; letter-spacing: 0.02em; }
/* People on tags: faces of who tagged, stacked */
.faces { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 2px 4px; cursor: pointer; color: var(--muted); font: inherit; border-radius: 999px; }
.faces:hover { background: var(--surface-2); color: var(--fg); }
.facestack { display: inline-flex; }
.facestack .face + .face { margin-left: -7px; }
.face { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); flex: none; }
.face.mono { display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; }
.faces-line { gap: 8px; }
.hero.person .blurb { max-width: 60ch; }
/* Phones (UX review #2): a bottom bar (Home, Search, Library, Queue) and a one-row mini player
   above it (cover and title, play/pause, zone); the full transport lives in Now playing */
.bottomnav { display: none; }
.np-transport { display: none; }
@media (max-width: 720px) {
  .shell { grid-template-rows: minmax(0, 1fr) auto auto; grid-template-areas: "content" "player" "bnav"; }
  .bottomnav { grid-area: bnav; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 2px 4px calc(2px + env(safe-area-inset-bottom)); }
  .bnav { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; border-radius: 10px; }
  .bnav .ic { width: 22px; height: 22px; }
  .bnav.on { color: var(--accent-strong); }
  .bnav:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .player { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto; align-items: center; min-height: 64px; padding: 6px 10px; gap: 8px; }
  .player-center { grid-column: auto; order: 0; }
  .player-center .seek { display: none; }
  .player-center .transport > :not(#toggle) { display: none; }
  .player-right .quality, .player-right .jobchip .jc-text { display: none; }
  .player .np-art { width: 44px; height: 44px; }
  body.np-open .player { display: none; }
  .np-transport { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; }
  .np-transport .icon-btn { width: 44px; height: 44px; }
  .np-transport .icon-btn.play { width: 56px; height: 56px; }
  /* Now playing fills the screen down to the bottom bar; seek and transport right under the title */
  body.np-open .overlay { bottom: calc(57px + env(safe-area-inset-bottom)); }
  .np-meta { display: flex; flex-direction: column; }
  .np-meta .np-progress { order: 1; }
  .np-meta .np-transport { order: 2; margin-bottom: 14px; }
  .np-meta .np-pubky { order: 3; }
  .np-meta .path { order: 4; }
  .np-meta > :not(.np-progress):not(.np-transport):not(.np-pubky):not(.path) { order: 0; }
}
/* Menus as a bottom sheet on phones; the playlist picker */
.popover.menu.sheet { border-radius: 16px 16px 0 0; max-height: 70vh; padding-bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25); }
.picker { max-height: 50vh; overflow: auto; margin: 10px 0; }
.picker .list-row { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); font: inherit; color: var(--fg); cursor: pointer; }
.picker .list-row:first-child { border-top: 0; }
.picker .list-row:hover { background: var(--surface-2); }
/* Search: one scrolling row of sources on phones */
@media (max-width: 720px) {
  .scopechips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -14px; margin-right: -14px; padding: 0 14px; }
  .scopechips::-webkit-scrollbar { display: none; }
  .scopechips .chip { flex: none; }
}
/* Library list controls: one compact row */
.listbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; }
.listbar select.input { width: auto; padding: 4px 8px; font-size: 13px; height: auto; margin-left: 4px; }
.azbar { display: flex; flex-wrap: wrap; gap: 2px; }
.az { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; min-width: 22px; height: 26px; border-radius: 6px; cursor: pointer; }
.az:hover { background: var(--surface-2); color: var(--fg); }
.az.on { background: var(--accent-soft); color: var(--accent-strong); }
@media (max-width: 720px) { .azbar { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; } }
/* Playlist art: a 2×2 mosaic of its album covers */
.art.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 0; }
.art.mosaic img { position: static; width: 100%; height: 100%; object-fit: cover; }
.art.pl-thumb { width: 44px; height: 44px; flex: none; border-radius: 6px; font-size: 13px; }
.homeedit .list-row label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
/* Smart playlist editor */
.smartedit { max-width: 760px; }
.smartedit .field { display: grid; gap: 4px; margin-bottom: 12px; }
.smrule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.smrule select.input, .smrule input.input, .smartedit p select.input, .smartedit .toolbar select.input { width: auto; padding: 5px 8px; font-size: 13px; height: auto; }
.lyric-nudge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; vertical-align: middle; }
/* The castable now-playing dashboard (/now-playing): the whole screen */
body.kiosk .sidebar, body.kiosk .topbar, body.kiosk .player, body.kiosk .bottomnav { display: none !important; }
body.kiosk .shell { grid-template-columns: 1fr; grid-template-rows: 1fr; grid-template-areas: "content"; }
body.kiosk .main { padding: 0; }
.dash { position: relative; min-height: 100vh; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.dash-bg { position: absolute; inset: -40px; filter: blur(48px) saturate(1.2); opacity: 0.45; }
.dash-bg .art { width: 100%; height: 100%; border-radius: 0; aspect-ratio: auto; }
.dash-inner { position: relative; display: grid; grid-template-columns: minmax(200px, 42vh) minmax(0, 1fr); gap: 5vw; align-items: center; width: min(1400px, 90vw); }
.dash-inner.empty { grid-template-columns: 1fr; text-align: center; }
.dash-art { width: 100%; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); border-radius: 18px; font-size: 64px; }
.dash-text h1 { font-size: clamp(32px, 5vw, 72px); line-height: 1.05; margin: 8px 0 12px; }
.dash-artist { font-size: clamp(20px, 2.6vw, 36px); margin: 0 0 6px; }
.dash-progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 28px; }
.dash-progress span { display: block; height: 100%; background: var(--accent); transition: width 0.9s linear; }
.dash-times { display: flex; justify-content: space-between; margin-top: 8px; font-variant-numeric: tabular-nums; }
.dash-brand { position: absolute; right: 24px; bottom: 18px; }
@media (max-width: 720px) { .dash-inner { grid-template-columns: 1fr; text-align: center; } .dash-art { width: 60vw; margin: 0 auto; } }
/* Multi-select: checkboxes on the rows and a bar of actions above the player */
.selbox { display: inline-flex; align-items: center; padding: 0 6px 0 2px; cursor: pointer; }
.selbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.selbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--player) + 14px); z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: calc(100vw - 24px); padding: 10px 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); }
.selcount { font-weight: 600; margin-right: 4px; }
@media (max-width: 720px) { .selbar { bottom: calc(57px + 70px + env(safe-area-inset-bottom)); left: 12px; right: 12px; transform: none; justify-content: center; } }
.selecting .srow:has(.selbox input:checked) { background: var(--accent-soft); }
@media (max-width: 720px) { .selecting .srow [data-splay], .selecting .srow [data-pup], .selecting .srow [data-pdown], .selecting .srow [data-rm], .selecting .srow [data-psrc], .selecting .srow [data-smore] { display: none; } }
/* One way back: the breadcrumb on wide screens, the back link on phones (UX review) */
@media (min-width: 721px) { .pagebar > .dupback { display: none; } }
@media (max-width: 720px) { .pagebar .crumbs { display: none; } }
.stickyhead { position: sticky; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-sizing: border-box; height: 52px; margin: -24px -24px -28px; padding: 0 24px; top: -24px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.stickyhead[hidden] { display: none; }
/* The bar takes no room in the flow (its margins cancel its height), so the page starts where it would without it */
.main > .stickyhead + * { margin-top: 0; }
.stickyhead strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .stickyhead { height: 46px; margin: -18px -14px -28px; padding: 0 14px; top: -18px; } }
.track .title:has(.idmark) { display: flex; align-items: center; min-width: 0; }
.track .title:has(.idmark) > .lnk { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.track .title:has(.idmark) > .idmark { flex: none; }
/* A listener (#46) plays the shared library; the owner's favourites, playlists, tags and settings aren't theirs */
body.listener .nav-item[data-view="home"], body.listener .nav-item[data-view="favourites"], body.listener .nav-item[data-view="playlists"],
body.listener .nav-item[data-view="radio"], body.listener .nav-item[data-view="sources"], body.listener .nav-item[data-view="identify"],
body.listener .bnav[data-bnav="home"], body.listener #jobchip, body.listener #h-setup, body.listener #zgroup,
body.listener #ifav, body.listener #aheart, body.listener .heart, body.listener [data-act="fav"], body.listener .idmark, body.listener #itags,
body.listener #npfav, body.listener .np-tags, body.listener [data-sel="playlist"], body.listener [data-sel="tag"], body.listener [data-sel="remove"] { display: none !important; }
/* Library › Add music */
.addm { padding: 18px 20px; }
.addm h3 { display: flex; align-items: center; gap: 8px; }
.dropzone { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--line-strong); border-radius: 14px; text-align: center; transition: background .12s, border-color .12s; }
.dropzone p { margin: 0; }
.dropzone > .ic { width: 28px; height: 28px; color: var(--muted); }
.dropzone.over, .dropzone:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); outline: none; }
.uplist { list-style: none; margin: 10px 0; padding: 0; max-height: 280px; overflow: auto; }
.uplist li { display: flex; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; }
.uplist li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#upbox { margin-top: 12px; }
.chip-sk { width: 96px; color: transparent; border-color: transparent; }
.chip-sk::before { content: "\00a0"; }
#impplan:not(:empty) { margin-top: 10px; }
#impplan .row-btns { margin-top: 8px; }
