.playback-card .metrics-row,
.playback-card .extra-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 6px 0;
  font-size: 14px;
  color: #bbb;
}
.playback-card .metrics-row div,
.playback-card .extra-row div {
  min-width: 110px;
}
.metrics-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 11px;
  font-weight: 600;
  color: #e5f3ff;
  white-space: nowrap;
}
.metric-badge .metric-label {
  color: #8ca0b9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 10px;
}
.metric-badge .metric-value {
  color: #fff;
  font-weight: 600;
}
.playback-card .meter {
  flex: 1;
  min-width: 120px;
}
.playback-card + .playback-card {
  margin-top: 16px;
}
.playback-card.track-transitioning {
  animation: track-transition 0.6s ease-out;
}
@keyframes track-transition {
  0% {
    background-color: rgba(255, 193, 7, 0.05);
  }
  50% {
    background-color: rgba(255, 193, 7, 0.15);
  }
  100% {
    background-color: transparent;
  }
}
.deck-grid {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 20px;
  align-items: stretch;
}
.deck-grid .playback-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
}
.deck-grid .playback-card + .playback-card {
  margin-top: 0;
}

/* DECK LAYOUT REWRITE: unified deck-section. Rollback: see DECK_LAYOUT_ROLLBACK.md */
.station-main .deck-grid .deck-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}
.station-main .deck-grid .deck-section {
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(14, 28, 46, 0.95);
  border: 1px solid rgba(80, 140, 210, 0.35);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
}
.station-main .deck-grid .deck-section:last-child {
  margin-bottom: 0;
}
.station-main .deck-grid .deck-section--live {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.station-main .deck-grid .deck-section-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.station-main .deck-grid .deck-section .deck-section-row .deck-track-info,
.station-main .deck-grid .deck-section .deck-section-row .deck-track-row {
  flex: 1 1 auto;
  min-width: 0;
}
.station-main .deck-grid .deck-section .deck-metrics--right {
  flex-shrink: 0;
  margin-left: auto;
}
body.theme-light .station-main .deck-grid .deck-card {
  background: transparent;
  border: none;
  box-shadow: none;
}
body.theme-light .station-main .deck-grid .deck-section {
  background: #fff;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Decks – On-Air title (LIVE/WAIT) + timer as text to the right of LIVE */
.deck-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.deck-remain-text {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #9fa8b3;
  font-weight: 500;
}
/* DECK LAYOUT REWRITE: unified deck-section. Rollback: see DECK_LAYOUT_ROLLBACK.md */
#deckNowPlaying .progress {
  margin-top: 6px;
  margin-bottom: 6px;
}
#deckNowPlaying .progress .meter {
  height: 8px;
}
#deckNowPlaying .progress .meter > span {
  border-radius: 4px;
}
.deck-waveform-container {
  position: relative;
  width: 100%;
  height: 80px;
  margin: 8px 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  overflow: hidden;
}
.deck-waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.deck-waveform-status {
  position: absolute;
  right: 8px;
  top: 6px;
  font-size: 11px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(8, 12, 20, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
  pointer-events: none;
}
.deck-waveform-status:empty,
.deck-waveform-status[hidden] {
  display: none;
}
.deck-waveform2-container {
  position: relative;
  width: 100%;
  height: 108px;
  margin: 8px 0 10px;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.82), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  overflow: hidden;
}
.deck-waveform2-header {
  position: absolute;
  left: 10px;
  top: 8px;
  z-index: 2;
  pointer-events: auto;
}
.deck-waveform2-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(191, 219, 254, 0.96);
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  padding: 2px 8px;
}
.deck-waveform2-info-btn {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.72);
  color: rgba(226, 232, 240, 0.96);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  padding: 0;
  cursor: pointer;
}
.deck-waveform2-info-btn:hover {
  background: rgba(30, 41, 59, 0.84);
}
.deck-waveform2-info-btn:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.85);
  outline-offset: 1px;
}
.deck-waveform2-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.deck-waveform2-status {
  position: absolute;
  right: 8px;
  top: 6px;
  font-size: 11px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(8, 12, 20, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
  pointer-events: none;
}
.deck-waveform2-status:empty,
.deck-waveform2-status[hidden] {
  display: none;
}
.deck-debug-row {
  display: grid;
  grid-template-columns: auto auto;
  align-items: start;
  gap: 6px 12px;
  margin-top: 6px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* limit reflow/paint to this strip (avoids full-page flicker with Vanta/canvas behind deck) */
  contain: layout style;
}
.deck-debug-row .deck-heartbeat-debug,
.deck-debug-row .deck-profile-settings-debug {
  margin-top: 0;
  min-width: 0;
  width: auto;
  max-width: none;
}
.deck-debug-row .deck-heartbeat-debug[open],
.deck-debug-row .deck-profile-settings-debug[open] {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
}
.deck-debug-row .deck-heartbeat-debug[open] .deck-heartbeat-debug__panel,
.deck-debug-row .deck-profile-settings-debug[open] .deck-heartbeat-debug__panel {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.deck-heartbeat-debug {
  margin-top: 6px;
  width: 100%;
  box-sizing: border-box;
}
.deck-heartbeat-debug__summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
  margin: 0;
}
.deck-heartbeat-debug__summary::-webkit-details-marker {
  display: none;
}
.deck-heartbeat-debug__summary::marker {
  content: '';
}
.deck-heartbeat-debug__summary-hint {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.5);
}
.deck-heartbeat-debug__chev {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid rgba(255, 255, 255, 0.55);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  margin-left: 2px;
  transition: transform 0.15s ease;
  transform: rotate(0deg);
}
.deck-heartbeat-debug[open] .deck-heartbeat-debug__chev {
  transform: rotate(90deg);
}
.deck-heartbeat-debug__panel {
  margin-top: 6px;
}
.deck-heartbeat-debug__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.deck-heartbeat-debug__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}
.deck-heartbeat-debug__clear {
  font-size: 11px;
  padding: 2px 10px;
  min-height: 0;
}
.deck-heartbeat-debug__body {
  margin: 0;
  max-height: 160px;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.95);
  white-space: pre-wrap;
  word-break: break-word;
}
#deckNowPlaying {
  position: relative;
}
/* Deck status summary above decks */
.deck-status-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.status-item--delay-sync {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.status-item--delay-sync .deck-delay-sync-toggle,
.status-item--delay-sync .deck-delay-sync-select {
  flex-shrink: 0;
}
.deck-status-bar .status-item.status-item--delay-sync {
  flex: 0 1 250px;
  min-width: 0;
  max-width: 250px;
}
.deck-delay-sync-toggle {
  border: 1px solid rgba(120, 170, 230, 0.35);
  background: rgba(8, 20, 34, 0.78);
  color: #dbeafe;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.deck-delay-sync-toggle[aria-pressed="true"] {
  border-color: rgba(74, 222, 128, 0.65);
  background: rgba(8, 40, 24, 0.8);
  color: #86efac;
}
.deck-delay-sync-select {
  min-width: 64px;
  height: 26px;
  border: 1px solid rgba(80, 140, 210, 0.3);
  border-radius: 8px;
  background: rgba(14, 28, 46, 0.95);
  color: #c8d6e5;
  font-size: 12px;
  padding: 2px 8px;
}
.deck-delay-sync-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.deck-mode-card {
  margin-bottom: 16px;
}

.deck-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
}

.deck-mode-row--modes {
  justify-content: flex-start;
}

.deck-mode-row + .deck-mode-row {
  border-top: 1px solid rgba(80, 140, 210, 0.22);
}

.deck-mode-toggle-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-mode-toggle-switch {
  transform: scale(0.9);
}

.deck-mode-label {
  font-size: 0.9rem;
  color: #f1d28a;
}

.deck-mode-label-left {
  color: #ff6f6f;
}

.deck-mode-label-right {
  color: #f1d28a;
}

.deck-mode-select-group {
  min-width: 180px;
  flex: 0 0 200px;
}

/* Deck status summary inline with mode pills */
.deck-status-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

/* Deck mode pill toggle (Playlist vs Scheduler) */
.deck-mode-pill-toggle {
  position: relative;
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(80,140,210,0.35);
  padding: 3px;
  background: rgba(14,28,46,0.95);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  min-width: 220px;
  overflow: hidden;
}

.deck-mode-pill-highlight {
  position: absolute;
  inset: 1px;
  width: 50%;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  transition: transform 0.22s ease, background 0.22s ease;
  z-index: 0;
}

.deck-mode-pill-option {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #9fb3cc;
  padding: 5px 10px;
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.deck-mode-pill-option--scheduler {
  color: #f1d28a;
}

.deck-mode-pill-toggle[data-mode="playlist"] .deck-mode-pill-highlight {
  transform: translateX(0%);
  background: linear-gradient(135deg, #ff6f6f, #b33030);
}

.deck-mode-pill-toggle[data-mode="scheduler"] .deck-mode-pill-highlight {
  transform: translateX(100%);
  background: linear-gradient(135deg, #ffd45c, #f0a500);
}

.deck-mode-pill-toggle[data-mode="playlist"] .deck-mode-pill-option--playlist {
  color: #040404;
}

.deck-mode-pill-toggle[data-mode="scheduler"] .deck-mode-pill-option--scheduler {
  color: #040404;
}

.deck-mode-pill-option.disabled {
  opacity: 0.45;
  cursor: default;
}
.deck-status-bar .status-item,
.deck-status-inline .status-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #dfe9f5;
  flex: 1 1 170px;
  min-width: 0;
}
.deck-status-bar .status-item {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 6px 14px;
  border: 1px solid rgba(90, 142, 210, 0.24);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 35, 56, 0.72), rgba(13, 24, 39, 0.62));
  overflow: hidden;
  box-sizing: border-box;
  flex-wrap: nowrap;
}
.deck-status-bar .status-item--wide,
.deck-status-inline .status-item--wide {
  flex: 2 1 260px;
  min-width: 220px;
}
.deck-status-bar .status-item--wide {
  flex: 1 1 auto;
  min-width: 0;
}
/* Scheduler + Playlist: equal width share */
.deck-status-bar .status-item--deck-primary {
  flex: 1 1 0;
  min-width: 0;
}
/* Ident only (no --compact-wide): max 200px — On/Off / Queued text */
.deck-status-bar .status-item--compact:not(.status-item--compact-wide) {
  flex: 0 1 200px;
  min-width: 0;
  max-width: 200px;
}
/* Progression uses --compact-wide */
.deck-status-bar .status-item--compact.status-item--compact-wide {
  flex: 0 1 200px;
  max-width: 260px;
  min-width: 172px;
}
@media (min-width: 640px) {
  .deck-status-bar .status-item--deck-primary {
    flex: 1 1 0;
    min-width: 120px;
  }
  .deck-status-bar .status-item--compact:not(.status-item--compact-wide) {
    flex: 0 1 200px;
    min-width: 0;
    max-width: 200px;
  }
  .deck-status-bar .status-item--compact.status-item--compact-wide {
    flex: 0 0 auto;
    max-width: 260px;
  }
  .deck-status-bar .status-item:not(.status-item--compact):not(.status-item--deck-primary) {
    flex: 1 1 120px;
    min-width: 0;
  }
}
/* Hide status items one by one before they wrap (order: Sync, Playlist, Scheduler, Progression; Idents stays last) */
@media (max-width: 1500px) {
  .deck-status-bar .status-item[data-system="delay-sync"] { display: none !important; }
}
@media (max-width: 1300px) {
  .deck-status-bar .status-item[data-system="engine"] { display: none !important; }
}
@media (max-width: 1100px) {
  .deck-status-bar .status-item[data-system="scheduler"] { display: none !important; }
}
@media (max-width: 950px) {
  .deck-status-bar .status-item[data-system="progression"] { display: none !important; }
}
@media (max-width: 639px) {
  .deck-status-bar .status-item {
    min-width: 0;
    flex: 1 1 auto;
  }
}
.deck-status-bar .status-label,
.deck-status-inline .status-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
  color: #8ca0b9;
  flex-shrink: 0;
  white-space: nowrap;
}
.deck-status-bar .status-value,
.deck-status-inline .status-value {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  position: relative;
  top: -1px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deck-status-bar .status-meta,
.deck-status-inline .status-meta {
  color: #9fb7d4;
  font-size: 13px;
  position: relative;
  top: -1px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deck-status-bar .status-item > .status-meta:empty,
.deck-status-inline .status-item > .status-meta:empty {
  display: none;
}
.deck-status-bar .status-dot,
.deck-status-inline .status-dot {
  flex-shrink: 0;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #58657a, #3a4454);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.45);
}
.status-dot--on {
  background: linear-gradient(135deg, #6ee7a1, #2fbf71);
  box-shadow: 0 0 8px rgba(111, 231, 161, 0.6);
}
.status-dot--warn {
  background: linear-gradient(135deg, #ffd86f, #ffb347);
  box-shadow: 0 0 8px rgba(255, 216, 111, 0.55);
}
.status-dot--off {
  background: linear-gradient(135deg, #ff7a7a, #d13838);
  box-shadow: 0 0 8px rgba(255, 122, 122, 0.45);
}
.deck-status-pills .system-chip .chip-label {
  text-align: center;
}
.deck-status-pills .system-chip .chip-value {
  text-align: center;
}
.deck-grid .playback-card .manual-inline-buttons {
  margin-top: 8px;
}
.track-history-card {
  margin-top: 24px;
}
.track-history-header {
  background: #1a1a1a !important;
  border-bottom: 1px solid #333 !important;
  border-left: none !important;
  border-radius: 0 !important;
  padding: 12px 16px;
}
.track-history-body {
  padding: 16px;
}
.deck-bpm-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 10px;
  color: #ffd86f;
  background: rgba(255, 216, 111, 0.06);
}

/* Track history list (pool-result style) */
.track-history-list-wrapper {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(17,17,17,0.75);
  overflow: hidden;
}
.track-history-list {
  max-height: 520px;
  overflow-y: auto;
  scrollbar-color: #707070 #101010;
}
.track-history-list::-webkit-scrollbar {
  width: 8px;
}
.track-history-list::-webkit-scrollbar-track {
  background: #101010;
  border-radius: 6px;
}
.track-history-list::-webkit-scrollbar-thumb {
  background: #707070;
  border-radius: 6px;
}
.track-history-list::-webkit-scrollbar-thumb:hover {
  background: #8d8d8d;
}

/* Header row */
.track-history-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7b8d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
  position: sticky;
  top: 0;
  background: rgba(17,17,17,0.97);
  z-index: 1;
}
.th-hplay {
  flex-shrink: 0;
  width: 28px;
}
.th-htime {
  flex-shrink: 0;
  width: 40px;
}
.th-htrack {
  flex: 1;
  min-width: 0;
}
.th-hbpm {
  flex-shrink: 0;
  min-width: 50px;
  text-align: right;
}
.th-hharmonic {
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
}
.th-hprofile {
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
}
.th-hselection {
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
}
.th-htransition {
  flex-shrink: 0;
  min-width: 70px;
  text-align: center;
}

/* Data rows */
.track-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}
.track-history-row:last-child {
  border-bottom: none;
}
.track-history-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.track-history-row--progression {
  background: rgba(255, 193, 7, 0.08);
}
.track-history-row--progression:hover {
  background: rgba(255, 193, 7, 0.12);
}

/* Play column */
.th-play {
  flex-shrink: 0;
  width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.th-play-placeholder {
  display: inline-block;
  width: 28px;
  height: 28px;
}
.track-history-play {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #9fb3cc;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.track-history-play:hover {
  background: rgba(41, 121, 255, 0.2);
  color: #fff;
}
.track-history-play.active {
  background: rgba(41, 121, 255, 0.3);
  color: #fff;
}

/* Time column */
.th-time {
  flex-shrink: 0;
  width: 40px;
  color: #8ca0b9;
  font-size: 11px;
  white-space: nowrap;
}

/* Track column – match track search styling */
.th-track {
  flex: 1;
  min-width: 0;
}
.track-history-meta {
  display: flex;
  gap: 6px;
  align-items: baseline;
  overflow: hidden;
}
.track-history-artist {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.track-history-sep {
  color: #556;
  flex-shrink: 0;
}
.track-history-title {
  color: #b0c4de;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.track-history-row--ident .track-history-artist,
.track-history-row--ident .track-history-title {
  color: #8ca0b9;
  font-weight: 400;
}
.th-actions {
  flex-shrink: 0;
  width: 32px;
  min-width: 32px;
  display: inline-flex;
  justify-content: flex-end;
}
.track-history-actions-wrap {
  position: relative;
  display: inline-flex;
}
.track-history-actions-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.track-history-actions-trigger:hover,
.track-history-actions-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
}
.track-history-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(12, 20, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.track-history-actions-menu[hidden] {
  display: none !important;
}
.track-history-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #e8eefb;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.track-history-menu-item:hover,
.track-history-menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

/* BPM column */
.th-bpm {
  flex-shrink: 0;
  min-width: 50px;
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #8ca0b9;
}
.track-history-bpm-perceptual {
  color: #ffc107;
  font-weight: 600;
}

/* Harmonic column */
.th-harmonic {
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
}
.th-harmonic .metric-badge {
  width: 24px;
  min-width: 24px;
  max-width: 24px;
  justify-content: center;
  padding: 3px 0;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}
.th-harmonic .metric-badge .metric-value {
  font-size: 10px;
  font-weight: 600;
}
/* Camelot key colors — dark theme text is white */
.th-harmonic .metric-badge[class*="key-"] .metric-value {
  color: #fff;
}
.th-harmonic .metric-badge.key-1  { background-color: #e74c3c; }
.th-harmonic .metric-badge.key-2  { background-color: #e67e22; }
.th-harmonic .metric-badge.key-3  { background-color: #f1c40f; }
.th-harmonic .metric-badge.key-4  { background-color: #2ecc71; }
.th-harmonic .metric-badge.key-5  { background-color: #27ae60; }
.th-harmonic .metric-badge.key-6  { background-color: #1abc9c; }
.th-harmonic .metric-badge.key-7  { background-color: #3498db; }
.th-harmonic .metric-badge.key-8  { background-color: #2980b9; }
.th-harmonic .metric-badge.key-9  { background-color: #9b59b6; }
.th-harmonic .metric-badge.key-10 { background-color: #8e44ad; }
.th-harmonic .metric-badge.key-11 { background-color: #e91e63; }
.th-harmonic .metric-badge.key-12 { background-color: #f06292; }

/* Profile column */
.th-profile {
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
  font-size: 12px;
  color: #8ca0b9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Selection column */
.th-selection {
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
  font-size: 12px;
  color: #8ca0b9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Transition column */
.th-transition {
  flex-shrink: 0;
  min-width: 70px;
  text-align: center;
}
.th-hactions {
  flex-shrink: 0;
  width: 32px;
  min-width: 32px;
}
.th-transition .flowforge-mix-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  border: 1px solid;
}
.th-ident-label {
  display: inline-block;
  padding: 2px 6px;
  line-height: 1.2;
  color: #8ca0b9;
  font-size: 11px;
  font-weight: 400;
}

/* Empty / loading message */
.track-history-empty-msg {
  text-align: center;
  color: #8ca0b9;
  padding: 24px;
  font-size: 13px;
}

/* Pagination */
.track-history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Track history responsiveness: hide columns in order as width shrinks */
/* 1. Profile */
@media (max-width: 1100px) {
  #panel-history .track-history-header-row .th-hprofile,
  #panel-history .track-history-row .th-profile {
    display: none;
  }
}
/* 2. Preview audio */
@media (max-width: 1000px) {
  #panel-history .track-history-header-row .th-hplay,
  #panel-history .track-history-row .th-play {
    display: none;
  }
}
/* 3. Selection */
@media (max-width: 900px) {
  #panel-history .track-history-header-row .th-hselection,
  #panel-history .track-history-row .th-selection {
    display: none;
  }
}
/* 4. Transition */
@media (max-width: 800px) {
  #panel-history .track-history-header-row .th-htransition,
  #panel-history .track-history-row .th-transition {
    display: none;
  }
}
/* 5. Time */
@media (max-width: 700px) {
  #panel-history .track-history-header-row .th-htime,
  #panel-history .track-history-row .th-time {
    display: none;
  }
}
/* 6. Title – hide track name, keep artist only when very narrow */
@media (max-width: 600px) {
  #panel-history .track-history-sep,
  #panel-history .track-history-title {
    display: none;
  }
}

/* Playback panel: soft background so body/vanta black doesn’t show as a solid box behind decks + engine events */
/* All station panels: same bordered container as deck */
.station-main .panel {
  background: rgba(12, 24, 42, 0.5);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(69, 118, 185, 0.2);
  border-top-color: rgba(69, 118, 185, 0.14);
}
#panel-playback .deck-panel-header {
  margin: 0 0 12px 0;
  justify-content: flex-start;
  gap: 12px;
}
#panel-playback .deck-panel-header .deck-mode-pill-toggle {
  flex-shrink: 0;
  min-width: 260px;
}
#panel-playback .deck-panel-header .pool-select {
  flex: 1 1 300px;
  min-width: 200px;
  max-width: 520px;
  margin-left: auto;
}
#panel-playback .deck-status-bar {
  margin-top: 0;
}
.deck-now-body {
  padding-top: 8px;
  padding-bottom: 8px;
}
.deck-now-body:empty,
.deck-now-body:has(.deck-idle-message[hidden]) {
  padding-top: 0;
  padding-bottom: 0;
}
#deckNowPlaying .deck-now-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 20, 35, 0.92);
  border-radius: 8px;
  padding: 12px;
  pointer-events: none;
}
#deckNowPlaying .deck-now-loading[aria-hidden="true"] {
  display: none;
}
.deck-now-loading-bar {
  height: 4px;
  width: 100%;
  max-width: 200px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.deck-now-loading-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 40%;
  background: rgba(122, 167, 255, 0.9);
  border-radius: 2px;
  animation: deck-loading-slide 1.2s ease-in-out infinite;
}
@keyframes deck-loading-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.deck-events-card {
  margin-top: 12px;
  padding: 8px;
}
.deck-events-card.deck-events-collapsible .deck-events-header {
  cursor: pointer;
  user-select: none;
  justify-content: flex-start;
  gap: 6px;
  margin: -8px -8px 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
}
.deck-events-card.deck-events-collapsible .deck-events-header .header-controls {
  margin-left: auto;
}
.deck-events-card.deck-events-collapsible.collapsed .deck-events-header .header-controls {
  display: none;
}
.deck-events-card.deck-events-collapsible .deck-events-toggle-arrow {
  display: inline-block;
  margin-right: 2px;
  font-size: 9px;
  transition: transform 0.2s ease;
}
.deck-events-card.deck-events-collapsible.collapsed .deck-events-toggle-arrow {
  transform: rotate(-90deg);
}
.deck-events-card.deck-events-collapsible.collapsed .deck-events-body {
  display: none;
}
.deck-events-card .deck-events-body.panel-body {
  padding: 8px 10px 10px;
}
.deck-events-card .events-panel {
  display: flex;
  flex-direction: column;
}
.deck-events-card .events-log {
  order: 1;
  margin-bottom: 0;
  max-height: 200px;
  padding: 4px 6px;
  font-size: 11px;
  border-radius: 6px;
  scrollbar-color: #707070 #101010;
}
.deck-events-card .events-log::-webkit-scrollbar {
  width: 6px;
}
.deck-events-card .events-log::-webkit-scrollbar-track {
  background: #101010;
  border-radius: 4px;
}
.deck-events-card .events-log::-webkit-scrollbar-thumb {
  background: #707070;
  border-radius: 4px;
}
.deck-events-card .events-log::-webkit-scrollbar-thumb:hover {
  background: #8d8d8d;
}
.deck-events-card .events-entry {
  padding: 4px 6px;
  gap: 6px;
  border-bottom: 1px solid #242424;
}
.deck-events-card .events-entry .event-body {
  gap: 3px;
}
.deck-events-card .events-entry .event-meta {
  font-size: 10px;
}
.deck-events-card .events-entry .event-time {
  font-size: 10px;
  min-width: 48px;
}
.deck-events-card .events-entry .event-kind {
  font-size: 10px;
}
.deck-events-card .event-section {
  font-size: 11px;
}
.deck-events-card .event-badge {
  font-size: 10px;
  padding: 2px 5px;
}
.deck-events-card .event-text {
  font-size: 11px;
}
.deck-events-card .btn.btn--sm {
  padding: 2px 8px;
  font-size: 11px;
}
.deck-events-card .events-toolbar {
  order: 2;
  margin-top: 0;
}
.deck-heading {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.deck-header-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.deck-header-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* DECK REWRITE: deck-section replaces cue-card for Next/Seed */
.station-main .deck-grid .deck-section .deck-queue-row {
  margin-top: 0;
}
.station-main .deck-grid .deck-section .deck-title--badge {
  flex-shrink: 0;
  width: 56px;
  min-width: 56px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b8d4e8;
  text-align: center;
  box-sizing: border-box;
}
body.theme-light .station-main .deck-grid .deck-section .deck-title--badge {
  background: #e5e5e5;
  border-color: hsl(0 0% 85%);
  color: #525252;
}
.station-main .deck-grid .deck-section .deck-queue-row .deck-track-row {
  flex: 1 1 auto;
  min-width: 0;
}

/* Live deck: track info left, metrics right (same as Next/Seed) */
.deck-section-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-top: 4px;
  width: 100%;
}
.deck-section-row:first-child {
  margin-top: 0;
}
#deckNowPlaying .deck-section-row .deck-live-badge {
  flex-shrink: 0;
}

/* LIVE + Timer badge: same style box as Next/Seed, split left (red+white LIVE) / right (light red+black timer) */
.deck-live-badge {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-sizing: border-box;
}
.deck-live-badge .deck-live-badge-label,
.deck-live-badge .deck-live-badge-timer {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.deck-live-badge-label {
  padding: 4px 10px;
  text-align: center;
}
.deck-live-badge-label.live {
  background: #b91c1c;
  color: #fff !important;
}
.deck-live-badge-label.wait {
  background: #737373;
  color: #fff;
}
.deck-live-badge-timer {
  padding: 4px 10px;
  background: #fecaca;
  color: #000 !important;
  text-align: center;
}
body.theme-light .deck-live-badge {
  background: transparent;
  border-color: hsl(0 0% 85%);
}
body.theme-light .deck-live-badge-label.live {
  background: #b91c1c;
  color: #fff !important;
}
body.theme-light .deck-live-badge-label.wait {
  background: #737373;
  color: #fff;
}
body.theme-light .deck-live-badge-timer {
  background: #fecaca;
  color: #000 !important;
}
#deckNowPlaying .deck-now-row .deck-track-info {
  flex: 1 1 auto;
  min-width: 0;
}
/* Keep kebab next to artist/title, not pushed right by expanding track */
#deckNowPlaying .deck-track-info .deck-track {
  flex: 0 1 auto;
}
#deckNowPlaying .deck-metrics--right {
  flex-shrink: 0;
  margin-left: auto;
}

.deck-header-wrapper {
  min-width: 0;
  overflow: visible;
}

.deck-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deck-track-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.deck-track-row .deck-track-info {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.deck-track-row .deck-metrics--queued {
  flex: 0 0 auto;
  white-space: nowrap;
}

.deck-header-separator {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 12px 0;
}

.deck-metrics--inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.deck-metrics--inline .deck-queued-block-btn {
  padding: 0;
  font-size: 10px;
  line-height: 1;
  border-radius: 3px;
  height: 18px;
  width: 18px;
  min-width: 18px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  justify-content: center;
}
.deck-subtitle {
  position: relative;
  font-size: 16px;
  color: #f2fbff;
  font-weight: 600;
  letter-spacing: 0.1px;
  text-transform: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: ellipsis;
  padding-right: 16px;
}
.deck-edit-icon {
  position: absolute;
  top: 7px;
  right: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
  font-size: 11px;
  line-height: 1;
  padding: 2px 4px 2px 3px;
  cursor: pointer;
  opacity: 0.6;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  display: inline-block;
  z-index: 1;
  border-radius: 4px;
}
.deck-heading:hover .deck-edit-icon {
  opacity: 0.9;
}
.deck-edit-icon:hover:not(:disabled),
.deck-edit-icon:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  opacity: 1;
}
.deck-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-weight: 600;
  color: #7aa7ff;
}
.history-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.history-row > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.playback-card .history-row strong {
  font-size: 13px;
  color: #9fa8b3;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.history-value {
  font-size: 14px;
  color: #dfe6f3;
  font-weight: 600;
}
.playback-card .progress {
  margin-top: 14px;
  margin-bottom: 12px;
}
.cue-card .progress {
  margin-top: 14px;
  margin-bottom: 12px;
}

/* Stations deck – compact layout */
/* Deck metric badges: LABEL on top, DATA below; every box same width and height */
.station-main .deck-grid .deck-metrics {
  padding: 4px 0;
  gap: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}
.station-main .deck-grid .deck-metrics .metric-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 56px;
  min-width: 56px;
  height: 40px;
  min-height: 40px;
  padding: 4px 3px;
  gap: 0;
  flex-shrink: 0;
  box-sizing: border-box;
  background: transparent;
  border: none;
}
.station-main .deck-grid .deck-metrics .metric-badge .metric-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8ca0b9;
  line-height: 1.1;
  order: 1;
}
.station-main .deck-grid .deck-metrics .metric-badge .metric-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  min-width: 0;
  order: 2;
}
.station-main .deck-grid .deck-metrics .metric-label {
  font-size: 11px;
}
.station-main .deck-grid .deck-metrics .metric-value {
  font-size: 14px;
}
.station-main .deck-grid .deck-metrics .metric-badge.metric-last {
  width: 72px;
  min-width: 72px;
}
.deck-metric-last-wrap {
  display: inline-flex;
  align-items: stretch;
  gap: 4px;
  flex-shrink: 0;
}
.deck-track-menu-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.deck-track-menu-anchor--metric {
  align-self: stretch;
}
.deck-track-menu-anchor--metric .deck-track-menu-btn {
  width: 28px;
  height: 40px;
  margin: 0;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: none;
}
.deck-track-menu-anchor--metric .deck-track-menu {
  top: calc(100% + 6px);
  right: 0;
  bottom: auto;
}
/* Beatmix: crossfade icon to the left of BPM */
.station-main .deck-grid .deck-metrics .deck-now-beatmix-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  margin: 0 8px 0 0;
  line-height: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
