/* ─────────────────────── tokens ─────────────────────── */
:root {
  --bg: #08090e;
  --bg-2: #0d0f15;
  --surface: rgba(255,255,255,0.025);
  --surface-2: rgba(255,255,255,0.04);
  --surface-3: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);
  --text: #f1f3f7;
  --muted: rgba(255,255,255,0.56);
  --muted-2: rgba(255,255,255,0.38);
  --muted-3: rgba(255,255,255,0.24);

  --rail-grad: linear-gradient(180deg, rgba(15,16,22,0.92), rgba(8,9,14,0.92));
  --menu-bg: rgba(15, 17, 24, 0.96);
  --art-shadow: rgba(8, 9, 14, 0.92);

  --cy: #5eead4;
  --cy-glow: rgba(94,234,212,0.32);
  --cy-bg-soft: rgba(94,234,212,0.10);
  --cy-bg-medium: rgba(94,234,212,0.18);
  --cy-border-soft: rgba(94,234,212,0.35);
  --cy-text: #5eead4;
  --pk: #f472b6;
  --pk-glow: rgba(244,114,182,0.32);
  --pk-bg-soft: rgba(244,114,182,0.10);
  --pk-bg-medium: rgba(244,114,182,0.18);
  --pk-border-soft: rgba(244,114,182,0.35);
  --pk-text: #f472b6;

  --danger: #fda4af;
  --danger-bg: rgba(253,164,175,0.06);
  --danger-border: rgba(253,164,175,0.25);

  --shadow-card: 0 18px 60px rgba(0,0,0,.28);
  --radius: 22px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

[data-theme="light"] {
  --bg: #f4f5f9;
  --bg-2: #ffffff;
  --surface: rgba(255,255,255,0.9);
  --surface-2: rgba(0,0,0,0.04);
  --surface-3: rgba(0,0,0,0.07);
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.18);
  --text: #0c0d12;
  --muted: rgba(0,0,0,0.58);
  --muted-2: rgba(0,0,0,0.42);
  --muted-3: rgba(0,0,0,0.25);

  --rail-grad: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,248,251,0.92));
  --menu-bg: rgba(255,255,255,0.98);
  --art-shadow: rgba(244,245,249,0.95);

  --cy: #0d9488;
  --cy-glow: rgba(13,148,136,0.20);
  --cy-bg-soft: rgba(13,148,136,0.08);
  --cy-bg-medium: rgba(13,148,136,0.14);
  --cy-border-soft: rgba(13,148,136,0.30);
  --cy-text: #0d9488;
  --pk: #db2777;
  --pk-glow: rgba(219,39,119,0.20);
  --pk-bg-soft: rgba(219,39,119,0.08);
  --pk-bg-medium: rgba(219,39,119,0.16);
  --pk-border-soft: rgba(219,39,119,0.30);
  --pk-text: #db2777;

  --danger: #be123c;
  --danger-bg: rgba(190,18,60,0.06);
  --danger-border: rgba(190,18,60,0.25);

  --shadow-card: 0 14px 40px rgba(20,22,40,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  background:
    radial-gradient(800px 500px at 8% -10%, rgba(94,234,212,0.07), transparent 60%),
    radial-gradient(900px 600px at 95% 5%, var(--pk-bg-soft), transparent 65%),
    var(--bg);
  min-height: 100vh;
}

button { background: none; border: none; color: inherit; cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ─────────────────────── sidebar (rail) ─────────────────────── */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 270px;
  height: 100vh;
  padding: 18px 14px 22px;
  border-right: 1px solid var(--border);
  background: var(--rail-grad);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  z-index: 10;
  transition: width .25s cubic-bezier(.16,1,.3,1);
}
.rail::-webkit-scrollbar { width: 0; }

/* Collapsed rail */
.rail.is-collapsed { width: 72px; padding: 18px 8px 22px; }
.rail.is-collapsed .profile-meta,
.rail.is-collapsed .profile-chev,
.rail.is-collapsed .nav-text,
.rail.is-collapsed .soon-chip,
.rail.is-collapsed .rail-section-title { display: none; }
.rail.is-collapsed .profile-card { padding: 6px; justify-content: center; }
.rail.is-collapsed .avatar { width: 36px; height: 36px; }
.rail.is-collapsed .nav-item { justify-content: center; padding: 9px 6px; }
.rail.is-collapsed .nav-icon { margin: 0; }
.rail.is-collapsed .rail-toggle { width: 100%; }
.rail.is-collapsed .rail-top { flex-direction: column; gap: 10px; }
.canvas { transition: margin-left .25s cubic-bezier(.16,1,.3,1); }
body.rail-collapsed .canvas { margin-left: 72px; }

