/* ═══════════════════════════════════════════════════════════
   Lightify — Neutral Dark Theme
   Palette: charcoal grays + soft emerald accent
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:           #111111;
  --surface:      #1a1a1a;
  --surface-2:    #202020;
  --panel:        #171717;
  --border:       #2c2c2c;
  --border-hi:    #444444;
  --accent:       #34d399;
  --accent-dim:   #10b981;
  --accent-rgb:   52, 211, 153;
  --text:         #e2e2e2;
  --text-2:       #888888;
  --text-3:       #4e4e4e;
  --danger:       #f87171;
  --heart:        #fb7185;
  --heart-empty:  var(--text-3);
  --radius:       5px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.hidden { display: none !important; }

/* ═══ Boot splash ═══ */
/* Shown from first paint so the auth page never flashes while a cached session
   resolves (~70ms). Covers everything below the 30px titlebar (window controls
   stay usable). Removed after a short min-display buffer via #splash-screen.splash-out. */
#splash-screen {
  position: fixed;
  left: 0; right: 0; top: 30px; bottom: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  opacity: 1;
  transition: opacity 0.38s ease;
}
#splash-screen.splash-out { opacity: 0; pointer-events: none; }
.splash-spinner {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(var(--accent-rgb), 0.18);
  border-top-color: var(--accent);
  animation: splash-spin 0.8s linear infinite;
}
@keyframes splash-spin { to { transform: rotate(360deg); } }
.splash-wordmark {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 6px;
  user-select: none;
}
@media (prefers-reduced-motion: reduce) {
  .splash-spinner { animation-duration: 1.6s; }
}

/* ═══ Title bar ═══ */
#titlebar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  height: 30px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 6px;
  -webkit-app-region: drag;
  flex-shrink: 0;
}

.titlebar-brand {
  display: flex;
  align-items: center;
  /* Tight gap so the L-shaped toggle reads as the "L" in "LIGHTIFY", continuing
     into the "IGHTIFY" wordmark. */
  gap: 1px;
  min-width: 0;
}

.titlebar-mark-toggle {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  -webkit-app-region: no-drag;
  transition: background 0.12s, color 0.12s;
}

.titlebar-mark-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

.titlebar-mark-toggle:focus-visible {
  outline: 1px solid rgba(var(--accent-rgb),0.4);
  outline-offset: 1px;
}

.titlebar-mark-icon {
  display: block;
  transform-origin: center;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.titlebar-mark-toggle.collapsed .titlebar-mark-icon {
  transform: scaleX(-1);
}

.titlebar-wordmark {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 3px;
  white-space: nowrap;
}

.titlebar-drag-fill {
  flex: 1;
  min-width: 0;
  height: 100%;
}

.titlebar-btns {
  display: flex;
  margin-left: auto;
  -webkit-app-region: no-drag;
}

.caption-btn {
  background: none;
  border: none;
  color: var(--text-3);
  width: 34px;
  height: 26px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.caption-btn:hover { background: var(--surface-2); color: var(--text); }
.caption-close:hover { background: var(--danger); color: #fff; }

/* ═══ Pages ═══ */
.page {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ═══ Auth page ═══ */
#auth-page {
  justify-content: center;
  align-items: center;
}

.auth-box {
  text-align: center;
  max-width: 460px;
  padding: 40px 32px;
}

.auth-box h1 {
  color: var(--text);
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 4px;
  margin-bottom: 20px;
}

.auth-box .dim {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.75;
}

.auth-box code {
  color: var(--accent);
  background: rgba(var(--accent-rgb),0.09);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  font-size: 11px;
}

.auth-link-btn {
  appearance: none;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-link-btn:hover {
  color: #6ee7b7;
}

.auth-link-btn:focus-visible {
  outline: 1px solid rgba(var(--accent-rgb),0.45);
  outline-offset: 2px;
  border-radius: 2px;
}

.auth-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 16px;
}

.auth-row label {
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
  font-weight: 500;
}

.auth-row input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}
.auth-row input:focus { border-color: var(--accent); }
.auth-row input::placeholder { color: var(--text-3); }

.auth-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.status { font-size: 12px; margin-top: 12px; min-height: 18px; color: var(--text-2); }
.status.error { color: var(--danger); }
.status.ok { color: var(--accent); }

/* ═══ Buttons ═══ */
.btn-primary {
  background: none;
  border: 1px solid var(--border-hi);
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 16px;
  cursor: pointer;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  gap: 6px;
  line-height: 1;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--surface-2); border-color: var(--accent); color: var(--text); }
.btn-primary:disabled { opacity: 0.32; cursor: default; pointer-events: none; }
.btn-primary:active:not(:disabled) { background: rgba(var(--accent-rgb),0.08); }
.btn-primary.active { color: var(--accent); border-color: rgba(var(--accent-rgb),0.32); background: rgba(var(--accent-rgb),0.08); }

.btn-sm { font-size: 10px; padding: 5px 12px; min-height: 28px; }
.btn-xs { font-size: 10px; padding: 4px 10px; min-height: 24px; border-color: var(--border); }
.btn-xs:hover { border-color: var(--border-hi); }

/* ═══ Player layout ═══ */
#player-page { display: flex; }

#left-panel {
  width: clamp(240px, 30vw, 300px);
  min-width: 240px;
  max-width: min(360px, 42vw);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--border);
  min-height: 0;
  min-width: 0;
  position: relative;
  transition: width 0.18s ease, min-width 0.18s ease;
}

