:root {
  --bg-deep: #07040f;
  --bg-surface: rgba(18, 11, 34, 0.72);
  --bg-card-hover: rgba(139, 92, 246, 0.14);
  --border-glass: rgba(168, 85, 247, 0.22);
  --border-glow: rgba(192, 132, 252, 0.55);
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --purple-600: #8b5cf6;
  --magenta-500: #ec4899;
  --text-main: #f5f3ff;
  --text-muted: #a79bc2;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --ease-fluid: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

button, input, select { font-family: inherit; }
button { color: inherit; }
code { background: rgba(139, 92, 246, 0.18); padding: 1px 6px; border-radius: 6px; font-size: 0.85em; }

:focus-visible { outline: 2px solid var(--purple-400); outline-offset: 2px; }

.hidden { display: none !important; }

/* ==================== FUNDO ANIMADO ==================== */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, #170b33 0%, #07040f 70%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.45;
  will-change: transform;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-1 { width: 480px; height: 480px; background: #7c3aed; top: -120px; left: -100px; }
.orb-2 { width: 420px; height: 420px; background: #c026d3; bottom: -100px; right: -80px; animation-delay: -6s; }
.orb-3 { width: 320px; height: 320px; background: #4f46e5; top: 45%; left: 45%; animation-delay: -12s; }

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.16) 0%, transparent 70%);
  pointer-events: none;
  will-change: transform;
}

@keyframes floatOrb {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(45px, -35px, 0) scale(1.08); }
  100% { transform: translate3d(-30px, 40px, 0) scale(0.95); }
}

/* ==================== VIDRO & ANIMAÇÕES ==================== */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.animate-pop-in { animation: popIn 0.55s var(--ease-fluid) both; }

@keyframes popIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideRowIn {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shake { animation: shakeError 0.4s ease; }

/* ==================== BOTÕES & CAMPOS ==================== */
.btn-primary-neon {
  background: linear-gradient(135deg, #8b5cf6 0%, #c026d3 100%);
  color: #fff;
  border: none;
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
  transition: transform 0.25s var(--ease-fluid), box-shadow 0.25s var(--ease-fluid), filter 0.2s, opacity 0.2s;
}

.btn-primary-neon:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(192, 38, 211, 0.55);
  filter: brightness(1.08);
}

.btn-primary-neon:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn-primary-neon:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.btn-secondary-glass {
  background: rgba(139, 92, 246, 0.14);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  padding: 10px 15px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.25s var(--ease-fluid);
}

.btn-secondary-glass:hover {
  background: rgba(139, 92, 246, 0.28);
  border-color: var(--border-glow);
  transform: translateY(-1px);
}

.btn-icon-glass {
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s var(--ease-fluid);
}

.btn-icon-glass:hover { background: rgba(139, 92, 246, 0.3); transform: scale(1.06); }

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 2px 6px;
}
.link-btn:hover { color: #fff; }

.w-full { width: 100%; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
select {
  width: 100%;
  background: rgba(9, 5, 20, 0.8);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 11px;
  padding: 12px 14px;
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, #c084fc 50%), linear-gradient(135deg, #c084fc 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 12px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
select option { background: #120b22; }

input:focus, select:focus {
  border-color: var(--purple-400);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.22);
}

/* ==================== LOGIN ==================== */
.auth-wrapper {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card { width: 100%; max-width: 440px; border-radius: 24px; padding: 34px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }

.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.5);
  flex-shrink: 0;
}

.brand-logo svg { width: 26px; height: 26px; }
.brand-logo.small { width: 40px; height: 40px; border-radius: 12px; }
.brand-logo.small svg { width: 20px; height: 20px; }

.auth-brand h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; }

.auth-brand h1 span,
.brand-text h2 span {
  background: linear-gradient(90deg, #c084fc, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle { font-size: 0.82rem; color: var(--text-muted); }
.auth-hint { margin-top: 18px; text-align: center; font-size: 0.78rem; color: var(--text-muted); }

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(9, 5, 20, 0.75);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid rgba(168, 85, 247, 0.18);
}

.tab-glider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(217, 70, 239, 0.35));
  border: 1px solid rgba(192, 132, 252, 0.45);
  border-radius: 10px;
  transition: transform 0.35s var(--ease-fluid);
}

.auth-tab {
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px;
  cursor: pointer;
  transition: color 0.25s;
}

