/* ============================================
   SONIC ARTISTES MULTI-TRACK PLAYER
   Design Philosophy: Notion for Audio
   Clean, Minimal, Professional
   ============================================ */

:root {
    /* Brand */
    --brand-blue: #0090C4;
    --brand-blue-hover: #007BA8;
    --brand-blue-light: #E6F7FF;
    --accent: #0090C4;          /* alias — used by tabs, help button, etc. */
    
    /* Neutrals (Notion-style) */
    --neutral-50: #FAFAFA;
    --neutral-100: #F5F5F5;
    --neutral-200: #E5E5E5;
    --neutral-300: #D4D4D4;
    --neutral-400: #A3A3A3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    
    /* Semantic */
    --bg-primary: #FFFFFF;
    --bg-secondary: #FAFAFA;
    --bg-tertiary: #F5F5F5;
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-tertiary: #737373;
    --border: #E5E5E5;
    
    /* Status colors */
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing (Notion uses 4px base) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    
    /* Radius */
    --radius-sm: 4px;
    --radius:    6px;
    --radius-md: 6px;
    --radius-lg: 8px;
    
    /* Sidebar */
    --sidebar-width: 280px;
    
    /* Shadows (very subtle) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   LAYOUT
   ============================================ */

.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo {
    width: 32px;
    height: 32px;
}

.logo-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 9.5px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    line-height: 1;
}

/* ── Mode pill + popover ─────────────────────────────────────────────────── */

.mode-pill {
    position: relative;
    display: inline-flex;
    margin-top: 5px;
}

.mode-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px 2px 5px;
    border-radius: 20px;
    border: 1px solid transparent;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: opacity 0.15s, filter 0.15s;
    line-height: 1;
    user-select: none;
}

.mode-pill-badge:hover {
    filter: brightness(1.15);
}

.mode-pill-badge svg {
    flex-shrink: 0;
}

.mode-pill-chevron {
    opacity: 0.65;
    transition: transform 0.18s;
    margin-left: 1px;
}

.mode-pill.open .mode-pill-chevron {
    transform: rotate(180deg);
}

/* Popover */
.mode-pill-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    width: 220px;
    z-index: 500;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
}

.mode-pill.open .mode-pill-popover {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.mode-pill-popover-title {
    padding: 8px 12px 6px;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border);
}

.mode-pill-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: background 0.12s, color 0.12s;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.mode-pill-option:last-child {
    border-bottom: none;
}

.mode-pill-option:hover:not(.mode-pill-option--current) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.mode-pill-option--current {
    cursor: default;
    opacity: 0.55;
}

.mode-pill-option-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-pill-option-body {
    flex: 1;
    min-width: 0;
}

.mode-pill-option-label {
    font-size: 12px;
    font-weight: 600;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.mode-pill-current-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 10px;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.mode-pill-option-desc {
    font-size: 10.5px;
    color: var(--text-tertiary);
    margin-top: 1px;
    line-height: 1.3;
}

.mode-pill-option-arrow {
    flex-shrink: 0;
    color: var(--text-tertiary);
    opacity: 0;
    transition: opacity 0.12s, transform 0.12s;
}

.mode-pill-option:hover:not(.mode-pill-option--current) .mode-pill-option-arrow {
    opacity: 1;
    transform: translateX(2px);
}

/* Help trigger button in sidebar header */
.help-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: none;
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    margin-right: 2px;
}

.help-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-secondary);
}

/* ── Help Modal ─────────────────────────────────────────────────────────────── */

