/* ==========================================================================
   SpotySync — Modern Spotify-Grade Dark Web Player UI
   ========================================================================== */
:root {
  --bg-black: #000000;
  --bg-surface: #121212;
  --bg-elevated: #181818;
  --bg-hover: #242424;
  --bg-active: #2a2a2a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #7a7a7a;
  --green: #1db954;
  --green-bright: #1ed760;
  --green-soft: rgba(29, 185, 84, 0.16);
  --purple-ai: #8b5cf6;
  --pink-ai: #ec4899;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --player-h: 88px;
  --sidebar-w: 278px;
}

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

html, body {
  height: 100%;
  background: var(--bg-black);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  color: var(--text-primary);
}

.hidden {
  display: none !important;
}

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }

/* ==================== APP SHELL LAYOUT ==================== */
.app-shell {
  display: flex;
  gap: 8px;
  padding: 8px 8px 0 8px;
  height: calc(100vh - var(--player-h));
}

/* ==================== LEFT SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.sidebar-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 14px 6px;
  cursor: pointer;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.brand-name {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-badge {
  display: inline-block;
  font-size: 11px;
  color: var(--green-bright);
  font-weight: 600;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: var(--text-primary);
  background: var(--bg-active);
}

.nav-item.nav-ai.active {
  background: linear-gradient(90deg, rgba(29, 185, 84, 0.22), rgba(139, 92, 246, 0.22));
  color: #fff;
}

.nav-ico { font-size: 17px; width: 22px; text-align: center; }

.library-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 10px 4px;
}

.library-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.library-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lib-divider {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 10px 8px 4px 8px;
}

.lib-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  text-align: left;
  width: 100%;
  transition: background 0.15s;
}

.lib-item:hover { background: var(--bg-hover); }
.lib-item.active { background: var(--bg-active); }

.lib-thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.liked-grad { background: linear-gradient(135deg, #450af5, #c4efd9); }
.all-grad { background: linear-gradient(135deg, #1db954, #14532d); }

.lib-meta { min-width: 0; flex: 1; }
.lib-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lib-sub {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mini Background Queue Widget */
.jobs-mini-panel {
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(29, 185, 84, 0.08);
  border: 1px solid rgba(29, 185, 84, 0.25);
}

.jobs-mini-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--green-bright);
  margin-bottom: 6px;
}

.jobs-badge {
  background: var(--green);
  color: #000;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
}

.job-row {
  font-size: 11px;
  margin-top: 6px;
}

.job-row-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.job-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e5e7eb;
}

.job-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
}

.job-bar-fill {
  height: 100%;
  background: var(--green-bright);
  transition: width 0.25s ease;
}

/* ==================== MAIN STAGE & TOPBAR ==================== */
.main-stage {
  flex: 1;
  min-width: 0;
  background: linear-gradient(180deg, #1d2822 0%, var(--bg-surface) 240px);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(18, 18, 18, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 10;
}

.topbar-left { flex: 1; max-width: 460px; }

.quick-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #242424;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  transition: border-color 0.15s, background 0.15s;
}

.quick-search-wrap:focus-within {
  border-color: rgba(255, 255, 255, 0.35);
  background: #2a2a2a;
}

.quick-search-wrap input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  font-size: 13.5px;
}

.qs-icon { font-size: 14px; opacity: 0.75; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 36px 24px;
}

/* ==================== BUTTONS & BADGES ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  transition: transform 0.12s, background 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-xs { padding: 4px 10px; font-size: 11.5px; }

.btn-primary {
  background: var(--green);
  color: #000;
}
.btn-primary:hover { background: var(--green-bright); }

.btn-ai {
  background: linear-gradient(135deg, #1db954, #6366f1);
  color: #fff;
}
.btn-ai:hover { opacity: 0.92; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.15); }

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.32); }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s, transform 0.12s;
  font-size: 15px;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}
.dot.green { background: var(--green-bright); box-shadow: 0 0 8px var(--green-bright); }
.dot.amber { background: var(--warning); box-shadow: 0 0 8px var(--warning); }

/* ==================== SECTION HEADERS & HERO ==================== */
.hero-greeting {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-greeting h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.hero-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 14px 0;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.section-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Quick Picks Grid (Spotify 2-row compact cards) */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  overflow: hidden;
  padding-right: 12px;
  cursor: pointer;
  position: relative;
  transition: background 0.18s;
}

.quick-card:hover { background: rgba(255, 255, 255, 0.16); }

.quick-card img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  flex-shrink: 0;
}

.quick-card-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.quick-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.18s;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