.rail-top {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.profile-wrap {
  flex: 1;
  position: relative;
}
.profile-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.profile-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.profile-card[aria-expanded="true"] { border-color: var(--border-strong); background: var(--surface-2); }
.profile-card[aria-expanded="true"] .profile-chev { transform: rotate(90deg); }
.profile-chev { transition: transform .18s; }

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--menu-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  z-index: 50;
  display: none;
  animation: profile-menu-in .14s cubic-bezier(.16,1,.3,1);
}
.profile-wrap.is-open .profile-menu,
.profile-menu.is-open { display: flex; flex-direction: column; gap: 2px; }
@keyframes profile-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.pm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  transition: background .12s, color .12s;
}
.pm-item:hover { background: var(--surface-3); }
.pm-icon {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}
.pm-icon svg { width: 14px; height: 14px; }
.pm-item--danger { color: var(--danger); }
.pm-item--danger .pm-icon { color: var(--danger); border-color: var(--danger-border); background: var(--danger-bg); }
.pm-item--danger:hover { background: var(--danger-bg); }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-meta { flex: 1; min-width: 0; text-align: left; }
.profile-name { font-weight: 600; font-size: 13px; }
.profile-tag { font-size: 11px; color: var(--muted); }
.profile-chev { width: 14px; height: 14px; color: var(--muted-2); }

.rail-toggle {
  width: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rail-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.rail-toggle svg { width: 16px; height: 16px; }

.rail-section { display: flex; flex-direction: column; gap: 6px; }
.rail-section-title {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 8px 4px;
  font-weight: 600;
}

.rail-nav { display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--muted);
  position: relative;
  transition: background .15s, border-color .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, var(--cy-bg-soft), transparent);
  color: var(--text);
}

.nav-icon {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--cy);
  flex-shrink: 0;
}
.nav-icon svg { width: 16px; height: 16px; }
.nav-item.is-active .nav-icon {
  background: var(--cy-bg-medium);
  border-color: var(--cy-border-soft);
  box-shadow: 0 0 0 4px var(--cy-bg-soft);
}
.nav-icon--pink { color: var(--pk); }
.nav-item.is-active .nav-icon--pink {
  background: var(--pk-bg-medium);
  border-color: var(--pk-border-soft);
  box-shadow: 0 0 0 4px rgba(219,39,119,0.06);
}

.nav-text { flex: 1; min-width: 0; }
.nav-label { font-weight: 600; font-size: 13px; color: var(--text); }
.nav-item:not(.is-active) .nav-label { color: var(--muted); }
.nav-item:hover .nav-label { color: var(--text); }
.nav-sub { font-size: 11px; color: var(--muted-2); }

.soon-chip {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--pk);
  background: var(--pk-bg-soft);
  border: 1px solid var(--pk-border-soft);
  padding: 3px 7px;
  border-radius: var(--radius-pill);
}

.rail-spacer { flex: 1; }

/* ─────────────────────── canvas (main area) ─────────────────────── */
.canvas {
  flex: 1;
  padding: 36px 44px 60px;
  width: auto;
  margin-left: 270px;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.view[hidden] { display: none; }

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.view-pretitle {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cy);
  font-weight: 700;
  margin-bottom: 6px;
}
.pretitle-pink { color: var(--pk); }

.view-title {
  font-family: var(--font-display);
  font-size: 38px;
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.05;
}
.view-title .accent {
  color: var(--cy);
  text-shadow: 0 0 28px var(--cy-glow);
}

.view-sub { margin-top: 6px; color: var(--muted); font-size: 14px; }

