@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════════
   SannMusic — Streaming-player UI
   Three-panel floating shell · emerald identity (#1fd981)
   Drop-in replacement: maps onto existing index.html / app.js
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg:            #000;
  --panel:         #121212;   /* sidebar + main panel */
  --panel-top:     #050505;   /* gradient top edge of main panel — near-black to blend with topbar */
  --elevated:      #181818;   /* cards */
  --elevated-2:    #282828;   /* card hover, menus */
  --surface-hover: hsla(0, 0%, 100%, 0.1);
  --surface-press: hsla(0, 0%, 100%, 0.07);
  --border:        hsla(0, 0%, 100%, 0.08);
  --border-hr:     hsla(0, 0%, 100%, 0.12);

  /* Text */
  --text:       #fff;
  --text-dim:   #b3b3b3;
  --text-muted: #6a6a6a;

  /* Identity — emerald, distinct from Spotify's #1db954 */
  --accent:       #1fd981;
  --accent-hover: #3ee99a;
  --accent-press: #16b86b;
  --accent-tint:  rgba(31, 217, 129, 0.14);
  --accent-glow:  rgba(31, 217, 129, 0.40);

  /* Keep legacy aliases so any inline refs still resolve */
  --surface:      #121212;
  --surface2:     #181818;
  --surface3:     #282828;
  --accent-green: #1fd981;
  --accent-dim:   rgba(31, 217, 129, 0.14);

  --error:    #f15e6c;
  --error-bg: #2a1213;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-med:  0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s  cubic-bezier(0.4, 0, 0.2, 1);

  --font: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;

  --sidebar-w: 248px;
  --sidebar-collapsed-w: 72px;
  --header-h:  60px;
  --np-h:      88px;
  --gap:       8px;

  --radius-panel: 10px;
  --radius-card:  8px;
  --radius-sm:    4px;
  --radius-md:    6px;
  --radius-lg:    8px;
  --radius-xl:    12px;
  --radius-pill:  500px;
}

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

html {
  height: 100%;
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Scrollbars (reference style) ─── */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: hsla(0, 0%, 100%, 0.3);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: hsla(0, 0%, 100%, 0.5); background-clip: padding-box; }

/* ═══ Screens ═══ */
.screen { display: none; height: 100%; flex-direction: column; }
.screen.visible { display: flex; }

/* ═══════════════════════════════════════════════════════════════
   Login Screen
   ═══════════════════════════════════════════════════════════════ */
#login-screen {
  align-items: center;
  padding: 40px 24px;
  overflow-y: auto;
  background:
    radial-gradient(85% 60% at 14% -4%, rgba(31, 217, 129, 0.17) 0%, transparent 58%),
    radial-gradient(60% 50% at 92% 104%, rgba(31, 217, 129, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #0a0d0b 0%, #000 64%);
}
/* film grain */
#login-screen::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.login-shell {
  width: min(980px, 100%);
  margin: auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  grid-template-areas:
    "brand card"
    "info  card";
  gap: 32px 56px;
  align-items: start;
  position: relative;
  z-index: 1;
}

/* ─── Brand ─── */
.login-brand { grid-area: brand; display: flex; flex-direction: column; gap: 20px; }
.login-brand-head { display: flex; align-items: center; gap: 16px; }
.login-mark { flex-shrink: 0; filter: drop-shadow(0 12px 32px rgba(31, 217, 129, 0.38)); }
.login-wordmark { font-size: 34px; font-weight: 800; letter-spacing: -1.1px; line-height: 1; }
.login-wordmark b { font-weight: 800; }
.login-tagline {
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--text-dim);
}

/* equalizer motif */
.login-eq { display: flex; align-items: flex-end; gap: 4px; height: 26px; }
.login-eq span {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, #2BE995, #10B86B);
  opacity: 0.55;
  transform-origin: bottom;
  animation: loginEq 1.6s ease-in-out infinite;
}
.login-eq span:nth-child(1) { height: 40%; animation-delay: -1.3s; }
.login-eq span:nth-child(2) { height: 90%; animation-delay: -0.7s; }
.login-eq span:nth-child(3) { height: 60%; animation-delay: -1.1s; }
.login-eq span:nth-child(4) { height: 100%; animation-delay: -0.2s; }
.login-eq span:nth-child(5) { height: 50%; animation-delay: -0.9s; }
@keyframes loginEq { 0%, 100% { transform: scaleY(0.35); } 50% { transform: scaleY(1); } }

/* ─── Info column ─── */
.login-info { grid-area: info; display: flex; flex-direction: column; gap: 24px; }
.login-features { list-style: none; display: flex; flex-direction: column; gap: 13px; margin: 0; padding: 0; }
.login-features li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-dim); }
.login-features svg { color: var(--accent); flex-shrink: 0; }

.apk-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  border: 1px solid var(--border-hr);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(31, 217, 129, 0.09), rgba(31, 217, 129, 0.02));
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--transition-med), transform var(--transition-med), box-shadow var(--transition-med);
}
.apk-card:hover {
  border-color: rgba(31, 217, 129, 0.55);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(31, 217, 129, 0.18);
}
.apk-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-tint);
  color: var(--accent);
  flex-shrink: 0;
}
.apk-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.apk-title { font-size: 14.5px; font-weight: 700; }
.apk-meta { font-size: 12px; color: var(--text-dim); }
.apk-arrow { margin-left: auto; color: var(--text-dim); transition: transform var(--transition-med), color var(--transition-med); }
.apk-card:hover .apk-arrow { transform: translateY(2px); color: var(--accent); }

/* ─── Sign-in card ─── */
.login-card {
  grid-area: card;
  align-self: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 38px 32px 32px;
  background: rgba(18, 18, 18, 0.72);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.login-card-head { display: flex; flex-direction: column; gap: 6px; }
.login-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.login-subtitle { font-size: 13px; font-weight: 500; color: var(--text-dim); }
.login-hint { font-size: 12px; color: var(--text-muted); text-align: center; margin: -6px 0 0; }
#login-screen .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

/* ─── Entrance ─── */
@keyframes loginRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-brand, .login-info, .login-card { animation: loginRise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.login-info { animation-delay: 0.09s; }
.login-card { animation-delay: 0.17s; }

@media (prefers-reduced-motion: reduce) {
  .login-eq span { animation: none; }
  .login-brand, .login-info, .login-card { animation: none; }
}

/* ─── Responsive ─── */
@media (max-width: 860px) {
  #login-screen { padding: 28px 18px; overflow-y: auto; }
  .login-shell {
    display: flex; flex-direction: column;
    gap: 26px; width: min(420px, 100%); margin: auto;
  }
  .login-brand { order: 1; }
  .login-card { order: 2; align-self: stretch; }
  .login-info { order: 3; }
  .login-eq { display: none; }
  .login-features { gap: 12px; }
  .login-features li { font-size: 13px; }
}
@media (max-width: 420px) {
  .login-card { padding: 22px 18px; }
  .login-wordmark { font-size: 28px; }
  .login-mark { width: 44px; height: 44px; }
  .apk-card { padding: 12px; }
}

.login-fields { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

.input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  background: var(--elevated);
  border: 1px solid var(--border-hr);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}
.input::placeholder { color: var(--text-muted); }

.login-error {
  display: none;
  width: 100%;
  padding: 11px 14px;
  background: var(--error-bg);
  border: 1px solid #4a1c1f;
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 13px;
  text-align: center;
}
.login-error.visible { display: block; }

/* Primary pill — uses the emerald identity */
.btn-primary {
  width: 100%;
  height: 50px;
  background: var(--accent);
  color: #000;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform 33ms ease, background var(--transition-fast), filter var(--transition-fast);
}
.btn-primary:hover { transform: scale(1.03); background: var(--accent-hover); }
.btn-primary:active { transform: scale(1); filter: brightness(0.95); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ═══════════════════════════════════════════════════════════════
   App shell — floating rounded panels on black
   ═══════════════════════════════════════════════════════════════ */
#browser-screen { background: var(--bg); }

.app-layout {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0; /* ponytail: prevents flex overflow — fills remaining space below topbar */
  position: relative;
  gap: var(--gap);
  padding: 0 var(--gap) var(--gap);
  padding-bottom: calc(var(--np-h) + var(--gap));
}

/* ─── Sidebar (its own panel) ─── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--panel);
  border: none;
  border-radius: var(--radius-panel) 0 0 var(--radius-panel);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  overflow: hidden;
  transition: transform var(--transition-med), width var(--transition-slow), min-width var(--transition-slow);
}
.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
  min-width: var(--sidebar-collapsed-w);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  height: var(--header-h);
  flex-shrink: 0;
  cursor: pointer;
  transition: padding var(--transition-slow);
}
.sidebar.collapsed .sidebar-header { padding: 0; justify-content: center; }
.sidebar-header svg { stroke: var(--accent); flex-shrink: 0; }
.sidebar-logo {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}
.sidebar.collapsed .sidebar-logo { opacity: 0; width: 0; overflow: hidden; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 4px 12px 12px;
  gap: 2px;
  overflow-y: auto;
  transition: padding var(--transition-slow);
}
.sidebar.collapsed .sidebar-nav { padding: 4px 8px 12px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 11px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: color var(--transition-fast), background var(--transition-fast), padding var(--transition-slow);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; gap: 0; }
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--text); }
.nav-item.active .nav-icon { opacity: 1; color: var(--text); }
.nav-icon { flex-shrink: 0; opacity: 0.85; }
.nav-label { transition: opacity var(--transition-fast); }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
  transition: margin var(--transition-slow);
}
.sidebar.collapsed .sidebar-divider { margin: 8px 16px; }

.sidebar-backdrop { display: none; }

.sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--surface-hover); }

.header-back-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  border: none;
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font);
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.header-back-btn:hover { background: rgba(0,0,0,0.55); }

/* ─── Main panel ─── */
.main-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, var(--panel-top) 0%, var(--panel) 240px);
  border-radius: 0 var(--radius-panel) var(--radius-panel) 0;
  position: relative;
}

/* ─── Scan progress bar ─── */
.scan-progress {
  height: 3px;
  background: var(--elevated-2);
  flex-shrink: 0;
  position: relative;
}
.scan-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 0 2px 2px 0;
}
.scan-progress-text {
  position: absolute;
  right: 8px;
  top: -18px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ─── Header — translucent, sticky on the panel ─── */
.header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  background: transparent;
  border: none;
  flex-shrink: 0;
  z-index: 20;
  transition: background var(--transition-med), box-shadow var(--transition-med);
}
.header.is-scrolled {
  background: rgba(18, 18, 18, 0.72) !important;
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 0 var(--border);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.breadcrumb::-webkit-scrollbar { display: none; }

.crumb {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: color var(--transition-fast);
  flex-shrink: 0;
}
.crumb:hover { color: var(--text); }
.crumb:last-child { color: var(--text); pointer-events: none; font-weight: 700; }
.crumb:first-child { font-weight: 700; }

.sep { color: var(--text-muted); padding: 0 2px; font-size: 16px; flex-shrink: 0; user-select: none; }

/* ─── Search bar ─── */
.tb-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-dim);
  transition: color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}
.tb-btn:hover { color: var(--text); transform: scale(1.06); background: rgba(0, 0, 0, 0.55); }
.tb-btn:active { transform: scale(1); }

/* ─── Main content scroll region ─── */
.main-content { position: relative; flex: 1; overflow: hidden; }

.tab-content {
  display: none;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 88px;
}
#tab-folders { padding-top: 0; }
.tab-content.active { display: block; }

/* ═══ Generic list + empties ═══ */
.items-list { display: flex; flex-direction: column; padding: 0 8px; }

.items-list .empty-state {
  padding: 72px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
}

.error-bar {
  padding: 11px 14px;
  margin: 8px 16px;
  background: var(--error-bg);
  border: 1px solid #4a1c1f;
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

/* ═══ Track / folder rows ═══ */
.item {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 56px;
  padding: 0 12px;
  border-bottom: none;
  border-radius: var(--radius-sm);
  cursor: default;
  transition: background var(--transition-fast);
  user-select: none;
}
.item:hover { background: var(--surface-hover); }
.item:active { background: var(--surface-press); }
.item-folder { cursor: pointer; }

/* checkbox */
.item-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-right: 14px;
  border: 2px solid var(--text-muted);
  border-radius: 3px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #000;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.selection-mode .item-checkbox { display: flex; }
.item-checkbox.checked { border-color: var(--accent); background: var(--accent); }

/* icon + thumb */
.item-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  font-size: 16px;
  border-radius: var(--radius-sm);
}
.item-folder .item-icon { background: var(--accent-tint); color: var(--accent); font-size: 15px; }
.item-file .item-icon, .item-fallback-note { color: var(--text-dim); font-size: 16px; }

.item-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-right: 14px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--elevated-2);
}

.item-index {
  width: 28px;
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  margin-right: 12px;
  user-select: none;
}

.item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 6px 0; }

.item-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.item-file .item-name { font-size: 15px; }

.item-meta {
  font-size: 13px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-duration {
  flex-shrink: 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  margin-left: 10px;
  min-width: 40px;
  text-align: right;
}

/* row buttons */
.btn-play {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
  transition: color var(--transition-fast), transform var(--transition-fast);
  margin-left: 6px;
  padding: 0;
}
.btn-play:hover { color: var(--text); transform: scale(1.1); }
.btn-play:active { transform: scale(1); }
.btn-play.is-playing { color: var(--accent); }

.btn-more {
  flex-shrink: 0;
  width: 36px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  transition: color var(--transition-fast), transform var(--transition-fast);
  padding: 0;
}
.btn-more:hover { color: var(--text); transform: scale(1.1); }

/* currently playing row — green text, no full-row band (Spotify style) */
.item.currently-playing {
  background: transparent !important;
}
.item.currently-playing:hover { background: var(--surface-hover) !important; }
.item.currently-playing .item-name,
.item.currently-playing .item-index,
.item.currently-playing .track-num-index { color: var(--accent) !important; }

/* ═══════════════════════════════════════════════════════════════
   Spotify-style track table (folder + playlist views)
   ═══════════════════════════════════════════════════════════════ */
.track-head {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  margin: 4px 16px 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.track-head .th-num { width: 28px; margin-right: 14px; text-align: center; flex-shrink: 0; }
.track-head .th-title { flex: 1; min-width: 0; }
.track-head .th-dur { width: 52px; text-align: right; flex-shrink: 0; color: var(--text-dim); }
.track-head .th-more { width: 36px; flex-shrink: 0; }

.track-list { padding: 0 8px; }

/* number column with hover-to-play + now-playing equalizer */
.track-row .track-num {
  width: 28px;
  height: 40px;
  margin-right: 14px;
  flex-shrink: 0;
  position: relative;
  display: grid;
  place-items: center;
}
.track-num-index {
  font-size: 15px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.track-num-play {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.track-row:hover .track-num-index { visibility: hidden; }
.track-row:hover .track-num-play { display: flex; }

.track-eq {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.track-eq > span {
  width: 3px;
  height: 5px;
  background: var(--accent);
  border-radius: 1px;
}
.track-row.row-playing .track-eq > span { animation: eqbar 0.9s ease-in-out infinite; }
.track-eq > span:nth-child(2) { animation-delay: 0.25s; }
.track-eq > span:nth-child(3) { animation-delay: 0.5s; }
@keyframes eqbar { 0%, 100% { height: 4px; } 50% { height: 15px; } }

.track-row.currently-playing .track-num-index { display: none; }
.track-row.currently-playing .track-eq { display: flex; }
.track-row.currently-playing:hover .track-eq { display: none; }
.track-row.currently-playing:hover .track-num-play { display: flex; }
.track-row.currently-playing .item-name { color: var(--accent); }

/* ═══ Sub-folder cards inside a directory ═══ */
.subhead {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 12px 0 14px;
  padding: 0 24px;
}
.folder-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  padding: 0 16px 12px;
}
.folder-card {
  background: var(--elevated);
  border-radius: var(--radius-card);
  padding: 12px;
  cursor: pointer;
  transition: background var(--transition-slow);
}
.folder-card:hover { background: var(--elevated-2); }
.folder-card:hover .card-play-btn { opacity: 1; transform: translateY(0); }
.folder-card-ph {
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--elevated-2), var(--panel));
}

/* ═══ Folder & playlist hero action rows ═══ */
.folder-hero-actions, .playlist-hero ~ .album-detail-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.folder-shuffle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.folder-shuffle-btn:hover { color: var(--text); transform: scale(1.08); }
.album-card-placeholder.folder-hero-ph {
  width: 232px;
  height: 232px;
  flex-shrink: 0;
  font-size: 0;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--elevated-2), var(--panel));
  aspect-ratio: auto;
}
.album-card-placeholder.folder-hero-ph svg { width: 72px; height: 72px; }

@media (max-width: 767px) {
  .album-card-placeholder.folder-hero-ph { width: 180px; height: 180px; }
}

/* ═══ Playlist cover hero ═══ */
.playlist-hero-cover {
  width: 232px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}
.playlist-hero-cover .pl-cover {
  margin-bottom: 0;
  border-radius: 0;
  box-shadow: none;
  width: 232px;
  height: 232px;
}

