/* ═══════════════════════════════════════════════════════════
   JBS STUDIO — Design System
   Dark + Ice Blue (#003F7D) + Ember Orange (#EDA12E)
   Border Radius: 2px everywhere. No exceptions.
   Google Material Symbols. Inter font. Dense layout.
   Gradients, glow, vibrant color. Music studio vibes.
   ═══════════════════════════════════════════════════════════ */

:root {
    /* Backgrounds */
    --bg-base: #0B0E11;
    --bg-surface: #131820;
    --bg-surface-alt: #1A2230;
    --bg-elevated: #212B3A;
    /* Borders */
    --border-subtle: #1E2836;
    --border-medium: #2A3748;
    --border-strong: #3A4D63;
    /* Primary: Ice Blue */
    --blue-50: #E8F4FD;
    --blue-100: #B8DFFA;
    --blue-200: #7CC4F2;
    --blue-300: #4AADE8;
    --blue-400: #003F7D;
    --blue-500: #1A7FC4;
    --blue-glow: rgba(0,63,125,0.15);
    /* Secondary: Ember Orange */
    --orange-50: #FFF3E6;
    --orange-100: #FFD9A8;
    --orange-200: #FFB85C;
    --orange-300: #EDA12E;
    --orange-400: #F08A00;
    --orange-500: #D47800;
    --orange-glow: rgba(237,161,46,0.15);
    /* Text */
    --text-primary: #E8ECF1;
    --text-secondary: #8899AA;
    --text-tertiary: #4D6070;
    --text-on-blue: #FFFFFF;
    --text-on-orange: #1A1A1A;
    /* Status */
    --success: #34D399;
    --danger: #F87171;
    --warning: #FBBF24;
    --info: #60A5FA;
    /* Platform */
    --spotify: #1DB954;
    --apple: #FC3C44;
    --soundcloud: #FF5500;
    --youtube: #FF0000;
    /* Layout */
    --sidebar-w: 260px;
    --player-h: 60px;
    --radius: 2px;
    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-primary);
    background: linear-gradient(135deg, #0a0a1a 0%, #0d1525 50%, #0a0a1a 100%);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ─── SCROLLBAR (enhanced) ─── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) var(--bg-base);
}

/* ─── SELECTION COLOR ─── */
::selection { background: rgba(0, 63, 125, 0.4); color: var(--text-primary); }
::-moz-selection { background: rgba(0, 63, 125, 0.4); color: var(--text-primary); }

/* ─── ANIMATED GLOW KEYFRAMES ─── */
@keyframes pulse-glow {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--success); }
    50% { opacity: 0.6; box-shadow: 0 0 8px var(--success), 0 0 12px rgba(52,211,153,0.3); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ─── AMBIENT BACKGROUND ANIMATION ─── */
@keyframes ambientDrift {
    0%   { background-position: 0% 50%, 100% 50%; }
    25%  { background-position: 50% 0%, 50% 100%; }
    50%  { background-position: 100% 50%, 0% 50%; }
    75%  { background-position: 50% 100%, 50% 0%; }
    100% { background-position: 0% 50%, 100% 50%; }
}

/* ─── PAGE CONTENT FADE-IN ─── */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── PLAY BUTTON PULSE ─── */
@keyframes playPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(237,161,46,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(237,161,46,0); }
}

/* ─── LOADING PULSE ─── */
@keyframes loadingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ─── PROGRESS GLOW ─── */
@keyframes progressGlow {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 2px rgba(237,161,46,0.3)); }
    50% { filter: brightness(1.15) drop-shadow(0 0 6px rgba(237,161,46,0.5)); }
}

/* ─── LOGIN ─── */
.login-screen {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0a0a1a 0%, #0d1525 40%, #0a0f1e 70%, #0a0a1a 100%);
    z-index: 1000;
}
.login-screen::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(0,63,125,0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(237,161,46,0.04) 0%, transparent 60%);
    pointer-events: none;
}
.login-box {
    width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-top: 2px solid var(--orange-300);
    border-radius: var(--radius);
    padding: 48px;
    position: relative;
    z-index: 1;
}
.login-header {
    display: flex; justify-content: center;
    margin-bottom: 28px;
}
.login-logo-img {
    width: 260px;
    height: auto;
    display: block;
}
.login-logo {
    font-size: 28px; font-weight: 700;
    color: var(--blue-400);
    letter-spacing: -1px;
}
.login-title {
    font-size: 14px; font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.login-subtitle {
    font-size: 18px; font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
}
.form-field {
    margin-bottom: 16px;
}
.form-field label {
    display: block;
    font-size: 13px; font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.form-field input, .form-field select, .form-field textarea {
    width: 100%;
    height: 42px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 15px;
    padding: 0 10px;
    outline: none;
    transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}
.form-field textarea {
    height: auto;
    min-height: 80px;
    padding: 8px 10px;
    resize: vertical;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 2px var(--blue-glow), 0 0 12px rgba(0,63,125,0.12);
}
.form-field input::placeholder { color: var(--text-tertiary); }
.form-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 12px;
    min-height: 18px;
}
.totp-instructions {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}
.qr-container {
    display: flex; justify-content: center;
    margin-bottom: 16px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 16px;
}
.qr-container img { width: 200px; height: 200px; image-rendering: pixelated; }
.totp-secret-display {
    margin-bottom: 16px;
    font-size: 11px;
}
.totp-secret-display label {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}
.totp-secret-display code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--blue-300);
    background: var(--bg-surface-alt);
    padding: 4px 8px;
    border-radius: var(--radius);
    user-select: all;
    word-break: break-all;
}

