/* =============================================
   MIDI Visor — style.css
   ============================================= */

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

:root {
  --bg-base:        #080b14;
  --bg-surface:     #0d1120;
  --bg-elevated:    #111827;
  --bg-card:        rgba(17, 24, 39, 0.8);
  --bg-card-hover:  rgba(30, 41, 59, 0.9);

  --border:         rgba(99, 102, 241, 0.12);
  --border-active:  rgba(99, 102, 241, 0.4);

  --accent-primary:   #818cf8;
  --accent-secondary: #a78bfa;
  --accent-glow:      rgba(129, 140, 248, 0.25);

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  --note-on:   #a78bfa;
  --note-off:  #60a5fa;
  --cc:        #34d399;
  --pc:        #f59e0b;
  --pb:        #f472b6;
  --other:     #94a3b8;
  --sysex:     #fb923c;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px rgba(129,140,248,0.2);

  --font-ui:   'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --header-h:  64px;
  --stats-h:   52px;
  --sidebar-w: 240px;
}

/* ── Background ── */
html, body {
  height: 100%;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation: drift 20s ease-in-out infinite alternate;
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #6366f1, transparent);
  top: -200px; left: -100px;
  animation-duration: 18s;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #a78bfa, transparent);
  bottom: -150px; right: -100px;
  animation-duration: 25s;
  animation-delay: -8s;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #06b6d4, transparent);
  top: 50%; right: 30%;
  animation-duration: 30s;
  animation-delay: -15s;
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, -20px) scale(1.05); }
  100% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ── App wrapper ── */
.app-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ── */
.header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(8, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 1rem;
}

.header-left, .header-right {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header-right { justify-content: flex-end; }
.header-center { flex-shrink: 0; }

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-primary);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.logo-icon svg { width: 100%; height: 100%; }
.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.logo-accent {
  color: var(--accent-primary);
  text-shadow: 0 0 20px var(--accent-glow);
}

/* Status pill */
.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}
.status-pill.connected {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.3);
  color: #34d399;
}
.status-pill.error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.3);
  color: #f87171;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s ease;
}
.status-pill.connected .status-dot {
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
  animation: pulse-dot 2s ease-in-out infinite;
}
.status-pill.error .status-dot {
  background: #f87171;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:hover {
  background: rgba(129,140,248,0.1);
  border-color: var(--border-active);
  color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0); }

/* ── Stats bar ── */
.stats-bar {
  height: var(--stats-h);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  background: rgba(13, 17, 32, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 0;
  overflow-x: auto;
}
.stats-bar::-webkit-scrollbar { display: none; }

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.25rem;
  min-width: 80px;
}
.stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1;
  transition: all 0.2s ease;
}
.stat-value.bump {
  animation: stat-bump 0.3s ease;
}
@keyframes stat-bump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); color: var(--accent-primary); }
  100% { transform: scale(1); }
}
.stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
  white-space: nowrap;
}
.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Main content ── */
.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── Device panel (sidebar) ── */
.device-panel {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: rgba(13, 17, 32, 0.6);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  gap: 0.5rem;
}
.device-panel::-webkit-scrollbar { width: 4px; }
.device-panel::-webkit-scrollbar-track { background: transparent; }
.device-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  color: var(--text-muted);
}
.panel-header svg { width: 14px; height: 14px; flex-shrink: 0; }
.panel-header h2 {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.panel-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  padding: 0 0.25rem;
  margin-top: -0.25rem;
  opacity: 0.7;
}

.device-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.device-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 0.5rem;
  color: var(--text-muted);
  text-align: center;
}
.device-empty svg { width: 40px; height: 40px; opacity: 0.4; }
.device-empty p { font-size: 0.75rem; line-height: 1.4; }

.device-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: default;
  animation: slide-in 0.3s ease;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.device-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}
.device-card.active { border-color: rgba(52,211,153,0.4); }
.device-card-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
.device-card-info {
  flex: 1;
  min-width: 0;
}
.device-card-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}
.device-card-type {
  font-size: 0.625rem;
  color: var(--text-muted);
}

/* Muted device card */
.device-card.muted {
  border-color: rgba(255,255,255,0.05);
  opacity: 0.55;
}
.device-card.muted .device-card-dot {
  background: var(--text-muted);
  box-shadow: none;
  animation: none;
}
.device-card.muted .device-card-name {
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: rgba(148,163,184,0.4);
}