.quick-card:hover .quick-play {
  opacity: 1;
  transform: translateY(0);
}

/* Music Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(182px, 1fr));
  gap: 16px;
}

.music-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.music-card:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.music-card.playing-card {
  box-shadow: inset 0 0 0 1.5px var(--green);
}

.card-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  background: #202020;
}

.card-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-play-fab {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: #000;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
}

.music-card:hover .card-play-fab,
.music-card.playing-card .card-play-fab {
  opacity: 1;
  transform: translateY(0);
}

.card-play-fab:hover {
  background: var(--green-bright);
  transform: scale(1.06);
}

.match-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  color: var(--green-bright);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(30, 215, 96, 0.35);
}

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-artist {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-reason {
  font-size: 11.5px;
  color: #9ca3af;
  margin-top: 7px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== TRACK TABLE ==================== */
.track-table {
  width: 100%;
  border-collapse: collapse;
}

.track-row {
  display: grid;
  grid-template-columns: 38px minmax(180px, 2fr) minmax(110px, 1fr) 72px 136px;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.14s;
}

.track-row.track-head {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  margin-bottom: 6px;
}

.track-row:not(.track-head):hover {
  background: rgba(255, 255, 255, 0.08);
}

.track-row.is-playing {
  background: rgba(29, 185, 84, 0.12);
}

.track-row.is-playing .tr-title {
  color: var(--green-bright);
}