/* ─── BUTTONS (enhanced) ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px;
    padding: 0 14px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
}
.btn:active { transform: scale(0.96); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-full { width: 100%; }
.btn-primary {
    background: linear-gradient(135deg, #003F7D 0%, #005aaa 100%);
    color: var(--text-on-blue);
    border-color: #004d99;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #004d99 0%, #0068c0 100%);
    border-color: #0068c0;
    box-shadow: 0 0 16px rgba(0,63,125,0.35), 0 4px 12px rgba(0,63,125,0.2);
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
    background: transparent;
    color: var(--blue-300);
    border-color: var(--blue-400);
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    background: var(--blue-glow);
    box-shadow: 0 0 12px rgba(0,63,125,0.2);
}
.btn-cta {
    background: linear-gradient(135deg, #EDA12E 0%, #F5B74A 100%);
    color: var(--text-on-orange);
    border-color: var(--orange-300);
}
.btn-cta:hover {
    background: linear-gradient(135deg, #F5B74A 0%, #FFD06E 100%);
    border-color: var(--orange-200);
    box-shadow: 0 0 16px rgba(237,161,46,0.35), 0 4px 12px rgba(237,161,46,0.2);
}
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
    transition: all 0.2s ease;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-surface-alt); }
.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
    transition: all 0.2s ease;
}
.btn-danger:hover { background: rgba(248,113,113,0.1); box-shadow: 0 0 12px rgba(248,113,113,0.15); }
.btn .material-symbols-outlined { font-size: 16px; }

/* ─── FOCUS STATES (accessibility) ─── */
.btn:focus-visible,
.nav-item:focus-visible,
.chip:focus-visible,
.tab:focus-visible,
.genre-chip:focus-visible,
.track-play:focus-visible,
.player-btn:focus-visible,
a:focus-visible {
    outline: 2px solid var(--blue-300);
    outline-offset: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
    border-color: var(--blue-400);
    box-shadow: 0 0 0 2px var(--blue-glow), 0 0 12px rgba(0,63,125,0.12);
}

/* ─── LAYOUT ─── */
#app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: 1fr var(--player-h);
    height: 100vh;
}
#app.player-hidden { grid-template-rows: 1fr 0; }

.sidebar {
    grid-row: 1 / -1;
    background: linear-gradient(180deg, rgba(0,63,125,0.14) 0%, rgba(19,24,32,0.98) 25%, rgba(13,17,22,0.98) 75%, rgba(237,161,46,0.06) 100%);
    border-right: 1px solid var(--border-subtle);
    display: flex; flex-direction: column;
    overflow-y: auto;
    position: relative;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.sidebar::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(180deg, rgba(0,63,125,0.35) 0%, transparent 30%, transparent 70%, rgba(237,161,46,0.2) 100%);
}
.sidebar-header {
    display: flex; justify-content: center;
    padding: 24px 16px 20px;
}
.sidebar-logo-img {
    width: 100%;
    max-width: 200px;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 12px rgba(0,63,125,0.25));
    transition: filter 0.3s ease;
}
.sidebar-logo-img:hover {
    filter: drop-shadow(0 0 18px rgba(0,63,125,0.4));
}
.sidebar-logo {
    font-size: 20px; font-weight: 700;
    color: var(--blue-400);
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(0,63,125,0.3);
}
.sidebar-title {
    font-size: 10px; font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.15em;
}
.sidebar-nav { flex: 1; padding: 0 8px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    height: 42px;
    padding: 0 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none; background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
    position: relative;
}
.nav-item:hover {
    color: var(--text-primary);
    background: rgba(26,34,48,0.7);
}
.nav-item.active {
    color: var(--text-primary);
    background: linear-gradient(90deg, rgba(237,161,46,0.12) 0%, rgba(0,63,125,0.1) 100%);
    border-left: 3px solid var(--orange-300);
    padding-left: 9px;
    box-shadow: inset 0 0 20px rgba(237,161,46,0.04);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--orange-300);
    filter: blur(6px);
    opacity: 0.7;
}
.nav-item .material-symbols-outlined { font-size: 18px; font-variation-settings: 'wght' 300; }
.nav-item.active .material-symbols-outlined { color: var(--orange-300); }
.nav-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--orange-300) 50%, transparent 100%);
    opacity: 0.25;
    margin: 10px 10px;
}
.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border-subtle);
}
.sync-status {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    font-size: 11px;
    color: var(--text-tertiary);
}
.sync-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse-glow 2s ease-in-out infinite;
}
.nav-logout { color: var(--text-tertiary); margin-top: 4px; }
.nav-logout:hover { color: var(--danger); }

.main-content {
    overflow-y: auto;
    background:
        linear-gradient(135deg, #0a0a1a 0%, #0d1525 50%, #0a0a1a 100%);
    position: relative;
}

/* Ambient gradient animation on main content */
.main-content::after {
    content: '';
    position: fixed;
    top: 0; left: var(--sidebar-w); right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0,63,125,0.07) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 90%, rgba(237,161,46,0.04) 0%, transparent 60%);
    background-size: 200% 200%, 200% 200%;
    animation: ambientDrift 60s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.page-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.page-container > * {
    animation: fadeSlideIn 0.3s ease-out;
}