.help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.help-modal {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    transform: translateY(8px);
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-overlay.open .help-modal {
    transform: translateY(0);
}

/* Header */
.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.help-modal-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-modal-logo-img {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.help-modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.help-modal-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-top: 2px;
    line-height: 1.4;
}

.help-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s cubic-bezier(0.4, 0, 0.2, 1), color 0.12s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.12s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.help-modal-close:hover {
    background: var(--bg-secondary);
    border-color: var(--border-strong, #CBD5E1);
    color: var(--text-primary);
}

/* Scrollable body */
.help-modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

.help-modal-body::-webkit-scrollbar { width: 4px; }
.help-modal-body::-webkit-scrollbar-track { background: transparent; }
.help-modal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Sections */
.help-section {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.help-section:last-child {
    border-bottom: none;
}

.help-section--tips {
    background: var(--bg-secondary);
}

/* SVG icon container — replaces emoji */
.help-section-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    margin-top: 1px;
}

.help-section--tips .help-section-icon {
    background: var(--bg-primary);
}

.help-section-content {
    flex: 1;
    min-width: 0;
}

.help-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.help-section-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 6px 0;
}

.help-section-text:last-child {
    margin-bottom: 0;
}

.help-tips-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.help-tips-list li {
    margin-bottom: 3px;
}

/* Footer */
.help-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.help-version {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .help-overlay {
        padding: var(--space-3);
        align-items: flex-end;
    }
    .help-modal {
        max-height: 92vh;
        border-radius: 8px 8px 0 0;
    }
    .help-modal-header,
    .help-section,
    .help-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.sidebar-search {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
}

.search-input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    background: var(--bg-secondary);
    transition: all 0.15s;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-blue);
    background: var(--bg-primary);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.sidebar-content {
    flex: 1;
    overflow: hidden;           /* panels scroll internally, not the whole column */
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ── Sidebar Tabs ─────────────────────────────────────────────────────────── */

.sidebar-tabs {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
}

.sidebar-tab {
    flex: 1;
    padding: 10px 6px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;        /* overlay parent border so active tab "seals" it */
    background: none;
    color: var(--text-tertiary);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.sidebar-tab:hover {
    color: var(--text-secondary);
}

.sidebar-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Container that wraps both panels and fills remaining sidebar height */
.sidebar-tab-panels {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Each panel: hidden by default, flex column when active */
.sidebar-tab-panel {
    display: none;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
    min-height: 0;
}

.sidebar-tab-panel.active {
    display: flex;
}

/* Themes panel: simple scrolling list */
.themes-panel {
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-2) 0;
}

.themes-panel::-webkit-scrollbar { width: 6px; }
.themes-panel::-webkit-scrollbar-track { background: transparent; }
.themes-panel::-webkit-scrollbar-thumb { background: var(--neutral-300); border-radius: 3px; }
.themes-panel::-webkit-scrollbar-thumb:hover { background: var(--neutral-400); }

/* Setlists panel: list grows + scrolls, action buttons pinned at bottom */
.setlists-panel {
    overflow: hidden;
}

.setlists-panel #userSetlistsList {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: var(--space-2) 0;
}

.setlists-panel #userSetlistsList::-webkit-scrollbar { width: 6px; }
.setlists-panel #userSetlistsList::-webkit-scrollbar-track { background: transparent; }
.setlists-panel #userSetlistsList::-webkit-scrollbar-thumb { background: var(--neutral-300); border-radius: 3px; }
.setlists-panel #userSetlistsList::-webkit-scrollbar-thumb:hover { background: var(--neutral-400); }

.setlists-panel .setlist-actions-row {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
}

/* Keep .sidebar-section for any other uses but strip old flex overrides */
.sidebar-section {
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border);
}

.section-header {
    padding: 0 var(--space-4) var(--space-2) var(--space-4);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.sidebar-item {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
    border-radius: 4px;
    margin: 0 8px 2px 8px;
}

.sidebar-item:hover {
    background: var(--bg-secondary);
}

.sidebar-item.active {
    background: var(--brand-blue-light);
    color: var(--brand-blue);
}

/* Give setlist items more vertical space */
.setlist-item {
    padding: 10px 16px;
}

.sidebar-item-content {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    min-width: 0;
}

.sidebar-item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.5;
}

.sidebar-item-text {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-item-count {
    font-size: 12px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.sidebar-item-actions {
    display: flex;
    gap: var(--space-1);
    opacity: 0;
    transition: opacity 0.15s;
}

.sidebar-item:hover .sidebar-item-actions {
    opacity: 1;
}

.action-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    color: var(--text-tertiary);
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* Setlist Item - Notion Style Vertical Layout */
.setlist-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.setlist-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.setlist-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* Setlist Actions Row - Notion Style */
.setlist-actions-row {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
}

.setlist-action-btn {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.setlist-action-btn .btn-icon {
    font-size: 16px;
    font-weight: 600;
}

.setlist-action-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--brand-blue);
    color: var(--brand-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.setlist-action-btn:active {
    transform: translateY(0);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    padding: var(--space-6) var(--space-8);
    border-bottom: 1px solid var(--border);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.content-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.content-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.content-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6) var(--space-8);
    /* padding-bottom is set dynamically by JS to always clear the floating player */
}

/* Welcome State */
.welcome {
    max-width: 600px;
    margin: var(--space-12) auto;
    text-align: center;
}

.welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-6);
}

.welcome h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.welcome p {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

.welcome-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

/* Table View */
.table-container {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.table th {
    padding: var(--space-2) var(--space-4);
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
}

.table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table tbody tr.active {
    background: var(--brand-blue-light);
}

.table-pagination {
    padding: var(--space-4);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    gap: var(--space-2);
}

.page-btn {
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.page-btn:hover {
    background: var(--bg-secondary);
}

.page-btn.active {
    background: var(--brand-blue);
    color: white;
    border-color: var(--brand-blue);
}

.table-action-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-secondary);
}

.table-action-btn:hover {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: white;
    transform: scale(1.1);
}

.table-action-btn-small {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
    color: var(--text-secondary);
}

.table-action-btn-small:hover:not(:disabled) {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: white;
    transform: scale(1.1);
}

/* Auto-Follow Toggle Button */
.auto-follow-toggle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--bg-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
    color: var(--text-tertiary);
}

.auto-follow-toggle.active {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

.auto-follow-toggle:hover {
    transform: scale(1.1);
    border-width: 2px;
}

.auto-follow-toggle.active:hover {
    background: var(--success);
    color: white;
}

.auto-follow-toggle:not(.active):hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
}

/* ============================================
   PLAYER
   ============================================ */

/* ============================================
   PLAYER - FLOATING DESIGN
   ============================================ */

.player {
    display: none;
}

.player.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    bottom: 16px;
    left: calc(var(--sidebar-width) + 24px);
    right: 24px;
    max-width: 1200px;
    max-height: min(92vh, 92dvh);   /* never taller than the viewport */
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12),
                0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