.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background .15s, border-color .15s, transform .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 14px; height: 14px; }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-primary {
  background: linear-gradient(180deg, var(--cy), #2dd4bf);
  color: #06241f;
  border-color: var(--cy-border-soft);
  box-shadow: 0 8px 30px var(--cy-glow), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #6fefd9, #2dd4bf);
  border-color: var(--cy);
  filter: brightness(1.05);
}
.btn-block { width: 100%; justify-content: center; padding: 11px 16px; }

/* ─────────────────────── grid layouts ─────────────────────── */
.grid { display: grid; gap: 18px; }
.grid-overview {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  grid-template-areas:
    "player up-next"
    "player voice"
    "tiles  tiles"
    "action action"
    "lyrics lyrics";
  grid-auto-rows: min-content;
  /* Don't stretch cards to fill grid cells. Each card takes its natural
     content height. Bottom edges may be uneven between left and right
     columns — that's expected and looks fine. */
  align-items: start;
}
.voice-card { grid-area: voice; min-height: 220px; }
.lyrics-card { grid-area: lyrics; }
.player-card { grid-area: player; }
.up-next     {
  grid-area: up-next;
  /* Fixed-height pane; long queues scroll instead of stretching the grid row. */
  display: flex;
  flex-direction: column;
  max-height: 460px;
  min-height: 220px;
  overflow: hidden;
}
.up-next .q-list {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.up-next .q-list::-webkit-scrollbar { width: 6px; }
.up-next .q-list::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
.up-next .q-list::-webkit-scrollbar-track { background: transparent; }
.q-list { padding: 8px 16px 14px; }
.q-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.q-row:last-child { border-bottom: none; }
.q-idx { font-size: 11px; color: var(--muted-2); width: 18px; font-family: ui-monospace, monospace; }
.q-text { flex: 1; min-width: 0; }
.q-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-artist { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-flag {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--cy);
  background: var(--cy-bg-soft);
  border: 1px solid var(--cy-border-soft);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}
.q-row.is-auto .q-title { color: var(--muted); }
.q-row.is-auto .q-idx { color: var(--cy); }
.q-row { cursor: pointer; align-items: center; }
.q-row:hover { background: rgba(34, 211, 238, 0.04); }
.q-actions {
  display: flex;
  gap: 4px;
  /* Always visible — hover-only was breaking mobile/touch entirely. */
  opacity: 0.55;
  transition: opacity .15s;
}
.q-row:hover .q-actions { opacity: 1; }
.q-btn {
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.q-btn svg { width: 13px; height: 13px; }
.q-btn.q-play:hover { background: var(--cy-bg-soft); border-color: var(--cy-border); color: var(--cy); }
.q-btn.q-del:hover { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.studio      { grid-area: studio; }
.tile-row    { grid-area: tiles; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.grid-2 { grid-template-columns: 1fr 1fr; }
.span-2 { grid-column: span 2; }

/* ─────────────────────── card primitive ─────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}
.card.pad { padding: 22px 22px 20px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.card-pretitle {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cy);
  font-weight: 700;
  margin-bottom: 4px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.015em;
  font-weight: 700;
}
.card-title.small { font-size: 17px; }
.big-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -0.02em;
  margin: 8px 0 4px;
}

.badge-count {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.tier-chip {
  background: var(--pk-bg-soft);
  border: 1px solid var(--pk-border-soft);
  color: var(--pk);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ─────────────────────── player card ─────────────────────── */
.player-card { display: flex; flex-direction: column; position: relative; }
.player-card.is-empty .player-art,
.player-card.is-empty .player-artist,
.player-card.is-empty .player-meta,
.player-card.is-empty .quick-pills,
.player-card.is-empty .progress,
.player-card.is-empty .vol-row,
.player-card.is-empty .player-title,
.player-card.is-empty .chip-row { display: none; }
.player-card.is-empty .transport { opacity: .35; pointer-events: none; }
.empty-hero {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 70px 24px 80px;
  gap: 12px;
}
.player-card.is-empty .empty-hero { display: flex; }
.empty-hero .empty-ring { margin: 0 auto 6px; width: 64px; height: 64px; }
.empty-hero .empty-ring svg { width: 28px; height: 28px; }
.empty-hero h3 {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.015em;
  font-weight: 700;
}
.empty-hero p { color: var(--muted); font-size: 13.5px; line-height: 1.6; max-width: 360px; }

.player-art {
  position: relative;
  height: 220px;
  background-size: cover;
  background-position: center;
  filter: grayscale(0.25);
}
.player-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 60% at 20% 50%, transparent, var(--art-shadow) 75%),
    linear-gradient(180deg, transparent, var(--art-shadow) 90%);
}
.player-art-glow {
  position: absolute;
  inset: -40% -10% auto auto;
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--cy-glow), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}
.player-art-thumb {
  position: absolute;
  right: 26px; top: 50%;
  transform: translateY(-50%);
  width: 132px; height: 132px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.player-art-thumb img { width: 100%; height: 100%; object-fit: cover; }

.player-info {
  padding: 22px 24px 6px;
}
.chip-row { display: flex; gap: 8px; margin-bottom: 14px; }
.chip {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.chip-live {
  color: var(--cy);
  background: var(--cy-bg-soft);
  border-color: var(--cy-border-soft);
}
.chip-live::first-letter { color: var(--cy); }

.player-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.player-artist { font-size: 15px; color: var(--text); margin-top: 4px; font-weight: 500; }
.player-meta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.muted-strong { color: var(--text); font-weight: 600; }

.quick-pills { display: flex; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.pill {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
}

.player-controls { padding: 8px 24px 22px; }

.progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.progress-time {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  font-weight: 600;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}
.progress-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--cy), var(--pk));
  border-radius: 999px;
  box-shadow: 0 0 16px var(--cy-glow);
  transition: width .12s linear;
  pointer-events: none;
}
.progress-bar.is-dragging .progress-fill { transition: none; }
.progress-knob {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px; height: 16px;
  background: var(--text);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(94,234,212,.18), 0 4px 12px rgba(0,0,0,.5);
  transition: left .12s linear, box-shadow .2s;
  pointer-events: none;
}
.progress-bar.is-dragging .progress-knob { transition: none; }

.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 14px 0 18px;
}
.t-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .12s, border-color .15s;
}
.t-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.t-btn:active { transform: scale(.95); }
.t-btn svg { width: 16px; height: 16px; }
.t-btn.is-active {
  background: var(--cy-bg-soft);
  border-color: var(--cy-border);
  color: var(--cy);
  box-shadow: 0 0 12px var(--cy-glow);
}
.t-btn.is-active.is-single { position: relative; }
.t-btn.is-active.is-single::after {
  content: "1";
  position: absolute;
  top: 4px; right: 6px;
  font-size: 9px; font-weight: 800;
  color: var(--cy);
  line-height: 1;
}
.t-btn.flash {
  animation: t-btn-flash .35s ease;
}
@keyframes t-btn-flash {
  0%   { box-shadow: 0 0 0 0 var(--cy-glow); background: var(--cy-bg-soft); border-color: var(--cy-border); }
  100% { box-shadow: 0 0 0 16px transparent; background: var(--surface); border-color: var(--border); }
}
.t-btn--main {
  width: 64px; height: 64px;
  background: linear-gradient(180deg, var(--cy), #2dd4bf);
  border-color: var(--cy-border-soft);
  color: #062a24;
  box-shadow: 0 8px 32px var(--cy-glow), inset 0 1px 0 rgba(255,255,255,.35);
}
.t-btn--main svg { width: 22px; height: 22px; }
.t-btn--main:hover { filter: brightness(1.06); }

.t-btn--xs {
  width: auto;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-red { background: #f87171; box-shadow: 0 0 8px rgba(248,113,113,.6); }

.vol-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 14px;
}
.vol-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 700;
}
.vol-icon { color: var(--cy); }
.vol-icon svg { width: 13px; height: 13px; }
.vol-pct { color: var(--text); margin-left: auto; }
.vol-bar {
  position: relative;
  height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
}
.vol-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: var(--cy);
  border-radius: 999px;
  transition: width .12s linear;
  pointer-events: none;
}
.vol-bar.is-dragging .vol-fill { transition: none; }
.vol-knob {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--text);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--cy-glow);
  transition: left .12s linear, box-shadow .2s;
  pointer-events: none;
}
.vol-bar.is-dragging .vol-knob { transition: none; }
.vol-side { display: flex; gap: 7px; }

