/* ═══════════════════════════════════════════════════════
   VARIABLES & RESET
═══════════════════════════════════════════════════════ */
:root {
  --green: #1DB954;
  --green-dim: #1aa34a;
  --bg: #0a0a0a;
  --surface: #121212;
  --surface2: #181818;
  --surface3: #242424;
  --surface4: #2a2a2a;
  --text: #ffffff;
  --text-muted: #b3b3b3;
  --text-dim: #6a6a6a;
  --border: rgba(255,255,255,0.07);
  --player-h: 90px;
  --sidebar-w: 72px;
  --nav-h: 60px;
  --radius: 10px;
  --transition: 0.2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ═══════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr var(--player-h);
  height: 100vh;
}
.sidebar {
  grid-row: 1;
  grid-column: 1;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 8px;
  border-right: 1px solid var(--border);
  z-index: 10;
}
.main {
  grid-row: 1;
  grid-column: 2;
  overflow-y: auto;
  background: linear-gradient(180deg, #1a1a1a 0%, var(--bg) 300px);
  position: relative;
}
.player-bar {
  grid-row: 2;
  grid-column: 1 / -1;
  background: #0d0d0d;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  z-index: 20;
}

/* ═══════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════ */
.logo-mark {
  width: 60px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.logo-mark img {
  width: 36px; height: 36px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
.sidebar-btn {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.sidebar-btn:hover { background: var(--surface3); color: var(--text); }
.sidebar-btn.active { background: var(--surface3); color: var(--green); }
.sidebar-btn svg { width: 22px; height: 22px; }
.sidebar-btn .tip {
  position: absolute;
  left: calc(100% + 8px);
  background: #333;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-4px);
  transition: 0.15s;
  z-index: 100;
}
.sidebar-btn:hover .tip { opacity: 1; transform: translateX(0); }
.sidebar-spacer { flex: 1; }
.user-avatar {
  width: 36px; height: 36px;
  background: var(--green);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #000;
  cursor: pointer;
  position: relative;
}
/* ═══════════════════════════════════════════════════════
   SEARCH VIEW
═══════════════════════════════════════════════════════ */
.search-panel {
  padding: 24px 24px 40px;
  width: 100%;
  box-sizing: border-box;
}
.search-bar {
  display: flex;
  gap: 0;
  background: var(--surface3);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  padding: 14px 18px;
  font-family: inherit;
}
.search-input::placeholder { color: var(--text-dim); }
.search-go-btn {
  background: var(--accent);
  border: none;
  color: #000;
  width: 56px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.search-go-btn:hover { background: #1ed760; }
.search-go-btn svg { width: 22px; height: 22px; }
.search-status {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
  min-height: 18px;
  padding: 0 4px;
}

/* Results table header */
.sr-table-head {
  display: grid;
  grid-template-columns: 48px 48px 2fr 1.5fr 80px 64px 1fr;
  gap: 0 12px;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.sr-th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.search-results { display: flex; flex-direction: column; gap: 1px; width: 100%; }

/* Result row: № | cover | title+sub | album | format | duration | path */
.sr-item {
  display: grid;
  grid-template-columns: 48px 48px 2fr 1.5fr 80px 64px 1fr;
  align-items: center;
  gap: 0 12px;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
/* ── Search result rows ── */
.sr-item:hover { background: var(--surface3); }

/* Default: number visible, arrow+bars hidden */
.sr-num {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  position: relative;
  width: 36px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sr-num-label { transition: opacity 0.15s; }

/* Arrow — always green, hidden by default */
.sr-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  color: #1db954;
}
/* Bars — hidden by default */
.sr-bars {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

/* HOVER (non-playing): hide number, show green arrow */
.sr-item:not(.sr-playing):hover .sr-num-label { opacity: 0; }
.sr-item:not(.sr-playing):hover .sr-play    { opacity: 1; }

/* PLAYING (not paused): hide number+arrow, show bars */
.sr-item.sr-playing:not(.paused) .sr-num-label { opacity: 0; }
.sr-item.sr-playing:not(.paused) .sr-play      { opacity: 0; }
.sr-item.sr-playing:not(.paused) .sr-bars      { opacity: 1; }

/* PLAYING + PAUSED: green number, no bars, no arrow */
.sr-item.sr-playing.paused .sr-num-label { opacity: 1; color: #1db954; }
.sr-item.sr-playing.paused .sr-bars      { opacity: 0; }
.sr-item.sr-playing.paused .sr-play      { opacity: 0; }

/* PLAYING hover: never show arrow */
.sr-item.sr-playing:hover .sr-play { opacity: 0; }

/* Title green when playing */
.sr-item.sr-playing .sr-title      { color: #1db954; }
.sr-item.sr-playing .sr-sub        { color: #1db954; }
.sr-item.sr-playing .sr-album-cell { color: #1db954; }
.sr-item.sr-playing .sr-format     { color: #1db954; background: rgba(29,185,84,0.12); }
.sr-item.sr-playing .sr-duration   { color: #1db954; }
.sr-item.sr-playing .sr-path       { color: #1db954; opacity: 0.7; }

/* Cover thumbnail */
.sr-cover {
  width: 40px; height: 40px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface4);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.sr-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.sr-cover-none {
  width: 40px; height: 40px;
  border-radius: 5px;
  background: var(--surface4);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  flex-shrink: 0;
}

.sr-info { min-width: 0; }
.sr-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sr-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.sr-sub em, .sr-title em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}
.sr-album-cell {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sr-album-cell em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}
.sr-format {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: var(--surface4);
  border-radius: 4px;
  padding: 2px 7px;
  text-transform: uppercase;
  width: fit-content;
}
.sr-duration {
  font-size: 13px;
  color: var(--text-dim);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sr-path {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: monospace;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════
   ABOUT MODAL
═══════════════════════════════════════════════════════ */
.about-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.about-overlay.open { opacity: 1; pointer-events: all; }
.about-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 48px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  transform: translateY(12px);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}
.about-overlay.open .about-box { transform: translateY(0); }
.about-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.about-close:hover { background: var(--surface4); color: var(--text); }
.about-logo {
  width: 288px; height: 288px;
  object-fit: contain;
  margin: 0 auto 20px;
  display: block;
  filter: drop-shadow(0 4px 18px rgba(29,185,84,0.35));
}
.about-title {
  font-size: 26px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.about-subtitle {
  font-size: 13px; color: var(--accent);
  font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.about-sep {
  height: 1px; background: var(--border);
  margin: 20px 0;
}
.about-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
  padding: 4px 0;
}
.about-row-label { color: var(--text-muted); }
.about-row-value { color: var(--text); font-weight: 500; }
.about-author-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--accent) 0%, #1ed760 100%);
  color: #000;
  font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
  letter-spacing: 0.3px;
}

.user-menu {
  position: absolute;
  bottom: 50px; left: 8px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  min-width: 180px;
  z-index: 999;
  display: none;
}
.user-menu.open { display: block; }
.user-menu-item {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.user-menu-item:hover { background: var(--surface4); color: var(--text); }
.user-menu-sep { height: 1px; background: var(--border); margin: 6px 0; }

/* ═══════════════════════════════════════════════════════
   TOP NAV
═══════════════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0;
  display: flex; align-items: center;
  padding: 14px 24px;
  gap: 12px;
  background: rgba(10,10,10,0.8);
  backdrop-filter: blur(12px);
  z-index: 5;
  border-bottom: 1px solid var(--border);
}
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  flex: 1;
  font-size: 15px;
  overflow: hidden;
}
.breadcrumb-item {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.15s;
}
.breadcrumb-item:hover { color: var(--text); }
.breadcrumb-item.current { color: var(--text); font-weight: 600; cursor: default; }
.breadcrumb-sep { color: var(--text-dim); font-size: 12px; flex-shrink: 0; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sort-select {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
  font-family: inherit;
  cursor: pointer;
}
.sort-select:hover { border-color: var(--text-dim); }
.back-btn {
  width: 36px; height: 36px;
  background: var(--surface3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.back-btn:hover { background: var(--surface4); color: var(--text); }
.back-btn svg { width: 18px; height: 18px; }
.back-btn:disabled { opacity: 0.3; pointer-events: none; }

/* ═══════════════════════════════════════════════════════
   GRID VIEW
═══════════════════════════════════════════════════════ */
#grid-view {
  padding: 24px;
}
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.section-count { font-size: 13px; color: var(--text-muted); }
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.folder-card {
  background: var(--surface2);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  position: relative;
}
.folder-card:hover { background: var(--surface3); transform: translateY(-2px); }
.folder-card:active { transform: scale(0.98); }
.folder-cover {
  aspect-ratio: 1;
  background: var(--surface3);
  overflow: hidden;
  position: relative;
}
.folder-cover img { width: 100%; height: 100%; object-fit: cover; }
.folder-cover .no-cover {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--surface3) 0%, var(--surface4) 100%);
}
.folder-cover .no-cover svg { width: 40%; height: 40%; opacity: 0.35; }
.folder-cover .play-overlay {
  position: absolute; bottom: 8px; right: 8px;
  width: 40px; height: 40px;
  background: var(--green);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.folder-cover .play-overlay svg { width: 18px; height: 18px; margin-left: 2px; }
.folder-card:hover .play-overlay { opacity: 1; transform: translateY(0); }
.folder-meta {
  padding: 12px;
}
.folder-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.folder-sub { font-size: 12px; color: var(--text-muted); }
.folder-card.subfolder .folder-sub::before { content: '📁 '; }
.folder-card.playing .folder-cover::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(29,185,84,0.2);
}

/* ═══════════════════════════════════════════════════════
   TRACK LIST VIEW
═══════════════════════════════════════════════════════ */
#track-view { padding: 0 0 24px; }
.album-header {
  display: flex; align-items: flex-end;
  gap: 24px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(29,185,84,0.2) 0%, transparent 100%);
  margin-bottom: 8px;
}
.album-cover-lg {
  width: 180px; height: 180px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
}
.album-cover-lg img { width: 100%; height: 100%; object-fit: cover; }
.album-cover-lg .no-cover-lg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface3);
}
.album-cover-lg .no-cover-lg svg { width: 72px; height: 72px; opacity: 0.55; color: var(--text-muted); }
.album-info { flex: 1; min-width: 0; }
.album-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 8px; }
.album-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; line-height: 1.1; }
.album-meta-line { font-size: 13px; color: var(--text-muted); }
.album-play-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--green);
  color: #000;
  border-radius: 50px;
  padding: 12px 28px;
  font-weight: 700; font-size: 14px;
  margin-top: 20px;
  transition: background 0.2s, transform 0.1s;
}
.album-play-btn:hover { background: #1ed760; }
.album-play-btn:active { transform: scale(0.97); }
.album-play-btn svg { width: 18px; height: 18px; }

/* Track list header */
.track-list-header {
  display: grid;
  grid-template-columns: 28px 40px 1fr 1fr 54px 52px 68px;
  gap: 8px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.track-list { padding: 8px 0; }
.track-row {
  display: grid;
  grid-template-columns: 28px 40px 1fr 1fr 54px 52px 68px;
  gap: 8px;
  padding: 8px 24px;
  border-radius: 6px;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.track-row:hover { background: var(--surface3); }
.track-row.playing { color: var(--green); }
.track-num {
  position: relative;
  font-size: 14px; color: var(--text-dim);
  text-align: center;
  font-family: 'DM Mono', monospace;
  display: flex; align-items: center; justify-content: center;
  height: 100%;
}
.track-num-label { transition: opacity 0.15s; }
/* playing + not paused: hide number, show animated bars */
.track-row.playing:not(.paused) .track-num-label { opacity: 0; }
.track-playing-icon {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
/* playing + not paused: show bars */
.track-row.playing:not(.paused) .track-playing-icon { opacity: 1; }
/* playing + paused: number visible again, bars hidden */
.track-row.playing.paused .track-num-label { opacity: 1; color: var(--green); }
.track-row.playing.paused .track-playing-icon { opacity: 0; }
.playing-bars {
  display: flex; align-items: flex-end; gap: 2px; height: 16px;
}
.playing-bars span {
  width: 3px; background: var(--green); border-radius: 2px;
  animation: bars 0.8s ease infinite;
}
.playing-bars span:nth-child(2) { animation-delay: 0.2s; }
.playing-bars span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bars {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}
.track-info { min-width: 0; }
.track-title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.track-artist-col { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-album-col { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-fmt-col { font-size: 11px; color: var(--text-dim); font-family: 'DM Mono', monospace; }
.track-size { font-size: 12px; color: var(--text-dim); font-family: 'DM Mono', monospace; text-align: right; }
.track-dur { font-size: 12px; color: var(--text-dim); font-family: 'DM Mono', monospace; text-align: right; }
.track-sort-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.track-sort-bar::-webkit-scrollbar { display: none; }
.track-sort-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface3);
  border: 1px solid var(--border);
  transition: 0.15s;
}
.track-sort-btn:hover { color: var(--text); border-color: var(--text-dim); }
.track-sort-btn.active { color: var(--text); border-color: var(--green); background: rgba(29,185,84,0.1); }

/* ── Playlist info bar (replaces sort bar for CUE/M3U) ── */
.playlist-info-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.playlist-info-bar::-webkit-scrollbar { display: none; }
.playlist-info-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  flex-shrink: 0;
}
.playlist-info-chip svg {
  width: 13px; height: 13px;
  flex-shrink: 0;
  color: var(--accent);
}
.playlist-info-chip strong {
  color: var(--text);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════
   PLAYER BAR
═══════════════════════════════════════════════════════ */
.player-left {
  display: flex; align-items: center; gap: 12px;
  width: 250px; min-width: 0; flex-shrink: 0;
}
.player-thumb {
  width: 56px; height: 56px;
  border-radius: 6px; overflow: hidden;
  background: var(--surface3); flex-shrink: 0;
}
.player-thumb img { width: 100%; height: 100%; object-fit: cover; }
.player-track-info { min-width: 0; }
.player-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-fmt { font-size: 10px; color: var(--text-dim); font-family: 'DM Mono', monospace; margin-top: 2px; }

.player-center {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 500px;
  margin: 0 auto;
}
.player-controls {
  display: flex; align-items: center; gap: 16px;
}
.ctrl-btn {
  color: var(--text-muted);
  transition: color 0.15s, transform 0.1s;
  display: flex; align-items: center; justify-content: center;
}
.ctrl-btn:hover { color: var(--text); }
.ctrl-btn:active { transform: scale(0.9); }
.ctrl-btn.active { color: var(--green); }
.ctrl-btn svg { width: 20px; height: 20px; }
.play-pause-btn {
  width: 40px; height: 40px;
  background: var(--text);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  transition: transform 0.1s, background 0.15s;
}
.play-pause-btn:hover { transform: scale(1.05); background: #f0f0f0; }
.play-pause-btn svg { width: 18px; height: 18px; }
.progress-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
}
.time-label { font-size: 11px; color: var(--text-dim); font-family: 'DM Mono', monospace; width: 36px; flex-shrink: 0; }
.time-label.right { text-align: right; }
.progress-bar {
  flex: 1; height: 4px;
  background: var(--surface4);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
/* Расширяем зону клика/тача невидимым псевдоэлементом, не меняя высоту полосы */
.progress-bar::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -10px; bottom: -10px;
}
.progress-fill {
  height: 100%;
  background: var(--text-muted);
  border-radius: 2px;
  transition: background 0.15s;
  pointer-events: none;
}
.progress-bar:hover .progress-fill,
.progress-bar.dragging .progress-fill { background: var(--green); }

.progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  background: var(--green);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 2;
}
.progress-bar:hover .progress-thumb,
.progress-bar.dragging .progress-thumb { opacity: 1; }

/* Всплывающее время над шариком */
.seek-preview {
  position: absolute;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: var(--surface3);
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 10;
}
.progress-bar:hover .seek-preview,
.progress-bar.dragging .seek-preview { opacity: 1; }

.player-right {
  display: flex; align-items: center; gap: 8px;
  width: 200px; justify-content: flex-end; flex-shrink: 0;
}
.volume-bar {
  display: flex; align-items: center; gap: 8px;
}
.vol-slider {
  width: 120px; height: 4px;
  background: var(--surface4);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.vol-slider::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: -10px; bottom: -10px;
}
.vol-fill {
  height: 100%;
  background: var(--text-muted);
  border-radius: 2px;
  pointer-events: none;
  transition: background 0.15s;
}
.vol-slider:hover .vol-fill,
.vol-slider.dragging .vol-fill { background: var(--green); }
.vol-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px; height: 12px;
  background: var(--green);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 2;
}
.vol-slider:hover .vol-thumb,
.vol-slider.dragging .vol-thumb { opacity: 1; }
.vol-preview {
  position: absolute;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  background: var(--surface3);
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 10;
}
.vol-slider:hover .vol-preview,
.vol-slider.dragging .vol-preview { opacity: 1; }

/* ═══════════════════════════════════════════════════════
   ADMIN PANEL (modal)
═══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%; max-width: 860px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: 0.15s;
}
.modal-close:hover { background: var(--surface4); color: var(--text); }
.modal-close svg { width: 16px; height: 16px; }
.modal-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-tab {
  padding: 14px 20px;
  font-size: 14px; font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: 0.15s;
  cursor: pointer;
}
.modal-tab:hover { color: var(--text); }
.modal-tab.active { color: var(--green); border-bottom-color: var(--green); }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.admin-section { margin-bottom: 28px; }
.admin-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px; }
.input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.form-input {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit; font-size: 14px;
  outline: none;
  flex: 1;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--green); }
.btn-primary {
  background: var(--green);
  color: #000;
  font-weight: 700; font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  transition: 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: #1ed760; }
.btn-danger {
  background: rgba(220,38,38,0.15);
  color: #ff6b6b;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(220,38,38,0.3);
  transition: 0.15s;
}
.btn-danger:hover { background: rgba(220,38,38,0.25); }
.btn-secondary {
  background: var(--surface3);
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--surface4);
  transition: 0.15s;
}
.btn-secondary:hover { background: var(--surface4); color: var(--text); }
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: flex; align-items: center;
  background: var(--surface3);
  border-radius: 10px;
  padding: 12px 14px;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.user-row:hover { background: var(--surface4); }
.user-row.selected { background: rgba(29,185,84,0.1); border: 1px solid rgba(29,185,84,0.3); }
.user-avatar-sm {
  width: 36px; height: 36px;
  background: var(--surface4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--text-muted);
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; }
.user-badge { font-size: 11px; color: var(--text-dim); }
.admin-badge { color: var(--green); font-size: 11px; font-weight: 600; margin-left: 6px; }
.access-tree { font-size: 13px; }
.folder-access-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}
.folder-access-row:hover { background: var(--surface3); }
.folder-access-row label { cursor: pointer; flex: 1; color: var(--text-muted); min-width: 0; }
.folder-access-row.has-audio label { color: var(--text); }
.folder-access-row input[type="checkbox"] { accent-color: var(--green); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.dt-toggle {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-dim);
  border-radius: 3px; transition: background 0.15s;
}
.dt-toggle:hover { background: var(--surface4); }
.dt-toggle-gap { width: 18px; flex-shrink: 0; }
.dt-children { border-left: 2px solid var(--surface4); margin-left: 8px; }
.scan-result {
  background: var(--surface3); border-radius: 8px;
  padding: 12px 16px; font-size: 13px;
  font-family: 'DM Mono', monospace;
  color: var(--green);
  display: none; margin-top: 12px;
}
.scan-result.visible { display: block; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.checkbox-row label { font-size: 14px; cursor: pointer; }
.checkbox-row input { accent-color: var(--green); width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════════════
   PLAYER VIEW (mobile tab)
═══════════════════════════════════════════════════════ */
#player-view {
  display: none;
  padding: 40px 24px 24px;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.pv-cover {
  width: min(280px, 80vw);
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  background: var(--surface3);
  flex-shrink: 0;
}
.pv-cover img { width: 100%; height: 100%; object-fit: cover; }
.pv-no-cover { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pv-no-cover svg { width: 30%; height: 30%; opacity: 0.3; }
.pv-info { text-align: center; width: 100%; }
.pv-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.pv-artist { font-size: 15px; color: var(--text-muted); }
.pv-controls { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pv-progress { width: 100%; display: flex; align-items: center; gap: 10px; }
.pv-btns { display: flex; align-items: center; gap: 24px; }
.pv-btns .ctrl-btn svg { width: 24px; height: 24px; }
.pv-btns .play-pause-btn { width: 56px; height: 56px; }
.pv-btns .play-pause-btn svg { width: 24px; height: 24px; }

/* ═══════════════════════════════════════════════════════
   MOBILE BOTTOM NAV
═══════════════════════════════════════════════════════ */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #000;
  border-top: 1px solid var(--border);
  z-index: 30;
  height: 60px;
}
.mobile-nav-inner {
  display: flex; height: 100%; width: 100%;
  justify-content: flex-end;
  align-items: center;
  padding: 0 16px;
  gap: 20px;
}
.mobile-nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  color: var(--text-muted);
  transition: color 0.15s;
  flex: none;
}
.mobile-nav-btn.active { color: var(--green); }
.mobile-nav-btn svg { width: 24px; height: 24px; }

/* ═══════════════════════════════════════════════════════
   NOTIFICATIONS
═══════════════════════════════════════════════════════ */
.toast {
  position: fixed; top: 20px; right: 20px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  z-index: 999;
  transform: translateY(-10px);
  opacity: 0;
  transition: 0.3s;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(29,185,84,0.5); color: var(--green); }
.toast.error { border-color: rgba(220,38,38,0.4); color: #ff6b6b; }

/* Loading */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; color: var(--text-dim);
  flex-direction: column; gap: 16px;
}
.spin {
  width: 32px; height: 32px;
  border: 2px solid var(--surface4);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  text-align: center; padding: 80px 24px;
  color: var(--text-dim);
}
.empty-state svg { width: 64px; height: 64px; opacity: 0.2; margin: 0 auto 16px; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --player-h: 0px; --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; grid-template-rows: calc(100vh - 60px) 60px; height: 100vh; }
  .sidebar { display: none; }
  .player-bar { display: none; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; }
  body { padding-bottom: 0; }
  .main { grid-row: 1; grid-column: 1; max-height: calc(100vh - 60px); height: calc(100vh - 60px); overflow-y: auto; overflow-x: hidden; }
  .track-sort-bar { padding: 10px 16px; gap: 6px; }
  .track-sort-btn { padding: 5px 10px; font-size: 12px; }
  .folder-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .album-header { flex-direction: column; align-items: center; text-align: center; }
  .album-info { display: flex; flex-direction: column; align-items: center; }
  .album-cover-lg { width: 140px; height: 140px; }
  .track-list-header { grid-template-columns: 32px 1fr 52px; }
  .track-list-header .th-album, .track-list-header .th-fmt, .track-list-header .th-size { display: none; }
  .track-row { grid-template-columns: 32px 1fr 52px; }
  .track-album-col, .track-fmt-col, .track-size { display: none; }
  .folder-cover .play-overlay { display: none !important; }
  .player-left { width: auto; }
  .player-right { width: auto; }
  #grid-view { padding: 16px 16px 100px !important; }
  #favorites-view { padding: 16px 16px 100px !important; }
  #track-view { padding-bottom: 0 !important; }
  .track-list { padding-bottom: 100px !important; }
  .album-title { font-size: 20px; }
  #player-view { display: flex; }
}
@media (min-width: 769px) {
  /* #player-view visibility on desktop is controlled by JS, not CSS */
  #player-view { display: none; /* default hidden, JS overrides */ }
}

/* ═══════════════════════════════════════════════════════
   MOBILE USER BOTTOM SHEET
═══════════════════════════════════════════════════════ */
.mob-sheet-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}
.mob-sheet-overlay.open { display: block; }

.mob-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface2);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--border);
  z-index: 201;
  padding: 0 0 40px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 85vh;
  overflow-y: auto;
}
.mob-sheet.open { transform: translateY(0); }

.mob-sheet-handle {
  width: 36px; height: 4px;
  background: var(--surface4);
  border-radius: 2px;
  margin: 12px auto 8px;
}
.mob-sheet-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px 12px;
}
.mob-sheet-avatar {
  width: 44px; height: 44px;
  background: var(--green);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: #000;
  flex-shrink: 0;
}
.mob-sheet-username {
  font-size: 17px; font-weight: 600; color: var(--text);
}
.mob-sheet-sep {
  height: 1px; background: var(--border);
  margin: 4px 0;
}
.mob-sheet-section-title {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 12px 20px 4px;
}
.mob-sheet-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  font-size: 16px; color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mob-sheet-item:active { background: var(--surface3); }
.mob-sheet-item svg { width: 22px; height: 22px; flex-shrink: 0; }

@media (min-width: 769px) {
  .mob-sheet, .mob-sheet-overlay { display: none !important; }
}

/* ═══════════════════════════════════════════════════════
   MOBILE ADMIN PANELS
═══════════════════════════════════════════════════════ */
.mob-admin-panel {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 300;
  flex-direction: column;
  overflow: hidden;
}
.mob-admin-panel.open { display: flex; }

.mob-admin-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 17px; font-weight: 600; color: var(--text);
  flex-shrink: 0;
}
.mob-admin-back {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--green);
  border-radius: 50%;
  transition: background 0.15s;
}
.mob-admin-back:active { background: var(--surface3); }
.mob-admin-back svg { width: 22px; height: 22px; }