/* Header is always fully visible — never scrolls away */
.player.active .player-header { flex-shrink: 0; }

/* Thin progress bar always shown below the header */
.player-mini-progress {
    flex-shrink: 0;
    height: 2px;
    background: var(--neutral-200);
    overflow: hidden;
}
.player-mini-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--brand-blue);
    transition: width 0.1s linear;
}

/* ── Loading state: pulse on mini bar, disabled play button ── */
/* Opacity is compositor-only — zero layout impact, universal support.     */
/* No background-position or background-size tricks that inflate paint boxes */
@keyframes mini-bar-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

.player.track-loading .player-mini-progress-fill {
    animation: mini-bar-pulse 1.2s ease-in-out infinite;
    transition: width 0.3s ease;
}

.player.track-loading .player-header-play-btn {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Controls and loading share remaining height and scroll internally */
.player.active #playerLoading,
.player.active #playerControls {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}
.player.active #playerControls::-webkit-scrollbar { width: 4px; }
.player.active #playerControls::-webkit-scrollbar-track { background: transparent; }
.player.active #playerControls::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3);
    border-radius: 2px;
}

/* ── Minimised state: hide controls, flip chevron ── */
.player.active.minimised #playerLoading,
.player.active.minimised #playerControls { display: none; }
.player.active.minimised .player-minimise-btn svg { transform: rotate(180deg); }

/* Mini progress bar is only for minimised state — full mode has its own timeline */
.player.active:not(.minimised) .player-mini-progress { display: none; }

/* ── Header action buttons ── */
.player-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: var(--space-3);
}

.player-header-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-blue);
    border: none;
    color: white;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.12s;
    flex-shrink: 0;
}

.player-header-play-btn:hover {
    background: var(--brand-blue-hover);
    transform: scale(1.08);
}

.player-minimise-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.player-minimise-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
}
.player-minimise-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--neutral-400);
}

/* ── Advanced controls cards (classes replace renderStems inline styles) ── */
.adv-stem-card {
    padding: var(--space-3);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    border: 1px solid var(--border);
}
.adv-stem-card-name {
    font-weight: 600;
    margin-bottom: var(--space-3);
    font-size: 13px;
    color: var(--text-primary);
}
.adv-stem-card-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
    align-items: end;
}

/* Center player on very large screens */
@media (min-width: 1800px) {
    .player.active {
        left: 50%;
        right: auto;
        width: 1200px;
        transform: translateX(calc(-50% + var(--sidebar-width) / 2));
    }
}