#left-panel.collapsed {
  width: 0;
  min-width: 0;
  border-right-color: transparent;
}

#left-panel.collapsed .panel-tabs,
#left-panel.collapsed .tab-content {
  display: none;
}

.panel-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-width: 0;
  min-height: 31px;
}

.panel-tabs {
  flex: 1;
  display: flex;
  min-width: 0;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  padding: 8px 4px;
  cursor: pointer;
  letter-spacing: 0.8px;
  transition: color 0.12s, border-color 0.12s;
}
.tab-btn:hover { color: var(--text-2); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

/* back nav button inside tab */
#btn-back, #btn-search-back {
  margin: 5px 8px;
  flex-shrink: 0;
  align-self: flex-start;
  max-width: calc(100% - 16px);
}

.library-toolbar {
  display: flex;
  gap: 6px;
  padding: 0 8px 6px;
  flex-shrink: 0;
  align-items: center;
  flex-wrap: wrap;
}

.library-jump-btn {
  margin-left: auto;
}

/* ═══ Search bar ═══ */
.search-bar {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}
.search-bar input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar input::placeholder { color: var(--text-3); }

/* ═══ Search filters ═══ */
#search-filters {
  display: flex;
  padding: 4px 8px;
  gap: 3px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.filter-btn {
  flex: 1 1 0;
  background: none;
  border: 1px solid transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 8px;
  font-weight: 700;
  padding: 3px 6px;
  cursor: pointer;
  letter-spacing: 0.5px;
  border-radius: 3px;
  transition: color 0.1s, background 0.1s, border-color 0.1s;
  min-width: 0;
  white-space: nowrap;
}
.filter-btn:hover { color: var(--text-2); }
.filter-btn.active {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb),0.28);
  background: rgba(var(--accent-rgb),0.07);
}

/* ═══ Scroll lists ═══ */
.scroll-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

.scroll-list,
.search-expansion-list,
#settings-panel,
.settings-watchdog-report,
.settings-devices-list,
.custom-select-menu {
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}

.scroll-list::-webkit-scrollbar,
.search-expansion-list::-webkit-scrollbar,
#settings-panel::-webkit-scrollbar,
.settings-watchdog-report::-webkit-scrollbar,
.settings-devices-list::-webkit-scrollbar,
.custom-select-menu::-webkit-scrollbar { width: 6px; }

.scroll-list::-webkit-scrollbar-track,
.search-expansion-list::-webkit-scrollbar-track,
#settings-panel::-webkit-scrollbar-track,
.settings-watchdog-report::-webkit-scrollbar-track,
.settings-devices-list::-webkit-scrollbar-track,
.custom-select-menu::-webkit-scrollbar-track { background: transparent; }