/* Mute button */
.device-mute-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}
.device-mute-btn svg { width: 13px; height: 13px; }
.device-mute-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--border);
  color: var(--text-secondary);
}
.device-mute-btn.is-muted {
  color: #f87171;
  border-color: rgba(248,113,113,0.3);
  background: rgba(248,113,113,0.08);
}
.device-mute-btn.is-muted:hover {
  background: rgba(248,113,113,0.15);
}

/* Filters */
.filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: background 0.15s ease;
  user-select: none;
}
.filter-item:hover { background: rgba(255,255,255,0.04); }
.filter-item input[type="checkbox"] { display: none; }
.filter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, #888);
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}
.filter-item:has(input:checked) .filter-dot {
  opacity: 1;
  box-shadow: 0 0 6px var(--c);
}
.filter-item:has(input:checked) { color: var(--text-primary); }

/* ── Log section ── */
.log-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.25rem;
  background: rgba(13,17,32,0.5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.log-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.625rem;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #f87171;
  text-transform: uppercase;
  transition: all 0.3s ease;
}
.live-badge.paused {
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}
.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1s step-start infinite;
}
.live-badge.paused .live-dot { animation: none; }
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.log-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toolbar-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.toolbar-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  outline: none;
}
.toolbar-select:focus { border-color: var(--border-active); }

/* Log container */
.log-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  scroll-behavior: smooth;
  position: relative;
}
.log-container::-webkit-scrollbar { width: 6px; }
.log-container::-webkit-scrollbar-track { background: transparent; }
.log-container::-webkit-scrollbar-thumb {
  background: rgba(99,102,241,0.2);
  border-radius: 3px;
}
.log-container::-webkit-scrollbar-thumb:hover {
  background: rgba(99,102,241,0.4);
}

/* Welcome state */
.log-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 1rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}
.log-welcome.hidden { display: none; }
.welcome-icon {
  width: 72px;
  height: 72px;
  color: var(--accent-primary);
  opacity: 0.3;
  animation: float 4s ease-in-out infinite;
}
.welcome-icon svg { width: 100%; height: 100%; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.log-welcome h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.log-welcome p {
  font-size: 0.875rem;
  max-width: 320px;
  line-height: 1.6;
}
.welcome-tip {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--accent-primary);
  background: rgba(129,140,248,0.08);
  border: 1px solid rgba(129,140,248,0.2);
  border-radius: 999px;
  padding: 0.3rem 0.875rem;
}
.welcome-tip svg { width: 13px; height: 13px; }

/* Log lines */
.log-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.log-line {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  background: rgba(255,255,255,0.02);
  transition: background 0.15s ease;
  animation: line-in 0.2s ease;
  word-break: break-all;
}
@keyframes line-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.log-line:hover { background: rgba(255,255,255,0.05); }

.log-line.type-noteOn    { border-left-color: var(--note-on); }
.log-line.type-noteOff   { border-left-color: var(--note-off); }
.log-line.type-cc        { border-left-color: var(--cc); }
.log-line.type-pc        { border-left-color: var(--pc); }
.log-line.type-pb        { border-left-color: var(--pb); }
.log-line.type-other     { border-left-color: var(--other); }
.log-line.type-sysex     { border-left-color: var(--sysex); }

.log-index {
  color: var(--text-muted);
  font-size: 0.6875rem;
  min-width: 40px;
  text-align: right;
  flex-shrink: 0;
}
.log-timestamp {
  color: var(--text-muted);
  font-size: 0.6875rem;
  flex-shrink: 0;
  min-width: 95px;
}
.log-type-badge {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
  min-width: 76px;
  text-align: center;
}
.type-noteOn  .log-type-badge { background: rgba(167,139,250,0.15); color: var(--note-on); }
.type-noteOff .log-type-badge { background: rgba(96,165,250,0.15);  color: var(--note-off); }
.type-cc      .log-type-badge { background: rgba(52,211,153,0.15);  color: var(--cc); }
.type-pc      .log-type-badge { background: rgba(245,158,11,0.15);  color: var(--pc); }
.type-pb      .log-type-badge { background: rgba(244,114,182,0.15); color: var(--pb); }
.type-other   .log-type-badge { background: rgba(148,163,184,0.15); color: var(--other); }
.type-sysex   .log-type-badge { background: rgba(251,146,60,0.15);  color: var(--sysex); }

