/* ═══════════════════════════════════════════════════════════
   🎵 Cyle Music — Design System
   Futuristic dark mode, cyan/violet neon, glassmorphism
   ═══════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────── */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f2a;
    --bg-card: rgba(15, 15, 42, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.07);
    --bg-input: rgba(255, 255, 255, 0.05);

    --text-primary: #e8eaf0;
    --text-secondary: #8b8da8;
    --text-muted: #555570;

    --accent: #00E5FF;
    --accent-hover: #33EBFF;
    --accent-glow: rgba(0, 229, 255, 0.25);
    --accent-soft: rgba(0, 229, 255, 0.1);

    --accent2: #7B2FFF;
    --accent2-glow: rgba(123, 47, 255, 0.25);

    --gradient: linear-gradient(135deg, var(--accent), var(--accent2));

    --success: #4ade80;
    --warning: #fbbf24;
    --error: #f87171;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(0, 229, 255, 0.2);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(0, 229, 255, 0.15);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* ─── Reset & Base ──────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    min-height: calc(100% + env(safe-area-inset-top));
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

body {
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    margin: 0;
}

/* ─── Edge Swipe Back Halo ─── */
.edge-swipe-halo {
    position: fixed;
    left: 0;
    top: 0;
    width: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(
        90deg,
        rgba(0, 229, 255, 0.6) 0%,
        rgba(100, 80, 255, 0.3) 40%,
        transparent 100%
    );
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.4), 0 0 80px rgba(100, 80, 255, 0.2);
}

/* Allow text selection in inputs on iOS */
input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

::selection {
    background: var(--accent-soft);
    color: var(--accent);
}

::-webkit-scrollbar {
    width: 14px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 4px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* ─── Screen System ─────────────────────────────────────── */
.screen {
    display: none;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════
   LOADING SCREEN
   ═══════════════════════════════════════════════════════════ */
#loading-screen {
    background: var(--bg-primary);
    align-items: center;
    justify-content: center;
}

.loading-container {
    text-align: center;
}

.loading-icon {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    margin-bottom: 1.5rem;
}

.loading-text {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
}

.loading-bar {
    width: 200px;
    height: 3px;
    background: var(--bg-glass);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 40%;
    background: var(--gradient);
    border-radius: 2px;
    animation: loadingSlide 1.2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════ */
#login-screen {
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(123, 47, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 229, 255, 0.04) 0%, transparent 40%);
}