/* author display:inline-flex must not override HTML [hidden]; otherwise chip stays visible */
.station-main .deck-grid .deck-metrics .deck-now-beatmix-chip[hidden] {
  display: none !important;
}
.station-main .deck-grid .deck-metrics .deck-now-beatmix-chip .deck-now-beatmix-icon {
  display: block;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  object-fit: contain;
  vertical-align: top;
  /* SVG is dark-filled; deck metrics are white on dark theme — invert to match */
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
body.theme-light .station-main .deck-grid .deck-metrics .deck-now-beatmix-chip .deck-now-beatmix-icon {
  filter: none;
  opacity: 1;
}

@keyframes deck-bpm-tempo-live-pulse-dark {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.45), 0 0 0 0 rgba(250, 204, 21, 0);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(253, 224, 71, 0.85), 0 0 12px 3px rgba(250, 204, 21, 0.42);
  }
}

@keyframes deck-bpm-tempo-live-pulse-light {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(202, 138, 4, 0.55), 0 0 0 0 rgba(202, 138, 4, 0);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.75), 0 0 10px 2px rgba(250, 204, 21, 0.38);
  }
}

/* Live tempo stretch: yellow chip on the number only — same badge footprint as other metrics (no flex shift) */
.station-main .deck-grid .deck-metrics .metric-badge.metric-bpm.metric-bpm--tempo-live .metric-value {
  display: inline-block;
  margin: 0 auto;
  width: auto;
  max-width: 100%;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(234, 179, 8, 0.22);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.45);
  color: #facc15;
  animation: deck-bpm-tempo-live-pulse-dark 1.35s ease-in-out infinite;
}
/* KEY badge: neutral box; only the harmonic value (e.g. 8A) in a colored chip, like track history */
.station-main .deck-grid .deck-metrics .metric-key .metric-value {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}
.station-main .deck-grid .deck-metrics .metric-key.key-1  .metric-value { background-color: #e74c3c; color: #1a1a1a !important; }
.station-main .deck-grid .deck-metrics .metric-key.key-2  .metric-value { background-color: #e67e22; color: #1a1a1a !important; }
.station-main .deck-grid .deck-metrics .metric-key.key-3  .metric-value { background-color: #f1c40f; color: #1a1a1a !important; }
.station-main .deck-grid .deck-metrics .metric-key.key-4  .metric-value { background-color: #2ecc71; color: #1a1a1a !important; }
.station-main .deck-grid .deck-metrics .metric-key.key-5  .metric-value { background-color: #27ae60; color: #1a1a1a !important; }
.station-main .deck-grid .deck-metrics .metric-key.key-6  .metric-value { background-color: #1abc9c; color: #1a1a1a !important; }
.station-main .deck-grid .deck-metrics .metric-key.key-7  .metric-value { background-color: #3498db; color: #1a1a1a !important; }
.station-main .deck-grid .deck-metrics .metric-key.key-8  .metric-value { background-color: #2980b9; color: #1a1a1a !important; }
.station-main .deck-grid .deck-metrics .metric-key.key-9  .metric-value { background-color: #9b59b6; color: #1a1a1a !important; }
.station-main .deck-grid .deck-metrics .metric-key.key-10 .metric-value { background-color: #8e44ad; color: #1a1a1a !important; }
.station-main .deck-grid .deck-metrics .metric-key.key-11 .metric-value { background-color: #e91e63; color: #1a1a1a !important; }
.station-main .deck-grid .deck-metrics .metric-key.key-12 .metric-value { background-color: #f06292; color: #1a1a1a !important; }

/* DECK REWRITE: deck-section (Next/Seed/History) inherits from deck-section base */
.station-main .deck-grid .deck-section--next,
.station-main .deck-grid .deck-section--seed,
.station-main .deck-grid .deck-section--history {
  min-width: 0;
  overflow: visible;
}
.station-main .deck-grid .deck-section--history {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.station-main .deck-grid .deck-section--history .deck-history-header-row {
  margin-top: 0;
}
.station-main .deck-grid .deck-section--history .deck-title--badge {
  width: 88px;
  min-width: 88px;
  padding: 6px 12px;
  font-size: 12px;
}
.station-main .deck-grid .deck-section--history .deck-history-canvas-wrap {
  min-width: 0;
  min-height: 200px;
  background: #0e0e0e;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.station-main .deck-grid .deck-section--history .deck-history-canvas-wrap .analytics-canvas {
  flex: 1;
  min-height: 120px;
}
.station-main .deck-grid .deck-section--history .deck-history-canvas-wrap .panel-message {
  padding: 12px;
  color: #bbb;
  font-size: 13px;
}
.station-main .deck-grid .deck-track-info {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #f2fbff;
  line-height: 1.3;
  min-width: 0;
  overflow: visible;
  max-width: 100%;
  position: relative;
}
.station-main .deck-grid .deck-track-info .deck-track-label-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 0 1 auto;
  position: relative;
}
.station-main .deck-grid .deck-track-info .deck-track-badges {
  position: absolute;
  top: 100%;
  left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 2px;
}
.station-main .deck-grid .deck-track-info .deck-track-badges:empty {
  display: none;
}
.deck-track-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  background: #fef9c3;
  color: #0a0a0a;
  border: 1px solid rgba(180, 170, 0, 0.4);
}
.deck-track-badge--tempo,
.deck-track-badge--beatmix {
  background: #fef9c3;
  color: #0a0a0a;
  border-color: rgba(180, 170, 0, 0.4);
}
.station-main .deck-grid .deck-track-info .deck-artist {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.station-main .deck-grid .deck-track-info .deck-track {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deck-track-edit-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.deck-track-edit-btn:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.12);
}
.deck-track-menu-btn {
  font-size: 20px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1;
  letter-spacing: -1px;
  text-shadow: 0 0 0.01px rgba(255, 255, 255, 0.9);
}
.deck-track-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 1500;
  min-width: 168px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(12, 20, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}
.deck-track-menu--up {
  top: auto;
  bottom: calc(100% + 6px);
}
.deck-track-menu[hidden] {
  display: none;
}
.deck-track-menu-item {
  width: 100%;
  display: block;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e8eefb;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
}
.deck-track-menu-item:hover,
.deck-track-menu-item:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
}
.deck-track-menu-item--danger {
  color: #fca5a5;
}
.deck-track-menu-item[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.deck-track-edit-btn[hidden] {
  display: none;
}
body.theme-light .deck-track-edit-btn {
  color: rgba(0, 0, 0, 0.45);
}
body.theme-light .deck-track-menu-btn {
  color: rgba(17, 24, 39, 0.78);
  text-shadow: none;
}
body.theme-light .deck-track-edit-btn:hover {
  color: rgba(0, 0, 0, 0.85);
  background: rgba(0, 0, 0, 0.08);
}
body.theme-light .deck-track-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(17, 24, 39, 0.16);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
}
body.theme-light .deck-track-menu-item {
  color: #1f2937;
}
body.theme-light .deck-track-menu-item:hover,
body.theme-light .deck-track-menu-item:focus-visible {
  background: rgba(2, 132, 199, 0.12);
}
body.theme-light .deck-track-menu-item--danger {
  color: #b91c1c;
}
body.theme-light .deck-delay-sync-toggle {
  background: rgba(255, 255, 255, 0.96);
  color: #1f2937;
  border-color: rgba(17, 24, 39, 0.2);
}
body.theme-light .deck-delay-sync-toggle[aria-pressed="true"] {
  color: #166534;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(220, 252, 231, 0.95);
}
body.theme-light .deck-delay-sync-select {
  background: rgba(255, 255, 255, 0.98);
  color: #111827;
  border-color: rgba(17, 24, 39, 0.18);
}
.station-main .deck-grid .deck-ident-badge {
  display: none;
  flex-shrink: 0;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  background-color: #1a1a1a;
  color: #fff;
  position: relative;
  top: -2px;
}
.station-main .deck-grid .deck-ident-badge[aria-hidden="false"] {
  display: inline-block;
}
.station-main .deck-grid .deck-track-info--ident .deck-artist {
  color: #ffd700 !important;
}
body.theme-light .station-main .deck-grid .deck-track-info--ident .deck-artist {
  color: #b8860b !important;
}
.deck-status-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.deck-status-bar .status-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #dfe9f5;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 6px 14px;
  border: 1px solid rgba(90, 142, 210, 0.24);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 35, 56, 0.72), rgba(13, 24, 39, 0.62));
  overflow: hidden;
  box-sizing: border-box;
  flex-wrap: nowrap;
}
.deck-status-bar .status-item--wide {
  flex: 1 1 auto;
  min-width: 0;
}
/* Scheduler + Playlist: equal width share */
.deck-status-bar .status-item--deck-primary {
  flex: 1 1 0;
  min-width: 0;
}
/* Ident only (no --compact-wide): max 200px — On/Off / Queued text */
.deck-status-bar .status-item--compact:not(.status-item--compact-wide) {
  flex: 0 1 200px;
  min-width: 0;
  max-width: 200px;
}
/* Progression uses --compact-wide */
.deck-status-bar .status-item--compact.status-item--compact-wide {
  flex: 0 1 200px;
  max-width: 260px;
  min-width: 172px;
}
@media (min-width: 640px) {
  .deck-status-bar .status-item--deck-primary {
    flex: 1 1 0;
    min-width: 120px;
  }
  .deck-status-bar .status-item--compact:not(.status-item--compact-wide) {
    flex: 0 1 200px;
    min-width: 0;
    max-width: 200px;
  }
  .deck-status-bar .status-item--compact.status-item--compact-wide {
    flex: 0 0 auto;
    max-width: 260px;
  }
  .deck-status-bar .status-item:not(.status-item--compact):not(.status-item--deck-primary) {
    flex: 1 1 120px;
    min-width: 0;
  }
}
/* Hide status items one by one before they wrap (order: Sync, Playlist, Scheduler, Progression; Idents stays last) */
@media (max-width: 1500px) {
  .deck-status-bar .status-item[data-system="delay-sync"] { display: none !important; }
}
@media (max-width: 1300px) {
  .deck-status-bar .status-item[data-system="engine"] { display: none !important; }
}
@media (max-width: 1100px) {
  .deck-status-bar .status-item[data-system="scheduler"] { display: none !important; }
}
@media (max-width: 950px) {
  .deck-status-bar .status-item[data-system="progression"] { display: none !important; }
}
@media (max-width: 639px) {
  .deck-status-bar .status-item {
    min-width: 0;
    flex: 1 1 auto;
  }
}
.deck-status-bar .status-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
  color: #8ca0b9;
}
.deck-status-bar .status-value {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  position: relative;
  top: -1px;
}
.deck-status-bar .status-meta {
  color: #9fb7d4;
  font-size: 13px;
  position: relative;
  top: -1px;
}
.deck-status-bar .status-item > .status-meta:empty {
  display: none;
}
.station-main .deck-grid .deck-artist {
  font-size: 18px;
  color: #b8d4e8;
}
.station-main .deck-grid .deck-track {
  font-size: 13px;
  color: #8ca0b9;
  margin-top: 1px;
}
.station-main .deck-grid .deck-section--next .deck-artist,
.station-main .deck-grid .deck-section--seed .deck-artist {
  color: #7a8fa3;
}
.station-main .deck-grid .deck-section--next .deck-track,
.station-main .deck-grid .deck-section--seed .deck-track {
  color: #6b7a8a;
}

.station-main .deck-grid .playback-card .progress,
.station-main .deck-grid .cue-card .progress {
  margin-bottom: 0;
}
.cue-card .progress .meter > span {
  background-color: #555 !important;
  background-image: none !important;
  box-shadow: inset 0 2px 6px rgba(255,255,255,0.1), inset 0 -2px 4px rgba(0,0,0,0.2) !important;
  transform: scaleX(1) !important;
  opacity: 0.6;
}
.playback-card .manual-inline-buttons {
  margin-top: 8px;
  gap: 6px;
  flex-wrap: wrap;
}

/* Waveform image container */
.waveform-container {
  width: 100%;
  height: 80px; /* Fixed height to prevent collapse */
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.waveform-image {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

/* Waveform fade markers overlay */
.waveform-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none; /* Hidden by default, shown when fade data exists */
}

.waveform-fade-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: rgba(255, 200, 0, 0.8);
  z-index: 10;
}

.waveform-fade-marker.waveform-fade-start {
  background-color: rgba(0, 255, 150, 0.8); /* Green for fade start */
}

.waveform-fade-marker.waveform-fade-end {
  background-color: rgba(255, 100, 100, 0.8); /* Red for fade end */
}

.waveform-fade-region {
  position: absolute;
  top: 0;
  bottom: 0;
  background-color: rgba(255, 200, 0, 0.15); /* Yellow tint for fade region */
  z-index: 5;
}

/* Danceability curve overlay drawn on top of waveform */
.waveform-curve {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4; /* Below fade markers, above image */
}

.playback-card .line,
.playback-card .metrics-row,
.playback-card .extra-row,
.playback-card .progress {
  font-size: 14px;
}
.playback-card .line strong,
.playback-card .metrics-row strong,
.playback-card .extra-row strong,
.playback-card .progress strong {
  font-size: 14px;
  color: #9fa8b3;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.playback-card .line strong::after,
.playback-card .metrics-row strong::after,
.playback-card .extra-row strong::after,
.playback-card .progress strong::after {
  content: '';
}
/* Nudge Controls UI removed - functionality preserved for programmatic use */
/* 
.nudge-card {
  margin-top: 16px;
}
.nudge-card .nudge-body {
  padding: 18px 20px 20px;
}
.nudge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.nudge-control {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nudge-control .form-label {
  font-size: 12px;
  color: #d7d7d7;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.nudge-control .form-hint {
  margin: 0;
}
.nudge-range {
  height: 24px;
}
.nudge-range::-webkit-slider-runnable-track {
  height: 6px;
}
.nudge-range::-moz-range-track {
  height: 6px;
}
.nudge-range::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -4px;
}
.nudge-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
}
.nudge-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.nudge-actions .btn {
  min-width: 140px;
}
*/
.scoring-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.scoring-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}
.scoring-grid--compact,
.scoring-inline-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.scoring-field--compact {
  width: 100%;
}
.scoring-bottom-row {
  margin-top: 8px;
}
*** End Patch
.scoring-inline-label {
  display: contents;
}
.form-control--tight {
  max-width: 160px;
}
.form-control--wide {
  max-width: 280px;
}
.scoring-checkbox-inline .checkbox-label span {
  font-size: 14px;
}
.scoring-checkbox-inline .checkbox-label {
  margin-right: 0;
}
.scoring-inline-combo {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
}
.scoring-inline-combo .shuffle-percent-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
}
.scoring-inline-combo select {
  min-width: 90px;
}
.scoring-field,
.scoring-inline-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 1em;
  width: 100%;
}
.scoring-toggle-field {
  flex: 1 1 auto;
  min-width: 220px;
  justify-content: space-between;
}
.scoring-select-field {
  flex: 1 1 100%;
}
.scoring-label {
  display: contents;
}
.scoring-field-label,
.scoring-inline-field .form-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  justify-self: flex-start;
  min-width: 240px;
  flex: 0 0 240px;
}
.scoring-field-hint,
.scoring-label .hint-wrapper,
.scoring-inline-field .hint-wrapper {
  justify-self: flex-start;
  flex: 0 0 auto;
}
.scoring-control,
.scoring-inline-control,
.scoring-slider {
  display: flex;
  align-items: center;
  justify-self: flex-start;
  flex: 0 0 auto;
}
.scoring-select {
  flex: 1 1 52%;
}
.scoring-select select {
  width: 100%;
}
.scoring-toggle .switch {
  margin-left: auto;
}
.short-range {
  width: 100%;
  max-width: 200px;
}
.scoring-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 6px 0;
}
.dbtools-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.crates-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.crate-list-section,
.crate-import-section {
  background: rgba(20,20,20,0.8);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.crate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.crate-table th,
.crate-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.crate-table th {
  text-align: left;
  color: #b0bec5;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 12px;
}
.crate-table td:last-child {
  text-align: right;
}
.crate-action-spacer {
  display: inline-block;
  width: 12px;
}
.idents-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Match combo row width (260 + 16 + 260) so ident box aligns with identsModeSelect */
.idents-body .form-row--split,
.idents-body .idents-track-row {
  max-width: 536px;
}
.idents-track-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: start;
}
.idents-track-row .form-label {
  min-width: 0;
  margin: 6px 0 0;
}
.idents-track-row .form-hint {
  grid-column: 1 / -1;
  margin-top: 4px;
}
.idents-list--compact {
  min-width: 0;
  width: 100%;
}
@media (max-width: 900px) {
  .idents-body .form-row--split,
  .idents-body .idents-track-row {
    max-width: none;
  }
  .idents-track-row {
    grid-template-columns: 1fr;
  }
}
.panel-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel-skeleton__line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.1) 100%);
  animation: skeletonPulse 1.2s ease-in-out infinite;
}
.panel-skeleton__line--wide {
  width: 80%;
}
.panel-skeleton__line--medium {
  width: 60%;
}
.panel-skeleton__line--narrow {
  width: 35%;
}
.panel-skeleton__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.panel-skeleton__grid .panel-skeleton__line {
  width: 100%;
}
@keyframes skeletonPulse {
  0% {
    background-position: -120px 0;
  }
  100% {
    background-position: 120px 0;
  }
}
.track-pool-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.track-pool-crate-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
}
.track-pool-crate-row.combined > .track-pool-crate-list {
  flex: 1 1 50%;
  min-width: 0;
}
.track-pool-crate-list {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.track-pool-range-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
  align-items: flex-start;
}
.track-pool-range {
  flex: 1 1 50%;
  min-width: 0;
}
.track-pool-checkboxes {
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 8px 10px;
  max-height: 180px;
  overflow-y: auto;
  background: rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.track-pool-checkboxes label {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  font-size: 0.95rem;
  gap: 8px;
}
.track-pool-checkboxes input[type="checkbox"] {
  margin-right: 4px;
}
.track-pool-preview {
  margin: 0;
  font-size: 13px;
  color: #9ccc65;
}
.track-pool-preview.error {
  color: #ef5350;
}
.track-pool-preview-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
#panel-trackpool .track-pool-options-row {
  margin-top: 8px;
  margin-bottom: 4px;
}
#panel-trackpool .track-pool-pool-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 280px;
}
.simple-trackpool-order-row {
  margin-top: 8px;
  gap: 8px;
}
.simple-trackpool-order-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
#trackPoolPreviewBtn {
  margin-left: auto;
}
.playlist-trackpool-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.toggled-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel-title-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}
.panel-title-toggle h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #f1f5ff;
}
.panel-subtitle {
  margin: 0;
  flex: 1 1 auto;
  font-size: 13px;
  color: #8ea0bb;
  line-height: 1.4;
}
.trackpool-master-switch {
  transform: none;
  margin-right: 10px;
}
.trackpool-header-text h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.4px;
}
.trackpool-header-text p {
  margin: 4px 0 0;
  color: #94b4cf;
  font-size: 13px;
}
.playlist-track-pool-body {
  gap: 14px;
}
.playlist-track-pool-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}
.tiny-crate-list {
  flex: 0 0 auto;
  width: min(20ch, 220px);
}
.tiny-crate-list .track-pool-checkboxes {
  max-height: 120px;
}
.track-pool-range-stack {
  flex: 1 1 240px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.range-double--compact {
  max-width: 220px;
}

.range-double {
  position: relative;
  height: 32px;
  margin-top: 6px;
}
.range-double::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  background: rgba(255,255,255,0.2);
  transform: translateY(-50%);
  border-radius: 2px;
}
.range-double__input {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  height: 32px;
  margin: 0;
}
.range-double__input::-webkit-slider-thumb {
  pointer-events: auto;
}
.range-double__input::-moz-range-thumb {
  pointer-events: auto;
}
.range-double__input--min {
  z-index: 2;
}
.range-double__input--max {
  z-index: 1;
}
.range-double__input::-webkit-slider-runnable-track,
.range-double__input::-moz-range-track {
  background: transparent;
}
.idents-status {
  margin: 0;
  font-size: 13px;
  color: #9ccc65;
}
.idents-status.pending {
  color: #b2ff59;
}
.idents-status.queued {
  color: #ffca28;
}
.idents-status.cleared {
  color: #4dd0e1;
}
.idents-status.disabled {
  color: #9e9e9e;
}
.idents-body .panel-message {
  margin: 0;
}
#identsTrackMeta {
  margin-top: 6px;
}
.idents-list {
  min-height: 160px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.2);
.idents-list.disabled {
  opacity: 0.5;
  pointer-events: none;
}
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.idents-list .panel-message {
  margin: 0;
  color: #cfd8dc;
}
.idents-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  line-height: 1.3;
}
.idents-item.disabled {
  opacity: 0.5;
}
.idents-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.idents-item span {
  flex: 1;
}
.crate-list-container {
  min-height: 120px;
}
.crate-import-section form .form-row {
  margin-bottom: 12px;
}
.hint-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.hint-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
  font-size: 11px;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  padding: 0;
}
.hint-icon:hover:not(:disabled),
.hint-icon:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.hint-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 12px;
  line-height: 1.4;
  color: #e0e0e0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 40;
}
.hint-wrapper:hover .hint-popover,
.hint-wrapper:focus-within .hint-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.compact-range {
  height: 26px;
}
.compact-range::-webkit-slider-runnable-track {
  height: 6px;
}
.compact-range::-moz-range-track {
  height: 6px;
}
.compact-range::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5px;
}
.compact-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
}
.scoring-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 4px;
}
.scoring-actions.scoring-actions-left {
  justify-content: flex-start;
}
.scoring-actions .btn {
  min-width: 140px;
}
.playback-card .line-now strong,
.playback-card .line-queued strong,
.playback-card .progress strong {
  width: auto;
}
.toggle-badge { font-size: 11px; margin-left: 8px; padding: 1px 8px; border-radius: 10px; border: 1px solid #666; color:#ddd; background: transparent; cursor: pointer; }
.card.expandable .detail-body { max-height: 1200px; overflow: hidden; transition: max-height .25s ease, padding .25s ease; padding-top: 6px; }
.card.expandable.collapsed .detail-body { max-height: 0; padding-top: 0; }
/* Original font: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  background: #000;
  color: #fff;
  font-size: 12px;
  overflow-x: hidden; /* Prevent horizontal scrollbar */
}
body.vanta-active {
  background: #000;
  background-image: none;
}
#vanta-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.top-nav {
  background: rgba(16, 30, 48, 0.96);
  border-bottom: 1px solid rgba(70, 120, 180, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px;
  margin: -10px -10px 24px -10px;
  min-height: 44px;
}
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #eee;
  font-size: 24px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}
.nav-left {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.nav-logo-link {
  display: inline-flex;
  align-items: center;
}
.nav-logo {
  height: 48px;
  width: auto;
  display: inline-block;
}
.nav-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.3px;
}
.nav-icons {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-station-display {
  display: inline-flex;
  flex-direction: column;
  margin-left: 10px;
  min-width: 0;
  gap: 0;
  padding: 4px 0;
}
.nav-station-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #fff;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-station-name--empty {
  color: #8a8a8a;
  font-style: italic;
}
.sidebar-heading {
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0.3px;
  font-weight: 600;
  color: #607080;
  padding: 16px 13px 4px;
  position: relative;
  user-select: none;
}
.sidebar-heading[data-section="playlist-engine"] {
  color: #d0d0d0;
  letter-spacing: 1.2px;
}
.playlist-engine-group {
  background: none;
  border: none;
  margin: 0;
  padding: 0;
  box-shadow: none;
}
.sidebar-item.playback {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-item.playback .sidebar-icon {
  width: 20px;
  height: 20px;
}
.sidebar-item.playback .deck-status-mini {
  visibility: hidden;
  opacity: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  min-width: 132px; /* Reserve space: 60px timer + 6px gap + 60px badge + 6px gap */
  transition: visibility 0.2s ease, opacity 0.2s ease;
}
.sidebar-item.playback.show-mini .deck-status-mini {
  visibility: visible;
  opacity: 1;
}
.sidebar-item.playback .remain-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(135, 206, 250, 0.5);
  background: rgba(135, 206, 250, 0.2);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  min-width: 60px;
  width: 60px;
  height: 24px;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.sidebar-item.playback .mini-live {
  width: 12px;
  height: 12px;
}
.sidebar-item.playback .status-badge.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 60px;
  width: 60px;
  height: 24px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.sidebar-item.playback .status-badge.mini.live {
  background: rgba(255, 77, 77, 0.2);
  border-color: rgba(255, 77, 77, 0.5);
  color: #ff4d4d;
}
.sidebar-item.playback .status-badge.mini.wait {
  background: rgba(255, 165, 0, 0.2);
  border-color: rgba(255, 165, 0, 0.5);
  color: #ffa500;
}
.nav-icon {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  width: 44px;
  height: 44px;
  font-size: 20px;
  color: #e5f3ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  padding: 0;
}
.nav-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.nav-icon:hover:not(:disabled),
.nav-icon:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.nav-account {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nav-account form {
  margin: 0;
}
.nav-account-name {
  font-size: 14px;
  color: #f0f0f0;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.nav-account .nav-icon {
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 18px;
}
.station-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100vh;
  transition: margin-top 0.12s ease;
}
.station-right {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.station-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  min-height: 52px;
  padding: 6px 24px;
  background: rgba(16, 30, 48, 0.98);
  border-bottom: 1px solid rgba(70, 120, 180, 0.35);
  display: flex;
  align-items: center;
  z-index: 300;
  overflow: visible;
}
.station-right {
  padding-top: 52px;
}
.sidebar-collapse-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #b0c4de;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.sidebar-collapse-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.station-top-bar-title {
  font-size: 14px;
  font-weight: 400;
  color: #e5f3ff;
  white-space: nowrap;
  margin-left: 8px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.topbar-station-name {
  color: #8ca0b9;
}
.topbar-sep {
  margin: 0 7px;
  color: #556;
  font-size: 16px;
  font-weight: 300;
}
.topbar-panel-name {
  font-weight: 600;
  color: #e5f3ff;
}
.station-top-bar-inner {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  box-sizing: border-box;
}
.station-top-bar-account {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.profile-btn {
  cursor: pointer;
}
.profile-btn svg {
  width: 20px;
  height: 20px;
}
.profile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 240px;
  padding: 12px;
  background: rgba(16, 30, 48, 0.98);
  border: 1px solid rgba(70, 120, 180, 0.35);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 400;
}
.profile-menu-section {
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.profile-menu-section:last-of-type {
  margin-bottom: 12px;
}
.profile-menu-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}
.profile-menu-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.profile-menu-label {
  color: #b0c4de;
}
.profile-menu-value {
  color: #e5f3ff;
  font-weight: 500;
  margin-left: 12px;
}
.profile-menu-signout-form {
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(70, 120, 180, 0.25);
}
.profile-menu-signout {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #e5f3ff;
  background: rgba(255, 120, 80, 0.15);
  border: 1px solid rgba(255, 100, 60, 0.4);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.profile-menu-signout:hover {
  background: rgba(255, 120, 80, 0.25);
  border-color: rgba(255, 100, 60, 0.55);
}
.station-top-bar-account .nav-account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
  font-size: 14px;
  color: #f0f0f0;
  font-weight: 600;
}
.station-top-bar .nav-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  font-size: 15px;
}
.top-bar-menu-toggle {
  display: none;
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 1;
}
.top-bar-menu-toggle .nav-logo,
.station-top-bar .nav-logo {
  height: 40px;
}
.station-sidebar {
  background: rgba(14, 28, 46, 0.98);
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 228px;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: none;
  padding-bottom: 16px;
}

