/* ═══════════════════════════════════════════════════════════
   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;
  --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; }

/* ═══ 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-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 3px;
}

.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(52,211,153,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(52,211,153,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 20px;
  cursor: pointer;
  border-radius: var(--radius);
  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(52,211,153,0.08); }
.btn-primary.active { color: var(--accent); border-color: rgba(52,211,153,0.32); background: rgba(52,211,153,0.08); }

.btn-sm { font-size: 10px; padding: 4px 12px; }
.btn-xs { font-size: 9px; padding: 3px 9px; 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;
}

.panel-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  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(52,211,153,0.28);
  background: rgba(52,211,153,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(52,211,153,0.07); }
.list-item.playing-active {
  background: linear-gradient(90deg, rgba(52,211,153,0.16), rgba(52,211,153,0.05) 58%, transparent 100%);
}
.list-item.playing-paused {
  background: linear-gradient(90deg, rgba(136,136,136,0.14), rgba(52,211,153,0.03) 58%, transparent 100%);
}
.list-item.selected.playing,
.list-item.selected.playing-active,
.list-item.selected.playing-paused {
  background: linear-gradient(90deg, rgba(52,211,153,0.2), rgba(52,211,153,0.11) 58%, rgba(52,211,153,0.06) 100%);
}
.list-item.selected { background: rgba(52,211,153,0.12); }
.list-item.expanded { background: rgba(52,211,153,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; }
.list-item.playing-jump-flash {
  animation: playingJumpFlash 1.05s ease;
}

@keyframes playingJumpFlash {
  0% {
    box-shadow: inset 0 0 0 0 rgba(52,211,153,0.34);
  }
  40% {
    box-shadow: inset 0 0 0 999px rgba(52,211,153,0.12);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(52,211,153,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;
}

.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(52,211,153,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;
}

#album-art-container {
  width: 180px;
  height: 180px;
  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);
}

#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: 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  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); }

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

/* ═══ Panel toggles ═══ */
#panel-toggles {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ═══ 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); }
}

.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-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(52,211,153,0.08);
  color: var(--text);
}

.bp-fetch-wrap {
  padding: 5px 12px;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}

.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: 22px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
#status-text {
  font-size: 10px;
  color: var(--text-3);
  flex: 1;
}
.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;
}
.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: 2px 6px;
  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; }

#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-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(52,211,153,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; }
  #album-art-container { width: 150px; height: 150px; }
}