.player-header {
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.player-icon {
    display: none;  /* Remove icon - not needed! */
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.player-artist {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.player-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.player-meta span:not(:last-child)::after {
    content: "•";
    margin-left: 8px;
    opacity: 0.5;
}

.player-controls {
    padding: 20px 24px 24px 24px;
}

/* Transport */
.transport {
    margin-bottom: var(--space-6);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--neutral-200);
    border-radius: 5px;
    margin-bottom: var(--space-3);
    cursor: pointer;
    position: relative;
    overflow: visible;
}

@media (max-width: 768px) {
    .progress-bar {
        height: 12px;
        border-radius: 6px;
    }
}

.progress-fill {
    height: 100%;
    background: var(--brand-blue);
    border-radius: 5px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
    pointer-events: none;
}

/* Playhead Dot with Glow */
.playhead-dot {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border: 2px solid var(--brand-blue);
    border-radius: 50%;
    box-shadow: 
        0 0 8px rgba(0, 144, 196, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
    cursor: pointer;
    transition: transform 0.15s ease;
    pointer-events: auto;
}

.playhead-dot:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 
        0 0 12px rgba(0, 144, 196, 0.6),
        0 3px 6px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .playhead-dot {
        width: 10px;
        height: 10px;
        border-width: 3px;
    }
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    font-variant-numeric: tabular-nums;
}

.time-display #currentTime {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.time-display #duration {
    font-size: 12px;
    color: var(--text-tertiary);
}

.transport-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
}

.transport-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 16px;
}

.transport-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--brand-blue);
}

.transport-btn-play {
    width: 56px;
    height: 56px;
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: white;
}

.transport-btn-play:hover {
    background: var(--brand-blue-hover);
}

/* Stems */
.stems {
    margin-top: var(--space-6);
}

.stems-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-4);
}

.stem {
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    background: var(--bg-primary);
    transition: all 0.15s;
}

.stem.muted {
    opacity: 0.4;
}

.stem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.stem-name {
    font-size: 14px;
    font-weight: 500;
}

.stem-buttons {
    display: flex;
    gap: var(--space-2);
}

.stem-btn {
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-family: var(--font-sans);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.stem-btn:hover {
    background: var(--bg-secondary);
}

.stem-btn.active {
    background: var(--brand-blue);
    color: white;
    border-color: var(--brand-blue);
}

.stem-btn-mute.active {
    background: var(--error);
    border-color: var(--error);
}

.stem-btn-solo.active {
    background: var(--success);
    border-color: var(--success);
}

.stem-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.control-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    display: flex;
    justify-content: space-between;
}

.control-value {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Sliders */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--neutral-200);
    border-radius: 2px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--brand-blue);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--brand-blue);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-pan {
    background: linear-gradient(to right, 
        var(--error) 0%, 
        var(--neutral-200) 50%, 
        var(--success) 100%
    );
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-secondary);
}

.btn-primary {
    background: var(--brand-blue);
    color: white;
    border-color: var(--brand-blue);
}

.btn-primary:hover {
    background: var(--brand-blue-hover);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-color: var(--border);
    font-size: 13px;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

#themeActions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Ensure all content-header buttons sit at equal height */
#themeActions .btn,
#addAllToSetlistBtn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    box-sizing: border-box;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-md);
}

.modal-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-4);
}

.modal-input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    margin-bottom: var(--space-4);
}

.modal-input:focus {
    outline: none;
    border-color: var(--brand-blue);
}

.modal-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
}

.setlist-option {
    transition: all 0.15s;
}

.setlist-option:not(.disabled):hover {
    background: var(--bg-secondary);
    border-color: var(--brand-blue) !important;
}

/* Loading */
.loading {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-secondary);
}

.loading-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    font-weight: 500;
}

.stem-load-track {
    width: 100%;
    max-width: 260px;
    height: 4px;
    background: var(--neutral-200);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto var(--space-3);
}

.stem-load-fill {
    height: 100%;
    width: 0%;
    background: var(--brand-blue);
    border-radius: 2px;
    transition: width 0.2s ease;
}

.loading-status {
    font-size: 11px;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--neutral-200);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-4);
}

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

/* Utility */
.hidden {
    display: none !important;
}

/* Full Library - Special Featured Section */
.full-library {
    padding: var(--space-4);
    margin: var(--space-4);
    background: linear-gradient(135deg, var(--brand-blue-light) 0%, var(--bg-primary) 100%);
    border: 1px solid var(--brand-blue);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s;
}

.full-library:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 144, 196, 0.15);
}

.full-library.active {
    background: var(--brand-blue);
    color: white;
}

.full-library-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.full-library-icon {
    font-size: 24px;
}

.full-library-title {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
}

.full-library-count {
    font-size: 12px;
    padding: 2px 8px;
    background: white;
    color: var(--brand-blue);
    border-radius: 12px;
    font-weight: 600;
}

.full-library.active .full-library-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.full-library-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-left: 36px;
}

.full-library.active .full-library-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