.sidebar-logo {
  padding: 10px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.sidebar-logo-button {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.sidebar-logo-button .nav-logo {
  height: 56px;
}

.sidebar-logo-text {
  margin-left: 9px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.sidebar-account {
  margin-top: auto;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(80, 140, 210, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #dfe9f5;
}
.sidebar-account .nav-account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-subsection {
  padding-bottom: 8px;
}
.sidebar-subtitle {
  font-size: 12px;
  text-transform: uppercase;
  color: #8c8c8c;
  letter-spacing: 0.08em;
  padding: 12px 14px 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}
.sidebar-master-switch {
  margin-left: auto;
  transform: scale(0.9);
  display: inline-flex;
  align-items: center;
  margin-right: -2px;
}
.sidebar-item .sidebar-master-switch {
  margin-left: auto;
}
.sidebar-sublist {
  display: flex;
  flex-direction: column;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  margin-left: 14px;
  margin-top: 4px;
}
.sidebar-sublist .sidebar-item {
  padding-left: 28px;
  padding-right: 8px;
}
.sidebar-subsection.disabled .sidebar-subtitle,
.sidebar-subsection.disabled .sidebar-item {
  opacity: 0.45;
  pointer-events: none;
}

.autodj-subtitle {
  background: linear-gradient(90deg, rgba(191,146,12,0.18), rgba(191,146,12,0.05));
  border-left: 3px solid #bf920c;
  border-radius: 6px;
  padding: 12px 14px;
  color: #f1d28a;
}
.autodj-subtitle .sidebar-label {
  color: inherit;
}
.autodj-badge {
  padding: 3px 8px;
  border-radius: 999px;
  background: #bf920c;
  color: #140d00;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  margin-left: 6px;
}
.autodj-switch .switch-slider {
  background: #3a3a3a;
  overflow: hidden;
}
.autodj-switch .switch-slider::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -150%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 60%);
  opacity: 0;
  transform: rotate(25deg);
  transition: opacity 0.2s ease;
}
.autodj-switch input:checked + .switch-slider {
  background: linear-gradient(90deg, #ffd45c, #ffb800);
  box-shadow: 0 0 20px rgba(255, 196, 77, 0.6);
}
.autodj-switch input:checked + .switch-slider:before {
  background: #2b1500;
}
.autodj-switch input:checked + .switch-slider::after {
  animation: autodjShimmer 1.6s linear infinite;
  opacity: 1;
}

@keyframes autodjShimmer {
  0% {
    transform: translateX(-100%) rotate(25deg);
    opacity: 0;
  }
  30% {
    opacity: 0.6;
  }
  60% {
    opacity: 0.3;
  }
  100% {
    transform: translateX(100%) rotate(25deg);
    opacity: 0;
  }
}
#autodjSection .sidebar-sublist {
  border-left: 2px solid rgba(191,146,12,0.45);
  background: linear-gradient(90deg, rgba(191,146,12,0.12), rgba(191,146,12,0.02));
  border-radius: 6px;
  margin-left: 8px;
  padding: 6px 6px 10px;
}
#autodjSection .sidebar-sublist .sidebar-item {
  background: transparent;
  color: #f7e2a5;
  border-bottom-color: rgba(191,146,12,0.2);
}
#autodjSection .sidebar-sublist .sidebar-item:hover,
#autodjSection .sidebar-sublist .sidebar-item.active {
  color: #fff8d0;
  border-left: 3px solid #bf920c;
}
#autodjSection .sidebar-sublist .sidebar-item:hover::before,
#autodjSection .sidebar-sublist .sidebar-item.active::before {
  background: rgba(191,146,12,0.22);
}
.simple-status {
  font-size: 13px;
  color: #f39c12;
  margin: 0;
}
.simple-body.disabled .simple-status {
  color: #9e9e9e;
}
.simple-note {
  font-size: 12px;
  color: #9e9e9e;
  margin: 0;
}
.sidebar-item {
  position: relative;
  background: transparent;
  border: none;
  border-bottom: none;
  color: #b0c4d8;
  padding: 9px 13px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 9px;
}
.sidebar-item::before {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  bottom: 0;
  border-radius: 8px;
  z-index: -1;
  background: transparent;
  transition: background 0.2s;
}
.sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: transparent;
  filter: brightness(0) invert(1);
  opacity: 0.65;
  display: block;
  transition: opacity 0.2s;
}
.sidebar-item:hover .sidebar-icon {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}
.sidebar-item.active .sidebar-icon {
  filter: brightness(0) invert(1);
  opacity: 0.85;
}
.sidebar-item:hover {
  color: #dfe9f5;
}
.sidebar-item:hover::before {
  background: rgba(255, 255, 255, 0.08);
}
.sidebar-item.active {
  color: #dfe9f5;
}
.sidebar-item.active::before {
  background: rgba(255, 255, 255, 0.15);
}
.sidebar-item.has-switch {
  padding-right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-item.has-switch .sidebar-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.sidebar-item.has-switch .sidebar-text .sidebar-label {
  flex: 1 1 auto;
}
.sidebar-item.has-switch .sidebar-label.disabled {
  color: inherit;
}
.sidebar-item.has-switch .set-prog-indicator {
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}
.sidebar-item.has-switch .sidebar-master-switch {
  margin-left: auto;
  margin-right: 0;
  transform: none;
  display: inline-flex;
  align-items: center;
}
.sidebar-item:last-child {
  border-bottom: none;
}
.sidebar-item.setprog-item .sidebar-label {
  flex: 1;
}
.sidebar-item.setprog-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 14px;
}
.sidebar-item .sidebar-label.disabled {
  color: #777;
}
.sidebar-item .switch-inline {
  margin-right: 2px;
  transform: scale(0.8);
  display: inline-flex;
  align-items: center;
}
.sidebar-item .switch-inline input {
  display: none;
}
.sidebar-item .switch-inline.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.set-prog-indicator {
  display: none;
  color: #0fa968;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.set-prog-indicator.active {
  display: inline-flex;
}
.set-prog-indicator.hidden {
  display: none;
}
.set-prog-indicator.due {
  color: #f39c12;
}
#identsIndicator.pending {
  color: #b2ff59;
}
#identsIndicator.queued {
  color: #ffca28;
}
#identsIndicator.cleared {
  color: #4dd0e1;
}
.station-main {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 24px;
}
.station-main .deck-grid {
  width: 100%;
}
.form-row.inline .form-group {
  align-items: flex-start;
}
.mix-toggle-header {
  margin-bottom: 12px;
}
.mix-toggle-header .panel-title-toggle {
  gap: 10px;
}
.mix-toggle-header .panel-title-toggle h3 {
  color: #f1d28a;
  margin: 0;
}
.panel {
  display: none;
}
.panel.active {
  display: block;
}
.panel-message {
  padding: 12px;
  color: #bbb;
  font-size: 13px;
}
.panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.playlist-master-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
/* Playlist mode toggle (AutoDJ/Simple/Crate/Sets) */
.playlist-mode-toggle {
  position: relative;
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(80,140,210,0.35);
  padding: 3px;
  background: rgba(14,28,46,0.95);
  cursor: pointer;
  min-width: 360px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  font: inherit;
}
.playlist-mode-toggle .toggle-display {
  display: flex;
  align-items: stretch;
  width: 100%;
}
/* Do not use inset + width:% together — inset sets left+right and overrides width, so the
   highlight stretched full width. Match four flex segments: (track − horizontal padding) / 4. */
.playlist-mode-toggle .toggle-highlight {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 4);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  transition: transform 0.22s ease, background 0.22s ease;
  z-index: 0;
  box-sizing: border-box;
}
.playlist-mode-toggle .toggle-option {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #9fb3cc;
  padding: 7px 12px;
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
  white-space: nowrap;
}
.toggle-option--crate {
  color: #ff6b6b;
}
.toggle-option--sets {
  color: #b388ff;
}
.playlist-mode-toggle[data-mode="autodj"] .toggle-highlight {
  transform: translateX(0%);
  background: linear-gradient(135deg, #ffd45c, #f0a500);
}
.playlist-mode-toggle[data-mode="simple"] .toggle-highlight {
  transform: translateX(100%);
  background: linear-gradient(135deg, #25c175, #1a8f54);
}
.playlist-mode-toggle[data-mode="crate"] .toggle-highlight {
  transform: translateX(200%);
  background: linear-gradient(135deg, #ff6b6b, #c62828);
}
.playlist-mode-toggle[data-mode="sets"] .toggle-highlight {
  transform: translateX(300%);
  background: linear-gradient(135deg, #b388ff, #7c4dff);
}
.playlist-mode-toggle[data-mode="autodj"] .toggle-option--autodj {
  color: #040404;
}
.playlist-mode-toggle[data-mode="simple"] .toggle-option--simple {
  color: #040404;
}
.playlist-mode-toggle[data-mode="crate"] .toggle-option--crate {
  color: #040404;
}
.playlist-mode-toggle[data-mode="sets"] .toggle-option--sets {
  color: #040404;
}
.status-badge-playlist-mode {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity 0.2s ease;
  min-width: 0;
}
.status-badge-playlist-mode:not(:empty) {
  opacity: 1;
}
/* Ensure badge is visible when it has text content */
.status-badge-playlist-mode[style*="opacity: 1"],
.status-badge-playlist-mode:not(:empty) {
  opacity: 1 !important;
}
.status-badge-playlist-mode--autodj {
  background: linear-gradient(135deg, #ffd45c, #f0a500);
  color: #040404;
  box-shadow: 0 2px 8px rgba(255,210,92,0.4);
}
.status-badge-playlist-mode--simple {
  background: linear-gradient(135deg, #25c175, #1a8f54);
  color: #040404;
  box-shadow: 0 2px 8px rgba(24,196,123,0.4);
}
.status-badge-playlist-mode--crate {
  background: linear-gradient(135deg, #ff6b6b, #c62828);
  color: #040404;
  box-shadow: 0 2px 8px rgba(255,107,107,0.4);
}
.status-badge-playlist-mode--sets {
  background: linear-gradient(135deg, #b388ff, #7c4dff);
  color: #040404;
  box-shadow: 0 2px 8px rgba(179,136,255,0.45);
}
/* Badge in card headers */
h2.card-header .status-badge-playlist-mode {
  margin-left: auto;
  margin-right: 0;
  flex-shrink: 0;
}
.playlist-system-status {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.system-chip {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  min-width: 140px;
  gap: 2px;
  color: #dbe3f3;
}
.system-chip .chip-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8ca0b9;
}
.system-chip .chip-value {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.system-chip .chip-energy-mode,
.system-chip .chip-dfc-mirror,
.system-chip .chip-ident-title,
.system-chip .chip-profile-name,
.system-chip .chip-scheduler-status {
  font-size: 11px;
  color: #8ca0b9;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
}
.system-chip[data-system="engine"] .chip-profile-name {
  color: #0fdf88;
}
.system-chip .chip-dfc-mirror {
  color: #9fb3cc;
}
.system-chip .chip-ident-title.chip-marquee {
  animation: chip-marquee 15s linear infinite;
}
@keyframes chip-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(110px - 100%));
  }
}
.system-chip .chip-ident-title.chip-marquee:hover {
  animation-play-state: paused;
}
.system-chip.live .chip-value {
  color: #0fdf88;
}
.system-chip.warn .chip-value {
  color: #ffb347;
}
.system-chip.idle .chip-value {
  color: #9fb3cc;
}
.system-chip.playing .chip-value {
  color: #7ecbff;
}
.system-chip.chip-hidden {
  display: none;
}
.playlist-tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
}
#playlistTabs > .card {
  margin-top: 12px;
}
/* Tab bar: outside card, horizontal line under, no wrap, scroll arrows */
.playlist-tab-scroll-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  margin-bottom: 0;
  overflow: hidden;
}
.playlist-tab-scroll-wrapper .playlist-tab-bar {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.playlist-tab-scroll-wrapper .playlist-tab-bar::-webkit-scrollbar {
  display: none;
}
.playlist-tab-arrow {
  display: none;
  flex-shrink: 0;
  width: 32px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #8ca0b9;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.playlist-tab-arrow.visible {
  display: flex;
}
.playlist-tab-arrow:hover:not(:disabled) {
  color: #fff;
  background: rgba(148, 163, 184, 0.15);
}
.playlist-tab-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}
.playlist-tab-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0 0 6px 0;
  border-bottom: none;
}
.playlist-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #9fb3cc;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.playlist-tab:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #dfe9f5;
  text-decoration: none;
}
.playlist-tab.active {
  background: rgba(148, 163, 184, 0.2);
  color: #fff;
  text-decoration: none;
}
.playlist-tab.active::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 3px;
  background: #0a0a0a;
}
#playlistTabs[data-mode="autodj"] .playlist-tab[data-modes~="autodj"] {
  color: #9fb3cc;
}
#playlistTabs[data-mode="autodj"] .playlist-tab[data-modes~="autodj"].active {
  background: rgba(148, 163, 184, 0.2);
  color: #fff;
}
#playlistTabs[data-mode="autodj"] .playlist-tab[data-modes~="autodj"]:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #dfe9f5;
}
#playlistTabs[data-mode="simple"] .playlist-tab[data-tab="simple-settings"] {
  color: #9fb3cc;
}
#playlistTabs[data-mode="simple"] .playlist-tab[data-tab="simple-settings"].active {
  background: rgba(148, 163, 184, 0.2);
  color: #fff;
}
#playlistTabs[data-mode="simple"] .playlist-tab[data-tab="simple-settings"]:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #dfe9f5;
}
/* Green dot: function-enabled indicator on playlist tabs (same style as pool builder) */
#playlistTabs .playlist-tab::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  margin-right: 4px;
}
#playlistTabs .playlist-tab.has-filter::before {
  background: #4caf50;
}
#playlistTabs .playlist-tab.active.has-filter::before {
  background: #fff;
}
body.theme-light #playlistTabs .playlist-tab.has-filter::before {
  background: #16a34a;
}
body.theme-light #playlistTabs .playlist-tab.active.has-filter::before {
  background: #fff;
}
.playlist-tab.playlist-tab--hidden {
  display: none;
}
.playlist-tab:disabled,
.playlist-tab.disabled {
  opacity: 0.4;
  cursor: default;
}
.playlist-tab-panels {
  position: relative;
}
.playlist-tab-panel {
  display: none;
}
.playlist-tab-panel.active {
  display: block;
  animation: tabFade 0.25s ease;
}
.playlist-tab-panel.playlist-tab-panel--hidden {
  display: none !important;
}
.playlist-tab-panel.playlist-tab-panel--flash {
  box-shadow: 0 0 0 2px rgba(64,133,224,0.55);
  border-radius: 12px;
}
@keyframes tabFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card.playlist-mode-card,
.station-main .panel > .card.playlist-mode-card {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.playlists-body.panel-body {
  padding: 0;
  padding-top: 4px;
}
.playlist-mode-card .panel-body {
  padding: 0;
  gap: 12px;
}
.form-row.inline .form-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.form-row.inline .form-group .switch {
  margin-left: auto;
}
.mix-toggle-header {
  margin-bottom: 8px;
}
.mix-toggle-header .panel-title-toggle h3 {
  color: #f1d28a;
}
.playlist-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 0;
  gap: 16px;
}
.playlist-section-header h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.5px;
}
.scoring-warning {
  margin: 0 0 8px;
}
.scoring-warning h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: #ff6b6b;
}
.playlist-section-chip {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.4);
}
.playlist-section-chip.live {
  color: #0fdf88;
  border-color: rgba(15,223,136,0.65);
}
.playlist-section-chip.warn {
  color: #ffb347;
  border-color: rgba(255,179,71,0.65);
}
.simple-mode-select {
  max-width: 180px;
  min-width: 150px;
  font-size: 14px;
  padding: 6px 10px;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-row--spaced {
  margin-top: 14px;
}
.form-row.row-layout {
  flex-direction: row;
  align-items: flex-start;
}
.form-row.toggle-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.form-row.toggle-row .form-label {
  margin: 0;
}
.form-row.toggle-row.toggle-row-inline {
  margin-top: 4px;
}
.set-programming-body.disabled .form-row:not(.toggle-row),
.set-programming-body.disabled .form-hint {
  opacity: 0.45;
  pointer-events: none;
}
.set-programming-body .form-hint.full {
  margin-top: 4px;
}
.form-row.inline {
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.form-row.inline .form-group {
  flex: 0 0 260px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-row.inline .form-group .form-hint {
  margin-top: 2px;
}
.switch {
  position: relative;
  display: inline-flex;
  width: 50px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: #3a3a3a;
  border-radius: 24px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.switch-slider:before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #0b0b0b;
  transition: transform 0.2s ease, background 0.2s ease;
}
.switch input:checked + .switch-slider {
  background: linear-gradient(90deg, #ff9b0f, #ff6f00);
  box-shadow: 0 0 12px rgba(255, 130, 0, 0.45);
}
.switch input:checked + .switch-slider:before {
  transform: translateX(24px);
  background: #fff4e6;
}
.switch input:disabled + .switch-slider {
  opacity: 0.4;
  cursor: not-allowed;
}
.form-label .current {
  font-weight: 400;
  margin-left: 6px;
  color: #8bc34a;
}
.panel-group {
  margin-top: 0;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  font-size: 13px;
  color: #eee;
}
.history-table thead th {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #333;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #aaa;
}
.history-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid #262626;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-table tbody tr:last-child td {
  border-bottom: none;
}
.history-table tbody tr:hover {
  background: #1f1f1f;
}
.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 90px;
}
.history-table th:nth-child(4),
.history-table td:nth-child(4),
.history-table th:nth-child(6),
.history-table td:nth-child(6) {
  text-align: right;
}
.history-table th:nth-child(2),
.history-table td:nth-child(2),
.history-table th:nth-child(3),
.history-table td:nth-child(3) {
  max-width: 220px;
}
.history-table .truncate-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.analytics-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.analytics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.analytics-row--legacy {
  display: none;
}
.analytics-block {
  background: #1f1f1f;
  border: 1px solid #303030;
  border-radius: 10px;
  padding: 12px;
}
.analytics-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #999;
  margin-bottom: 8px;
}
.analytics-canvas {
  width: 100%;
  height: 200px;
  display: block;
  background: #0e0e0e;
  border-radius: 6px;
}
.analytics-canvas--with-border {
  border: 1px solid #333;
}

/* Generic tooltip styling, reusable across the app */
.has-tooltip {
  position: relative;
  cursor: help;
}
.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 125%;
  transform: translateX(-50%);
  padding: 8px 12px;
  min-width: 260px;
  max-width: 420px;
  white-space: pre-line;
  font-size: 12px;
  line-height: 1.5;
  color: #f5f5f5;
  background: rgba(15, 15, 15, 0.95);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease-out;
  z-index: 20;
}
.has-tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 120%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(15, 15, 15, 0.95) transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.12s ease-out;
  z-index: 20;
}
.has-tooltip:hover::after,
.has-tooltip:hover::before {
  opacity: 1;
}
.analytics-canvas.small {
  height: 200px;
}
.analytics-canvas.wheel {
  height: 240px;
}
.analytics-split {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.analytics-split .analytics-block {
  min-height: 260px;
}
.analytics-placeholder-body {
  font-size: 13px;
  color: #bdbdbd;
  padding: 12px;
  border: 1px dashed #444;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
.chart-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: rgba(15,15,15,0.92);
  color: #f5f5f5;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  max-width: 220px;
  word-break: break-word;
}

/* Database Stats panel */
.dbstats-panel-body {
  padding: 16px;
  flex-direction: column;
  gap: 20px;
}
.dbstats-loading {
  color: #94a3b8;
  font-size: 14px;
}
.dbstats-error {
  color: #f87171;
  font-size: 14px;
}
.dbstats-summary-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.dbstats-card {
  display: flex;
  flex-direction: column;
  min-width: 120px;
  padding: 12px 16px;
  background: rgba(30,41,59,0.6);
  border: 1px solid rgba(71,85,105,0.5);
  border-radius: 8px;
}
.dbstats-card-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #e2e8f0;
}
.dbstats-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-top: 4px;
}
.dbstats-section {
  border-top: 1px solid rgba(71,85,105,0.4);
  padding-top: 16px;
}
.dbstats-section:first-of-type {
  border-top: none;
  padding-top: 0;
}
.dbstats-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 12px 0;
}
.dbstats-played-label {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 8px 0;
}
.dbstats-played-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 8px;
  align-items: flex-start;
}
.dbstats-played-grid .dbstats-chart-wrap {
  flex: 1 1 280px;
  min-width: 0;
  margin-top: 0;
}
.dbstats-chart-wrap {
  max-width: 500px;
  margin-top: 8px;
}
.dbstats-bar-chart {
  width: 100%;
  max-width: 100%;
  display: block;
  border-radius: 6px;
}
.dbstats-genre-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.dbstats-genre-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #94a3b8;
}
.dbstats-genre-controls input {
  cursor: pointer;
}
.dbstats-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 8px;
}
.dbstats-stats-row strong {
  color: #e2e8f0;
}
.dbstats-tempo-row {
  margin-top: 14px;
}
.dbstats-tabs {
  margin-top: 16px;
}
.dbstats-tabs .playlist-tab-scroll-wrapper {
  margin-bottom: 12px;
}
.dbstats-tab-panels {
  padding-top: 12px;
}
body.theme-light .dbstats-card {
  background: rgba(248,250,252,0.9);
  border-color: rgba(148,163,184,0.4);
}
body.theme-light .dbstats-card-value {
  color: #1e293b;
}
body.theme-light .dbstats-card-label {
  color: #64748b;
}
body.theme-light .dbstats-section-title {
  color: #1e293b;
}
body.theme-light .dbstats-played-label {
  color: #475569;
}
body.theme-light .dbstats-stats-row {
  color: #475569;
}
body.theme-light .dbstats-stats-row strong {
  color: #0f172a;
}
body.theme-light .dbstats-genre-controls label {
  color: #64748b;
}

.analytics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-size: 11px;
  color: #b0b0b0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.analytics-legend span::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.analytics-legend span[data-key="key"]::before { background: #4fc3f7; }