.mob-admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 80px;
  display: flex; flex-direction: column; gap: 24px;
}
.mob-admin-desc {
  font-size: 14px; color: var(--text-muted); line-height: 1.5;
  margin-bottom: 16px;
}
.mob-admin-desc code {
  font-family: 'DM Mono', monospace;
  color: var(--green);
}
.mob-admin-section {
  display: flex; flex-direction: column; gap: 0;
}
.mob-admin-section-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

@media (min-width: 769px) {
  .mob-admin-panel { display: none !important; }
}

/* ═══════════════════════════════════════════════════════
   MOBILE FOLDER TREE
═══════════════════════════════════════════════════════ */
.tree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  min-height: 40px;
}
.tree-toggle {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-dim);
  flex-shrink: 0;
  border-radius: 4px;
  transition: background 0.15s;
}
.tree-toggle:active { background: var(--surface3); }
.tree-toggle-gap { width: 22px; flex-shrink: 0; }
.tree-node input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--green);
  flex-shrink: 0;
  cursor: pointer;
}
.tree-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--text-muted);
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.tree-icon { font-size: 15px; flex-shrink: 0; }
.tree-label span:not(.tree-badge):not(.tree-icon) {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tree-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 5px; border-radius: 4px;
  flex-shrink: 0;
  margin-left: auto;
}
.tree-badge-audio { background: rgba(29,185,84,0.15); color: var(--green); }
.tree-badge-folder { background: var(--surface4); color: var(--text-dim); }
.tree-children { border-left: 2px solid var(--surface4); margin-left: 10px; }