/* iPad Optimizations */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .content-header {
        padding: var(--space-4) var(--space-4) var(--space-4) 60px;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: var(--space-2);
    }

    /* Title block takes full first row — buttons always wrap to a clean second row */
    .content-header > div:first-child {
        width: 100%;
        min-width: 0;
    }

    .content-title {
        font-size: 18px;
    }

    .content-body {
        padding: var(--space-4);
    }
    
    .player-controls {
        padding: var(--space-4);
    }
    
    .stem-controls {
        grid-template-columns: 1fr;
    }
    
    .table th,
    .table td {
        padding: var(--space-2) var(--space-3);
    }
}

/* ============================================
   PHASE 2 FEATURES
   ============================================ */

/* COMPACT REDESIGN - Option 3 */

/* Compact Transport */
.transport-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.transport-btn-stop-compact {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 18px;
}

.transport-btn-stop-compact:hover {
    background: var(--bg-secondary);
    border-color: var(--brand-blue);
}

.transport-btn-play-compact {
    width: 72px;
    height: 72px;
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: white;
    border-radius: 50%;
    font-size: 28px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transport-btn-play-compact:hover {
    background: var(--brand-blue-hover);
    transform: scale(1.05);
}

.speed-select-compact {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 80px;
}

.speed-select-compact:hover {
    border-color: var(--brand-blue);
}

.resync-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    padding: 0;
    color: var(--text-secondary);
}

.resync-btn svg {
    width: 15px;
    height: 15px;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.resync-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--brand-blue);
    opacity: 1;
    color: var(--brand-blue);
}

.resync-btn:hover svg {
    transform: rotate(360deg);
}

.resync-btn:active svg {
    transform: rotate(360deg) scale(0.88);
    transition-duration: 0.15s;
}

/* Stems Compact */
.stems-compact {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.stems-compact-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-3);
}

.stem-compact {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    transition: all 0.15s;
}

.stem-compact:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stem-compact-name {
    font-size: 13px;
    font-weight: 500;
}

.stem-compact.muted {
    opacity: 0.4;
}

.stem-compact.muted .stem-compact-name {
    text-decoration: line-through;
}

/* Draggable Volume Bar */
.draggable-volume-bar {
    width: 150px;
    position: relative;
}

.mini-volume-bar {
    width: 100%;
    height: 6px;
    background: var(--neutral-200);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: height 0.15s;
}

.mini-volume-bar:hover {
    height: 8px;
}

.mini-volume-fill {
    height: 100%;
    background: var(--brand-blue);
    border-radius: 3px;
    transition: width 0.05s linear;
    pointer-events: none;
}

.volume-label {
    font-size: 10px;
    color: var(--neutral-500);
    text-align: center;
    margin-top: 2px;
}

/* Pan Dot and Slider */
.pan-control {
    width: 40px;
    position: relative;
}

.pan-dot {
    width: 8px;
    height: 8px;
    background: var(--neutral-400);
    border-radius: 50%;
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.pan-dot:hover {
    transform: scale(1.3);
    background: var(--brand-blue);
}

.pan-dot.active {
    background: var(--brand-blue);
}

.pan-label {
    font-size: 10px;
    color: var(--neutral-500);
    text-align: center;
    margin-top: 2px;
}

/* Inline Pan Slider */
.inline-pan-slider {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    margin-bottom: 8px;
    min-width: 200px;
}

.inline-pan-slider.active {
    display: block;
}

.inline-pan-slider::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: white;
}

.pan-slider-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    text-align: center;
}