.auth-tab.active { color: #fff; }

.form-group { margin-bottom: 16px; }
.form-group label, .field-label { display: block; font-size: 0.82rem; font-weight: 500; color: #d8b4fe; margin-bottom: 6px; }

.password-wrap { position: relative; }
.icon-btn-inline {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.75;
}

.auth-error {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  margin-bottom: 14px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn-ghost-sm {
  background: transparent;
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost-sm:hover { color: #fff; border-color: var(--purple-400); }

/* ==================== LAYOUT ==================== */
.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 275px 1fr;
  gap: 18px;
  padding: 18px 18px 108px 18px;
  min-height: 100vh;
}

.sidebar {
  border-radius: 22px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 126px);
  position: sticky;
  top: 18px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 16px 6px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.16);
}

.brand-text h2 { font-size: 1.25rem; font-weight: 800; }
.domain-tag { font-size: 0.72rem; color: var(--purple-400); }

.nav-section-title {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 16px 10px 8px 10px;
}

.nav-item {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 3px;
  text-align: left;
  transition: all 0.25s var(--ease-fluid);
}

.nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: rgba(139, 92, 246, 0.12); color: #fff; transform: translateX(3px); }

.nav-item.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.28), rgba(217, 70, 239, 0.16));
  border-color: rgba(192, 132, 252, 0.35);
  color: #fff;
  font-weight: 600;
}

.badge {
  margin-left: auto;
  background: rgba(139, 92, 246, 0.25);
  color: #e9d5ff;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 999px;
}