/* ─────────────────────── up next ─────────────────────── */
.empty-pane {
  padding: 26px 22px 30px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty-ring {
  width: 48px; height: 48px;
  margin: 6px auto 16px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.empty-ring svg { width: 22px; height: 22px; }

/* ─────────────────────── studio ─────────────────────── */
.studio { padding-bottom: 18px; }
.studio-note {
  padding: 0 20px;
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 16px;
}
.btn-block { margin: 0 20px; width: calc(100% - 40px); }
.knob-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 18px 20px 0;
}
.knob-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 7px;
}
.knob-val { color: var(--text); }

/* ─────────────────────── tiles ─────────────────────── */
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  position: relative;
  overflow: hidden;
}
.tile-tag {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 700;
}
.tile-value {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 8px 0 4px;
  font-weight: 700;
}
.tile-sub { font-size: 12px; color: var(--muted); }

/* ─────────────────────── voice card ─────────────────────── */
.voice-list {
  padding: 6px 14px 16px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.voice-list::-webkit-scrollbar { width: 6px; }
.voice-list::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
.voice-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  transition: background .12s;
}
.voice-member:hover { background: var(--surface-2); }
.voice-member .v-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
}
.voice-member .v-av img { width: 100%; height: 100%; object-fit: cover; }
.voice-member .v-name { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-member .v-flag {
  font-size: 10px; padding: 2px 7px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.voice-member .v-flag.bot { color: var(--cy); background: var(--cy-bg-soft); border-color: var(--cy-border-soft); }

/* ─────────────────────── autoplay tile ─────────────────────── */
.tile-autoplay { display: flex; flex-direction: column; }
.autoplay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 6px;
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  width: max-content;
}
.autoplay-toggle .ap-knob {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background .18s, transform .18s, border-color .18s;
}
.autoplay-toggle[aria-pressed="true"] {
  color: var(--cy);
  border-color: var(--cy-border-soft);
  background: var(--cy-bg-soft);
}
.autoplay-toggle[aria-pressed="true"] .ap-knob {
  background: var(--cy);
  border-color: var(--cy);
  transform: translateX(2px);
  box-shadow: 0 0 12px var(--cy-glow);
}

/* ─────────────────────── empty hero — join voice variants ─────────────────────── */
.empty-hero .empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--cy), #2dd4bf);
  color: #06241f;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border: 1px solid var(--cy-border-soft);
  cursor: pointer;
  box-shadow: 0 10px 30px var(--cy-glow);
  transition: filter .15s, transform .12s;
}
.empty-hero .empty-cta:hover { filter: brightness(1.08); }
.empty-hero .empty-cta:active { transform: translateY(1px); }
.empty-hero .empty-cta svg { width: 16px; height: 16px; }
.empty-hero .empty-cta[hidden] { display: none; }

/* ─────────────────────── lyrics card ─────────────────────── */
/* IMPORTANT: full-width strip at the bottom (grid-area: lyrics) */
.lyrics-card { display: flex; flex-direction: column; min-height: 320px; max-height: 480px; }
.lyrics-card .card-head { flex-shrink: 0; }
.lyrics-status {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted-2);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.lyrics-status.is-live { color: var(--cy); background: var(--cy-bg-soft); border-color: var(--cy-border-soft); }
.lyrics-status.is-static { color: var(--pk); background: var(--pk-bg-soft); border-color: var(--pk-border-soft); }