.analytics-legend span[data-key="dance"]::before { background: #81c784; }
.analytics-legend span[data-key="trans"]::before { background: #ffb74d; }
.analytics-legend span[data-key="fresh"]::before { background: #ba68c8; }

.analytics-legend--harmonic {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: #dfe9f5;
  gap: 10px;
}
.analytics-legend--harmonic span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.analytics-legend--harmonic span::before {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--legend-color, #ffffff);
}

/* Scheduler panel – no outer card; Day/Week pill and profile bar in header, calendar in its own box */
.scheduler-help-link{font-size:.85rem;color:#76c2ff;text-decoration:none}
.scheduler-help-link:hover{text-decoration:underline}
.scheduler-header-controls{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.scheduler-inspector-header h3{display:none}
.scheduler-toggle{display:flex;align-items:center;gap:8px}
.scheduler-toggle .switch-slider{margin-right:4px}
/* Scheduler Day/Week pill – same style as deck Playlist/Scheduler pill */
.scheduler-type-toggle {
  position: relative;
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(80, 140, 210, 0.35);
  padding: 6px;
  background: rgba(14, 28, 46, 0.95);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  min-width: 180px;
}
.scheduler-type-highlight {
  position: absolute;
  inset: 2px;
  width: 50%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s ease, background 0.22s ease;
  z-index: 0;
}
.scheduler-type-toggle[data-type="day"] .scheduler-type-highlight {
  transform: translateX(0%);
  background: linear-gradient(135deg, #ff6f6f, #b33030);
}
.scheduler-type-toggle[data-type="week"] .scheduler-type-highlight {
  transform: translateX(100%);
  background: linear-gradient(135deg, #ffd45c, #f0a500);
}
.scheduler-type-btn {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 5px 10px;
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
  color: #9fb3cc;
}
.scheduler-type-btn--week {
  color: #f1d28a;
}
.scheduler-type-toggle[data-type="day"] .scheduler-type-btn--day,
.scheduler-type-toggle[data-type="week"] .scheduler-type-btn--week {
  color: #040404;
}
.scheduler-type-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* Scheduler panel header: title, Day/Week pill (out of box), profile bar like playlist */
#panel-scheduler .scheduler-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  row-gap: 12px;
  margin: 0 0 12px 0;
  padding: 4px 0 8px 0;
}
#panel-scheduler .scheduler-panel-header .scheduler-type-toggle {
  flex-shrink: 0;
}
.scheduler-profile-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-basis: 100%;
  min-width: 0;
}
.scheduler-profile-bar .scheduler-profile-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}
.scheduler-profile-bar .scheduler-profile-btn {
  flex-shrink: 0;
}
.scheduler-profile-bar .scheduler-profile-btn:first-of-type {
  margin-left: auto;
}
#panel-scheduler .scheduler-panel-header .scheduler-status-text {
  margin-left: auto;
  flex-shrink: 0;
}
/* Calendar editor – main box */
.scheduler-toolbar{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}
.scheduler-toolbar .pool-header-bar{margin-bottom:0}
.scheduler-validation-inline{display:none;font-size:.85rem;color:#ffab40;font-weight:600;margin-left:12px;flex-shrink:0;max-width:min(400px,100%)}
.scheduler-status-text{font-size:.85rem;color:rgba(255,255,255,.7)}
.scheduler-segment-summary {
  font-size: 13px;
  font-weight: 600;
  color: #b8d4e8;
  min-height: 1.5em;
  margin-left: 12px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  background: transparent;
}
.scheduler-grid-wrapper {
  position: relative;
  width: calc(100% - 12px);
  margin-left: 12px;
  border-radius: 12px;
  border: 1px solid rgba(80, 140, 210, 0.35);
  background: rgba(14, 28, 46, 0.95);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  max-height: 600px;
  scrollbar-color: #707070 #101010;
}
.scheduler-grid-wrapper::-webkit-scrollbar{width:8px}
.scheduler-grid-wrapper::-webkit-scrollbar-track{background:#101010;border-radius:6px}
.scheduler-grid-wrapper::-webkit-scrollbar-thumb{background:#707070;border-radius:6px}
.scheduler-grid-wrapper::-webkit-scrollbar-thumb:hover{background:#8d8d8d}
.scheduler-grid{position:relative;height:992px;display:grid;gap:4px;padding-left:48px;padding-top:32px}
.scheduler-grid.scheduler-grid--day{grid-template-columns:1fr}
.scheduler-grid.scheduler-grid--week{grid-template-columns:repeat(7,1fr)}
.scheduler-day-header-row{position:absolute;top:0;left:48px;right:0;display:grid;gap:4px;grid-template-columns:inherit;z-index:3;pointer-events:auto;height:32px;background:rgba(14,28,46,0.95)}
.scheduler-day-header{display:flex;align-items:center;justify-content:center;font-size:.85rem;font-weight:600;color:rgba(255,255,255,.5);padding:6px 8px;text-transform:uppercase;letter-spacing:.05em;outline:none;background:transparent}
.scheduler-day-header span{display:inline-flex;align-items:center;gap:4px}
.scheduler-day-header--selected{color:rgba(255,255,255,1);outline:none!important}
.scheduler-column-controls{position:absolute;top:6px;right:6px;display:flex;gap:4px;z-index:4}
.scheduler-column-control-btn{border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.04);color:#fff;border-radius:50%;width:18px;height:18px;font-size:10px;line-height:1;font-weight:700;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background .2s ease,border-color .2s ease,color .2s ease,transform .1s ease;padding:0}
.scheduler-column-control-btn svg{width:10px;height:10px}
.scheduler-column-control-btn:hover{background:#00c853;border-color:#00c853;color:#050505}
.scheduler-column-control-btn:focus-visible{outline:2px solid #00c853;outline-offset:2px}
.scheduler-column-control-btn:active{transform:scale(.9)}
.scheduler-column-control-btn--delete{color:#fff;border-color:rgba(255,255,255,.4)}
.scheduler-column-control-btn--delete:hover{background:#ff1744;border-color:#ff1744;color:#050505}
.scheduler-grid-column{position:relative;border:1px solid rgba(255,255,255,.08);border-radius:8px;background:rgba(255,255,255,.015);height:992px}
.scheduler-grid-column--selected{background:rgba(255,255,255,.08);border:none;outline:none}
.scheduler-hour-lines-container{position:absolute;top:32px;left:48px;right:0;height:960px;pointer-events:none;z-index:1}
.scheduler-hour-line{position:absolute;left:0;right:0;height:1px;background:rgba(255,255,255,.04)}
.scheduler-hour-label{position:absolute;left:-48px;top:-8px;font-size:.7rem;color:rgba(255,255,255,.4);text-align:right;width:44px;pointer-events:none;padding-right:4px}
.scheduler-segment {
  position: absolute;
  left: 6px;
  right: 6px;
  padding: 4px 10px;
  font-size: 10px;
  line-height: 1.25;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  color: #f5f5f5;
  font-weight: 400;
  cursor: pointer;
  overflow: visible;
  transition: transform 0.15s ease, background-color 0.2s ease;
  z-index: 2;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
}
.scheduler-segment strong {
  display: block;
  font-weight: 400;
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
}
.scheduler-segment small{display:none}
.scheduler-segment[data-selected="true"]{outline:none;border-color:rgba(255,255,255,.25);background:rgba(173,216,230,.35);box-shadow:0 6px 18px rgba(0,0,0,.55)}
.scheduler-segment[data-error="true"]{border-color:#ff6f6f!important;box-shadow:0 6px 18px rgba(255,111,111,.35)}
.scheduler-segment-warning{position:absolute;top:50%;right:24px;transform:translateY(-50%);padding:2px 6px;border-radius:999px;background:#ff5252;color:#fff;font-size:.58rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em}
.scheduler-segment-warning--gap{background:#ffab40;color:#050505}
.scheduler-now-line{position:absolute;left:0;right:0;height:2px;background:#00bcd4;pointer-events:none;z-index:5;box-shadow:0 0 6px rgba(0,188,212,.6)}
.scheduler-segment-handle{position:absolute;left:0;right:0;height:8px;cursor:ns-resize;z-index:10;background:transparent}
.scheduler-segment-handle:hover{background:rgba(255,255,255,.2)}
.scheduler-segment-handle--top{top:-4px}
.scheduler-segment-handle--bottom{bottom:-4px}
.scheduler-segment-profile-btn{border:none;background:none;padding:0;margin:0;color:inherit;font:inherit;display:inline-flex;align-items:center;gap:4px;cursor:pointer}
.scheduler-segment-profile-btn:hover{text-decoration:underline}
.scheduler-segment-profile-caret{font-size:.75em;opacity:.8}
.scheduler-segment-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border: 1px solid #ff4444;
  background: transparent;
  color: #ff4444;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.15s ease, background 0.2s ease;
  font-weight: 700;
  padding: 0;
  touch-action: manipulation;
}
.scheduler-segment-delete-cross{opacity:0;transition:opacity .2s ease;position:relative;top:0}
.scheduler-segment-delete:hover {
  opacity: 1;
  background: #ff4444;
  color: #fff;
  transform: scale(1.05);
}
.scheduler-segment-delete:hover .scheduler-segment-delete-cross{opacity:1;top:1px}
.scheduler-segment-delete:active{transform:scale(0.9)}
.scheduler-grid-empty {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 24px;
  border-radius: 12px;
  background: rgba(14, 28, 46, 0.5);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}
.scheduler-grid-empty.active {
  display: flex;
}
.scheduler-grid-empty p {
  margin: 0;
  max-width: 280px;
}
.scheduler-grid-empty .btn {
  min-height: 44px;
  padding: 10px 20px;
  touch-action: manipulation;
}
.scheduler-profile-modal .modal-dialog{min-width:260px}
.scheduler-profile-modal-body{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}
.scheduler-profile-modal .modal-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.scheduler-inspector{flex:1;min-width:260px;border:1px solid rgba(255,255,255,.1);border-radius:12px;padding:16px;background:rgba(0,0,0,.4);display:flex;flex-direction:column;gap:12px}
.scheduler-inspector-header{display:flex;justify-content:space-between;align-items:center}
.scheduler-inspector-field{display:flex;flex-direction:column;gap:6px}
.scheduler-time-row{display:flex;gap:12px}
.scheduler-time-row .form-field{flex:1}
.scheduler-time-inputs{display:flex;gap:8px;align-items:center}
.scheduler-time-inputs select{flex:1}
.scheduler-time-inputs span{color:rgba(255,255,255,.6);font-weight:600}
.scheduler-color-picker{width:80px;height:32px;border:none;border-radius:6px;padding:0;background:transparent}
.scheduler-inspector-actions{display:flex;gap:8px;flex-wrap:wrap}
.scheduler-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:8px}
.scheduler-footer-left,.scheduler-footer-right{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.scheduler-validation-message{min-height:22px;font-size:.85rem;color:#ffab40}


.station-control-group{padding:8px 12px}
.station-control-row{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.station-control-row:last-child{margin-bottom:0}
.station-control-label{font-size:14px;color:var(--text-secondary);white-space:nowrap;min-width:100px;flex-shrink:0;transition:color 0.2s}
.station-control-label.disabled{color:#666;opacity:0.6}
.station-control-row select{flex:1;min-width:0}
.scheduler-menu-toggle{display:inline-flex;align-items:center;margin-left:auto}
.playlist-header-row{display:flex;align-items:center;justify-content:flex-start;gap:16px;flex-wrap:wrap;margin-bottom:8px}
/* Legacy playlist-profile-selector removed — now uses .pool-header-bar */
.track-pool-selector-controls .nav-icon{
  margin-left:0;
  border:1px solid rgba(80,140,210,0.35);
  background:rgba(14,28,46,0.95);
  color:#e5f3ff;
  border-radius:6px;
  padding:6px 10px;
  box-shadow:0 6px 14px rgba(0,0,0,0.35);
  transition:background 0.2s ease,border-color 0.2s ease;
}
.track-pool-selector-controls .nav-icon:hover{
  background:rgba(23,44,70,0.95);
  border-color:rgba(115,165,225,0.55);
}
.track-pool-match-count{
  padding-left:0;
  font-size:14px;
  color:var(--text-secondary);
  white-space:nowrap;
  font-weight:500;
  margin-left:0.5rem;
}
.playlists-body select,
.playlists-body .form-control,
.playlists-body .form-control--compact {
  background:rgba(14,28,46,0.95);
  border:1px solid rgba(80,140,210,0.35);
  color:#fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow:inset 0 0 0 1px rgba(41,96,180,0.1);
}
.playlists-body .form-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8ca0b9;
}
.playlists-body .form-hint {
  font-size: 12px;
  font-weight: 500;
  color: #8ca0b9;
}
.playlists-body select:focus,
.playlists-body .form-control:focus,
.playlists-body .form-control--compact:focus {
  border-color:rgba(130,190,255,0.8);
  box-shadow:0 0 0 2px rgba(66,133,244,0.25);
  outline:none;
}
h2.card-header .playlist-mode-toggle{margin-left:0}
.playlists-body h2.card-header{justify-content:flex-start}
#panel-playlists .playlist-panel-header {
  margin: 0 0 12px 0;
  padding: 4px 0 8px 0;
  justify-content: flex-start;
  column-gap: 12px;
  row-gap: 16px;
  flex-wrap: wrap;
}
#panel-playlists .playlist-panel-header > span:first-child {
  display: none;
}
#panel-playlists .playlist-panel-header .playlist-mode-toggle {
  flex-shrink: 0;
}
.playlist-profile-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-basis: 100%;
  min-width: 0;
}
.playlist-profile-bar .playlist-profile-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}
.playlist-profile-bar .playlist-profile-btn {
  flex-shrink: 0;
}
.playlist-profile-bar .playlist-profile-btn:first-of-type {
  margin-left: auto;
}
/* Playlist profile bar: match status box font styling */
#panel-playlists .playlist-profile-select {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  max-width: none;
}
#panel-playlists .playlist-profile-btn {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8ca0b9;
}
#panel-playlists .playlist-profile-btn.pool-btn-new {
  color: #6db3ff;
}
#panel-playlists .playlist-profile-btn.pool-btn-delete {
  color: #ff7070;
}
body.theme-light #panel-playlists .playlist-profile-select {
  color: #0a0a0a;
}
body.theme-light #panel-playlists .playlist-profile-btn {
  color: #525252;
}
body.theme-light #panel-playlists .playlist-profile-btn.pool-btn-new {
  color: #171717;
}
body.theme-light #panel-playlists .playlist-profile-btn.pool-btn-delete {
  color: #dc2626;
}
.scheduler-menu-row{display:flex;align-items:center;gap:10px;margin-top:6px}
.scheduler-menu-row .sidebar-item{flex:1;margin:0}
@media (max-width: 900px) {
  .scheduler-inspector { width: 100%; }
  .scheduler-grid.scheduler-grid--week { grid-template-columns: repeat(2, 1fr); }
  .scheduler-grid-wrapper { width: calc(100% - 12px); margin-left: 12px; }
  .scheduler-toolbar .pool-header-bar .pool-btn-new,
  .scheduler-toolbar .pool-header-bar .pool-btn-save,
  .scheduler-toolbar .pool-header-bar .pool-btn-delete {
    min-height: 44px;
    padding: 8px 12px;
    touch-action: manipulation;
  }
}
@media (max-width: 640px) {
  .scheduler-grid-wrapper { width: calc(100% - 8px); margin-left: 8px; max-height: 480px; }
}

.panel-message.error {
  color: #ff6b6b;
}
.form-label {
  font-weight: 600;
  font-size: 16px;
  color: #f0f0f0;
}
.form-row--split {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.form-row--split .form-field {
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-control--compact {
  max-width: 280px;
}
.repeat-range-row .form-field {
  max-width: 280px;
}
.repeat-range-row .range-control--mini {
  width: 160px;
}
.progression-select-row .form-field {
  flex: 1 1 200px;
}

/* Progression controls container */
.progression-controls-container {
  margin-bottom: 0.75rem;
}
#panel-setprog .progression-checkbox-row {
  margin-top: 1.25rem;
}

/* Sets Flow: top-align controls — default form-row--split uses flex-end, so a taller third column made “When set completes” sit higher */
#panel-sets-flow .form-row--split {
  align-items: flex-start;
}

/* Progression graph container */
.progression-graph-container {
  width: 100%;
  margin-top: 0.75rem;
}

.progression-graph-label {
  padding-bottom: 0.5rem;
}

.progression-graph-edit-row {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.progression-graph-edit-label {
  font-size: 14px;
  font-weight: 600;
  color: #8ca0b9;
}

.progression-graph-edit-radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 14px;
}

.progression-graph-edit-radio span {
  font-size: 14px;
}

.progression-graph-wrapper {
  position: relative;
  background: rgba(20, 30, 45, 0.6);
  border: 1px solid rgba(80, 140, 210, 0.3);
  border-radius: 4px;
  padding: 8px;
  min-height: 320px;
  width: 100%;
}

#progressionGraphCanvas {
  display: block;
  width: 100% !important;
  height: 300px !important;
  min-height: 300px;
  cursor: crosshair;
  background: rgba(15, 25, 40, 0.8);
  border-radius: 2px;
  box-sizing: border-box;
}

.progression-controls-left {
  flex: 0 0 auto;
  min-width: 300px;
}

@media (max-width: 1200px) {
  .progression-select-row {
    flex-direction: column;
  }
  
  .progression-graph-container {
    margin-left: 0;
    margin-top: 1.5rem;
    max-width: 100%;
  }

  /* Keep Harmonic Mix & Progression controls left-aligned on narrow layouts */
  #panel-mix .form-row--split,
  #panel-setprog .form-row--split {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  #panel-mix .form-row--split .form-field,
  #panel-setprog .form-row--split .form-field {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }
}
/* Flow Forge Styles */
.flowforge-controls {
  margin-bottom: 1.5rem;
}

.flowforge-playlist-container {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(80, 140, 210, 0.3);
}

.flowforge-playlist-header {
  font-size: 16px;
  font-weight: 600;
  color: #e5f3ff;
  margin-bottom: 1rem;
}

.flowforge-playlist-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(20, 30, 45, 0.6);
  border-radius: 4px;
  border: 1px solid rgba(80, 140, 210, 0.2);
}

.flowforge-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.flowforge-stat--checkbox {
  flex-direction: row;
  align-items: center;
  margin-top: 0.5rem;
}

.flowforge-stat-label {
  font-size: 11px;
  color: #8ca0b9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flowforge-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: #e5f3ff;
}

.flowforge-playlist-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 12px;
}

.flowforge-playlist-table thead {
  background: rgba(20, 30, 45, 0.8);
}

.flowforge-playlist-table th {
  padding: 0.5rem 0.4rem;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: #8ca0b9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(80, 140, 210, 0.2);
}

.flowforge-playlist-table td {
  padding: 0.5rem 0.4rem;
  font-size: 12px;
  color: #dfe9f5;
  border-bottom: 1px solid rgba(80, 140, 210, 0.1);
}

.flowforge-playlist-table tbody tr:hover {
  background: rgba(80, 140, 210, 0.1);
}

.flowforge-substitute-list {
  max-height: 400px;
  overflow-y: auto;
  margin: 16px 0;
}
.flowforge-substitute-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.flowforge-substitute-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.flowforge-substitute-item-info {
  flex: 1;
}
.flowforge-substitute-item-info strong {
  display: block;
  color: #f0f0f0;
  margin-bottom: 4px;
  font-size: 14px;
}
.flowforge-substitute-item-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #8ca0b9;
}
.flowforge-substitute-item-meta span {
  white-space: nowrap;
}
.flowforge-substitute-sql {
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.flowforge-substitute-sql textarea {
  width: 100%;
  resize: vertical;
}
.flowforge-playlist-row {
  transition: background-color 0.2s ease;
}
.flowforge-playlist-row:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
}
.flowforge-playlist-row.processing {
  opacity: 0.6;
  pointer-events: none;
}
#flowforgeSubstituteTitle {
  font-size: 18px;
  font-weight: 600;
  color: #e5f3ff;
  margin: 0 0 16px 0;
}