/* ── Playlist: unavailable track ── */
.track-row.track-unavailable {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.track-row.track-unavailable:hover {
  background: transparent;
}
.track-unavailable-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 80, 80, 0.12);
  color: #e05555;
  vertical-align: middle;
  line-height: 1.4;
}

/* ── Cover modal ── */
.cover-modal-box {
  padding: 40px 36px 32px;
  max-width: 420px;
}
.cover-modal-img-wrap {
  width: 320px; height: 320px;
  margin: 0 auto 20px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface3);
  display: flex; align-items: center; justify-content: center;
}
.cover-modal-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.cover-modal-img-wrap svg {
  width: 64px; height: 64px;
  color: var(--surface4);
}
.cover-modal-title {
  font-size: 17px; font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cover-modal-artist {
  font-size: 13px; color: var(--text-muted);
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Favorites ── */
/* Sidebar heart button — red when active */
#sb-favorites.active svg { color: #e05555; }
#sb-favorites.active { color: #e05555; }
#mob-favorites.active svg { color: #e05555; }

/* Heart button in track row */
.track-fav-btn {
  background: none; border: none; padding: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
}
.track-fav-btn svg { width: 15px; height: 15px; }
.track-fav-btn.fav-active { color: #e05555; opacity: 1; }
.track-row:hover .track-fav-btn { opacity: 1; }
.track-fav-btn:hover { color: #e05555; }
.track-row.track-unavailable .track-fav-btn { display: none; }

/* Mobile: always visible if favorited */
@media (max-width: 768px) {
  .track-fav-btn.fav-active { opacity: 1; }
}

/* Heart button on folder card */
.folder-fav-btn {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px;
  background: rgba(0,0,0,0.45);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  z-index: 2;
}
.folder-fav-btn svg { width: 15px; height: 15px; color: #fff; }
.folder-fav-btn.fav-active { opacity: 1; background: rgba(224,85,85,0.85); }
.folder-fav-btn.fav-active svg { color: #fff; }
.folder-card:hover .folder-fav-btn { opacity: 1; }
.folder-fav-btn:hover { background: rgba(224,85,85,0.85); }

/* Favorites view */
#favorites-view { padding: 24px; display: none; }
.fav-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-dim);
  margin: 24px 0 12px;
}

/* Virtual "Любимые треки" card */
.fav-tracks-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px;
  background: var(--surface2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  margin-bottom: 20px;
}
.fav-tracks-card:hover { background: var(--surface3); transform: translateY(-1px); }
.fav-tracks-cover {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(224,85,85,0.4);
}
.fav-tracks-cover svg { width: 36px; height: 36px; color: #fff; }
.fav-tracks-info { flex: 1; min-width: 0; }
.fav-tracks-name { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.fav-tracks-meta { font-size: 13px; color: var(--text-muted); }

/* Mobile: adjust grid for heart column */
@media (max-width: 768px) {
  .track-list-header { grid-template-columns: 22px 32px 1fr 52px; }
  .track-row { grid-template-columns: 22px 32px 1fr 52px; }
}

/* ── Favorite tracks card cover — grey bg + red heart ── */
.fav-heart-cover {
  background: linear-gradient(135deg, var(--surface3) 0%, var(--surface4) 100%) !important;
}
.fav-heart-cover svg {
  width: 45% !important; height: 45% !important;
  opacity: 1 !important;
  color: #e05555 !important;
}

/* ── Favorites heart cover for alb-cover-lg ── */
.fav-heart-cover-lg {
  background: linear-gradient(135deg, var(--surface3) 0%, var(--surface4) 100%) !important;
}
.fav-heart-cover-lg svg {
  width: 52px !important; height: 52px !important;
  color: #e05555 !important;
  opacity: 1 !important;
}

/* ── Public folder markers ───────────────────────────────────────────────── */
.folder-card.folder-public .folder-cover {
  outline: 2px solid #4a9eff22;
  outline-offset: -2px;
}
.folder-public-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 4px;
  color: #4a9eff;
  opacity: 0.85;
  flex-shrink: 0;
}

/* ── Edit-user modal ─────────────────────────────────────────────────────── */
.edit-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--surface2);
  border-radius: 12px;
  padding: 28px 32px;
  width: 420px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  animation: slideUp 0.18s ease;
}
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-box h3 {
  margin: 0 0 20px;
  font-size: 17px;
  font-weight: 700;
}

.modal-field {
  margin-bottom: 14px;
}
.modal-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.modal-field input[type="text"],
.modal-field input[type="password"],
.modal-field input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface3);
  border: 1px solid var(--surface4);
  border-radius: 6px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.modal-field input:focus {
  border-color: var(--accent);
}
.modal-field .hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.modal-checkbox-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}
.modal-checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent);
}

.modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 6px;
}
.modal-btn {
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.modal-btn:hover { opacity: 0.85; }
.modal-btn-cancel {
  background: var(--surface3);
  color: var(--text-muted);
}
.modal-btn-save {
  background: var(--accent);
  color: #fff;
}
.modal-error {
  color: #e05555;
  font-size: 13px;
  margin-bottom: 10px;
  display: none;
}

/* ═══════════════════════════════════════════════════════
   USER MENU — icons
═══════════════════════════════════════════════════════ */
.user-menu-item { display: flex; align-items: center; gap: 9px; }
.user-menu-username { font-weight: 600; color: var(--text); pointer-events: none; }
.umicon { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.7; }

/* ═══════════════════════════════════════════════════════
   MY FILES MODAL
═══════════════════════════════════════════════════════ */
.mf-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.mf-overlay.open { display: flex; }
.mf-box {
  background: var(--surface2);
  border-radius: 14px;
  width: min(900px, 100%);
  height: min(620px, 90vh);
  display: flex; flex-direction: column;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  overflow: hidden;
}

/* Header */
.mf-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mf-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700;
  flex: 1;
}
.mf-quota {
  font-size: 12px; color: var(--text-muted);
  background: var(--surface3);
  padding: 3px 10px; border-radius: 20px;
}
.mf-quota { color: var(--green); }
.mf-quota.over { color: #ff6b6b; background: rgba(220,38,38,0.15); }
.mf-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
  border-radius: 6px; transition: 0.15s;
  display: flex; align-items: center;
}
.mf-close:hover { background: var(--surface4); color: var(--text); }