.lyrics-view {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 18px 22px 60px;
  position: relative;
  mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 12%, #000 78%, transparent 100%);
}
.lyrics-view::-webkit-scrollbar { width: 6px; }
.lyrics-view::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }

.lyrics-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  min-height: 220px;
  gap: 12px;
  color: var(--muted);
  font-size: 13.5px;
}

.lyric-line {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1.35;
  padding: 8px 0;
  color: var(--muted-3);
  transition: color .35s ease, transform .35s ease, opacity .35s ease, filter .35s ease;
  filter: blur(0.3px);
  cursor: pointer;
}
.lyric-line:hover { color: var(--muted); }
.lyric-line.is-current {
  color: var(--text);
  transform: scale(1.04);
  transform-origin: left center;
  filter: none;
  font-weight: 700;
}
.lyric-line.is-passed { color: var(--muted-2); }
.lyric-line.is-soon { color: var(--muted-3); }
.lyric-fallback {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-wrap;
  padding: 8px 0;
}

/* ─────────────────────── recent action ─────────────────────── */
.action-card {
  grid-area: action;
  background:
    radial-gradient(120% 100% at 0% 0%, var(--cy-bg-soft), transparent 55%),
    var(--surface);
  border: 1px solid var(--cy-border-soft);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: box-shadow .4s, border-color .4s;
}
.action-card.pulse {
  animation: action-pulse .9s cubic-bezier(.16,1,.3,1);
}
@keyframes action-pulse {
  0%   { box-shadow: 0 0 0 0 var(--cy-glow), var(--shadow-card); }
  35%  { box-shadow: 0 0 0 8px var(--cy-bg-soft), var(--shadow-card); }
  100% { box-shadow: 0 0 0 0 transparent, var(--shadow-card); }
}
.action-card.pulse .action-title,
.action-card.pulse .action-desc,
.action-card.pulse .meta-cell {
  animation: act-fade-in .35s ease;
}
@keyframes act-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}
.action-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.action-tag {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cy);
  font-weight: 700;
  margin-bottom: 4px;
}
.action-title {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.015em;
  font-weight: 700;
}
.action-status {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cy);
  border: 1px solid var(--cy-border-soft);
  background: var(--cy-bg-soft);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
}
.action-desc {
  font-size: 13.5px;
  color: var(--cy);
  margin-bottom: 18px;
}
.action-strong { color: var(--text); font-weight: 700; }
.action-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.meta-cell {
  border: 1px solid var(--cy-border-soft);
  background: var(--cy-bg-soft);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}
.meta-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cy);
  font-weight: 700;
  margin-bottom: 5px;
}
.meta-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  letter-spacing: -0.01em;
}

/* ─────────────────────── guild forms ─────────────────────── */
.form-row { margin-bottom: 18px; }
.form-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}
.input {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  border-color: var(--cy);
  box-shadow: 0 0 0 3px var(--cy-glow);
}
.form-hint {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 7px;
}
.form-hint code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
}

.slider-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}
.slider-val {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  min-width: 38px;
  text-align: right;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-top: 1px solid var(--border);
}
.switch-row:first-of-type { border-top: none; padding-top: 16px; }
.switch-title { font-weight: 600; font-size: 13px; }
.switch-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.switch {
  appearance: none;
  width: 38px;
  height: 22px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  transition: transform .18s cubic-bezier(.4,1,.6,1);
}
.switch:checked {
  background: var(--cy-bg-medium);
  border-color: var(--cy-border-soft);
}
.switch:checked::before {
  transform: translateX(16px);
  background: var(--cy);
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.source-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: border-color .15s, color .15s, background .15s;
}
.source-card:hover { color: var(--text); border-color: var(--border-strong); }
.source-card.is-active {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.src-dot { width: 10px; height: 10px; border-radius: 50%; }
.src-sc  { background: #ff7a00; box-shadow: 0 0 10px rgba(255,122,0,.5); }
.src-yt  { background: #ff3333; box-shadow: 0 0 10px rgba(255,51,51,.5); }
.src-ytm { background: #ff5577; box-shadow: 0 0 10px rgba(255,85,119,.5); }
.src-sp  { background: #1ed760; box-shadow: 0 0 10px rgba(30,215,96,.5); }

.muted { color: var(--muted); font-size: 13px; }

/* ─────────────────────── playlists ─────────────────────── */
.import-card { display: flex; flex-direction: column; gap: 4px; margin-bottom: 32px; }

.import-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.import-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.import-source-badge {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
  transition: color .15s, border-color .15s;
}
.import-source-badge .src-dot { width: 7px; height: 7px; }
.import-source-badge.is-detected { color: var(--text); border-color: var(--border-strong); }

.import-input {
  width: 100%;
  padding-left: 102px;
  font-size: 14px;
  margin-bottom: 0;
}

.import-btn { flex-shrink: 0; padding: 11px 18px; }
.import-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.3);
}
.import-btn svg { width: 14px; height: 14px; }

.import-supports {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.support-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.support-chip .src-dot { width: 7px; height: 7px; }

.src-am { background: #fc3c44; box-shadow: 0 0 10px rgba(252,60,68,.5); }

.pl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 4px 14px;
}
.pl-head-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.pl-head-count {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 700;
}

.pl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.pl-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 22px 40px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}
.pl-empty .empty-ring { margin-bottom: 16px; }

.pl-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  animation: pl-in .35s cubic-bezier(.16,1,.3,1);
  transition: border-color .15s;
}
.pl-item:hover { border-color: var(--border-strong); }
@keyframes pl-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.pl-cover {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--cy-glow), var(--pk-glow));
  border: 1px solid var(--border-strong);
  position: relative;
  overflow: hidden;
}
.pl-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 20% 10%, rgba(255,255,255,0.18), transparent 60%);
}
.pl-cover-source {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: rgba(0,0,0,0.55);
  border-radius: var(--radius-pill);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: #fff;
  backdrop-filter: blur(6px);
}