.scroll-list::-webkit-scrollbar-thumb,
.search-expansion-list::-webkit-scrollbar-thumb,
#settings-panel::-webkit-scrollbar-thumb,
.settings-watchdog-report::-webkit-scrollbar-thumb,
.settings-devices-list::-webkit-scrollbar-thumb,
.custom-select-menu::-webkit-scrollbar-thumb {
  background: var(--border-hi);
  border-radius: 999px;
}

.scroll-list::-webkit-scrollbar-thumb:hover,
.search-expansion-list::-webkit-scrollbar-thumb:hover,
#settings-panel::-webkit-scrollbar-thumb:hover,
.settings-watchdog-report::-webkit-scrollbar-thumb:hover,
.settings-devices-list::-webkit-scrollbar-thumb:hover,
.custom-select-menu::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

.list-item {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(44,44,44,0.5);
  cursor: pointer;
  transition: background 0.08s;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.list-item:hover { background: var(--surface-2); }
.list-item.playing::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.95;
}
.list-item.playing { background: rgba(var(--accent-rgb),0.07); }
.list-item.playing-active {
  background: linear-gradient(90deg, rgba(var(--accent-rgb),0.16), rgba(var(--accent-rgb),0.05) 58%, transparent 100%);
}
.list-item.playing-paused {
  background: linear-gradient(90deg, rgba(136,136,136,0.14), rgba(var(--accent-rgb),0.03) 58%, transparent 100%);
}
.list-item.selected.playing,
.list-item.selected.playing-active,
.list-item.selected.playing-paused {
  background: linear-gradient(90deg, rgba(var(--accent-rgb),0.2), rgba(var(--accent-rgb),0.11) 58%, rgba(var(--accent-rgb),0.06) 100%);
}
.list-item.selected { background: rgba(var(--accent-rgb),0.12); }
.list-item.expanded { background: rgba(var(--accent-rgb),0.09); }
.list-item.playing .item-icon { color: var(--accent); }
.list-item.playing-paused .item-icon { color: var(--text-2); }
.list-item.playing .item-name { color: #f4fff9; }
.list-item.playing-active .item-sub { color: #9fd4bf; }
.list-item.playing-paused .item-sub { color: #9a9a9a; }
/* Region-locked track: no playable version in the user's market (is_playable=false). */
.list-item.track-unavailable { opacity: 0.42; }
.list-item.track-unavailable .item-name { text-decoration: line-through; text-decoration-thickness: 1px; }
.list-item.download-active {
  background: linear-gradient(90deg, rgba(var(--accent-rgb),0.08), rgba(var(--accent-rgb),0.03) 62%, transparent 100%);
}
.list-item.download-new {
  animation: downloadRowFlash 1.2s ease;
}
.list-item.playing-jump-flash {
  animation: playingJumpFlash 1.05s ease;
}

@keyframes playingJumpFlash {
  0% {
    box-shadow: inset 0 0 0 0 rgba(var(--accent-rgb),0.34);
  }
  40% {
    box-shadow: inset 0 0 0 999px rgba(var(--accent-rgb),0.12);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(var(--accent-rgb),0);
  }
}

@keyframes downloadRowFlash {
  0% {
    box-shadow: inset 0 0 0 0 rgba(var(--accent-rgb),0.34);
    background: rgba(var(--accent-rgb),0.04);
  }
  40% {
    box-shadow: inset 0 0 0 999px rgba(var(--accent-rgb),0.1);
    background: rgba(var(--accent-rgb),0.1);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(var(--accent-rgb),0);
    background: rgba(var(--accent-rgb),0);
  }
}

.item-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

.item-body { flex: 1; min-width: 0; }

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

.item-sub {
  font-size: 10px;
  color: var(--text-2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-progress {
  margin-top: 6px;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.download-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(var(--accent-rgb),0.75), rgba(110,231,183,0.95));
  transition: width 0.18s ease;
}

.search-expansion {
  border-bottom: 1px solid rgba(44,44,44,0.65);
  background: rgba(12,12,12,0.42);
  padding: 0 8px 8px 37px;
  min-width: 0;
}

.search-expansion-status {
  color: var(--text-2);
  font-size: 10px;
  padding: 6px 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-expansion-list {
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  border-left: 1px solid rgba(var(--accent-rgb),0.22);
  background: rgba(0,0,0,0.16);
  min-width: 0;
}

.search-expansion-list .list-item {
  padding: 7px 10px;
}

/* ═══ Right panel ═══ */
#right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 320px;
  min-height: 0;
  background: var(--bg);
}

/* ═══ Now Playing ═══ */
#now-playing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

#album-art-container {
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}

/* Full (non-mini) now-playing view scales with the window on BOTH axes, bounded
   so it never overflows the centered, overflow:hidden #now-playing column. Mini
   modes (body.mini-*) keep their own sizes and are never matched by :not(.mini-player). */
body:not(.mini-player) #album-art-container {
  width: auto;
  aspect-ratio: 1 / 1;
  block-size: clamp(150px, min(46vh, 34vw), 460px);
}
body:not(.mini-player) #track-info   { max-width: clamp(340px, 42vw, 560px); }
body:not(.mini-player) #progress-row { max-width: clamp(380px, 44vw, 620px); }
body:not(.mini-player) #track-name   { font-size: clamp(14px, 1.7vh, 20px); }
body:not(.mini-player) #track-artist { font-size: clamp(12px, 1.35vh, 16px); }
body:not(.mini-player) #controls     { gap: clamp(10px, 1.3vw, 22px); }
body:not(.mini-player) .ctrl-btn     { min-width: clamp(32px, 4.4vh, 46px); min-height: clamp(32px, 4.4vh, 46px); }
body:not(.mini-player) .ctrl-btn svg { width: clamp(18px, 2.5vh, 26px); height: auto; }
body:not(.mini-player) .ctrl-btn.play-btn     { width: clamp(38px, 5.2vh, 58px); height: clamp(38px, 5.2vh, 58px); }
body:not(.mini-player) .ctrl-btn.play-btn svg { width: clamp(22px, 3vh, 30px); }
body:not(.mini-player) #volume-row   { width: clamp(148px, 20vw, 260px); }

#album-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#no-art {
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  user-select: none;
}

#track-info {
  text-align: center;
  max-width: 340px;
  width: 100%;
}
#track-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#track-artist {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══ Progress bar ═══ */
#progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 380px;
}
#elapsed, #duration {
  font-size: 10px;
  color: var(--text-3);
  font-family: 'Cascadia Code', 'Consolas', monospace;
  min-width: 34px;
  text-align: center;
}
#progress-bar {
  flex: 1;
  height: 3px;
  background: var(--surface-2);
  border-radius: 2px;
  cursor: pointer;
  transition: height 0.1s;
}
#progress-bar:hover { height: 5px; }
#progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s linear;
}

