/* Musikbot – dark glass like the hub portal, with its own "vinyl & neon" accent (mint + violet).
   Desktop first (1920×1080, 1440×900, holds down to ~1100 px); below 900 px it only stays usable.
   CSP-friendly: no inline styles; per-element values come from custom properties set via CSSOM
   (--h = cover hue, --p = progress 0..1, --v = range fill). Font: Mona Sans (OFL, see ../fonts/OFL.txt). */

@font-face {
  font-family: "Mona Sans";
  src: url("../fonts/MonaSans-latin-wdth.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #070a18;
  --night-2: #0c1026;
  --ink: #eef1fa;
  --ink-2: #bdc3d8;
  --ink-3: #9aa2ba;
  --edge: rgba(255, 255, 255, 0.11);
  --edge-hi: rgba(255, 255, 255, 0.24);
  --a: 110 231 214;       /* mint */
  --a2: 150 132 255;      /* violet */
  --a-light: #b8fff3;
  --a-ink: #03201c;       /* text on mint */
  --ok: 74 222 154;
  --down: 255 122 133;
  --warn: 255 196 107;
  --yt: 255 110 110;
  --sc: 255 158 84;
  --radio: 176 160 255;
  --font: "Mona Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --radius: 22px;
  --top-h: 60px;
  --bar-h: 92px;
  --gap: 20px;
  --pad-x: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.5;
  font-weight: 430;
  color: var(--ink);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.is-app { padding-bottom: var(--bar-h); }
h1, h2, h3, p, ul, ol, dl, dd, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }

.ico {
  width: 1em; height: 1em; flex: none; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 10px 16px; border-radius: 12px;
  background: #fff; color: #070a18; font-weight: 600;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

:focus { outline: none; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.kbd {
  display: inline-block; min-width: 1.7em; padding: 1px 6px;
  font-family: var(--mono); font-size: 0.75rem; line-height: 1.5; text-align: center; color: var(--ink);
  border-radius: 6px; border: 1px solid var(--edge-hi); background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

/* ---------- light + grain ---------- */
.light {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(50vw 44vw at 10% 6%, rgba(110, 231, 214, 0.16), transparent 70%),
    radial-gradient(40vw 40vw at 96% 26%, rgba(150, 132, 255, 0.24), transparent 70%),
    radial-gradient(44vw 34vw at 44% 108%, rgba(255, 92, 170, 0.14), transparent 70%),
    radial-gradient(26vw 22vw at 62% 10%, rgba(255, 179, 107, 0.07), transparent 70%),
    radial-gradient(120% 80% at 50% -10%, #141a3f, transparent 60%),
    var(--night);
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("../img/grain.svg");
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: var(--top-h); padding: 0 var(--pad-x);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
/* blur on a pseudo-element: backdrop-filter on .topbar itself would become the containing block of fixed children */
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(7, 10, 24, 0.9), rgba(7, 10, 24, 0.7));
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; flex: none; border-radius: 10px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; flex: none; box-shadow: 0 6px 18px -8px rgba(110, 231, 214, 0.8); }
.brand-name { font-size: 1.125rem; font-stretch: 125%; font-weight: 680; letter-spacing: -0.02em; }
.brand-tag {
  padding: 1px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  color: rgb(var(--a2)); background: rgb(var(--a2) / 0.14); box-shadow: inset 0 0 0 1px rgb(var(--a2) / 0.4);
}
.top-live { display: flex; align-items: center; gap: 10px; min-width: 0; margin-left: 10px; }
.voice-slot { min-width: 0; display: flex; }
.top-right { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.toolbar + .top-right { margin-left: 0; }

.toolbar {
  display: flex; gap: 2px; margin-left: auto; padding: 3px; flex: none;
  border-radius: 999px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
}
.tool-link {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 13px 0 11px; border-radius: 999px;
  font-size: 0.875rem; font-weight: 560; color: var(--ink-2); white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}
.tool-link .ico { width: 16px; height: 16px; }
.tool-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.07); }
.tool-link[aria-current="page"] { color: var(--a-ink); background: rgb(var(--a)); }

.status-pill, .countdown {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  height: 30px; padding: 0 12px;
  font-size: 0.8125rem; font-weight: 560; color: var(--ink-2); white-space: nowrap;
  border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--edge);
}
.status-pill .dot { position: relative; width: 8px; height: 8px; border-radius: 50%; flex: none; background: #8a91a8; }
.status-pill[data-status="open"] .dot { background: rgb(var(--ok)); box-shadow: 0 0 0 3px rgb(var(--ok) / 0.16), 0 0 10px rgb(var(--ok) / 0.75); }
.status-pill[data-status="open"] .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgb(var(--ok));
  animation: ping 2.8s var(--ease-out) infinite;
}
.status-pill[data-status="connecting"] .dot { animation: breathe 1.2s ease-in-out infinite alternate; }
.status-pill[data-status="lost"], .status-pill[data-status="bot-offline"] { color: #ffc2c8; border-color: rgb(var(--down) / 0.4); }
.status-pill[data-status="lost"] .dot, .status-pill[data-status="bot-offline"] .dot { background: rgb(var(--down)); box-shadow: 0 0 0 3px rgb(var(--down) / 0.18); }
@keyframes ping { 0% { transform: scale(1); opacity: 0.8; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes breathe { to { opacity: 0.3; } }

.countdown { color: var(--ink); font-weight: 620; }
.countdown .ico { width: 15px; height: 15px; color: rgb(var(--a)); }
.countdown[data-soon="true"] { color: rgb(var(--warn)); border-color: rgb(var(--warn) / 0.5); }
.countdown[data-soon="true"] .ico { color: rgb(var(--warn)); }

/* account */
.account { position: relative; }
.account-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 3px;
  border-radius: 999px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.05); cursor: pointer;
  font-size: 0.875rem; font-weight: 600;
}
.account-btn:hover { border-color: var(--edge-hi); background: rgba(255, 255, 255, 0.09); }
.account-btn .chev { width: 14px; height: 14px; color: var(--ink-3); }
.account-name { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  font-size: 0.8125rem; font-weight: 680; font-stretch: 110%; color: var(--a-ink);
  background: linear-gradient(140deg, rgb(var(--a)), rgb(var(--a2)));
}
.avatar-sm { width: 30px; height: 30px; font-size: 0.75rem; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  width: 240px; padding: 14px;
  border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(30, 34, 58, 0.96), rgba(16, 19, 38, 0.98));
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
  animation: pop-in 0.18s var(--ease-out);
}
.menu-name { font-weight: 650; overflow-wrap: anywhere; }
.menu-role { font-size: 0.8125rem; color: var(--ink-2); margin-bottom: 12px; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }

/* ---------- banners ---------- */
.banners { max-width: 1900px; margin: 0 auto; padding: 14px var(--pad-x) 0; display: grid; gap: 8px; }
.banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 16px; border-radius: 14px;
  font-size: 0.9375rem; color: var(--ink);
}
.banner strong { font-weight: 650; }
.banner span { color: var(--ink-2); }
.banner-ico { width: 18px; height: 18px; margin-top: 3px; }
.banner-down { background: rgb(var(--down) / 0.12); box-shadow: inset 0 0 0 1px rgb(var(--down) / 0.4); }
.banner-down .banner-ico { color: rgb(var(--down)); }
.banner-warn { background: rgb(var(--warn) / 0.1); box-shadow: inset 0 0 0 1px rgb(var(--warn) / 0.4); }
.banner-warn .banner-ico { color: rgb(var(--yt)); }
.banner-soft { padding: 7px 14px; font-size: 0.875rem; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.banner-soft strong { font-weight: 600; }
.banner-soft .banner-ico { color: rgb(var(--yt) / 0.85); margin-top: 2px; }

/* ---------- workspace: search | queue | side panel ---------- */
.workspace {
  display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 1fr);
  gap: var(--gap); align-items: start;
  max-width: 1640px; margin: 0 auto; padding: 18px var(--pad-x) 24px;
}
.workspace:focus { outline: none; }
.workspace.has-panel { grid-template-columns: minmax(330px, 400px) minmax(0, 1fr) clamp(420px, 30vw, 540px); max-width: 1900px; }
.workspace.is-message { display: block; }
.col { min-width: 0; }
.col-add {
  position: sticky; top: calc(var(--top-h) + 18px);
  display: flex; flex-direction: column; gap: 16px;
  max-height: calc(100vh - var(--top-h) - var(--bar-h) - 36px); overflow-y: auto;
  margin-right: -6px; padding-right: 6px; /* room for the thin scrollbar */
}
.col-add > .card { flex: none; }
.noscript, .page-loading { padding: 40px 0; text-align: center; color: var(--ink-2); }

.side-panel {
  position: sticky; top: calc(var(--top-h) + 18px);
  max-height: calc(100vh - var(--top-h) - var(--bar-h) - 36px); overflow-y: auto;
  padding: 20px; border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, rgba(36, 40, 72, 0.7), rgba(14, 17, 36, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 30px 70px -30px rgba(0, 0, 0, 0.95);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
  container: panel / inline-size;
  animation: panel-in 0.22s var(--ease-out);
}
.side-panel .page-title:focus { outline: none; }
@keyframes panel-in { from { opacity: 0; transform: translateX(12px); } }
.panel-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.side-panel .page-head { padding: 0 40px 4px 2px; }
.side-panel .page-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.side-panel .card {
  padding: 16px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.035); box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.side-panel .page-message { padding-top: 24px; }
.side-panel .message { padding: 24px 16px; }

/* ---------- glass card ---------- */
.card {
  position: relative; isolation: isolate; min-width: 0;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.022) 60%), rgba(8, 10, 26, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 30px 60px -36px rgba(0, 0, 0, 0.95);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
}
.card-title { font-size: 1.125rem; font-stretch: 112%; font-weight: 660; letter-spacing: -0.012em; line-height: 1.25; }
.card-sub { margin-top: 2px; font-size: 0.875rem; color: var(--ink-2); }
.card-intro { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }

.lens {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px;
  color: var(--a-light);
  background: radial-gradient(120% 120% at 30% 0%, rgb(var(--a) / 0.45), transparent 70%), linear-gradient(160deg, rgb(var(--a) / 0.2), rgb(var(--a2) / 0.14));
  box-shadow: inset 0 0 0 1px rgb(var(--a) / 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 26px -12px rgb(var(--a) / 0.8);
}
.lens .ico { width: 20px; height: 20px; }
.lens-warn { color: #ffe1b3; background: radial-gradient(120% 120% at 30% 0%, rgb(var(--warn) / 0.45), transparent 70%), rgb(var(--warn) / 0.1); box-shadow: inset 0 0 0 1px rgb(var(--warn) / 0.5); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  font-size: 0.9375rem; font-weight: 600; line-height: 1.2; color: var(--ink); white-space: nowrap;
  border-radius: 999px; border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.12s, color 0.15s, filter 0.15s;
}
.btn .ico { width: 17px; height: 17px; }
.btn:hover:not(:disabled) { border-color: var(--edge-hi); background: rgba(255, 255, 255, 0.11); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btn-primary {
  color: var(--a-ink); border-color: transparent;
  background: linear-gradient(180deg, #a5fff0, rgb(var(--a)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 26px -12px rgb(var(--a) / 0.8);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #c4fff6, #8ff0e2); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 0.8125rem; }
.btn-sm .ico { width: 15px; height: 15px; }
.btn-lg { min-height: 50px; font-size: 1.0625rem; }
.btn-block { width: 100%; }
.is-danger { color: #ffb8bf; }
.btn.is-danger { border-color: rgb(var(--down) / 0.35); }
.btn.is-danger:hover:not(:disabled) { background: rgb(var(--down) / 0.14); border-color: rgb(var(--down) / 0.6); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; padding: 0;
  border-radius: 50%; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.05);
  color: var(--ink-2); cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
}
.icon-btn .ico { width: 18px; height: 18px; }
.icon-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--edge-hi); background: rgba(255, 255, 255, 0.1); }
.icon-btn:active:not(:disabled) { transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn-sm { width: 32px; height: 32px; }
.icon-btn-sm .ico { width: 16px; height: 16px; }
.icon-btn.is-danger:hover:not(:disabled) { color: #ffc2c8; border-color: rgb(var(--down) / 0.55); background: rgb(var(--down) / 0.14); }

.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 12px;
  font-size: 0.8125rem; font-weight: 580; color: var(--ink);
  border-radius: 999px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.06);
  cursor: pointer; white-space: nowrap;
}
.chip-btn .ico { width: 15px; height: 15px; }
.chip-btn:hover:not(:disabled) { border-color: var(--edge-hi); background: rgba(255, 255, 255, 0.1); }
.chip-btn:disabled { opacity: 0.38; cursor: not-allowed; }

.link-btn {
  display: inline; margin-left: 6px; padding: 0; border: 0; background: none;
  color: rgb(var(--a)); font-weight: 620; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.link-btn:hover { color: var(--a-light); }

/* ---------- segmented control (radio inputs) ---------- */
.seg-legend { margin-bottom: 6px; font-size: 0.8125rem; font-weight: 580; color: var(--ink-2); }
.seg-track {
  display: flex; gap: 3px; padding: 3px;
  border-radius: 13px; background: rgba(0, 0, 0, 0.24); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.seg-opt { position: relative; flex: 1 1 0; min-width: 0; }
.seg-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-opt > span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 10px; border-radius: 10px;
  font-size: 0.875rem; font-weight: 580; color: var(--ink-2); white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
  pointer-events: none;
}
.seg-opt .ico { width: 15px; height: 15px; }
.seg-opt input:checked + span { color: var(--ink); background: rgb(var(--a) / 0.2); box-shadow: inset 0 0 0 1px rgb(var(--a) / 0.55); }
.seg-opt input:focus-visible + span { outline: 2px solid #fff; outline-offset: 1px; }
.seg-opt input:disabled + span { opacity: 0.45; }
.seg-opt input:not(:checked):not(:disabled):hover + span { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.seg-wide .seg-opt > span { min-height: 38px; }

/* ---------- range ---------- */
.range {
  --v: 50%;
  flex: 1; min-width: 0; height: 28px; margin: 0;
  background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 5px; border-radius: 999px;
  background: linear-gradient(90deg, rgb(var(--a)) 0 var(--v), rgba(255, 255, 255, 0.16) var(--v) 100%);
}
.range::-moz-range-track { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); }
.range::-moz-range-progress { height: 5px; border-radius: 999px; background: rgb(var(--a)); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; margin-top: -5.5px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 0 0 3px rgb(var(--a) / 0.25), 0 3px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s;
}
.range:hover::-webkit-slider-thumb { transform: scale(1.15); }
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 3px rgb(var(--a) / 0.25), 0 3px 8px rgba(0, 0, 0, 0.5); }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgb(var(--a) / 0.5); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgb(var(--a) / 0.5); }
.range:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- fields ---------- */
.field {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  min-height: 44px; padding: 0 10px 0 14px;
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.26);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: box-shadow 0.15s;
}
.field:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.field:focus-within { box-shadow: inset 0 0 0 1.5px rgb(var(--a) / 0.8), 0 0 0 4px rgb(var(--a) / 0.14); }
.field-ico { width: 18px; height: 18px; color: var(--ink-3); }
.field .field-input { flex: 1; min-width: 0; height: 42px; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.field .field-input:focus-visible { outline: none; box-shadow: none; }
.field:focus-within .field-kbd { display: none; }
.field-btn { flex: none; min-height: 44px; padding: 0 18px; border-radius: 13px; }
.field-input {
  width: 100%; min-height: 40px; padding: 0 12px;
  font-size: 0.9375rem; color: var(--ink);
  border-radius: 11px; border: 0; background: rgba(0, 0, 0, 0.26); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.field-input:hover:not(:disabled) { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.field-input::placeholder { color: var(--ink-3); opacity: 1; }
.field-input:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px rgb(var(--a) / 0.8), 0 0 0 4px rgb(var(--a) / 0.14); }
.field-input:disabled { opacity: 0.5; }
.field-input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px rgb(var(--down)), 0 0 0 4px rgb(var(--down) / 0.14); }
.field-input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.field-input.mono { font-family: var(--mono); font-size: 0.8125rem; text-overflow: ellipsis; }
.field-hint { margin-top: 6px; padding-left: 2px; font-size: 0.8125rem; color: var(--ink-3); }
.form-error { font-size: 0.875rem; font-weight: 560; color: #ffb8bf; }
.form-error:empty { display: none; }

.select {
  min-height: 34px; padding: 0 32px 0 12px;
  font-size: 0.875rem; font-weight: 580;
  border-radius: 10px; border: 1px solid var(--edge);
  background: rgba(0, 0, 0, 0.25) url("../img/chevron.svg") no-repeat right 9px center / 15px;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
.select:hover:not(:disabled) { border-color: var(--edge-hi); }
.select:disabled { opacity: 0.55; cursor: not-allowed; }
.select option { color: #111; }

.switch {
  -webkit-appearance: none; appearance: none; flex: none;
  position: relative; width: 44px; height: 26px; margin: 0;
  border-radius: 999px; background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  cursor: pointer; transition: background-color 0.2s;
}
.switch::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s var(--ease-spring);
}
.switch:checked { background: rgb(var(--a)); }
.switch:checked::before { transform: translateX(18px); }

/* ---------- badges + pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 22px; padding: 0 8px 0 6px;
  font-size: 0.6875rem; font-weight: 640; letter-spacing: 0.01em;
  border-radius: 999px;
}
.badge .ico { width: 14px; height: 14px; }
.badge-youtube { color: #ffb3b3; background: rgb(var(--yt) / 0.14); box-shadow: inset 0 0 0 1px rgb(var(--yt) / 0.4); }
.badge-youtube .ico { color: rgb(var(--yt)); }
.badge-soundcloud { color: #ffd0a8; background: rgb(var(--sc) / 0.14); box-shadow: inset 0 0 0 1px rgb(var(--sc) / 0.4); }
.badge-soundcloud .ico { color: rgb(var(--sc)); }
.badge-radio { color: #d9d1ff; background: rgb(var(--radio) / 0.14); box-shadow: inset 0 0 0 1px rgb(var(--radio) / 0.45); }
.badge.is-compact { width: 18px; height: 18px; padding: 0; justify-content: center; background: none; box-shadow: none; }
.badge.is-compact .ico { width: 16px; height: 16px; }
.badge-radio.is-compact .ico { color: rgb(var(--radio)); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 24px; padding: 0 10px 0 8px;
  font-size: 0.75rem; font-weight: 620; border-radius: 999px;
}
.pill .ico { width: 13px; height: 13px; }
.pill-active { color: #b7f7d6; background: rgb(var(--ok) / 0.14); box-shadow: inset 0 0 0 1px rgb(var(--ok) / 0.4); }
.pill-locked { color: #ffc2c8; background: rgb(var(--down) / 0.14); box-shadow: inset 0 0 0 1px rgb(var(--down) / 0.4); }
.pill-expired, .pill-revoked { color: var(--ink-2); background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.pill-waiting { color: #ffe1b3; background: rgb(var(--warn) / 0.12); box-shadow: inset 0 0 0 1px rgb(var(--warn) / 0.4); }

/* ---------- generated cover ("vinyl") ---------- */
.disc {
  --h: 190;
  position: relative; display: grid; place-items: center; flex: none;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 4px),
    conic-gradient(from 200deg, hsl(var(--h) 85% 64%), hsl(calc(var(--h) + 55) 80% 58%), hsl(calc(var(--h) + 140) 70% 42%), hsl(calc(var(--h) + 220) 75% 30%), hsl(var(--h) 85% 64%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 8px 22px -12px hsl(var(--h) 80% 50% / 0.8);
}
.disc::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.35), transparent 32%, transparent 62%, rgba(255, 255, 255, 0.12) 80%, transparent);
  mix-blend-mode: soft-light;
}
.disc-hole { width: 24%; height: 24%; border-radius: 50%; background: var(--night-2); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14), inset 0 1px 2px rgba(0, 0, 0, 0.6); }
.disc-sm { width: 38px; height: 38px; }
.disc-sm .disc-hole { width: 26%; height: 26%; }
.disc-md { width: 58px; height: 58px; }
.disc-lg { width: 128px; height: 128px; }
.disc-xl { width: 132px; height: 132px; }

/* ---------- equalizer ---------- */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 16px; height: 12px; flex: none; }
.eq i { flex: 1; height: 30%; border-radius: 1px; background: currentColor; }
.eq-sm { width: 14px; height: 12px; }
[data-state="playing"] .eq i { animation: eq 1s ease-in-out infinite alternate; }
[data-state="playing"] .eq i:nth-child(2) { animation-duration: 0.7s; animation-delay: -0.3s; }
[data-state="playing"] .eq i:nth-child(3) { animation-duration: 0.9s; animation-delay: -0.6s; }
[data-state="playing"] .eq i:nth-child(4) { animation-duration: 0.6s; animation-delay: -0.1s; }
@keyframes eq { 0% { height: 20%; } 100% { height: 100%; } }
@keyframes spin { to { transform: rotate(1turn); } }

/* ---------- now playing: shared bits ---------- */
.np-badges { display: inline-flex; }
.np-badges:empty { display: none; }
.np-sub { display: flex; min-width: 0; font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap; }
.np-artist { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.np-by { flex: none; color: var(--ink-3); }
.np-by::before { content: "·"; margin: 0 6px; }
[data-state="playing"] .np-art .disc { animation: spin 9s linear infinite; }
[data-state="idle"] .np-art .disc, [data-state="offline"] .np-art .disc { filter: grayscale(1) brightness(0.55); }
[data-state="idle"] .np-title, [data-state="offline"] .np-title { color: var(--ink-2); }

.np-progress { display: grid; grid-template-columns: 3.4em minmax(0, 1fr) 3.4em; align-items: center; gap: 10px; width: 100%; font-size: 0.75rem; color: var(--ink-3); }
.np-progress .t-now { text-align: right; }
.np-progress[data-idle="true"] { opacity: 0.45; }
.progress { position: relative; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.13); overflow: hidden; }
.progress-fill {
  --p: 0;
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, rgb(var(--a)), rgb(var(--a2)));
  transform: scaleX(var(--p)); transform-origin: left center;
  transition: transform 0.5s linear;
}
.np-progress[data-live="true"] .progress-fill { background: linear-gradient(90deg, rgb(var(--a2) / 0.4), rgb(var(--a2)), rgb(var(--a2) / 0.4)); background-size: 200% 100%; animation: live 3s linear infinite; }
@keyframes live { to { background-position: -200% 0; } }
.np-progress[data-live="true"] .t-now { color: rgb(var(--radio)); font-weight: 650; }