.flowforge-mix-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toggle-row .toggle-hint {
  margin: 0;
  flex: 1 1 320px;
  color: #aaa;
  font-size: 14px;
}
.form-control {
  background: #1f1f1f;
  border: 1px solid #444;
  color: #eee;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
}
select.form-control,
select.form-control--compact {
  max-width: 280px;
}
.form-control:focus {
  outline: none;
  border-color: #2979ff;
  box-shadow: 0 0 0 2px rgba(41,121,255,0.25);
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.form-actions--autosave {
  justify-content: flex-end;
  min-height: 20px;
}
.autosave-status {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: rgba(240, 240, 240, 0.82);
  min-height: 1.2em;
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.autosave-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.autosave-status.is-pending,
.autosave-status.is-saving {
  color: #8dc6ff;
}
.autosave-status.is-error {
  color: #ff9b9b;
}
.theme-light .autosave-status {
  color: rgba(24, 32, 48, 0.72);
}
.theme-light .autosave-status.is-pending,
.theme-light .autosave-status.is-saving {
  color: #0b63ce;
}
.theme-light .autosave-status.is-error {
  color: #c23333;
}
.checkbox-row {
  gap: 4px;
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #f0f0f0;
}
.checkbox-label input[type="checkbox"],
.track-pool-checkboxes input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid #2cc36b;
  background-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, opacity 0.15s ease;
  position: relative;
  margin-right: 6px;
}

.checkbox-label input[type="checkbox"]::after,
.track-pool-checkboxes input[type="checkbox"]::after {
  content: '✔';
  font-size: 14px;
  color: #3bff88;
  position: absolute;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.checkbox-label input[type="checkbox"]:checked,
.track-pool-checkboxes input[type="checkbox"]:checked {
  border-color: #3bff88;
  background-color: transparent;
}

.checkbox-label input[type="checkbox"]:checked::after,
.track-pool-checkboxes input[type="checkbox"]:checked::after {
  opacity: 1;
}

.checkbox-label input[type="checkbox"]:hover,
.track-pool-checkboxes input[type="checkbox"]:hover {
  opacity: 0.9;
}

.checkbox-label input[type="checkbox"]:focus-visible,
.track-pool-checkboxes input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(59, 255, 136, 0.45);
  outline-offset: 2px;
}
.range-control {
  width: 140px;
  max-width: 100%;
  accent-color: #2979ff;
}

.range-control--mini {
  width: 120px;
  max-width: 120px;
}
.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 16px;
  font-size: 13px;
  color: #ccc;
}
.value-grid strong {
  color: #fff;
  margin-right: 4px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
  font-size: 15px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  margin: 2px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
}
.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible:not(:disabled) {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}
.btn-alert {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
}
.btn-alert:hover:not(:disabled),
.btn-alert:focus-visible:not(:disabled) {
  background: #a52a2a;
  border-color: #a52a2a;
  color: #fff;
}
.btn-danger {
  border-color: #b91c1c;
  background: #dc2626;
  color: #fff;
}
.btn-danger:hover:not(:disabled),
.btn-danger:focus-visible:not(:disabled) {
  background: #b91c1c;
  border-color: #991b1b;
  color: #fff;
}
.btn-secondary {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
  font-size: 13px;
  padding: 8px 16px;
}
.btn-secondary:hover:not(:disabled),
.btn-secondary:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.btn-secondary.active {
  background: #d32f2f;
  border-color: #b71c1c;
  color: #fff;
}
.btn-secondary.active:hover:not(:disabled) {
  background: #c62828;
}
.btn-success {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
}
.btn-success:hover:not(:disabled),
.btn-success:focus-visible:not(:disabled) {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}
.save-status {
  font-size: 14px;
  color: #8bc34a;
}
.save-status.error {
  color: #ff6b6b;
}
.form-hint {
  font-size: 14px;
  color: #aaa;
  margin-top: 4px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
/* Stack stations vertically on the overview page */
#grid.grid { grid-template-columns: 1fr; }
.card {
  border: 1px solid rgba(69, 118, 185, 0.4);
  border-radius: 8px;
  padding: 0;
  background: rgba(10, 20, 35, 0.92);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  color: #fff;
}
/* All station menu panels: same bordered card look as deck */
.station-main .panel > .card {
  border: 1px solid rgba(69, 118, 185, 0.4);
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}
h2.card-header {
  margin: -12px -12px 12px;
  padding: 12px 16px;
  background: rgba(14, 28, 46, 0.95);
  border-bottom: 1px solid rgba(80, 140, 210, 0.35);
  border-left: 0;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: inset 0 0 0 1px rgba(41, 96, 180, 0.12);
  color: #e5f3ff;
  font-size: 18px;
  font-weight: 600;
}
h2.card-header.panel-main-header {
  display: none;
}
h2.card-header.panel-main-header.has-controls {
  display: flex;
  justify-content: flex-start;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
  margin: -12px 0 0 0;
  padding: 4px 0 8px 0;
  min-height: 0;
  font-size: 0;
  color: transparent;
}
h2.card-header.panel-main-header.has-controls > span:first-child {
  display: none;
}
h2.card-header.panel-main-header.has-controls > * {
  font-size: 14px;
}
.header-controls { display: inline-flex; align-items: center; gap: 10px; }
.playback-card .header-controls {
  margin-left: auto;
  justify-content: flex-end;
}
h1 { margin-bottom: 16px; color:#fff; font-size:12px; }
h2 { margin: 0 0 8px 0; font-size:12px; color:#fff; }
.card h2 { font-size: 18px; font-weight: 600; }
.card h2 a { text-decoration: none; color: inherit; }
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  min-width: 60px;
  width: 60px;
  height: 24px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.status-badge.live {
  background: rgba(255, 77, 77, 0.2);
  border-color: rgba(255, 77, 77, 0.5);
  color: #ff4d4d;
}
.status-badge.wait {
  background: rgba(255, 165, 0, 0.2);
  border-color: rgba(255, 165, 0, 0.5);
  color: #ffa500;
}
.status-badge.cue {
  background: rgba(139, 195, 74, 0.2);
  border-color: rgba(139, 195, 74, 0.5);
  color: #8bc34a;
}
.status-badge.empty {
  background: rgba(136, 136, 136, 0.2);
  border-color: rgba(136, 136, 136, 0.5);
  color: #888;
}
.status-badge.queued {
  background: rgba(100, 181, 246, 0.2);
  border-color: rgba(100, 181, 246, 0.5);
  color: #64b5f6;
}
.status-badge.preparing {
  background: rgba(255, 193, 7, 0.2);
  border-color: rgba(255, 193, 7, 0.5);
  color: #ffc107;
  animation: preparing-pulse 2s ease-in-out infinite;
}
@keyframes preparing-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}
.live-icon { width: 18px; height: 18px; display: none; }
.remain-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(135, 206, 250, 0.5);
  background: rgba(135, 206, 250, 0.2);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  min-width: 60px;
  width: 60px;
  height: 24px;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.remain-badge.remain-header { margin-right: 6px; }
.err { color: #ff6b6b; }
a { color: inherit; text-decoration: none; }
.card strong { color:#fff; font-weight:600; }
.card .value, .card .bpm, .card .key, .card .len, .card .last-prev, .card .artist-prev, .card .beats, .card .played-at, .card .now-text, .card .next-text {
  font-size: 12px;
  color: #bbb;
  font-weight: normal;
}
.playback-card .value,
.playback-card .bpm,
.playback-card .key,
.playback-card .len,
.playback-card .dfc,
.playback-card .last-prev,
.playback-card .artist-prev {
  font-size: 14px;
  color: #f0f0f0;
  font-weight: 600;
}
.playback-card .line-text,
.playback-card .queued-text,
.playback-card .meter,
.playback-card .deck2-bpm,
.playback-card .deck2-key,
.playback-card .deck2-len,
.playback-card .deck2-last-prev,
.playback-card .deck2-artist-prev {
  font-weight: 600;
  color: #f5f5f5;
}
.playback-card .now-text,
.playback-card .queued-text {
  font-size: 16px;
  font-weight: 600;
  color: #f0f0f0;
}

/* Even vertical rhythm inside station cards */
.card .line,
.card .metrics,
.card .extra > div,
.card .progress,
.card .next {
  padding: 6px 0;
}

.card .line {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 6px;
}

.card .line-now strong,
.card .line-next strong {
  display: inline-block;
  width: 110px;
}

.card .line-next .line-text { font-weight: normal; }

.card .metrics, .card .progress { align-items: center; }
.row { display: flex; gap: 16px; align-items: stretch; }
.col-flex { flex: 1 1 auto; }
.col-fixed { flex: 0 0 360px; width: 360px; }
.legend { margin-top: 8px; font-size: 12px; color: #444; display: flex; flex-wrap: wrap; gap: 12px; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 12px; height: 12px; display: inline-block; border-radius: 2px; }

/* Progress meter inspired by CSS-Tricks */
.meter { height: 14px; position: relative; background: #555; border-radius: 12px; padding: 5px 8px; box-shadow: inset 0 -1px 1px rgba(255,255,255,0.15); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 12px; background-color: #2bc253; background-image: linear-gradient(to bottom, #2bc253, #54f054); box-shadow: inset 0 2px 6px rgba(255,255,255,0.25), inset 0 -2px 4px rgba(0,0,0,0.35); width: 100%; transform-origin: left center; transform: scaleX(0); transition: transform .12s linear; }
.meter.orange > span { background-color: #f1a165; background-image: linear-gradient(to bottom, #f1a165, #f36d0a); }
.meter.red > span { background-color: #f0a3a3; background-image: linear-gradient(to bottom, #f0a3a3, #f42323); }
.meter-mini { height: 8px; padding: 0; background: transparent; box-shadow: none; border: none; }
.meter-mini > span { height: 8px; border-radius: 6px; background-image: none; }

/* Progress bar on same line, fills remaining space */
.progress { display: flex; align-items: center; gap: 8px; }
.progress strong { flex: 0 0 auto; }
.progress .meter { height: 8px; flex: 1 1 auto; padding: 0; background: #555; border: none; box-shadow: none; border-radius: 6px; }
.progress .meter > span { height: 8px; border-radius: 6px; }

table.history { width: 100%; border-collapse: collapse; }
table.history th, table.history td { padding: 6px 8px; border-bottom: 1px solid #333; }
table.history th { text-align: left; color:#ccc; }

.tooltip { position: fixed; pointer-events: none; background: rgba(30,30,30,0.95); color:#fff; border: 1px solid #444; padding: 4px 6px; border-radius: 4px; font-size: 12px; z-index: 9999; }

/* Form controls */
input[type="range"] { width: 100%; cursor: pointer; }
input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
select { font-size: 12px; }

@media (min-width: 900px) {
  .sidebar-collapse-btn {
    display: flex;
  }
  .station-layout {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
  }
  .station-sidebar {
    flex: 0 0 228px;
    width: 228px;
    height: 100vh;
    min-height: 100vh;
    position: sticky;
    top: 0;
    margin: 0;
    padding: 0;
    border-radius: 0;
    border-right: none;
    background: rgba(14, 28, 46, 0.98);
    box-shadow: none;
    transition: width 0.2s ease, flex-basis 0.2s ease;
    overflow: hidden;
  }
  .station-top-bar {
    left: 228px;
    right: 0;
    width: auto;
    max-width: none;
    transition: left 0.2s ease;
  }
  .station-right {
    flex: 1 1 auto;
    min-width: 0;
  }
  .station-main {
    flex: 1 1 auto;
    padding-left: 24px;
    padding-right: 24px;
  }
  /* Collapsed sidebar: icon-only strip, icons in same position as full menu */
  .station-layout.sidebar-collapsed .station-sidebar {
    flex: 0 0 52px;
    width: 52px;
    min-width: 52px;
    overflow: hidden;
    flex-direction: column;
    align-items: stretch;
  }
  .station-layout.sidebar-collapsed .station-top-bar {
    left: 52px;
  }
  .station-layout.sidebar-collapsed .station-sidebar .sidebar-logo,
  .station-layout.sidebar-collapsed .station-sidebar .sidebar-label,
  .station-layout.sidebar-collapsed .station-sidebar .sidebar-heading,
  .station-layout.sidebar-collapsed .station-sidebar .deck-status-mini,
  .station-layout.sidebar-collapsed .station-sidebar .sidebar-master-switch,
  .station-layout.sidebar-collapsed .station-sidebar .set-prog-indicator {
    display: none !important;
  }
  .station-layout.sidebar-collapsed .station-sidebar .sidebar-item {
    padding: 9px 13px;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
  }
  .station-layout.sidebar-collapsed .station-sidebar .sidebar-item.has-switch .sidebar-text {
    flex: none;
    justify-content: flex-start;
  }
  .station-layout.sidebar-collapsed .station-sidebar .playlist-engine-group {
    flex-direction: column;
  }
  .station-layout.sidebar-collapsed .station-sidebar .playlist-sublist,
  .station-layout.sidebar-collapsed .station-sidebar .autodj-subtitle {
    display: none !important;
  }
  .station-layout.sidebar-collapsed .station-sidebar .sidebar-sublist .sidebar-item {
    padding: 9px 13px;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .station-layout {
    position: relative;
    gap: 0;
    padding-top: 0;
  }
  .station-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: rgb(14, 28, 46);
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), top 0.25s cubic-bezier(0.4, 0, 0.2, 1), height 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, box-shadow 0.2s ease;
    z-index: 200;
    padding-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  /* On mobile the menu toggle logo lives in the top bar only; hide sidebar logo so it never disappears */
  .station-sidebar .sidebar-logo {
    display: none !important;
  }
  .top-bar-menu-toggle {
    display: none;
  }
  .sidebar-collapse-btn {
    display: flex;
  }
  /* Keep top bar fixed so it doesn't take flow space (avoids double gap above station-right) */
  /* Collapsed: slide off-screen with transform */
  .station-layout:not(.menu-open) .station-sidebar {
    transform: translateX(-100%);
    background: transparent;
    z-index: 250;
  }
  .station-layout.menu-open .station-sidebar {
    transform: translateX(0);
    top: 52px;
    height: calc(100vh - 52px);
    background: rgba(14, 28, 46, 0.98);
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }
  .station-sidebar .sidebar-item,
  .station-sidebar .sidebar-heading,
  .station-sidebar .playlist-engine-group {
    transition: opacity 0.2s ease;
  }
  .station-layout:not(.menu-open) .station-sidebar .sidebar-item,
  .station-layout:not(.menu-open) .station-sidebar .sidebar-heading,
  .station-layout:not(.menu-open) .station-sidebar .playlist-engine-group {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-out;
  }
  .station-layout.menu-open .station-sidebar .sidebar-item,
  .station-layout.menu-open .station-sidebar .sidebar-heading,
  .station-layout.menu-open .station-sidebar .playlist-engine-group {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.2s ease-in 0.05s;
  }
  .station-sidebar .sidebar-item {
    border-right: none;
    font-size: 15px;
  }
  /* Top bar: full viewport width; hamburger btn is inline so no extra left padding needed */
  .station-top-bar {
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    z-index: 100;
  }
  .station-layout.menu-open .station-top-bar {
    z-index: 300;
    isolation: isolate;
  }
  .station-top-bar-account {
    margin-right: 0;
    z-index: 2;
  }
  /* Backdrop: below top bar so Mr Gravy / logout stay visible; click to close */
  .sidebar-backdrop {
    position: fixed;
    top: 74px;
    left: 260px;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 150;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  .station-layout.menu-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

.events-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.events-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.events-log {
  border: 1px solid rgba(69, 118, 185, 0.35);
  border-radius: 10px;
  background: rgba(10, 20, 35, 0.85);
  max-height: 340px;
  overflow-y: auto;
  font-size: 12px;
}
.events-entry {
  padding: 10px 12px;
  border-bottom: 1px solid #242424;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.events-entry .event-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.events-entry .event-badge {
  align-self: flex-start;
}
.events-entry:last-child {
  border-bottom: none;
}
.events-entry .event-meta {
  font-size: 11px;
  color: #999;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.events-entry .event-kind {
  color: #ffb74d;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.events-entry .event-time {
  color: #93c5ff;
  font-size: 11px;
  min-width: 60px;
  flex-shrink: 0;
  align-self: center;
  position: relative;
  top: 2px;
}
.events-entry .event-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.event-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
  align-self: center;
  line-height: 1.2;
  white-space: nowrap;
  color: #e5f3ff;
  min-width: 80px;
  width: 80px;
}
.event-badge--green {
  background: rgba(111, 231, 161, 0.15);
  border: 1px solid rgba(111, 231, 161, 0.4);
  color: #6ee7a1;
}
.event-badge--red {
  background: rgba(255, 122, 122, 0.15);
  border: 1px solid rgba(255, 122, 122, 0.4);
  color: #ff7a7a;
}
.event-badge--ident {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.4);
  color: #ffc107;
}
.event-badge--perceptual {
  background: rgba(255, 152, 0, 0.2);
  border: 1px solid rgba(255, 152, 0, 0.5);
  color: #ff9800;
}
.event-badge--neutral {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5f3ff;
}
/* Playlist mode badge in events */
.event-badge-playlist-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
  align-self: center;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 80px;
  width: 80px;
  border: none;
}
.event-badge-playlist-mode--autodj {
  background: linear-gradient(135deg, #ffd45c, #f0a500);
  color: #040404;
  box-shadow: 0 2px 8px rgba(255,210,92,0.4);
}
.event-badge-playlist-mode--simple {
  background: linear-gradient(135deg, #25c175, #1a8f54);
  color: #040404;
  box-shadow: 0 2px 8px rgba(24,196,123,0.4);
}
.event-badge-playlist-mode--crate {
  background: linear-gradient(135deg, #ff6b6b, #c62828);
  color: #040404;
  box-shadow: 0 2px 8px rgba(255,107,107,0.4);
}
.event-text {
  color: #dfe9f5;
  font-size: 12px;
  flex: 1;
  position: relative;
  top: 2px;
  align-self: center;
}
.event-text.event-text--ident {
  color: #ffd700 !important;
}
.events-empty {
  padding: 20px;
  text-align: center;
  color: #909090;
}
.event-section {
  font-size: 11px;
  color: #cfd8dc;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}
.event-section-label {
  color: #8bc34a;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-right: 6px;
}
.event-section .event-text {
  flex: 1;
  position: static;
  top: auto;
  align-self: auto;
}
.event-fallback-warning {
  display: inline-block;
  color: #ff7a7a;
  font-weight: 700;
  font-size: 12px;
  margin-left: 4px;
  vertical-align: middle;
}
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}
.confirm-dialog {
  width: min(420px, 90vw);
  background: #111;
  border: 1px solid #444;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.confirm-dialog h3 {
  margin: 0;
  font-size: 18px;
  color: #fff;
}
.confirm-dialog p {
  margin: 0;
  font-size: 14px;
  color: #cfd8dc;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.confirm-overlay[hidden] {
  display: none;
}
.daemon-action-dialog {
  align-items: center;
  text-align: center;
}
.daemon-action-progress {
  display: flex;
  justify-content: center;
  align-items: center;
}
.daemon-action-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(41, 182, 246, 0.24);
  border-top-color: #29b6f6;
  animation: daemon-action-spin 1s linear infinite;
}
.daemon-action-status {
  font-size: 12px;
  color: #90a4ae;
  margin-top: -6px;
}
@keyframes daemon-action-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.manual-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.manual-buttons .btn {
  font-size: 13px;
  padding: 8px 16px;
}
.manual-inline-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.manual-inline-buttons .btn {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 3px;
}
.badge-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px !important;
  font-weight: 600;
  white-space: nowrap;
  min-width: 120px;
  width: 120px;
  height: 24px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.badge-button--success {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
}
.badge-button--success:hover,
.badge-button--success:focus-visible {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}
.badge-button--alert {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
}
.badge-button--alert:hover,
.badge-button--alert:focus-visible {
  background: #a52a2a;
  border-color: #a52a2a;
  color: #fff;
}
.badge-button[data-manual-action="reseed"]:hover,
.badge-button[data-manual-action="reseed"]:focus-visible,
.badge-button[data-manual-action="seed-rare"]:hover,
.badge-button[data-manual-action="seed-rare"]:focus-visible {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}
.badge-button#blockCurrentBtn,
.badge-button#blockQueuedBtn {
  margin-left: auto;
}
.badge-button.success {
  background: rgba(129,199,132,0.85);
  border-color: rgba(129,199,132,0.7);
  color: #1b5e20;
}
.badge-button.error {
  background: rgba(229,57,53,0.85);
  border-color: rgba(229,57,53,0.7);
  color: #fff;
}
.badge-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Track pool mood pills */
.mood-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mood-pill {
  min-width: 100px;
  width: 100px;
  height: 24px;
  text-transform: none;
  font-size: 11px !important;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.mood-pill--neutral {
  opacity: 0.9;
}

.mood-pill--include {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}

.mood-pill--off {
  background: #5c1b1b;
  border-color: #7f2525;
  color: #ffe5e5;
  opacity: 0.85;
}

.mood-pill--off::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -10%;
  width: 120%;
  height: 2px;
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(-20deg);
  pointer-events: none;
}

.login-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.login-wrapper {
  width: min(420px, 92vw);
  padding: 24px;
}

.login-card {
  background: rgba(17,17,17,0.88);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 36px 38px 42px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 18px 46px rgba(0,0,0,0.55);
}

.login-logo {
  height: 90px;
  display: block;
  margin: 0 auto 4px;
}

.login-title {
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  color: #f5f5f5;
  letter-spacing: 0.6px;
  margin: 0;
}
.login-tagline {
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.65);
  margin: 4px 0 0 0;
  letter-spacing: 0.2px;
}
.login-subtitle {
  text-align: center;
  font-size: 18px;
  color: #cfd8dc;
  margin: 0;
  letter-spacing: 0.4px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.login-alert,
.login-error {
  font-size: 14px;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 8px;
  margin: -4px 0 6px;
}
.login-alert {
  background: rgba(41,121,255,0.15);
  border: 1px solid rgba(41,121,255,0.35);
  color: #c4ddff;
}
.login-error {
  background: rgba(244,67,54,0.18);
  border: 1px solid rgba(244,67,54,0.45);
  color: #ffab91;
}
.login-form .remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #e0e0e0;
  margin-top: -6px;
}
.login-form .remember-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.login-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 16px;
  color: #cfd8dc;
  letter-spacing: 0.2px;
}

.login-input {
  background: #111;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 14px 16px;
  color: #fff;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input:focus {
  outline: none;
  border-color: #2979ff;
  box-shadow: 0 0 0 2px rgba(41,121,255,0.35);
}

.login-submit {
  margin-top: 8px;
  width: 100%;
  font-size: 16px;
}

.login-footer {
  margin-top: 24px;
  text-align: center;
}

.login-footer-text {
  font-size: 12px;
  color: rgba(229, 243, 255, 0.7);
}

.login-footer-separator {
  margin: 0 6px;
}

.login-footer-link {
  color: #e5f3ff;
  text-decoration: none;
  border-bottom: 1px dotted rgba(229, 243, 255, 0.5);
}

.login-footer-link:hover {
  color: #ffffff;
  border-bottom-style: solid;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  padding: 12px 16px;
  background: rgba(8, 14, 26, 0.98);
  border-top: 1px solid rgba(72, 119, 186, 0.7);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.7);
  font-size: 13px;
  color: #dfe9f5;
}

.cookie-banner-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-banner-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cookie-banner-text strong {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e5f3ff;
}

.cookie-banner-text span {
  font-size: 12px;
  color: #9fb7d4;
}

.cookie-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-btn-reject,
.cookie-btn-accept {
  font-size: 12px;
  padding: 6px 12px;
}

@media (max-width: 700px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner-actions {
    justify-content: flex-end;
  }
}

.privacy-page {
  background: radial-gradient(circle at top, #324a70 0, #050811 45%, #020309 100%);
  color: #e5f3ff;
}

.privacy-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.privacy-card {
  max-width: 800px;
  width: 100%;
  background: rgba(10, 18, 32, 0.96);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(89, 140, 205, 0.7);
  padding: 32px 28px;
}

.privacy-title {
  margin: 0 0 12px 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e5f3ff;
}

.privacy-intro {
  margin: 0 0 20px 0;
  color: #c1d5f0;
}

.privacy-card h2 {
  margin-top: 22px;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 600;
  color: #e5f3ff;
}

.privacy-card p {
  margin: 0 0 12px 0;
  color: #c1d5f0;
  font-size: 14px;
  line-height: 1.6;
}

.privacy-card ul {
  margin: 0 0 14px 20px;
  padding: 0;
  color: #c1d5f0;
  font-size: 14px;
}

.privacy-card li + li {
  margin-top: 4px;
}

.privacy-card code {
  background: rgba(3, 11, 25, 0.9);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 13px;
}

.privacy-back-link {
  margin-top: 20px;
}

.privacy-back-link a {
  color: #e5f3ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(229, 243, 255, 0.6);
}

.privacy-back-link a:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.control-shell {
  max-width: 520px;
  margin: 24px auto 40px;
  padding: 0 12px;
}
.control-page {
  margin: 0;
}
.control-page .top-nav {
  margin: 0 0 24px 0;
  border-radius: 0;
}
.control-page .top-nav .nav-logo {
  height: 56px;
}
.control-page .nav-title {
  display: none;
}
.control-page .control-card .card-header {
  margin: 0 0 12px 0;
  padding: 0;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}
body.theme-light .control-page .control-card .card-header {
  background: transparent;
  border-bottom: none;
  color: #0a0a0a;
}
.control-card {
  margin: 0;
  padding: 16px;
}
.control-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.control-events {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(18,18,18,0.85);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.numeric-stepper {
  display: inline-flex;
  align-items: stretch;
  align-self: flex-start;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.35);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 4px 10px rgba(0,0,0,0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: auto;
  max-width: max-content;
}
.numeric-stepper--mini {
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 3px 8px rgba(0,0,0,0.3);
}
.numeric-stepper--mini .stepper-button {
  width: 30px;
  font-size: 14px;
}
.numeric-stepper--mini .stepper-input {
  width: 44px;
  font-size: 15px;
}
.numeric-stepper.scoring-stepper .stepper-input {
  width: 56px;
  font-size: 16px;
  font-weight: 600;
}
.numeric-stepper.scoring-stepper .stepper-button {
  width: 32px;
  font-size: 16px;
}
.numeric-stepper--disabled {
  opacity: 0.5;
  pointer-events: none;
}
.numeric-stepper:focus-within {
  border-color: rgba(129, 212, 250, 0.6);
  box-shadow: 0 0 0 1px rgba(129, 212, 250, 0.4), 0 10px 26px rgba(0,0,0,0.5);
}
.stepper-button {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #e5f3ff;
  font-size: 16px;
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  border-radius: 4px;
  padding: 4px;
}
.stepper-button:hover:not(:disabled),
.stepper-button:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.stepper-button:focus-visible {
  outline: 2px solid rgba(129,212,250,0.6);
  outline-offset: -2px;
}
.stepper-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.stepper-input {
  width: 48px;
  text-align: center;
  border: none;
  background: transparent;
  color: #e0f7fa;
  font-size: 18px;
  font-weight: 500;
  appearance: none;
  -moz-appearance: textfield;
  user-select: none;
  caret-color: transparent;
}
.stepper-input:focus {
  outline: none;
}
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stepper-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}
.stepper-value-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: #90a4ae;
}
.stepper-value {
  display: block;
  font-size: 24px;
  font-weight: 600;
  color: #e3f2fd;
  margin-top: 6px;
}
.stepper-hint {
  margin: 0;
  font-size: 11px;
  color: #9fb4c0;
  max-width: 100%;
}
.setting-stepper-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.setting-stepper-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#panel-tempo .form-row.form-row--split {
  align-items: flex-start;
}
#panel-tempo .bpm-variance-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
#panel-tempo .bpm-tempo-checkboxes {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scoring-slider--stepper {
  width: auto;
}
.scoring-slider--stepper .numeric-stepper {
  width: auto;
  margin-top: 0;
}

@media (max-width: 640px) {
  .scoring-grid--compact,
  .scoring-inline-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .scoring-field-label,
  .scoring-inline-field .form-label,
  .scoring-field-hint,
  .scoring-inline-field .hint-wrapper,
  .scoring-control,
  .scoring-inline-control {
    justify-self: flex-start;
  }
}
.scoring-stepper {
  min-width: 100px;
  justify-content: center;
}

.control-events h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #b0bec5;
}
.control-events-list {
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-color: #707070 #101010;
}
.control-events-list::-webkit-scrollbar {
  width: 8px;
}
.control-events-list::-webkit-scrollbar-track {
  background: #101010;
  border-radius: 6px;
}
.control-events-list::-webkit-scrollbar-thumb {
  background: #707070;
  border-radius: 6px;
}
.control-events-list::-webkit-scrollbar-thumb:hover {
  background: #8d8d8d;
}
.control-event-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #d1d9df;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 6px;
}
.control-event-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.control-event-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #90a4ae;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.control-event-kind {
  color: #ffb74d;
}
.control-event-time {
  color: #81d4fa;
}
.control-event-body {
  color: #eceff1;
}
.station-control-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: min(420px, 55vh);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: #707070 #101010;
}
.station-control-list::-webkit-scrollbar {
  width: 8px;
}
.station-control-list::-webkit-scrollbar-track {
  background: #101010;
  border-radius: 6px;
}
.station-control-list::-webkit-scrollbar-thumb {
  background: #707070;
  border-radius: 6px;
}
.control-host-metrics {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 480px;
}
.control-section-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.control-section-toggle-arrow {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #90a4ae;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}
.control-section-toggle[aria-expanded="false"] .control-section-toggle-arrow {
  transform: rotate(0deg);
}
.control-section-body[hidden] {
  display: none;
}
.control-section-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.control-host-metrics-title {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #90a4ae;
  margin: 0;
}
.control-host-metric-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 480px;
}
.control-host-spark {
  height: 36px;
  width: 100%;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.control-host-spark svg {
  display: block;
  width: 100%;
  height: 100%;
  vertical-align: top;
}
.control-host-metric {
  display: grid;
  grid-template-columns: 52px 1fr minmax(5.5rem, auto);
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.control-host-metric-label {
  color: #b0bec5;
  font-weight: 500;
}
.control-host-metric-path {
  font-size: 11px;
  opacity: 0.85;
}
.control-host-metric-bar-wrap {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.control-host-metric-bar {
  height: 100%;
  width: 0%;
  max-width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4fc3f7, #29b6f6);
  transition: width 0.35s ease;
}
.control-host-metric[data-metric="memory"] .control-host-metric-bar {
  background: linear-gradient(90deg, #81c784, #66bb6a);
}
.control-host-metric[data-metric="disk"] .control-host-metric-bar {
  background: linear-gradient(90deg, #ffb74d, #ffa726);
}
.control-host-metric-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #eceff1;
  font-size: 12px;
  white-space: nowrap;
}
.control-host-metrics--error .control-host-metric-value {
  color: #ef9a9a;
}
.control-host-temps {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.control-host-temps-title {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #90a4ae;
  margin: 0 0 2px 0;
}
.control-host-temp-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, 32%) 1fr minmax(4.5rem, auto);
  align-items: center;
  gap: 10px;
  font-size: 13px;
  max-width: 480px;
}
.control-host-temp-name {
  color: #b0bec5;
  font-weight: 500;
  min-width: 0;
}
.control-host-temp-bar-wrap {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  min-width: 0;
}
.control-host-temp-bar {
  height: 100%;
  width: 0%;
  max-width: 100%;
  border-radius: 999px;
  transition: width 0.35s ease, background 0.25s ease;
}
.control-host-temp-bar--ok {
  background: linear-gradient(90deg, #26c6da, #4dd0e1);
}
.control-host-temp-bar--warm {
  background: linear-gradient(90deg, #ffb74d, #ffa726);
}
.control-host-temp-bar--hot {
  background: linear-gradient(90deg, #ef5350, #e53935);
}
.control-host-temp-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #eceff1;
  font-size: 12px;
  white-space: nowrap;
}
.control-host-daemon-controls {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.control-host-daemon-controls-title {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #90a4ae;
  margin: 0;
}
.control-host-daemon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 10px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  background: rgba(18,18,18,0.85);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
  max-width: 480px;
  min-width: 0;
  font-size: 13px;
}
.control-host-daemon-row-text {
  flex: 1;
  min-width: 0;
}
.control-host-daemon-row-title {
  color: #eceff1;
  font-weight: 500;
}
.control-host-daemon-row-hint {
  font-size: 11px;
  color: #90a4ae;
  margin-top: 2px;
}
.control-host-daemon-row--off .control-host-daemon-row-title {
  color: #b0bec5;
}
.control-host-daemon-row.unavailable .station-switch-input:disabled + .station-switch-slider {
  opacity: 0.45;
}
body.theme-light .station-control-list {
  scrollbar-color: #c4c4c4 #f0f0f0;
}
body.theme-light .station-control-list::-webkit-scrollbar-track {
  background: #f0f0f0;
}
body.theme-light .station-control-list::-webkit-scrollbar-thumb {
  background: #c4c4c4;
}
body.theme-light .control-host-metrics {
  border-top-color: hsl(0 0% 89.8%);
}
body.theme-light .control-host-metrics-title {
  color: #737373;
}
body.theme-light .control-section-toggle-arrow {
  border-left-color: #737373;
}
body.theme-light .control-host-spark {
  background: rgba(0, 0, 0, 0.04);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
body.theme-light .control-host-metric-label {
  color: #525252;
}
body.theme-light .control-host-metric-bar-wrap {
  background: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
body.theme-light .control-host-metric-value {
  color: #0a0a0a;
}
body.theme-light .control-host-metrics--error .control-host-metric-value {
  color: #b91c1c;
}
body.theme-light .control-host-temps {
  border-top-color: hsl(0 0% 89.8%);
}
body.theme-light .control-host-temps-title {
  color: #737373;
}
body.theme-light .control-host-temp-name {
  color: #525252;
}
body.theme-light .control-host-temp-bar-wrap {
  background: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
body.theme-light .control-host-temp-value {
  color: #0a0a0a;
}
body.theme-light .control-host-daemon-controls {
  border-top-color: hsl(0 0% 89.8%);
}
body.theme-light .control-host-daemon-controls-title {
  color: #737373;
}
body.theme-light .control-host-daemon-row {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
body.theme-light .control-host-daemon-row-title {
  color: #171717;
}
body.theme-light .control-host-daemon-row-hint {
  color: #737373;
}
body.theme-light .control-host-daemon-row--off .control-host-daemon-row-title {
  color: #525252;
}
.station-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  background: rgba(18,18,18,0.85);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 480px;
}
.station-control-row.processing {
  opacity: 0.7;
}
.station-control-meta {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.station-control-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}
.station-control-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.station-control-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.station-control-nowplaying {
  font-size: 12px;
  line-height: 18px;
  min-height: 18px;
  color: rgba(200, 220, 240, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  min-width: 0;
}
.station-loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
}
.station-loading-dots .ld-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(200, 220, 240, 0.9);
  animation: ld-dot-bounce 1.2s ease-in-out infinite;
}
.station-loading-dots .ld-dot:nth-child(1) { animation-delay: 0s; }
.station-loading-dots .ld-dot:nth-child(2) { animation-delay: 0.15s; }
.station-loading-dots .ld-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes ld-dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.6; }
  40% { transform: scale(1); opacity: 1; }
}
.station-status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0,0,0,0.45);
}
.station-status-dot.running {
  background: #4caf50;
}
.station-status-dot.stopped {
  background: #f44336;
}
.station-control-row.processing .station-status-dot {
  background: #9e9e9e !important;
}
.station-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  padding-right: 6px;
}
/* Proto.io-style on/off flip switch */
.station-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.station-switch-input {
  opacity: 0;
  width: 0;
  height: 0;
}
.station-switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(244, 67, 54, 0.6);
  border-radius: 28px;
  transition: background 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}
.station-switch-on,
.station-switch-off {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
  transition: opacity 0.2s ease;
}
.station-switch-on {
  color: rgba(255, 255, 255, 0.9);
}
.station-switch-off {
  color: rgba(255, 255, 255, 0.5);
}
.station-switch-input:checked + .station-switch-slider .station-switch-on {
  opacity: 1;
}
.station-switch-input:checked + .station-switch-slider .station-switch-off {
  opacity: 0.35;
}
.station-switch-input:not(:checked) + .station-switch-slider .station-switch-on {
  opacity: 0.35;
}
.station-switch-input:not(:checked) + .station-switch-slider .station-switch-off {
  opacity: 1;
}
.station-switch-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
}
.station-switch-input:checked + .station-switch-slider {
  background: rgba(76, 175, 80, 0.7);
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.5);
  border-color: rgba(76, 175, 80, 0.8);
}
.station-switch.processing .station-switch-slider {
  background: rgba(158, 158, 158, 0.6) !important;
  box-shadow: 0 0 8px rgba(158, 158, 158, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
  animation: station-switch-breathe 2.5s ease-in-out infinite;
}
.station-switch-input:checked + .station-switch-slider::before {
  transform: translateX(32px);
}
.station-switch-input:focus-visible + .station-switch-slider {
  outline: 2px solid rgba(0, 212, 255, 0.8);
  outline-offset: 2px;
}
.station-switch-input:disabled + .station-switch-slider {
  cursor: not-allowed;
}
.station-switch.processing {
  cursor: wait;
  pointer-events: none;
}
@keyframes station-switch-breathe {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
@media (max-width: 520px) {
  .station-control-row {
    flex-direction: column;
    align-items: stretch;
  }
  .control-host-daemon-row {
    flex-direction: column;
    align-items: stretch;
  }
  .station-control-meta {
    flex: 1 1 auto;
    min-width: 0;
  }
  .station-toggle {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-right: 0;
  }
  .control-host-daemon-row .station-toggle {
    width: 100%;
    justify-content: flex-end;
    padding-right: 0;
  }
}

.station-stream-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 6px;
  transition: filter 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.station-stream-link:hover {
  filter: drop-shadow(0 0 6px rgba(139, 195, 74, 0.55));
}
.station-stream-link-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  /* audio.svg is black; control rows are dark — match gear-style contrast */
  filter: invert(1);
}
.station-stream-link:focus-visible {
  outline: 2px solid #8bc34a;
  outline-offset: 2px;
}

.station-gear-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  color: #cfd8dc;
  transition: color 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}
.station-gear-link:hover {
  color: #e8f5e9;
  filter: drop-shadow(0 0 8px rgba(139, 195, 74, 0.8));
}
.station-gear-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.station-gear-link:focus-visible {
  outline: 2px solid #8bc34a;
  outline-offset: 2px;
}

#panel-tracksearch.panel {
  display: none;
}
#panel-tracksearch.panel.active {
  display: grid;
  grid-template-columns: auto 16px 1fr;
  grid-template-rows: auto auto;
  gap: 12px 0;
  padding-top: 60px;
}

#panel-history.panel {
  display: none;
}
#panel-history.panel.active {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px 0;
  padding-top: 60px;
}
.track-history-panel-header {
  margin: 0;
  grid-row: 1;
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #e5f3ff;
  padding: 0 0 8px 0;
}
#panel-history .track-history-list-wrapper {
  grid-row: 2;
  min-height: 0;
}
.track-search-header-bar {
  display: contents;
}
.track-search-header-bar .panel-main-header {
  margin-bottom: 0;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}
.track-search-header-bar .track-search-input-wrap {
  grid-column: 3;
  grid-row: 1;
}
.track-search-body {
  grid-column: 3;
  grid-row: 2;
}
.track-search-input-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}
.track-search-icon {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}
.track-search-icon svg {
  width: 14px;
  height: 14px;
}
.track-search-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  background: rgba(14, 28, 46, 0.95);
  border: 1px solid rgba(80, 140, 210, 0.35);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  padding: 7px 12px 7px 32px;
  box-shadow: inset 0 0 0 1px rgba(41, 96, 180, 0.1);
}
.track-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.track-search-input:focus {
  outline: none;
  border-color: rgba(130, 190, 255, 0.8);
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.25);
}
body.theme-light #panel-tracksearch .track-search-icon {
  color: #737373;
}
body.theme-light #panel-tracksearch .track-search-input {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  color: #0a0a0a !important;
  box-shadow: none;
}
body.theme-light #panel-tracksearch .track-search-input::placeholder {
  color: #737373;
}
body.theme-light #panel-tracksearch .track-search-input:focus {
  border-color: hsl(221 83% 53%);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
#panel-tracksearch .track-search-body {
  padding-left: 0;
  padding-right: 0;
}
.track-search-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.track-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(17,17,17,0.75);
  max-height: 420px;
  overflow-y: auto;
  scrollbar-color: #707070 #101010;
  container-type: inline-size;
  container-name: track-search;
}
.track-search-results::-webkit-scrollbar {
  width: 8px;
}
.track-search-results::-webkit-scrollbar-track {
  background: #101010;
  border-radius: 6px;
}
.track-search-results::-webkit-scrollbar-thumb {
  background: #707070;
  border-radius: 6px;
}
.track-search-results::-webkit-scrollbar-thumb:hover {
  background: #8d8d8d;
}
.track-search-results.empty {
  display: none;
}

/* Column header row */
.track-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7b8d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
  position: sticky;
  top: 0;
  background: rgba(17,17,17,0.97);
  z-index: 1;
}
.track-search-hplay {
  width: 28px;
  flex-shrink: 0;
}
.track-search-hmeta {
  flex: 1;
  min-width: 0;
}
.track-search-hbpm {
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}
.track-search-hkey {
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
}
.track-search-hdur {
  flex-shrink: 0;
  min-width: 40px;
  text-align: right;
}
.track-search-hactions {
  flex-shrink: 0;
  min-width: 44px;
  text-align: right;
}
/* Responsive: hide BPM then Key as container narrows (before truncating artist/title) */
@container track-search (max-width: 560px) {
  .track-search-hbpm,
  .track-search-item .track-search-bpm {
    display: none;
  }
}
@container track-search (max-width: 440px) {
  .track-search-hkey,
  .track-search-item .track-search-key {
    display: none;
  }
}

/* Result rows */
.track-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
}
.track-search-item.selected {
  background: rgba(139,195,74,0.15);
}
.track-search-item:last-child {
  border-bottom: none;
}
.track-search-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Play button */
.track-search-play {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #9fb3cc;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.track-search-play:hover {
  background: rgba(41, 121, 255, 0.2);
  color: #fff;
}