/* ═══ Controls ═══ */
#controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 7px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  transition: color 0.12s;
}
.ctrl-btn:hover { color: var(--text); }
.ctrl-btn.active { color: var(--accent); }

.ctrl-btn.play-btn {
  background: var(--text);
  color: var(--bg);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  transition: background 0.12s, transform 0.1s;
}
.ctrl-btn.play-btn:hover { background: var(--accent); transform: scale(1.06); }
.ctrl-btn.liked { color: var(--heart); }

/* ═══ Volume ═══ */
#volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 148px;
  color: var(--text-3);
}
#volume-slider {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 3px;
  background: var(--surface-2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}
#volume-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ═══ UI polish: dynamic accent · motion · recent list ═══ */

/* Dynamic album-art accent — tints to the current cover; falls back to the
   default teal when no color has been sampled (or CORS blocked the sample). */
#progress-fill { background: var(--accent-dynamic, var(--accent)); }
#volume-slider::-webkit-slider-thumb { background: var(--accent-dynamic, var(--accent)); }
#album-art-container {
  box-shadow: 0 8px 32px rgba(0,0,0,0.45),
              0 12px 46px -8px var(--accent-dynamic-soft, transparent);
  transition: box-shadow 0.6s ease;
}

/* Cover crossfade on track change. */
#album-art.art-swap { animation: artSwap 0.42s ease; }
@keyframes artSwap {
  0%   { opacity: 0.2; transform: scale(1.04); }
  100% { opacity: 1;   transform: scale(1); }
}
/* Play button press feedback. */
.ctrl-btn.play-btn:active { transform: scale(0.93); }