/* ═══ Selection batch bar ═══ */
.selection-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  margin: 8px 16px 0;
  background: var(--elevated-2);
  border-radius: var(--radius-card);
}
.selection-bar.visible { display: flex; }

.selection-count { font-size: 13px; color: var(--text); font-weight: 700; flex: 1; }

.selection-btn {
  height: 34px;
  padding: 0 18px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 33ms ease, background var(--transition-fast);
}
.selection-btn:hover { transform: scale(1.04); background: var(--accent-hover); }
.selection-btn:active { transform: scale(1); }
.selection-btn-danger { background: transparent; color: var(--text); border: 1px solid var(--border-hr); }
.selection-btn-danger:hover { background: transparent; border-color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   Now Playing Bar — sits on the black, full width
   ═══════════════════════════════════════════════════════════════ */
.now-playing {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--np-h);
  background: var(--bg);
  border: none;
  z-index: 100;
  flex-direction: row;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
}

/* left — cover + meta */
.np-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 180px;
  width: 30%;
  max-width: 320px;
  flex-shrink: 0;
}

.np-cover {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--elevated-2);
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.np-placeholder {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--elevated-2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.np-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.np-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-title:hover { text-decoration: underline; cursor: default; }
.np-artist {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-link {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.np-link:hover {
  color: var(--text);
  text-decoration: underline;
}

/* center — controls + progress */
.np-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 722px;
  margin: 0 auto;
}

.np-controls { display: flex; align-items: center; gap: 16px; }

.np-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  border-radius: 50%;
  transition: color var(--transition-fast), transform var(--transition-fast);
  position: relative;
}
.np-btn:hover { color: var(--text); transform: scale(1.06); }
.np-btn:active { transform: scale(1); }
.np-btn-sm { width: 32px; height: 32px; }

/* white circular play/pause (reference) */
.np-btn-play {
  width: 38px;
  height: 38px;
  background: var(--text);
  color: #000;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}
.np-btn-play:hover { color: #000; transform: scale(1.08); }
.np-btn-play:active { transform: scale(1); }

/* active states for shuffle / repeat — emerald with dot */
.np-btn-sm.active { color: var(--accent); }
.np-btn-sm.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* progress row */
.np-time-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.np-time {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: center;
}

.np-progress-click {
  flex: 1;
  height: 4px;
  background: hsla(0, 0%, 100%, 0.2);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
}
.np-progress-click-fill {
  position: relative;
  height: 4px;
  background: var(--text);
  width: 0%;
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.1s linear, background var(--transition-fast);
}
.np-progress-click-fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  opacity: 0;
  transition: opacity var(--transition-fast);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.np-progress-click:hover .np-progress-click-fill { background: var(--accent); }
.np-progress-click:hover .np-progress-click-fill::after { opacity: 1; }

/* right — like + close */
.np-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  width: 30%;
  max-width: 320px;
  justify-content: flex-end;
}

.np-btn-like { transition: color var(--transition-fast), transform var(--transition-fast) !important; }
.np-btn-like:hover { transform: scale(1.15); color: var(--text); }
.np-btn-like.liked { color: var(--accent) !important; }
.np-btn-like.liked svg { fill: var(--accent); stroke: var(--accent); }
.np-btn-like.liked:hover { color: var(--accent-hover) !important; }

/* ─── Volume control ─── */
.np-volume-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.np-volume-slider-wrap {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px 8px;
  background: var(--elevated-2);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  margin-bottom: 8px;
}
.np-volume-wrap:hover .np-volume-slider-wrap,
.np-volume-slider-wrap:hover { display: block; }
.np-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  background: hsla(0, 0%, 100%, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  writing-mode: horizontal-tb;
}
.np-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.np-volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* ─── Queue panel ─── */
.queue-panel {
  position: fixed;
  bottom: var(--np-h);
  right: 8px;
  width: 340px;
  max-height: 60vh;
  background: var(--elevated);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  z-index: 90;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.queue-panel.visible { display: flex; }
.queue-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.queue-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.queue-clear-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}
.queue-clear-btn:hover { color: var(--text); }
.queue-panel-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}
.queue-panel .item { cursor: pointer; }
.queue-panel .item:hover { background: var(--surface-hover); }
.queue-panel .item-queue-drag {
  flex-shrink: 0;
  width: 24px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  cursor: grab;
  margin-right: 4px;
}

@media (max-width: 767px) {
  .queue-panel {
    right: 4px;
    left: 4px;
    width: auto;
    max-height: 50vh;
  }
}

@media (max-width: 767px) {
  .np-volume-wrap { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   Section titles (Playlists / Favorites headers)
   ═══════════════════════════════════════════════════════════════ */
.playlists-view, .favorites-view { padding: 0 24px 24px; }
.home-view { padding: 8px 24px 24px; }

.playlists-header, .favorites-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.playlists-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
}
.favorites-count { font-size: 13px; color: var(--text-dim); font-weight: 600; }

/* ═══ Card grids ═══ */
.playlist-grid, .album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.playlist-card, .album-card {
  background: var(--elevated);
  border-radius: var(--radius-card);
  padding: 12px;
  cursor: pointer;
  transition: background var(--transition-slow);
}
.playlist-card:hover, .album-card:hover { background: var(--elevated-2); }
.album-card { overflow: visible; }

.playlist-card-icon {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--accent-tint), var(--elevated-2));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--accent);
}

/* auto-composited playlist cover */
.pl-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--elevated-2);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.pl-cover-empty {
  background: linear-gradient(135deg, var(--accent-tint), var(--elevated-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.pl-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--elevated-2); }

.playlist-card-name, .album-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 5px;
}
.playlist-card-meta, .album-card-artist, .album-card-year {
  font-size: 13px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.45;
}

.album-card-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
  background: var(--elevated-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.album-card-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--elevated-2), var(--elevated));
  color: var(--text-muted);
  font-size: 38px;
  border-radius: var(--radius-sm);
}
.recent-card-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--elevated-2), var(--elevated));
  color: var(--text-muted);
  font-size: 38px;
  border-radius: var(--radius-sm);
}
.album-card-info { padding: 14px 4px 6px; }
.album-card-title { margin-bottom: 4px; }

/* ─── Hover-reveal green play FAB ─── */
.card-cover-wrap { position: relative; margin-bottom: 14px; }
.card-cover-wrap--round { border-radius: 50%; }
.card-cover-wrap > .album-card-cover,
.card-cover-wrap > .recent-card-cover,
.card-cover-wrap > .album-card-placeholder,
.card-cover-wrap > .pl-cover { margin-bottom: 0; }

.card-play-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition-slow), transform var(--transition-slow), background var(--transition-fast);
  box-shadow: 0 8px 20px var(--accent-glow);
  z-index: 2;
  padding: 0;
}
.album-card:hover .card-play-btn,
.playlist-card:hover .card-play-btn,
.artist-card:hover .card-play-btn,
.recent-card:hover .card-play-btn { opacity: 1; transform: translateY(0); }
.card-play-btn:hover { background: var(--accent-hover) !important; transform: scale(1.06) translateY(0) !important; }
.card-play-btn:active { transform: scale(1) translateY(0) !important; }

/* ═══ Artists ═══ */
.artist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  padding-top: 4px;
}
.artist-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 16px 12px;
  border-radius: var(--radius-card);
  background: var(--elevated);
  transition: background var(--transition-slow);
}
.artist-card:hover { background: var(--elevated-2); }
.artist-card .card-cover-wrap { width: 100%; display: flex; justify-content: center; }
.artist-card-placeholder {
  width: 100%;
  max-width: 130px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--elevated-2), var(--accent-tint));
  color: var(--accent);
  font-size: 42px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.artist-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.artist-card-meta { font-size: 13px; color: var(--text-dim); text-align: center; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   Album / Artist / Playlist / Favorites detail — full-bleed gradient heroes
   ═══════════════════════════════════════════════════════════════ */
.album-detail-header, .artist-detail-header {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 48px 32px 28px;
  min-height: 340px;
  position: relative;
  margin: 0 -24px;
  background:
    linear-gradient(180deg, rgba(31, 217, 129, 0.32) 0%, rgba(31, 217, 129, 0.06) 50%, transparent 100%),
    linear-gradient(180deg, #000 0%, #1a1a1a 8px, var(--panel) 100%);
}

/* Full-bleed for folder hero (items-list has different padding) */
.items-list > .album-detail-header,
.items-list > .artist-detail-header {
  margin: 0 -8px;
}

/* Purple gradient for Favorites */
.album-detail-header.favorites-hero {
  background:
    linear-gradient(180deg, rgba(102,72,176,0.92) 0%, rgba(72,50,128,0.5) 50%, transparent 100%),
    linear-gradient(180deg, #000 0%, #4d3a8c 8px, var(--panel) 100%);
}

/* Breadcrumb inside hero (overlaid on gradient) */
.hero-breadcrumb {
  position: absolute;
  top: 16px;
  left: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 5;
}
.hero-breadcrumb::-webkit-scrollbar { display: none; }
.hero-breadcrumb .crumb {
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: color var(--transition-fast);
  flex-shrink: 0;
}
.hero-breadcrumb .crumb:hover { color: rgba(255,255,255,0.9); }
.hero-breadcrumb .crumb:last-child { color: var(--text); pointer-events: none; font-weight: 700; }
.hero-breadcrumb .sep { color: rgba(255,255,255,0.35); padding: 0 2px; font-size: 15px; flex-shrink: 0; user-select: none; }

.album-detail-cover {
  width: 232px;
  height: 232px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--elevated-2);
  flex-shrink: 0;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}
.album-detail-info { flex: 1; min-width: 0; }
.album-detail-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text);
  margin-bottom: 12px;
}
.album-detail-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--text);
  line-height: 1.05;
  margin-bottom: 18px;
}
.album-detail-artist { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.album-detail-meta { font-size: 14px; color: var(--text-dim); }
.album-detail-meta .adm-artist { color: var(--text); font-weight: 700; }
.adm-artist-link { cursor: pointer; }
.adm-artist-link:hover { text-decoration: underline; }
.album-detail-meta .adm-dot { color: var(--text-muted); }
.album-detail-meta .adm-sub { color: var(--text-dim); }
.album-detail-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 32px;
  margin: 0 -24px;
  background: linear-gradient(180deg, rgba(31,217,129,0.04) 0%, transparent 100%);
}
.items-list > .album-detail-actions,
.items-list > .folder-hero-actions { margin: 0 -8px; }

/* desktop: reveal the row ••• only on hover / current (Spotify behavior) */
@media (hover: hover) {
  .track-row .btn-more { opacity: 0; transition: opacity var(--transition-fast); }
  .track-row:hover .btn-more,
  .track-row:focus-within .btn-more,
  .track-row.currently-playing .btn-more { opacity: 1; }
}

.artist-detail-placeholder {
  width: 232px;
  height: 232px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--elevated-2), var(--accent-tint));
  color: var(--accent);
  font-size: 72px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}
.artist-detail-name {
  font-size: clamp(44px, 7vw, 80px);
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--text);
  line-height: 1.05;
}
.artist-detail-meta { font-size: 14px; color: var(--text-dim); margin-top: 12px; }

/* big green play-all circle */
.album-play-all-btn, .playlist-play-all-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform var(--transition-fast), background var(--transition-fast);
  box-shadow: 0 8px 24px var(--accent-glow);
  flex-shrink: 0;
}
.album-play-all-btn:hover, .playlist-play-all-fab:hover { transform: scale(1.06); background: var(--accent-hover); }
.album-play-all-btn:active, .playlist-play-all-fab:active { transform: scale(1); }

/* Hero follow pill (artist folders) */
.hero-follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
.hero-follow-btn:hover { border-color: var(--text-dim); transform: scale(1.02); }
.hero-follow-btn:active { transform: scale(1); }
.hero-follow-btn.following {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent);
}
.hero-follow-btn.following svg { fill: currentColor; }

/* ═══════════════════════════════════════════════════════════════
   Home dashboard
   ═══════════════════════════════════════════════════════════════ */
.home-view { padding: 20px 24px 24px; }
.home-section { margin-bottom: 32px; }
.home-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.home-section-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
  white-space: nowrap;
}
.home-section-header { gap: 16px; }
.home-section-title:hover { text-decoration: underline; cursor: pointer; }
.home-section-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.home-section-link:hover { text-decoration: underline; color: var(--text); }

.home-horizontal-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.home-horizontal-scroll::-webkit-scrollbar { display: none; }

.recent-card {
  flex-shrink: 0;
  width: 160px;
  padding: 12px;
  border-radius: var(--radius-card);
  background: var(--elevated);
  cursor: pointer;
  transition: background var(--transition-slow);
}
.recent-card:hover { background: var(--elevated-2); }
.recent-card-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--elevated-2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
.recent-card .card-cover-wrap { margin-bottom: 14px; }
.recent-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}
.recent-card-artist {
  font-size: 13px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-chip {
  flex-shrink: 0;
  padding: 9px 18px;
  background: var(--elevated);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.folder-chip:hover { background: var(--elevated-2); transform: scale(1.03); }

/* ═══ Detail nav / back ═══ */
.detail-nav { padding: 8px 24px 0; display: flex; align-items: center; }
.detail-back-btn {
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  white-space: nowrap;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.detail-back-btn:hover { background: rgba(0, 0, 0, 0.6); transform: scale(1.04); }

.playlist-back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font);
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.playlist-back-btn:hover { background: rgba(0, 0, 0, 0.6); transform: scale(1.04); }

/* ═══ Playlist detail header ═══ */
.playlist-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 24px;
  margin-bottom: 8px;
}
.playlist-detail-title { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; color: var(--text); }
.playlist-detail-actions { margin-left: auto; display: flex; gap: 10px; }
.playlist-detail-actions .playlist-action-btn {
  height: 36px;
  padding: 0 18px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 33ms ease, background var(--transition-fast);
}
.playlist-play-all { background: var(--accent); color: #000; }
.playlist-play-all:hover { background: var(--accent-hover); transform: scale(1.04); }
.playlist-more-btn {
  background: transparent;
  border: 1px solid var(--border-hr) !important;
  color: var(--text-dim);
  height: 36px;
  width: 36px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast), color var(--transition-fast);
  padding: 0;
  letter-spacing: 1px;
}
.playlist-more-btn:hover { border-color: var(--text); color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   Dropdown menu
   ═══════════════════════════════════════════════════════════════ */
.dropdown-backdrop { position: fixed; inset: 0; z-index: 149; background: transparent; }
.dropdown {
  position: fixed;
  z-index: 150;
  background: var(--elevated-2);
  border: none;
  border-radius: var(--radius-card);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 6px 12px rgba(0, 0, 0, 0.35);
  min-width: 196px;
  padding: 4px;
  overflow: hidden;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-item-danger { color: var(--error); }
.dropdown-item-danger:hover { background: var(--error-bg); }
.dropdown-divider { height: 1px; background: var(--border-hr); margin: 4px 0; }
.dropdown-item.has-submenu::after { content: '›'; margin-left: auto; font-size: 18px; color: var(--text-dim); }

/* ═══ Upload progress ═══ */
.upload-progress {
  padding: 14px 16px;
  margin: 8px 16px;
  background: var(--elevated);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.upload-track { width: 100%; height: 4px; background: hsla(0, 0%, 100%, 0.2); border-radius: 2px; overflow: hidden; }
.upload-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width var(--transition-fast); width: 0; }

/* ═══════════════════════════════════════════════════════════════
   Modal
   ═══════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  width: 90%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.modal-title { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); }
.modal-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: #3e3e3e;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: box-shadow var(--transition-fast);
}
.modal-input:focus { box-shadow: 0 0 0 2px var(--text); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.modal-btn {
  height: 40px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 33ms ease, background var(--transition-fast);
}
.modal-btn:hover { transform: scale(1.04); }
.modal-btn:active { transform: scale(1); }
.modal-btn-secondary { background: transparent; color: var(--text); }
.modal-btn-secondary:hover { background: transparent; color: var(--text); text-decoration: underline; }
.modal-btn-primary { background: var(--accent); color: #000; }
.modal-btn-primary:hover { background: var(--accent-hover); }
.modal-btn-danger { background: var(--error); color: #fff; }

/* ─── Share playlist modal ─── */
.share-modal { max-width: 440px; }
.share-options { display: flex; flex-direction: column; gap: 8px; }
.share-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  background: var(--elevated-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.share-opt:hover { border-color: var(--border-hr); }
.share-opt.is-active { border-color: var(--accent); }
.share-radio {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  position: relative;
}
.share-opt.is-active .share-radio { border-color: var(--accent); }
.share-opt.is-active .share-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}
.share-opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share-opt-label { font-size: 15px; font-weight: 700; }
.share-opt-sub { font-size: 12.5px; color: var(--text-dim); }

/* ─── Post-login notice ─── */
.notice-box { max-width: 460px; gap: 18px; }
.notice-head { display: flex; align-items: center; gap: 10px; }
.notice-pill {
  font-size: 10px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase;
  color: #000; background: var(--accent); border-radius: var(--radius-pill); padding: 3px 10px;
}
.notice-item {
  display: flex; gap: 14px; padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}
.notice-ico {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent);
}
.notice-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.notice-body strong { font-size: 14px; font-weight: 800; letter-spacing: -0.2px; }
.notice-body p { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.notice-dl {
  align-self: flex-start; margin-top: 3px;
  font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.notice-dl:hover { text-decoration: underline; }
.notice-remember {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text-dim); cursor: pointer; user-select: none;
}
.notice-remember input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
@media (max-width: 480px) {
  .notice-box { padding: 22px 18px; }
  .notice-item { padding: 12px; gap: 11px; }
}

.metadata-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.metadata-form .field { gap: 4px; }
.metadata-form .field.full { grid-column: 1 / -1; }
.metadata-form .field-label { font-size: 10px; }
.metadata-form .input { height: 40px; font-size: 14px; }

/* ═══ Loading overlay ═══ */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  z-index: 200;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.loading-overlay.visible { display: flex; }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid hsla(0, 0%, 100%, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 13px; font-weight: 600; color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════════════
   Responsive — tablet
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .sidebar { width: 220px; min-width: 220px; }
  .playlist-grid, .album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .artist-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════════
   Responsive — mobile
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .app-layout { padding: 0; gap: 0; }
  #browser-screen .app-layout { padding-bottom: var(--np-h); }

  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 280px;
    min-width: 280px;
    z-index: 150;
    border-radius: 0;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 149;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity var(--transition-med);
  }
  .sidebar-backdrop.visible { display: block; opacity: 1; }

  .sidebar-toggle { display: flex; }
  .main-panel { border-radius: 0; }
  .header { padding: 0 14px; gap: 10px; }
  .header.is-scrolled { background: rgba(18, 18, 18, 0.92) !important; }

  .now-playing { padding: 0 12px; gap: 10px; }
  .np-left { min-width: 0; width: auto; flex: 1; max-width: none; }
  .np-center { display: none; }
  .np-right { min-width: 0; width: auto; flex-shrink: 0; }

  .tab-content { padding-bottom: 128px; }
  .playlists-view, .favorites-view { padding: 0 16px 20px; }
  .home-view { padding: 8px 16px 20px; }
  .playlist-grid, .album-grid, .folder-card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 155px)); gap: 10px; justify-content: center; }
  .folder-card, .playlist-card, .album-card { padding: 10px; }
  .album-card-title, .playlist-card-name { font-size: 13px; }
  .album-card-artist, .playlist-card-meta { font-size: 11px; }
  .folder-card-grid { padding: 0 12px 12px; }
  .artist-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .album-detail-header, .artist-detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 32px 20px 24px;
    min-height: 0;
    margin: 0 -16px;
  }
  .items-list > .album-detail-header,
  .items-list > .artist-detail-header { margin: 0 -8px; }
  .hero-breadcrumb { left: 20px; right: 20px; }
  .album-detail-cover { width: 180px; height: 180px; }
  .artist-detail-placeholder { width: 180px; height: 180px; font-size: 56px; }
  .album-detail-title { font-size: clamp(28px, 9vw, 44px); }
  .artist-detail-name { font-size: clamp(30px, 10vw, 48px); }
  .album-detail-actions { justify-content: center; padding: 18px 20px; margin: 0 -16px; }
  .items-list > .album-detail-actions,
  .items-list > .folder-hero-actions { margin: 0 -8px; }
}