/* ─── PLAYER BAR (premium audio player) ─── */
.player-bar {
    grid-column: 1 / -1;
    height: var(--player-h);
    background: linear-gradient(90deg, #0f1520 0%, #131d2d 30%, #151e2e 70%, #121a28 100%);
    border-top: 1px solid var(--border-medium);
    display: flex; align-items: center;
    padding: 0 16px;
    gap: 16px;
    position: relative;
    z-index: 3000;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.player-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--blue-400) 25%, var(--orange-300) 50%, var(--blue-400) 75%, transparent 100%);
    opacity: 0.5;
}
.player-track-info {
    display: flex; align-items: center; gap: 10px;
    min-width: 180px;
}
.player-art {
    width: 42px; height: 42px;
    background: var(--bg-surface-alt);
    border-radius: var(--radius);
    flex-shrink: 0;
    border: 1px solid var(--border-subtle);
    transition: border-color 0.2s ease;
}
.player-art:hover {
    border-color: var(--orange-300);
}
.player-art img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.player-meta { min-width: 0; }
.player-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-controls {
    display: flex; align-items: center; gap: 4px;
}
.player-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}
.player-btn:hover { color: var(--text-primary); background: var(--bg-surface-alt); }
.player-btn .material-symbols-outlined { font-size: 20px; }
.player-btn-play {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(237,161,46,0.15), rgba(237,161,46,0.05));
    border: 1px solid rgba(237,161,46,0.3);
}
.player-btn-play .material-symbols-outlined { font-size: 26px; color: var(--text-primary); }
.player-btn-play:hover {
    color: var(--orange-300);
    background: linear-gradient(135deg, rgba(237,161,46,0.25), rgba(237,161,46,0.1));
    border-color: var(--orange-300);
    box-shadow: 0 0 16px rgba(237,161,46,0.2);
}
.player-btn-play:hover .material-symbols-outlined { color: var(--orange-300); }
.player-btn-play.playing {
    animation: playPulse 2s ease-in-out infinite;
    border-color: var(--orange-300);
    background: linear-gradient(135deg, rgba(237,161,46,0.2), rgba(237,161,46,0.08));
}
.player-progress {
    flex: 1;
    display: flex; align-items: center; gap: 8px;
}
.player-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); min-width: 32px; }
.player-bar-track {
    flex: 1;
    height: 4px;
    background: var(--border-medium);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s ease;
}
.player-bar-track:hover {
    height: 6px;
}
.player-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-400) 0%, var(--blue-300) 60%, var(--orange-300) 100%);
    border-radius: 2px;
    width: 0;
    position: relative;
}
.player-bar-fill.playing {
    animation: progressGlow 2s ease-in-out infinite;
}
.player-bar-fill::after {
    content: '';
    position: absolute;
    top: -2px; right: 0; bottom: -2px;
    width: 40px;
    background: linear-gradient(90deg, transparent, rgba(237,161,46,0.3));
    border-radius: 2px;
    filter: blur(3px);
}
.player-bar-handle {
    width: 12px; height: 12px;
    background: var(--orange-300);
    border-radius: 50%;
    position: absolute;
    top: -4px; right: -6px;
    opacity: 0;
    transition: opacity 120ms, transform 120ms;
    box-shadow: 0 0 8px rgba(237,161,46,0.4);
}
.player-bar-track:hover .player-bar-handle { opacity: 1; transform: scale(1.1); }
.player-extra {
    display: flex; align-items: center; gap: 12px;
    min-width: 150px; justify-content: flex-end;
}
.player-volume { display: flex; align-items: center; gap: 4px; }
.vol-slider {
    width: 70px; height: 4px;
    -webkit-appearance: none;
    background: var(--border-medium);
    border-radius: 2px;
    outline: none;
    transition: height 0.15s ease;
}
.vol-slider:hover { height: 6px; }
.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    background: var(--blue-300);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(74,173,232,0.3);
    transition: transform 0.15s ease;
}
.vol-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.vol-slider::-moz-range-thumb {
    width: 12px; height: 12px;
    background: var(--blue-300);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(74,173,232,0.3);
}

/* ─── BADGES (enhanced vibrancy) ─── */
.badge {
    display: inline-flex; align-items: center;
    height: 26px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius);
    white-space: nowrap;
    transition: all 0.2s ease;
}
.badge-data {
    background: var(--bg-surface-alt);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}
.badge-blue { background: rgba(0,63,125,0.2); color: var(--blue-300); border: 1px solid rgba(0,63,125,0.15); }
.badge-orange { background: rgba(237,161,46,0.2); color: var(--orange-300); border: 1px solid rgba(237,161,46,0.15); }
.badge-green { background: rgba(52,211,153,0.2); color: var(--success); border: 1px solid rgba(52,211,153,0.15); }
.badge-red { background: rgba(248,113,113,0.2); color: var(--danger); border: 1px solid rgba(248,113,113,0.15); }