.badge.hot { background: linear-gradient(135deg, #8b5cf6, #ec4899); color: #fff; }

.sidebar-playlists { flex: 1; overflow-y: auto; margin-top: 4px; min-height: 60px; }
.playlist-header { display: flex; align-items: center; justify-content: space-between; padding-right: 6px; }

.btn-icon-xs {
  background: rgba(139, 92, 246, 0.25);
  border: 1px solid var(--border-glass);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s;
}

.btn-icon-xs:hover { transform: scale(1.1); background: var(--purple-600); }

.playlist-item-row { display: flex; align-items: center; gap: 6px; }
.playlist-item-row .nav-item { flex: 1; padding: 9px 10px; font-size: 0.85rem; }
.empty-mini { font-size: 0.78rem; color: var(--text-muted); padding: 8px 10px; }

.btn-del-pl {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.6;
  padding: 4px;
}

.btn-del-pl:hover { opacity: 1; color: var(--err); }

.sidebar-footer { border-top: 1px solid rgba(168, 85, 247, 0.16); padding-top: 14px; }

.storage-meter {
  font-size: 0.75rem;
  color: #d8b4fe;
  background: rgba(139, 92, 246, 0.12);
  padding: 9px 11px;
  border-radius: 10px;
  margin-bottom: 10px;
}
.storage-row { display: flex; justify-content: space-between; margin-bottom: 6px; }
.storage-bar { height: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 999px; overflow: hidden; }
.storage-fill { height: 100%; width: 0; background: linear-gradient(90deg, #a855f7, #ec4899); transition: width 0.6s var(--ease-fluid); }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(9, 5, 20, 0.65);
  padding: 10px;
  border-radius: 14px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.user-meta { flex: 1; min-width: 0; }
.user-meta strong { display: block; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { display: block; font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover { background: rgba(239, 68, 68, 0.35); color: #fff; }

/* ==================== CONTEÚDO ==================== */
.main-content { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.topbar {
  border-radius: 20px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box { position: relative; flex: 1; min-width: 220px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: 0.65; }
.search-box input { padding-left: 40px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.visualizer-hero {
  border-radius: 22px;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg, rgba(35, 16, 68, 0.82) 0%, rgba(15, 9, 30, 0.88) 100%);
}

.hero-info { min-width: 0; }
.hero-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.live-pill {
  background: rgba(168, 85, 247, 0.22);
  border: 1px solid rgba(192, 132, 252, 0.4);
  color: #e9d5ff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.view-title { font-size: 0.82rem; color: var(--purple-400); font-weight: 600; }
.hero-info h3 { font-size: 1.55rem; font-weight: 800; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-info p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 18px; }
.hero-stats { display: flex; gap: 14px; flex-wrap: wrap; }

.stat-chip {
  background: rgba(9, 5, 20, 0.65);
  border: 1px solid rgba(168, 85, 247, 0.2);
  padding: 10px 16px;
  border-radius: 14px;
}

.stat-chip strong { display: block; font-size: 1.15rem; color: #e9d5ff; }
.stat-chip span { font-size: 0.74rem; color: var(--text-muted); }

.canvas-wrapper {
  background: rgba(7, 4, 15, 0.65);
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: 18px;
  padding: 12px;
}

#spectrumCanvas { width: 100%; height: 140px; display: block; }

/* ==================== TABELA ==================== */
.tracks-section { border-radius: 22px; padding: 18px; flex: 1; }

.tracks-table-header,
.track-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 130px 64px 76px 200px;
  align-items: center;
}

.tracks-table-header {
  padding: 0 14px 12px 14px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.16);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.tracks-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

.track-row {
  padding: 9px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.22s ease, transform 0.22s var(--ease-fluid), border-color 0.22s ease;
}

.track-row:hover { background: var(--bg-card-hover); transform: translateX(4px); }
.track-row.active { background: linear-gradient(90deg, rgba(139, 92, 246, 0.26), rgba(236, 72, 153, 0.14)); border-color: rgba(192, 132, 252, 0.45); }
.track-row.is-busy { cursor: progress; }
.track-row.is-error { cursor: default; }
.track-row .muted { color: var(--text-muted); font-size: 0.84rem; }

.track-main-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }

.track-thumb {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2e1065, #701a75);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.track-thumb img { width: 100%; height: 100%; object-fit: cover; }

.track-titles { min-width: 0; }
.track-titles strong { display: block; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-titles small { display: block; font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-titles small.err { color: #fca5a5; }

.mini-progress { height: 3px; margin-top: 5px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; max-width: 220px; }
.mini-progress > div { height: 100%; background: linear-gradient(90deg, #a855f7, #ec4899); transition: width 0.4s ease; }
.mini-progress.indeterminate > div { width: 100% !important; background: linear-gradient(90deg, transparent, #a855f7, #ec4899, transparent); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }

.source-pill { display: inline-block; font-size: 0.72rem; padding: 4px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.source-pill.audio { background: rgba(139, 92, 246, 0.2); color: #d8b4fe; }
.source-pill.video { background: rgba(236, 72, 153, 0.2); color: #f9a8d4; }
.source-pill.local { background: rgba(99, 102, 241, 0.22); color: #c7d2fe; }
.source-pill.busy { background: rgba(251, 191, 36, 0.18); color: #fde68a; }
.source-pill.error { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.source-pill .conv { opacity: 0.75; font-weight: 500; }

.row-actions { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }

.row-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.2s, background 0.2s;
}

.row-btn:hover { transform: scale(1.12); background: rgba(168, 85, 247, 0.3); }
.row-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

.eq-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.eq-bars span { width: 3px; background: #e879f9; border-radius: 2px; animation: eqBounce 0.8s ease-in-out infinite alternate; }
.eq-bars span:nth-child(2) { animation-delay: 0.2s; }
.eq-bars span:nth-child(3) { animation-delay: 0.4s; }
.eq-bars span:nth-child(4) { animation-delay: 0.1s; }

@keyframes eqBounce { 0% { height: 4px; } 100% { height: 16px; } }

.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-state h4 { color: #fff; font-size: 1.1rem; margin: 10px 0 6px 0; }
.empty-state .btn-primary-neon { margin-top: 18px; }

/* ==================== CONVERSOR ==================== */
.converter-section { border-radius: 22px; padding: 22px; flex: 1; }
.converter-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }

.converter-card {
  background: rgba(9, 5, 20, 0.55);
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.converter-card h4, .jobs-header h4 { font-size: 0.95rem; font-weight: 700; }

.convert-drop {
  border: 2px dashed rgba(192, 132, 252, 0.45);
  border-radius: 16px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  background: rgba(139, 92, 246, 0.08);
  transition: all 0.25s var(--ease-fluid);
}

.convert-drop:hover, .convert-drop.over { background: rgba(139, 92, 246, 0.2); border-color: #e879f9; transform: translateY(-2px); }
.convert-drop span { font-size: 0.8rem; color: var(--text-muted); }
.convert-drop-icon { font-size: 1.8rem; }
.convert-or { text-align: center; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.convert-pick-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }

.pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.2s;
}
.pick-item:hover { background: rgba(139, 92, 246, 0.14); }
.pick-item.selected { background: rgba(139, 92, 246, 0.26); border-color: rgba(192, 132, 252, 0.5); }
.pick-item .track-thumb { width: 32px; height: 32px; font-size: 0.9rem; border-radius: 8px; }
.pick-item .track-titles strong { font-size: 0.84rem; }

.segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(9, 5, 20, 0.75);
  border-radius: 12px;
  padding: 4px;
  border: 1px solid rgba(168, 85, 247, 0.18);
}

.seg-btn {
  background: none;
  border: 1px solid transparent;
  padding: 10px;
  border-radius: 9px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s var(--ease-fluid);
}

.seg-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(217, 70, 239, 0.35));
  border-color: rgba(192, 132, 252, 0.45);
  color: #fff;
}

.convert-help { font-size: 0.78rem; color: var(--text-muted); line-height: 1.45; }

.convert-selected {
  font-size: 0.82rem;
  color: #e9d5ff;
  background: rgba(139, 92, 246, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  word-break: break-word;
}

.jobs-header { display: flex; align-items: baseline; gap: 10px; margin: 22px 4px 10px; flex-wrap: wrap; }
.jobs-header small { color: var(--text-muted); font-size: 0.78rem; }
.jobs-list { display: flex; flex-direction: column; gap: 8px; }

.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(9, 5, 20, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.14);
  animation: slideRowIn 0.35s var(--ease-fluid) backwards;
}

.job-row strong { display: block; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-row small { font-size: 0.76rem; color: var(--text-muted); }
.job-row small.err { color: #fca5a5; }
.job-row .mini-progress { max-width: none; margin-top: 7px; }
.job-actions { display: flex; gap: 6px; }
.job-actions a { text-decoration: none; }

/* ==================== FILA DE ENVIO ==================== */
.upload-panel {
  position: fixed;
  left: 22px;
  bottom: 108px;
  width: 340px;
  max-height: 46vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  z-index: 30;
  overflow: hidden;
  animation: popIn 0.4s var(--ease-fluid);
}

.upload-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; font-size: 0.85rem; }
.upload-total { height: 3px; background: rgba(255,255,255,0.08); }
.upload-total-fill { height: 100%; width: 0; background: linear-gradient(90deg, #a855f7, #ec4899); transition: width 0.3s ease; }
.upload-list { overflow-y: auto; padding: 6px 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.upload-panel.collapsed .upload-list { display: none; }

.upload-item { padding: 7px 8px; border-radius: 10px; font-size: 0.78rem; }
.upload-item .u-top { display: flex; justify-content: space-between; gap: 8px; }
.upload-item .u-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.upload-item .u-state { color: var(--text-muted); flex-shrink: 0; }
.upload-item.done .u-state { color: var(--ok); }
.upload-item.error .u-state { color: #fca5a5; }
.upload-item .mini-progress { max-width: none; }

/* ==================== PLAYER ==================== */
.player-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 92px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr;
  align-items: center;
  gap: 20px;
  border-top: 1px solid rgba(192, 132, 252, 0.32);
}

.dock-track-info { display: flex; align-items: center; gap: 12px; min-width: 0; }

.dock-cover { cursor: pointer;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6d28d9, #be185d);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.dock-cover img { width: 100%; height: 100%; object-fit: cover; }
.dock-meta { min-width: 0; }
.dock-meta strong { display: block; font-size: 0.94rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-meta small { color: var(--text-muted); font-size: 0.8rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-fav-dock { background: none; border: none; font-size: 1.2rem; cursor: pointer; transition: transform 0.2s; }
.btn-fav-dock:hover { transform: scale(1.2); }

.dock-controls-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.control-buttons { display: flex; align-items: center; gap: 16px; }

.ctrl-btn { background: none; border: none; font-size: 1.15rem; cursor: pointer; opacity: 0.55; transition: opacity 0.2s, transform 0.2s; }
.ctrl-btn:hover, .ctrl-btn.active { opacity: 1; transform: scale(1.12); }

.ctrl-btn-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.55);
  transition: transform 0.25s var(--ease-fluid);
}

.ctrl-btn-play:hover { transform: scale(1.1); }

.progress-row { width: 100%; display: flex; align-items: center; gap: 10px; }
.time-label { font-size: 0.75rem; color: var(--text-muted); min-width: 36px; font-variant-numeric: tabular-nums; }
.progress-bar-wrap { flex: 1; padding: 6px 0; cursor: pointer; }
.progress-bar-bg { height: 5px; background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; transition: height 0.2s; }
.progress-bar-wrap:hover .progress-bar-bg { height: 7px; }
.progress-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #a855f7, #ec4899); border-radius: 999px; }

.dock-extras { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }

.speed-pill {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid var(--border-glass);
  color: #e9d5ff;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.volume-control { display: flex; align-items: center; gap: 8px; }
input[type="range"] { accent-color: #a855f7; width: 88px; cursor: pointer; }

/* ==================== VÍDEO FLUTUANTE ==================== */
.pip-video-box {
  position: fixed;
  right: 22px;
  bottom: 108px;
  width: 320px;
  border-radius: 16px;
  overflow: hidden;
  z-index: 25;
  transition: width 0.35s var(--ease-fluid), box-shadow 0.2s ease;
}

.pip-video-box.large { width: min(760px, calc(100vw - 44px)); }
.pip-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-size: 0.78rem; font-weight: 600; background: rgba(15, 9, 30, 0.9); }
.pip-header button { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0 4px; font-size: 0.9rem; }
.pip-header button:hover { color: #fff; }
#mediaEngine { width: 100%; display: block; background: #000; max-height: 60vh; }

/* ==================== OVERLAY, MODAIS, TOASTS ==================== */
.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(7, 4, 15, 0.85);
  backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-overlay.visible { display: flex; }

.drop-card {
  border: 2px dashed #c084fc;
  background: rgba(139, 92, 246, 0.14);
  padding: 48px 64px;
  border-radius: 28px;
  text-align: center;
  max-width: 620px;
  animation: popIn 0.35s var(--ease-fluid);
}

.drop-card p { color: var(--text-muted); margin-top: 8px; font-size: 0.9rem; }
.drop-icon { font-size: 3rem; margin-bottom: 12px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 3, 12, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card { width: 100%; max-width: 420px; border-radius: 22px; padding: 26px; }
.modal-card.modal-wide { max-width: 620px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-subtitle { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.close-modal { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.playlist-picker-list, .import-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.import-list { max-height: 42vh; overflow-y: auto; }

.picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  font-size: 0.86rem;
  width: 100%;
  text-align: left;
}

.picker-item:hover { background: rgba(139, 92, 246, 0.25); }
.picker-item .p-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item small { color: var(--text-muted); flex-shrink: 0; }
.import-list .picker-item { cursor: default; }

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  background: rgba(24, 14, 46, 0.94);
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 0.86rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  animation: popIn 0.35s var(--ease-fluid);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.error { border-color: rgba(248, 113, 113, 0.6); }
.toast.ok { border-color: rgba(52, 211, 153, 0.55); }

/* ==================== RESPONSIVO ==================== */
@media (max-width: 1180px) {
  .tracks-table-header, .track-row { grid-template-columns: 40px minmax(0, 1fr) 120px 72px 200px; }
  .col-plays, .track-row .cell-plays { display: none; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; padding: 12px 12px 150px; }
  .sidebar { position: static; height: auto; }
  .sidebar-playlists { max-height: 180px; }
  .visualizer-hero { grid-template-columns: 1fr; }
  .converter-grid { grid-template-columns: 1fr; }
  .tracks-table-header, .track-row { grid-template-columns: 34px minmax(0, 1fr) 100px; }
  .row-btn.opt { display: none; }
  .col-source, .col-plays, .col-dur, .track-row .cell-source, .track-row .cell-plays, .track-row .cell-dur { display: none; }
  .player-dock { grid-template-columns: 1fr; height: auto; padding: 10px 14px; gap: 8px; }
  .dock-extras { display: none; }
  .upload-panel { left: 12px; right: 12px; width: auto; bottom: 150px; }
  .pip-video-box { right: 12px; bottom: 150px; width: 240px; }
  .topbar-actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* As linhas só animam quando a lista muda de filtro/busca (não a cada atualização). */
.tracks-list.animate .track-row { animation: slideRowIn 0.38s var(--ease-fluid) backwards; }

/* Celular: menu vira uma faixa horizontal para a lista de músicas aparecer logo. */
@media (max-width: 960px) {
  .app-shell > * { min-width: 0; }
  .sidebar { padding: 12px; gap: 8px; min-width: 0; }
  .sidebar-header { padding-bottom: 10px; }
  .sidebar-nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-nav .nav-section-title { display: none; }
  .sidebar-nav .nav-item { width: auto; flex: none; margin: 0; padding: 8px 12px; }
  .sidebar-nav .nav-item:hover { transform: none; }
  .sidebar-playlists { max-height: 120px; min-height: 0; }
  .sidebar-footer { display: flex; gap: 8px; align-items: stretch; padding-top: 10px; }
  .storage-meter { flex: 1; margin: 0; }
  .user-card { flex: 1.4; padding: 6px 8px; }
  .topbar-actions .btn-primary-neon, .topbar-actions .btn-secondary-glass { flex: 1; justify-content: center; padding: 10px; font-size: 0.82rem; }
  .visualizer-hero { padding: 18px; }
  #spectrumCanvas { height: 90px; }
}

/* ==================== BUSCAR MÚSICAS ==================== */
.discover-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.discover-stats .stat-chip strong { font-size: 1.25rem; }
.discover-stats .stat-chip small { display: block; color: var(--text-muted); font-size: 0.72rem; margin-top: 2px; }
.discover-stats .stat-chip.hot { background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(236, 72, 153, 0.18)); border-color: rgba(192, 132, 252, 0.45); }
.discover-search { display: grid; grid-template-columns: minmax(240px, 330px) 1fr auto; gap: 12px; align-items: center; }
.discover-search .search-box { min-width: 0; }
.discover-more { display: flex; justify-content: center; margin-top: 12px; }
.result-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
.result-row .track-thumb { width: 48px; height: 48px; }
.result-row .meta-line { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }
.result-row .meta-line a { color: var(--purple-400); text-decoration: none; }
.result-row .meta-line a:hover { text-decoration: underline; }
.btn-dl { min-width: 128px; justify-content: center; }
.btn-dl.state-done { background: rgba(52, 211, 153, 0.16); border-color: rgba(52, 211, 153, 0.45); color: #a7f3d0; box-shadow: none; }
.btn-dl.state-error { background: rgba(239, 68, 68, 0.16); border-color: rgba(248, 113, 113, 0.45); color: #fecaca; box-shadow: none; }
@media (max-width: 960px) {
  .discover-search { grid-template-columns: 1fr; }
  .result-row { grid-template-columns: 40px minmax(0, 1fr); }
  .result-row .job-actions { grid-column: 1 / -1; }
  .btn-dl { width: 100%; }
}

/* ==================== LINKS DO SOUNDCLOUD ==================== */
.links-form { grid-template-columns: 1fr 170px auto; }
.links-header { align-items: center; justify-content: space-between; }
.link-filter { grid-template-columns: repeat(5, auto); }
.link-filter .seg-btn { padding: 8px 14px; font-size: 0.82rem; }

.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.link-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(9, 5, 20, 0.55);
  border: 1px solid rgba(168, 85, 247, 0.16);
  transition: transform 0.3s var(--ease-fluid), border-color 0.25s, box-shadow 0.25s;
}
.link-grid.animate .link-card { animation: slideRowIn 0.35s var(--ease-fluid) backwards; }
.link-card:hover { transform: translateY(-3px); border-color: var(--border-glow); box-shadow: 0 10px 30px rgba(139, 92, 246, 0.22); }
.link-card.playing { border-color: rgba(236, 72, 153, 0.65); box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.35), 0 10px 30px rgba(236, 72, 153, 0.2); }
.link-art {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #2e1065, #701a75);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
  cursor: pointer;
  border: none;
  width: 100%;
  padding: 0;
}
.link-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.link-art .link-play {
  position: absolute; right: 10px; bottom: 10px;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff; font-size: 1rem;
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.45);
  opacity: 0; transform: translateY(6px) scale(0.92);
  transition: all 0.25s var(--ease-fluid);
}
.link-card:hover .link-play, .link-card.playing .link-play, .link-art:focus-visible .link-play { opacity: 1; transform: none; }
.link-kind {
  position: absolute; left: 10px; top: 10px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(7, 4, 15, 0.78); color: #e9d5ff; border: 1px solid rgba(192, 132, 252, 0.35);
}
.link-kind.album { color: #fbcfe8; border-color: rgba(236, 72, 153, 0.5); }
.link-kind.track { color: #c7d2fe; border-color: rgba(129, 140, 248, 0.45); }
.link-kind.artist { color: #a7f3d0; border-color: rgba(52, 211, 153, 0.45); }
.link-via { position: absolute; right: 10px; top: 10px; font-size: 0.7rem; padding: 3px 7px; border-radius: 999px; background: rgba(7, 4, 15, 0.78); }
.link-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.link-body strong { font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-body small { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-tools { display: flex; align-items: center; gap: 6px; }
.link-tools select { padding: 5px 26px 5px 8px; font-size: 0.75rem; border-radius: 8px; flex: 1; min-width: 0; background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%; }
.link-tools a.row-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: #e9d5ff; font-weight: 700; }

.webhook-card {
  margin-top: 22px;
  border-radius: 16px;
  background: rgba(9, 5, 20, 0.5);
  border: 1px solid rgba(168, 85, 247, 0.16);
}
.webhook-card summary {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 16px; cursor: pointer; font-weight: 600; font-size: 0.9rem; list-style: none;
}
.webhook-card summary::-webkit-details-marker { display: none; }
.webhook-card summary small { font-weight: 500; font-size: 0.74rem; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }
.webhook-card summary small.on { background: rgba(52, 211, 153, 0.16); color: #a7f3d0; }
.webhook-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.webhook-body .field-label { margin: 10px 0 0; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 9px 12px; font-size: 0.8rem; border-radius: 10px; background: rgba(7, 4, 15, 0.8); border: 1px solid rgba(168, 85, 247, 0.2); }
.copy-row code.fresh { border-color: rgba(52, 211, 153, 0.6); color: #a7f3d0; }
.code-sample {
  margin: 0; padding: 12px 14px; border-radius: 12px; overflow-x: auto;
  background: rgba(7, 4, 15, 0.85); border: 1px solid rgba(168, 85, 247, 0.18);
  font-size: 0.76rem; line-height: 1.5; color: #e9d5ff; white-space: pre;
}

.sc-box { width: 360px; transition: width 0.35s var(--ease-fluid), transform 0.35s var(--ease-fluid), opacity 0.25s; }
/* Escondido sem display:none: o iframe continua tocando. */
.sc-box.sc-collapsed { transform: translateY(calc(100% + 160px)); opacity: 0; pointer-events: none; }
.sc-box.large { width: min(560px, calc(100vw - 44px)); }
.sc-box iframe { display: block; width: 100%; height: 166px; border: 0; background: #000; }
.sc-box.large iframe { height: 420px; }
.sc-box.tall iframe { height: 300px; }
.sc-box.large.tall iframe { height: 460px; }
#scBoxTitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

@media (max-width: 960px) {
  .links-form { grid-template-columns: 1fr; }
  .link-filter { grid-template-columns: repeat(5, auto); overflow-x: auto; max-width: 100%; }
  .link-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .link-tools { flex-wrap: wrap; }
  .link-tools select { flex: 1 1 100%; }
  .link-card .link-play { opacity: 1; transform: none; }
  .sc-box, .sc-box.large { right: 12px; left: 12px; width: auto; bottom: 150px; }
  .sc-box.tall iframe, .sc-box.large iframe, .sc-box.large.tall iframe { height: 240px; }
}

/* Erro do formulário de links: fica visível até a próxima tentativa. */
.link-error { margin: 12px 0 4px; line-height: 1.45; }

/* ==================== SELEÇÃO MÚLTIPLA NA BIBLIOTECA ==================== */
.select-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 4px 4px 12px; }
.select-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.select-actions strong { font-size: 0.86rem; color: #e9d5ff; }
.select-hint { color: var(--text-muted); font-size: 0.76rem; flex-basis: 100%; }
.btn-sm { padding: 7px 12px !important; font-size: 0.8rem !important; }
.btn-danger-glass {
  background: rgba(239, 68, 68, 0.16); border: 1px solid rgba(248, 113, 113, 0.45); color: #fecaca;
  border-radius: 10px; cursor: pointer; font-weight: 600; transition: background 0.2s, opacity 0.2s;
}
.btn-danger-glass:hover:not(:disabled) { background: rgba(239, 68, 68, 0.3); }
.btn-danger-glass:disabled { opacity: 0.4; cursor: not-allowed; }
.select-box {
  width: 18px; height: 18px; border-radius: 5px; border: 2px solid rgba(196, 181, 253, 0.6);
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; color: #fff; line-height: 1;
}
.track-row.selected { background: rgba(139, 92, 246, 0.2); box-shadow: inset 3px 0 0 #a855f7; }
.track-row.selected .select-box { background: #8b5cf6; border-color: #8b5cf6; }
.tracks-list.selecting .track-row { cursor: pointer; user-select: none; }
.tracks-list.selecting .row-actions { opacity: 0.35; pointer-events: none; }

/* ==================== DOWNLOAD DO SOUNDCLOUD ==================== */
.row-btn.sc-dl { font-size: 0.85rem; }
.row-btn.sc-dl.busy { animation: pulse-dl 1s ease-in-out infinite; }
@keyframes pulse-dl { 50% { opacity: 0.45; } }
.sc-dl-panel { margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { .row-btn.sc-dl.busy { animation: none; } }

/* ==================== CABEÇALHO DA PLAYLIST + REORDENAR ==================== */
.pl-header { display: flex; gap: 20px; align-items: center; padding: 6px 4px 18px; margin-bottom: 8px; border-bottom: 1px solid rgba(168, 85, 247, 0.14); }
.pl-cover {
  flex-shrink: 0; width: 128px; height: 128px; border-radius: 16px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
  background: linear-gradient(135deg, #2e1065, #701a75);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.28);
}
.pl-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-cover.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.pl-info { min-width: 0; flex: 1; }
.pl-eyebrow { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; color: var(--purple-400); }
.pl-info h3 { font-size: 1.6rem; line-height: 1.15; margin: 2px 0 4px; overflow-wrap: anywhere; }
.pl-info p { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 12px; }
.pl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-actions button:disabled { opacity: 0.45; cursor: not-allowed; }
.pl-hint { display: block; margin-top: 10px; font-size: 0.74rem; color: var(--text-muted); }

.drag-handle {
  flex-shrink: 0; cursor: grab; touch-action: none; user-select: none;
  color: var(--text-muted); font-size: 1.1rem; line-height: 1; padding: 6px 2px;
  border-radius: 6px; transition: color 0.2s, background 0.2s;
}
.drag-handle:hover { color: var(--text-main); background: rgba(168, 85, 247, 0.16); }
.tracks-list.reorder .track-row.dragging { opacity: 0.45; }
.tracks-list.reorder .track-row.dragging .drag-handle { cursor: grabbing; }
.track-row.drop-before { box-shadow: inset 0 2px 0 var(--magenta-500); }
.track-row.drop-after { box-shadow: inset 0 -2px 0 var(--magenta-500); }
.select-actions button:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 720px) {
  .pl-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .pl-cover { width: 96px; height: 96px; font-size: 2.2rem; }
  .pl-info h3 { font-size: 1.3rem; }
}

/* ==================== LINKS: SPOTIFY ==================== */
.links-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 6px 0 4px; }
#linkProvider { grid-template-columns: repeat(3, auto); }
#linkSort {
  background: rgba(9, 5, 20, 0.6); color: var(--text-main); border: 1px solid var(--border-glass);
  border-radius: 10px; padding: 8px 10px; font-size: 0.82rem;
}
.sp-note { margin-top: 6px; }
#linkProvider .seg-btn[data-count]::after { content: " " attr(data-count); opacity: 0.6; font-size: 0.74rem; }
.link-provider {
  position: absolute; right: 10px; top: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
  background: rgba(7, 4, 15, 0.78); border: 1px solid rgba(192, 132, 252, 0.35);
}
.link-provider.spotify { border-color: rgba(30, 215, 96, 0.6); }
.link-card.spotify .link-art { background: linear-gradient(135deg, #064e3b, #1e1b4b); }
.link-card.spotify .link-art .link-play { background: linear-gradient(135deg, #1ed760, #8b5cf6); box-shadow: 0 6px 18px rgba(30, 215, 96, 0.35); }
.link-art .link-via { right: 42px; }
.sp-wrap iframe { display: block; width: 100% !important; height: 152px !important; border: 0; }
.sc-box.tall .sp-wrap iframe { height: 352px !important; }
.sc-box.large .sp-wrap iframe { height: 420px !important; }
@media (max-width: 720px) {
  .sc-box.tall .sp-wrap iframe, .sc-box.large .sp-wrap iframe { height: 240px !important; }
}

/* ==================== APP DESKTOP (Tauri) ==================== */
/* Elementos que só existem no app do PC: escondidos no site. */
html:not(.is-desktop) .desktop-only { display: none !important; }
#btnLocalOnly { margin-top: 10px; }
.desktop-toggle {
  display: flex; align-items: center; gap: 10px; margin: 0 4px 10px;
  font-size: 0.9rem; cursor: pointer;
}
.desktop-toggle input, .job-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--purple-500); cursor: pointer; }
.job-row.toggle-row { grid-template-columns: auto minmax(0, 1fr) auto; cursor: pointer; }
.source-pill.offline { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
.source-pill.saved { background: rgba(52, 211, 153, 0.16); color: #a7f3d0; }
.track-row.is-unavailable { opacity: 0.45; }
.net-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.net-pill.on { background: rgba(52, 211, 153, 0.16); color: #a7f3d0; }
.net-pill.off { background: rgba(248, 113, 113, 0.16); color: #fecaca; }
/* App do PC no modo sem conta: esconde o que depende do servidor. */
html.is-local .needs-server{display:none!important}