.pl-meta { display: flex; flex-direction: column; gap: 4px; }
.pl-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.pl-stats {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.pl-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}
.pl-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.pl-action:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.pl-action svg { width: 12px; height: 12px; }
.pl-action.danger { color: var(--danger); border-color: var(--danger-border); }
.pl-action.danger:hover { background: var(--danger-bg); }

.import-progress {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cy-border-soft);
  background: var(--cy-bg-soft);
  font-size: 12px;
  color: var(--cy);
  letter-spacing: 0.04em;
  display: none;
}
.import-progress.show { display: block; }
.import-progress-bar {
  margin-top: 8px;
  height: 3px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.import-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cy), var(--pk));
  width: 0%;
  transition: width .25s linear;
}

/* ─────────────────────── settings / theme ─────────────────────── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}
.theme-card {
  text-align: left;
  padding: 18px 18px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .15s, background .15s, transform .12s;
}
.theme-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.theme-card.is-active {
  border-color: var(--cy-border-soft);
  background: var(--cy-bg-soft);
  box-shadow: 0 0 0 3px var(--cy-bg-soft);
}
.theme-card-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}
.theme-card-tag {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--pk);
}
.theme-card-state {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted-2);
}
.theme-card-state.active {
  color: var(--cy);
}
.theme-card-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.theme-card-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ─────────────────────── toast ─────────────────────── */
.toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translate(-50%, -10px);
  background: var(--menu-bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .25s cubic-bezier(.16,1,.3,1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ─────────────────────── spin animation ─────────────────────── */
@keyframes spin-once-kf { to { transform: rotate(360deg); } }
.spin-once { animation: spin-once-kf .6s ease-in-out; transform-origin: center; }

/* ─────────────────────── search modal ─────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px 20px;
  overflow-y: auto;
}
.modal.show { display: flex; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4,5,9,0.74);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal-pane {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
  overflow: hidden;
  animation: modal-in .22s cubic-bezier(.16,1,.3,1);
}
.modal-pane--lg { max-width: 760px; }
.modal-pane--xl { max-width: 920px; }

.pl-detail-head {
  position: relative;
  padding: 32px 36px 28px;
  background-size: cover;
  background-position: center;
}
.pl-detail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.5)),
              radial-gradient(120% 100% at 0% 0%, rgba(0,0,0,0), rgba(0,0,0,.55) 70%);
}
.pl-detail-headline { position: relative; z-index: 2; color: #fff; }
.pl-detail-headline .pl-cover-source { position: static; display: inline-flex; margin-bottom: 14px; background: rgba(0,0,0,0.6); }
.pl-detail-name {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
  margin-bottom: 6px;
}
.pl-detail-sub { font-size: 13px; color: rgba(255,255,255,0.78); margin-bottom: 18px; }
.pl-detail-actions { display: flex; gap: 8px; }
.pl-detail-actions .btn-ghost { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.18); }
.pl-detail-actions .btn-ghost:hover { background: rgba(255,255,255,0.16); }

.pl-tracks {
  max-height: 50vh;
  overflow-y: auto;
  padding: 6px 12px 14px;
}
.pl-tracks::-webkit-scrollbar { width: 8px; }
.pl-tracks::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

.track-row {
  display: grid;
  grid-template-columns: 36px 1fr auto 38px;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  transition: background .12s;
}
.track-row:hover { background: var(--surface-2); }
.track-row.flash { background: var(--cy-bg-soft); }

.track-n {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
  font-weight: 600;
}
.track-meta { min-width: 0; }
.track-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-artist {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.track-dur {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.track-play {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--cy-bg-soft);
  border: 1px solid var(--cy-border-soft);
  color: var(--cy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .12s;
}
.track-play:hover { background: var(--cy-bg-medium); transform: scale(1.06); }
.track-play:active { transform: scale(.94); }
.track-play svg { width: 12px; height: 12px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.modal-x {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: color .15s, border-color .15s, background .15s;
}
.modal-x:hover { color: var(--text); border-color: var(--text); background: var(--surface-2); }
.modal-x svg { width: 16px; height: 16px; }

.modal-content { padding: 36px 36px 28px; }

.modal-pretitle {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cy);
  margin-bottom: 12px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 14px;
}
.modal-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  max-width: 540px;
  margin-bottom: 26px;
}

.modal-section { margin-bottom: 18px; }
.modal-section-title {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cy);
  margin-bottom: 10px;
}
.modal-section-box {
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 20px;
  background: rgba(255,255,255,0.012);
}
.modal-section-hint {
  color: var(--muted-2);
  font-size: 13.5px;
  padding: 4px 2px;
}

.modal-input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-strong);
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.modal-input::placeholder { color: var(--muted-2); }
.modal-input:focus { border-color: var(--cy); box-shadow: 0 0 0 3px var(--cy-glow); }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  margin-top: 6px;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 6px;
  border-radius: 12px;
  transition: background .12s;
}
.result-row:hover { background: var(--surface-2); }
.result-cover {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cy-glow), var(--pk-glow));
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.result-meta { flex: 1; min-width: 0; }
.result-title { font-size: 14px; font-weight: 600; color: var(--text); }
.result-artist { font-size: 12px; color: var(--muted); margin-top: 2px; }
.result-add {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cy);
  border: 1px solid var(--cy-border-soft);
  background: var(--cy-bg-soft);
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  transition: background .15s;
}
.result-add:hover { background: var(--cy-bg-medium); }

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .08s;
  margin-bottom: 4px;
}
.search-result:hover { background: var(--surface-2); border-color: var(--border); }
.search-result:active { transform: scale(.99); }
.search-result .sr-art {
  width: 42px; height: 42px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--cy-glow), var(--pk-glow));
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.search-result .sr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.search-result .sr-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result .sr-artist { font-size: 12px; color: var(--muted); }
.search-result .sr-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.search-result .sr-src {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.search-result .sr-src .src-dot { width: 6px; height: 6px; }
.search-result .sr-dur {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11px;
  color: var(--muted-2);
}

@media (max-width: 600px) {
  .modal-content { padding: 28px 22px 22px; }
  .modal-title { font-size: 26px; }
}

/* ─────────────────────── slider dragging state ─────────────────────── */
.is-dragging .vol-knob,
.is-dragging .progress-knob { box-shadow: 0 0 0 6px var(--cy-glow), 0 4px 14px rgba(0,0,0,.6); }

/* ─────────────────────── responsive ─────────────────────── */
@media (max-width: 1080px) {
  .grid-overview {
    grid-template-columns: 1fr;
    grid-template-areas:
      "player"
      "up-next"
      "voice"
      "tiles"
      "action"
      "lyrics";
  }
  .action-meta { grid-template-columns: repeat(2, 1fr); }
  .tile-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .source-grid { grid-template-columns: repeat(2, 1fr); }
  .theme-grid { grid-template-columns: 1fr; }
}

/* Mobile header (hidden on desktop) */
.mobile-bar { display: none; }
.rail-backdrop { display: none; }

@media (max-width: 720px) {
  body { flex-direction: column; padding-top: 56px; }

  /* Top fixed bar with hamburger + brand */
  .mobile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    padding: 0 14px;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
  }
  .mobile-hamburger {
    appearance: none; border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    width: 38px; height: 38px;
    border-radius: 10px;
    display: grid; place-items: center;
    cursor: pointer;
  }
  .mobile-hamburger svg { width: 20px; height: 20px; }
  .mobile-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.01em;
  }
  .mobile-pad { flex: 1; }

  /* Sidebar becomes a slide-in drawer */
  .rail {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 78%;
    max-width: 280px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 60;
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 32px rgba(0,0,0,.4);
  }
  .rail.is-open { transform: translateX(0); }
  body.rail-collapsed .rail { width: 78%; }
  .rail-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
  }
  .rail-backdrop.is-open { opacity: 1; pointer-events: auto; }
  .rail-toggle { display: none; }
  .profile-menu.is-open { right: 12px !important; left: auto !important; }

  .canvas { padding: 16px 14px 36px; margin-left: 0 !important; }
  .view-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; justify-content: center; padding: 9px 12px; font-size: 12.5px; }
  .view-title { font-size: 22px; line-height: 1.18; }
  .view-sub { font-size: 12.5px; }

  .grid { gap: 14px; }

  .player-card { padding: 0; }
  .player-art { height: 180px; }
  .player-art-thumb { width: 96px; height: 96px; right: 18px; }
  .player-info { padding: 16px 18px 0; }
  .player-title { font-size: 22px; }
  .player-artist { font-size: 13px; }
  .player-controls { padding: 14px 18px 18px; }
  .progress { gap: 8px; }
  .progress-time { font-size: 11px; }
  .quick-pills { gap: 6px; }
  .quick-pills .pill { font-size: 10.5px; padding: 5px 9px; }

  .empty-hero { padding: 38px 18px 32px; min-height: 220px; }
  .empty-hero h3 { font-size: 18px; }

  .tile-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { padding: 14px 14px; }
  .tile-value { font-size: 16px; }
  .tile-sub { font-size: 10.5px; }

  .voice-card { min-height: 160px; }
  .voice-list { padding: 8px 14px 16px; gap: 6px; }
  .voice-member { padding: 6px 0; }

  .lyrics-card { min-height: 240px; max-height: 60vh; }
  .lyrics-view { padding: 14px 18px 36px; }
  .lyric-line { font-size: 17px; padding: 6px 0; }

  .action-card { padding: 16px 16px 14px; }
  .action-title { font-size: 18px; }
  .action-meta { grid-template-columns: 1fr 1fr; gap: 10px; }

  .vol-row { grid-template-columns: 1fr; }
  .vol-side { justify-content: flex-end; }

  /* Modal: full-screen on phone */
  .modal-pane { max-width: 100vw; max-height: 100vh; border-radius: 0; }
  .modal-content { padding: 22px 18px 18px; }
  .modal-title { font-size: 22px; }

  /* Servers grid */
  .invite-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Playlists */
  .pl-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Settings & source grid */
  .source-grid { grid-template-columns: 1fr 1fr; }
  .theme-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .rail .rail-nav { display: none; }
  .rail .profile-card { min-width: 0; flex: 1; }
  .head-actions { flex-wrap: wrap; }
}