/* ─── CARDS (enhanced depth) ─── */
.card {
    background: linear-gradient(180deg, rgba(19,24,32,0.9) 0%, rgba(13,17,22,0.9) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 16px;
    transition: all 0.25s ease;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 2px 8px rgba(0,0,0,0.2);
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--blue-400), var(--orange-300));
    opacity: 0.3;
    transition: opacity 0.25s ease;
    border-radius: var(--radius) var(--radius) 0 0;
}
.card:hover {
    border-color: var(--border-medium);
    transform: translateY(-4px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 12px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,63,125,0.1);
}
.card:hover::before { opacity: 0.8; }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}

/* ─── PAGE HEADER ─── */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--orange-300), var(--blue-400), transparent) 1;
}
.page-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}
.page-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ─── SECTION HEADERS ─── */
.section-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid transparent;
    border-image: linear-gradient(90deg, rgba(237,161,46,0.4), transparent) 1;
    position: relative;
}

/* ─── ORANGE ACCENT DIVIDERS ─── */
.section-divider,
hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--orange-300), transparent);
    opacity: 0.25;
    margin: 24px 0;
}

/* ─── TABLES (enhanced readability) ─── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    padding: 12px 10px;
    border-bottom: 2px solid var(--border-medium);
    position: sticky; top: 0;
    background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(19,24,32,0.98) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2;
}
.data-table td {
    padding: 12px 10px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    transition: background 0.15s ease;
}
.data-table tr:nth-child(even) td {
    background: rgba(0,63,125,0.04);
}
.data-table tr:nth-child(odd) td {
    background: transparent;
}
.data-table tr:hover td {
    background: rgba(0,63,125,0.1);
}
.data-table .col-mono { font-family: var(--font-mono); font-size: 11px; }
.data-table .col-action { text-align: right; }
.data-table .col-play {
    width: 36px;
    text-align: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}
.data-table .col-play:hover { color: var(--orange-300); }

/* Table horizontal scroll wrapper for mobile */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ─── STAT TILES (enhanced with gradient & depth) ─── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat-tile {
    background: linear-gradient(135deg, rgba(19,24,32,0.95) 0%, rgba(0,63,125,0.06) 50%, rgba(13,17,22,0.95) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 24px;
    min-height: 120px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}
.stat-tile:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.stat-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue-400), var(--orange-300));
    opacity: 0.7;
}
.stat-tile::after {
    content: '';
    position: absolute;
    top: 2px; left: 0;
    width: 30%;
    height: 2px;
    background: var(--orange-300);
    filter: blur(4px);
    opacity: 0.4;
}
.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    line-height: 1.2;
    text-shadow: 0 0 20px rgba(232,236,241,0.08);
}
.stat-change {
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ─── TABS ─── */
.tabs {
    display: flex; gap: 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}
.tab {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
    color: var(--orange-300);
    border-bottom-color: var(--orange-300);
}

/* ─── SPLIT LAYOUT ─── */
.split-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    min-height: calc(100vh - var(--player-h) - 120px);
}
.split-sidebar {
    background: linear-gradient(180deg, rgba(19,24,32,0.9) 0%, rgba(13,17,22,0.9) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 12px;
    overflow-y: auto;
    max-height: calc(100vh - var(--player-h) - 120px);
}
.split-main {
    overflow-y: auto;
}

/* ─── SEARCH BAR ─── */
.search-bar {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius);
    padding: 0 12px;
    height: 36px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-bar:focus-within {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 2px var(--blue-glow), 0 0 12px rgba(0,63,125,0.08);
}
.search-bar .material-symbols-outlined {
    font-size: 18px;
    color: var(--text-tertiary);
    font-variation-settings: 'wght' 300;
}
.search-bar input {
    flex: 1;
    background: none; border: none; outline: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
}
.search-bar input::placeholder { color: var(--text-tertiary); }

/* ─── FILTER CHIPS ─── */
.chip-group {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.chip {
    height: 26px;
    padding: 0 10px;
    display: inline-flex; align-items: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}
.chip:hover { border-color: var(--border-medium); color: var(--text-primary); }
.chip.active {
    background: linear-gradient(135deg, rgba(0,63,125,0.2), rgba(237,161,46,0.1));
    color: var(--orange-300);
    border-color: var(--orange-300);
}

/* ─── LIST ITEMS ─── */
.list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s ease;
}
.list-item:hover { background: var(--bg-surface-alt); }
.list-item.active {
    background: rgba(237,161,46,0.08);
    border-left: 2px solid var(--orange-300);
    padding-left: 8px;
}
.list-item-title { font-size: 12px; font-weight: 500; }
.list-item-sub { font-size: 11px; color: var(--text-secondary); }

/* ─── ALBUM ART ─── */
.art-sm { width: 40px; height: 40px; border-radius: 4px; overflow: hidden; background: var(--bg-surface-alt); flex-shrink: 0; }
.art-md { width: 48px; height: 48px; border-radius: var(--radius); background: var(--bg-surface-alt); flex-shrink: 0; }
.art-lg { width: 200px; height: 200px; border-radius: 4px; overflow: hidden; background: var(--bg-surface-alt); flex-shrink: 0; }
.art-sm img, .art-md img, .art-lg img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

/* ─── ALBUM GRID ─── */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.album-card {
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.album-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(237,161,46,0.1); }
.album-card .album-art {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-surface-alt);
    border-radius: 4px;
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    position: relative;
    transition: border-color 0.2s ease;
}
.album-card:hover .album-art {
    border-color: var(--orange-300);
}
.album-card .album-art img { width: 100%; height: 100%; object-fit: cover; }
.album-card .album-title { font-size: 18px; font-weight: 600; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-card .album-meta { font-size: 14px; color: var(--text-secondary); }

/* ─── LOADING (enhanced) ─── */
.spinner {
    width: 16px; height: 16px;
    border: 2px solid var(--border-medium);
    border-top-color: var(--orange-300);
    border-right-color: var(--blue-400);
    border-radius: 50%;
    animation: spin 600ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    animation: loadingPulse 1.5s ease-in-out infinite;
}

/* ─── MODAL / DRAWER ─── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    display: flex; align-items: center; justify-content: center;
}
.modal {
    background: linear-gradient(180deg, var(--bg-elevated) 0%, #1a2436 100%);
    border: 1px solid var(--border-medium);
    border-top: 2px solid var(--orange-300);
    border-radius: var(--radius);
    padding: 24px;
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.5);
    animation: fadeSlideIn 0.2s ease-out;
}
.modal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 380px;
    background: linear-gradient(180deg, var(--bg-elevated) 0%, #1a2436 100%);
    border-left: 1px solid var(--border-medium);
    z-index: 100;
    padding: 20px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 200ms ease-out;
    box-shadow: -8px 0 32px rgba(0,0,0,0.3);
}
.drawer.open { transform: translateX(0); }
.drawer-close {
    position: absolute; top: 12px; right: 12px;
    background: none; border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}
.drawer-close:hover { color: var(--text-primary); }

/* ─── CHAT (Santiago) ─── */
.chat-container {
    display: flex; flex-direction: column;
    height: calc(100vh - var(--player-h) - 120px);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}
.chat-msg {
    display: flex; gap: 10px;
    margin-bottom: 16px;
    max-width: 85%;
}
.chat-msg.user { margin-left: auto; flex-direction: row-reverse; }
.chat-avatar {
    width: 28px; height: 28px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
}
.chat-avatar.ai { background: var(--blue-glow); color: var(--blue-400); }
.chat-avatar.human { background: var(--orange-glow); color: var(--orange-300); }
.chat-bubble {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.6;
}
.chat-msg.assistant .chat-bubble { background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.chat-msg.user .chat-bubble {
    background: linear-gradient(135deg, rgba(0,63,125,0.15), rgba(0,63,125,0.08));
    border: 1px solid rgba(0,63,125,0.3);
}
.chat-input-bar {
    display: flex; gap: 8px;
    padding: 12px 0 0;
    border-top: 1px solid var(--border-subtle);
}
.chat-input {
    flex: 1;
    height: 36px;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius);
    padding: 0 12px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.chat-input:focus {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 2px var(--blue-glow), 0 0 12px rgba(0,63,125,0.08);
}

/* ─── LYRICS EDITOR ─── */
.lyrics-display {
    font-size: 14px;
    line-height: 2;
    color: var(--text-primary);
    white-space: pre-wrap;
    padding: 16px;
    background: linear-gradient(180deg, rgba(19,24,32,0.9) 0%, rgba(13,17,22,0.9) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    min-height: 300px;
}
.lyrics-display .section-tag {
    color: var(--orange-300);
    font-weight: 600;
    font-size: 12px;
}

/* ─── WAVEFORM MINI ─── */
.waveform-mini {
    height: 24px;
    background: var(--bg-surface-alt);
    border-radius: var(--radius);
    overflow: hidden;
}

/* ─── GRID LAYOUTS ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ─── PROGRESS BAR ─── */
.progress-bar {
    height: 4px;
    background: var(--border-subtle);
    border-radius: 2px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-400), var(--blue-300));
    border-radius: 2px;
    transition: width 300ms ease-out;
}
.progress-fill.orange {
    background: linear-gradient(90deg, var(--orange-400), var(--orange-300));
}

/* ─── CHECKLIST ─── */
.checklist-item {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 0;
    font-size: 12px;
}
.checklist-item input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--orange-300);
    cursor: pointer;
}
.checklist-item.done { color: var(--text-tertiary); text-decoration: line-through; }