/* Body */
.mf-body {
  display: flex; flex: 1; overflow: hidden;
}

/* Tree panel */
.mf-tree-panel {
  width: 220px; flex-shrink: 0; min-width: 140px; max-width: 480px;
  overflow-y: auto;
  padding: 8px 0;
  position: relative;
}

/* Resizer */
.mf-resizer {
  width: 5px; flex-shrink: 0;
  background: var(--border);
  cursor: col-resize;
  transition: background 0.15s;
  position: relative; z-index: 1;
}
.mf-resizer:hover, .mf-resizer.dragging {
  background: var(--green);
}
.mf-tree { font-size: 13px; }
.mf-tree-node { user-select: none; }
.mf-tree-row {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 8px; cursor: pointer;
  border-radius: 6px; margin: 1px 4px;
  color: var(--text-muted);
  transition: background 0.1s;
  white-space: nowrap; overflow: hidden;
}
.mf-tree-row:hover { background: var(--surface3); color: var(--text); }
.mf-tree-row.active { background: rgba(29,185,84,.12); color: var(--green); font-weight: 600; }
.mf-tree-toggle {
  width: 16px; flex-shrink: 0;
  font-size: 10px; color: var(--text-dim);
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.mf-tree-icon { flex-shrink: 0; opacity: 0.6; }
.mf-tree-name { overflow: hidden; text-overflow: ellipsis; }
.mf-tree-editing input {
  font-size: 13px; padding: 1px 6px;
  background: var(--surface4);
  border: 1px solid var(--accent);
  border-radius: 4px; color: var(--text);
  outline: none; width: 120px;
}
.mf-tree-children { padding-left: 16px; }

/* Tree DnD */
.mf-tree-row.drag-src { opacity: 0.4; }
.mf-tree-row.drag-over-target {
  background: rgba(29,185,84,0.2) !important;
  outline: 1px solid var(--green);
  border-radius: 6px;
}

/* Files panel */
.mf-files-panel {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; position: relative;
}
.mf-files-panel.drag-over { background: rgba(29,185,84,0.06); }
.mf-files-panel.drag-over .mf-drop-hint { opacity: 1; }
.mf-files-list {
  flex: 1; overflow-y: auto; padding: 8px;
  padding-bottom: 48px;
}
.mf-file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px;
  cursor: pointer; font-size: 13px;
  transition: background 0.1s;
  user-select: none;
}
.mf-file-row:hover { background: var(--surface3); }
.mf-file-row.selected { background: rgba(29,185,84,0.15); color: var(--accent); }
.mf-file-icon { flex-shrink: 0; opacity: 0.55; }
.mf-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-file-size { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.mf-drop-hint {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; color: var(--text-dim);
  border-top: 1px dashed var(--border);
  opacity: 0.5; pointer-events: none;
  transition: opacity 0.2s;
  background: var(--surface2);
}
.mf-files-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px;
  height: 100%; color: var(--text-dim); font-size: 13px;
}