.login-overlay {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-container {
    width: 100%;
    max-width: 380px;
    padding: 2.5rem 2rem;
    background: rgba(15, 15, 42, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow), var(--shadow-glow);
    animation: fadeInUp 0.6s ease-out;
}

.login-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.input-group input[type="text"],
.input-group input[type="password"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: var(--font);
    transition: var(--transition);
    outline: none;
}

.input-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.checkbox-group {
    flex-direction: row;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-ghost:hover {
    color: var(--accent);
    background: var(--bg-glass);
}

.btn-full {
    width: 100%;
}

.error-message {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--error);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   INSTALL PROMPT SCREEN
   ═══════════════════════════════════════════════════════════ */
#install-screen {
    background: var(--bg-primary);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.install-container {
    max-width: 420px;
    text-align: center;
}

.install-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 1.5rem;
}

.install-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.install-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

.install-instructions {
    text-align: left;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.install-instructions h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.install-instructions ol {
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.install-instructions p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   APP — HEADER (compact)
   ═══════════════════════════════════════════════════════════ */
.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.15rem 0.8rem;
    padding-top: calc(env(safe-area-inset-top, 0px) - 15px);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.player-header.hidden {
    transform: translateY(-100%);
}

.header-title {
    font-size: 0.95rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.3rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}

.header-icon-btn svg {
    width: 26px;
    height: 26px;
}

.header-icon-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════
   SIDE MENU (hamburger)
   ═══════════════════════════════════════════════════════════ */
.side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.side-menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.side-menu {
    position: fixed;
    top: 80px;
    left: 16px;
    width: 200px;
    background: rgba(30, 30, 60, 0.3);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    z-index: 301;
    transform: scale(0.8) translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.side-menu.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.side-menu-header {
    display: none;
}

.side-menu-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.side-menu-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3rem;
}

.side-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 10px;
    transition: var(--transition);
    text-align: left;
}

.side-menu-item:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════
   APP — CONTENT AREA
   ═══════════════════════════════════════════════════════════ */
.player-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    padding-top: calc(3rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(2rem + var(--safe-bottom));
}

/* ─── Back Button ─────────────────────────────────────── */
.back-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.4rem 0.9rem;
    color: var(--accent);
    font-size: 0.85rem;
    font-family: var(--font);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
}

/* ─── Section Titles ───────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-more {
    font-size: 0.8rem;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
}

/* ─── Horizontal Scroll Cards ──────────────────────────── */
.h-scroll {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.h-scroll::-webkit-scrollbar {
    display: none;
}

/* ─── Album / Playlist Card ───────────────────────────── */
.card {
    flex-shrink: 0;
    width: 140px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
}

.card-cover {
    width: 140px;
    height: 140px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    position: relative;
    box-shadow: var(--shadow);
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-cover .cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-muted);
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
}

.card-title {
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Song Row ─────────────────────────────────────────── */
.song-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
    margin-bottom: 0.25rem;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.song-row:hover {
    background: var(--bg-glass-hover);
}

.song-row.active {
    background: var(--accent-soft);
}

.song-cover {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-card);
}

.song-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-info {
    flex: 1;
    min-width: 0;
    max-width: 70%;
}

.song-title {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    gap: 0.1rem;
}

.song-actions-btns {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.song-duration {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .song-actions {
        flex-direction: row-reverse;
        align-items: center;
        gap: 0.3rem;
    }
}

/* ─── Song Row Buttons ─────────────────────────────────── */
.song-fav-btn, .song-add-pl-btn, .song-queue-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.3rem;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    transition: var(--transition);
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* Force clicks on SVG children to target the parent button (Safari fix) */
.song-fav-btn svg, .song-add-pl-btn svg, .song-queue-btn svg,
.song-fav-btn svg *, .song-add-pl-btn svg *, .song-queue-btn svg * {
    pointer-events: none;
}

.song-fav-btn.active { color: #7b5cff; }
.song-fav-btn:hover { color: #7b5cff; }

.song-add-pl-btn:hover { color: var(--text-light); }

.song-queue-btn:hover { color: var(--accent); }

/* ─── Playlist Picker Popup ────────────────────────────── */
.playlist-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
}

.playlist-picker {
    position: fixed;
    z-index: 501;
    min-width: 200px;
    max-height: 250px;
    overflow-y: auto;
    background: rgba(30, 30, 60, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
}

.playlist-picker-title {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.25rem;
}

.playlist-picker-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.playlist-picker-item {
    background: none;
    border: none;
    color: var(--text-light);
    padding: 0.8rem 1rem;
    text-align: left;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.playlist-picker-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ─── Context Menu Popup ───────────────────────────────── */
.context-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.3);
}

.context-menu {
    position: fixed;
    z-index: 501;
    min-width: 200px;
    background: rgba(30, 30, 60, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.4rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: ctxFadeIn 0.15s ease;
}

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

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.context-menu-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ─── Heart (favorites) on now-playing ─────────────────── */
.np-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 0.5rem;
}

.np-heart-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.np-heart-btn svg {
    width: 28px;
    height: 28px;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.np-heart-btn.starred svg {
    fill: #ff4d6a;
    stroke: #ff4d6a;
}

.np-heart-btn:not(.starred) svg {
    fill: none;
    stroke: var(--text-secondary);
}

.np-heart-btn:active {
    transform: scale(1.3);
}

/* ═══════════════════════════════════════════════════════════
   DYNAMIC ISLANDS (Bottom Navigation & Mini Player)
   ═══════════════════════════════════════════════════════════ */
.bottom-islands {
    position: fixed;
    bottom: calc(16px + var(--safe-bottom));
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 200;
    pointer-events: none; /* Let clicks pass through empty space */
}

/* Base Pill Style shared by both islands */
.island-pill {
    background: rgba(30, 30, 50, 0.35); /* More transparent base for the liquid effect */
    backdrop-filter: blur(35px) saturate(250%);
    -webkit-backdrop-filter: blur(35px) saturate(250%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.35rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto; /* Re-enable clicks inside pills */
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 54px; /* Fixed height for uniformity */
}

/* Scroll state: smaller and more transparent */
.bottom-islands.scrolled .island-pill {
    background: rgba(20, 20, 35, 0.15);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(6px) scale(0.92);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

/* --- Left Island: Mini Player (Dynamic width) --- */
.mini-player-island {
    position: relative;
    cursor: pointer;
    justify-content: space-between;
    /* Collapsed width (play button only basically) */
    width: 54px; 
    padding: 0;
    gap: 0;
    flex-shrink: 1;
}

.mini-player-island.expanded {
    /* Auto width based on content but max constrained by screen */
    width: auto;
    max-width: calc(100% - 70px - 1rem); /* Space for right island + gap */
    padding: 0.2rem 0.6rem;
    padding-top: 0.5rem; /* Extra space for seekbar */
    gap: 0.5rem;
    flex-grow: 1;
}

/* Seekbar at top of mini player bubble */
.island-seekbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    opacity: 0;
    cursor: default;
    z-index: 5;
    transition: opacity 0.3s, height 0.2s;
}
.mini-player-island.expanded .island-seekbar {
    opacity: 1;
    cursor: pointer;
    /* Larger touch target */
    height: 4px;
    padding-top: 6px;
    padding-bottom: 6px;
    margin-top: -6px;
    background: transparent;
}
.island-seekbar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: none;
    box-shadow: 0 0 6px var(--accent);
}
/* Thin background track visible only when expanded */
.mini-player-island.expanded .island-seekbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 20px 20px 0 0;
}

/* The cover has been removed from the mini-player in v2 */

.island-info {
    flex: 1;
    min-width: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
}

.mini-player-island.expanded .island-info {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.4s ease forwards;
}

.island-title {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.island-artist {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.island-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    height: 100%;
    width: 100%;
}

.mini-player-island.expanded .island-controls {
    width: auto;
}

.island-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

.island-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.island-play {
    width: 46px; 
    height: 46px;
    border-radius: 50%;
    color: white;
}

/* Histogram (playing indicator) when collapsed */
.island-histogram {
    display: none;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 18px;
    width: 24px;
    margin: 0 auto;
}

.hist-bar {
    width: 4px;
    background-color: var(--accent);
    border-radius: 2px;
    animation: hist-bounce 0.8s infinite alternate ease-in-out;
}

.hist-bar:nth-child(1) { animation-delay: 0.1s; height: 30%; }
.hist-bar:nth-child(2) { animation-delay: 0.4s; height: 80%; }
.hist-bar:nth-child(3) { animation-delay: 0.2s; height: 50%; }

@keyframes hist-bounce {
    0% { height: 20%; }
    100% { height: 100%; }
}

/* Pause state for histogram */
.mini-player-island.paused .hist-bar {
    animation-play-state: paused;
    height: 20%;
}

/* Toggle visibility between Play Btn and Histogram based on expansion */
.mini-player-island:not(.expanded) .island-play {
    display: none !important;
}
.mini-player-island:not(.expanded) .island-histogram {
    display: flex;
}
/* When expanded, show play btn, hide histogram */
.mini-player-island.expanded .island-histogram {
    display: none !important;
}
.mini-player-island.expanded .island-play {
    display: flex;
}

.island-heart,
.island-next,
.island-menu {
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.mini-player-island.expanded .island-heart,
.mini-player-island.expanded .island-next,
.mini-player-island.expanded .island-menu {
    width: 32px;
    opacity: 1;
    margin: 0 0.1rem;
}

.island-heart {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.island-heart.starred {
    fill: var(--accent);
    stroke: var(--accent);
}

.island-btn:hover {
    transform: scale(1.1);
}

.island-play:active {
    transform: scale(0.9);
}


/* --- Right Island: Navigation (Collapsible) --- */
.bottom-nav {
    display: flex;
    justify-content: flex-end; /* Align contents to the right */
    align-items: center;
    width: 54px; /* Icon-only initially */
    margin-left: auto; /* Push to the exact right edge of space-between */
    flex-shrink: 0;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), padding 0.4s ease, margin 0.4s ease;
}

/* Expanded state takes full remaining space minus mini-player gap */
.bottom-nav.expanded {
    width: calc(100% - 70px - 1rem); /* Explicit width instead of flex-grow ensures right-anchored expansion */
    justify-content: space-around; /* Distribute icons */
    padding: 0.3rem 0.5rem;
}

/* If the mini player is NOT expanded (i.e nothing is playing), the nav can take full width */
.bottom-islands:not(.player-active) .bottom-nav.expanded {
    width: 100%;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.4rem 0.6rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font);
    cursor: pointer;
    transition: color 0.15s ease, opacity 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

/* Hide non-active buttons when collapsed to pill */
.bottom-nav:not(.expanded) .nav-btn,
.bottom-nav.pill-mode .nav-btn {
    display: none;
}

.bottom-nav:not(.expanded) .nav-btn.active,
.bottom-nav.pill-mode .nav-btn.active {
    display: flex;
    padding: 0;
    margin: auto;
}

/* Always show Home button so user can navigate back from any screen */
.bottom-nav:not(.expanded) .nav-btn[data-screen="home"],
.bottom-nav.pill-mode .nav-btn[data-screen="home"] {
    display: flex;
    padding: 0;
}

/* Show all when expanded AND no mini-player taking space */
.bottom-nav.expanded:not(.pill-mode) .nav-btn {
    display: flex;
    flex: 1;
}

/* Hide labels when mini player takes over or fully collapsed */
.bottom-nav:not(.expanded) .nav-label,
.mini-player-island.expanded + .bottom-nav .nav-label,
.bottom-nav.pill-mode .nav-label {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

.nav-btn.active { color: var(--accent); }

.nav-icon { line-height: 1; }
.nav-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-btn.active .nav-icon svg {
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 0;
}

.nav-label {
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    opacity: 1;
    max-height: 1rem;
    transition: opacity 0.2s ease, max-height 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════
   NOW PLAYING — FULL SCREEN
   ═══════════════════════════════════════════════════════════ */
.now-playing {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    height: 100%;
}

.np-cover {
    width: min(80vw, 320px);
    height: min(80vw, 320px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), var(--shadow-glow);
    margin-bottom: 2rem;
    background: var(--bg-card);
}

.np-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.np-info {
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.np-title {
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-artist {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.np-album {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Progress Bar */
.np-progress {
    width: 100%;
    margin-bottom: 0.3rem;
}

.np-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-glass);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.np-progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s linear;
    position: relative;
}

.np-progress-fill.seeking {
    transition: none !important;
}

.np-progress-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-glow);
    opacity: 0;
    transition: opacity var(--transition);
}

.np-progress-bar:hover .np-progress-fill::after {
    opacity: 1;
}

.np-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* Controls */
.np-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.np-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: var(--transition);
    border-radius: 50%;
}

.np-btn:hover {
    color: var(--text-primary);
}

.np-btn.active {
    color: var(--accent);
}

.np-play-btn {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--accent-glow);
    transition: var(--transition);
}

.np-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px var(--accent-glow);
}

.np-quality {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ─── 🔗 Mobile Device Section (Now Playing) ─── */
.np-devices {
    margin-top: 0.8rem;
    padding: 0 0.5rem;
}

.np-devices-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem;
    margin-top: 0.8rem;
}

.np-devices-header-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.np-devices-icon {
    font-size: 0.8rem;
}

.np-devices-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.np-devices-count {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ─── Remote Device Card ─── */
.np-remote-device {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    margin-top: 0.4rem;
    transition: all var(--transition);
}

.np-remote-device.active {
    background: rgba(0, 229, 255, 0.04);
    border-color: rgba(0, 229, 255, 0.15);
}

.np-remote-device-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.np-remote-device-icon {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.np-remote-device-name {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-remote-transfer-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    line-height: 1;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.np-remote-transfer-btn:active {
    background: rgba(0, 229, 255, 0.15);
    border-color: var(--accent);
    transform: scale(1.1);
}

/* ─── Remote Now Playing Info ─── */
.np-remote-now-playing {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.3rem 0;
}

.np-remote-cover {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.np-remote-track-info {
    flex: 1;
    min-width: 0;
}

.np-remote-track-title {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-remote-track-artist {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Remote Playback Controls ─── */
.np-remote-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.4rem 0 0.2rem;
}

.np-remote-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.np-remote-btn:active {
    color: var(--accent);
    transform: scale(1.15);
}

.np-remote-play-btn {
    width: 40px;
    height: 40px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 50%;
}

.np-remote-play-btn:active {
    background: var(--accent);
    color: var(--bg-primary);
    transform: scale(1.08);
}

/* ═══════════════════════════════════════════════════════════
   NOW PLAYING — MOBILE SWIPE UI
   ═══════════════════════════════════════════════════════════ */

/* Scroll container — natural continuous scroll, vertical only */
.np-swipe-container {
    height: calc(100vh - 3rem);
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.np-swipe-container::-webkit-scrollbar { display: none; }

/* Sections flow naturally */
.np-section {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
}

.np-section-current {
    min-height: calc(100vh - 3rem);
    justify-content: center;
    align-items: center;
    padding: 0;
}

.np-section-current .now-playing {
    height: auto;
}

.np-section-previous {
    justify-content: flex-end;
    padding: 0.5rem 0.5rem 0;
}

.np-section-queue {
    justify-content: flex-start;
    padding-top: 0.5rem;
    padding-bottom: 6rem;
}

.np-section-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem 0.8rem 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ─── Swipe Hints (subtle) ─── */
.np-swipe-hint {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.4rem;
    opacity: 0.5;
}

.np-swipe-hint span {
    display: inline-block;
    animation: hintBounce 1.5s infinite;
}

.np-swipe-hint-up span {
    animation-name: hintBounceUp;
}

@keyframes hintBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

@keyframes hintBounceUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ─── Track List ─── */
.np-track-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0 0.3rem;
}

/* ─── Track Card (swipable) ─── */
.np-track-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.np-card-content {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem;
    background: var(--bg-card);
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-tap-highlight-color: transparent;
}

.np-card-cover {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-glass);
}

.np-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.np-card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

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

.np-card-title {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-card-artist {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-card-dur {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ─── Hidden Actions (revealed by swipe) ─── */
.np-card-actions {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0 0.8rem;
    z-index: 1;
}

.np-card-actions-left {
    left: 0;
    background: linear-gradient(90deg, var(--accent) 80%, transparent);
}

.np-card-actions-right {
    right: 0;
    background: linear-gradient(270deg, rgba(100, 120, 255, 0.9) 80%, transparent);
}

.np-card-action {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.np-card-action svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.np-card-star.active svg {
    fill: white;
}

.np-card-remove svg {
    stroke-width: 2.5;
}

/* Show actions when swiping */
.np-track-card.swiping-right .np-card-actions-left .np-card-action {
    opacity: 1;
}

.np-track-card.swiping-left .np-card-actions-right .np-card-action {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   SEARCH
   ═══════════════════════════════════════════════════════════ */
.search-container {
    padding: 0 0.5rem;
}

.search-quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.search-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.search-quick-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0 1rem;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: var(--font);
    outline: none;
}

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

.search-icon {
    font-size: 1rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-results-section {
    margin-bottom: 1.5rem;
}

.search-results-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════════════ */
.settings-section {
    margin-bottom: 1.5rem;
}

.settings-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
}

.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.settings-option:hover {
    border-color: var(--border-hover);
}

.settings-option.active {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.settings-option-label {
    font-size: 0.9rem;
}

.settings-option-value {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.settings-option .check {
    color: var(--accent);
    font-size: 1.1rem;
    display: none;
}

.settings-option.active .check {
    display: inline;
}

/* Crossfade slider */
.crossfade-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--surface-elevated, #333);
    outline: none;
    cursor: pointer;
}

.crossfade-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}

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

.crossfade-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.crossfade-slider::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: var(--surface-elevated, #333);
}

.settings-logout {
    margin-top: 2rem;
    width: 100%;
    padding: 0.85rem;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
}

.settings-logout:hover {
    background: rgba(248, 113, 113, 0.2);
}

/* ─── Queue ─────────────────────────────────────────────── */
.queue-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.queue-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.queue-empty-text {
    font-size: 0.95rem;
}

/* ─── Album Detail ──────────────────────────────────────── */
.album-detail-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}

.album-detail-cover {
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    background: var(--bg-card);
}

.album-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-detail-info {
    min-width: 0;
}

.album-detail-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.album-detail-artist {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.album-detail-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.album-play-all {
    margin-bottom: 1rem;
}

/* ─── Responsive ────────────────────────────────────────── */
/* Responsive breakpoints moved to player-web.css */

/* ─── Clickable Links (artist/album) ───────────────────── */
.clickable-link {
    color: inherit;
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
}

.clickable-link:hover {
    color: var(--accent);
}

.clickable-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.2s ease;
}

.clickable-link:hover::after {
    width: 100%;
}

/* ─── Artist Detail ────────────────────────────────────── */
.artist-detail-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.artist-detail-cover {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    background: var(--bg-card);
}

.artist-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-detail-name {
    font-size: 1.3rem;
    font-weight: 700;
}

.artist-detail-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ─── Playlist Detail ──────────────────────────────────── */
.playlist-detail-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.playlist-detail-cover {
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    flex-shrink: 0;
    background: var(--bg-card);
}

.playlist-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-detail-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.playlist-detail-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.playlist-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.15);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-icon-sm {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1;
    transition: all var(--transition);
}

.btn-icon-sm:hover {
    background: var(--bg-glass-hover);
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── Playlists Grid ───────────────────────────────────── */
.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

/* ─── Playlist Header Bar ──────────────────────────────── */
.playlist-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ─── Playlist Tabs ────────────────────────────────────── */
.playlist-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: var(--bg-card);
    border-radius: 999px;
    width: fit-content;
}

.playlist-tab {
    padding: 0.45rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 999px;
    transition: all var(--transition);
    white-space: nowrap;
}

.playlist-tab.active {
    background: var(--accent);
    color: #fff;
}

.playlist-tab:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Pétunia badge */
.petunia-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 1rem;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.card-cover {
    position: relative;
}

/* ═══════════════════════════════════════════════════════════
   MODAL SYSTEM
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: auto;
    /* Explicitly allow interaction on iOS */
    -webkit-tap-highlight-color: transparent;
}
.modal-overlay.active { opacity: 1; }

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    min-width: 320px;
    max-width: 420px;
    width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.2s ease;
    pointer-events: auto;
}
.modal-overlay.active .modal-box { transform: scale(1); }

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.modal-message {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.modal-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    outline: none;
    margin-bottom: 1rem;
    box-sizing: border-box;
    /* Explicitly allow interaction on iOS */
    user-select: text;
    -webkit-user-select: text;
    pointer-events: auto;
}
.modal-input:focus { border-color: var(--accent); }

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition);
}

.modal-cancel {
    background: transparent;
    color: var(--text-secondary);
}
.modal-cancel:hover { color: var(--text-primary); }

.modal-confirm {
    background: var(--accent);
    color: #fff;
}
.modal-confirm:hover { filter: brightness(1.15); }

.modal-confirm.danger {
    background: #e74c3c;
}
.modal-confirm.danger:hover { background: #c0392b; }

/* ═══════════════════════════════════════════════════════════
   PLAYLIST CREATE BUTTON
   ═══════════════════════════════════════════════════════════ */
.playlist-create-btn {
    padding: 0.4rem 0.9rem;
    border: 1.5px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.playlist-create-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   PLAYLIST CARD MENU (⋮ button)
   ═══════════════════════════════════════════════════════════ */
.playlist-card-menu {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    z-index: 2;
}
.card:hover .playlist-card-menu,
.grid-card:hover .playlist-card-menu,
.song-row:hover .playlist-card-menu { opacity: 1; }
.playlist-card-menu:hover { background: rgba(0, 0, 0, 0.8); }

/* In list view, position statically */
.song-duration .playlist-card-menu {
    position: static;
    opacity: 0.5;
    background: transparent;
    color: var(--text-secondary);
}
.song-row:hover .song-duration .playlist-card-menu { opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   PLAYLIST CONTEXT MENU
   ═══════════════════════════════════════════════════════════ */
.playlist-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 8999;
}

.playlist-context-menu {
    z-index: 9000;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.35rem;
    min-width: 180px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.playlist-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-align: left;
}
.playlist-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}
.playlist-menu-item.danger { color: #e74c3c; }
.playlist-menu-item.danger:hover { background: rgba(231, 76, 60, 0.1); }

/* ─── Song Sections (2-col desktop) ────────────────────── */
.song-cover {
    transition: transform 0.15s ease;
}

.song-cover:hover {
    transform: scale(1.05);
}

/* ─── View Toggle (per-section header) ─────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.view-toggle {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
}

.view-toggle-btn {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem;
    cursor: pointer;
    opacity: 0.4;
    transition: all var(--transition);
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.view-toggle-btn.active {
    opacity: 1;
    border-color: var(--accent);
    background: rgba(0, 210, 255, 0.1);
}

.view-toggle-btn:hover {
    opacity: 0.85;
}

/* ─── Grid View (compact tiles) ────────────────────────── */
.section-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.grid-card {
    cursor: pointer;
    text-align: center;
    transition: transform 0.15s ease;
}

.grid-card:hover {
    transform: scale(1.04);
}

.grid-card-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.grid-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-card-title {
    font-size: 0.7rem;
    margin-top: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

/* ─── Settings: Home Sections ──────────────────────────── */
.home-section-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 0.4rem;
    transition: opacity var(--transition);
}

.home-section-row.disabled {
    opacity: 0.45;
}

/* Drag handle */
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: var(--text-muted);
    padding: 0.3rem;
    border-radius: 4px;
    transition: color var(--transition), background var(--transition);
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
}

.drag-handle:hover {
    color: var(--accent);
    background: rgba(0, 210, 255, 0.08);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Dragging state */
.home-section-row.dragging {
    position: fixed;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: scale(1.02);
    opacity: 0.95;
    pointer-events: none;
}

/* Placeholder */
.drag-placeholder {
    background: rgba(0, 210, 255, 0.06);
    border: 2px dashed rgba(0, 210, 255, 0.25);
    border-radius: var(--radius);
    margin-bottom: 0.4rem;
    transition: height 0.15s ease;
}

.home-section-row-info {
    flex: 1;
    min-width: 0;
}

.home-section-row-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.home-section-row-mode {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 20px;
    transition: background var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATION
   ═══════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 30, 60, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-family: var(--font);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════
   PÉTUNIA SCREEN
   ═══════════════════════════════════════════════════════════ */
.petunia-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
    padding-top: 0.5rem;
}

@media (min-width: 1024px) {
    .petunia-tabs {
        display: none;
    }
}

.petunia-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 0.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.petunia-tab svg {
    fill: currentColor;
    flex-shrink: 0;
}

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

.petunia-tab:hover {
    color: var(--text-light);
}

/* Hero */
.petunia-hero {
    text-align: center;
    padding: 1.5rem 1rem;
}

.petunia-hero-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.petunia-hero h2 {
    font-size: 1.3rem;
    margin: 0 0 0.3rem;
}

.petunia-hero-sub {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Status card */
.petunia-status-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 0 0 1.5rem;
}

.petunia-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.petunia-status-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

/* Section */
.petunia-section h3 {
    font-size: 0.9rem;
    margin: 0 0 0.7rem;
}

/* Search */
.petunia-search-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
}

.petunia-search-bar svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.petunia-search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
}

.petunia-search-bar input::placeholder {
    color: var(--text-muted);
}

/* Results */
.petunia-result-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.3rem;
    transition: var(--transition);
}

.petunia-result-row:hover {
    background: var(--bg-glass-hover);
}

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

.petunia-result-title {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.petunia-result-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.petunia-dl-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0.3rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.petunia-dl-btn:hover {
    color: var(--text-light);
}

/* Requests */
.petunia-requests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
}

.petunia-requests-header h3 {
    margin: 0;
    font-size: 0.95rem;
}

.petunia-refresh-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    transition: var(--transition);
}

.petunia-refresh-btn:hover {
    color: var(--accent);
}

.petunia-request-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.3rem;
}

.petunia-request-status {
    font-size: 1.1rem;
    flex-shrink: 0;
}

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

.petunia-request-title {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.petunia-request-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* States */
.petunia-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.petunia-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.petunia-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 22px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
    background: white;
}

/* ═══════════════════════════════════════════════════════════
   🌸 MusicBrainz Search — Album Grid, Tracklist, DL
   ═══════════════════════════════════════════════════════════ */

.mb-section {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 1rem;
}

/* Collapsible local results */
.search-local-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.2rem;
}
.search-local-toggle {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    transition: var(--transition);
    opacity: 0.7;
}
.search-local-toggle:hover {
    opacity: 1;
    background: var(--bg-glass-hover);
}

.mb-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mb-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.mb-back-btn {
    background: var(--bg-glass);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-primary);
    padding: 0.4rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.mb-back-btn:hover {
    background: var(--bg-glass-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.mb-loading, .mb-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-results-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.3rem 0;
    margin-top: 0.5rem;
}

/* ─── Artist List ─── */

.mb-artist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}
.mb-artist-row:hover {
    background: var(--bg-glass-hover);
}

.mb-results-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: 0.8rem 0.8rem 0.3rem;
}

.mb-release-row {
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
}
.mb-release-row:hover {
    background: var(--bg-glass-hover);
}
.mb-release-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}
.mb-release-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mb-artist-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.mb-artist-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.15rem;
}