/* Meta: artist — title */
.track-search-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  align-items: baseline;
  overflow: hidden;
}
.track-search-artist {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.track-search-sep {
  color: #556;
  flex-shrink: 0;
}
.track-search-title {
  color: #b0c4de;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.track-blocked-badge {
  display: inline-block;
  width: 18px;
  height: 18px;
  padding: 0;
  background: #8c1d1d;
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
  text-align: center;
  line-height: 18px;
  flex-shrink: 0;
}

/* Data columns */
.track-search-bpm,
.track-search-key,
.track-search-dur {
  flex-shrink: 0;
  font-size: 12px;
  color: #8ca0b9;
  min-width: 36px;
  text-align: right;
}
.track-search-key {
  min-width: 28px;
}
.track-search-dur {
  min-width: 40px;
}

/* Action popup menu */
.track-search-actions {
  flex-shrink: 0;
  min-width: 44px;
  display: inline-flex;
  justify-content: flex-end;
}
.track-search-actions-wrap {
  position: relative;
  display: inline-flex;
}
.track-search-actions-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.track-search-actions-trigger:hover,
.track-search-actions-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
}
.track-search-actions-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.track-search-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1500;
  display: flex;
  flex-direction: row;
  gap: 4px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(12, 20, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.track-search-actions-menu[hidden] {
  display: none !important;
}
.track-search-menu-item {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #e8eefb;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.track-search-menu-item:hover,
.track-search-menu-item:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.12);
}
.track-search-menu-item[data-track-action="block"] {
  color: #fca5a5;
}
.track-search-menu-item[data-track-action="unblock"] {
  color: #86efac;
}
.track-search-menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.track-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid transparent;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.idents-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.idents-preview-btn {
  padding: 1px 4px;
  font-size: 10px;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  color: #ffffff;
  cursor: pointer;
}
.idents-preview-btn:hover,
.idents-preview-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}
.idents-edit-btn {
  padding: 1px 4px;
  font-size: 10px;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  color: #9fb3cc;
  cursor: pointer;
}
.idents-edit-btn:hover,
.idents-edit-btn:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}
.track-search-btn.success {
  background: rgba(129,199,132,0.85);
  border-color: rgba(129,199,132,0.7);
  color: #1b5e20;
}
.track-search-btn.error {
  background: rgba(229,57,53,0.9);
  border-color: rgba(211,47,47,0.8);
  color: #ffebee;
}
/* Track Search Pagination */
.track-search-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.pagination-btn {
  padding: 5px 14px;
  background: rgba(41, 121, 255, 0.18);
  border: 1px solid rgba(41, 121, 255, 0.35);
  color: #6db3ff;
  cursor: pointer;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.pagination-btn:hover:not(:disabled) {
  background: rgba(41, 121, 255, 0.3);
  border-color: rgba(41, 121, 255, 0.5);
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-btn.active {
  background: rgba(41, 121, 255, 0.35);
  border-color: rgba(41, 121, 255, 0.5);
}
.pagination-info {
  font-size: 12px;
  font-weight: 600;
  color: #8ca0b9;
  margin: 0 0.5rem;
}
.pagination-numbers {
  display: flex;
  gap: 0.25rem;
}

/* Pagination – light theme (match playlist profile buttons) */
body.theme-light .pagination-btn {
  background: rgba(10, 10, 10, 0.06);
  border-color: hsl(0 0% 82%);
  color: #171717;
}
body.theme-light .pagination-btn:hover:not(:disabled) {
  background: rgba(10, 10, 10, 0.12);
  border-color: hsl(0 0% 72%);
}
body.theme-light .pagination-btn:disabled {
  opacity: 0.4;
}
body.theme-light .pagination-btn.active {
  background: rgba(10, 10, 10, 0.12);
  border-color: hsl(0 0% 72%);
  color: #171717;
}
body.theme-light .pagination-info {
  color: #525252;
}

.track-search-btn:focus-visible,
.track-search-play:focus-visible {
  outline: 2px solid rgba(139,195,74,0.8);
  outline-offset: 2px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}
.modal-overlay[hidden] {
  display: none;
}
.modal-dialog {
  width: min(420px, 92vw);
  background: #111;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-dialog--large {
  width: min(800px, 95vw);
  max-height: 90vh;
}
.modal-dialog h3 {
  margin: 0;
  font-size: 18px;
  color: #fff;
}
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-buttons {
  display: inline-flex;
  gap: 10px;
  justify-content: flex-end;
}
.modal-error {
  color: #ff6b6b;
  font-size: 13px;
}
.modal-error[hidden] {
  display: none;
}

/* Track edit modal tabs */
.modal-dialog--tabs {
  width: min(900px, 95vw);
  max-height: 96vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
}
.modal-tabs-hint {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}
.modal-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0 0 12px 0;
  flex-shrink: 0;
  padding: 0 2px 0 0;
}
.modal-tab {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  border-radius: 6px 6px 0 0;
}
.modal-tab:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.1);
}
.modal-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-bottom-color: var(--accent, #4fc3f7);
}
.modal-tab[aria-selected="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-bottom-color: var(--accent, #4fc3f7);
}
.modal-tab-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-top: 8px;
}
#trackEditPanelDetails {
  overflow: hidden;
}
.modal-tab-panel[hidden] {
  display: none;
}
.track-edit-genres-mount,
.track-edit-history-mount {
  min-height: 120px;
}
.track-edit-waveform-row {
  margin-top: 4px;
}
.track-edit-waveform-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.track-edit-waveform-actions {
  display: inline-flex;
  gap: 6px;
}
.track-edit-waveform-container {
  width: 100%;
  height: 114px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.track-edit-waveform-canvas {
  width: 100%;
  height: 100px;
  flex-shrink: 0;
  display: block;
  cursor: grab;
}
.track-edit-waveform-scroll {
  width: calc(100% - 24px);
  height: 8px;
  margin: 2px 12px 4px;
  flex-shrink: 0;
  box-sizing: border-box;
  cursor: pointer;
  align-self: center;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}
.track-edit-waveform-scroll::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(79, 195, 247, 0.9);
  cursor: pointer;
}
.track-edit-waveform-scroll::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(79, 195, 247, 0.9);
  cursor: pointer;
  border: none;
}
body.theme-light .track-edit-waveform-scroll {
  background: rgba(0, 0, 0, 0.08);
}
body.theme-light .track-edit-waveform-scroll::-webkit-slider-thumb,
body.theme-light .track-edit-waveform-scroll::-moz-range-thumb {
  background: rgba(25, 118, 210, 0.9);
}
.track-edit-waveform-canvas.is-dragging {
  cursor: grabbing;
}
.track-edit-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.track-edit-history-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}
.track-edit-history-item:last-child {
  border-bottom: none;
}
body.theme-light .modal-tabs-hint {
  color: rgba(0, 0, 0, 0.5);
}
body.theme-light .modal-tabs {
  border-bottom-color: rgba(0, 0, 0, 0.12);
}
body.theme-light .modal-tab {
  color: rgba(0, 0, 0, 0.7);
  background: rgba(0, 0, 0, 0.04);
}
body.theme-light .modal-tab:hover {
  color: rgba(0, 0, 0, 0.9);
  background: rgba(0, 0, 0, 0.08);
}
body.theme-light .modal-tab.active,
body.theme-light .modal-tab[aria-selected="true"] {
  color: #0a0a0a;
  background: rgba(0, 0, 0, 0.08);
  border-bottom-color: var(--accent, #1976d2);
}
body.theme-light .track-edit-history-item {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
body.theme-light .track-edit-waveform-container {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

/* Track preview modal */
.preview-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.preview-status-text {
  font-size: 13px;
  color: #cfd8dc;
}
.preview-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-start;
}

/* Track Pool Tabs */
.track-pool-tabs {
  margin: 20px 0;
  display: block !important;
}

#trackPoolEditor .track-pool-tabs {
  display: block !important;
}

#trackPoolEditor .track-pool-tab-content[data-tab="genre"] {
  display: block !important;
  visibility: visible !important;
}

.track-pool-tab-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.track-pool-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s;
}

.track-pool-tab:hover {
  color: rgba(255, 255, 255, 0.9);
}

.track-pool-tab.active {
  color: #fff;
  border-bottom-color: #4a9eff;
}

.track-pool-genre-container {
  margin-top: 1rem;
}

.track-pool-genre-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.track-pool-genre-column {
  flex: 1;
  min-width: 0;
}

.track-pool-genre-column .form-label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: #e5f3ff;
}

.track-pool-genre-checkboxes {
  display: flex;
  flex-direction: column;
}

.track-pool-genre-checkboxes .checkbox-label {
  font-size: 0.75rem;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
}

.track-pool-genre-checkboxes .checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
  margin-top: 0;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 3px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: transparent;
  position: relative;
}

.track-pool-genre-checkboxes .checkbox-label input[type="checkbox"]:checked {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.5);
  border-width: 1px;
}

.track-pool-genre-checkboxes .checkbox-label input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #66bb6a;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 2px rgba(102, 187, 106, 0.8), 0 0 4px rgba(102, 187, 106, 0.4);
}

.track-pool-genre-checkboxes .checkbox-label span {
  font-size: 0.75rem;
  line-height: 1.3;
  margin-top: 0px;
  flex: 1;
}

.track-pool-genre-scroll {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.track-pool-genre-scroll::-webkit-scrollbar {
  width: 8px;
}

.track-pool-genre-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.track-pool-genre-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Genre dots */
.genre-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.genre-dot-maest {
  background-color: #ff4444; /* Red */
}

.genre-dot-mtg {
  background-color: #4444ff; /* Blue */
}

.genre-dot-apple {
  background-color: #ffaa00; /* Yellow */
}


.track-pool-genre-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.track-pool-tab-content {
  min-height: 200px;
}

.track-pool-criteria-tabs {
  display: block !important;
}

.track-pool-criteria-tabs .track-pool-tab-content {
  display: none;
}

.track-pool-criteria-tabs .track-pool-tab-content.active {
  display: block !important;
}

/* Ensure genre tab is visible on initial load */
.track-pool-criteria-tabs .track-pool-tab-content[data-tab="genre"].active {
  display: block !important;
}

.criteria-list {
  margin: 16px 0;
}

.criterion-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.criterion-row .form-control {
  flex: 1;
}

.criterion-row .criterion-values {
  display: flex;
  gap: 8px;
  flex: 2;
}

.track-pool-preview {
  margin-top: 16px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.track-pool-preview-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
}

.track-pool-preview-count {
  color: #4a9eff;
}

.track-pool-preview-item {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.track-pool-preview-item:last-child {
  border-bottom: none;
}

.track-pool-preview-item[data-song-id] {
  cursor: pointer;
  transition: background-color 0.2s;
}

.track-pool-preview-item[data-song-id]:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.track-pool-preview-play-icon {
  display: inline-block;
  background: none;
  border: none;
  color: #e5f3ff;
  cursor: pointer;
  padding: 0 4px 0 0;
  font-size: 12px;
  vertical-align: middle;
  transition: color 0.2s ease, transform 0.1s ease;
  line-height: 1;
  width: 16px;
  text-align: center;
}

.track-pool-preview-play-icon:hover {
  color: #fff;
  transform: scale(1.2);
}

.track-pool-preview-play-icon:active {
  transform: scale(1.1);
}

/* Track Pool Tabs */
.track-pool-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

.track-pool-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 14px;
  color: #9fb3cc;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  margin-bottom: -1px;
}

.track-pool-tab:hover {
  color: #fff;
}

.track-pool-tab.active {
  color: #fff;
  border-bottom-color: #2979ff;
}

.track-pool-tab-content {
  display: none;
}

.track-pool-tab-content.active {
  display: block;
}

/* BPM Range Sliders */
.bpm-range-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.bpm-range-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.bpm-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2979ff;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease, transform 0.1s ease;
}

.bpm-range-slider::-webkit-slider-thumb:hover {
  background: #1c5dd8;
  transform: scale(1.1);
}

.bpm-range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2979ff;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease, transform 0.1s ease;
}

.bpm-range-slider::-moz-range-thumb:hover {
  background: #1c5dd8;
  transform: scale(1.1);
}

/* Voice Probability Slider */
.voice-probability-slider-wrapper {
  position: relative;
  height: 8px;
}

.voice-probability-slider-fill {
  position: absolute;
  left: 0;
  top: 2px;
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #f44336 0%, #ff9800 25%, #ffc107 50%, #8bc34a 75%, #4caf50 100%);
  border-radius: 4px;
  pointer-events: none;
  z-index: 1;
  transition: width 0.1s ease;
}

.voice-probability-slider {
  position: relative;
  z-index: 2;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.voice-probability-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 2px solid #2979ff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.voice-probability-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.voice-probability-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 2px solid #2979ff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.voice-probability-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.voice-probability-slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

/* Mood Sliders */
.mood-slider-wrapper {
  position: relative;
  height: 8px;
}

.mood-slider-fill {
  position: absolute;
  left: 0;
  top: 2px;
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #f44336 0%, #ff9800 25%, #ffc107 50%, #8bc34a 75%, #4caf50 100%);
  border-radius: 4px;
  pointer-events: none;
  z-index: 1;
  transition: width 0.1s ease;
}

.mood-slider {
  position: relative;
  z-index: 2;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.mood-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 2px solid #2979ff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.mood-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.mood-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 2px solid #2979ff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.mood-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.mood-slider::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

/* Beta Badge */
.beta-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #ff9800;
  background: rgba(255, 152, 0, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: -10px;
  margin-top: -15px;
  transform: rotate(-15deg);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: top;
  position: relative;
}

/* Voice Probability Sliders */
.voice-slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.voice-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.voice-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2979ff;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease, transform 0.1s ease;
}

.voice-slider::-webkit-slider-thumb:hover {
  background: #1c5dd8;
  transform: scale(1.1);
}

.voice-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2979ff;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: background 0.2s ease, transform 0.1s ease;
}

.voice-slider::-moz-range-thumb:hover {
  background: #1c5dd8;
  transform: scale(1.1);
}

/* Dual-handle range slider */
.dual-range-container {
  position: relative;
  width: 50%;
  height: 40px;
  margin: 20px 0;
}

.dual-range-input {
  position: absolute;
  width: 100%;
  height: 6px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  z-index: 2;
}

.dual-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2979ff;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.3);
  pointer-events: all;
  position: relative;
  z-index: 3;
  transition: background 0.2s ease, transform 0.1s ease;
}

.dual-range-input::-webkit-slider-thumb:hover {
  background: #1c5dd8;
  transform: scale(1.15);
}

.dual-range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2979ff;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.3);
  pointer-events: all;
  position: relative;
  z-index: 3;
  transition: background 0.2s ease, transform 0.1s ease;
}

.dual-range-input::-moz-range-thumb:hover {
  background: #1c5dd8;
  transform: scale(1.15);
}

.dual-range-input.dual-range-min {
  z-index: 2;
}

.dual-range-input.dual-range-max {
  z-index: 1;
}

.dual-range-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  transform: translateY(-50%);
  z-index: 0;
}

.dual-range-fill {
  position: absolute;
  top: 50%;
  height: 6px;
  background: #2979ff;
  border-radius: 3px;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
}

.dual-range-input.dual-range-min::-webkit-slider-thumb {
  z-index: 3;
}

.dual-range-input.dual-range-max::-webkit-slider-thumb {
  z-index: 4;
}

/* Disable section when toggle is off */
.track-pool-genre-section.disabled,
#trackPoolBpmSection.disabled,
#trackPoolVoiceSection.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Genre Dropdown Styles */
.genre-dropdown {
  position: relative;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.genre-dropdown-summary {
  display: block;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  color: #fff;
  transition: background-color 0.2s, border-color 0.2s;
}

.genre-dropdown-summary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.genre-dropdown-summary::-webkit-details-marker {
  display: none;
}

.genre-dropdown-summary::marker {
  display: none;
}

.genre-dropdown[open] .genre-dropdown-summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}

.genre-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: none;
  border-radius: 0 0 4px 4px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.genre-dropdown-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #e0e0e0;
  transition: background-color 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.genre-dropdown-item:last-child {
  border-bottom: none;
}

.genre-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.genre-dropdown-item.selected {
  background-color: rgba(74, 158, 255, 0.2);
  color: #4a9eff;
  font-weight: 500;
}

.track-pool-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.track-pool-editor-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

/* Track Pools Manager panel layout – only visible when .active (same as .panel) */
.panel.track-pools-manager-panel {
  display: none;
}
.panel.track-pools-manager-panel.active {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(12, 24, 42, 0.92);
}
.track-pools-manager-panel .track-pools-list-card .panel-body {
  padding-bottom: 0.5rem;
}
.track-pools-editor-card .card-header.track-pools-editor-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.track-pools-editor-card .track-pool-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.track-pools-editor-body {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .track-pools-editor-body {
    grid-template-columns: 1fr;
  }
}
.track-pools-editor-criteria {
  min-width: 0;
}
.track-pools-editor-criteria .track-pool-criteria-tabs {
  margin-bottom: 1rem;
}
.track-pools-editor-criteria .track-pool-tab-content {
  padding: 0.75rem 0;
}
.track-pools-editor-criteria .form-field + .form-field,
.track-pools-editor-criteria .track-pool-range-row {
  margin-top: 0.5rem;
}
.track-pool-range-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.track-pool-range-row .range-sep {
  color: var(--text-secondary, #8ea0bb);
  font-weight: 500;
}
.track-pools-editor-crates {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.track-pools-editor-preview {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  background: rgba(14, 28, 46, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.track-pools-editor-preview .track-pool-preview-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #e5f3ff;
}
.track-pools-editor-preview .track-pool-preview-list {
  max-height: 320px;
  overflow-y: auto;
  margin-top: 0.5rem;
}
.track-pools-editor-preview .track-pool-preview-item {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}
.track-pools-editor-preview .track-pool-preview-item:last-child {
  border-bottom: none;
}

/* ===== Shared pool-style header bar ===== */
.pool-header-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ===== Pool Builder ===== */
#panel-track-pools-manager .playlist-profile-bar.pool-builder-header {
  padding: 52px 4px 0 4px;
  margin-bottom: 12px;
}
#panel-track-pools-manager .playlist-profile-select {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
#panel-track-pools-manager .playlist-profile-btn {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
body.theme-light #panel-track-pools-manager .playlist-profile-select {
  color: #0a0a0a;
}
body.theme-light #panel-track-pools-manager .playlist-profile-btn {
  color: #525252;
}
.pool-builder-header .pool-select,
.pool-header-bar .pool-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 280px;
}
.pool-builder-tabs {
  margin-bottom: 0;
}
.pool-builder-tabs .playlist-tab-scroll-wrapper {
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  margin-bottom: 12px;
}
.pool-builder-tab .pool-pill-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  vertical-align: -1px;
}
.pool-builder-tab[data-filter="spotify_genre"] .pool-pill-icon {
  width: 14px;
  height: 14px;
}
/* Green dot: active selection indicator on pool builder tabs */
.pool-builder-tab::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  margin-left: 4px;
}
.pool-builder-tab.has-filter::before {
  background: #4caf50;
}
.pool-builder-tab.active.has-filter::before {
  background: #fff;
}
body.theme-light .pool-builder-tab.has-filter::before {
  background: #16a34a;
}
body.theme-light .pool-builder-tab.active.has-filter::before {
  background: #fff;
}
.pool-builder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  margin-bottom: 12px;
}
.pool-select {
  background: rgba(14, 28, 46, 0.95);
  color: #c8d6e5;
  border: 1px solid rgba(80, 140, 210, 0.3);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
}
.pool-btn-new,
.pool-btn-save,
.pool-btn-delete,
.pool-btn-cancel {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.pool-btn-new {
  background: rgba(41, 121, 255, 0.18);
  color: #6db3ff;
  border-color: rgba(41, 121, 255, 0.35);
}
.pool-btn-new:hover { background: rgba(41, 121, 255, 0.3); }
.pool-btn-save {
  background: #2979ff;
  color: #fff;
  border-color: #2979ff;
}
.pool-btn-save:hover { background: #1c6ae0; }
.pool-btn-save:disabled {
  opacity: 0.4;
  cursor: default;
}
.pool-btn-delete {
  background: rgba(255, 68, 68, 0.12);
  color: #ff7070;
  border-color: rgba(255, 68, 68, 0.3);
}
.pool-btn-delete:hover { background: rgba(255, 68, 68, 0.25); }
.pool-btn-delete:disabled {
  opacity: 0.35;
  cursor: default;
}
.pool-btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: #9fb3cc;
  border-color: rgba(255, 255, 255, 0.15);
}
.pool-btn-cancel:hover { background: rgba(255, 255, 255, 0.14); }

/* Pool name modal */
.pool-name-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}
.pool-name-modal-content {
  background: #1a2940;
  border: 1px solid rgba(80, 140, 210, 0.3);
  border-radius: 10px;
  padding: 22px 26px;
  min-width: 320px;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.pool-name-modal-title {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 14px;
  color: #dfe9f5;
}
.pool-name-modal-content .form-control {
  width: 100%;
  background: rgba(14, 28, 46, 0.95);
  color: #c8d6e5;
  border: 1px solid rgba(80, 140, 210, 0.3);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.pool-name-modal-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.pool-builder-pills {
  display: flex;
  gap: 6px;
  padding: 0 4px;
  margin-bottom: 0;
  flex-wrap: wrap;
}
.pool-pill-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  vertical-align: -1px;
}
.pool-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(80, 140, 210, 0.35);
  background: rgba(14, 28, 46, 0.95);
  color: #9fb3cc;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.pool-pill:hover {
  background: rgba(23, 44, 70, 0.95);
  color: #dfe9f5;
}
.pool-pill.active {
  background: #2979ff;
  border-color: #2979ff;
  color: #fff;
}
.pool-pill::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
}
.pool-pill.has-filter::after {
  background: #4caf50;
}
.pool-pill.active.has-filter::after {
  background: #fff;
}

/* Drawer slide animation */
.pool-builder-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin: 0 4px;
}
.pool-builder-drawer.open {
  max-height: 500px;
}
.pool-drawer-content {
  padding: 16px 0 12px;
}

/* Audio Models sliders */
.pool-audio-models-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.pool-audio-model-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pool-audio-model-label {
  flex: 0 0 110px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}
.pool-audio-model-slider {
  flex: 1;
  min-width: 0;
  max-width: 200px;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.pool-audio-model-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #4fc3f7);
  cursor: pointer;
  border: none;
}
.pool-audio-model-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #4fc3f7);
  cursor: pointer;
  border: none;
}
.pool-audio-model-value {
  flex-shrink: 0;
  min-width: 28px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
}
body.theme-light .pool-audio-model-label {
  color: rgba(0, 0, 0, 0.8);
}
body.theme-light .pool-audio-model-value {
  color: rgba(0, 0, 0, 0.65);
}
body.theme-light .pool-audio-model-slider {
  background: rgba(0, 0, 0, 0.12);
}
body.theme-light .pool-audio-model-slider::-webkit-slider-thumb {
  background: var(--accent, #1976d2);
}
body.theme-light .pool-audio-model-slider::-moz-range-thumb {
  background: var(--accent, #1976d2);
}

/* BPM slider */
.pool-bpm-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pool-bpm-label {
  font-size: 12px;
  color: #8ca0b9;
  min-width: 30px;
  text-align: center;
  flex-shrink: 0;
}
.pool-dual-range {
  position: relative;
  flex: 1;
  height: 36px;
}
.pool-dual-range-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  transform: translateY(-50%);
}
.pool-dual-range-fill {
  position: absolute;
  top: 50%;
  height: 6px;
  background: #2979ff;
  border-radius: 3px;
  transform: translateY(-50%);
  pointer-events: none;
}
.pool-dual-range-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}
.pool-dual-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2979ff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  pointer-events: all;
  position: relative;
  z-index: 3;
  transition: background 0.15s, transform 0.1s;
}
.pool-dual-range-input::-webkit-slider-thumb:hover {
  background: #1c5dd8;
  transform: scale(1.15);
}
.pool-dual-range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2979ff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  pointer-events: all;
}
.pool-dual-range-input::-moz-range-thumb:hover {
  background: #1c5dd8;
  transform: scale(1.15);
}
.pool-bpm-values {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #e5f3ff;
  letter-spacing: 0.3px;
}
.pool-filter-clear {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #8ca0b9;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.pool-filter-clear:hover {
  background: rgba(239, 83, 80, 0.2);
  color: #ef5350;
  border-color: rgba(239, 83, 80, 0.4);
}
body.theme-light .pool-filter-clear {
  border-color: hsl(0 0% 82%);
  color: #737373;
}
body.theme-light .pool-filter-clear:hover {
  background: rgba(239, 83, 80, 0.1);
  color: #ef5350;
  border-color: rgba(239, 83, 80, 0.4);
}
.pool-bpm-options {
  display: flex;
  gap: 20px;
  margin-top: 12px;
}

/* Genre grid */
.pool-genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px 16px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}
.pool-genre-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  cursor: pointer;
}
.pool-genre-name {
  flex: 1;
  color: #dfe9f5;
}
.pool-genre-count {
  font-size: 11px;
  color: #8ca0b9;
  min-width: 28px;
  text-align: right;
}

/* Genre tree (MAEST hierarchical) */
.pool-gtree {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}
.pool-gtree-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pool-gtree-group:last-child {
  border-bottom: none;
}
.pool-gtree-master {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
}
.pool-gtree-toggle {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #6b7b8d;
  font-size: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  padding: 0;
}
.pool-gtree-toggle:hover {
  color: #c0d0e0;
  background: rgba(255, 255, 255, 0.06);
}
.pool-gtree-master-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
  font-size: 13px;
}
.pool-gtree-master-name {
  flex: 1;
  font-weight: 600;
  color: #dfe9f5;
}
.pool-gtree-subs {
  padding: 0 0 6px 30px;
}
.pool-gtree-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
  cursor: pointer;
}
body.theme-light .pool-gtree-group {
  border-bottom-color: hsl(0 0% 92%);
}
body.theme-light .pool-gtree-toggle {
  color: #a3a3a3;
}
body.theme-light .pool-gtree-toggle:hover {
  color: #333;
  background: rgba(0, 0, 0, 0.05);
}
body.theme-light .pool-gtree-master-name {
  color: #171717;
}
body.theme-light .pool-gtree-subs .pool-genre-name {
  color: #525252;
}