/* Recent / queue sidebar: de-emphasize the repeated track glyph. */
#sidebar-list .item-icon { color: var(--text-3); opacity: 0.55; }
#sidebar-list .list-item.playing .item-icon { color: var(--accent); opacity: 1; }

/* Relative-time chip on Recent rows. */
.item-time {
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 8px;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Animated equalizer bars on the actively-playing row. */
.eq-bars { display: none; align-items: flex-end; gap: 2px; height: 12px; }
.list-item.playing-active .item-icon svg { display: none; }
.list-item.playing-active .item-icon .eq-bars { display: inline-flex; }
.eq-bars i {
  width: 3px;
  height: 100%;
  background: var(--accent-dynamic, var(--accent));
  border-radius: 1px;
  transform-origin: bottom;
  animation: eqBar 0.9s ease-in-out infinite;
}
.eq-bars i:nth-child(1) { animation-delay: -0.20s; }
.eq-bars i:nth-child(2) { animation-delay: -0.55s; }
.eq-bars i:nth-child(3) { animation-delay: -0.35s; }
@keyframes eqBar { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  #album-art.art-swap { animation: none; }
  .eq-bars i { animation: none; }
}

/* Skeleton loaders (shown while a list loads) + centered empty states. */
.skeleton-row { pointer-events: none; cursor: default; }
.skeleton-row:hover { background: transparent; }
.skeleton-block {
  background: linear-gradient(90deg, var(--surface-2) 25%, rgba(255,255,255,0.07) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  border-radius: 4px;
  animation: skeletonShimmer 1.3s ease-in-out infinite;
}
.skeleton-icon { width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0; }
.skeleton-line { height: 9px; }
.skeleton-line-sub { height: 7px; margin-top: 6px; }
@keyframes skeletonShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.list-item.list-empty {
  cursor: default;
  justify-content: center;
  padding: 22px 12px;
  border-bottom: none;
}
.list-item.list-empty:hover { background: transparent; }
.list-item.list-empty .item-body { flex: 0 1 auto; text-align: center; }
.list-item.list-empty .item-name { white-space: normal; letter-spacing: 0.02em; }

@media (prefers-reduced-motion: reduce) {
  .skeleton-block { animation: none; }
}

/* Direct-manipulation queue: drag grip + remove button (hover-revealed). */
.queue-grip, .queue-remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.queue-grip { cursor: grab; }
.queue-grip:active { cursor: grabbing; }
.queue-remove {
  font-size: 15px;
  line-height: 1;
  width: 18px;
  height: 18px;
  border-radius: 4px;
}
.list-item:hover .queue-grip,
.list-item:hover .queue-remove { opacity: 0.55; }
.queue-grip:hover { opacity: 1; color: var(--text); }
.queue-remove:hover { opacity: 1; color: #ff6b6b; background: rgba(255,107,107,0.14); }
.list-item.drag-source { opacity: 0.4; }
.list-item.drag-over { box-shadow: inset 0 2px 0 0 var(--accent-dynamic, var(--accent)); }

/* ═══ Mini player ═══ */
.caption-btn.active { background: var(--surface-2); color: var(--accent); }

/* Common to every mini layout: hide the browsing chrome + statusbar so the
   compact window is just titlebar + now-playing. */
body.mini-player #left-panel,
body.mini-player #sidebar,
body.mini-player #volume-row,
body.mini-player #extras-row,
body.mini-player #statusbar,
body.mini-player #btn-shuffle,
body.mini-player #btn-repeat,
body.mini-player .titlebar-brand { display: none; }

body.mini-player #right-panel {
  min-width: 0;
  /* Album-tinted frame — a subtle inset border that picks up the cover accent. */
  box-shadow: inset 0 0 0 1px var(--accent-dynamic-soft, rgba(255,255,255,0.07));
}

/* ── Square — cover-forward: big art + title up top, transport pinned to the
   bottom. The bottom edge line is the only progress indicator (no inline bar). ── */
body.mini-square #now-playing {
  justify-content: flex-start;
  padding: 20px 18px 20px;
  gap: 12px;
}
body.mini-square #album-art-container {
  width: min(70vw, 240px);
  height: auto;
  aspect-ratio: 1 / 1;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5),
              0 12px 40px -8px var(--accent-dynamic-soft, transparent);
}
body.mini-square #track-info { max-width: 100%; }
body.mini-square #track-name { font-size: 14px; }
body.mini-square #track-artist { font-size: 11px; }
body.mini-square #progress-row { display: none; } /* replaced by the edge line */
body.mini-square #controls { margin-top: auto; gap: 8px; }