.mb-artist-disambig {
    color: var(--text-secondary);
    font-style: italic;
}

.mb-artist-score {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 2rem;
    text-align: right;
}

/* ─── Albums Grid ─── */

.mb-albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 0.25rem 0;
}

@media (max-width: 480px) {
    .mb-albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
}

.mb-album-card {
    background: var(--bg-glass);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
}
.mb-album-card:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255,255,255,0.08);
    transform: translateY(-2px);
}
.mb-album-card.owned {
    border-color: rgba(74, 222, 128, 0.3);
}

/* Availability borders — neon glow */
.mb-album-card.avail-searching {
    border: 2px solid rgba(250, 204, 21, 0.6);
    animation: avail-pulse 1.5s ease-in-out infinite;
}
.mb-album-card.avail-downloadable {
    border: 2px solid rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.4),
                0 0 14px rgba(59, 130, 246, 0.2),
                inset 0 0 6px rgba(59, 130, 246, 0.1);
}
.mb-album-card.avail-waitlist {
    border: 2px solid rgba(251, 146, 60, 0.6);
    box-shadow: 0 0 6px rgba(251, 146, 60, 0.2);
}
@keyframes avail-pulse {
    0%, 100% {
        border-color: rgba(250, 204, 21, 0.3);
        box-shadow: 0 0 4px rgba(250, 204, 21, 0.1);
    }
    50% {
        border-color: rgba(250, 204, 21, 0.8);
        box-shadow: 0 0 10px rgba(250, 204, 21, 0.3),
                    0 0 20px rgba(250, 204, 21, 0.15);
    }
}