/* Results */
.pool-builder-results {
  padding: 0 4px;
}
.pool-results-count {
  font-size: 13px;
  color: #8ca0b9;
  margin-bottom: 8px;
  padding: 0 2px;
}
.pool-results-count strong {
  color: #4a9eff;
  font-weight: 700;
}
.pool-results-list {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.75);
}
.pool-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6b7b8d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
}
.pool-result-hcol[data-sort] {
  cursor: pointer;
  transition: color 0.15s;
}
.pool-result-hcol[data-sort]:hover {
  color: #c0d0e0;
}
.pool-result-hplay {
  width: 28px;
  flex-shrink: 0;
}
.pool-result-hmeta {
  flex: 0 0 420px;
  width: 420px;
  min-width: 0;
  overflow: hidden;
}
.pool-result-hbpm {
  flex: 0 0 44px;
  width: 44px;
  text-align: left;
}
.pool-result-hgenre {
  flex: 1 1 300px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pool-result-hdur {
  flex: 0 0 50px;
  width: 50px;
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
  text-align: right;
}
.pool-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}
.pool-result-item:last-child {
  border-bottom: none;
}
.pool-result-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.pool-result-play {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #9fb3cc;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.pool-result-play:hover {
  background: rgba(41, 121, 255, 0.2);
  color: #fff;
}
.pool-result-meta {
  flex: 0 0 420px;
  width: 420px;
  min-width: 0;
  display: flex;
  gap: 6px;
  align-items: baseline;
  overflow: hidden;
}
.pool-result-artist {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}
.pool-result-sep {
  color: #556;
  flex-shrink: 0;
}
.pool-result-title {
  color: #b0c4de;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.pool-result-bpm,
.pool-result-dur {
  flex: 0 0 44px;
  width: 44px;
  font-size: 12px;
  color: #8ca0b9;
}
.pool-result-bpm {
  text-align: left;
}
.pool-result-dur {
  flex: 0 0 50px;
  width: 50px;
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
  text-align: right;
}
.pool-result-genre {
  flex: 1 1 300px;
  min-width: 0;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Light theme overrides */
body.theme-light .pool-pill {
  background: #f0f0f0;
  border-color: hsl(0 0% 85%);
  color: #525252;
}
body.theme-light .pool-pill:hover {
  background: #e5e5e5;
  color: #171717;
}
body.theme-light .pool-pill.active {
  background: #0a0a0a;
  border-color: #0a0a0a;
  color: #fff;
}
body.theme-light .pool-pill.has-filter::after {
  background: #22c55e;
}
body.theme-light .pool-pill.active.has-filter::after {
  background: #fff;
}
body.theme-light .pool-select,
body.theme-light .pool-header-bar .pool-select {
  background: #fff;
  color: #171717;
  border-color: hsl(0 0% 82%);
}
body.theme-light .pool-btn-new {
  background: rgba(10, 10, 10, 0.06);
  color: #171717;
  border-color: hsl(0 0% 82%);
}
body.theme-light .pool-btn-new:hover { background: rgba(10, 10, 10, 0.12); }
body.theme-light .pool-btn-save {
  background: #0a0a0a;
  color: #fff;
  border-color: #0a0a0a;
}
body.theme-light .pool-btn-save:hover { background: #262626; }
body.theme-light .pool-btn-delete {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}
body.theme-light .pool-btn-delete:hover { background: rgba(220, 38, 38, 0.16); }
body.theme-light .pool-btn-cancel {
  background: #f5f5f5;
  color: #525252;
  border-color: hsl(0 0% 82%);
}
body.theme-light .pool-btn-cancel:hover { background: #e5e5e5; }
body.theme-light .pool-name-modal-content {
  background: #fff;
  border-color: hsl(0 0% 85%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
body.theme-light .pool-name-modal-title {
  color: #0a0a0a;
}
body.theme-light .pool-name-modal-content .form-control {
  background: #fff;
  color: #171717;
  border-color: hsl(0 0% 82%);
}
body.theme-light .pool-dual-range-track {
  background: rgba(0, 0, 0, 0.1);
}
body.theme-light .pool-bpm-label {
  color: #737373;
}
body.theme-light .pool-bpm-values {
  color: #171717;
}
body.theme-light .pool-dual-range-input::-webkit-slider-thumb {
  border-color: rgba(0, 0, 0, 0.15);
}
body.theme-light .pool-genre-name {
  color: #171717;
}
body.theme-light .pool-genre-count {
  color: #737373;
}
body.theme-light .pool-results-count {
  color: #525252;
}
body.theme-light .pool-results-count strong {
  color: #0a0a0a;
}
body.theme-light .pool-results-list {
  background: #fafafa;
  border-color: hsl(0 0% 89.8%);
}
body.theme-light .pool-result-header {
  color: #8b8b8b;
  border-bottom-color: hsl(0 0% 88%);
}
body.theme-light .pool-result-hcol[data-sort]:hover {
  color: #333;
}
body.theme-light .pool-result-item {
  border-bottom-color: hsl(0 0% 92%);
}
body.theme-light .pool-result-item:hover {
  background: hsl(0 0% 96%);
}
body.theme-light .pool-result-play {
  border-color: hsl(0 0% 85%);
  color: #525252;
}
body.theme-light .pool-result-play:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #171717;
}
body.theme-light .pool-result-artist {
  color: #171717;
}
body.theme-light .pool-result-sep {
  color: #a3a3a3;
}
body.theme-light .pool-result-title {
  color: #525252;
}
body.theme-light .pool-result-bpm,
body.theme-light .pool-result-genre,
body.theme-light .pool-result-dur {
  color: #737373;
}
.image-carousel {
  position: relative;
  width: 100%;
  margin: 36px auto 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  overflow-x: hidden; /* Hide horizontal scrollbar */
}
.image-carousel--control {
  padding: 0 24px 24px;
  /* Full width - no max-width */
}
/* Gradients removed - images appear from right and disappear to left */
.image-carousel__track {
  display: flex;
  align-items: center;
  gap: 0; /* No gaps between images */
  transform: translateX(0);
  will-change: transform;
}
.image-carousel__item {
  flex: 0 0 auto;
  border-radius: 0; /* No curved borders */
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  background: rgba(18, 30, 50, 0.9);
  margin-right: 0; /* No gaps */
  opacity: 0; /* Hidden until loaded */
  transition: opacity 0.3s ease;
}
.image-carousel__item.loaded {
  opacity: 1;
}
.image-carousel__item img {
  display: block;
  height: 70px;
  width: auto;
}
@media (max-width: 600px) {
  .image-carousel {
    margin-top: 28px;
  }
  .image-carousel__item img {
    height: 56px;
  }
}

/* Track Debug Modal */
.track-debug-content {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 0;
}

.track-debug-loading,
.track-debug-error {
  padding: 20px;
  text-align: center;
  color: #aaa;
}

.track-debug-error {
  color: #ff6b6b;
}

.track-debug-tree {
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

.track-debug-tree-root {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track-debug-group {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.track-debug-group-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.track-debug-group-header:hover {
  background: rgba(255, 255, 255, 0.1);
}

.track-debug-toggle {
  display: inline-block;
  width: 16px;
  text-align: center;
  color: #888;
  font-size: 10px;
  transition: transform 0.2s;
}

.track-debug-group-header strong {
  color: #fff;
  font-weight: 600;
}

.track-debug-group-content {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.track-debug-group-content[hidden] {
  display: none;
}

.track-debug-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.track-debug-item:last-child {
  border-bottom: none;
}

.track-debug-key {
  color: #4fc3f7;
  font-weight: 600;
  word-break: break-word;
}

.track-debug-value {
  color: #e0e0e0;
  word-break: break-word;
  white-space: pre-wrap;
}

.track-debug-null {
  color: #888;
  font-style: italic;
}

.track-debug-bool {
  color: #81c784;
  font-weight: 600;
}

.track-debug-number {
  color: #ffb74d;
}

.track-debug-empty {
  color: #888;
  font-style: italic;
}

.track-debug-object {
  color: #ba68c8;
  white-space: pre;
  font-size: 11px;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 4px;
  margin-top: 4px;
}

/* Theme toggle – sun/moon icon button */
.theme-toggle-btn,
.theme-toggle-btn.nav-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0 4px 0 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s ease;
}
.theme-toggle-btn:hover {
  color: #fff;
}
.theme-toggle-btn:focus-visible {
  outline: none;
}
.theme-toggle-btn .theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle-btn .theme-icon[hidden] {
  display: none;
}
/* Initial paint: dark mode shows sun, light mode shows moon */
.theme-toggle-btn .theme-icon-moon {
  display: none;
}
body.theme-light .theme-toggle-btn .theme-icon-sun {
  display: none !important;
}
body.theme-light .theme-toggle-btn .theme-icon-moon {
  display: inline-flex !important;
}
body.theme-light .theme-toggle-btn {
  color: rgba(0, 0, 0, 0.7);
}
body.theme-light .theme-toggle-btn:hover {
  color: rgba(0, 0, 0, 0.9);
}

/* ========== Light theme (shadcn-style). Toggle via top bar button. ========== */
body.theme-light {
  background: #ececec;
  color: hsl(0 0% 3.9%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body.theme-light input,
body.theme-light select,
body.theme-light button,
body.theme-light textarea,
body.theme-light table,
body.theme-light th,
body.theme-light td,
body.theme-light .card,
body.theme-light .panel,
body.theme-light h1,
body.theme-light h2,
body.theme-light h3 {
  font-family: inherit;
}
body.theme-light.vanta-active {
  background: #ececec;
}
body.theme-light .top-nav {
  background: #ffffff;
  border-bottom: 1px solid hsl(0 0% 89.8%);
  color: #0a0a0a;
}
body.theme-light .nav-title,
body.theme-light .nav-account-name,
body.theme-light .station-top-bar .nav-account-name {
  color: #0a0a0a;
}
body.theme-light .nav-icon {
  color: #0a0a0a;
  background: #f5f5f5;
  border: 1px solid hsl(0 0% 89.8%);
}
body.theme-light .nav-icon svg {
  fill: currentColor;
}
body.theme-light .nav-icon:hover:not(:disabled),
body.theme-light .nav-icon:focus-visible:not(:disabled) {
  background: #e5e5e5;
  border-color: hsl(0 0% 80%);
  color: #0a0a0a;
}
body.theme-light .station-top-bar {
  background: #ffffff;
  border-bottom: 1px solid hsl(0 0% 89.8%);
  color: #0a0a0a;
}
body.theme-light .profile-menu {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
body.theme-light .profile-menu-section {
  background: rgba(0, 0, 0, 0.04);
}
body.theme-light .profile-menu-row:not(:last-child) {
  border-bottom-color: hsl(0 0% 92%);
}
body.theme-light .profile-menu-label {
  color: #525252;
}
body.theme-light .profile-menu-value {
  color: #0a0a0a;
}
body.theme-light .profile-menu-signout-form {
  border-top-color: hsl(0 0% 89.8%);
}
body.theme-light .profile-menu-signout {
  color: #c2410c;
  background: rgba(234, 88, 12, 0.08);
  border-color: rgba(234, 88, 12, 0.3);
}
body.theme-light .profile-menu-signout:hover {
  background: rgba(234, 88, 12, 0.15);
  border-color: rgba(234, 88, 12, 0.45);
}
body.theme-light .station-top-bar-title {
  color: #0a0a0a;
}
body.theme-light .topbar-station-name {
  color: #737373;
}
body.theme-light .topbar-sep {
  color: #a3a3a3;
}
body.theme-light .topbar-panel-name {
  color: #171717;
}
body.theme-light .sidebar-collapse-btn {
  color: #737373;
}
body.theme-light .sidebar-collapse-btn:hover {
  color: #0a0a0a;
  background: rgba(0, 0, 0, 0.06);
}
body.theme-light .station-sidebar,
body.theme-light .station-layout.menu-open .station-sidebar {
  background: #fafafa;
  border-right: 1px solid hsl(0 0% 89.8%);
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
}
body.theme-light .nav-logo {
  content: url('/assets/images/gravy_logo_invert.png');
}
body.theme-light .login-logo {
  content: url('/assets/images/gravy_logo_invert.png');
}
body.theme-light .sidebar-logo-text,
body.theme-light .sidebar-heading,
body.theme-light .sidebar-subtitle {
  color: #374151;
}
body.theme-light .sidebar-item {
  color: #737b88;
}
body.theme-light .sidebar-item:hover {
  color: #4b5563;
}
body.theme-light .sidebar-item:hover::before {
  background: rgba(0, 0, 0, 0.06);
}
body.theme-light .card,
body.theme-light .control-card,
body.theme-light .station-main .panel > .card,
body.theme-light .playback-card,
/* DECK REWRITE: cue-card removed; deck-section has its own theme styles */
body.theme-light .deck-events-card {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  color: #0a0a0a;
}
body.theme-light h2.card-header {
  background: #fafafa;
  border-bottom: 1px solid hsl(0 0% 89.8%);
  color: #0a0a0a;
  box-shadow: none;
}
body.theme-light h2.card-header.panel-main-header.has-controls {
  background: transparent;
  border-bottom: none;
}
body.theme-light h1,
body.theme-light h2,
body.theme-light .card h2,
body.theme-light .card strong {
  color: #0a0a0a;
}
body.theme-light .card .value,
body.theme-light .card .bpm,
body.theme-light .card .key,
body.theme-light .card .len,
body.theme-light .card .last-prev,
body.theme-light .card .artist-prev,
body.theme-light .playback-card .metrics-row,
body.theme-light .playback-card .extra-row {
  color: #525252;
}
body.theme-light .station-main .deck-grid .deck-artist {
  color: #171717;
}
body.theme-light .station-main .deck-grid .deck-track {
  color: #525252;
}
body.theme-light .station-main .deck-grid .deck-section--next .deck-artist,
body.theme-light .station-main .deck-grid .deck-section--seed .deck-artist {
  color: #0f172a;
}
body.theme-light .station-main .deck-grid .deck-section--next .deck-track,
body.theme-light .station-main .deck-grid .deck-section--seed .deck-track {
  color: #374151;
}
body.theme-light .station-main .deck-grid .deck-metrics .metric-label {
  color: #737373;
}
body.theme-light .station-main .deck-grid .deck-metrics .metric-value {
  color: #0a0a0a;
}
body.theme-light .station-main .deck-grid .deck-metrics .metric-badge.metric-bpm.metric-bpm--tempo-live .metric-value {
  background: rgba(250, 204, 21, 0.28);
  box-shadow: inset 0 0 0 1px rgba(202, 138, 4, 0.55);
  color: #a16207;
  animation: deck-bpm-tempo-live-pulse-light 1.35s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .station-main .deck-grid .deck-metrics .metric-badge.metric-bpm.metric-bpm--tempo-live .metric-value,
  body.theme-light .station-main .deck-grid .deck-metrics .metric-badge.metric-bpm.metric-bpm--tempo-live .metric-value {
    animation: none;
  }
}
body.theme-light .station-main .panel {
  background: transparent;
  border: none;
}
/* Track Pools manager (sidebar): restore a card-like surface; generic rule above clears all panels */
body.theme-light .station-main .panel.track-pools-manager-panel {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}
body.theme-light .deck-status-bar .status-label,
body.theme-light .deck-status-bar .status-value {
  color: #525252;
}
body.theme-light .deck-status-bar .status-value {
  color: #0a0a0a;
}
body.theme-light .deck-status-bar .status-meta {
  color: #737373;
}
body.theme-light .btn {
  border: 1px solid hsl(0 0% 89.8%);
  color: #0a0a0a;
  background: #fff;
}
body.theme-light .btn:hover {
  background: #f5f5f5;
}
body.theme-light .btn-primary {
  background: #0a0a0a;
  color: #fff;
  border-color: #0a0a0a;
}
body.theme-light .btn-primary:hover {
  background: #262626;
}
body.theme-light .btn-danger {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
}
body.theme-light .btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #991b1b;
  color: #fff;
}
body.theme-light .login-wrapper {
  background: transparent;
}
body.theme-light .login-card {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  color: #0a0a0a;
}
body.theme-light .login-title,
body.theme-light .login-tagline,
body.theme-light .login-label {
  color: #0a0a0a;
}
body.theme-light .login-input {
  background: #fff;
  border: 1px solid hsl(0 0% 89.8%);
  color: #0a0a0a;
}
body.theme-light .confirm-overlay {
  background: rgba(0, 0, 0, 0.5);
}
body.theme-light .confirm-dialog {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #0a0a0a;
}
body.theme-light .daemon-action-spinner {
  border-color: rgba(2, 132, 199, 0.18);
  border-top-color: #0284c7;
}
body.theme-light .daemon-action-status {
  color: #737373;
}
body.theme-light .control-body,
body.theme-light .control-events,
body.theme-light .station-control-list {
  color: #0a0a0a;
}
body.theme-light .deck-panel-header {
  color: #0a0a0a;
}
body.theme-light .remain-badge {
  color: #0a0a0a;
  background: rgba(0, 0, 0, 0.06);
  border-color: hsl(0 0% 80%);
}
body.theme-light #deckNowPlaying .deck-now-loading {
  background: rgba(255, 255, 255, 0.94);
}
body.theme-light .deck-now-loading-bar {
  background: rgba(0, 0, 0, 0.12);
}
body.theme-light .deck-now-loading-bar::after {
  background: hsl(221 83% 53%);
}

/* ----- Pill toggles (Playlist/Scheduler, Day/Week) ----- */
body.theme-light .deck-mode-pill-toggle,
body.theme-light .scheduler-type-toggle {
  background: #f0f0f0;
  border: 1px solid hsl(0 0% 85%);
  box-shadow: none;
}
body.theme-light .deck-mode-pill-option,
body.theme-light .scheduler-type-btn {
  color: #404040;
}
body.theme-light .deck-mode-pill-highlight,
body.theme-light .scheduler-type-highlight {
  background: #0a0a0a !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}
body.theme-light .deck-mode-pill-toggle[data-mode="playlist"] .deck-mode-pill-option--playlist,
body.theme-light .deck-mode-pill-toggle[data-mode="scheduler"] .deck-mode-pill-option--scheduler {
  color: #fff;
}
body.theme-light .scheduler-type-toggle[data-type="day"] .scheduler-type-btn--day,
body.theme-light .scheduler-type-toggle[data-type="week"] .scheduler-type-btn--week {
  color: #fff;
}

/* ----- Progress bar / meter (on-air bar) ----- */
body.theme-light .meter,
body.theme-light .progress .meter {
  background: #e5e5e5;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
body.theme-light .meter > span {
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), inset 0 -1px 2px rgba(0, 0, 0, 0.08);
}
body.theme-light #deckNowPlaying .card-header {
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}
body.theme-light .track-history-card .card-header {
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}
body.theme-light #deckNowPlaying .progress .meter {
  height: 4px;
  background: #d4d4d4;
  border-radius: 999px;
  box-shadow: none;
}
body.theme-light #deckNowPlaying .progress .meter > span {
  height: 4px;
  background: #000;
  background-image: none;
  border-radius: 999px;
  box-shadow: none;
}

/* ----- Switch (on/off toggle) ----- */
body.theme-light .switch-slider {
  background: #d4d4d4;
}
body.theme-light .switch-slider:before {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
body.theme-light .switch input:checked + .switch-slider {
  background: linear-gradient(90deg, #ff9b0f, #ff6f00);
  box-shadow: 0 0 10px rgba(255, 130, 0, 0.35);
}
body.theme-light .switch input:checked + .switch-slider:before {
  background: #fff4e6;
}
body.theme-light .autodj-switch .switch-slider {
  background: #d4d4d4;
}
body.theme-light .autodj-switch input:checked + .switch-slider {
  background: linear-gradient(90deg, #ffd45c, #ffb800);
}

/* ----- Selects / combo boxes & form controls ----- */
body.theme-light select,
body.theme-light .form-control,
body.theme-light .form-control--compact {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  color: #0a0a0a;
}
body.theme-light select:focus,
body.theme-light .form-control:focus,
body.theme-light .form-control--compact:focus {
  border-color: hsl(221 83% 53%);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  outline: none;
}
body.theme-light .playlists-body select,
body.theme-light .playlists-body .form-control,
body.theme-light .playlists-body .form-control--compact {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  color: #0a0a0a;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
}
body.theme-light .playlists-body .form-label {
  color: #525252;
}
body.theme-light .playlists-body .form-hint {
  color: #737373;
}
body.theme-light .playlists-body select:focus,
body.theme-light .playlists-body .form-control:focus,
body.theme-light .playlists-body .form-control--compact:focus {
  border-color: hsl(221 83% 53%);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
body.theme-light .playlist-profile-selector .nav-icon,
body.theme-light .track-pool-selector-controls .nav-icon {
  background: #f5f5f5;
  border: 1px solid hsl(0 0% 89.8%);
  color: #0a0a0a;
}
body.theme-light .playlist-profile-selector .nav-icon:hover,
body.theme-light .track-pool-selector-controls .nav-icon:hover {
  background: #e5e5e5;
  border-color: hsl(0 0% 80%);
}
body.theme-light .scheduler-time-inputs span {
  color: #525252;
}

/* ----- Scheduler panel ----- */
body.theme-light .scheduler-segment-summary {
  color: #525252;
}
body.theme-light .scheduler-status-text {
  color: #525252;
}
body.theme-light .scheduler-grid-wrapper {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  scrollbar-color: #c4c4c4 #f0f0f0;
}
body.theme-light .scheduler-grid-wrapper::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 6px;
}
body.theme-light .scheduler-grid-wrapper::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 6px;
}
body.theme-light .scheduler-grid-wrapper::-webkit-scrollbar-thumb:hover {
  background: #a3a3a3;
}
body.theme-light .scheduler-day-header-row {
  background: #fafafa;
}
body.theme-light .scheduler-day-header {
  color: #525252;
}
body.theme-light .scheduler-day-header--selected {
  color: #0a0a0a;
}
body.theme-light .scheduler-hour-line {
  background: hsl(0 0% 90%);
}
body.theme-light .scheduler-hour-label {
  color: #737373;
}
body.theme-light .scheduler-grid-column {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
}
body.theme-light .scheduler-grid-column--selected {
  background: #f5f5f5;
  border-color: hsl(0 0% 80%);
}
body.theme-light .scheduler-segment {
  background: #f5f5f5;
  border: 1px solid hsl(0 0% 89.8%);
  color: #171717;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
body.theme-light .scheduler-segment[data-selected="true"] {
  background: #e0f2fe;
  border-color: hsl(199 89% 48%);
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.2);
}
body.theme-light .scheduler-column-control-btn {
  background: #f5f5f5;
  border: 1px solid hsl(0 0% 89.8%);
  color: #0a0a0a;
}
body.theme-light .scheduler-column-control-btn:hover {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}
body.theme-light .scheduler-column-control-btn--delete:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}
body.theme-light .scheduler-inspector {
  background: #fafafa;
  border: 1px solid hsl(0 0% 89.8%);
}
body.theme-light .scheduler-help-link {
  color: hsl(221 83% 53%);
}
body.theme-light .scheduler-grid-empty {
  background: rgba(250, 250, 250, 0.9);
  color: #525252;
}

/* ----- Graph / analytics ----- */
body.theme-light .analytics-block {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
}
body.theme-light .analytics-heading {
  color: #737373;
}
body.theme-light .analytics-canvas,
body.theme-light .station-main .deck-grid .deck-section--history .deck-history-canvas-wrap {
  background: #fafafa;
  border-radius: 6px;
}
body.theme-light .analytics-canvas--with-border {
  border: 1px solid hsl(0 0% 89.8%);
}
body.theme-light .station-main .deck-grid .deck-section--history .deck-history-canvas-wrap {
  background: transparent;
  border-radius: 0;
}
body.theme-light .analytics-canvas--with-border {
  border: 1px solid hsl(0 0% 89.8%);
}
body.theme-light .station-main .deck-grid .deck-section .deck-title,
body.theme-light .station-main .deck-grid .deck-section .deck-title--queued {
  color: #525252;
}
body.theme-light .deck-remain-text {
  color: #737373;
}
body.theme-light .deck-waveform-container {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
}
body.theme-light .deck-waveform2-container {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(224, 242, 254, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.28);
}
body.theme-light .deck-waveform2-title {
  color: #1d4ed8;
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(59, 130, 246, 0.18);
}
body.theme-light .deck-waveform2-info-btn {
  background: rgba(255, 255, 255, 0.92);
  color: #1e3a8a;
  border-color: rgba(59, 130, 246, 0.28);
}
body.theme-light .deck-waveform-status {
  color: #1f2937;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(17, 24, 39, 0.15);
}
body.theme-light .deck-waveform2-status {
  color: #1f2937;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(17, 24, 39, 0.15);
}
body.theme-light .deck-heartbeat-debug__summary-hint {
  color: #94a3b8;
}
body.theme-light .deck-heartbeat-debug__chev {
  border-left-color: #64748b;
}
body.theme-light .deck-heartbeat-debug__title {
  color: #64748b;
}
body.theme-light .deck-heartbeat-debug__body {
  background: #f8fafc;
  border-color: hsl(0 0% 89.8%);
  color: #1e293b;
}
body.theme-light .analytics-placeholder-body {
  background: #f5f5f5;
  border: 1px dashed #d4d4d4;
  color: #525252;
}
body.theme-light .chart-tooltip {
  background: rgba(255, 255, 255, 0.96);
  color: #171717;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
body.theme-light .analytics-legend {
  color: #525252;
}
body.theme-light .analytics-legend--harmonic {
  color: #374151;
}
body.theme-light .progression-graph-wrapper {
  background: #f5f5f5;
  border: 1px solid hsl(0 0% 89.8%);
}
body.theme-light #progressionGraphCanvas {
  background: #fafafa;
}
body.theme-light .progression-graph-edit-label {
  color: #525252;
}
body.theme-light .progression-graph-edit-radio,
body.theme-light .progression-graph-edit-radio span {
  color: #171717;
}
body.theme-light .has-tooltip::after {
  background: rgba(255, 255, 255, 0.98);
  color: #171717;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
body.theme-light .has-tooltip::before {
  border-color: rgba(255, 255, 255, 0.98) transparent transparent transparent;
}

/* ----- Tables & lists ----- */
body.theme-light .history-table {
  color: #171717;
}
body.theme-light .history-table thead th {
  border-bottom: 1px solid hsl(0 0% 89.8%);
  color: #525252;
}
body.theme-light .history-table tbody td {
  border-bottom: 1px solid #f0f0f0;
}
body.theme-light .history-table tbody tr:hover {
  background: #f5f5f5;
}
body.theme-light .track-history-row--progression {
  background: rgba(255, 193, 7, 0.06);
}
body.theme-light .track-history-row--progression:hover {
  background: rgba(255, 193, 7, 0.12);
}
body.theme-light .crate-list-section,
body.theme-light .crate-import-section {
  background: #fafafa;
  border: 1px solid hsl(0 0% 89.8%);
}
body.theme-light .checkbox-label {
  color: #0a0a0a;
}
body.theme-light .scoring-divider {
  background: hsl(0 0% 89.8%);
}

/* ----- Form labels & hints (global) ----- */
body.theme-light .form-label {
  color: #0a0a0a;
}
body.theme-light .form-hint {
  color: #737373;
}

/* ----- Numeric stepper ----- */
body.theme-light .numeric-stepper {
  background: #fff;
  border-color: hsl(0 0% 89.8%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
body.theme-light .numeric-stepper:focus-within {
  border-color: hsl(221 83% 53%);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
body.theme-light .stepper-button {
  border-color: hsl(0 0% 89.8%);
  background: #f5f5f5;
  color: #171717;
}
body.theme-light .stepper-button:hover:not(:disabled),
body.theme-light .stepper-button:focus-visible:not(:disabled) {
  background: #e5e5e5;
  border-color: hsl(0 0% 80%);
  color: #0a0a0a;
}
body.theme-light .stepper-input {
  color: #0a0a0a;
  background: transparent;
}

/* ----- Custom checkboxes ----- */
body.theme-light .checkbox-label input[type="checkbox"],
body.theme-light .track-pool-checkboxes input[type="checkbox"] {
  border-color: hsl(0 0% 78%);
}
body.theme-light .checkbox-label input[type="checkbox"]:checked,
body.theme-light .track-pool-checkboxes input[type="checkbox"]:checked {
  border-color: #16a34a;
}
body.theme-light .checkbox-label input[type="checkbox"]::after,
body.theme-light .track-pool-checkboxes input[type="checkbox"]::after {
  color: #16a34a;
}
body.theme-light .checkbox-label input[type="checkbox"]:focus-visible,
body.theme-light .track-pool-checkboxes input[type="checkbox"]:focus-visible {
  outline-color: rgba(22, 163, 74, 0.45);
}

/* ----- Track Pool (playlist editor tab) ----- */
body.theme-light .track-pool-checkboxes {
  border-color: hsl(0 0% 89.8%);
  background: #fafafa;
}
body.theme-light .trackpool-header-text p {
  color: #737373;
}
body.theme-light .track-pool-preview {
  color: #16a34a;
}
body.theme-light .track-pool-preview.error {
  color: #dc2626;
}
body.theme-light .track-pool-match-count {
  color: #171717;
}

/* ----- Track Pool tabs (genre/bpm/crate sub-tabs) ----- */
body.theme-light .track-pool-tab {
  color: #737373;
}
body.theme-light .track-pool-tab:hover {
  color: #171717;
}
body.theme-light .track-pool-tab.active {
  color: #0a0a0a;
  border-bottom-color: #0a0a0a;
}
body.theme-light .track-pool-genre-scroll::-webkit-scrollbar-track {
  background: #f0f0f0;
}
body.theme-light .track-pool-genre-scroll::-webkit-scrollbar-thumb {
  background: #c4c4c4;
}
body.theme-light .track-pool-genre-scroll::-webkit-scrollbar-thumb:hover {
  background: #a3a3a3;
}
body.theme-light .track-pool-genre-checkboxes .checkbox-label input[type="checkbox"]:checked {
  border-color: #16a34a;
}

/* ----- Track Pool preview list (pool builder) ----- */
body.theme-light .track-pool-preview-count {
  color: #0a0a0a;
}
body.theme-light .track-pool-preview-item {
  border-bottom-color: hsl(0 0% 92%);
}
body.theme-light .track-pool-preview-item:hover {
  background: hsl(0 0% 96%);
}
body.theme-light .track-pool-preview-play-icon {
  color: #737373;
}
body.theme-light .track-pool-preview-play-icon:hover {
  color: #171717;
}

/* ----- Toggle panel headings (Progression, Idents, Track Pool) ----- */
body.theme-light .panel-title-toggle h3 {
  color: #0a0a0a;
}
/* Mix toggle sub-headers keep a warm accent */
body.theme-light .mix-toggle-header .panel-title-toggle h3 {
  color: #92400e;
}

/* ----- Scoring panel text ----- */
body.theme-light .scoring-field-label {
  color: #0a0a0a;
}
body.theme-light .scoring-field-hint {
  color: #737373;
}
body.theme-light .scoring-checkbox-inline .checkbox-label span,
body.theme-light .scoring-inline-combo span {
  color: #0a0a0a;
}

/* ----- Idents panel ----- */
body.theme-light .idents-list {
  border-color: hsl(0 0% 89.8%);
  background: #fafafa;
}
body.theme-light .idents-list .panel-message {
  color: #737373;
}
body.theme-light .idents-item span {
  color: #171717;
}
body.theme-light .idents-status.disabled {
  color: #a3a3a3;
}
body.theme-light .idents-preview-btn {
  color: #525252;
}
body.theme-light .idents-preview-btn:hover,
body.theme-light .idents-preview-btn:focus-visible {
  background: rgba(0, 0, 0, 0.06);
  border-color: hsl(0 0% 85%);
  color: #171717;
}
body.theme-light .idents-edit-btn {
  color: #a3a3a3;
}
body.theme-light .idents-edit-btn:hover,
body.theme-light .idents-edit-btn:focus-visible {
  color: #171717;
  background: rgba(0, 0, 0, 0.06);
  border-color: hsl(0 0% 85%);
}

/* ----- Track Pools Manager (editor card & preview) ----- */
body.theme-light .track-pools-editor-preview {
  background: #fafafa;
  border-color: hsl(0 0% 89.8%);
}
body.theme-light .track-pools-editor-preview .track-pool-preview-title {
  color: #0a0a0a;
}
body.theme-light .track-pools-editor-preview .track-pool-preview-item {
  border-bottom-color: hsl(0 0% 92%);
}

/* ----- Scoring warning ----- */
body.theme-light .scoring-warning h3 {
  color: #dc2626;
}

body.theme-light .toggle-badge {
  border: 1px solid hsl(0 0% 89.8%);
  color: #525252;
  background: #f5f5f5;
}
body.theme-light .toggle-row .toggle-hint {
  color: #525252;
}

/* ----- Station On/Off switch ----- */
body.theme-light .station-switch-on {
  color: #0a0a0a;
}
body.theme-light .station-switch-off {
  color: #737373;
}
body.theme-light .station-switch-input:not(:checked) + .station-switch-slider {
  background: rgba(239, 68, 68, 0.25);
  border-color: hsl(0 0% 89.8%);
}
body.theme-light .station-switch-slider::before {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ----- Playlist tabs & mode card ----- */
body.theme-light .playlist-tab-scroll-wrapper {
  border-bottom-color: rgba(0, 0, 0, 0.12);
}
body.theme-light .playlist-tab-arrow {
  color: #525252;
}
body.theme-light .playlist-tab-arrow:hover:not(:disabled) {
  color: #0a0a0a;
  background: rgba(0, 0, 0, 0.06);
}
body.theme-light .playlist-tab {
  color: #525252;
}
body.theme-light .playlist-tab:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #171717;
}
body.theme-light .playlist-tab.active {
  background: rgba(0, 0, 0, 0.1);
  color: #0a0a0a;
}
body.theme-light #playlistTabs[data-mode="autodj"] .playlist-tab[data-modes~="autodj"] {
  color: #525252;
}
body.theme-light #playlistTabs[data-mode="autodj"] .playlist-tab[data-modes~="autodj"].active {
  background: rgba(0, 0, 0, 0.1);
  color: #0a0a0a;
}
body.theme-light #playlistTabs[data-mode="autodj"] .playlist-tab[data-modes~="autodj"]:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #171717;
}
body.theme-light #playlistTabs[data-mode="simple"] .playlist-tab[data-tab="simple-settings"] {
  color: #525252;
}
body.theme-light #playlistTabs[data-mode="simple"] .playlist-tab[data-tab="simple-settings"].active {
  background: rgba(0, 0, 0, 0.1);
  color: #0a0a0a;
}
body.theme-light #playlistTabs[data-mode="simple"] .playlist-tab[data-tab="simple-settings"]:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #171717;
}
body.theme-light .card.playlist-mode-card,
body.theme-light #panel-playlists .card.playlist-mode-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
body.theme-light .playlist-mode-toggle {
  background: #f0f0f0;
  border: 1px solid hsl(0 0% 85%);
  box-shadow: none;
}
body.theme-light .playlist-mode-toggle .toggle-highlight {
  background: #0a0a0a !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}
body.theme-light .playlist-mode-toggle .toggle-option {
  color: #404040;
}
body.theme-light .playlist-mode-toggle .toggle-option--crate,
body.theme-light .playlist-mode-toggle .toggle-option--sets {
  color: #404040;
}
body.theme-light .playlist-mode-toggle[data-mode="autodj"] .toggle-option--autodj,
body.theme-light .playlist-mode-toggle[data-mode="simple"] .toggle-option--simple,
body.theme-light .playlist-mode-toggle[data-mode="crate"] .toggle-option--crate,
body.theme-light .playlist-mode-toggle[data-mode="sets"] .toggle-option--sets {
  color: #fff;
}

/* ----- Engine events (light theme) ----- */
body.theme-light .events-log {
  background: #fafafa;
  border-color: hsl(0 0% 89.8%);
  scrollbar-color: #c4c4c4 #f0f0f0;
}
body.theme-light .events-log::-webkit-scrollbar-track {
  background: #f0f0f0;
}
body.theme-light .events-log::-webkit-scrollbar-thumb {
  background: #c4c4c4;
}
body.theme-light .events-log::-webkit-scrollbar-thumb:hover {
  background: #a3a3a3;
}
body.theme-light .events-entry {
  border-bottom-color: hsl(0 0% 92%);
}
body.theme-light .events-entry .event-meta {
  color: #737373;
}
body.theme-light .events-entry .event-kind {
  color: #b45309;
}
body.theme-light .events-entry .event-time {
  color: #525252;
}
body.theme-light .event-text {
  color: #171717;
}
body.theme-light .event-text.event-text--ident {
  color: #b8860b !important;
}
body.theme-light .event-section {
  color: #525252;
}
body.theme-light .event-section-label {
  color: #15803d;
}
body.theme-light .events-empty {
  color: #737373;
}
body.theme-light .event-fallback-warning {
  color: #dc2626;
}
/* Badges – keep colored tints but darken text for readability */
body.theme-light .event-badge {
  background: rgba(0, 0, 0, 0.04);
  border-color: hsl(0 0% 82%);
  color: #171717;
}
body.theme-light .event-badge--green {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.3);
  color: #15803d;
}
body.theme-light .event-badge--red {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}
body.theme-light .event-badge--ident {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.3);
  color: #b45309;
}
body.theme-light .event-badge--perceptual {
  background: rgba(234, 88, 12, 0.08);
  border-color: rgba(234, 88, 12, 0.3);
  color: #c2410c;
}
body.theme-light .event-badge--neutral {
  background: rgba(0, 0, 0, 0.04);
  border-color: hsl(0 0% 82%);
  color: #525252;
}
/* Playlist mode badges keep their gradients */
body.theme-light .event-badge-playlist-mode--autodj {
  box-shadow: 0 1px 4px rgba(240, 165, 0, 0.25);
}
body.theme-light .event-badge-playlist-mode--simple {
  box-shadow: 0 1px 4px rgba(26, 143, 84, 0.25);
}
body.theme-light .event-badge-playlist-mode--crate {
  box-shadow: 0 1px 4px rgba(198, 40, 40, 0.25);
}
body.theme-light .flowforge-playlist-table thead th {
  border-color: hsl(0 0% 89.8%);
  color: #525252;
}
body.theme-light .flowforge-playlist-table td {
  border-color: #f0f0f0;
  color: #171717;
}
body.theme-light .flowforge-playlist-table tbody tr:hover {
  background: #f5f5f5;
}
body.theme-light .flowforge-playlist-table thead {
  background: #f5f5f5;
}
body.theme-light .flowforge-substitute-item {
  background: #f5f5f5;
  border: 1px solid hsl(0 0% 89.8%);
}

/* ----- Track history (light theme: white background) ----- */
body.theme-light #panel-history .track-history-panel-header {
  color: #0a0a0a;
}
body.theme-light .track-history-header {
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none;
}
body.theme-light .track-history-list-wrapper {
  background: #ffffff;
  border-color: hsl(0 0% 89.8%);
}
body.theme-light .track-history-list {
  scrollbar-color: #c4c4c4 #f0f0f0;
}
body.theme-light .track-history-header-row {
  color: #8b8b8b;
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: hsl(0 0% 92%);
}
body.theme-light .track-history-row {
  border-bottom-color: hsl(0 0% 92%);
}
body.theme-light .track-history-row:hover {
  background: hsl(0 0% 96%);
}
body.theme-light .track-history-artist {
  color: #171717;
}
body.theme-light .track-history-title {
  color: #525252;
}
body.theme-light .track-history-sep {
  color: #a3a3a3;
}
body.theme-light .track-history-row--ident .track-history-artist,
body.theme-light .track-history-row--ident .track-history-title {
  color: #a3a3a3;
}
body.theme-light .track-history-play {
  border-color: rgba(0, 0, 0, 0.15);
  color: #525252;
}
body.theme-light .track-history-play:hover {
  background: rgba(41, 121, 255, 0.15);
  color: #0a0a0a;
}
body.theme-light .track-history-play.active {
  background: rgba(41, 121, 255, 0.25);
  color: #0a0a0a;
}
body.theme-light .th-time {
  color: #737373;
}
body.theme-light .th-bpm {
  color: #737373;
}
body.theme-light .track-history-bpm-perceptual {
  color: #d97706;
}
body.theme-light .th-profile,
body.theme-light .th-selection {
  color: #737373;
}
body.theme-light .th-ident-label {
  color: #a3a3a3;
}
body.theme-light .track-history-actions-trigger {
  color: rgba(17, 24, 39, 0.78);
}
body.theme-light .track-history-actions-trigger:hover,
body.theme-light .track-history-actions-trigger:focus-visible {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.85);
}
body.theme-light .track-history-actions-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(17, 24, 39, 0.16);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}
body.theme-light .track-history-menu-item {
  color: #1f2937;
}
body.theme-light .track-history-menu-item:hover,
body.theme-light .track-history-menu-item:focus-visible {
  background: rgba(2, 132, 199, 0.12);
}
body.theme-light .track-history-empty-msg {
  color: #737373;
}
body.theme-light .track-history-pagination {
  border-top-color: hsl(0 0% 92%);
}
/* Harmonic badge text: black in light theme */
body.theme-light .th-harmonic .metric-badge[class*="key-"] .metric-value {
  color: #1a1a1a;
}

/* ----- Playlist tabs (duplicate removed — see above) ----- */

/* ----- Modals & dropdowns ----- */
body.theme-light .modal-dialog {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  color: #0a0a0a;
}
body.theme-light .modal-dialog h3,
body.theme-light .modal-dialog p,
body.theme-light .modal-dialog .form-label,
body.theme-light .modal-dialog strong,
body.theme-light .modal-dialog .form-hint {
  color: #0a0a0a;
}
body.theme-light .modal-dialog .form-hint {
  color: #525252;
}
body.theme-light .confirm-dialog h3 {
  color: #0a0a0a;
}
body.theme-light .confirm-dialog p {
  color: #525252;
}
body.theme-light .confirm-actions .btn {
  color: inherit;
}
body.theme-light .confirm-actions .btn-primary {
  color: #fff;
}
body.theme-light .modal-dialog .form-control,
body.theme-light .modal-dialog input,
body.theme-light .modal-dialog select {
  color: #0a0a0a;
}
body.theme-light .modal-dialog .track-edit-history-item {
  color: #525252;
}
body.theme-light .genre-dropdown-list {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
body.theme-light .genre-dropdown-item {
  color: #171717;
  border-bottom: 1px solid #f0f0f0;
}
body.theme-light .genre-dropdown-item:hover,
body.theme-light .genre-dropdown-item.selected {
  background: #f5f5f5;
}

/* ----- Generic tooltip & legend ----- */
body.theme-light .tooltip {
  background: rgba(255, 255, 255, 0.96);
  color: #171717;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
body.theme-light .legend {
  color: #525252;
}
body.theme-light table.history th,
body.theme-light table.history td {
  border-bottom: 1px solid #e5e5e5;
}
body.theme-light table.history th {
  color: #525252;
}
body.theme-light table.history td {
  color: #171717;
}
body.theme-light .panel-message {
  color: #525252;
}

/* ----- Control events list ----- */
body.theme-light .control-events-list {
  scrollbar-color: #c4c4c4 #f0f0f0;
}
body.theme-light .control-events-list::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 6px;
}
body.theme-light .control-events-list::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 6px;
}
body.theme-light .control-events-list::-webkit-scrollbar-thumb:hover {
  background: #a3a3a3;
}
body.theme-light .control-event-item {
  color: #525252;
  border-bottom: 1px solid #f0f0f0;
}

/* ----- Control page: station control rows ----- */
body.theme-light .station-control-row {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
body.theme-light .station-control-name {
  color: #0a0a0a;
}
body.theme-light .station-control-nowplaying {
  color: #525252;
}
body.theme-light .station-loading-dots .ld-dot {
  background: rgba(0, 0, 0, 0.45);
}
body.theme-light .station-gear-link {
  color: #737373;
}
body.theme-light .station-gear-link:hover {
  color: #0a0a0a;
  filter: none;
}
body.theme-light .station-stream-link:hover {
  filter: none;
  opacity: 0.92;
}
body.theme-light .station-stream-link-img {
  filter: none;
}

/* ----- Track search (light theme: white background) ----- */
body.theme-light .track-search-results {
  background: #ffffff;
  border: 1px solid hsl(0 0% 89.8%);
  scrollbar-color: #c4c4c4 #f0f0f0;
}
body.theme-light .track-search-results::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 6px;
}
body.theme-light .track-search-results::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 6px;
}
body.theme-light .track-search-results::-webkit-scrollbar-thumb:hover {
  background: #a3a3a3;
}
body.theme-light .track-search-header {
  color: #8b8b8b;
  background: rgba(250, 250, 250, 0.97);
  border-bottom-color: hsl(0 0% 92%);
}
body.theme-light .track-search-item {
  border-bottom-color: hsl(0 0% 92%);
  color: #171717;
}
body.theme-light .track-search-item.selected {
  background: rgba(34, 197, 94, 0.12);
}
body.theme-light .track-search-item:hover {
  background: hsl(0 0% 96%);
}
body.theme-light .track-search-play {
  border-color: hsl(0 0% 85%);
  color: #737373;
}
body.theme-light .track-search-play:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #171717;
}
body.theme-light .track-search-artist {
  color: #171717;
}
body.theme-light .track-search-sep {
  color: #a3a3a3;
}
body.theme-light .track-search-title {
  color: #525252;
}
body.theme-light .track-search-bpm,
body.theme-light .track-search-key,
body.theme-light .track-search-dur {
  color: #737373;
}
body.theme-light .track-blocked-badge {
  background: #dc2626;
}
body.theme-light .track-search-actions-trigger {
  color: rgba(17, 24, 39, 0.78);
}
body.theme-light .track-search-actions-trigger:hover,
body.theme-light .track-search-actions-trigger:focus-visible {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.85);
}
body.theme-light .track-search-actions-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(17, 24, 39, 0.16);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}
body.theme-light .track-search-menu-item {
  color: #1f2937;
}
body.theme-light .track-search-menu-item:hover,
body.theme-light .track-search-menu-item:focus-visible {
  background: rgba(2, 132, 199, 0.12);
}
body.theme-light .track-search-menu-item[data-track-action="block"] {
  color: #b91c1c;
}
body.theme-light .track-search-menu-item[data-track-action="unblock"] {
  color: #16a34a;
}
body.theme-light .track-search-btn {
  color: #fff;
}
body.theme-light .track-search-btn.success {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.3);
  color: #15803d;
}
body.theme-light .track-search-btn.error {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}