/* ── Bar — horizontal media strip: cover ▸ title/progress ▸ transport ── */
body.mini-bar #now-playing {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "art info controls"
    "art progress controls";
  align-items: center;
  align-content: center;
  gap: 2px 12px;
  padding: 0 16px;
}
body.mini-bar #album-art-container {
  grid-area: art;
  width: 84px;
  height: 84px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5),
              0 8px 24px -8px var(--accent-dynamic-soft, transparent);
}
body.mini-bar #track-info { grid-area: info; text-align: left; max-width: 100%; align-self: end; }
body.mini-bar #track-name { font-size: 13px; }
body.mini-bar #track-artist { font-size: 10px; margin-top: 1px; }
body.mini-bar #progress-row { grid-area: progress; max-width: 100%; gap: 6px; align-self: start; }
body.mini-bar #elapsed,
body.mini-bar #duration { min-width: 26px; font-size: 9px; }
body.mini-bar #controls { grid-area: controls; gap: 6px; }
body.mini-bar .ctrl-btn { padding: 5px; min-width: 28px; min-height: 28px; }

/* ── Nano — cover fills the content area (below the titlebar); transport on hover ── */
body.mini-nano #now-playing { padding: 0; gap: 0; align-items: stretch; }
body.mini-nano #album-art-container {
  flex: 1;
  width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: none;
  cursor: zoom-in;
}
body.mini-nano #track-info,
body.mini-nano #progress-row { display: none; }
/* Transport is a small pill near the bottom so the rest of the cover stays a
   click target for expand-to-square. pointer-events gate on hover so the hidden
   pill never swallows a cover click. */
body.mini-nano #controls {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.52);
  opacity: 0;
  pointer-events: none;
}
body.mini-nano #now-playing:hover #controls,
body.mini-nano #now-playing:focus-within #controls { opacity: 1; pointer-events: auto; }

/* ── Snap control (layout switch) — lives in the titlebar, only shown in mini. ── */
#mini-modes { display: none; }
body.mini-player #mini-modes {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 6px;
  padding: 2px;
  border-radius: 6px;
  background: var(--surface-2);
}
.mini-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.mini-mode-btn:hover { color: var(--text); background: var(--bg); }
.mini-mode-btn.active { color: var(--accent); background: rgba(var(--accent-rgb),0.16); }

/* ── Edge progress line, pinned to the bottom of the mini window (square/nano) ── */
#mini-edge { display: none; }
body.mini-player #mini-edge {
  display: block;
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 6;
  pointer-events: none;
}
/* Bar carries its own inline progress row, so drop the edge line there to avoid
   a double indicator (must follow the rule above to win on equal specificity). */
body.mini-bar #mini-edge { display: none; }

/* ── Idle-fade: dim the chrome after a pause in pointer movement (cover stays).
   Gated behind no-preference so reduced-motion users keep chrome visible.
   The snap control lives in the titlebar and is intentionally not faded. ── */
@media (prefers-reduced-motion: no-preference) {
  body.mini-player #track-info,
  body.mini-player #progress-row,
  body.mini-square #controls,
  body.mini-bar #controls { transition: opacity 0.4s ease; }
  body.mini-player #mini-edge { transition: width 0.3s linear; }
  body.mini-idle #track-info,
  body.mini-idle #progress-row { opacity: 0; }
  body.mini-idle.mini-square #controls,
  body.mini-idle.mini-bar #controls { opacity: 0; }
}

/* ═══ Extras row ═══ */
#extras-row {
  display: flex;
  gap: 14px;
}