/* ─── SAMPLE GRID ─── */
.sample-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
}
.sample-card {
    background: linear-gradient(180deg, rgba(19,24,32,0.9) 0%, rgba(13,17,22,0.9) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.sample-card:hover {
    border-color: var(--orange-300);
    background: linear-gradient(180deg, rgba(26,34,48,0.95) 0%, rgba(19,24,32,0.95) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}
.sample-card .sample-wave {
    height: 24px;
    background: linear-gradient(90deg, rgba(0,63,125,0.15), rgba(237,161,46,0.08));
    border-radius: 1px;
    margin-bottom: 6px;
}
.sample-card .sample-name { font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sample-card .sample-meta { font-size: 10px; color: var(--text-tertiary); font-family: var(--font-mono); display: flex; gap: 8px; }

/* ─── UTILITY ─── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-sm { font-size: 11px; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-blue { color: var(--blue-400); }
.text-orange { color: var(--orange-300); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-mono { font-family: var(--font-mono); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
    font-size: 13px;
}
.empty-state a { color: var(--orange-300); text-decoration: none; transition: color 0.2s ease; }
.empty-state a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (max-width: 768px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --sidebar-w: 0px;
        --player-h: auto;
    }

    /* Sidebar — off-canvas drawer */
    .sidebar {
        display: none;
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 280px;
        z-index: 200;
        border-right: 1px solid var(--border-medium);
        box-shadow: 8px 0 32px rgba(0,0,0,0.5);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.mobile-open {
        display: flex;
        transform: translateX(0);
    }

    /* App grid — single column */
    #app {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }

    /* Page layout */
    .page-container { padding: 12px 14px; }
    .page-title { font-size: 20px; letter-spacing: -0.2px; }
    .page-subtitle { font-size: 12px; }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    /* Split layout stacks */
    .split-layout { grid-template-columns: 1fr; }
    .split-sidebar { max-height: 200px; overflow-y: auto; }

    /* Grids go single column */
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    /* Cards — no hover effects on touch */
    .card { padding: 12px; }
    .card:hover { transform: none; }
    .album-card:hover { transform: none; box-shadow: none; }

    /* Album grid */
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .sample-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

    /* Tabs — horizontal scroll */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        scrollbar-width: none;
        margin-bottom: 12px;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Player bar — compact mobile layout */
    .player-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 4px 8px 2px;
        gap: 4px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 3000;
        align-items: center;
    }
    .player-art { width: 36px; height: 36px; border-radius: 4px; flex-shrink: 0; }
    .player-track-info { min-width: 0; flex: 1; }
    .player-track-info .player-title { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .player-track-info .player-artist { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .player-controls { gap: 0; flex-shrink: 0; }
    .player-btn { width: 28px; height: 28px; }
    .player-btn .material-symbols-outlined { font-size: 18px; }
    .player-btn-play { width: 32px; height: 32px; }
    .player-btn-play .material-symbols-outlined { font-size: 20px; }
    .player-progress { width: 100%; order: 3; padding-bottom: 2px; }
    .player-time { font-size: 9px; }
    .player-extra { display: none; }
    .player-badges { display: none; }
    .player-volume { display: none; }

    /* Tables — horizontal scroll */
    .data-table { min-width: 500px; }

    /* Modal — full width on mobile */
    .modal { min-width: auto; margin: 12px; max-width: calc(100vw - 24px); }
    .modal-title { font-size: 16px; }

    /* Drawer full width */
    .drawer { width: 100%; }
    .chat-msg { max-width: 95%; }

    /* Login */
    .login-box { width: 92vw; max-width: 380px; padding: 20px; }
    .login-logo-img { width: 240px; }
    .sidebar-logo-img { width: 140px; }
    .login-subtitle { font-size: 14px; }

    /* Search */
    .search-bar { width: 100%; }
    .chip-group { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }

    /* Stats */
    .stat-value { font-size: 24px; }
    .stat-label { font-size: 11px; }
    .section-header { font-size: 11px; }
    .nav-item { font-size: 13px; }

    /* Ambient background off for performance */
    .main-content::after { animation: none; }
    .main-content::before { display: none; }

    /* ── Favorites / Library rows ── */
    .fv-song-row { padding: 8px 10px; gap: 8px; }
    .fv-song-title { font-size: 13px; }
    .fv-song-meta { font-size: 11px; }
    .fv-song-badges { display: none; }
    .fv-song-tags { display: none; }
    .fv-song-actions { gap: 0; }
    .fv-song-actions .btn { width: 24px; }
    .fv-play-btn { padding: 2px; }

    /* ── Analysis panel ── */
    .anl-panel {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 12px 12px 0 0 !important;
        max-height: 70vh !important;
    }

    /* ── Discover page ── */
    .dc-results-grid { grid-template-columns: 1fr !important; }
    .dc-search-bar { font-size: 14px; }

    /* ── Mobile menu button ── */
    .mobile-menu-btn { display: flex; }

    /* ── Top nav bar for mobile (added by JS) ── */
    .mobile-top-nav {
        display: flex;
        position: fixed;
        top: 0; left: 0; right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-medium);
        z-index: 2999;
        padding: 4px 0;
        padding-top: max(4px, env(safe-area-inset-top));
        justify-content: space-around;
    }
    .mobile-top-nav .mob-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1px;
        font-size: 10px;
        color: var(--text-tertiary);
        text-decoration: none;
        padding: 4px 8px;
        border-radius: 6px;
        transition: color 0.15s;
    }
    .mobile-top-nav .mob-nav-item.active {
        color: var(--orange-300);
    }
    .mobile-top-nav .mob-nav-item .material-symbols-outlined {
        font-size: 22px;
    }
    /* When top nav is present, offset content down */
    body.has-mobile-nav .main-content {
        padding-top: 56px;
        padding-bottom: 68px;
    }
    body.has-mobile-nav #app {
        grid-template-rows: 1fr auto;
        min-height: 100vh;
    }
    /* Player stays at bottom */
    body.has-mobile-nav .player-bar {
        bottom: 0;
    }

    /* ── Mobile dropdown menu (replaces sidebar overlay) ── */
    .mobile-menu-dropdown {
        display: none;
        position: fixed;
        top: 52px; left: 0; right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-medium);
        z-index: 3001;
        padding: 12px 16px 16px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.5);
        max-height: calc(100vh - 52px);
        overflow-y: auto;
    }
    .mobile-menu-dropdown.open {
        display: block;
    }
    .mobile-menu-dropdown .mob-menu-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
    .mobile-menu-dropdown .mob-menu-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 12px 8px;
        color: var(--text-secondary);
        text-decoration: none;
        border-radius: 8px;
        font-size: 11px;
        transition: all 0.15s;
    }
    .mobile-menu-dropdown .mob-menu-item:active {
        background: var(--bg-elevated);
    }
    .mobile-menu-dropdown .mob-menu-item .material-symbols-outlined {
        font-size: 24px;
        color: var(--text-primary);
    }
    .mobile-menu-dropdown .mob-menu-divider {
        height: 1px;
        background: var(--border-subtle);
        margin: 8px 0;
    }
    .mobile-menu-dropdown .mob-menu-logout {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        color: var(--danger);
        font-size: 13px;
        border-radius: 6px;
        cursor: pointer;
        border: none;
        background: none;
        width: 100%;
    }
    .mobile-menu-dropdown .mob-menu-logout:active {
        background: rgba(248,113,113,0.1);
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Small Phone (max-width: 480px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .page-container { padding: 8px 10px; }
    .page-title { font-size: 17px; }
    .page-subtitle { font-size: 11px; }
    .page-header { margin-bottom: 12px; padding-bottom: 8px; }

    .stat-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .stat-value { font-size: 20px; }
    .stat-label { font-size: 10px; }

    .player-bar { padding: 4px 8px; }
    .player-art { width: 32px; height: 32px; }
    .player-btn-play { width: 30px; height: 30px; }
    .player-btn-play .material-symbols-outlined { font-size: 18px; }
    .player-progress { display: block; } /* keep progress visible */
    .player-controls { gap: 0; }

    .login-logo-img { width: 200px; }
    .login-box { padding: 16px; }

    .album-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }

    /* Favorites rows tighter */
    .fv-song-row { padding: 6px 8px; gap: 6px; }
    .fv-song-row img { width: 40px !important; height: 40px !important; }
    .fv-song-title { font-size: 12px; }
    .fv-song-meta { font-size: 10px; }

    /* Tabs smaller */
    .tab { padding: 6px 10px; font-size: 11px; }
    .tab .material-symbols-outlined { font-size: 14px; }

    /* Cards tighter */
    .card { padding: 10px; }

    /* Section headers */
    .section-header { font-size: 10px; margin-bottom: 8px; }

    /* Buttons */
    .btn { font-size: 12px; padding: 6px 12px; }
    .btn-sm { font-size: 11px; padding: 4px 8px; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Very small (max-width: 360px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
    .page-title { font-size: 15px; }
    .page-container { padding: 6px 8px; }
    .tab { padding: 5px 8px; font-size: 10px; }
    .fv-song-row img { width: 36px !important; height: 36px !important; }
}


/* Mobile menu toggle button (injected by JS when needed) */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 10px; left: 10px;
    z-index: 201;
    width: 40px; height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center; justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.mobile-menu-btn:hover {
    background: var(--bg-surface-alt);
    border-color: var(--orange-300);
}
@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
}
.mobile-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 199;
    transition: opacity 0.3s ease;
}
.mobile-overlay.active { display: block; }