/* ─────────────────────── invite cards / autoplay tile ─────────────────────── */
.invite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.invite-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
  transition: border-color .15s, transform .12s;
}
.invite-card .invite-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.invite-card:hover { border-color: var(--cy-border); transform: translateY(-1px); }
.invite-art {
  width: 60px; height: 60px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cy-bg-soft), var(--pk-bg-soft));
  display: grid; place-items: center;
  color: var(--text);
  font-weight: 700;
  font-size: 22px;
}
.invite-art img { width: 100%; height: 100%; object-fit: cover; }
.invite-fallback { color: var(--text); }
.invite-name { font-weight: 700; font-size: 15px; }
.invite-row { display: flex; gap: 6px; }
.invite-pill {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted-2);
}
.invite-pill.owner { color: var(--cy); border-color: var(--cy-border-soft); background: var(--cy-bg-soft); }
.invite-pill.admin { color: var(--pk); border-color: var(--pk-border-soft); background: var(--pk-bg-soft); }
.invite-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  background: linear-gradient(120deg, #22d3ee, #a855f7);
  color: #061018;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: filter .15s, transform .12s;
  margin-top: auto;
  box-shadow: 0 8px 22px rgba(34, 211, 238, 0.25);
}
.invite-cta::before {
  content: "🤖";
  margin-right: 8px;
  filter: grayscale(0.2);
}
.invite-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.invite-cta:active { transform: translateY(0); }