.pan-slider-container {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.pan-slider-label {
    font-size: 11px;
    color: var(--neutral-500);
    min-width: 20px;
}

.pan-slider {
    flex: 1;
}

/* Expandable Section */
.expandable-section {
    margin-top: var(--space-3);
}

.expand-btn {
    width: 100%;
    padding: var(--space-2);
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.expand-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.expanded-controls {
    display: none;
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.expanded-controls.active {
    display: block;
}

/* Quick Actions Bar */

/* Speed Control */
.speed-control {
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.speed-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.speed-label span:first-child {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.speed-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-blue);
}

.speed-slider {
    margin-bottom: var(--space-2);
}

.speed-presets {
    display: flex;
    gap: var(--space-2);
    justify-content: space-between;
}

.speed-preset-btn {
    flex: 1;
    padding: 4px 8px;
    font-size: 11px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.speed-preset-btn:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.speed-preset-btn.active {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: white;
}

/* A-B Loop */
.loop-controls {
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.loop-btn {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.loop-btn:hover {
    background: var(--bg-tertiary);
}

.loop-btn.active {
    background: var(--warning);
    border-color: var(--warning);
    color: white;
}

.loop-status {
    flex: 1;
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
}

/* Loop Markers on Progress Bar */
.loop-marker {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 8px;
    background: var(--warning);
    border-radius: 1px;
    transform: translateX(-50%);
    pointer-events: none;
}

.loop-marker.marker-a {
    background: var(--success);
}

.loop-marker.marker-b {
    background: var(--error);
}

.loop-region {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(245, 158, 11, 0.2);
    pointer-events: none;
}

/* Stem Presets */
.stem-presets {
    margin-bottom: var(--space-4);
}

.preset-select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-sans);
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.15s;
}

.preset-select:hover {
    border-color: var(--brand-blue);
}

.preset-select:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px var(--brand-blue-light);
}

/* ============================================
   MOBILE MENU
   ============================================ */

/* Mobile Menu Button (Hamburger) — matches .admin-menu-btn styling exactly */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: var(--space-4);
    left: var(--space-4);
    z-index: 1001;
    width: 36px;
    height: 36px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: background 0.12s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Close Button in Sidebar */
.mobile-close-btn {
    display: none;
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.mobile-close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--brand-blue);
}

/* Backdrop Overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Show close button in sidebar */
    .mobile-close-btn {
        display: block;
    }
    
    /* Hide sidebar by default */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        width: 280px;
        max-width: 80vw;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    }
    
    /* Sidebar open state */
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    /* Show backdrop when menu is open */
    .sidebar-backdrop.active {
        display: block;
    }
    
    /* Main content takes full width */
    .main {
        margin-left: 0;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
    
    /* Adjust sidebar header for close button */
    .sidebar-header {
        padding-right: 50px;
    }
    
    /* Floating player on mobile */
    .player.active {
        left: 1%; /* Reset to centered on mobile */
        right: 1%;
        width: auto;
        max-width: none;
        transform: none; /* Reset any transform */
        bottom: 12px;
        border-radius: 10px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }
    
    .player-header {
        padding: 16px 20px 12px 20px;
    }
    
    .player-controls {
        padding: 16px 20px 20px 20px;
    }
    
    .player-meta {
        font-size: 10px;
    }
}


/* ══════════════════════════════════════════════════════════════════════════════
   DARK PLAYER THEME
   All rules scoped under .player.active so nothing outside the player is
   affected. The player sits at the bottom of the screen as a dark "cockpit"
   surface, visually distinct from the white content above it.
   ══════════════════════════════════════════════════════════════════════════════ */

/* Card */
.player.active {
    background: #18181B;
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow:
        0 -12px 48px rgba(0, 0, 0, 0.45),
        0 -4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.07); /* subtle top-edge highlight */
}

/* ── Header ── */
.player.active .player-header {
    border-bottom-color: rgba(255, 255, 255, 0.07);
}
.player.active .player-title  { color: #FFFFFF; }
.player.active .player-artist { color: rgba(255, 255, 255, 0.58); }
.player.active .player-meta   { color: rgba(255, 255, 255, 0.33); }

/* ── Loading state ── */
.player.active .loading       { color: rgba(255, 255, 255, 0.55); }
.player.active .loading-title { color: rgba(255, 255, 255, 0.82); font-weight: 500; }
.player.active .loading-status{ color: rgba(255, 255, 255, 0.4); }
.player.active .stem-load-track { background: rgba(255, 255, 255, 0.1); }
.player.active .spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: var(--brand-blue);
}

/* ── Progress bar ── */
.player.active .progress-bar  { background: rgba(255, 255, 255, 0.1); }

/* ── Time display ── */
.player.active .time-display #currentTime {
    color: #FFFFFF;
}
.player.active .time-display #duration {
    color: rgba(255, 255, 255, 0.38);
}

/* ── Loop controls ── */
.player.active .loop-btn {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.65);
}
.player.active .loop-btn:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}
.player.active .loop-btn.active {
    background: var(--warning);
    border-color: var(--warning);
    color: #FFFFFF;
}
.player.active .loop-status {
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

/* ── Transport ── */
.player.active .transport-btn-stop-compact {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.78);
}
.player.active .transport-btn-stop-compact:hover {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.28);
    color: #FFFFFF;
}

.player.active .speed-select-compact {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.82);
}
.player.active .speed-select-compact:hover,
.player.active .speed-select-compact:focus {
    border-color: var(--brand-blue);
    outline: none;
}
/* Dark dropdown options (where browser supports) */
.player.active .speed-select-compact option {
    background: #27272A;
    color: #FFFFFF;
}