/* ═══ Panel toggles ═══ */
#panel-toggles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  justify-self: center;
}

.footer-dock-btn {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-2);
  gap: 0;
}

.footer-dock-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.footer-dock-btn:hover {
  background: transparent;
  border: none;
  color: var(--text);
}

.footer-dock-btn:active:not(:disabled) {
  background: transparent;
}

.footer-dock-btn.active {
  background: transparent;
  border: none;
  color: var(--accent);
}

/* ═══ Sidebar ═══ */
#sidebar {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 268px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
  animation: slideIn 0.17s ease;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
/* Smooth slide-out on close (closeSidebar adds this, then hides after the anim). */
#sidebar.sidebar-closing {
  animation: slideOut 0.17s ease forwards;
  pointer-events: none;
}
@keyframes slideOut {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#sidebar-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 2px;
}

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

.sidebar-header-btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.4px;
  min-height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  transition: color 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}

.sidebar-header-btn:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}

.sidebar-header-btn:disabled {
  opacity: 0.28;
  cursor: default;
}

.sidebar-clear-btn {
  color: var(--text-2);
}

.sidebar-clear-btn:hover:not(:disabled) {
  color: var(--accent);
  background: rgba(var(--accent-rgb),0.06);
}

.sidebar-close-btn {
  width: 24px;
  min-width: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-close-btn:hover:not(:disabled) {
  color: var(--text);
}

#sidebar-actions {
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
}

/* ═══ Beatport panel ═══ */
.bp-header {
  color: var(--text-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 10px 12px 6px;
  flex-shrink: 0;
}

.bp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.bp-label {
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
}

#bp-genre {
  position: relative;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.custom-select {
  position: relative;
  min-width: 0;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.12s, color 0.12s;
}

.custom-select-trigger:hover { border-color: var(--border-hi); color: var(--text); }
.custom-select-trigger:focus,
.custom-select.open .custom-select-trigger { border-color: var(--accent); }

.custom-select-label {
  min-width: 0;
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-caret {
  color: var(--text-3);
  font-size: 10px;
  transition: transform 0.12s ease;
}

.custom-select.open .custom-select-caret { transform: rotate(180deg); }

.custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: 6px;
  box-shadow: 0 14px 28px rgba(0,0,0,0.45);
  z-index: 40;
}

.custom-select-option {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 11px;
  padding: 7px 10px;
  text-align: left;
  cursor: pointer;
  transition: background 0.08s, color 0.08s;
}

.custom-select-option:hover,
.custom-select-option.active {
  background: rgba(var(--accent-rgb),0.08);
  color: var(--text);
}

.bp-fetch-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 6px;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}

.bp-mode-cluster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.bp-mode-btn,
.bp-icon-btn {
  width: 100%;
  min-width: 0;
  height: 26px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.12s ease, color 0.12s ease;
  box-shadow: none;
}

.bp-mode-btn img,
.bp-icon-btn img {
  width: 18px;
  height: 18px;
  display: block;
  opacity: 0.72;
  filter: none;
}

.bp-mode-btn:hover,
.bp-icon-btn:hover {
  background: rgba(255,255,255,0.03);
  box-shadow: none;
}

.bp-mode-btn:active:not(:disabled),
.bp-icon-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.bp-mode-btn.active {
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.bp-mode-btn.active img,
.bp-icon-btn:hover img {
  opacity: 1;
}

.bp-icon-btn {
  width: 28px;
  min-width: 28px;
  justify-self: end;
  border-radius: 8px;
  background: transparent;
}

.bp-icon-btn:hover {
  background: rgba(255, 184, 107, 0.08);
}

.bp-mode-btn:disabled,
.bp-icon-btn:disabled {
  opacity: 0.5;
}

.bp-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
  gap: 8px;
  flex-wrap: wrap;
}

.bp-actions .btn-primary,
.bp-fetch-wrap .btn-primary {
  min-width: 0;
  max-width: 100%;
}

.bp-actions .btn-primary {
  flex: 1 1 120px;
}

.bp-status {
  font-size: 10px;
  color: var(--text-3);
  padding: 4px 12px 8px;
  word-wrap: break-word;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}