/* Playlist detail modal */
.plm-actions { display: flex; gap: 10px; margin-bottom: 14px; }
.plm-row {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  gap: 14px;
  align-items: center;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: background .15s, border-color .15s;
}
.plm-row:hover { background: var(--cy-bg-soft); border-color: var(--cy-border-soft); border-radius: 8px; }
.plm-row:last-child { border-bottom: none; }
.plm-idx { font-size: 11px; color: var(--muted-2); font-family: ui-monospace, monospace; }
.plm-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plm-tt { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plm-ta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plm-add {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  transition: background .15s, color .15s;
}
.plm-row:hover .plm-add { background: var(--cy); color: #051018; }
.plm-add svg { width: 14px; height: 14px; }

/* Make playlist card cover + name clickable cursor */
.pl-item .pl-cover, .pl-item .pl-name { cursor: pointer; }

/* Autoplay toggle (real iOS-style slider) */
.tile-autoplay { display: flex; flex-direction: column; gap: 8px; }
.autoplay-toggle {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: max-content;
}
.autoplay-toggle .ap-track {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--surface-3, #2a2a35);
  border: 1px solid var(--border);
  transition: background .2s, border-color .2s;
}
.autoplay-toggle .ap-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: transform .2s ease, background .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.autoplay-toggle .ap-text {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted-2);
  transition: color .2s;
}
.autoplay-toggle[aria-pressed="true"] .ap-track {
  background: var(--cy-bg-soft);
  border-color: var(--cy-border);
}
.autoplay-toggle[aria-pressed="true"] .ap-knob {
  background: var(--cy);
  transform: translateX(20px);
  box-shadow: 0 0 12px var(--cy-glow);
}
.autoplay-toggle[aria-pressed="true"] .ap-text { color: var(--cy); }
.autoplay-toggle:hover .ap-track { filter: brightness(1.1); }