.voice-chip {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 280px;
  height: 32px; padding: 0 10px 0 11px;
  font-size: 0.8125rem; font-weight: 600; color: var(--ink);
  border-radius: 999px; border: 1px solid var(--edge); background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
}
.voice-chip .ico { width: 15px; height: 15px; color: rgb(var(--a)); }
.voice-chip .chev { width: 13px; height: 13px; color: var(--ink-3); }
.voice-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-chip[data-connected="false"] { color: #ffe1b3; border-color: rgb(var(--warn) / 0.45); }
.voice-chip[data-connected="false"] .ico:first-child { color: rgb(var(--warn)); }
.voice-chip.is-static { cursor: default; padding-right: 12px; }
button.voice-chip:hover { border-color: var(--edge-hi); background: rgba(255, 255, 255, 0.07); }

.ctl {
  display: grid; place-items: center; flex: none;
  width: 38px; height: 38px; padding: 0;
  border-radius: 50%; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.06);
  color: var(--ink); cursor: pointer;
  transition: transform 0.12s, background-color 0.15s, border-color 0.15s, filter 0.15s;
}
.ctl .ico { width: 17px; height: 17px; }
.ctl:hover:not(:disabled):not(.ctl-main) { background: rgba(255, 255, 255, 0.13); border-color: var(--edge-hi); }
.ctl:active:not(:disabled) { transform: scale(0.93); }
.ctl:disabled { opacity: 0.35; cursor: not-allowed; }
.ctl-main {
  width: 46px; height: 46px; border: 0; color: var(--a-ink);
  background: radial-gradient(120% 120% at 30% 10%, #d4fff8, rgb(var(--a)) 55%, #3fb9ab);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 30px -12px rgb(var(--a) / 0.9);
}
.ctl-main .ico { width: 21px; height: 21px; }
.ctl-main:hover:not(:disabled) { filter: brightness(1.08); }
.ctl-sm { width: 30px; height: 30px; background: transparent; border-color: transparent; color: var(--ink-2); }
.ctl-sm .ico { width: 17px; height: 17px; }
.vol-out { width: 3.3em; flex: none; text-align: right; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }

/* ---------- player bar (member page) ---------- */
.player-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  height: var(--bar-h);
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}
.player-bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(16, 19, 42, 0.86), rgba(7, 10, 24, 0.95));
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 -20px 50px -30px rgb(var(--a) / 0.35);
}
.pb {
  height: 100%; max-width: 1900px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 1.25fr) minmax(0, 1fr);
  align-items: center; gap: 28px; padding: 0 var(--pad-x);
}
.pb-now { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pb-text { min-width: 0; display: grid; gap: 1px; }
.pb-state {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 0.6875rem; font-weight: 660; letter-spacing: 0.07em; text-transform: uppercase; color: rgb(var(--a));
}
.pb-state .badge { letter-spacing: 0.01em; text-transform: none; }
.pb[data-state="paused"] .pb-state, .pb[data-state="idle"] .pb-state { color: var(--ink-3); }
.pb[data-state="offline"] .pb-state { color: #ffb8bf; }
.pb .np-title { font-size: 1rem; font-weight: 660; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-connect { flex: none; }
.pb-center { display: grid; gap: 6px; justify-items: center; min-width: 0; }
.transport { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pb-tune { display: flex; align-items: center; justify-content: flex-end; gap: 18px; min-width: 0; }
.volume { display: flex; align-items: center; gap: 2px; width: 230px; min-width: 150px; }
.seg-loop .seg-opt > span { min-height: 30px; padding: 0 9px; font-size: 0.8125rem; }
.seg-loop .seg-opt .ico { width: 14px; height: 14px; }
.seg-loop .seg-opt:first-child .ico { width: 12px; height: 12px; }

/* ---------- now playing card (guest page) ---------- */
.np { padding: 22px 24px; overflow: hidden; border-color: rgb(var(--a) / 0.28); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 40px 110px -50px rgb(var(--a) / 0.6), 0 30px 60px -36px rgba(0, 0, 0, 0.95); }
.np-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70% 70% at 0% 0%, rgb(var(--a) / 0.2), transparent 70%),
    radial-gradient(60% 80% at 100% 100%, rgb(var(--a2) / 0.22), transparent 70%);
}
.np-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.75rem; font-weight: 640; letter-spacing: 0.07em; text-transform: uppercase; color: rgb(var(--a)); }
.np:not([data-state="playing"]) .eyebrow { color: var(--ink-3); }
.np[data-state="offline"] .eyebrow { color: #ffb8bf; }
.np-body { display: flex; align-items: center; gap: 22px; }
.np-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.np .np-title {
  font-size: 1.75rem; font-stretch: 118%; font-weight: 680; letter-spacing: -0.025em; line-height: 1.15;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.np .np-sub { font-size: 0.9375rem; white-space: normal; }
.np .np-progress { margin-top: 18px; }

/* ---------- add column: search + radio ---------- */
.add, .radio { padding: 16px; }
.add .card-title, .radio .card-title { margin: 2px 2px 12px; }
.card-title-ico { display: flex; align-items: center; gap: 9px; font-size: 1rem; }
.card-title-ico .ico { width: 17px; height: 17px; color: rgb(var(--a)); }

.search-row { display: flex; gap: 8px; }
.search-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.search-opts .field-hint { margin: 0; flex: 1 1 10em; }
.seg-source .seg-opt > span { min-height: 30px; padding: 0 11px; font-size: 0.8125rem; }
.seg-source .seg-opt .ico { width: 15px; height: 15px; }
.seg-source .seg-opt:first-child input:checked + span .ico { color: rgb(var(--yt)); }
.seg-source .seg-opt:last-child input:checked + span .ico { color: rgb(var(--sc)); }
.radio-hint { margin: 0 2px 12px; }

.results { margin-top: 4px; }
.results:empty { display: none; }
.results-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 2px 4px; font-size: 0.875rem; color: var(--ink-2); }
.results-note > span { flex: 1 1 14em; }
.results-note .ico { width: 17px; height: 17px; flex: none; }
.results-note.is-loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgb(var(--a) / 0.3); border-top-color: rgb(var(--a)); animation: spin 0.8s linear infinite; flex: none; }
.results-note.is-error { color: #ffc2c8; }
.result-list { margin-top: 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.result { display: flex; align-items: center; gap: 12px; padding: 7px 6px; border-radius: 12px; transition: background-color 0.12s; }
.result:hover { background: rgba(255, 255, 255, 0.05); }
.result-text { flex: 1; min-width: 0; }
.result-title { font-size: 0.875rem; font-weight: 620; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-meta, .q-meta { display: flex; align-items: center; gap: 7px; min-width: 0; margin-top: 1px; font-size: 0.8125rem; color: var(--ink-3); }
.result-block { margin-top: 2px; font-size: 0.8125rem; font-weight: 600; color: rgb(var(--warn)); }
.result-error { margin-top: 3px; font-size: 0.8125rem; line-height: 1.4; color: #ffc2c8; }
.result-error:empty { display: none; }
.result.is-blocked .disc { filter: grayscale(1) brightness(0.6); }
.result.is-blocked .result-title { color: var(--ink-2); }
.result.has-error { background: rgb(var(--down) / 0.07); }
.add-btn { width: 34px; height: 34px; color: rgb(var(--a)); border-color: rgb(var(--a) / 0.45); background: rgb(var(--a) / 0.08); }
.add-btn:hover:not(:disabled) { color: var(--a-ink); background: rgb(var(--a)); border-color: transparent; }
.result.is-added .add-btn { color: var(--a-ink); background: rgb(var(--a)); border-color: transparent; opacity: 1; }

.guest-counter { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 9px 14px; border-radius: 12px; font-size: 0.875rem; font-weight: 620; background: rgb(var(--a2) / 0.12); box-shadow: inset 0 0 0 1px rgb(var(--a2) / 0.35); }
.guest-counter[data-left="0"] { color: var(--ink-2); background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.pips, .meter { display: inline-flex; gap: 3px; flex: none; }
.pips i, .meter i { width: 6px; height: 15px; border-radius: 3px; background: rgb(var(--a2)); box-shadow: 0 0 8px rgb(var(--a2) / 0.6); }
.pips i.is-used, .meter i { background: rgba(255, 255, 255, 0.14); box-shadow: none; }
.meter i { width: 5px; height: 12px; }
.meter i.is-used { background: rgb(var(--a2)); }

.stations { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.station {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 52px; padding: 6px 12px 6px 7px; text-align: left;
  border-radius: 13px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.035);
  cursor: pointer; transition: background-color 0.12s, border-color 0.12s;
}
.station:hover:not([aria-pressed="true"]) { background: rgba(255, 255, 255, 0.08); }
.station-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.station-name { font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station-genre { font-size: 0.8125rem; color: var(--ink-3); }
.station-state { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--ink-2); background: rgba(255, 255, 255, 0.06); }
.station-state .ico { width: 14px; height: 14px; }
.station .when-on { display: none; }
.station[aria-pressed="true"] { border-color: rgb(var(--radio) / 0.55); background: rgb(var(--radio) / 0.12); }
.station[aria-pressed="true"] .station-state { color: rgb(var(--radio)); background: rgb(var(--radio) / 0.18); }
.station[aria-pressed="true"] .when-on { display: inline-flex; }
.station[aria-pressed="true"] .when-off { display: none; }
.station[aria-pressed="true"] .eq i { animation: eq 0.8s ease-in-out infinite alternate; }
.station[aria-pressed="true"] .eq i:nth-child(2) { animation-duration: 0.55s; }
.station[aria-pressed="true"] .eq i:nth-child(3) { animation-duration: 0.7s; animation-delay: -0.3s; }

/* ---------- queue (main column) ---------- */
.queue { padding: 18px 14px 12px; container: queue / inline-size; }
.queue-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; padding: 0 8px 12px; }
.queue-hint { font-size: 0.8125rem; color: var(--ink-3); }
.queue-meta { display: flex; gap: 12px; margin-left: auto; font-size: 0.8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.queue-cap { color: var(--ink-2); font-weight: 600; }
.queue-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.q-item, .q-cols {
  display: grid; align-items: center; gap: 0 12px;
  grid-template-columns: 14px 30px 38px minmax(0, 1fr) minmax(90px, 180px) 52px 146px;
  grid-template-areas: "grip pos disc main by dur acts";
}
.q-item {
  position: relative;
  min-height: 54px; padding: 6px 8px 6px 6px; border-radius: 12px;
  transition: background-color 0.12s;
}
.q-item:hover { background: rgba(255, 255, 255, 0.045); }
.q-cols {
  padding: 0 8px 7px 6px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.6875rem; font-weight: 640; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
}
.q-col-pos { grid-area: pos; text-align: right; }
.q-col-main { grid-column: disc-start / main-end; }
.q-col-by { grid-area: by; }
.q-col-dur { grid-area: dur; text-align: right; }
.q-grip { grid-area: grip; display: grid; place-items: center; color: var(--ink-3); opacity: 0.5; }
.q-grip .ico { width: 14px; height: 14px; }
.q-item[data-movable="true"] { cursor: grab; }
.q-item[data-movable="true"]:hover .q-grip { opacity: 1; }
.q-pos { grid-area: pos; text-align: right; font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); }
.q-item > .disc { grid-area: disc; }
.q-main { grid-area: main; min-width: 0; }
.q-title { font-size: 0.9375rem; font-weight: 620; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-by { grid-area: by; font-size: 0.8125rem; color: var(--ink-2); }
.q-by.is-guest { color: #cfc5ff; }
.q-item[data-own="true"] .q-by { color: rgb(var(--a)); font-weight: 620; }
.q-dur { grid-area: dur; text-align: right; font-size: 0.8125rem; color: var(--ink-3); }
.q-acts { grid-area: acts; display: flex; justify-content: flex-end; gap: 4px; opacity: 0.4; transition: opacity 0.12s; }
.q-item:hover .q-acts, .q-item:focus-within .q-acts { opacity: 1; }
.q-acts .icon-btn { background: transparent; border-color: transparent; }
.q-acts .icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); border-color: var(--edge); }
.q-acts .icon-btn:disabled { opacity: 0.25; }
.q-item[data-own="true"] { background: linear-gradient(90deg, rgb(var(--a) / 0.09), transparent 60%); }
.q-item[data-own="true"]:hover { background: linear-gradient(90deg, rgb(var(--a) / 0.13), rgba(255, 255, 255, 0.04) 60%); }
.q-item[data-own="true"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: rgb(var(--a)); }
.q-item.is-dragging { opacity: 0.4; }
.q-item.drop-before { box-shadow: inset 0 2px 0 rgb(var(--a)); }
.q-item.drop-after { box-shadow: inset 0 -2px 0 rgb(var(--a)); }
@container queue (max-width: 720px) {
  .q-item {
    grid-template-columns: 14px 30px minmax(0, 1fr) 52px 140px;
    grid-template-areas: "grip pos main dur acts" "grip pos by dur acts";
  }
  .q-item > .disc, .q-cols { display: none; }
}
body[data-density="compact"] .q-item { min-height: 38px; padding-top: 2px; padding-bottom: 2px; }
body[data-density="compact"] .q-item > .disc { display: none; }
body[data-density="compact"] :is(.q-item, .q-cols) { grid-template-columns: 14px 30px minmax(0, 1fr) minmax(90px, 180px) 52px 146px; grid-template-areas: "grip pos main by dur acts"; }
body[data-density="compact"] .q-col-main { grid-column: auto; grid-area: main; }
body[data-density="compact"] .q-meta { display: none; }
body[data-density="compact"] .q-acts .icon-btn { width: 28px; height: 28px; }
.guest-layout :is(.q-item, .q-cols) { grid-template-columns: 0 30px 38px minmax(0, 1fr) minmax(90px, 170px) 52px 36px; }

.empty { display: grid; justify-items: center; gap: 4px; padding: 36px 16px 30px; text-align: center; }
.empty-art { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 8px; border-radius: 50%; color: var(--ink-3); background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.empty-art .ico { width: 22px; height: 22px; }
.empty-title { font-weight: 640; }
.empty-text { font-size: 0.875rem; color: var(--ink-2); max-width: 28em; }
.empty-sm { padding: 16px 8px 8px; }

/* skeleton */
.skeleton { display: grid; gap: 12px; }
.skeleton-queue { min-height: 460px; align-content: start; }
.sk { display: block; border-radius: 10px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-line { height: 16px; }
.sk-line.w60 { width: 60%; }
.sk-field { height: 44px; border-radius: 13px; }
.sk-row { height: 44px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- dialog + popover ---------- */
.dialog, .keys-pop {
  width: min(460px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 48px));
  margin: auto; padding: 20px;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 20px;
  background: linear-gradient(180deg, rgba(30, 34, 62, 0.97), rgba(14, 17, 36, 0.99));
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9);
}
.dialog[open] { display: flex; flex-direction: column; animation: pop-in 0.2s var(--ease-out); }
.dialog::backdrop, .keys-pop::backdrop { background: rgba(4, 6, 16, 0.55); }
.keys-pop { width: min(520px, calc(100vw - 32px)); overflow: auto; }
.keys-pop:popover-open { animation: pop-in 0.18s var(--ease-out); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 1.1875rem; font-stretch: 115%; font-weight: 680; }
.dialog-text { margin: 4px 0 14px; font-size: 0.875rem; color: var(--ink-2); }
.dialog-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.keys { display: grid; }
.keys > div { display: grid; grid-template-columns: 11em minmax(0, 1fr); align-items: center; gap: 12px; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.keys dt { white-space: nowrap; }
.keys dd { font-size: 0.875rem; color: var(--ink-2); }

.channel-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; overflow-y: auto; padding: 4px; margin: -4px; }
.channel {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 52px; padding: 6px 12px 6px 8px; text-align: left;
  border-radius: 13px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.05); cursor: pointer;
}
.channel:hover:not([aria-current="true"]) { background: rgba(255, 255, 255, 0.1); }
.channel-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); color: var(--ink-2); flex: none; }
.channel-ico .ico { width: 17px; height: 17px; }
.channel-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.channel-name { font-weight: 640; overflow-wrap: anywhere; }
.channel-sub { font-size: 0.8125rem; color: var(--ink-3); }
.channel-here { flex: none; font-size: 0.8125rem; font-weight: 640; color: rgb(var(--a)); }
.chev-r { width: 16px; height: 16px; color: var(--ink-3); transform: rotate(-90deg); }
.channel[aria-current="true"] { border-color: rgb(var(--a) / 0.5); background: rgb(var(--a) / 0.1); }
.channel[aria-current="true"] .channel-ico { color: rgb(var(--a)); background: rgb(var(--a) / 0.15); }

/* ---------- toasts ---------- */
.toasts {
  position: fixed; z-index: 60; right: var(--pad-x);
  bottom: calc(var(--bar-h) + 14px);
  display: grid; justify-items: end; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none;
}
.is-guest-page .toasts { bottom: 20px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 7px 7px 7px 14px;
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(36, 40, 70, 0.97), rgba(20, 24, 46, 0.98));
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.9);
  pointer-events: auto;
  animation: toast-in 0.25s var(--ease-out);
}
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; }
.toast-ico { width: 18px; height: 18px; color: rgb(var(--a)); }
.toast-error { border-color: rgb(var(--down) / 0.5); }
.toast-error .toast-ico { color: rgb(var(--down)); }
.toast-ok .toast-ico { color: rgb(var(--ok)); }
.toast-text { flex: 1; min-width: 0; font-size: 0.875rem; overflow-wrap: anywhere; }
.toast-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; flex: none; }
.toast-close:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.toast-close .ico { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- panel pages ---------- */
.page-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.page-head { padding: 4px 2px 2px; }
.page-title { font-size: 1.375rem; font-stretch: 120%; font-weight: 680; letter-spacing: -0.02em; line-height: 1.15; }
.page-sub { margin-top: 4px; max-width: 46em; font-size: 0.875rem; color: var(--ink-2); }

/* guests */
.guest-form { display: grid; gap: 14px; }
.invite-slot:empty { display: none; }
.invite {
  margin-top: 16px; padding: 16px;
  border-radius: 16px; background: rgb(var(--a) / 0.07); box-shadow: inset 0 0 0 1px rgb(var(--a) / 0.35);
  animation: pop-in 0.25s var(--ease-out);
}
.invite-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.invite-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 680; }
.invite-title .ico { width: 18px; height: 18px; color: rgb(var(--ok)); }
.invite-close { width: 32px; height: 32px; border-color: transparent; background: none; }
.invite-valid { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 0.8125rem; color: var(--ink-2); }
.invite-valid .ico { width: 14px; height: 14px; }
.invite-block { display: grid; gap: 8px; margin-top: 14px; }
.invite-label { font-size: 0.75rem; font-weight: 640; letter-spacing: 0.05em; text-transform: uppercase; color: rgb(var(--a)); }
.code-digits { display: flex; gap: 8px; }
.digit {
  display: grid; place-items: center; flex: 1 1 0; max-width: 52px; height: 56px;
  font-size: 1.75rem; font-weight: 700; font-stretch: 110%; font-variant-numeric: tabular-nums;
  border-radius: 12px; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 10px 24px -14px rgb(var(--a) / 0.9);
}
.invite-note { display: flex; gap: 8px; margin-top: 14px; font-size: 0.8125rem; color: var(--ink-2); }
.invite-note .ico { width: 16px; height: 16px; margin-top: 2px; color: rgb(var(--a)); }