.player.active .resync-btn {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.48);
}
.player.active .resync-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

/* ── Stems section ── */
.player.active .stems-compact {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.player.active .stems-compact-header {
    color: rgba(255, 255, 255, 0.33);
    letter-spacing: 0.08em;
}

/* Stem rows */
.player.active .stem-compact {
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.07);
}
.player.active .stem-compact:hover {
    background: rgba(255, 255, 255, 0.09);
    box-shadow: none;
}
.player.active .stem-compact.muted {
    opacity: 0.35;
}
.player.active .stem-compact-name {
    color: rgba(255, 255, 255, 0.88);
}

/* Volume */
.player.active .mini-volume-bar  { background: rgba(255, 255, 255, 0.1); }
.player.active .volume-label     { color: rgba(255, 255, 255, 0.35); }

/* Pan */
.player.active .pan-dot  { background: rgba(255, 255, 255, 0.28); }
.player.active .pan-dot:hover { background: var(--brand-blue); }
.player.active .pan-dot.active { background: var(--brand-blue); }
.player.active .pan-label { color: rgba(255, 255, 255, 0.32); }

/* Pan popup */
.player.active .inline-pan-slider {
    background: #27272A;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.player.active .inline-pan-slider::after {
    border-top-color: #27272A;
}
.player.active .pan-slider-header {
    color: rgba(255, 255, 255, 0.5);
}
.player.active .pan-slider-label {
    color: rgba(255, 255, 255, 0.45);
}

/* Mute button (class may vary — target by position in stem row) */
.player.active .stem-compact button {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.65);
}
.player.active .stem-compact button:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
}
.player.active .stem-compact.muted button {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.38);
    color: #F87171;
}

/* Preset select */
.player.active .preset-select {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.72);
}
.player.active .preset-select:hover,
.player.active .preset-select:focus {
    border-color: var(--brand-blue);
    outline: none;
    box-shadow: none;
}
.player.active .preset-select option {
    background: #27272A;
    color: #FFFFFF;
}

/* Expand / lyrics buttons */
.player.active .expand-btn {
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.38);
    background: transparent;
}
.player.active .expand-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
}

/* Expanded controls panel */
.player.active .expanded-controls {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
}

/* Lyrics content */
.player.active #lyricsContent pre {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* ── Mini progress bar (dark) ── */
.player.active .player-mini-progress {
    background: rgba(255, 255, 255, 0.1);
}
.player.active .player-mini-progress-fill {
    background: var(--brand-blue);
}
/* Shimmer inherits fine in dark mode — no override needed */

/* ── Header action buttons (dark) ── */
.player.active .player-header-play-btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.85);
}
.player.active .player-header-play-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--brand-blue);
    color: #fff;
}
.player.active .player-minimise-btn {
    color: rgba(255, 255, 255, 0.5);
}
.player.active .player-minimise-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.07);
}

/* ── Advanced stem cards (dark) ── */
.player.active .adv-stem-card {
    background: #27272A;
    border-color: rgba(255, 255, 255, 0.08);
}
.player.active .adv-stem-card-name {
    color: rgba(255, 255, 255, 0.85);
}
.player.active .control-label {
    color: rgba(255, 255, 255, 0.45);
}
.player.active .control-value {
    color: rgba(255, 255, 255, 0.75);
}

/* ── Solo button (dark) ── */
.player.active .stem-btn-solo {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.55);
}
.player.active .stem-btn-solo:hover {
    background: rgba(255, 200, 50, 0.12);
    border-color: rgba(255, 200, 50, 0.4);
    color: #FFD700;
}
.player.active .stem-btn-solo.active {
    background: rgba(255, 200, 50, 0.18);
    border-color: #FFD700;
    color: #FFD700;
}

/* ── Sliders inside advanced controls (dark) ── */
.player.active .expanded-controls input[type="range"] {
    accent-color: var(--brand-blue);
}
.player.active .expanded-controls input[type="range"]::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.15);
}
.player.active .expanded-controls input[type="range"]::-webkit-slider-thumb {
    background: var(--brand-blue);
    border-color: #27272A;
}

/* ── Auth Strip (sidebar, web mode only) ─────────────────────────────────── */

.auth-strip {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    align-items: center;
}

.auth-strip-signin-btn {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.15s;
    text-align: center;
}

.auth-strip-signin-btn:hover {
    background: var(--brand-blue-hover);
}