/* Small status dots row at card bottom */
.mb-avail-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    font-size: 0.65rem;
    color: var(--text-tertiary);
}
.mb-avail-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.mb-avail-dots .dot.searching {
    background: rgba(234, 179, 8, 0.6);
    animation: dot-pulse 1s ease-in-out infinite;
}
.mb-avail-dots .dot.exact { background: #22c55e; }
.mb-avail-dots .dot.partial { background: #fb923c; }
.mb-avail-dots .dot.none { background: #ef4444; opacity: 0.5; }
@keyframes dot-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.mb-album-cover {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}
.mb-album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mb-cover-placeholder {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.mb-owned-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.mb-album-info {
    padding: 0.5rem 0.6rem 0.3rem;
}

.mb-album-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mb-album-year {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.mb-avail-badge {
    font-size: 0.65rem;
    margin-top: 0.2rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.mb-avail-badge.available {
    color: var(--success);
}
.mb-avail-badge.unavailable {
    color: var(--text-muted);
    opacity: 0.6;
}

.mb-avail-slsk {
    font-size: 0.65rem;
    margin-top: 0.1rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.mb-avail-slsk.available {
    color: var(--accent2, #7B2FFF);
}
.mb-avail-slsk.unavailable {
    color: var(--text-muted);
    opacity: 0.5;
}

.mb-album-actions {
    padding: 0.3rem 0.6rem 0.5rem;
}

.mb-dl-btn {
    background: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
}
.mb-dl-btn:hover:not(:disabled) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}
.mb-dl-btn.owned {
    color: var(--success);
    border-color: rgba(74, 222, 128, 0.2);
    background: rgba(74, 222, 128, 0.05);
    cursor: default;
}

/* ─── Tracklist View ─── */

.mb-track-header {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0 1rem;
    align-items: flex-start;
}

.mb-track-cover {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
    position: relative;
}
.mb-track-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 480px) {
    .mb-track-cover {
        width: 80px;
        height: 80px;
    }
}

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

.mb-track-album-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mb-track-artist {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.mb-track-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.mb-track-owned {
    color: var(--success);
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.mb-dl-album-btn {
    background: var(--gradient);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: var(--transition);
}
.mb-dl-album-btn:hover:not(:disabled) {
    opacity: 0.85;
    transform: scale(1.02);
}
.mb-dl-album-btn:disabled {
    opacity: 0.6;
    cursor: default;
}
.mb-dl-album-btn.owned {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
}

.mb-tracklist {
    border-top: 1px solid rgba(255,255,255,0.06);
}

.mb-track-row {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.3rem;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: var(--transition);
}
.mb-track-row:hover {
    background: var(--bg-glass);
}

.mb-track-num {
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 1.8rem;
    text-align: right;
    flex-shrink: 0;
}

.mb-track-name {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mb-track-dur {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.mb-track-dl-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    font-size: 0.7rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}
.mb-track-dl-btn:hover:not(:disabled) {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}
.mb-track-dl-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ═══════════════════════════════════════════════════════════
   🌸 Pétunia — Chat & Download Status
   ═══════════════════════════════════════════════════════════ */

/* Chat container */
.petunia-chat {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    min-height: 300px;
}

.petunia-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.petunia-chat-welcome {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}
.petunia-chat-welcome-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}
.petunia-chat-welcome h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.petunia-chat-welcome p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Messages */
.petunia-chat-msg {
    display: flex;
    gap: 0.5rem;
    max-width: 90%;
    animation: fadeInUp 0.2s ease;
}
.petunia-chat-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.petunia-chat-bot {
    align-self: flex-start;
}

.petunia-chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: var(--bg-glass);
}

.petunia-chat-bubble {
    padding: 0.6rem 0.9rem;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
}
.petunia-chat-user .petunia-chat-bubble {
    background: var(--accent);
    color: #000;
    border-bottom-right-radius: 4px;
}
.petunia-chat-bot .petunia-chat-bubble {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}
.petunia-chat-bot .petunia-chat-bubble code {
    background: rgba(0,0,0,0.3);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* Typing indicator */
.petunia-chat-typing {
    padding: 0.5rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.petunia-typing-dots {
    display: flex;
    gap: 4px;
}
.petunia-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: petuniaTyping 1.4s infinite ease-in-out;
}
.petunia-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.petunia-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes petuniaTyping {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Chat form */
.petunia-chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255,255,255,0.05);
}
.petunia-chat-form input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    color: var(--text-primary);
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    outline: none;
}
.petunia-chat-form input:focus {
    border-color: var(--accent);
}
.petunia-chat-send {
    background: var(--gradient);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.petunia-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
}
.petunia-chat-send:disabled {
    opacity: 0.5;
}

/* Download Status */
.petunia-requests {
    padding: 0.5rem 0;
}
.petunia-requests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem 0.5rem;
}
.petunia-requests-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.petunia-refresh-btn {
    background: var(--bg-glass);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary);
    padding: 0.35rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: var(--transition);
}
.petunia-refresh-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.petunia-history-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem 0.5rem 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 0.5rem;
}

.petunia-dl-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.petunia-dl-loading, .petunia-dl-empty {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.petunia-dl-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    transition: var(--transition);
}
.petunia-dl-row:hover {
    background: var(--bg-glass);
}

.petunia-dl-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.petunia-dl-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}
.petunia-dl-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.petunia-dl-complete .petunia-dl-title { color: var(--success); }
.petunia-dl-failed .petunia-dl-title { color: var(--error, #f87171); }