/* Username select dropdown */
select#setup-username {
    width: 100%;
    padding: 10px 12px;
    background: #1a1a2e;
    color: #e0e0e0;
    border: 1px solid #2a2a4a;
    border-radius: 2px;
    font-family: Inter, sans-serif;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27 fill=%27%23888%27%3e%3cpath d=%27M7 10l5 5 5-5z%27/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
}
select#setup-username:focus {
    border-color: #003F7D;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,63,125,0.15), 0 0 12px rgba(0,63,125,0.08);
}
select#setup-username option {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Auth form toggle links */
.form-toggle {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #2a2a4a;
    font-size: 13px;
    color: #888;
}
.form-toggle a {
    color: var(--orange-300);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
    transition: color 0.2s ease;
}
.form-toggle a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════
   JBS STUDIO — Extended Styles (v2 update)
   ═══════════════════════════════════════════════════════════ */

/* ─── LINK RESET (no purple visited) ─── */
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
a:visited { color: inherit; }

/* ─── PLAY OVERLAY ON ALBUM ART ─── */
.album-art .play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 200ms;
}
.album-card:hover .play-overlay { opacity: 1; }
.play-overlay .play-btn {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--orange-300); color: #000;
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer; font-size: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.play-overlay .play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(237,161,46,0.5);
}
.play-overlay .play-btn .material-symbols-outlined { font-size: 28px; }