/* ── Logged-in user pill ─────────────────────────────────────────────────── */

.auth-strip-user {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.auth-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-blue) 0%, #3a7fc1 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(77, 157, 224, 0.25);
}

/* Two-line name + email block */
.auth-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-username {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.auth-user-email {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* Action buttons (admin cog + logout) stacked vertically on the right */
.auth-user-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.auth-logout-btn {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
    padding: 0;
}

.auth-logout-btn:hover {
    color: var(--text-primary);
    background: var(--neutral-100);
}

/* ── Auth gate — blur & lock content behind login modal ─────────────────── */

/* Applied to .app when user is not authenticated (web mode only).
   Targets only .sidebar and .main so the fixed auth-overlay sits unaffected above. */
.sidebar,
.main {
    transition: filter 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app.auth-locked .sidebar,
.app.auth-locked .main {
    filter: blur(14px) brightness(0.8);
    pointer-events: none;
    user-select: none;
}

/* Hide the hamburger while locked — no point opening a blurred sidebar on mobile */
.app.auth-locked .mobile-menu-btn {
    display: none;
}

/* ── Auth Modal ──────────────────────────────────────────────────────────── */

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.auth-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.auth-modal {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    width: 100%;
    max-width: 420px;
    padding: var(--space-8);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.2s ease;
}

.auth-overlay.open .auth-modal {
    transform: translateY(0) scale(1);
}

.auth-modal-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.auth-modal-logo-img {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
}

.auth-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.auth-modal-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* Tabs (kept for reference — invite-only mode hides these) */
.auth-tabs {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 3px;
    margin-bottom: var(--space-6);
    background: var(--bg-secondary);
    gap: 2px;
}

.auth-tab {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    border: none;
    border-radius: 4px;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.auth-tab.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.auth-tab:not(.active):hover {
    color: var(--text-secondary);
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.auth-form.hidden {
    display: none;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.auth-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.auth-input {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    width: 100%;
}

.auth-input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 144, 196, 0.12);
}

.auth-input::placeholder {
    color: var(--neutral-400);
}

.auth-error {
    font-size: 12px;
    color: var(--error);
    min-height: 16px;
    line-height: 1.4;
}

.auth-submit-btn {
    width: 100%;
    padding: var(--space-3);
    background: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    margin-top: var(--space-1);
}

.auth-submit-btn:hover:not(:disabled) {
    background: var(--brand-blue-hover);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-invite-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: var(--space-3);
    line-height: 1.5;
}

/* Mobile */
@media (max-width: 480px) {
    .auth-overlay {
        padding: var(--space-3);
        align-items: flex-end;
    }
    .auth-modal {
        border-radius: 16px 16px 0 0;
        max-height: 92vh;
        overflow-y: auto;
    }
}

/* ── Admin cog link (sidebar auth strip — admin only) ───────────────────── */
.auth-admin-link {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    padding: 0;
}
.auth-admin-link:hover {
    color: var(--brand-blue);
    background: var(--brand-blue-light);
}

/* ── PIN Gate ─────────────────────────────────────────────────────────────────
   Full-screen overlay shown on index-local / index-offline when a PIN is set.
   Removed immediately by JS if no PIN configured or session already verified.
────────────────────────────────────────────────────────────────────────────── */
#pinGate {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.pin-gate-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px var(--space-8);
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pin-gate-logo {
    width: 56px;
    height: auto;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-1);
}

.pin-gate-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.pin-gate-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0;
    text-align: center;
}

.pin-gate-input {
    width: 100%;
    text-align: center;
    font-size: 1.4rem;
    letter-spacing: 0.25em;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pin-gate-input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 144, 196, 0.12);
}

.pin-gate-error {
    font-size: 12px;
    color: var(--error);
    min-height: 16px;
    margin: 0;
    text-align: center;
}

.pin-gate-btn {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--brand-blue);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-gate-btn:hover {
    background: var(--brand-blue-hover);
}

@keyframes pin-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-5px); }
    80%       { transform: translateX(5px); }
}

#pinGate.pin-shake .pin-gate-card {
    animation: pin-shake 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Player toast ─────────────────────────────────────────────────────────── */
.player-toast {
    position: absolute;
    bottom: calc(100% + var(--space-2));
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    max-width: 320px;
    width: max-content;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full, 999px);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 200;
}

.player-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.player-toast--error {
    background: #ef4444;
    color: #fff;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.player-toast--success {
    background: #22c55e;
    color: #fff;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35);
}