/* ═══ Status bar ═══ */
#statusbar {
  height: 26px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 10px;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.statusbar-start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  justify-self: start;
}

#status-text {
  font-size: 10px;
  color: var(--text-3);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-logout {
  font-size: 9px;
  padding: 2px 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.05em;
  justify-self: end;
}
.btn-logout:hover { border-color: var(--accent); color: var(--accent); }

/* ═══ Settings gear button ═══ */
.btn-settings {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px 8px;
  margin: 0;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s;
}
.btn-settings:hover { color: var(--accent); }

/* ═══ Settings overlay + panel ═══ */
#settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
#settings-overlay.hidden { display: none; }

/* ═══ Command palette ═══ */
#command-palette {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 205;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
#command-palette.hidden { display: none; }
#cmdk-panel {
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  width: min(560px, calc(100vw - 32px));
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
#cmdk-input {
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  padding: 14px 16px;
  outline: none;
}
#cmdk-input::placeholder { color: var(--text-3); }
#cmdk-list {
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#cmdk-list.hidden { display: none; }
.cmdk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-2);
}
.cmdk-item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item-hint {
  flex-shrink: 0;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.cmdk-item.active { background: rgba(var(--accent-rgb),0.16); color: var(--text); }
.cmdk-item.active .cmdk-item-hint { color: var(--accent); }
#cmdk-empty { padding: 20px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
#cmdk-empty.hidden { display: none; }

#confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.62);
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
}

#confirm-overlay.hidden { display: none; }

#settings-panel {
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  width: min(440px, calc(100vw - 32px));
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
}

#confirm-panel {
  background: var(--panel);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  width: min(360px, calc(100vw - 32px));
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  padding: 14px;
}

.confirm-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.confirm-message {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.confirm-danger {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.35);
}

.confirm-danger:hover {
  background: rgba(248, 113, 113, 0.10);
  border-color: var(--danger);
  color: #ffd0d0;
}

.settings-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.settings-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 2px;
}

.settings-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-child { border-bottom: none; }

.settings-section-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.settings-hint {
  font-size: 11px;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.settings-select,
.settings-input {
  background: rgba(0,0,0,0.18);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  min-height: 32px;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.12s, background 0.12s;
}

.settings-select:focus,
.settings-input:focus {
  border-color: var(--accent);
  background: rgba(0,0,0,0.28);
}

.settings-select {
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.settings-action-row {
  display: flex;
  gap: 8px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.settings-action-row-inline {
  align-items: center;
}

.settings-input-row {
  display: flex;
  gap: 8px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.settings-input-row .settings-input {
  flex: 1 1 220px;
}

.settings-watchdog-report {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0,0,0,0.18);
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.45;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.settings-devices-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 130px;
  overflow-y: auto;
}

.settings-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.settings-device-name {
  font-size: 12px;
  color: var(--text-2);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.settings-device-name.settings-device-active { color: var(--accent); }

.settings-radio-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.settings-radio {
  font-size: 11px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}
.settings-radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin: 0;
  border-radius: 50%;
  border: 1px solid var(--border-hi);
  background: rgba(0,0,0,0.18);
  box-shadow: inset 0 0 0 5px transparent;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}

.settings-radio input[type="radio"]:checked {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--accent);
}

/* ═══ Context menu ═══ */
.ctx-menu {
  position: fixed;
  background: var(--surface-2);
  border: 1px solid var(--border-hi);
  border-radius: 6px;
  padding: 4px 0;
  z-index: 100;
  min-width: 156px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.ctx-menu-item {
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.08s, color 0.08s;
}
.ctx-menu-item:hover { background: rgba(var(--accent-rgb),0.08); color: var(--text); }
.ctx-menu-item.danger { color: var(--danger); }
.ctx-menu-item.danger:hover { background: rgba(248,113,113,0.10); color: #ffd0d0; }

/* ═══ Responsive ═══ */
@media (max-width: 900px) {
  #left-panel { width: 240px; min-width: 200px; }
  /* Artwork now scales fluidly via `body:not(.mini-player) #album-art-container`
     (clamp on both axes), so no hard breakpoint override is needed here. */
}