.log-body {
  flex: 1;
  color: var(--text-primary);
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: baseline;
}
.log-channel {
  color: var(--text-muted);
  font-size: 0.6875rem;
}
.log-val-label { color: var(--text-muted); font-size: 0.75rem; }
.log-val       { color: var(--text-primary); font-weight: 600; }
.log-note-name {
  color: var(--accent-secondary);
  font-size: 0.75rem;
  font-weight: 600;
}
.log-hex {
  color: var(--text-muted);
  font-size: 0.6875rem;
  margin-left: auto;
  font-family: var(--font-mono);
}

/* ── Piano ── */
.piano-section {
  flex-shrink: 0;
  padding: 0.625rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(8,11,20,0.6);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.piano-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  flex-shrink: 0;
}
.piano-label svg { width: 14px; height: 14px; }

.piano-wrapper {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
}
.piano-wrapper::-webkit-scrollbar { height: 3px; }
.piano-wrapper::-webkit-scrollbar-track { background: transparent; }
.piano-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.piano {
  display: flex;
  align-items: flex-start;
  height: 52px;
  position: relative;
  gap: 2px;
  min-width: max-content;
}

.key {
  position: relative;
  border-radius: 0 0 4px 4px;
  cursor: default;
  transition: background 0.05s ease, box-shadow 0.05s ease, transform 0.05s ease;
  flex-shrink: 0;
}
.key.white {
  width: 20px;
  height: 52px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.06);
}
.key.black {
  width: 14px;
  height: 34px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.06);
  margin-left: -8px;
  margin-right: -8px;
  z-index: 1;
}
.key.white.active {
  background: var(--note-on);
  box-shadow: 0 0 12px var(--note-on), 0 0 4px var(--note-on);
  transform: scaleY(0.97);
  transform-origin: top;
}
.key.black.active {
  background: var(--accent-secondary);
  box-shadow: 0 0 10px var(--accent-secondary);
}
.key.just-released {
  background: rgba(129,140,248,0.3) !important;
  transition: background 0.5s ease;
}

/* ── Audio panel ── */
.audio-status-tag {
  margin-left: auto;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}
.audio-status-tag.on  { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
.audio-status-tag.off { background: rgba(148,163,184,0.1);  color: var(--text-muted); border: 1px solid var(--border); }

.audio-volume-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  margin-top: 0.25rem;
}
.audio-vol-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  min-width: 22px;
}
.audio-vol-val {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  min-width: 34px;
  text-align: right;
}
.vol-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(129,140,248,0.2);
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 6px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.vol-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.vol-slider:hover { background: rgba(129,140,248,0.35); }

/* Channel map */
.chmap-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.25rem 0;
}
.chmap-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0 0.25rem;
}
.chmap-ch {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent-primary);
  font-family: var(--font-mono);
  min-width: 30px;
}
.chmap-arrow {
  font-size: 0.625rem;
  color: var(--text-muted);
}
.chmap-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.2rem 0.4rem;
  outline: none;
  min-width: 0;
  transition: border-color 0.15s ease;
}
.chmap-input:focus {
  border-color: var(--border-active);
  color: var(--text-primary);
}

/* Song display */
.song-display {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.625rem;
  margin-bottom: 0.25rem;
  background: rgba(129,140,248,0.06);
  border: 1px solid rgba(129,140,248,0.15);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}
.song-display.changed {
  background: rgba(129,140,248,0.15);
  border-color: rgba(129,140,248,0.4);
  animation: song-pop 0.4s ease;
}
@keyframes song-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.song-label {
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.song-number {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  line-height: 1;
  text-shadow: 0 0 16px var(--accent-glow);
  transition: all 0.2s ease;
}
.song-folder {
  font-size: 0.625rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Audio activity flash */
.audio-indicator {
  margin-top: 0.5rem;
  padding: 0 0.5rem;
  height: 22px;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  color: #34d399;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.1s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-indicator.active {
  opacity: 1;
  animation: audio-flash 0.6s ease forwards;
}
@keyframes audio-flash {
  0%   { opacity: 1; color: #34d399; }
  60%  { opacity: 0.8; }
  100% { opacity: 0; }
}

/* ── Responsive ── */
@media (max-width: 800px) {
  :root { --sidebar-w: 200px; }
  .stat-item { padding: 0 0.75rem; min-width: 60px; }
}
@media (max-width: 600px) {
  .device-panel { display: none; }
  .header-right .btn span { display: none; }
}