/* ─── GENRE / PLATFORM BADGES (Discover page) ─── */
.badge-spotify { background: rgba(29,185,84,0.2); color: #1DB954; border: 1px solid rgba(29,185,84,0.15); }
.badge-apple { background: rgba(252,60,68,0.2); color: #FC3C44; border: 1px solid rgba(252,60,68,0.15); }
.genre-chip {
    display: inline-flex; align-items: center;
    height: 36px; padding: 0 16px;
    font-size: 14px; font-weight: 500;
    border-radius: 18px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    cursor: pointer; transition: all 0.2s ease;
}
.genre-chip:hover { border-color: var(--orange-300); background: var(--orange-glow); color: var(--orange-300); }
.genre-chip.active { background: var(--orange-300); color: #000; border-color: var(--orange-300); }

/* ─── TRACK LISTING (expandable area) ─── */
.album-tracks {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    margin-top: 12px;
    padding: 16px;
}
.track-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 8px;
    border-radius: 4px;
    transition: background 0.15s ease;
}
.track-row:hover { background: var(--bg-surface-alt); }
.track-num { width: 28px; text-align: right; color: var(--text-tertiary); font-size: 14px; font-family: var(--font-mono); }
.track-title { flex: 1; font-size: 15px; font-weight: 500; }
.track-duration { font-size: 13px; color: var(--text-tertiary); font-family: var(--font-mono); }
.track-play {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); transition: all 0.2s ease;
}
.track-play:hover { color: var(--orange-300); background: var(--orange-glow); }

/* ─── ANIMATED BACKGROUND PATTERN ─── */
.main-content::before {
    content: '';
    position: fixed;
    top: 0; left: var(--sidebar-w); right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(0,63,125,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(237,161,46,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════ */

/* ─── LYRICS PANEL ─── */
.lyrics-panel {
    position: fixed;
    right: 0;
    bottom: var(--player-h);
    width: 380px;
    max-height: 60vh;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: -4px -4px 24px rgba(0,0,0,0.3);
    z-index: 100;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(16px);
}
.lyrics-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}
.lyrics-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-size: 15px;
    line-height: 2;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}
.lyrics-panel-content .lyrics-line {
    padding: 2px 0;
    transition: color 0.3s, font-size 0.3s;
}
.lyrics-panel-content .lyrics-line.active {
    color: var(--orange-300);
    font-weight: 600;
}
.lyrics-panel-content .lyrics-section-tag {
    color: var(--blue-300);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 12px 0 4px;
    display: block;
}
.lyrics-panel .lyrics-source {
    padding: 8px 16px;
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
    flex-shrink: 0;
}
.player-btn.lyrics-active {
    color: var(--orange-300);
}
@media (max-width: 768px) {
    .lyrics-panel {
        width: 100%;
        max-height: 50vh;
    }
}


/* ═══════════════════════════════════════════════════════════
   MOBILE OVERRIDES — Inline style overrides for JS-rendered content
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Analytics stat grids (inline 4-5 column) */
    [style*="grid-template-columns:repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    [style*="grid-template-columns:repeat(5"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    [style*="grid-template-columns: repeat(5"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Discover result cards — single column */
    [style*="grid-template-columns:repeat(auto-fill"] {
        grid-template-columns: 1fr !important;
    }

    /* UM release header image smaller */
    .ana-um-release img[style*="width:56px"] {
        width: 44px !important;
        height: 44px !important;
    }

    /* Fix large fonts in JS-rendered content */
    [style*="font-size:36px"] { font-size: 20px !important; }
    [style*="font-size:32px"] { font-size: 18px !important; }
    [style*="font-size:28px"] { font-size: 16px !important; }
    [style*="font-size:22px"] { font-size: 16px !important; }

    /* Player fixed at bottom — slim single row */
    .player-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 3000 !important;
    }

    /* Main content: top nav (~52px) + bottom player (~48px) */
    .main-content {
        padding-top: 56px !important;
        padding-bottom: 68px !important;
        min-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Analysis panel */
    .anl-panel {
        bottom: 52px !important;
        max-height: calc(100vh - 110px) !important;
    }

    /* Hide hamburger — top nav replaces it */
    .mobile-menu-btn { display: none !important; }

    /* Mobile overlay for dropdown backdrop */
    .mobile-overlay { z-index: 2998; }
}

@media (max-width: 480px) {
    /* Even tighter stat grids on small phones */
    [style*="grid-template-columns:repeat(4"],
    [style*="grid-template-columns:repeat(5"],
    [style*="grid-template-columns: repeat(4"],
    [style*="grid-template-columns: repeat(5"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Smaller album art throughout */
    [style*="width:56px"][style*="height:56px"] {
        width: 40px !important;
        height: 40px !important;
    }

    /* Even smaller fonts */
    [style*="font-size:22px"] { font-size: 15px !important; }
    [style*="font-size:20px"] { font-size: 14px !important; }
}


@media print {
    .sidebar,
    .player-bar,
    .mobile-menu-btn,
    .mobile-overlay,
    .btn,
    .search-bar,
    .chip-group,
    .nav-item,
    .player-controls,
    .player-extra {
        display: none !important;
    }
    #app {
        display: block;
        grid-template-columns: 1fr;
    }
    html, body {
        background: #fff;
        color: #000;
        overflow: visible;
    }
    .main-content {
        background: #fff;
        overflow: visible;
    }
    .main-content::before,
    .main-content::after {
        display: none;
    }
    .page-container {
        padding: 0;
        max-width: 100%;
    }
    .card {
        background: #fff;
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }
    .card::before { display: none; }
    .stat-tile {
        background: #fff;
        border: 1px solid #ccc;
    }
    .stat-tile::before,
    .stat-tile::after { display: none; }
    .stat-value { color: #000; text-shadow: none; }
    .data-table th { background: #f0f0f0; color: #333; }
    .data-table td { color: #000; }
    .page-title { color: #000; }
    .page-header { border-image: none; border-bottom-color: #ccc; }
    a { color: #000 !important; }
}