.tr-idx {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.tr-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.tr-cover {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.tr-text { min-width: 0; }
.tr-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tr-artist {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tr-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d1d5db;
  white-space: nowrap;
}

.tag-chip.mood {
  background: rgba(139, 92, 246, 0.18);
  color: #ddd6fe;
}

.tr-dur {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

/* ==================== AI DJ STUDIO ==================== */
.ai-banner {
  background: linear-gradient(135deg, rgba(29, 185, 84, 0.24) 0%, rgba(99, 102, 241, 0.28) 55%, rgba(236, 72, 153, 0.2) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.ai-banner h1 {
  font-size: 26px;
  font-weight: 800;
}

.ai-prompt-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.ai-prompt-row .input {
  flex: 1;
  min-width: 240px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill-btn {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.pill-btn:hover { background: rgba(255, 255, 255, 0.16); }
.pill-btn.active {
  background: var(--green);
  color: #000;
  border-color: var(--green-bright);
}

.dj-message-box {
  background: var(--bg-elevated);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 18px;
}

.dj-engine-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(29, 185, 84, 0.18);
  color: var(--green-bright);
  margin-bottom: 6px;
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.discovery-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.discovery-card:hover { border-color: rgba(29, 185, 84, 0.45); }

/* ==================== TASTE PROFILE VIEW ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-subtle);
}

.stat-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--green-bright);
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.taste-panel {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border-subtle);
  margin-top: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 48px;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  font-size: 13px;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), #38bdf8);
}

/* ==================== PLAYLIST BANNER ==================== */
.playlist-banner {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 22px;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.playlist-cover-big {
  width: 148px;
  height: 148px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.playlist-banner-meta h1 {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.15;
}

/* ==================== RIGHT DRAWER ==================== */
.right-drawer {
  width: 310px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-tabs { display: flex; gap: 6px; }
.drawer-tab {
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--text-secondary);
}
.drawer-tab.active {
  background: var(--bg-active);
  color: #fff;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.queue-item:hover { background: var(--bg-hover); }
.queue-item.active { background: rgba(29, 185, 84, 0.16); }
.queue-item img { width: 38px; height: 38px; border-radius: 5px; object-fit: cover; }

/* ==================== PERSISTENT SPOTIFY PLAYER BAR ==================== */
.player-bar {
  height: var(--player-h);
  background: #0a0a0a;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.4fr) minmax(200px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0 18px;
}

.player-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: #1f1f1f;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.player-track-info { min-width: 0; flex: 1; }
.player-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctrl-btn {
  font-size: 16px;
  color: var(--text-secondary);
  padding: 4px 7px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.ctrl-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.ctrl-btn.active { color: var(--green-bright); }

.auto-dj-btn {
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 3px 9px;
}
.auto-dj-btn.active {
  background: rgba(29, 185, 84, 0.16);
  border-color: var(--green);
  color: var(--green-bright);
}

.sleep-btn {
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 9px;
  font-variant-numeric: tabular-nums;
}
.sleep-btn.active {
  background: rgba(139, 92, 246, 0.22);
  border-color: #a78bfa;
  color: #ddd6fe;
}

.sleep-active-box {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(29, 185, 84, 0.14));
  border: 1px solid rgba(167, 139, 250, 0.4);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  margin-bottom: 14px;
}

.sleep-active-label {
  font-size: 12px;
  color: #ddd6fe;
  font-weight: 600;
}

.sleep-countdown-big {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 4px 0 10px 0;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.sleep-active-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sleep-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sleep-eot-btn {
  grid-column: 1 / -1;
}

.sleep-custom-row {
  display: flex;
  gap: 8px;
}

.sleep-fade-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #e5e7eb;
  cursor: pointer;
}

.sleep-fade-toggle input[type="checkbox"] {
  accent-color: var(--green);
  width: 16px;
  height: 16px;
}

.android-bg-card {
  background: rgba(29, 185, 84, 0.08);
  border: 1px solid rgba(29, 185, 84, 0.25);
  border-radius: 10px;
  padding: 12px;
}

.android-bg-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-bright);
  margin-bottom: 4px;
}

.play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s;
}
.play-btn:hover { transform: scale(1.06); }

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 540px;
}

.time-label {
  font-size: 11px;
  color: var(--text-secondary);
  width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.seek-bar, .volume-bar {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: #404040;
  outline: none;
  cursor: pointer;
}

.seek-bar { flex: 1; }
.volume-bar { width: 92px; }

.seek-bar::-webkit-slider-thumb,
.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.seek-bar:hover::-webkit-slider-thumb,
.volume-bar:hover::-webkit-slider-thumb {
  background: var(--green-bright);
}

.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.mini-visualizer {
  width: 84px;
  height: 28px;
  border-radius: 4px;
}

/* ==================== FORMS & MODALS ==================== */
.input {
  width: 100%;
  background: #222222;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--green); }
.input-sm { padding: 6px 10px; font-size: 12.5px; width: auto; }

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.hint-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal {
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.modal-sm { max-width: 420px; }
.modal-lg { max-width: 820px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  gap: 8px;
}

.tab-btn {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
}
.tab-btn.active {
  color: var(--green-bright);
  border-bottom-color: var(--green-bright);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-footer-inline {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--green);
  background: rgba(29, 185, 84, 0.08);
}
.dropzone-ico { font-size: 36px; margin-bottom: 8px; }
.dropzone small { color: var(--text-secondary); display: block; margin-top: 6px; }

.status-msg { font-size: 13px; color: var(--green-bright); min-height: 18px; }
.status-msg.err { color: #f87171; }

/* Update & Logs Console */
.update-summary {
  background: #111;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  font-size: 13.5px;
  line-height: 1.65;
}

.log-console {
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  color: #a7f3d0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
}

.log-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.log-stats {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.log-entries {
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  max-height: 380px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.log-entry {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: pre-wrap;
  word-break: break-word;
}
.log-entry.ERROR { color: #fca5a5; background: rgba(239, 68, 68, 0.08); }
.log-entry.WARNING { color: #fde68a; }
.log-entry.INFO { color: #d1d5db; }

/* Online search results */
.online-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}
.online-row img {
  width: 60px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.online-meta { flex: 1; min-width: 0; }

/* Toast */
.toast-container {
  position: fixed;
  right: 18px;
  bottom: calc(var(--player-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: #232323;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 4px solid var(--green);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  animation: fadeSlideUp 0.2s ease;
}
.toast.err { border-left-color: var(--danger); }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Nav */
.mobile-nav {
  display: none;
}

@media (max-width: 900px) {
  body {
    display: flex;
    flex-direction: column;
  }
  .sidebar, .right-drawer, .mini-visualizer, .volume-bar, #btnMute {
    display: none !important;
  }
  .app-shell {
    padding: 0;
    flex: 1;
    height: auto;
    min-height: 0;
  }
  .main-stage { border-radius: 0; }
  .topbar { padding: 10px 12px; }
  .content-scroll { padding: 14px 14px 28px 14px; }
  .player-bar {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 92px;
    padding: 8px 12px;
    gap: 6px;
  }
  .player-left { gap: 8px; }
  .player-cover { width: 42px; height: 42px; }
  .player-controls { gap: 8px; }
  .player-right { display: none; }
  .track-row {
    grid-template-columns: 28px 1fr 54px 72px;
  }
  .tr-tags { display: none; }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 56px;
    background: #0a0a0a;
    border-top: 1px solid var(--border-subtle);
  }
  .mnav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-secondary);
    font-size: 16px;
  }
  .mnav-btn small { font-size: 10px; }
  .mnav-btn.active { color: var(--green-bright); }
  .form-grid { grid-template-columns: 1fr; }
}