/* ----- Track history list scrollbar ----- */
body.theme-light .track-history-list::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 6px;
}
body.theme-light .track-history-list::-webkit-scrollbar-thumb {
  background: #c4c4c4;
  border-radius: 6px;
}
body.theme-light .track-history-list::-webkit-scrollbar-thumb:hover {
  background: #a3a3a3;
}

/* ----- Sidebar active state ----- */
body.theme-light .sidebar-item.active {
  color: #1a1a1a;
}
body.theme-light .sidebar-item.active::before {
  background: rgba(0, 0, 0, 0.1);
}
body.theme-light .sidebar-icon {
  filter: brightness(0);
  opacity: 0.55;
}
body.theme-light .sidebar-item:hover .sidebar-icon {
  filter: brightness(0);
  opacity: 0.6;
}
body.theme-light .sidebar-item.active .sidebar-icon {
  filter: brightness(0);
  opacity: 0.9;
}
body.theme-light #autodjSection .sidebar-sublist .sidebar-item.active::before {
  background: rgba(251, 191, 36, 0.2);
}

/* ----- Hint popover ----- */
body.theme-light .hint-popover {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid hsl(0 0% 89.8%);
  color: #171717;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ----- Deck mode labels (next to pill toggle) ----- */
body.theme-light .deck-mode-label {
  color: #b45309;
}
body.theme-light .deck-mode-label-left {
  color: #b91c1c;
}
body.theme-light .deck-mode-label-right {
  color: #b45309;
}

/* ----- Simulator modal (in Playlist Editor) ----- */
.simulator-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.simulator-open-btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.simulator-modal-overlay { align-items: center; justify-content: center; }
.simulator-modal-dialog {
  width: min(480px, 92vw);
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  flex-direction: column;
  gap: 12px;
  background: rgba(14, 28, 46, 0.98);
}
.simulator-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.simulator-modal-header h3 { margin: 0; font-size: 18px; color: #fff; }
.simulator-close-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.simulator-close-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
body.theme-light .simulator-close-btn { color: #525252; }
body.theme-light .simulator-close-btn:hover { background: rgba(0,0,0,0.08); color: #0a0a0a; }
body.theme-light .simulator-modal-dialog { background: #fafafa; }

.simulator-modal-body .simulator-controls { margin-bottom: 1rem; }
.simulator-control-grid { display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 0.75rem; }
.simulator-modal-body .simulator-row { margin-bottom: 0.5rem; }
.simulator-modal-body .simulator-row label { display: block; margin-bottom: 0.25rem; }
.simulator-actions { margin-top: 0.75rem; }
.simulator-actions .btn { margin-right: 0.5rem; }
.simulator-running-indicator { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: #38bdf8; font-weight: 600; }
.simulator-running-indicator[hidden] { display: none !important; }
.simulator-spinner { width: 14px; height: 14px; border: 2px solid rgba(56, 189, 248, 0.3); border-top-color: #38bdf8; border-radius: 50%; animation: simulator-spin 0.75s linear infinite; }
.simulator-modal-body .simulator-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--panel-bg, rgba(255,255,255,0.05));
  border-radius: 6px;
}
.simulator-stat-label { margin-right: 0.25em; font-size: 0.85rem; }
.simulator-modal-body .simulator-mini-history { margin-bottom: 1rem; }
.simulator-mini-history-title { font-size: 0.95rem; margin-bottom: 0.4rem; }
.simulator-modal-body .simulator-recent-picks {
  height: 160px;
  min-height: 160px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--border-color, rgba(255,255,255,0.15));
  border-radius: 6px;
  padding: 0.5rem;
  background: var(--panel-bg, rgba(0,0,0,0.2));
}
.simulator-history-table { margin-bottom: 0; font-size: 12px; table-layout: fixed; width: 100%; background: transparent; }
.simulator-history-table th:nth-child(1),
.simulator-history-table td:nth-child(1) { width: auto !important; }
.simulator-history-table th.simulator-col-track,
.simulator-history-table td.simulator-col-track { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.simulator-history-table th.simulator-col-bpm,
.simulator-history-table td.simulator-col-bpm { width: 70px; min-width: 70px; max-width: 70px; text-align: right; white-space: nowrap; box-sizing: border-box; }
.simulator-history-table th.simulator-col-key,
.simulator-history-table td.simulator-col-key { width: 78px; min-width: 78px; max-width: 78px; text-align: right; white-space: nowrap; box-sizing: border-box; }
.simulator-history-table th.simulator-col-result,
.simulator-history-table td.simulator-col-result { width: 92px; min-width: 92px; max-width: 92px; text-align: right; white-space: nowrap; box-sizing: border-box; }
.simulator-history-table .simulator-col-key .metric-badge { margin-left: auto; margin-right: 0; }
body.theme-light .simulator-recent-picks { background: #fff; border-color: hsl(0 0% 89.8%); }
body.theme-light .simulator-history-table tbody td { color: #171717; }
body.theme-light .simulator-history-table thead th { color: #525252; }
.simulator-badge { font-size: 0.7em; padding: 0.15em 0.4em; border-radius: 4px; margin-right: 0.5em; }
.simulator-badge--scored { background: #16a34a; color: #fff; }
.simulator-badge--unscored { background: #6b7280; color: #fff; }
.simulator-sql-section { margin-bottom: 1rem; }
.simulator-sql-title { font-size: 0.95rem; margin-bottom: 0.5rem; }
.simulator-sql-list .simulator-sql-details { margin-bottom: 0.5rem; }
.simulator-sql-pre { font-size: 0.75rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0.25rem 0; padding: 0.5rem; background: var(--code-bg, rgba(0,0,0,0.3)); border-radius: 4px; }
.simulator-recent-empty, .simulator-sql-empty { color: var(--muted, #94a3b8); font-size: 0.9rem; }
.simulator-modal-body .simulator-sql-pre,
.simulator-modal-body .simulator-sql-details,
.simulator-modal-body .simulator-sql-details summary,
.simulator-modal-body .simulator-stat-label,
.simulator-modal-body .simulator-mini-history-title,
.simulator-modal-body .simulator-sql-title,
.simulator-modal-body .simulator-row label { color: var(--text-primary, #e2e8f0); }
body.theme-light .simulator-modal-body .simulator-sql-pre,
body.theme-light .simulator-modal-body .simulator-sql-details,
body.theme-light .simulator-modal-body .simulator-sql-details summary,
body.theme-light .simulator-modal-body .simulator-stat-label,
body.theme-light .simulator-modal-body .simulator-mini-history-title,
body.theme-light .simulator-modal-body .simulator-sql-title,
body.theme-light .simulator-modal-body .simulator-row label { color: #171717; }
body.theme-light .simulator-modal-body .simulator-recent-empty,
body.theme-light .simulator-modal-body .simulator-sql-empty { color: #737373; }
body.theme-light .simulator-modal-body .simulator-stats { background: rgba(0,0,0,0.06); }
body.theme-light .simulator-modal-body .simulator-sql-pre { background: #f1f5f9; color: #0f172a; }
body.theme-light .simulator-running-indicator { color: #0c4a6e; }

@media (max-width: 860px) {
  .simulator-control-grid { grid-template-columns: 1fr; }
}

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

/* System Logs panel – label/select same as playlist editor */
#panel-system-logs .system-logs-source-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 280px;
  margin-bottom: 12px;
}
.system-logs-view-wrapper { margin-top: 8px; }
/* Results pane: same font as pool-result-title; wrap lines, no horizontal scroll */
.system-logs-content {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  margin: 0;
  padding: 12px;
  max-height: 70vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(0,0,0,0.25);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: pre-wrap;
  word-break: break-word;
  color: #b0c4de;
}
body.theme-light .system-logs-content {
  background: #f1f5f9;
  color: #525252;
  border-color: hsl(0 0% 89.8%);
}
.system-logs-content .log-track-highlight {
  background: rgba(74, 158, 255, 0.25);
  padding: 0 2px;
  border-radius: 2px;
}
body.theme-light .system-logs-content .log-track-highlight {
  background: rgba(59, 130, 246, 0.2);
}

/* Playlist engine log — rich HTML layout */
.system-logs-content.system-logs-content--rich {
  white-space: normal;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 1.45;
  padding: 14px;
}
.system-logs-content--rich .log-pl-rich-root {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.system-logs-content--rich .log-pl-rich-preamble {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #94a3b8;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
body.theme-light .system-logs-content--rich .log-pl-rich-preamble {
  color: #64748b;
  background: #e2e8f0;
  border-color: #cbd5e1;
}
.system-logs-content--rich .log-pl-rich-record {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
body.theme-light .system-logs-content--rich .log-pl-rich-record {
  border-color: #e2e8f0;
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.system-logs-content--rich .log-pl-rich-head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}
body.theme-light .system-logs-content--rich .log-pl-rich-head {
  border-bottom-color: #e2e8f0;
  background: #f1f5f9;
}
.system-logs-content--rich .log-pl-rich-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.system-logs-content--rich .log-pl-rich-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #94a3b8;
}
body.theme-light .system-logs-content--rich .log-pl-rich-time {
  color: #64748b;
}
.system-logs-content--rich .log-pl-rich-level {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.system-logs-content--rich .log-pl-rich-level--warning {
  background: rgba(251, 191, 36, 0.2);
  color: #fcd34d;
}
.system-logs-content--rich .log-pl-rich-level--error {
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}
body.theme-light .system-logs-content--rich .log-pl-rich-level {
  background: rgba(22, 163, 74, 0.15);
  color: #15803d;
}
.system-logs-content--rich .log-pl-rich-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.system-logs-content--rich .log-pl-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #bae6fd;
}
body.theme-light .system-logs-content--rich .log-pl-badge {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}
.system-logs-content--rich .log-pl-badge-k {
  font-weight: 600;
  opacity: 0.85;
}
.system-logs-content--rich .log-pl-badge-k::after {
  content: ':';
  margin-left: 1px;
  opacity: 0.7;
}
.system-logs-content--rich .log-pl-badge-v {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}
.system-logs-content--rich .log-pl-rich-summary {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  line-height: 1.4;
}
body.theme-light .system-logs-content--rich .log-pl-rich-summary {
  color: #0f172a;
}
.system-logs-content--rich .log-pl-rich-body {
  padding: 10px 12px 12px;
}
.system-logs-content--rich .log-pl-rich-body-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.system-logs-content--rich .log-pl-rich-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7dd3fc;
  margin-top: 10px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}
.system-logs-content--rich .log-pl-rich-body-inner > .log-pl-rich-section-title:first-child {
  margin-top: 0;
}
body.theme-light .system-logs-content--rich .log-pl-rich-section-title {
  color: #0369a1;
  border-bottom-color: rgba(3, 105, 161, 0.2);
}
.system-logs-content--rich .log-pl-rich-hr {
  border: none;
  height: 1px;
  margin: 10px 0;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.45), transparent);
}
.system-logs-content--rich .log-pl-rich-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  padding: 3px 0 3px 8px;
  border-left: 2px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}
body.theme-light .system-logs-content--rich .log-pl-rich-line {
  color: #334155;
  border-left-color: #cbd5e1;
}
.system-logs-content--rich .log-pl-rich-line--seed {
  border-left-color: rgba(34, 197, 94, 0.5);
  color: #86efac;
}
body.theme-light .system-logs-content--rich .log-pl-rich-line--seed {
  color: #047857;
  border-left-color: #6ee7b7;
}
.system-logs-content--rich .log-pl-rich-line--harmonic {
  border-left-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
}
body.theme-light .system-logs-content--rich .log-pl-rich-line--harmonic {
  color: #a16207;
  border-left-color: #fbbf24;
}
.system-logs-content--rich .log-pl-rich-line--settings {
  border-left-color: rgba(192, 132, 252, 0.45);
  color: #e9d5ff;
}
body.theme-light .system-logs-content--rich .log-pl-rich-line--settings {
  color: #6b21a8;
  border-left-color: #d8b4fe;
}
.system-logs-content--rich .log-pl-rich-line--sets {
  border-left-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}
body.theme-light .system-logs-content--rich .log-pl-rich-line--sets {
  color: #b45309;
  border-left-color: #fcd34d;
}
.system-logs-content--rich .log-pl-rich-line--annotate {
  border-left-color: rgba(56, 189, 248, 0.55);
  color: #7dd3fc;
}
body.theme-light .system-logs-content--rich .log-pl-rich-line--annotate {
  color: #0369a1;
  border-left-color: #38bdf8;
}
.system-logs-content--rich .log-pl-rich-picked {
  margin: 6px 0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
}
.system-logs-content--rich .log-pl-rich-plain {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== Deck refresh (rollback-safe override block) ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body.theme-light {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Keep content within a readable ultrawide field. Responsive padding. */
.station-main {
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 10px;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* ===== Mobile collapse fix (rollback: delete this block) ===== */
@media (max-width: 1200px) {
  .station-main .deck-grid .deck-section .deck-section-row,
  .station-main .deck-grid .deck-section .deck-queue-row {
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .station-main {
    padding-left: 12px;
    padding-right: 12px;
  }
  .station-main .panel {
    padding: 12px;
  }
  .station-top-bar {
    padding-left: 16px;
    padding-right: 16px;
  }
  /* Deck: hide badges on collapse; show only LIVE/Next/Seed + artist/title */
  .station-main .deck-grid .deck-section .deck-metrics,
  .station-main .deck-grid .deck-section .deck-metrics--right {
    display: none !important;
  }
  .station-main .deck-grid .deck-section {
    padding: 6px 8px;
  }
  body.theme-light .station-sidebar,
  body.theme-light .station-layout.menu-open .station-sidebar {
    border-right: none;
  }
  /* History graph: half normal height at menu collapse (200→100, 120→60); wrap = canvas size to avoid white space */
  .station-main .deck-grid .deck-section--history .deck-history-canvas-wrap {
    min-height: 60px !important;
    height: 60px !important;
    max-height: 60px !important;
  }
  #analyticsBpmHarmonicCanvas,
  .station-main .deck-grid .deck-section--history .deck-history-canvas-wrap .analytics-canvas {
    flex: 0 0 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    height: 60px !important;
  }
}

/* ===== Remove panel borders (rollback: delete this block) ===== */
.station-main .panel {
  border: none;
}
.card,
.station-main .panel > .card {
  border: none;
}
h2.card-header {
  box-shadow: none;
}

/* Sidebar active affordance (keep original padding for hover/selected box size). */
.sidebar-item.active .sidebar-label {
  font-size: 16.5px;
}

/* Live track should dominate visual hierarchy. */
#deckNowPlaying .deck-track-info .deck-artist {
  font-size: 24px;
  font-weight: 750;
  color: #eaf6ff;
}
#deckNowPlaying .deck-track-info .deck-track {
  font-size: 16px;
  color: #b4d2ea;
}

/* Mobile: tighter padding + smaller artist/track text */
@media (max-width: 640px) {
  .station-main {
    padding-left: 10px;
    padding-right: 10px;
  }
  .station-main .panel {
    padding: 10px;
  }
  .station-main .deck-grid .deck-section {
    padding: 6px 6px;
  }
  #deckNowPlaying .deck-track-info .deck-artist {
    font-size: 15px;
  }
  #deckNowPlaying .deck-track-info .deck-track {
    font-size: 12px;
  }
  .station-main .deck-grid .deck-artist {
    font-size: 12px;
  }
  .station-main .deck-grid .deck-track {
    font-size: 11px;
  }
}

/* Narrow: smaller pill font + wider pill so Scheduler stays readable (same breakpoint as sidebar collapse) */
@media (max-width: 900px) {
  #panel-playback .deck-panel-header .deck-mode-pill-toggle {
    min-width: 220px;
  }
  #panel-playback .deck-panel-header .deck-mode-pill-option {
    font-size: 10px;
    padding: 4px 12px;
  }
}

/* Mobile: playlist/scheduler combo + select fit within viewport */
@media (max-width: 640px) {
  #panel-playback .deck-panel-header {
    flex-wrap: wrap;
    min-width: 0;
    gap: 8px;
  }
  #panel-playback .deck-panel-header .deck-mode-pill-toggle {
    min-width: 220px;
    flex: 0 1 auto;
  }
  #panel-playback .deck-panel-header .deck-mode-pill-option {
    font-size: 10px;
    padding: 4px 10px;
  }
  #panel-playback .deck-panel-header .pool-select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    margin-left: 0;
  }
}

/* Deck metric badges: no box styling; harmonic colors on Key only. */
.station-main .deck-grid .deck-metrics .metric-badge .metric-label {
  color: #8ca0b9;
}

/* Strong button hierarchy on deck controls. */
.badge-button#playNextBtn {
  border-color: rgba(92, 255, 164, 0.7);
  background: linear-gradient(135deg, #1bbf72, #14985a);
  color: #041a0f;
  box-shadow: 0 8px 18px rgba(27, 191, 114, 0.35);
}
.badge-button#playNextBtn:hover,
.badge-button#playNextBtn:focus-visible {
  background: linear-gradient(135deg, #22d183, #18aa66);
  border-color: rgba(126, 255, 189, 0.95);
  color: #03140c;
}
.badge-button#blockCurrentBtn,
.badge-button#blockQueuedBtn {
  border-color: rgba(255, 118, 118, 0.65);
  background: linear-gradient(135deg, #4b1f28, #6e2430);
  color: #ffd9d9;
  box-shadow: 0 8px 16px rgba(156, 43, 60, 0.25);
}
.badge-button#blockCurrentBtn:hover,
.badge-button#blockCurrentBtn:focus-visible,
.badge-button#blockQueuedBtn:hover,
.badge-button#blockQueuedBtn:focus-visible {
  background: linear-gradient(135deg, #6f2a37, #963446);
  border-color: rgba(255, 150, 150, 0.85);
  color: #fff2f2;
}

/* Status header feel with clearer grouping and live pips. */
.deck-status-bar .status-item {
  gap: 9px;
}
.status-dot {
  width: 11px;
  height: 11px;
}
.status-dot--on {
  animation: deck-status-live-pulse 1.8s ease-in-out infinite;
}
.status-dot--off {
  animation: none;
}
@keyframes deck-status-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 231, 161, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(111, 231, 161, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 231, 161, 0); }
}

/* Light theme tuning for the refreshed status/header styles. */
body.theme-light .deck-status-bar .status-item {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 252, 0.9));
}
/* DECK REWRITE: deck-section handles both themes; light colors in base .deck-section rule */
body.theme-light #deckNowPlaying .deck-track-info .deck-artist {
  color: #0f172a;
}
body.theme-light .deck-track-badge--tempo,
body.theme-light .deck-track-badge--beatmix {
  background: #fef9c3;
  color: #0a0a0a;
  border-color: rgba(180, 170, 0, 0.4);
}
body.theme-light #deckNowPlaying .deck-track-info .deck-track {
  color: #334155;
}