/* Toolbar */
.mf-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0; gap: 8px;
}
.mf-toolbar-left, .mf-toolbar-right { display: flex; gap: 6px; }
.mf-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 7px;
  font-size: 12px; font-weight: 600; border: none;
  cursor: pointer; transition: 0.15s;
  background: var(--surface3); color: var(--text-muted);
  white-space: nowrap;
}
.mf-btn:hover { background: var(--surface4); color: var(--text); }
.mf-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.mf-btn-danger { color: #ff6b6b; }
.mf-btn-danger:hover { background: rgba(220,38,38,0.2); color: #ff6b6b; }
.mf-btn-upload { background: rgba(29,185,84,0.15); color: var(--green); }
.mf-btn-upload:hover { background: rgba(29,185,84,0.25); }
.mf-btn-scan { background: var(--surface3); }

/* Upload progress */
.mf-upload-progress {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.mf-progress-info {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted); margin-bottom: 5px;
}
.mf-progress-bar-wrap {
  height: 4px; background: var(--surface4); border-radius: 2px; overflow: hidden;
}
.mf-progress-bar {
  height: 100%; background: var(--green);
  border-radius: 2px; transition: width 0.2s;
  width: 0%;
}

/* Status */
.mf-status {
  padding: 8px 16px; font-size: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
}
.mf-status.ok    { color: var(--green); border-top-color: rgba(29,185,84,0.3); }
.mf-status.error { color: #ff6b6b; border-top-color: rgba(220,38,38,0.3); }
.mf-status.warn  { color: #f59e0b; border-top-color: rgba(245,158,11,0.3); }

/* Scan spinner inside toolbar */
.mf-scan-spin {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--surface4);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
