/* LocalJam - Minimalist One-Screen Player Stylesheet */

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

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
}

:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* ==========================================================================
   L0 Stage Primary Viewport
   ========================================================================== */

#stage-root {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stage-viewport,
.stage-container {
  width: 100%;
  max-width: var(--stage-max, 420px);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.stage-player-column {
  width: 100%;
  max-width: var(--stage-max, 420px);
  height: 100vh;
  height: 100dvh;
  max-height: 840px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  box-sizing: border-box;
  touch-action: manipulation;
}

/* Row 1: Active Status Chips & Overflow Pill */
.stage-row-1,
.stage-row-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  width: 100%;
}

.stage-chips-group,
.stage-status-chips {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 32px;
}

.stage-chip {
  background: var(--bg-surface-elevated, #1a2333);
  border: 1px solid var(--border-subtle, #334155);
  color: var(--text-secondary, #cbd5e1);
  border-radius: var(--radius-full, 9999px);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.stage-chip.chip-starred,
.stage-chip.stage-chip-star {
  color: var(--accent-amber, #fbbf24);
  border-color: var(--accent-amber, #fbbf24);
}

.stage-chip.chip-muted,
.stage-chip.stage-chip-muted {
  color: var(--accent-rose, #f43f5e);
  border-color: var(--accent-rose, #f43f5e);
}

.stage-chip.stage-chip-shuffle,
.stage-chip.stage-chip-repeat {
  color: var(--accent-cyan, #38bdf8);
  border-color: var(--accent-cyan, #38bdf8);
}

.stage-chip.stage-chip-eq {
  color: var(--accent-purple, #a855f7);
  border-color: var(--accent-purple, #a855f7);
}

.stage-btn-overflow,
.btn-stage-overflow {
  background: var(--bg-surface-elevated, #1a2333);
  border: 1px solid var(--border-subtle, #334155);
  color: var(--text-primary, #f8fafc);
  border-radius: var(--radius-full, 9999px);
  padding: 4px 12px;
  font-size: 14px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stage-row1-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.stage-btn-feedback {
  background: var(--bg-surface-elevated, #1a2333);
  border: 1px solid var(--border-subtle, #334155);
  color: var(--text-secondary, #cbd5e1);
  border-radius: var(--radius-full, 9999px);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.stage-btn-feedback:hover {
  background: var(--bg-surface-hover, #232f45);
  border-color: var(--accent-cyan, #38bdf8);
  color: var(--text-primary, #f8fafc);
}

.stage-btn-feedback:focus-visible {
  outline: 2px solid var(--accent-cyan, #38bdf8);
  outline-offset: 2px;
}

.stage-btn-overflow:hover,
.btn-stage-overflow:hover {
  background: var(--bg-surface-hover, #232f45);
  border-color: var(--border-strong, #475569);
}

/* Row 2: 280x280 Center Artwork & Visualizer Canvas */
.stage-row-2,
.stage-row-artwork {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
  width: 100%;
}

.stage-artwork-wrapper,
.stage-artwork-container {
  position: relative;
  width: 280px;
  height: 280px;
  max-width: 280px;
  max-height: 280px;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  background: var(--bg-surface, #131b2b);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border-subtle, #1e293b);
  user-select: none;
  touch-action: none;
}

@media (max-width: 340px) {
  .stage-artwork-wrapper,
  .stage-artwork-container {
    width: 240px;
    height: 240px;
  }
}

.stage-artwork,
.stage-artwork-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stage-artwork-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #64748b);
}

.stage-visualizer-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Row 3: Metadata (Title & Subtitle) */
.stage-row-3,
.stage-row-metadata {
  width: 100%;
  text-align: center;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  box-sizing: border-box;
}

.stage-title-container {
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.stage-track-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  line-height: 1.25;
}

.stage-track-subtitle {
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  line-height: 1.25;
}

/* Row 4: Seek Bar / Radio Status Line */
.stage-row-4,
.stage-row-timeline {
  width: 100%;
  min-height: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  box-sizing: border-box;
}

.stage-timeline-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.stage-timestamps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 2px;
  box-sizing: border-box;
}

.stage-time-current,
.timestamp-current,
.stage-time-remaining,
.timestamp-remaining {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted, #64748b);
  min-width: 38px;
  text-align: center;
}

.timestamp-current {
  text-align: left;
}

.timestamp-remaining {
  text-align: right;
}

.stage-seek-slider {
  width: 100%;
  accent-color: var(--accent-cyan, #38bdf8);
  height: 6px;
  border-radius: 3px;
  cursor: pointer;
  background: var(--bg-surface-elevated, #1a2333);
}

.stage-radio-status {
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-radio-status.status-ready { color: var(--text-secondary, #cbd5e1); }
.stage-radio-status.status-connecting,
.stage-radio-status.status-buffering { color: var(--accent-amber, #fbbf24); }
.stage-radio-status.status-live { color: var(--accent-cyan, #38bdf8); }
.stage-radio-status.status-error,
.stage-radio-status.status-offline { color: var(--accent-rose, #f43f5e); }

/* Row 5: Transport Controls */
.stage-row-5,
.stage-row-transport {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0;
  width: 100%;
  gap: clamp(8px, 3vw, 18px);
}

.stage-transport-cluster {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(8px, 3vw, 18px);
}

.stage-btn-transport,
.btn-stage-transport {
  background: var(--bg-surface-elevated, #1a2333);
  border: 1px solid var(--border-subtle, #334155);
  color: var(--text-primary, #f8fafc);
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full, 9999px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.stage-btn-rewind,
.btn-stage-rewind,
.stage-btn-forward,
.btn-stage-forward {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.stage-btn-transport:hover,
.btn-stage-transport:hover {
  background: var(--bg-surface-hover, #232f45);
  border-color: var(--border-strong, #475569);
  transform: scale(1.04);
}

.stage-btn-transport:active,
.btn-stage-transport:active {
  transform: scale(0.96);
}

.stage-btn-transport:disabled,
.btn-stage-transport:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.stage-btn-play,
.btn-stage-play {
  width: 64px;
  height: 64px;
  background: var(--accent-cyan, #38bdf8);
  color: #0b0f17;
  border: none;
  font-size: 22px;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.4);
}

.stage-btn-play:hover,
.btn-stage-play:hover {
  filter: brightness(1.12);
  background: var(--accent-cyan, #38bdf8);
  color: #0b0f17;
}

/* Row 6: Dual-Source Handle Bar */
.stage-row-6,
.stage-row-source-bar {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle, #1e293b);
}

.stage-source-handle-bar,
.stage-source-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 14px;
  background: var(--bg-surface, #131b2b);
  border: 1px solid var(--border-subtle, #1e293b);
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
  user-select: none;
  touch-action: pan-y;
}

.stage-source-handle-line {
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

.stage-source-pills {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
}

.stage-source-pill {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 6px 14px;
  border-radius: var(--radius-full, 9999px);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.stage-source-pill:hover {
  color: var(--text-primary, #f8fafc);
}

.stage-source-pill.active {
  color: var(--accent-cyan, #38bdf8);
  background: rgba(56, 189, 248, 0.14);
}

.stage-source-separator {
  background: none;
  border: none;
  padding: 0 4px;
  margin: 0;
  color: var(--text-muted, #64748b);
  font-size: inherit;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.stage-source-separator:focus-visible {
  outline: 2px solid var(--accent-cyan, #38bdf8);
  outline-offset: 2px;
  border-radius: var(--radius-sm, 4px);
}

.stage-prompt-reauth,
.stage-reauth-pill {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid var(--accent-rose, #f43f5e);
  color: var(--accent-rose, #f43f5e);
  padding: 6px 14px;
  border-radius: var(--radius-full, 9999px);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Empty Stage State */
.stage-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}
.stage-empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.stage-empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.stage-empty-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}
.stage-empty-btn:hover { background: var(--bg-surface-hover); }

/* ==========================================================================
   Layers System (L1 Sheets & L2 Modals)
   ========================================================================== */

#layer-root { position: relative; z-index: 100; }
.layer-wrapper,
.layer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  background: var(--modal-backdrop-glass);
  backdrop-filter: blur(var(--backdrop-blur-sm));
  -webkit-backdrop-filter: blur(var(--backdrop-blur-sm));
  z-index: 100;
}

.layer-backdrop.layer-overflow {
  align-items: center;
}

@media (max-width: 768px) {
  .layer-backdrop.layer-overflow {
    align-items: flex-end;
  }
}
.layer-error {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: auto;
  background: var(--bg-surface);
  border: 1px solid var(--accent-rose);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: var(--text-primary);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.layer-error-title { color: var(--accent-rose); font-size: 18px; margin-bottom: 8px; }
.layer-error-message { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; word-break: break-word; }
.layer-error-close {
  background: var(--accent-rose);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ==========================================================================
   L1 Browse Sheet
   ========================================================================== */

.browse-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--sheet-max);
  max-height: 88vh;
  max-height: 88dvh;
  height: 88vh;
  height: 88dvh;
  background: var(--surface-glass);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.browse-sheet-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.browse-header,
.browse-sheet-header {
  display: flex;
  flex-direction: column;
  padding: 14px 20px 8px 20px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.browse-header-row1 {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.segmented-tabs,
.browse-sheet-tabs {
  display: flex;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  padding: 3px;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.tab-btn,
.browse-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, background 0.15s ease;
  line-height: 1;
}

.tab-btn:hover,
.browse-tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active,
.browse-tab-btn.active {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.browse-folder-btn,
.browse-btn-add-folder {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.15s ease;
}

.browse-folder-btn:hover,
.browse-btn-add-folder:hover {
  background: var(--bg-surface-hover);
}

.browse-feedback-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary, #cbd5e1);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.browse-feedback-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-cyan, #38bdf8);
  color: var(--text-primary, #f8fafc);
}

.browse-feedback-btn:focus-visible {
  outline: 2px solid var(--accent-cyan, #38bdf8);
  outline-offset: 2px;
}

.browse-filter-input {
  flex: 1;
  min-width: 100px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.browse-filter-input:focus {
  border-color: var(--accent-cyan);
}

.browse-close-btn,
.browse-btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
  flex-shrink: 0;
  pointer-events: auto;
  z-index: 10;
  transition: color 0.15s ease;
}

.browse-close-btn:hover,
.browse-btn-close:hover {
  color: var(--text-primary);
}

.browse-close-btn:focus-visible,
.browse-btn-close:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.browse-header-row2,
.browse-chips-bar,
.browse-sheet-chips {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle, #334155) transparent;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.browse-header-row2::-webkit-scrollbar,
.browse-chips-bar::-webkit-scrollbar,
.browse-sheet-chips::-webkit-scrollbar {
  height: 4px;
}

.browse-header-row2::-webkit-scrollbar-track,
.browse-chips-bar::-webkit-scrollbar-track,
.browse-sheet-chips::-webkit-scrollbar-track {
  background: transparent;
}

.browse-header-row2::-webkit-scrollbar-thumb,
.browse-chips-bar::-webkit-scrollbar-thumb,
.browse-sheet-chips::-webkit-scrollbar-thumb {
  background: var(--border-subtle, #334155);
  border-radius: var(--radius-full);
}

.chip,
.browse-chip-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  flex-shrink: 0;
  line-height: 1;
  transition: all 0.15s ease;
}

.chip:hover,
.browse-chip-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.chip.active,
.browse-chip-btn.active {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

.browse-sort-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  flex-shrink: 0;
}

.browse-sort-select:focus {
  border-color: var(--accent-cyan);
}

.browse-back-chip {
  background: var(--bg-surface-elevated);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.browse-breadcrumb-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 6px;
  white-space: nowrap;
}

.browse-list-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.browse-list,
.browse-sheet-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0 24px 0;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.browse-list::-webkit-scrollbar,
.browse-sheet-list::-webkit-scrollbar {
  width: 6px;
}
.browse-list::-webkit-scrollbar-track,
.browse-sheet-list::-webkit-scrollbar-track {
  background: transparent;
}
.browse-list::-webkit-scrollbar-thumb,
.browse-sheet-list::-webkit-scrollbar-thumb {
  background: var(--border-subtle, #334155);
  border-radius: var(--radius-full, 9999px);
}
.browse-list::-webkit-scrollbar-thumb:hover,
.browse-sheet-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, #64748b);
}

/* Provider Grouping & Sticky Headers (F11) */
.browse-provider-group {
  display: flex;
  flex-direction: column;
  position: relative;
}

.browse-section-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px;
  background: #0f172a;
  border-bottom: 1px solid var(--border-subtle, #334155);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.browse-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan, #38bdf8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.browse-section-count {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  color: var(--text-secondary, #94a3b8);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
  line-height: 1;
}

/* Dual-Coded Provider Badge (F12) */
.browse-provider-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  color: var(--accent-cyan, #38bdf8);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: var(--radius-sm, 4px);
  padding: 1px 5px;
  margin-right: 6px;
  line-height: 1.2;
  vertical-align: baseline;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.browse-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  min-height: 52px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  background: transparent;
  transition: background 0.15s ease;
  user-select: none;
  text-align: left;
  box-sizing: border-box;
}

@media (pointer: coarse) {
  .browse-row {
    min-height: 56px;
    padding: 10px 20px;
  }
}

.browse-row:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.08));
}

.browse-row:focus-visible {
  outline: 2px solid var(--accent-cyan, #38bdf8);
  outline-offset: -2px;
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.08));
}

.browse-row.is-playing {
  background: rgba(56, 189, 248, 0.1);
  border-left: 3px solid var(--accent-cyan, #38bdf8);
  padding-left: 17px;
}

.browse-playing-bar {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--accent-cyan, #38bdf8);
  box-shadow: 0 0 8px var(--accent-cyan, #38bdf8);
  flex-shrink: 0;
  animation: pulseDot 1.4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.browse-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.browse-row-primary {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.browse-row.is-playing .browse-row-primary {
  color: var(--accent-cyan, #38bdf8);
}

.browse-row-secondary {
  font-size: 12px;
  color: var(--text-secondary, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.browse-row-trailing {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted, #64748b);
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
  padding-left: 12px;
  letter-spacing: 0.02em;
}

.browse-row > .browse-row-primary:not(.browse-row-main *) {
  flex: 1;
  min-width: 0;
}

.browse-empty-state,
.browse-sheet-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: 14px;
  gap: 12px;
}

/* ==========================================================================
   L2 Overflow Menu (Desktop Popover & Mobile Bottom Sheet)
   ========================================================================== */

.overflow-sheet-layer {
  position: relative;
  z-index: 101;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

@media (max-width: 768px) {
  .overflow-sheet-layer {
    align-items: flex-end;
  }
}

.overflow-sheet-layer .sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 1;
  pointer-events: auto;
}

.overflow-panel,
.overflow-menu {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 360px;
  max-height: 85vh;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface-glass, rgba(16, 24, 39, 0.92));
  backdrop-filter: blur(var(--backdrop-blur, 16px));
  -webkit-backdrop-filter: blur(var(--backdrop-blur, 16px));
  border-radius: var(--radius-xl, 16px);
  border: 1px solid var(--border-strong, #334155);
  padding: 16px;
  box-shadow: var(--shadow-lg, 0 20px 25px -5px rgba(0, 0, 0, 0.6));
  animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary, #f8fafc);
  margin: auto;
  box-sizing: border-box;
  pointer-events: auto;
  overflow: hidden;
}

@media (max-width: 768px) {
  .overflow-panel,
  .overflow-menu {
    max-width: 100%;
    max-height: 85vh;
    max-height: 85dvh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 12px 16px 28px 16px;
    margin: 0;
  }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.overflow-panel .sheet-drag-handle {
  width: 40px;
  height: 4px;
  background: var(--border-subtle, #475569);
  border-radius: var(--radius-full, 9999px);
  margin: 0 auto 12px auto;
  display: none;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .overflow-panel .sheet-drag-handle {
    display: block;
  }
}

.overflow-close-btn,
.overflow-menu-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 10;
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 16px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm, 4px);
  line-height: 1;
  pointer-events: auto;
  transition: color 0.15s ease;
}

.overflow-close-btn:hover,
.overflow-menu-close:hover {
  color: var(--text-primary, #f8fafc);
}

.overflow-close-btn:focus-visible,
.overflow-menu-close:focus-visible {
  outline: 2px solid var(--accent-cyan, #38bdf8);
  outline-offset: 2px;
}

.overflow-content {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.overflow-list,
.overflow-menu-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.overflow-row,
.overflow-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s ease;
  box-sizing: border-box;
}

.overflow-row:hover,
.overflow-menu-item:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.08));
}

.overflow-row:focus-visible,
.overflow-menu-item:focus-visible {
  outline: 2px solid var(--accent-cyan, #38bdf8);
  outline-offset: -1px;
}

.overflow-label,
.overflow-item-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #f8fafc);
  white-space: nowrap;
}

.overflow-state,
.overflow-item-state {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan, #38bdf8);
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
}

.overflow-volume-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: default;
  padding: 0 12px;
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
}

.overflow-volume-row:hover {
  background: transparent;
}

.overflow-volume-slider {
  flex: 1;
  min-width: 80px;
  max-width: 140px;
  accent-color: var(--accent-cyan, #38bdf8);
  cursor: pointer;
}

.overflow-volume-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm, 4px);
  display: flex;
  align-items: center;
}

.overflow-volume-toggle:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.08));
}

.overflow-volume-toggle:focus-visible {
  outline: 2px solid var(--accent-cyan, #38bdf8);
  outline-offset: 1px;
}

.overflow-divider {
  border: none;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  margin: 6px 0;
  width: 100%;
}

.overflow-row-destructive .overflow-label,
.overflow-row-destructive .overflow-state,
.overflow-menu-item-destructive .overflow-item-label,
.overflow-menu-item-destructive .overflow-item-state {
  color: var(--accent-rose, #f43f5e);
}

.overflow-row-destructive:hover,
.overflow-menu-item-destructive:hover {
  background: rgba(244, 63, 94, 0.12);
}

.overflow-row-destructive:focus-visible,
.overflow-menu-item-destructive:focus-visible {
  outline: 2px solid var(--accent-rose, #f43f5e);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

#toast-root {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  pointer-events: none;
}
.toast-host { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.toast-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-md);
  animation: fadeInToast 0.15s ease-out;
}
@keyframes fadeInToast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   Modals (EQ Modal, Release Notes, Update Banner)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--modal-backdrop-glass);
  backdrop-filter: blur(var(--backdrop-blur-sm));
  -webkit-backdrop-filter: blur(var(--backdrop-blur-sm));
  z-index: 150;
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 92%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.modal-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.btn-close { background: transparent; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; }

.btn {
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.btn-primary { background: var(--accent-cyan); color: #000; }
.btn-secondary { background: var(--bg-surface-elevated); color: var(--text-primary); border: 1px solid var(--border-subtle); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* EQ Modal */
.eq-controls-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.form-select {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.eq-sliders-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 200px;
  padding: 10px 0;
}
.eq-slider-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; height: 100%; }
.eq-slider-wrapper { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; }
.eq-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 24px;
  height: 120px;
  accent-color: var(--accent-cyan);
}
.eq-db-label, .eq-freq-label { font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); }

/* Release Notes Modal */
.release-section-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.release-highlights-list { padding-left: 20px; font-size: 13px; color: var(--text-primary); line-height: 1.5; }
.commit-item { display: flex; gap: 8px; font-size: 12px; margin-bottom: 4px; }
.commit-hash { color: var(--accent-cyan); font-family: var(--font-mono); }
.commit-msg { color: var(--text-secondary); }
.modal-footer { margin-top: 20px; display: flex; justify-content: flex-end; }

/* Update Banner */
.update-banner-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  width: 92%;
  max-width: 480px;
}
.update-banner {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--accent-amber);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
}
.update-banner-text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.status-badge { font-size: 10px; font-weight: 700; color: var(--accent-amber); }
.update-banner-actions { display: flex; gap: 8px; }

/* Diagnostics & Feedback Modal */
.feedback-modal-card {
  max-width: 520px;
  width: 92%;
  max-height: 85vh;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
}

.feedback-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.feedback-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .feedback-summary-grid {
    grid-template-columns: 1fr;
  }
}

.feedback-metric-card {
  background: var(--bg-surface, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 8px);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feedback-metric-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.feedback-metric-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feedback-notes-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.feedback-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #94a3b8);
}

.feedback-textarea {
  background: var(--bg-surface, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-md, 8px);
  padding: 10px 12px;
  color: var(--text-primary, #f8fafc);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  resize: vertical;
  min-height: 64px;
  outline: none;
  box-sizing: border-box;
  width: 100%;
}

.feedback-textarea:focus {
  border-color: var(--accent-cyan, #38bdf8);
}

.feedback-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}