@media (max-width: 480px) {
  .np-cover { width: 44px; height: 44px; }
  .np-title { font-size: 13px; }
  .np-artist { font-size: 11px; }
  .recent-card { width: 150px; }
}

/* ─── Mobile bar: restore center controls on a second row, optional ─── */
@media (max-width: 767px) {
  .now-playing { height: 64px; }
  #browser-screen .app-layout { padding-bottom: 64px; }
}

/* ─── Safe area for notched phones ─── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .now-playing {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--np-h) + env(safe-area-inset-bottom));
  }
  #browser-screen .app-layout {
    padding-bottom: calc(var(--np-h) + var(--gap) + env(safe-area-inset-bottom));
  }
  @media (max-width: 767px) {
    .now-playing { height: calc(64px + env(safe-area-inset-bottom)); }
    #browser-screen .app-layout {
      padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }
  }
}

/* ═══════════════════════════════════════════════════════════════
   Settings Modal
   ═══════════════════════════════════════════════════════════════ */
/* Card more button (three-dot menu) */
.card-more-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 5;
}
.folder-card:hover .card-more-btn,
.card-more-btn:focus-visible { opacity: 1; }
.card-more-btn:hover { background: rgba(0,0,0,0.85); color: var(--text); }

/* Card follow button (artists) — stacked above the play FAB */
.card-follow-btn {
  position: absolute;
  bottom: 64px;
  right: 18px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  z-index: 5;
}
.card-follow-btn:hover { background: rgba(0,0,0,0.85); color: var(--text); transform: scale(1.06); }
.card-follow-btn.followed { color: var(--accent); background: rgba(0,0,0,0.75); }
.card-follow-btn.followed svg { fill: currentColor; }
.card-follow-btn:focus-visible { opacity: 1; }
@media (hover: hover) {
  .card-follow-btn { opacity: 0; }
  .folder-card:hover .card-follow-btn { opacity: 1; }
}

/* Hidden items */
.folder-card-hidden { opacity: 0.55; }
.folder-card-hidden:hover { opacity: 1; }
.hidden-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #f0a040;
  pointer-events: none;
}
.track-hidden { opacity: 0.5; }
.track-hidden:hover { opacity: 0.85; }

/* ═══════════════════════════════════════════════════════════════
   v2 ENHANCEMENTS — logo, full-screen player, mobile nav, polish
   ═══════════════════════════════════════════════════════════════ */

/* ─── Logo ─── */
.sidebar-logo b { font-weight: 800; }
.logo-accent { color: var(--accent); font-weight: 700; }

/* mobile-only brand lockup in header */
.header-brand { display: none; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.header-brand svg { filter: drop-shadow(0 4px 10px rgba(31,217,129,0.3)); flex-shrink: 0; }
.header-brand-text { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.header-brand-text b { font-weight: 800; }

/* ─── Polish: cards lift on hover ─── */
.album-card, .playlist-card, .recent-card, .artist-card, .folder-card {
  transition: background var(--transition-med), transform var(--transition-med), box-shadow var(--transition-med);
}
.album-card:hover, .playlist-card:hover, .recent-card:hover, .artist-card:hover, .folder-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.now-playing { border-top: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════════
   Full-screen Player
   ═══════════════════════════════════════════════════════════════ */
.fs-player {
  position: fixed; inset: 0;
  z-index: 130;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transform: translateY(24px);
  transition: opacity var(--transition-med), transform var(--transition-med), visibility var(--transition-med);
  overflow: hidden;
}
.fs-player.open { opacity: 1; visibility: visible; transform: translateY(0); }

.fs-bg {
  position: absolute; inset: -10%;
  background-size: cover; background-position: center;
  filter: blur(60px) saturate(1.5) brightness(0.55);
  transform: scale(1.2);
  transition: background-image var(--transition-slow);
}
.fs-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.72) 45%, rgba(0,0,0,0.92) 100%);
}

.fs-inner {
  position: relative; z-index: 2;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  width: 100%; max-width: 560px;
  margin: 0 auto;
  padding: 18px 24px calc(28px + env(safe-area-inset-bottom, 0px));
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
}

.fs-top { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.fs-top-label { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.fs-top-sub { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--text-dim); }
.fs-top-src { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-icon-btn {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text); cursor: pointer;
  border-radius: 50%; transition: background var(--transition-fast), transform var(--transition-fast);
}
.fs-icon-btn:hover { background: var(--surface-hover); transform: scale(1.05); }

/* stage holds art / lyrics / queue (one visible at a time) */
.fs-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; margin: 8px 0; }

.fs-art-wrap {
  width: 100%; max-width: min(420px, 52vh); aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  transition: opacity var(--transition-med), transform var(--transition-med);
}
.fs-art {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 28px 70px rgba(0,0,0,0.6);
  background: var(--elevated-2);
}
.fs-art-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px; color: var(--text-muted);
  background: linear-gradient(135deg, var(--elevated-2), var(--panel));
  box-shadow: 0 28px 70px rgba(0,0,0,0.6);
}

.fs-lyrics, .fs-queue {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  border-radius: 14px;
}
.fs-player.panel-open .fs-art-wrap { display: none; }
.fs-lyrics.visible, .fs-queue.visible { display: flex; }

.fs-lyrics-content {
  padding: 8px 4px 40px;
  font-size: 22px; line-height: 1.7; font-weight: 700;
  color: rgba(255,255,255,0.55);
  text-wrap: pretty;
}
.fs-lyrics-content .lyric-line { margin: 0 0 6px; transition: color var(--transition-fast); }
.fs-lyrics-empty {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center;
  color: var(--text-dim); font-size: 15px; font-weight: 600; padding: 24px;
}
.fs-lyrics-empty svg { opacity: 0.4; }