.guest-list .card-title { margin-bottom: 6px; }
.access-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.access {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "sub" "btn";
  align-items: center; gap: 6px 12px; padding: 12px 0;
}
.access + .access { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.access-main { grid-area: main; display: flex; align-items: center; gap: 10px; min-width: 0; }
.access-time { font-weight: 640; white-space: nowrap; }
.access-sub { grid-area: sub; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 0.8125rem; color: var(--ink-2); }
.access-created { color: var(--ink-3); }
.access > .btn { grid-area: btn; justify-self: start; }
.access[data-state="expired"] .access-time, .access[data-state="locked"] .access-time { color: var(--ink-2); font-weight: 500; }
@container panel (min-width: 440px) {
  .access { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main btn" "sub btn"; }
}

/* settings */
.settings { display: grid; }
.setting { display: grid; gap: 6px; padding: 12px 0; }
.setting + .setting, .settings-form .setting + .setting { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.card-intro + .setting { padding-top: 0; }
.setting-label { font-weight: 620; }
.setting-hint { font-size: 0.8125rem; color: var(--ink-3); }
.num-field { display: flex; align-items: center; gap: 10px; }
.num-field .field-input { width: 110px; }
.unit { color: var(--ink-2); font-size: 0.875rem; }
.setting-switch { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; }
.setting-switch .setting-hint { grid-column: 1 / -1; }
.form-foot { display: flex; justify-content: flex-end; padding-top: 10px; }
.settings-form { display: grid; }
.settings-form .form-error { padding-top: 8px; }
.volume-plain { width: auto; gap: 12px; }

.mfa { display: flex; align-items: flex-start; gap: 14px; }
.mfa-title { font-size: 1rem; font-weight: 660; line-height: 1.3; }
.mfa-text { margin: 4px 0 14px; font-size: 0.875rem; color: var(--ink-2); }

/* members */
.members { padding: 6px 16px; }
.member-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.member {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "av text" "av actions";
  align-items: center; gap: 8px 12px; padding: 12px 0;
}
.member + .member { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.member > .avatar { grid-area: av; align-self: start; width: 34px; height: 34px; }
.member-text { grid-area: text; min-width: 0; }
.member-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 640; }
.member-seen { font-size: 0.8125rem; color: var(--ink-3); }
.member-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.member-self { font-size: 0.8125rem; color: var(--ink-3); }
.member[data-blocked="true"] .avatar { filter: grayscale(1); opacity: 0.6; }
.member[data-blocked="true"] .member-name > .truncate { color: var(--ink-2); }
.member .btn { min-height: 34px; padding: 0 12px; font-size: 0.8125rem; }
@container panel (min-width: 500px) {
  .member { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av text actions"; }
  .member > .avatar { align-self: center; }
}

/* audit log */
.log { padding: 6px 16px 14px; }
.log-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.log-day { padding: 14px 0 4px; font-size: 0.75rem; font-weight: 660; letter-spacing: 0.05em; text-transform: uppercase; color: rgb(var(--a)); }
.log-entry { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.log-day + .log-entry { border-top: 0; }
.log-time { font-size: 0.8125rem; color: var(--ink-3); padding-top: 1px; }
.log-text { font-size: 0.875rem; color: var(--ink-2); overflow-wrap: anywhere; }
.log-actor { font-weight: 640; color: var(--ink); }
.log-role { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 0.6875rem; font-weight: 640; vertical-align: 1px; color: var(--ink-2); background: rgba(255, 255, 255, 0.07); }
.log-role.role-admin { color: var(--a-light); background: rgb(var(--a) / 0.14); }
.log-role.role-guest { color: #d9d1ff; background: rgb(var(--a2) / 0.16); }
.log-title { color: var(--ink); }
.log .btn-block { margin-top: 12px; }

/* message (401, logout, no permission, invalid link …) */
.page-message { justify-items: center; padding-top: 8vh; }
.message { width: min(520px, 100%); display: grid; justify-items: center; gap: 10px; padding: 32px 28px; text-align: center; }
.message .lens { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 6px; }
.message .lens .ico { width: 24px; height: 24px; }
.message-title { font-size: 1.375rem; font-stretch: 115%; font-weight: 680; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
.message-title:focus { outline: none; }
.message-text { color: var(--ink-2); max-width: 30em; margin-bottom: 8px; }
.message-warn .lens { color: #ffe1b3; background: radial-gradient(120% 120% at 30% 0%, rgb(var(--warn) / 0.45), transparent 70%), rgb(var(--warn) / 0.1); box-shadow: inset 0 0 0 1px rgb(var(--warn) / 0.5); }
.message-down .lens { color: #ffc2c8; background: radial-gradient(120% 120% at 30% 0%, rgb(var(--down) / 0.45), transparent 70%), rgb(var(--down) / 0.1); box-shadow: inset 0 0 0 1px rgb(var(--down) / 0.5); }

/* ---------- guest page ---------- */
.guest-main { max-width: 860px; margin: 0 auto; padding: 24px var(--pad-x) 56px; }
.guest-main:focus { outline: none; }
.is-guest-page .banners { max-width: 860px; }
.guest-layout { display: grid; gap: 18px; }
.page-gate { justify-items: center; padding-top: 6vh; }
.gate { width: min(460px, 100%); display: grid; justify-items: center; gap: 10px; padding: 30px 28px 26px; text-align: center; }
.gate-art { margin-bottom: 6px; }
.gate-disc { --h: 168; animation: spin 12s linear infinite; }
.gate-title { font-size: 1.875rem; font-stretch: 125%; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.gate-text { color: var(--ink-2); font-size: 0.9375rem; }
.gate-form { width: 100%; display: grid; gap: 12px; margin-top: 12px; text-align: left; }
.gate-label { font-weight: 620; }
.code-input {
  width: 100%; height: 64px; padding: 0 0 0 0.5em;
  font-size: 2rem; font-weight: 700; font-stretch: 110%; letter-spacing: 0.5em; text-align: center;
  color: var(--ink); border: 0; border-radius: 16px;
  background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.code-input:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26); }
.code-input::placeholder { color: rgba(255, 255, 255, 0.2); }
.code-input:focus-visible { outline: none; box-shadow: inset 0 0 0 2px rgb(var(--a)), 0 0 0 5px rgb(var(--a) / 0.16); }
.code-input::selection { color: #fff; background: rgb(var(--a2) / 0.45); }
.code-input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px rgb(var(--down)), 0 0 0 5px rgb(var(--down) / 0.16); }
.gate-hint { text-align: center; font-size: 0.8125rem; color: var(--ink-3); }

/* ---------- demo switcher (mockup only, in the top bar) ---------- */
.demo-slot { position: relative; flex: none; }
.demo { font-size: 0.8125rem; color: var(--ink-2); }
.demo summary {
  display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px;
  border-radius: 999px; border: 1px dashed rgba(255, 255, 255, 0.24); background: rgba(8, 10, 26, 0.5);
  cursor: pointer; list-style: none; white-space: nowrap;
}
.demo summary:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.4); }
.demo summary::-webkit-details-marker { display: none; }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--warn)); flex: none; }
.demo-body {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
  width: min(620px, calc(100vw - 48px)); padding: 14px 16px 16px; display: grid; gap: 6px;
  border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(30, 34, 58, 0.98), rgba(16, 19, 38, 0.99));
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9);
}
.demo-label { margin-top: 4px; font-weight: 640; color: var(--ink); }
.demo-links { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-link { display: inline-flex; align-items: center; min-height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.04); }
.demo-link:hover { border-color: var(--edge-hi); background: rgba(255, 255, 255, 0.09); }
.demo-link[aria-current="page"] { color: var(--a-ink); background: rgb(var(--a)); border-color: transparent; font-weight: 640; }
.demo-hint { margin-top: 6px; color: var(--ink-3); }

/* ---------- narrower windows ---------- */
@media (max-width: 1439px) {
  .seg-loop .seg-text { display: none; }
  .volume { width: 190px; }
}
@media (max-width: 1399px) {
  /* the side panel floats over the queue instead of taking a third column */
  .workspace.has-panel { grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); }
  .side-panel {
    position: fixed; z-index: 30;
    top: calc(var(--top-h) + 12px); right: 16px; bottom: calc(var(--bar-h) + 12px);
    width: min(500px, calc(100vw - 32px)); max-height: none;
    background: linear-gradient(165deg, rgba(36, 40, 72, 0.95), rgba(14, 17, 36, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 40px 100px -20px rgba(0, 0, 0, 0.95), -30px 0 80px -40px rgba(0, 0, 0, 0.9);
  }
}
@media (max-width: 1365px) {
  /* toolbar and demo switch collapse to icons; the labels stay as accessible names */
  .tool-link span, .demo summary span:last-child {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .tool-link { padding: 0 10px; }
  .demo summary { padding: 0 10px; }
}
@media (max-width: 1199px) {
  :root { --pad-x: 18px; --gap: 16px; }
  .workspace, .workspace.has-panel { grid-template-columns: minmax(310px, 360px) minmax(0, 1fr); }
  .account-name { display: none; }
  .account-btn { padding-right: 8px; }
  .pb { gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(320px, 1.2fr) minmax(0, 0.9fr); }
}
@media (max-width: 899px) {
  /* not a target: only keep everything reachable and non-overlapping */
  :root { --bar-h: 190px; }
  .topbar { gap: 8px; }
  .brand-name { display: none; }
  .status-pill span:last-child { display: none; }
  .workspace, .workspace.has-panel { grid-template-columns: minmax(0, 1fr); }
  /* search first, then the queue, then radio */
  .col-add { display: contents; }
  .col-add > .add { order: 1; }
  .col-queue { order: 2; }
  .col-add > .radio { order: 3; }
  .pb { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 16px; align-content: center; }
  .pb-tune { justify-content: flex-start; }
}

/* ---------- fallbacks + preferences ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: linear-gradient(165deg, rgba(40, 46, 78, 0.92), rgba(18, 22, 44, 0.94)); }
  .topbar::before, .player-bar::before { background: rgba(10, 13, 30, 0.97); }
}
@media (prefers-contrast: more) {
  :root { --ink-2: #d9ddeb; --ink-3: #c0c6d8; --edge: rgba(255, 255, 255, 0.4); }
  .card, .side-panel { background: rgba(14, 17, 36, 0.96); border-color: rgba(255, 255, 255, 0.4); }
  .q-acts { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-state="playing"] .eq i { height: 60%; }
  [data-state="playing"] .eq i:nth-child(2) { height: 100%; }
  [data-state="playing"] .eq i:nth-child(4) { height: 40%; }
  .status-pill .dot::after { display: none; }
}