.fs-queue-head { font-size: 13px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-dim); padding: 4px 4px 12px; flex-shrink: 0; }
.fs-queue-list { display: flex; flex-direction: column; gap: 2px; padding-bottom: 30px; }
.fs-q-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 8px; cursor: pointer;
  transition: background var(--transition-fast);
}
.fs-q-item:hover { background: var(--surface-hover); }
.fs-q-item.current .fs-q-title { color: var(--accent); }
.fs-q-grip {
  flex-shrink: 0; width: 22px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: grab; touch-action: none;
}
.fs-q-grip:active { cursor: grabbing; }
.fs-q-cover { width: 44px; height: 44px; border-radius: 5px; object-fit: cover; background: var(--elevated-2); flex-shrink: 0; }
.fs-q-info { flex: 1; min-width: 0; }
.fs-q-title { font-size: 15px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-q-eq { width: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.fs-q-eq .track-eq { position: static; display: flex; }
.fs-q-eq .track-eq > span { animation: eqbar 0.9s ease-in-out infinite; }
.fs-q-eq .track-eq > span:nth-child(2) { animation-delay: 0.25s; }
.fs-q-eq .track-eq > span:nth-child(3) { animation-delay: 0.5s; }
.fs-queue-empty { padding: 40px 16px; text-align: center; color: var(--text-dim); font-size: 14px; }

/* meta row */
.fs-meta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; margin-top: 6px; }
.fs-meta-text { flex: 1; min-width: 0; }
.fs-title { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-artist { font-size: 15px; color: var(--text-dim); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; }
.fs-like {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  border-radius: 50%; transition: color var(--transition-fast), transform var(--transition-fast);
}
.fs-like:hover { color: var(--text); transform: scale(1.1); }
.fs-like.liked { color: var(--accent); }
.fs-like.liked svg { fill: var(--accent); stroke: var(--accent); }

/* progress */
.fs-progress-row { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-top: 18px; }
.fs-time { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 38px; }
.fs-time:last-child { text-align: right; }
.fs-progress {
  flex: 1; height: 6px; border-radius: 3px;
  background: hsla(0,0%,100%,0.22); cursor: pointer;
  position: relative; display: flex; align-items: center;
  touch-action: none;
}
.fs-progress-fill { height: 6px; width: 0%; border-radius: 3px; background: var(--text); position: relative; pointer-events: none; transition: background var(--transition-fast); }
.fs-progress-fill::after {
  content: ''; position: absolute; right: -7px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 50%; background: var(--text);
  opacity: 0; transition: opacity var(--transition-fast); box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.fs-progress:hover .fs-progress-fill { background: var(--accent); }
.fs-progress:hover .fs-progress-fill::after { opacity: 1; }

/* controls */
.fs-controls { display: flex; align-items: center; justify-content: center; gap: 22px; flex-shrink: 0; margin-top: 22px; }
.fs-ctl {
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  border-radius: 50%; position: relative;
  width: 48px; height: 48px;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.fs-ctl:hover { color: var(--text); transform: scale(1.08); }
.fs-ctl.fs-play {
  width: 64px; height: 64px; background: var(--text); color: #000;
}
.fs-ctl.fs-play:hover { color: #000; transform: scale(1.06); background: #fff; }
.fs-ctl.active { color: var(--accent); }
.fs-ctl.active::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
#fs-repeat-one { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 9px; font-weight: 800; }

/* bottom toolbar */
.fs-bottom { display: flex; align-items: center; justify-content: space-around; gap: 8px; flex-shrink: 0; margin-top: 22px; }
.fs-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 14px; background: none; border: none;
  color: var(--text-dim); font-size: 13px; font-weight: 700; font-family: var(--font);
  cursor: pointer; border-radius: var(--radius-pill);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.fs-tab:hover { color: var(--text); background: var(--surface-hover); }
.fs-tab.active { color: var(--accent); }
.fs-sleep-badge { margin-left: 4px; color: var(--accent); font-variant-numeric: tabular-nums; }
.fs-sleep-badge:not(:empty)::before { content: ''; }

/* ═══════════════════════════════════════════════════════════════
   Sleep timer menu (reuses .dropdown) + drag handles
   ═══════════════════════════════════════════════════════════════ */
.dropdown-item.sleep-active { color: var(--accent); }
.dropdown-item.sleep-active::after { content: '✓'; margin-left: auto; color: var(--accent); }

.item-queue-drag { touch-action: none; }
.reorder-dragging { opacity: 0.5; background: var(--elevated-2) !important; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.pl-drag-handle {
  flex-shrink: 0; width: 24px; height: 40px; margin-right: 4px;
  display: none; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: grab; touch-action: none;
}
.pl-drag-handle:active { cursor: grabbing; }
.track-row:hover .pl-drag-handle { display: flex; }

/* ─── Recently Added (home) ─── */
.recent-card .ra-badge {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.6px;
  color: var(--accent); margin-bottom: 4px; text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════
   Mobile bottom navigation
   ═══════════════════════════════════════════════════════════════ */
.mobile-nav { display: none; }

@media (max-width: 767px) {
  :root { --mnav-h: 60px; }

  .mobile-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(var(--mnav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(10, 10, 10, 0.86);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-top: 1px solid var(--border);
    z-index: 105;
  }
  .mnav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    font-size: 10px; font-weight: 700; font-family: var(--font);
    transition: color var(--transition-fast);
    padding: 0;
  }
  .mnav-item span { letter-spacing: 0.2px; }
  .mnav-item.active { color: var(--accent); }
  .mnav-item:active { transform: scale(0.94); }

  /* hide hamburger; bottom nav replaces it */
  .sidebar-toggle { display: none !important; }
  /* show brand lockup in header (toggled off on folders via JS) */
  .header-brand { display: flex; }

  /* floating mini-player above the nav */
  .now-playing {
    left: 8px; right: 8px;
    bottom: calc(var(--mnav-h) + env(safe-area-inset-bottom, 0px) + 6px);
    height: 62px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(28, 28, 28, 0.92);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
  #browser-screen .app-layout { padding-bottom: calc(var(--mnav-h) + env(safe-area-inset-bottom, 0px)); }
  #browser-screen .app-layout {
    padding-bottom: calc(62px + var(--mnav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  }

  /* give the mini-player a thin progress sliver at its top edge */
  .np-center { display: none; }

  .fs-inner { max-width: 100%; }
  .fs-art-wrap { max-width: 78vw; }
  .fs-title { font-size: 22px; }
}

@media (max-width: 767px) {
  /* override the older safe-area block so the floating bar math wins */
  #browser-screen .app-layout {
    padding-bottom: calc(62px + var(--mnav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  }
}

/* small phones */
@media (max-width: 380px) {
  .mnav-item span { font-size: 9px; }
  .fs-controls { gap: 16px; }
  .fs-ctl { width: 44px; height: 44px; }
  .fs-ctl.fs-play { width: 58px; height: 58px; }
}

/* ═══════════════════════════════════════════════════════════════
   v3 — Spotify-style global top bar, search, Liked-Songs Favorites
   ═══════════════════════════════════════════════════════════════ */
:root { --topbar-h: 64px; }

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--bg);
  position: relative;
  z-index: 60;
}
.topbar-left { display: flex; align-items: center; flex-shrink: 0; min-width: var(--sidebar-w); }
.topbar-logo {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer; padding: 4px 6px;
  border-radius: 8px; transition: opacity var(--transition-fast);
}
.topbar-logo:hover { opacity: 0.85; }
.topbar-logo:active { transform: scale(0.98); }
.topbar-logo svg { filter: drop-shadow(0 4px 12px rgba(31,217,129,0.35)); flex-shrink: 0; }
.topbar-wordmark { font-size: 19px; font-weight: 800; letter-spacing: -0.4px; color: var(--text); white-space: nowrap; }
.topbar-wordmark b { font-weight: 800; }

.topbar-center {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.topbar-home {
  width: 48px; height: 48px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--elevated); color: var(--text-dim);
  border: none; border-radius: 50%; cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}
.topbar-home:hover { color: var(--text); transform: scale(1.05); background: var(--elevated-2); }
.topbar-home:active { transform: scale(1); }
.topbar-home.active { color: var(--text); }

.topbar-search {
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 474px;
  height: 48px; padding: 0 16px;
  background: var(--elevated);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.topbar-search:hover { background: var(--elevated-2); }
.topbar-search:focus-within { border-color: var(--text); background: var(--elevated-2); }
.topbar-search-icon { color: var(--text-dim); flex-shrink: 0; }
.topbar-search:focus-within .topbar-search-icon { color: var(--text); }
.topbar-search-input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 500;
}
.topbar-search-input::placeholder { color: var(--text-dim); }
.topbar-search-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.topbar-search-clear {
  flex-shrink: 0; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-dim); cursor: pointer; border-radius: 50%;
  transition: color var(--transition-fast);
}
.topbar-search-clear:hover { color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* sub-header now repurposed as a thin contextual bar (back / breadcrumb only) */
.sidebar-header svg { stroke: var(--text-dim) !important; }
.sidebar-header:hover svg { stroke: var(--text) !important; }
.header-brand { display: none !important; }
.header { overflow: hidden; transition: height var(--transition-med); }
.header.header-collapsed { height: 0; }

/* ─── Search results overlay ─── */
.search-overlay {
  display: none;
  position: absolute; inset: 0;
  overflow-y: auto;
  z-index: 25;
  background: linear-gradient(180deg, var(--panel-top) 0%, var(--panel) 260px);
}
.search-overlay.active { display: block; }
.search-results { padding: 24px 24px 32px; }
.search-status { font-size: 13px; color: var(--text-dim); padding: 4px 0 18px; display: flex; align-items: center; gap: 10px; }
.search-status .spinner-sm {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border-hr); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.search-section { margin-bottom: 30px; }
.search-section-title { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 14px; color: var(--text); }
.search-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.search-empty { padding: 72px 24px; text-align: center; }
.search-empty-icon { font-size: 44px; opacity: 0.4; margin-bottom: 14px; }
.search-empty-title { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.search-empty-sub { font-size: 14px; color: var(--text-dim); max-width: 360px; margin: 0 auto; line-height: 1.55; }
.search-card-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; text-transform: capitalize; }

/* ─── Favorites — Liked-Songs hero ─── */
.favorites-cover {
  width: 232px; height: 232px; flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4f86ff 0%, #8e5bff 55%, #c44ff0 100%);
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  color: #fff;
}
.favorites-cover svg { width: 92px; height: 92px; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.4)); }
.favorites-meta-row { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-dim); flex-wrap: wrap; }
.favorites-owner { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--text); }
.favorites-owner-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-press));
  color: #06140e; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.favorites-shuffle-btn {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.favorites-shuffle-btn:hover { color: var(--text); transform: scale(1.08); }
.favorites-shuffle-btn.active { color: var(--accent); }

/* extra track-table columns (album + date added) for favorites */
.track-head .th-thumb { width: 44px; margin-right: 14px; flex-shrink: 0; }
.th-album, .item-album {
  width: 28%; max-width: 300px; flex-shrink: 0;
  font-size: 13px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-right: 16px;
}
.item-album { cursor: default; }
.album-link { cursor: pointer; }
.album-link:hover { text-decoration: underline; color: var(--text); }
.th-date, .item-date {
  width: 116px; flex-shrink: 0;
  font-size: 13px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.track-row .item-album, .track-row .item-date { text-transform: none; }
.fav-table .btn-more { color: var(--text-dim); }
.fav-table .item-file:hover .btn-more, .fav-table .btn-more.liked { color: var(--accent); }
.fav-table .track-row .btn-more { opacity: 1 !important; }

@media (max-width: 920px) {
  .th-album, .item-album { display: none; }
}
@media (max-width: 680px) {
  .th-date, .item-date { display: none; }
}

/* ─── Top bar responsive ─── */
@media (max-width: 1024px) {
  .topbar-left { min-width: 0; }
  .topbar-wordmark { display: none; }
}
@media (max-width: 767px) {
  .topbar { height: 56px; gap: 10px; padding: 0 12px; }
  .topbar-home { display: none; }
  .topbar-center { justify-content: stretch; }
  .topbar-search { height: 42px; max-width: none; }
  .topbar-logo svg { width: 28px; height: 28px; }
  .search-results { padding: 16px 14px 28px; }
  .search-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .favorites-cover { width: 180px; height: 180px; }
  .favorites-cover svg { width: 68px; height: 68px; }
}

/* ═══════════════════════════════════════════════════════════════
   v4 — Spotify-style redesign
   Library panel · Home quick-picks & shelves · Albums / Artists
   library pages · artist page · album hero · Favorites · Playlists
   · Now Playing panel · player bar polish.
   Appended last so it wins the cascade over v1–v3.
   Markup contracts for every class below: HANDOFF.md / preview.html
   ═══════════════════════════════════════════════════════════════ */
:root {
  --sidebar-w: 300px;
  --sidebar-collapsed-w: 72px;
  --np-panel-w: 340px;
  --radius-panel: 8px;

  --text-sub:   #a7a7a7;   /* secondary copy on #121212 (7.6:1) */
  --text-muted: #8a8a8a;   /* was #6a6a6a (3.3:1) — now ≥4.5:1 */
  --card-hover: #1f1f1f;
  --chip-bg:    #2a2a2a;
  --chip-bg-hover: #353535;
  --fav-purple: #5038a0;

  /* Hero colour: JS may set --hero-tint on a hero from the cover's
     dominant colour; these are the fallbacks. */
  --hero-tint: #3e3e3e;
}

/* ─── Shell ─── */
.sidebar { border-radius: var(--radius-panel); }
.main-panel {
  border-radius: var(--radius-panel);
  background: var(--panel);
  container: main / inline-size;
}
.now-playing { border-top: none; }

/* No lift on hover — Spotify cards only change background */
.album-card, .playlist-card, .recent-card, .artist-card, .folder-card { background: transparent; }
.album-card:hover, .playlist-card:hover, .recent-card:hover, .artist-card:hover, .folder-card:hover {
  background: var(--card-hover);
  transform: none;
  box-shadow: none;
}
.card-play-btn { box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45); }
.card-play-btn:focus-visible { opacity: 1; transform: none; }

/* ═══ Library panel (#sidebar.lib) ═══ */
.lib { display: flex; flex-direction: column; overflow: hidden; }
.lib .nav-item {                         /* reset v1 .nav-item */
  width: auto; padding: 0; gap: 0;
  border-radius: 0; background: none;
  font-size: inherit; overflow: visible;
}
.lib .lib-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 12px 8px 16px; flex-shrink: 0;
}
.lib .lib-title {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 4px; color: var(--text-dim);
  font-size: 16px; font-weight: 700;
}
.lib .lib-title:hover { color: var(--text); }
.lib .lib-title.active { color: var(--text-dim); }        /* "home" tab — not a selection */
.lib .lib-title.active:hover { color: var(--text); }
.lib .lib-create {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px 0 10px;
  border: none; border-radius: var(--radius-pill);
  background: var(--card-hover); color: var(--text);
  font: 700 13px var(--font); cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.lib .lib-create:hover { background: var(--chip-bg); transform: scale(1.04); }

.lib .lib-chips {
  display: flex; flex-wrap: nowrap; gap: 8px; padding: 4px 16px 12px; flex-shrink: 0;
  overflow-x: auto; scrollbar-width: none;
}
.lib .lib-chips::-webkit-scrollbar { display: none; }
.lib .lib-chip {
  flex-shrink: 0; height: 32px; padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--chip-bg); color: var(--text);
  font-size: 13px; font-weight: 600;
}
.lib .lib-chip:hover { background: var(--chip-bg-hover); }
.lib .lib-chip.active { background: var(--accent); color: #000; }

.lib .lib-list {
  flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px;
  scrollbar-width: thin;
  /* Chrome 121+: scrollbar-width disables ::-webkit-scrollbar, so the
     standard color is what keeps this dark instead of the default white */
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.lib-section + .lib-section { margin-top: 10px; }
.lib-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 8px 6px;
  color: var(--text-sub); font-size: 12px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.lib-section-count { color: var(--text-muted); font-weight: 600; letter-spacing: 0; }
.lib-empty { padding: 16px 10px; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.lib .lib-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 8px;
  border: none; border-radius: 6px; background: none;
  color: var(--text); text-align: left; cursor: pointer;
  font-family: var(--font);
}
.lib .lib-row:hover { background: var(--card-hover); }
.lib .lib-row.active,
.lib .lib-row.is-open { background: rgba(255, 255, 255, 0.07); }
.lib .lib-row.is-playing .lib-row-title { color: var(--accent); }
.lib-thumb {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 4px; object-fit: cover;
  background: var(--elevated-2); color: var(--text-dim);
  display: grid; place-items: center;
}
.lib-thumb--round { border-radius: 50%; }
.lib-thumb--fav { background: var(--fav-purple); color: #fff; }
.lib-thumb--folder { background: var(--accent-tint); color: var(--accent); }
.lib .lib-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lib-row-title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-row-meta {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 400; color: var(--text-sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lib-pin { color: var(--accent); flex-shrink: 0; }
.lib-row-eq { flex-shrink: 0; color: var(--accent); }
#lib-fav-count:not(:empty)::before { content: ' · '; }

/* collapsed (title click → toggleSidebarCollapse) */
.sidebar.collapsed .lib-chips,
.sidebar.collapsed .lib-create,
.sidebar.collapsed .lib-section-head,
.sidebar.collapsed .lib-row-eq { display: none; }
.sidebar.collapsed .lib-head { justify-content: center; padding: 12px 0 8px; }
.sidebar.collapsed .lib-title { gap: 0; }
.sidebar.collapsed .lib-row { justify-content: center; gap: 0; padding: 8px 0; }
.sidebar.collapsed .lib-row-text,
.sidebar.collapsed .lib-title .nav-label { display: none; }

/* ═══ Shared page furniture ═══ */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  height: 32px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: var(--radius-pill);
  background: var(--chip-bg); color: var(--text);
  font: 600 13px var(--font); white-space: nowrap; cursor: pointer;
  transition: background var(--transition-fast);
}
.chip:hover { background: var(--chip-bg-hover); }
.chip.active { background: var(--accent); color: #000; }
.chip-x { width: 32px; padding: 0; justify-content: center; }

.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px 0 16px;
}
.page-title { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -0.8px; }
.page-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.items-list > .page-head,
.items-list > .filter-chips,
.items-list > .notice-strip { margin-left: 16px; margin-right: 16px; }

.tool-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  border: none; border-radius: 50%; background: none;
  color: var(--text-dim); display: grid; place-items: center; cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.tool-btn:hover { color: var(--text); transform: scale(1.06); }
.sort-btn {
  height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px;
  border: none; background: none; color: var(--text-dim);
  font: 600 13px var(--font); cursor: pointer;
}
.sort-btn:hover { color: var(--text); }
.view-toggle { display: flex; gap: 2px; padding: 2px; border-radius: 6px; background: var(--card-hover); }
.view-toggle button {
  width: 32px; height: 32px; border: none; border-radius: 4px;
  background: transparent; color: var(--text-sub);
  display: grid; place-items: center; cursor: pointer;
}
.view-toggle button:hover { color: var(--text); }
.view-toggle button.active { background: #3a3a3a; color: var(--text); }

.btn-pill {
  height: 36px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: var(--radius-pill);
  background: var(--accent); color: #000;
  font: 700 14px var(--font); cursor: pointer;
  transition: transform 33ms ease, background var(--transition-fast);
}
.btn-pill:hover { background: var(--accent-hover); transform: scale(1.04); }
.btn-pill:active { transform: scale(1); }
.btn-pill--light { height: 32px; font-size: 13px; background: #fff; }
.btn-pill--light:hover { background: #fff; }
.link-btn {
  border: none; background: none; padding: 0;
  color: var(--text-dim); font: 700 13px var(--font); cursor: pointer;
}
.link-btn:hover { color: var(--text); text-decoration: underline; }
.notice-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin-bottom: 16px;
  border-radius: var(--radius-card); background: var(--card-hover);
  font-size: 13px; color: #d6d6d6;
}
.section-title { margin: 0 0 12px; font-size: 24px; font-weight: 800; letter-spacing: -0.4px; }
.subhead { font-size: 24px; letter-spacing: -0.4px; margin: 24px 0 8px; padding: 0 16px; }

/* ═══ Home ═══ */
.home-view {
  padding: 16px 24px 32px;
  background: linear-gradient(180deg, var(--home-tint, rgba(31, 217, 129, 0.2)) 0, transparent 300px);
}
.home-greeting { margin: 0 0 16px; font-size: 28px; font-weight: 800; letter-spacing: -0.6px; }

.quick-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; margin-bottom: 40px;
}
.quick-tile {
  position: relative; display: flex; align-items: center;
  height: 64px; border-radius: 6px; overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer; transition: background var(--transition-med);
}
.quick-tile:hover { background: rgba(255, 255, 255, 0.16); }
.quick-cover {
  width: 64px; height: 64px; flex-shrink: 0; object-fit: cover;
  background: var(--elevated-2); color: var(--text-dim);
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.quick-cover--fav { background: var(--fav-purple); color: #fff; }
.quick-title {
  flex: 1; min-width: 0; padding: 0 12px;
  font-size: 14px; font-weight: 700; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* full-tile hit area (keyboard + click); play button sits above it */
.quick-hit { position: absolute; inset: 0; z-index: 1; border: none; background: none; cursor: pointer; border-radius: inherit; }
.quick-hit:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.quick-tile.is-playing .quick-title { color: var(--accent); }
.quick-tile .track-eq { position: static; display: none; margin-right: 16px; height: 16px; }
.quick-tile.is-playing .track-eq { display: flex; }
.quick-tile.row-playing .track-eq > span { animation: eqbar 0.9s ease-in-out infinite; }
.quick-tile .card-play-btn {
  position: relative; inset: auto; z-index: 2;
  width: 36px; height: 36px; margin-right: 12px; flex-shrink: 0;
  transform: none;
}
.quick-tile:hover .card-play-btn { opacity: 1; transform: none; }
.quick-tile.is-playing .card-play-btn { display: none; }
@media (hover: none) { .quick-tile .card-play-btn { display: none; } }  /* touch: tap the tile */

/* shelves: one scrolling row, Spotify spacing */
.home-section { margin-bottom: 32px; }
.home-section-header { margin-bottom: 8px; align-items: baseline; }
.home-section-title { font-size: 24px; }
.home-section-link {
  font-size: 13px; font-weight: 700; text-transform: none; letter-spacing: 0;
  color: var(--text-dim);
}
.home-horizontal-scroll {
  display: grid; grid-auto-flow: column; grid-auto-columns: 184px;
  gap: 0; margin: 0 -12px; padding-bottom: 0;
  overflow-x: auto; scroll-snap-type: x proximity;
}
.home-horizontal-scroll > * { scroll-snap-align: start; }
.home-horizontal-scroll .recent-card,
.home-horizontal-scroll .playlist-card { width: auto !important; padding: 12px; }
.recent-card .card-cover-wrap { margin-bottom: 10px; }
.recent-card-title { font-size: 15px; font-weight: 600; }
.recent-card.is-playing .recent-card-title { color: var(--accent); }
.recent-card-artist { color: var(--text-sub); }

/* Recently added: artist folders render round, NEW pill */
.recent-card--round .recent-card-cover,
.recent-card--round .recent-card-placeholder,
.recent-card--round .card-cover-wrap { border-radius: 50%; }
.recent-card .ra-badge {
  display: inline-block; padding: 2px 6px; margin-bottom: 6px;
  border-radius: 4px; background: var(--accent-tint); color: var(--accent);
  font-size: 10px; font-weight: 800; letter-spacing: 0.6px;
}

/* Recent folders as tiles (replaces .folder-chip) */
.folder-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.folder-tile {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 10px 12px; border: none; border-radius: 6px;
  background: rgba(255, 255, 255, 0.06); color: var(--text);
  text-align: left; font-family: var(--font); cursor: pointer;
  transition: background var(--transition-fast);
}
.folder-tile:hover { background: rgba(255, 255, 255, 0.14); }
.folder-tile-ico {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 6px;
  background: var(--accent-tint); color: var(--accent);
  display: grid; place-items: center;
}
.folder-tile-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.folder-tile-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-tile-path { font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═══ Folder / album / artist card grids ═══ */
.folder-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 4px; padding: 0 4px 12px;
}
.folder-card { padding: 12px; }
.folder-card .card-cover-wrap { margin-bottom: 10px; }
.album-card-title { font-size: 15px; font-weight: 600; }
.album-card-artist { color: var(--text-sub); }

/* artist cards: round, star badge top-left (reuses .card-follow-btn) */
.folder-card--artist .card-cover-wrap,
.folder-card--artist .album-card-cover,
.folder-card--artist .album-card-placeholder { border-radius: 50%; }
.folder-card--artist .card-follow-btn { top: 6%; left: 6%; bottom: auto; right: auto; background: var(--panel); }
.folder-card--artist .card-follow-btn.followed { opacity: 1; }
.folder-card--artist .card-play-btn { right: 2px; bottom: 2px; }

/* horizontal shelf of folder cards (e.g. "Following") */
.shelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: 176px;
  overflow-x: auto; padding: 0 4px 8px; scroll-snap-type: x proximity;
}
.shelf > * { scroll-snap-align: start; }

/* list view: same .folder-card markup, CSS turns it into rows */
.folder-card-grid.is-list { grid-template-columns: 1fr; gap: 0; }
.folder-card-grid.is-list .folder-card {
  position: relative; display: grid;
  grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: auto auto;
  column-gap: 12px; align-items: center; padding: 8px 12px; border-radius: 4px;
}
.folder-card-grid.is-list .card-cover-wrap { grid-row: 1 / 3; width: 48px; height: 48px; margin: 0; position: static; }
.folder-card-grid.is-list .album-card-cover,
.folder-card-grid.is-list .album-card-placeholder { width: 48px; height: 48px; box-shadow: none; }
.folder-card-grid.is-list .album-card-title { margin: 0; align-self: end; }
.folder-card-grid.is-list .album-card-artist { align-self: start; }
.folder-card-grid.is-list .card-play-btn { display: none; }
.folder-card-grid.is-list .card-more-btn { top: 50%; right: 12px; transform: translateY(-50%); }
.folder-card-grid.is-list .card-follow-btn { top: 4px; left: 4px; width: 20px; height: 20px; }

/* A–Z jump bar + letter groups (Artists) */
.az-bar { display: flex; flex-wrap: wrap; gap: 2px; }
.az-link {
  min-width: 24px; height: 24px; padding: 0 4px; border-radius: 4px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--text-sub); text-decoration: none;
}
.az-link:hover { background: var(--chip-bg); color: var(--text); }
.az-head { display: flex; align-items: center; gap: 12px; margin: 16px 16px 4px; scroll-margin-top: 12px; }
.az-letter { min-width: 20px; font-size: 18px; font-weight: 800; color: var(--accent); }
.az-rule { flex: 1; height: 1px; background: var(--border); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 24px 16px 8px;
}
.section-head .section-title { margin: 0; }

/* ═══ Detail heroes (album, artist, playlist, favorites) ═══ */
.hero-breadcrumb { display: none !important; }   /* artist name in the meta line navigates instead */
.album-detail-header,
.artist-detail-header {
  min-height: 0;
  padding: 72px 32px 24px;
  background: var(--hero-tint);
  background: linear-gradient(180deg, var(--hero-tint) 0%, color-mix(in srgb, var(--hero-tint) 60%, #000) 100%);
}
.album-detail-label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.album-detail-title { font-size: clamp(40px, 6vw, 88px); letter-spacing: -0.04em; line-height: 1; margin-bottom: 16px; }
.album-detail-title.is-long { font-size: clamp(32px, 4.4vw, 68px); }
.album-detail-meta { color: rgba(255, 255, 255, 0.8); }
.adm-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: -7px; margin-right: 6px; }
.album-detail-actions {
  gap: 24px; padding: 24px 32px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--hero-tint) 45%, transparent) 0%, transparent 100%);
}
.album-play-all-btn { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
.hero-icon-btn {
  width: 40px; height: 40px; border: none; background: none;
  color: var(--text-dim); display: grid; place-items: center; cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.hero-icon-btn:hover { color: var(--text); transform: scale(1.06); }
.hero-icon-btn.active { color: var(--accent); }
.actions-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }

/* Follow = outline pill (Spotify) */
.hero-follow-btn { height: 34px; padding: 0 16px; border: 1px solid rgba(255, 255, 255, 0.5); font-weight: 700; }
.hero-follow-btn:hover { border-color: var(--text); }
.hero-follow-btn.following { background: transparent; border-color: var(--accent); color: var(--text); }
.hero-follow-btn svg { display: none; }

/* Artist hero: round picture, larger name */
.artist-hero .album-detail-cover,
.artist-hero .folder-hero-ph { border-radius: 50%; }
.artist-hero .album-detail-title { font-size: clamp(48px, 8vw, 104px); }

/* Favorites + playlist heroes */
.album-detail-header.favorites-hero { --hero-tint: #5a41b8; }
.favorites-hero ~ .album-detail-actions { --hero-tint: #5a41b8; }
.favorites-cover { background: var(--fav-purple); }
.playlist-hero { --hero-tint: #4a4a4a; }

/* ═══ Track tables ═══ */
.track-head {
  text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500;
  color: var(--text-dim);
}
.track-row:hover { background: rgba(255, 255, 255, 0.1); }
.item-meta { color: var(--text-sub); }
.item-meta .artist-link { color: inherit; cursor: pointer; }
.item-meta .artist-link:hover { color: var(--text); text-decoration: underline; }
.th-quality, .item-quality {
  width: 170px; flex-shrink: 0; padding-right: 16px;
  font-size: 13px; color: var(--text-sub);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.th-plays, .item-plays {
  width: 110px; flex-shrink: 0;
  font-size: 13px; color: var(--text-sub); font-variant-numeric: tabular-nums;
}
.th-like { width: 36px; flex-shrink: 0; }
.row-like {
  width: 28px; height: 28px; flex-shrink: 0; margin-left: 8px;
  border: none; background: none; color: var(--text-dim);
  display: grid; place-items: center; cursor: pointer; opacity: 0;
}
.track-row:hover .row-like, .row-like:focus-visible, .row-like.liked { opacity: 1; }
.row-like.liked { color: var(--accent); }
.row-like.liked svg { fill: currentColor; stroke: currentColor; }

/* ═══ Artist page body ═══ */
.artist-top { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; margin: 8px 16px 32px; }
.artist-top .track-list { padding: 0; }
.artist-top .track-head { margin: 0 0 6px; }
.side-card {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 12px; border: none; border-radius: var(--radius-card);
  background: var(--card-hover); color: var(--text);
  text-align: left; font-family: var(--font); cursor: pointer;
}
.side-card:hover { background: var(--chip-bg); }
.side-card-art { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.side-card-art img, .side-card-art .side-card-ph {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  background: var(--elevated-2); display: grid; place-items: center;
}
.side-card-badge {
  position: absolute; right: -4px; bottom: -4px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--fav-purple); border: 3px solid var(--card-hover);
  color: #fff; display: grid; place-items: center;
}
.side-card-title { display: block; font-size: 15px; font-weight: 700; }
.side-card-sub { display: block; font-size: 13px; color: var(--text-sub); margin-top: 4px; }

/* ═══ Playlists page ═══ */
.playlists-header { align-items: center; margin: 24px 0 20px; }
.playlists-title { font-size: 32px; letter-spacing: -0.8px; }
.playlist-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 4px; margin: 0 -12px; }
.playlist-card-meta { color: var(--text-sub); }
.fav-tile {
  grid-column: span 2; position: relative; overflow: hidden;
  margin: 12px; min-height: 200px; padding: 20px;
  display: flex; flex-direction: column; justify-content: flex-end;
  border-radius: var(--radius-card); background: #4b3496;
  cursor: pointer; transition: filter var(--transition-med);
}
.fav-tile:hover { filter: brightness(1.08); }
.fav-tile-bg { position: absolute; right: -14px; top: -18px; width: 120px; height: 120px; color: #fff; opacity: 0.1; pointer-events: none; }
.fav-tile-snippet {
  margin: 0 0 auto; padding-bottom: 20px;
  font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, 0.8);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.fav-tile-snippet b { color: #fff; font-weight: 600; }
.fav-tile-title { font-size: 32px; font-weight: 800; letter-spacing: -0.8px; }
.fav-tile-sub { font-size: 14px; color: rgba(255, 255, 255, 0.85); margin-top: 6px; }
.fav-tile .card-play-btn { right: 20px; bottom: 20px; width: 52px; height: 52px; }
.fav-tile:hover .card-play-btn { opacity: 1; transform: none; }
.new-playlist-card {
  margin: 12px; min-height: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 2px dashed rgba(255, 255, 255, 0.25); border-radius: var(--radius-card);
  background: transparent; color: var(--text-dim);
  font: 700 14px var(--font); cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}
.new-playlist-card:hover { border-color: rgba(255, 255, 255, 0.6); color: var(--text); }

/* ═══ Now Playing panel (right column) ═══ */
.np-panel {
  width: var(--np-panel-w); flex-shrink: 0;
  background: var(--panel); border-radius: var(--radius-panel);
  overflow-y: auto; padding: 0 16px 16px;
  scrollbar-width: thin;
  /* standard props win over ::-webkit-scrollbar once scrollbar-width is set */
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.np-panel[hidden] { display: none; }
.npp-head {
  position: sticky; top: 0; z-index: 2; background: var(--panel);
  display: flex; align-items: center; gap: 4px; padding: 16px 0 12px;
}
.npp-source {
  flex: 1; min-width: 0; padding: 0; border: none; background: none;
  color: var(--text); text-align: left; cursor: pointer;
  font: 700 16px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.npp-source:hover { text-decoration: underline; }
.npp-art-wrap {
  aspect-ratio: 1; border-radius: var(--radius-card); overflow: hidden;
  background: var(--elevated-2); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.npp-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.npp-meta { display: flex; align-items: center; gap: 12px; margin: 16px 0 20px; }
.npp-meta-text { flex: 1; min-width: 0; }
.npp-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.npp-artist { margin-top: 4px; font-size: 15px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.npp-like { width: 36px; height: 36px; }
.npp-card { border-radius: var(--radius-card); background: var(--card-hover); padding: 16px; margin-bottom: 12px; }
.npp-card--lyrics { background: var(--lyrics-tint, #1d2f5c); }
.npp-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 12px; font-size: 15px; font-weight: 700;
}
.npp-card-sub { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.75); }
.npp-lyrics-lines {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px;
  font-size: 20px; font-weight: 700; line-height: 1.3;
}
.npp-lyrics-lines .is-past { color: rgba(255, 255, 255, 0.55); }
.npp-lyrics-lines .is-current { color: #fff; }
.npp-lyrics-lines .is-next { color: rgba(255, 255, 255, 0.4); }
.npp-lyrics-empty { font-size: 14px; color: rgba(255, 255, 255, 0.75); margin-bottom: 12px; }
.npp-row {
  display: flex; align-items: center; gap: 12px;
  width: calc(100% + 12px); margin: 0 -6px; padding: 6px;
  border: none; border-radius: 6px; background: none;
  color: var(--text); text-align: left; font-family: var(--font); cursor: pointer;
}
.npp-row:hover { background: var(--chip-bg); }
.npp-row img { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; background: var(--elevated-2); flex-shrink: 0; }
.npp-row-text { min-width: 0; }
.npp-row-title { display: block; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.npp-row-sub { display: block; font-size: 13px; color: var(--text-sub); margin-top: 3px; }
.npp-file-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.file-tag { padding: 4px 8px; border-radius: 4px; background: var(--chip-bg); color: #d6d6d6; font-size: 11px; font-weight: 700; }
.file-tag--accent { background: var(--accent-tint); color: var(--accent); font-weight: 800; letter-spacing: 0.6px; }
.npp-file-path { font-size: 12px; color: var(--text-sub); line-height: 1.5; word-break: break-all; }
.npp-file-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: #d6d6d6; }
.npp-file-note svg { color: var(--accent); flex-shrink: 0; }

/* ═══ Player bar ═══ */
.np-left { gap: 12px; }
.np-left .np-btn-like { margin-left: 4px; flex-shrink: 0; }
#np-panel-btn[aria-pressed="true"] { color: var(--accent); }
#np-panel-btn[aria-pressed="true"]::after {
  content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
@media (min-width: 768px) {
  /* volume slider inline, always visible (was a hover pop-up) */
  .np-volume-wrap { gap: 2px; }
  .np-volume-slider-wrap {
    display: flex !important; position: static; transform: none;
    padding: 0; margin: 0; background: none; box-shadow: none; border-radius: 0;
  }
  .np-volume-slider {
    width: 96px;
    background: linear-gradient(to right, #fff var(--vol, 100%), hsla(0, 0%, 100%, 0.25) var(--vol, 100%));
  }
  .np-volume-slider:hover {
    background: linear-gradient(to right, var(--accent) var(--vol, 100%), hsla(0, 0%, 100%, 0.25) var(--vol, 100%));
  }
  .np-volume-slider::-webkit-slider-thumb { width: 12px; height: 12px; opacity: 0; }
  .np-volume-slider:hover::-webkit-slider-thumb { opacity: 1; }
}

/* ═══ Responsive ═══ */
@container main (max-width: 1000px) {
  .artist-top { grid-template-columns: minmax(0, 1fr); }
  .th-quality, .item-quality, .th-plays, .item-plays { display: none; }
}
@container main (max-width: 900px) {
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container main (max-width: 560px) {
  .fav-tile { grid-column: span 1; }
  .fav-tile-snippet { display: none; }
}
@media (max-width: 1179px) {
  .np-panel { display: none !important; }
  .np-desktop-only { display: none; }
}
@media (max-width: 1024px) {
  .sidebar { width: 260px; min-width: 260px; }
}
@media (max-width: 767px) {
  .home-view { padding: 8px 16px 20px; }
  .quick-grid { gap: 6px; margin-bottom: 28px; }
  .quick-tile { height: 56px; }
  .quick-cover { width: 56px; height: 56px; }
  .home-horizontal-scroll { grid-auto-columns: 152px; }
  .album-detail-header, .artist-detail-header { padding: 32px 20px 24px; }
  .page-title { font-size: 26px; }
  .items-list > .page-head,
  .items-list > .filter-chips,
  .items-list > .notice-strip { margin-left: 8px; margin-right: 8px; }
}

/* v4 fixes — cover images fill their rounded thumb containers */
.lib-thumb, .quick-cover { overflow: hidden; }
.lib-thumb > img, .quick-cover > img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; border-radius: inherit;
}

/* Desktop: fullscreen player is mobile-only — hide the mini-player expand */
@media (min-width: 1180px) {
  #np-close-btn { display: none; }
}

/* "Show lyrics" — expanded, scrollable lyrics box in the Now Playing panel */
.npp-lyrics-lines.is-expanded {
  max-height: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

/* Topbar centering: the Home + search group was centered between the logo
   block (min-width 300px) and the icon cluster (~130px), pushing it ~85px
   right of viewport center. Equal outer columns give exact centering. */
@media (min-width: 768px) {
  .topbar-left { flex: 1 1 0; }
  .topbar-right { flex: 1 1 0; justify-content: flex-end; }
  .topbar-center { flex: 0 1 auto; }
}
/* ═══════════════════════════════════════════════════════════════
   v5 — Settings page + profile menu
   Append to the END of styles.css (after v4). Relies on v4 tokens:
   --card-hover, --chip-bg, --text-sub, --text-muted, .btn-pill.
   Markup contracts: HANDOFF-settings.md / preview-settings.html
   ═══════════════════════════════════════════════════════════════ */

/* ─── Avatar (generic) ─── */
.avatar {
  --av: 32px;
  width: var(--av); height: var(--av); flex-shrink: 0;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--av-bg, #e8a33d); color: var(--av-fg, #1a1205);
  font-weight: 800; font-size: calc(var(--av) * 0.42); line-height: 1;
  text-transform: uppercase; user-select: none;
}
.avatar--40 { --av: 40px; }
.avatar--44 { --av: 44px; }
.avatar--112 { --av: 112px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }

.role-badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  background: var(--chip-bg); color: var(--text-dim);
  font-size: 10px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
}
.role-badge--admin { background: var(--accent-tint); color: var(--accent); }

/* ─── Top-bar avatar button (replaces the gear; keeps id="btn-settings") ─── */
.topbar-avatar {
  width: 48px; height: 48px; flex-shrink: 0;
  border: none; border-radius: 50%; background: var(--card-hover);
  display: grid; place-items: center; cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.topbar-avatar:hover { background: var(--chip-bg); transform: scale(1.04); }
.topbar-avatar[aria-expanded="true"] { background: #3a3a3a; }

/* ─── Profile menu ─── */
.profile-menu {
  position: fixed; top: calc(var(--topbar-h) - 4px); right: 16px; z-index: 140;
  width: 280px; padding: 4px; border-radius: var(--radius-card);
  background: var(--elevated-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 6px 12px rgba(0, 0, 0, 0.35);
}
.profile-menu[hidden] { display: none; }
.profile-menu-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 14px; }
.profile-menu-name { display: block; font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.profile-menu-sep { height: 1px; margin: 4px; background: var(--border-hr); }
.profile-menu-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px; border: none; border-radius: 4px; background: none;
  color: var(--text); font: 500 14px var(--font); text-align: left; cursor: pointer;
}
.profile-menu-item:hover, .profile-menu-item:focus-visible { background: #3a3a3a; outline: none; }
.profile-menu-item svg { flex-shrink: 0; color: var(--text-dim); }

/* ─── Settings page layout ─── */
.settings-view { min-height: 100%; }
.set-wrap {
  display: flex; min-height: 100%;
  /* full-height divider beside the sticky nav */
  background: linear-gradient(to right, transparent 247px, var(--border) 247px, var(--border) 248px, transparent 248px);
}
.set-nav {
  width: 248px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 28px 12px;
  position: sticky; top: 0; align-self: flex-start;
}
.set-nav-title { margin: 0 12px 16px; font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.set-nav-group { margin: 20px 12px 8px; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; }
.set-nav-item {
  position: relative; display: flex; align-items: center;
  height: 40px; padding: 0 12px 0 20px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-dim);
  font: 600 14px var(--font); text-align: left; cursor: pointer; white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.set-nav-item::before {
  content: ''; position: absolute; left: 4px; top: 11px; width: 4px; height: 18px;
  border-radius: 2px; background: transparent;
}
.set-nav-item:hover { background: var(--card-hover); color: var(--text); }
.set-nav-item[aria-current="page"] { background: var(--chip-bg); color: var(--text); }
.set-nav-item[aria-current="page"]::before { background: var(--accent); }

.set-body { flex: 1; min-width: 0; max-width: 800px; padding: 32px 40px 48px; }
.set-h1 { margin: 0 0 24px; font-size: 32px; font-weight: 800; letter-spacing: -0.8px; }
.set-h1 .set-count { font-size: 20px; font-weight: 700; color: var(--text-muted); }
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.set-head .set-h1 { margin: 0; }

/* ─── Cards ─── */
.set-card { border-radius: var(--radius-card); background: var(--elevated); padding: 24px; margin-bottom: 16px; }
.set-card--flush { padding: 0; overflow: hidden; }
.set-card--row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px; }
.set-card--accent { border: 1px solid var(--border-hr); }
.set-card-title { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.set-card-sub { margin: 0; font-size: 13px; color: var(--text-sub); line-height: 1.5; }
.set-card-head { padding: 24px 24px 12px; }
.set-note { margin: 12px 4px 0; font-size: 12px; color: var(--text-muted); }

/* ─── Forms ─── */
.set-fields { display: grid; gap: 16px; max-width: 420px; margin-top: 20px; }
.set-fields--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
.set-field { display: grid; gap: 6px; }
.set-label { font-size: 13px; font-weight: 600; color: #d6d6d6; }
.set-input {
  height: 44px; padding: 0 14px; border-radius: 6px;
  border: 1px solid #3e3e3e; background: #242424; color: var(--text);
  font: 400 15px var(--font); outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.set-input:focus { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.set-input[aria-invalid="true"] { border-color: var(--error); box-shadow: none; }
.set-check { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 14px; cursor: pointer; }
.set-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.set-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.set-actions--start { justify-content: flex-start; }
.form-msg { min-height: 18px; margin-top: 12px; font-size: 13px; }
.form-msg.is-error { color: var(--error); }
.form-msg.is-ok { color: var(--accent); }

/* ─── Buttons (add to v4 .btn-pill family) ─── */
.btn-pill--sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-outline {
  height: 40px; padding: 0 18px; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: var(--radius-pill);
  background: transparent; color: var(--text); font: 700 14px var(--font); cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.btn-outline:hover { border-color: var(--text); background: rgba(255, 255, 255, 0.04); }
.btn-outline:disabled { opacity: 0.5; cursor: default; }
.btn-outline.btn-pill--sm { height: 34px; padding: 0 14px; font-size: 13px; border-color: rgba(255, 255, 255, 0.2); }
.btn-outline--danger { border-color: var(--error); color: var(--error); }
.btn-outline--danger:hover { border-color: var(--error); background: rgba(241, 94, 108, 0.12); }
.btn-text {
  height: 40px; padding: 0 18px; border: none; border-radius: var(--radius-pill);
  background: transparent; color: var(--text); font: 700 14px var(--font); cursor: pointer;
}
.btn-text:hover { background: var(--chip-bg); }
.btn-text--danger { color: var(--error); }
.btn-text--danger:hover { background: rgba(241, 94, 108, 0.12); }
.btn-text.btn-pill--sm { height: 34px; padding: 0 14px; font-size: 13px; }

/* ─── Account: profile header ─── */
.set-profile { display: flex; align-items: center; gap: 24px; padding: 8px 0 32px; }
.set-profile-kicker { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.set-profile-name { margin: 4px 0 10px; font-size: 48px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; overflow-wrap: anywhere; }
.set-profile-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text-dim); }

/* ─── Switch rows ─── */
.set-row { display: flex; align-items: center; gap: 24px; padding: 20px 24px; border-top: 1px solid var(--border); }
.set-card--flush > .set-row:first-child { border-top: none; }
.set-row-text { flex: 1; min-width: 0; }
.set-row-title { font-size: 15px; font-weight: 600; }
.set-row-desc { margin-top: 4px; font-size: 13px; color: var(--text-sub); line-height: 1.5; }
.switch {
  position: relative; width: 44px; height: 24px; flex-shrink: 0; padding: 0;
  border: none; border-radius: var(--radius-pill); background: #535353; cursor: pointer;
  transition: background var(--transition-fast);
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform var(--transition-fast);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ─── Users + hidden folders lists ─── */
.set-list-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--border); }
.set-card--flush > .set-list-row:first-child { border-top: none; }
.set-list-row:hover { background: #1a1a1a; }
.set-list-text { flex: 1; min-width: 0; }
.set-list-title { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-list-title .you { color: var(--text-muted); font-weight: 500; }
.set-list-sub { display: block; margin-top: 3px; font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-list-actions { display: flex; gap: 6px; flex-shrink: 0; }
.set-folder-ico {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 6px;
  background: var(--chip-bg); color: var(--text-sub); display: grid; place-items: center;
}
.set-empty { padding: 20px 24px; font-size: 13px; color: var(--text-sub); border-top: 1px solid var(--border); }

/* ─── Library scan ─── */
.set-scan { margin-top: 20px; }
.set-scan[hidden] { display: none; }
.set-scan-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.set-scan-fill { height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width 0.3s ease; }
.set-scan-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; }

/* ─── About ─── */
.set-about-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.set-about-head .set-h1 { margin: 0; }
.set-about-ver { margin-top: 4px; font-size: 13px; color: var(--text-sub); }
.set-about-text { margin: 0 0 24px; max-width: 620px; font-size: 15px; line-height: 1.65; color: #d6d6d6; }
.set-link-row {
  display: flex; align-items: center; gap: 16px; padding: 18px 24px;
  border-top: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.set-card--flush > .set-link-row:first-child { border-top: none; }
.set-link-row:hover { background: #1a1a1a; text-decoration: none; }
.set-link-row svg { color: var(--text-sub); flex-shrink: 0; }
.set-about-foot { margin: 24px 0 0; font-size: 12px; color: var(--text-muted); }
.set-body .apk-card { margin-top: 0; }

/* ─── Responsive ─── */
@container main (max-width: 720px) {
  .set-fields--2 { grid-template-columns: minmax(0, 1fr); }
  .set-profile-name { font-size: 36px; }
}
@media (max-width: 767px) {
  .set-wrap { flex-direction: column; background: none; }
  .set-nav {
    position: static; width: auto; flex-direction: row; gap: 6px;
    padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--border);
    overflow-x: auto; scrollbar-width: none;
  }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav-title, .set-nav-group { display: none; }
  .set-nav-item { flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: var(--radius-pill); background: var(--chip-bg); color: var(--text); }
  .set-nav-item::before { display: none; }
  .set-nav-item[aria-current="page"] { background: var(--accent); color: #000; }
  .set-body { padding: 20px 16px 32px; }
  .set-profile { gap: 16px; }
  .avatar--112 { --av: 80px; }
  .set-profile-name { font-size: 32px; }
  .set-list-row { flex-wrap: wrap; }
  .set-list-actions { width: 100%; justify-content: flex-end; }
  .profile-menu { right: 8px; left: 8px; width: auto; top: 52px; }
}


/* ═══════════════════════════════════════════════════════════════
   v5 Settings round — user-requested deviation from the handoff:
   the design ships as a full page, but it renders inside the
   existing modal shell (a windowed box) instead. These rules only
   size the .set-wrap design into .modal-box.settings-modal.
   ═══════════════════════════════════════════════════════════════ */
.modal-box.settings-modal {
  position: relative;
  width: min(920px, 92vw);
  max-width: none;
  height: min(680px, 88vh);
  max-height: 88vh;
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.settings-modal .set-wrap { flex: 1; min-height: 0; width: 100%; }
.settings-modal .set-body { overflow-y: auto; overscroll-behavior: contain; }
.set-modal-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 36px; height: 36px; padding: 0;
  border: none; border-radius: 50%;
  background: transparent; color: var(--text-dim);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.set-modal-close:hover { background: var(--card-hover); color: var(--text); }
@media (max-width: 767px) {
  .modal-box.settings-modal { width: 94vw; height: min(720px, 92vh); max-height: 92vh; }
  .settings-modal .set-nav { padding-right: 56px; }
  .settings-modal .set-fields--2 { grid-template-columns: minmax(0, 1fr); }
  .settings-modal .set-profile-name { font-size: 36px; }
}

/* ═══════════════════════════════════════════════════════════════
   v6 — Artist page with online info (MusicBrainz / TheAudioDB / Last.fm)
   Append to the END of styles.css (after v4 + v5). Uses v4/v5 tokens
   and classes: --card-hover, --chip-bg, --text-sub, --text-muted,
   .filter-chips/.chip, .btn-outline, .btn-text, .btn-pill, .set-input.
   Markup contracts: HANDOFF-artist-info.md / preview-artist-info.html
   ═══════════════════════════════════════════════════════════════ */

/* ─── Skeleton shimmer (loading state) ─── */
.skel {
  display: block; border-radius: 4px;
  background: linear-gradient(90deg, #242424 0, #2f2f2f 50%, #242424 100%);
  background-size: 800px 100%;
  animation: skel 1.4s linear infinite;
}
.skel--inline { display: inline-block; vertical-align: middle; height: 14px; }
@keyframes skel { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ─── Artist hero: same box in every state ───
   Layout never depends on info: fixed min-height, picture + name pinned to
   the bottom. Only the background layer (.hero-banner) and the info part
   of the meta line change between states. */
.artist-hero {
  position: relative; overflow: hidden;
  min-height: 420px; align-items: flex-end;
  padding: 72px 32px 28px;
}
.artist-hero > :not(.hero-banner) { position: relative; z-index: 1; }
.hero-banner { position: absolute; inset: 0; z-index: 0; }
.hero-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.hero-banner::after {           /* scrim: name stays readable on any photo */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.55) 80%, rgba(18, 18, 18, 0.85) 100%);
}
.hero-banner.skel { border-radius: 0; opacity: 0.5; }
.hero-banner.skel::after { display: none; }

.artist-hero .album-detail-cover,
.artist-hero .folder-hero-ph {
  width: 200px; height: 200px; border-radius: 50%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(18, 18, 18, 0.6);
}
.artist-hero .album-detail-title { font-size: clamp(48px, 8vw, 112px); letter-spacing: -0.04em; }
.artist-hero .album-detail-title.is-long { font-size: clamp(38px, 5.8vw, 86px); }
.artist-hero .album-detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 22px; font-size: 15px; color: rgba(255, 255, 255, 0.9); }
.ai-meta { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-meta:empty { display: none; }
.ai-meta-sep { opacity: .7; }
.ai-meta .skel--inline:first-child { width: 150px; }
.ai-meta .skel--inline + .skel--inline { width: 110px; }

/* ─── Discography: type label under each card comes from MusicBrainz ─── */
.ai-disc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 24px 16px 12px; }
.ai-disc-head .section-title { margin: 0; }
.ai-disc-note { font-size: 13px; color: var(--text-sub); }
.items-list > .ai-disc-chips { margin: 0 16px 8px; }

/* ─── About: matched ─── */
.ai-about { margin: 32px 16px; }
.ai-about-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.ai-bio { border-radius: var(--radius-card); background: var(--card-hover); overflow: hidden; }
.ai-bio-photo { display: block; width: 100%; height: 220px; object-fit: cover; object-position: center 25%; background: var(--elevated-2); }
.ai-bio-body { padding: 20px 24px 24px; }
.ai-bio-text {
  margin: 0; font-size: 15px; line-height: 1.7; color: #e6e6e6; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.ai-bio.is-open .ai-bio-text { display: block; -webkit-line-clamp: unset; overflow: visible; }
.ai-bio-toggle { margin-top: 12px; }
.ai-bio-source { margin-top: 16px; font-size: 12px; color: var(--text-muted); }
.ai-bio-source a { color: var(--text-sub); }

.ai-facts { margin: 0; padding: 8px 24px; border-radius: var(--radius-card); background: var(--card-hover); align-self: start; }
.ai-fact { padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.ai-fact:first-child { border-top: none; }
.ai-fact dt { font-size: 12px; font-weight: 700; color: var(--text-sub); }
.ai-fact dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; line-height: 1.5; }
.ai-fact dd.ai-fact-list { font-size: 14px; font-weight: 500; color: #e6e6e6; line-height: 1.7; }
.ai-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px !important; }
.ai-tag { padding: 4px 10px; border-radius: var(--radius-pill); background: var(--chip-bg); font-size: 12px; font-weight: 600; }

/* ─── About: loading skeleton ─── */
.ai-about.is-loading .ai-bio-photo { height: 220px; border-radius: 0; }
.ai-skel-lines { display: grid; gap: 10px; }
.ai-skel-lines .skel { height: 14px; }
.ai-skel-lines .skel:nth-child(2) { width: 92%; }
.ai-skel-lines .skel:nth-child(3) { width: 96%; }
.ai-skel-lines .skel:nth-child(4) { width: 60%; }
.ai-facts.is-loading { display: grid; gap: 22px; padding: 22px 24px; }
.ai-facts.is-loading .skel { height: 14px; }
.ai-facts.is-loading .skel:nth-child(odd) { height: 12px; width: 30%; }
.ai-facts.is-loading .skel:nth-child(even) { width: 65%; }
.ai-loading-note { margin: 12px 0 0; font-size: 12px; color: var(--text-muted); }

/* ─── About: no info (normal) / error (non-fatal) ─── */
.ai-notice {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 32px 16px; padding: 20px 24px;
  border-radius: var(--radius-card); background: var(--elevated);
}
.ai-notice svg { flex-shrink: 0; color: var(--text-sub); }
.ai-notice-text { flex: 1; min-width: 220px; }
.ai-notice-title { font-size: 15px; font-weight: 600; }
.ai-notice-sub { margin-top: 3px; font-size: 13px; color: var(--text-sub); }
.ai-notice--error { padding: 16px 20px; border: 1px solid rgba(241, 94, 108, 0.35); }
.ai-notice--error svg { color: var(--error); }
.ai-notice--error .ai-notice-sub { margin: 0; color: #d6d6d6; }

/* ─── Credits + admin row ─── */
.ai-credits {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin: 8px 16px 40px; padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.ai-credits a { color: var(--text-sub); }
.ai-credits a:hover { color: var(--text); }
.ai-admin { display: flex; gap: 6px; flex-wrap: wrap; }

/* ─── Fix-match dialog (inside the existing .modal-backdrop) ─── */
.fm-box { max-width: 560px; width: calc(100% - 32px); max-height: min(720px, 86vh); padding: 0; gap: 0; overflow: hidden; display: flex; flex-direction: column; }
.fm-head { padding: 24px 24px 0; }
.fm-sub { margin-top: 6px; font-size: 13px; color: var(--text-sub); }
.fm-sub code { font: 600 12px var(--mono); color: #d6d6d6; background: var(--chip-bg); padding: 2px 6px; border-radius: 4px; }
.fm-search { display: flex; gap: 8px; padding: 16px 24px 12px; }
.fm-search .set-input { flex: 1; min-width: 0; }
.fm-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 8px; display: grid; gap: 6px; align-content: start; }
.fm-option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border-radius: var(--radius-card);
  border: 1px solid transparent; background: var(--card-hover); cursor: pointer;
}
.fm-option:hover { background: var(--chip-bg); }
.fm-option:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.fm-option input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.fm-option-text { min-width: 0; flex: 1; }
.fm-option-name { display: block; font-size: 15px; font-weight: 700; }
.fm-option-dis { color: var(--text-sub); font-weight: 500; }
.fm-option-meta { display: block; margin-top: 4px; font-size: 12px; color: var(--text-sub); }
.fm-score { flex-shrink: 0; padding: 2px 7px; border-radius: 4px; background: var(--chip-bg); color: var(--text-dim); font-size: 11px; font-weight: 800; }
.fm-score--high { background: var(--accent-tint); color: var(--accent); }
.fm-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px 24px 20px; border-top: 1px solid var(--border); }
.fm-foot .fm-spacer { flex: 1; }
.fm-empty { padding: 24px 8px; text-align: center; font-size: 13px; color: var(--text-sub); }

/* ─── Responsive ─── */
@container main (max-width: 1000px) {
  .ai-about-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .artist-hero { min-height: 360px; flex-direction: column; align-items: flex-start; justify-content: flex-end; text-align: left; padding: 48px 20px 24px; }
  .artist-hero .album-detail-cover, .artist-hero .folder-hero-ph { width: 120px; height: 120px; }
  .ai-about, .ai-notice, .ai-credits { margin-left: 8px; margin-right: 8px; }
  .ai-disc-head { margin-left: 8px; margin-right: 8px; }
  .artist-hero .album-detail-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
  .ai-meta-sep--end { display: none; }
}
/* ═══════════════════════════════════════════════════════════════
   v7 — Synced lyrics
   Lyrics view (fills the area between top bar and player bar) ·
   live lyrics card in the Now Playing panel · mobile full-screen
   player lyrics tab.
   Append AFTER the v4, v5 and v6 blocks. Purely additive.
   Markup contract: HANDOFF-lyrics.md / preview-lyrics.html
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* JS sets --lyrics-tint on #lyrics-view, #npp-lyrics and
     #fullscreen-player from the cover colour (lyricsTint()). */
  --lyrics-tint: #1e3a72;
  --lyr-future: rgba(255, 255, 255, 0.42);  /* not sung yet */
  --lyr-past:   rgba(255, 255, 255, 0.7);   /* already sung */
  --lyr-plain:  rgba(255, 255, 255, 0.92);  /* unsynced text */
}

/* ─── Layout switch: the view replaces library + main + panel ─── */
.lyr-view[hidden] { display: none !important; }
.app-layout.lyrics-open > .sidebar,
.app-layout.lyrics-open > .main-panel,
.app-layout.lyrics-open > .np-panel,
.app-layout.lyrics-open > .sidebar-backdrop { display: none !important; }
#browser-screen.is-lyrics-fs .topbar { display: none; }

/* ─── Lyrics view ─── */
.lyr-view {
  flex: 1; min-width: 0; position: relative;
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius-panel);
  background: var(--lyrics-tint);
  transition: background-color .6s ease;
}
.lyr-head {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 24px 24px;
  background: linear-gradient(180deg, var(--lyrics-tint) 55%, transparent);
  pointer-events: none;                       /* let wheel/clicks reach the lines under the fade… */
}
.lyr-head > * { pointer-events: auto; }        /* …but keep the controls clickable */
.lyr-cover {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 4px; object-fit: cover;
  background: rgba(0, 0, 0, 0.25); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.lyr-head-text { flex: 1; min-width: 0; }
.lyr-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lyr-artist { margin-top: 2px; font-size: 13px; color: rgba(255, 255, 255, 0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lyr-artist .np-link { color: inherit; }
.lyr-badge {
  padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.22);
  font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.9); white-space: nowrap;
}
.lyr-badge:empty { display: none; }
.lyr-size { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.22); }
.lyr-size button {
  width: 32px; height: 28px; display: grid; place-items: center;
  border: none; border-radius: 999px; background: transparent; cursor: pointer;
  color: rgba(255, 255, 255, 0.75); font: 800 13px/1 var(--font);
}
.lyr-size button[data-lyr-size="m"] { font-size: 16px; }
.lyr-size button[data-lyr-size="l"] { font-size: 20px; }
.lyr-size button:hover { color: #fff; }
.lyr-size button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.22); color: #fff; }
.lyr-icon-btn {
  width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center;
  border: none; border-radius: 50%; background: none; cursor: pointer;
  color: rgba(255, 255, 255, 0.85); transition: color var(--transition-fast), transform var(--transition-fast);
}
.lyr-icon-btn:hover { color: #fff; transform: scale(1.06); }
.lyr-icon-btn:focus-visible, .lyr-size button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.lyr-scroll {
  position: relative; flex: 1; min-height: 0; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.lyr-body { max-width: 1040px; margin: 0 auto; padding: 88px 48px 45vh; }

/* text size (data-size on #lyrics-view, remembered per device) */
.lyr-view { --lyr-size: clamp(26px, 3.2vw, 40px); }
.lyr-view[data-size="s"] { --lyr-size: clamp(22px, 2.4vw, 30px); }
.lyr-view[data-size="l"] { --lyr-size: clamp(30px, 4vw, 52px); }

/* ─── Lines (shared by the view and the mobile player) ─── */
.lyr-lines {
  list-style: none; margin: 0; padding: 0;
  font-size: var(--lyr-size, 40px); font-weight: 800; line-height: 1.22; letter-spacing: -0.02em;
  text-wrap: pretty; overflow-wrap: anywhere;
}
.lyr-line { margin: 0 0 0.5em; color: var(--lyr-future); transition: color .35s ease; }
.lyr-line.is-past { color: var(--lyr-past); }
.lyr-line.is-current { color: #fff; }
.lyr--plain .lyr-line { color: var(--lyr-plain); }
.lyr-space { height: 0.5em; }
.lyr-btn {
  display: block; width: 100%; padding: 0; margin: 0;
  border: none; background: none; color: inherit; cursor: pointer; text-align: left;
  font: inherit; letter-spacing: inherit; line-height: inherit;
}
.lyr-btn:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.18em; }
.lyr-btn:focus-visible { outline: 2px solid #fff; outline-offset: 6px; border-radius: 4px; }

/* instrumental break */
.lyr-dots { display: inline-flex; align-items: center; gap: 0.22em; height: 1.22em; }
.lyr-dots span, .npp-dots span { display: block; width: 0.28em; height: 0.28em; border-radius: 50%; background: currentColor; }
.is-current .lyr-dots span, .npp-dots.is-current span { animation: lyrDot 1.2s ease-in-out infinite; }
.is-current .lyr-dots span:nth-child(2), .npp-dots.is-current span:nth-child(2) { animation-delay: .2s; }
.is-current .lyr-dots span:nth-child(3), .npp-dots.is-current span:nth-child(3) { animation-delay: .4s; }
@keyframes lyrDot { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }

/* notes, credit, loading, empty */
.lyr-note {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 28px; padding: 8px 14px;
  border-radius: 999px; background: rgba(0, 0, 0, 0.22);
  font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.9);
}
.lyr-note svg { flex-shrink: 0; }
.lyr-credit { margin: 56px 0 0; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.75); }
.lyr-credit a { color: inherit; text-decoration: underline; }
.lyr-loading { display: flex; flex-direction: column; gap: 22px; padding-top: 8px; }
.lyr-skel {
  display: block; height: calc(var(--lyr-size, 40px) * 1.05); border-radius: 10px;
  background: linear-gradient(90deg, rgba(255,255,255,.10) 25%, rgba(255,255,255,.20) 50%, rgba(255,255,255,.10) 75%);
  background-size: 200% 100%; animation: lyrSkel 1.4s linear infinite;
}
@keyframes lyrSkel { to { background-position: -200% 0; } }
.lyr-status { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.8); }
.lyr-empty {
  min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; color: rgba(255, 255, 255, 0.92);
}
.lyr-empty > svg { opacity: .55; }
.lyr-empty-title { margin: 4px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.lyr-empty-sub { margin: 0; max-width: 420px; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, 0.8); }
.lyr-empty .btn-outline { margin-top: 12px; border-color: rgba(255, 255, 255, 0.7); color: #fff; }

/* "Back to current line" (appears after the user scrolls away) */
.lyr-pill {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px;
  border: none; border-radius: 999px; background: #fff; color: #000; cursor: pointer; white-space: nowrap;
  font: 700 14px var(--font); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.lyr-pill[hidden] { display: none; }
.lyr-pill:hover { transform: translateX(-50%) scale(1.04); }

/* ─── Player bar mic button: uses the existing .np-btn-sm.active dot ─── */
@media (min-width: 768px) and (max-width: 1179px) {
  #np-lyrics-btn.np-desktop-only { display: flex; }   /* lyrics view works on tablets too */
}

/* ─── Now Playing panel card ─── */
.npp-card--lyrics { background: var(--lyrics-tint); transition: background-color .6s ease; }
.npp-card--lyrics .npp-card-head .npp-card-sub { flex: 1; }
.npp-icon-btn {
  width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center;
  border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.22); color: #fff; cursor: pointer;
  transition: transform var(--transition-fast);
}
.npp-icon-btn:hover { transform: scale(1.06); }
button.npp-lyrics-lines {
  width: 100%; padding: 0; border: none; background: none; text-align: left; cursor: pointer;
  font-family: var(--font); letter-spacing: -0.2px; color: inherit;
}
button.npp-lyrics-lines:hover > span { text-decoration: underline; text-underline-offset: 4px; }
button.npp-lyrics-lines:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 4px; }
.npp-lyrics-lines > span { transition: color .35s ease; }
.npp-lyrics-lines .is-past { color: var(--lyr-past); }        /* was .55 in v4 */
.npp-lyrics-lines .is-next { color: var(--lyr-future); }
.npp-lyrics-lines .is-plain { color: var(--lyr-plain); }
.npp-dots { display: inline-flex; align-items: center; gap: 5px; height: 26px; font-size: 20px; }
.npp-lyrics-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.npp-lyrics-foot .npp-card-sub { flex: 1; min-width: 0; }
.npp-lyrics-skel { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.npp-lyrics-skel .lyr-skel { height: 22px; }

/* ─── Mobile full-screen player: Lyrics tab ─── */
.fs-player.is-lyrics { background: var(--lyrics-tint); }
.fs-player.is-lyrics .fs-bg { display: none; }
.fs-player.is-lyrics .fs-scrim {
  background: linear-gradient(180deg, var(--lyrics-tint) 0%, var(--lyrics-tint) 70%, rgba(0, 0, 0, 0.55) 100%);
  transition: background .6s ease;
}
.fs-lyrics {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 40px, #000 calc(100% - 56px), transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0, #000 40px, #000 calc(100% - 56px), transparent 100%);
}
.fs-lyrics-content.lyr { padding: 24px 4px 45%; font-size: inherit; line-height: inherit; color: inherit; }
.fs-lyrics .lyr-lines { --lyr-size: 26px; }
.fs-lyrics .lyr-note { margin-bottom: 20px; font-size: 12px; padding: 8px 12px; }
.fs-lyrics .lyr-credit { margin-top: 40px; font-size: 12px; }
.fs-lyrics .lyr-skel { height: 28px; }
.fs-lyrics .lyr-empty { min-height: 100%; }
.fs-lyrics .lyr-empty-title { font-size: 22px; }
.fs-stage .lyr-pill { bottom: 16px; font-size: 13px; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .lyr-badge, .lyr-size { display: none; }
  .lyr-body { padding-left: 24px; padding-right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .lyr-line, .npp-lyrics-lines > span, .lyr-view, .npp-card--lyrics { transition: none; }
  .is-current .lyr-dots span, .npp-dots.is-current span, .lyr-skel { animation: none; }
}

/* ── Port fix (not in lyrics.css): the design toggles #npp-lyrics-lines and
   #npp-lyrics-open with the `hidden` attribute, but v4 styles both with an
   author `display` value (.npp-lyrics-lines { display: flex } / .btn-pill
   { display: inline-flex }) — author rules beat the UA [hidden] rule, so
   without these they never hide. ── */
.npp-lyrics-lines[hidden] { display: none; }
.npp-lyrics-foot .btn-pill[hidden] { display: none; }
/* ═══════════════════════════════════════════════════════════════
   v8 — Phone layout (≤ 767 px)
   Matches the "Mobile ·" artboards on the design canvas.
   Append LAST in styles.css (after v4, v5, v6, v7). Purely additive:
   desktop is untouched except the few new elements at the top,
   which are hidden or neutral above 767 px.
   Markup contract: HANDOFF-mobile.md / mobile-app.html
   ═══════════════════════════════════════════════════════════════ */

/* ─── New elements: defaults (desktop) ─── */
.m-back, .sheet-grip, .sheet-head { display: none; }
.fs-more { display: none; }

/* Search: optional "Top result" card (works on desktop too) */
.search-top-card {
  display: flex; align-items: center; gap: 16px; width: 100%; max-width: 480px;
  padding: 16px; border: none; border-radius: var(--radius-card);
  background: var(--card-hover); color: var(--text); text-align: left; cursor: pointer;
  font-family: var(--font); transition: background var(--transition-fast);
}
.search-top-card:hover { background: var(--chip-bg); }
.search-top-cover { width: 72px; height: 72px; flex-shrink: 0; border-radius: 6px; object-fit: cover; background: var(--elevated-2); }
.search-top-cover.is-round { border-radius: 50%; }
.search-top-text { flex: 1; min-width: 0; }
.search-top-name { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-top-sub { display: block; margin-top: 4px; font-size: 13px; color: var(--text-sub); }
.search-top-play {
  width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: #000; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}
.search-chips { margin-bottom: 8px; }
[data-search-group][hidden], .search-top[hidden] { display: none; }

@keyframes mSheetUp { from { transform: translateY(100%); } to { transform: none; } }

@media (max-width: 767px) {
  :root { --m-gutter: 16px; --m-mini-h: 58px; --mnav-h: 64px; }
  .main-panel { background: var(--panel); }

  /* ═══ Top bar: avatar · search pill ═══ */
  .topbar { height: 60px; gap: 12px; padding: 0 var(--m-gutter); }
  .topbar-left { display: none; }
  .topbar-right { order: -1; min-width: 0; width: auto; gap: 0; }
  .topbar-right > :not(#btn-settings) { display: none !important; }
  .topbar-avatar { width: 36px; height: 36px; padding: 0; background: none; }
  .topbar-avatar .avatar { --av: 34px; font-size: 14px; }
  .topbar-center { flex: 1; min-width: 0; }
  .topbar-search { height: 40px; max-width: none; padding: 0 14px; gap: 10px; background: var(--chip-bg); border-width: 0; }
  .topbar-search:focus-within { border-width: 2px; }
  .topbar-search-input { font-size: 15px; }                 /* ≥ 15–16px stops iOS zooming in */
  .profile-menu { top: 56px; }

  /* ═══ Bottom nav ═══ */
  .mobile-nav {
    height: calc(var(--mnav-h) + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.92) 38%, #000 100%);
    backdrop-filter: none; -webkit-backdrop-filter: none; border-top: 0; padding-top: 10px;
  }
  .mnav-item { color: var(--text-sub); font-size: 10.5px; font-weight: 600; min-height: 48px; }
  .mnav-item.active { color: #fff; font-weight: 700; }
  .mnav-item.active svg { stroke-width: 2.5; }

  /* ═══ Mini player (floats above the nav, tinted like the lyrics) ═══ */
  .now-playing {
    left: 8px; right: 8px; height: var(--m-mini-h);
    bottom: calc(var(--mnav-h) + env(safe-area-inset-bottom, 0px) + 2px);
    padding: 0 4px 0 8px; gap: 0; overflow: hidden;
    border: 0; border-radius: 8px;
    background: var(--lyrics-tint, #2a2a2a);
    backdrop-filter: none; -webkit-backdrop-filter: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    transition: background-color .6s ease;
  }
  .np-left { gap: 10px; cursor: pointer; }                   /* tap → full-screen player */
  .np-cover { width: 42px; height: 42px; border-radius: 4px; }
  .np-title { font-size: 13px; font-weight: 700; }
  .np-artist { font-size: 12px; color: rgba(255, 255, 255, 0.75); }
  .np-artist .np-link { pointer-events: none; }             /* the whole bar opens the player */
  .np-left .np-btn-like { width: 44px; height: 44px; margin-left: 0; }
  .np-left .np-btn-like svg { width: 22px; height: 22px; }
  .np-center { display: flex; flex: 0 0 auto; flex-direction: row; gap: 0; position: static; }
  .np-controls { gap: 0; }
  .np-controls > :not(#np-play-btn) { display: none; }
  #np-play-btn { width: 44px; height: 44px; background: none; color: #fff; box-shadow: none; }
  #np-play-btn svg { width: 26px; height: 26px; }
  .np-time-row { position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; gap: 0; padding: 0; }
  .np-time { display: none; }
  .np-progress-click { height: 2px; background: rgba(255, 255, 255, 0.25); pointer-events: none; }
  .np-progress-click-fill { height: 2px; }
  .np-progress-click-fill::after { display: none; }
  .np-right { display: none; }
  #browser-screen .app-layout {
    padding-bottom: calc(var(--m-mini-h) + var(--mnav-h) + env(safe-area-inset-bottom, 0px) + 8px);
  }

  /* ═══ Shared page furniture ═══ */
  .filter-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-chips .chip { flex-shrink: 0; height: 32px; }
  .page-head { margin: 8px var(--m-gutter) 12px !important; gap: 8px; }
  .page-title { font-size: 24px; letter-spacing: -0.5px; }
  .items-list > .filter-chips { margin: 0 0 14px !important; padding: 0 var(--m-gutter); }
  .section-title, .home-section-title { font-size: 20px; letter-spacing: -0.4px; }
  .section-head { margin-left: var(--m-gutter); margin-right: var(--m-gutter); }
  .card-play-btn, .card-more-btn { display: none !important; }   /* no hover on phones: tap the card */

  /* ═══ Home ═══ */
  .home-view { padding: 4px 0 20px; }
  .home-view > .filter-chips { padding: 0 var(--m-gutter); margin-bottom: 8px; }
  .home-greeting { margin: 8px var(--m-gutter) 14px; font-size: 24px; letter-spacing: -0.5px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 var(--m-gutter) 28px; }
  .quick-tile { height: 56px; border-radius: 4px; }
  .quick-title { font-size: 13px; }
  .home-section { margin-bottom: 28px; }
  .home-section-header { padding: 0 var(--m-gutter); margin-bottom: 12px; }
  .home-horizontal-scroll { grid-auto-columns: 140px; gap: 14px; padding: 0 var(--m-gutter); margin: 0; scrollbar-width: none; }
  .home-horizontal-scroll::-webkit-scrollbar { display: none; }
  .home-horizontal-scroll:has(.recent-card--round) { grid-auto-columns: 120px; }
  .recent-card, .home-horizontal-scroll .playlist-card { padding: 0; background: none !important; }
  .recent-card-title, .playlist-card-name { font-size: 13px; margin-top: 8px; }
  .recent-card--round .recent-card-title { text-align: center; }
  .folder-tile-grid { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; }
  .folder-tile { border-radius: 0; background: none; padding: 8px var(--m-gutter); min-height: 64px; }
  .folder-tile-ico { width: 48px; height: 48px; }

  /* ═══ Albums (and any folder grid): two full-width columns ═══ */
  .folder-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px;
    padding: 0 var(--m-gutter); margin: 0; justify-content: stretch;
  }
  .folder-card { padding: 0; background: none !important; }
  .folder-card .card-cover-wrap { margin-bottom: 8px; }
  .folder-card .album-card-title { font-size: 13px; font-weight: 600; line-height: 1.3; white-space: normal;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .folder-card .album-card-artist { font-size: 12px; margin-top: 3px; }
  .folder-card-grid.is-list { padding: 0; gap: 0; }
  .folder-card-grid.is-list .folder-card { padding: 6px var(--m-gutter); grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; }
  .folder-card-grid.is-list .card-cover-wrap { width: 56px; height: 56px; }
  .folder-card-grid.is-list .album-card-cover, .folder-card-grid.is-list .album-card-placeholder { width: 56px; height: 56px; }
  .folder-card-grid.is-list .album-card-title { font-size: 15px; font-weight: 500; -webkit-line-clamp: 1; }

  /* ═══ Artists: list rows with round photos + A–Z rail ═══ */
  .folder-card-grid:has(> .folder-card--artist):not(.shelf) { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 28px 0 0; }
  .folder-card-grid:not(.shelf) > .folder-card--artist {
    display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px;
    align-items: center; padding: 6px 0 6px var(--m-gutter); position: relative;
  }
  .folder-card-grid:not(.shelf) > .folder-card--artist .card-cover-wrap { grid-row: 1 / 3; width: 56px; height: 56px; margin: 0; }
  .folder-card-grid:not(.shelf) > .folder-card--artist .album-card-cover,
  .folder-card-grid:not(.shelf) > .folder-card--artist .album-card-placeholder { width: 56px; height: 56px; box-shadow: none; }
  .folder-card-grid:not(.shelf) > .folder-card--artist .album-card-title { margin: 0; align-self: end; font-size: 15px; font-weight: 500; -webkit-line-clamp: 1; }
  .folder-card-grid:not(.shelf) > .folder-card--artist .album-card-artist { align-self: start; }
  .folder-card-grid:not(.shelf) > .folder-card--artist .card-follow-btn { top: 4px; left: 12px; width: 20px; height: 20px; }
  .shelf { gap: 12px; padding: 0 var(--m-gutter); margin: 0 0 8px; grid-auto-columns: 104px; }
  .shelf .folder-card--artist .album-card-title { text-align: center; -webkit-line-clamp: 1; }
  .shelf .folder-card--artist .album-card-artist { display: none; }
  .az-head { margin: 14px var(--m-gutter) 4px; }
  .az-bar {
    position: fixed; z-index: 4; right: 2px; top: 132px;
    flex-direction: column; flex-wrap: nowrap; gap: 0; padding: 4px 0; width: 22px;
  }
  .az-link { width: 22px; height: 15px; min-width: 0; padding: 0; font-size: 10px; line-height: 15px; text-align: center; border-radius: 4px; }

  /* ═══ Album / folder page ═══ */
  .album-detail-header { position: relative; }
  .m-back {
    display: grid; place-items: center; position: absolute; z-index: 3; top: 8px; left: 8px;
    width: 40px; height: 40px; border: none; border-radius: 50%;
    background: rgba(0, 0, 0, 0.35); color: #fff; cursor: pointer;
  }
  .album-detail-header.folder-hero:not(.artist-hero) {
    flex-direction: column; align-items: stretch; text-align: left; gap: 20px;
    padding: 60px var(--m-gutter) 12px; margin: 0;
  }
  .folder-hero:not(.artist-hero) .album-detail-cover,
  .folder-hero:not(.artist-hero) .folder-hero-ph { width: 240px; height: 240px; align-self: center; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55); }
  .folder-hero:not(.artist-hero) .album-detail-label { display: none; }
  .folder-hero:not(.artist-hero) .album-detail-title,
  .folder-hero:not(.artist-hero) .album-detail-title.is-long { font-size: 24px; letter-spacing: -0.5px; line-height: 1.15; margin: 0; }
  .album-detail-meta { justify-content: flex-start; flex-wrap: wrap; font-size: 13px; row-gap: 4px; }
  .album-detail-actions { justify-content: flex-start; gap: 4px; padding: 4px 12px 8px; margin: 0 !important; }
  .album-detail-actions > * { order: 1; }
  .album-detail-actions .folder-shuffle-btn,
  .album-detail-actions .favorites-shuffle-btn { order: 2; margin-left: auto; }
  .album-detail-actions .album-play-all-btn { order: 3; width: 56px; height: 56px; }
  .hero-icon-btn { width: 44px; height: 44px; }

  /* Song rows: title + artist + ⋯ (always visible) */
  .track-head { display: none; }
  .track-list { padding: 0; }
  .track-row { min-height: 56px; padding: 4px 4px 4px var(--m-gutter); gap: 12px; border-radius: 0; }
  .track-row:hover { background: none; }
  .track-row:active { background: rgba(255, 255, 255, 0.06); }
  .track-row .track-num { display: none; }
  .artist-top .track-row .track-num { display: flex; width: 22px; }
  .track-row .item-name { font-size: 15px; }
  .track-row .item-meta { font-size: 13px; margin-top: 3px; }
  .item-quality, .item-duration, .item-plays, .item-album, .item-date { display: none !important; }
  .row-like { display: none; }
  .row-like.liked { display: grid; opacity: 1; width: 20px; margin: 0; }
  .row-like.liked svg { width: 14px; height: 14px; }
  .track-row .btn-more { opacity: 1 !important; width: 40px; height: 44px; flex-shrink: 0; color: var(--text-dim); }
  .track-row .item-thumb { width: 48px; height: 48px; border-radius: 4px; }
  .items-list > .subhead { margin: 20px var(--m-gutter) 12px; }

  /* ═══ Artist page (v6 online info) ═══ */
  .album-detail-header.artist-hero {
    min-height: 0; flex-direction: column; align-items: flex-start; justify-content: flex-start;
    text-align: left; gap: 14px; padding: 136px var(--m-gutter) 4px; margin: 0;
  }
  .artist-hero .hero-banner { bottom: auto; height: 220px; }
  .artist-hero .hero-banner::after { background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 40%, var(--panel) 100%); }
  .artist-hero .album-detail-cover, .artist-hero .folder-hero-ph {
    width: 112px; height: 112px; box-shadow: 0 0 0 4px var(--panel), 0 12px 32px rgba(0, 0, 0, 0.5);
  }
  .artist-hero .album-detail-label { font-size: 12px; color: var(--text-dim); }
  .artist-hero .album-detail-title { font-size: 40px; letter-spacing: -1.2px; line-height: 1.05; margin: 2px 0 6px; }
  .artist-hero .album-detail-meta { flex-direction: column; align-items: flex-start; gap: 3px; }
  .artist-hero .ai-meta-sep--end { display: none; }
  .album-detail-header > .m-back { position: absolute; z-index: 3; }   /* beats v6 ".artist-hero > :not(.hero-banner)" */
  .folder-hero-actions .hero-follow-btn { order: 1; }
  .folder-hero-actions .hero-icon-btn { order: 1; }
  .artist-top { grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 12px 0 24px; }
  .artist-top > section > .section-title { margin: 0 var(--m-gutter) 6px; }
  .artist-top > aside { margin: 0 var(--m-gutter); }
  .artist-top > aside > .section-title { display: none; }
  .side-card { width: 100%; }
  .ai-disc-head { margin: 0 var(--m-gutter) 12px; }
  .items-list > .ai-disc-chips { margin: 0 0 14px !important; padding: 0 var(--m-gutter); }
  .ai-disc-chips + .folder-card-grid,
  .ai-disc-head + .folder-card-grid,
  .artist-top ~ .folder-card-grid {
    display: grid; grid-auto-flow: column; grid-auto-columns: 140px; grid-template-columns: none;
    overflow-x: auto; scrollbar-width: none; gap: 14px;
  }
  .ai-about, .ai-notice, .ai-credits { margin-left: var(--m-gutter); margin-right: var(--m-gutter); }
  .ai-about-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ai-bio-photo { height: 180px; }
  .ai-credits { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ai-admin { flex-wrap: wrap; }

  /* ═══ Favorites ═══ */
  .favorites-view { padding: 0 0 20px; }
  .album-detail-header.favorites-hero {
    flex-direction: row; align-items: flex-end; text-align: left; gap: 16px;
    padding: 12px var(--m-gutter) 0; margin: 0;
  }
  .favorites-cover { width: 120px; height: 120px; flex-shrink: 0; }
  .favorites-cover svg { width: 52px; height: 52px; }
  .favorites-hero .album-detail-label { font-size: 12px; }
  .favorites-hero .album-detail-title { font-size: 34px; letter-spacing: -1px; margin: 2px 0 6px; }
  .favorites-meta-row { font-size: 13px; flex-wrap: wrap; }
  .favorites-view > .album-detail-actions { padding: 12px 12px 8px; }
  .favorites-view .actions-right { order: 0; margin: 0; }
  .favorites-view > .filter-chips { padding: 0 var(--m-gutter); margin-bottom: 8px; }

  /* ═══ Playlists: list rows ═══ */
  .playlists-view { padding: 0 0 20px; }
  .playlists-view .page-head .btn-pill { height: 36px; padding: 0 14px; font-size: 13px; }
  .playlist-grid { display: flex; flex-direction: column; gap: 0; margin: 0; }
  .playlist-grid > .playlist-card, .playlist-grid > .fav-tile, .playlist-grid > .new-playlist-card {
    display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px;
    align-items: center; min-height: 0; height: auto; aspect-ratio: auto;
    padding: 6px var(--m-gutter); margin: 0; border: 0; border-radius: 0; background: none !important; text-align: left;
  }
  .playlist-grid > .playlist-card .card-cover-wrap { grid-row: 1 / 3; width: 64px; height: 64px; margin: 0; }
  .playlist-grid > .playlist-card .pl-cover { width: 64px; height: 64px; border-radius: 4px; }
  .playlist-grid > .playlist-card .playlist-card-name { margin: 0; align-self: end; font-size: 15px; font-weight: 500; }
  .playlist-grid > .playlist-card .playlist-card-meta { align-self: start; margin-top: 3px; font-size: 13px; }
  .playlist-grid > .fav-tile { position: relative; overflow: visible; }
  .playlist-grid > .fav-tile { filter: none !important; }
  .playlist-grid > .fav-tile .fav-tile-bg {
    position: static; grid-row: 1 / 3; width: 64px; height: 64px; padding: 18px; box-sizing: border-box; opacity: 1;
    border-radius: 4px; background: linear-gradient(135deg, var(--fav-purple), #8f7ad6); color: #fff;
  }
  .playlist-grid > .fav-tile .fav-tile-bg svg { width: 100%; height: 100%; }
  .playlist-grid > .fav-tile .card-play-btn { display: none; }
  .playlists-view .page-head .view-toggle, #new-playlist-btn { display: none; }   /* list only; "New playlist" row is in the list */
  .playlist-grid > .fav-tile .fav-tile-snippet { display: none; }
  .playlist-grid > .fav-tile .fav-tile-title { position: static; align-self: end; font-size: 15px; font-weight: 500; letter-spacing: 0; }
  .playlist-grid > .fav-tile .fav-tile-sub { position: static; align-self: start; margin-top: 3px; font-size: 13px; color: var(--text-sub); }
  .playlist-grid > .new-playlist-card { order: -1; grid-template-rows: auto; color: var(--text); font-size: 15px; font-weight: 600; }
  .playlist-grid > .new-playlist-card > svg, .playlist-grid > .new-playlist-card > .new-playlist-ico {
    width: 64px; height: 64px; padding: 18px; box-sizing: border-box; border-radius: 4px; background: var(--chip-bg);
  }

  /* ═══ Search ═══ */
  .search-results { padding: 8px 0 28px; }
  .search-results > .search-chips { padding: 0 var(--m-gutter); margin-bottom: 12px; }
  .search-section { margin-bottom: 20px; }
  .search-section-title { margin: 0 var(--m-gutter) 10px; font-size: 18px; }
  .search-top { padding: 0 var(--m-gutter); }
  .search-top .search-section-title { margin-left: 0; }
  .search-results .items-list .item { padding: 4px 4px 4px var(--m-gutter); min-height: 56px; }
  .search-results .item .btn-play { display: none; }
  .search-results .item .btn-more { opacity: 1; width: 40px; height: 44px; }
  .search-grid {
    display: grid; grid-auto-flow: column; grid-auto-columns: 130px; grid-template-columns: none;
    gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 0 var(--m-gutter);
  }
  .search-grid .recent-card { width: auto; padding: 0; background: none; }
  .search-grid .recent-card-title { font-size: 13px; }

  /* ═══ Song / item menu → bottom sheet (all .dropdown menus) ═══ */
  .dropdown-backdrop { background: rgba(0, 0, 0, 0.6); }
  .dropdown {
    left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important;
    width: auto !important; min-width: 0; max-height: 80vh; overflow-y: auto;
    padding: 8px 0 calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 14px 14px 0 0; animation: mSheetUp .22s ease-out;
  }
  .dropdown-item { min-height: 52px; padding: 0 20px; font-size: 15px; border-radius: 0; }
  .sheet-grip { display: block; width: 36px; height: 4px; margin: 0 auto 10px; border-radius: 2px; background: #5a5a5a; }
  .sheet-head {
    display: flex; align-items: center; gap: 12px; padding: 4px 20px 14px; margin-bottom: 6px;
    border-bottom: 1px solid var(--border-hr);
  }
  .sheet-head-art { width: 48px; height: 48px; border-radius: 4px; object-fit: cover; background: var(--elevated); flex-shrink: 0; }
  .sheet-head-text { min-width: 0; }
  .sheet-head-title { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sheet-head-sub { display: block; margin-top: 3px; font-size: 13px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* ═══ Full-screen player: scroll down for lyrics, queue, file ═══ */
  .fs-player { background: var(--lyrics-tint, var(--panel)); }       /* no cover yet → still opaque */
  .fs-inner { overflow-y: auto; scrollbar-width: none; padding-left: 24px; padding-right: 24px; }
  .fs-inner::-webkit-scrollbar { display: none; }
  .fs-inner > * { flex-shrink: 0; }
  .fs-stage { flex: 0 0 auto; height: min(calc(100vw - 48px), 52vh); margin: 20px 0 24px; }
  .fs-art-wrap { max-width: 100%; }
  .fs-art, .fs-art-ph { border-radius: 10px; }
  .fs-player.panel-open .fs-inner { overflow: hidden; }
  .fs-player.panel-open .fs-stage { flex: 1 1 auto; height: auto; }
  .fs-player.panel-open .fs-more { display: none; }
  .fs-more { display: block; margin-top: 26px; padding-bottom: 8px; }
  .fs-card { border-radius: 10px; background: rgba(0, 0, 0, 0.28); padding: 16px; margin-bottom: 12px; }
  .fs-card--lyrics { background: var(--lyrics-tint); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06); }
  .fs-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-size: 15px; font-weight: 700; }
  .fs-card-sub { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.75); }
  .fs-card .link-btn { color: #d6d6d6; font-size: 13px; font-weight: 700; }
  .fs-more-lines { margin-bottom: 16px; }
  .fs-more .npp-row { width: calc(100% + 12px); }

  /* ═══ Settings ═══ */
  .set-wrap { background: none; }
  .set-body { padding: 8px var(--m-gutter) 24px; }
  .set-profile { gap: 16px; padding: 16px; border-radius: 12px; background: linear-gradient(135deg, #3a2a10, var(--card-hover)); }
  .set-profile .avatar--112 { --av: 64px; font-size: 28px; }
  .set-profile-name { font-size: 22px; }
  .set-card { border-radius: 10px; }
  .set-row { gap: 16px; align-items: center; }
  .set-row .switch { flex-shrink: 0; margin-left: auto; }
  .set-list-row { flex-wrap: wrap; row-gap: 8px; }
  .set-list-actions { width: 100%; padding-left: 52px; }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .dropdown { animation: none; }
  .now-playing { transition: none; }
}
