        :root {
            --bg: #0a0a0a;
            --bg-card: #141414;
            --text: #f0ede8;
            --text-muted: #7a7670;
            --text-dim: #4a4640;
            --accent: #e8dcc8;
            --accent-warm: #c9a96e;
            --border: #1e1e1e;
            --radius: 6px;
            --safe-top: env(safe-area-inset-top, 0px);
            --safe-bottom: env(safe-area-inset-bottom, 0px);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
            -webkit-touch-callout: none;
        }

        html, body {
            height: 100%;
            overflow: hidden;
        }

        body {
            font-family: 'DM Sans', sans-serif;
            background: var(--bg);
            color: var(--text);
            -webkit-font-smoothing: antialiased;
        }

        /* ── Views ─────────────────────────────── */

        .view {
            position: absolute;
            inset: 0;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            transition: opacity .3s ease, transform .3s ease;
        }

        .view.hidden {
            opacity: 0;
            pointer-events: none;
            transform: translateY(10px);
        }

        .is-hidden {
            display: none !important;
        }

        /* ── Library ───────────────────────────── */

        #library {
            padding: calc(var(--safe-top) + 56px) 20px calc(var(--safe-bottom) + 24px);
        }

        .library-header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 100;
            padding: calc(var(--safe-top) + 14px) 20px 14px;
            background: rgba(10, 10, 10, 0.85);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border-bottom: 1px solid rgba(255,255,255,0.04);
        }

        .library-header h1 {
            font-size: 15px;
            font-weight: 500;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: var(--text-muted);
        }

        .album-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 18px;
        }

        .album-card {
            cursor: pointer;
            transition: transform .15s ease;
            animation: fadeUp .4s ease backwards;
        }

        .album-card:active {
            transform: scale(0.96);
        }

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

        .album-cover-wrap img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .album-meta {
            padding: 8px 2px 0;
        }

        .album-meta .title {
            font-size: 14px;
            font-weight: 500;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .album-meta .artist {
            font-size: 12px;
            font-weight: 300;
            color: var(--text-muted);
            margin-top: 1px;
        }

        /* ── Player ────────────────────────────── */

        #player {
            display: flex;
            flex-direction: column;
            padding-top: calc(var(--safe-top) + 8px);
            overflow: hidden;
        }

        .player-nav {
            display: flex;
            align-items: center;
            padding: 0 20px;
            height: 44px;
            flex-shrink: 0;
        }

        .btn-back {
            background: none;
            border: none;
            color: var(--text-muted);
            font-family: inherit;
            font-size: 14px;
            font-weight: 400;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 8px 0;
        }

        .btn-back svg {
            width: 18px;
            height: 18px;
        }

        .player-artwork {
            flex-shrink: 1;
            min-height: 0;
            padding: 16px 40px 20px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .player-artwork img {
            width: 100%;
            max-width: 300px;
            max-height: 100%;
            aspect-ratio: 1;
            border-radius: 4px;
            object-fit: cover;
            box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
        }

        .player-info {
            text-align: center;
            padding: 0 28px;
            flex-shrink: 0;
        }

        .player-info .track-name {
            font-size: 18px;
            font-weight: 500;
            color: var(--text);
        }

        .player-info .album-artist {
            font-size: 13px;
            font-weight: 300;
            color: var(--text-muted);
            margin-top: 3px;
        }

        .player-info .format-badge {
            display: inline-block;
            font-size: 9px;
            font-weight: 500;
            letter-spacing: 0.08em;
            color: var(--accent-warm);
            border: 1px solid rgba(201, 169, 110, 0.3);
            border-radius: 3px;
            padding: 1px 5px;
            margin-left: 6px;
            vertical-align: middle;
        }

        /* ── Progress ──────────────────────────── */

        .progress-section {
            padding: 20px 28px 0;
            flex-shrink: 0;
        }

        .progress-bar-wrap {
            position: relative;
            width: 100%;
            height: 32px;
            display: flex;
            align-items: center;
            cursor: pointer;
            touch-action: none;
        }

        .progress-track {
            width: 100%;
            height: 3px;
            background: var(--border);
            border-radius: 2px;
            overflow: hidden;
            transition: height .15s ease;
        }

        .progress-fill {
            height: 100%;
            background: var(--accent);
            width: 0%;
            border-radius: 2px;
            transition: width .15s linear;
        }

        .progress-bar-wrap.seeking .progress-fill {
            transition: none;
        }

        .progress-bar-wrap.seeking .progress-track {
            height: 6px;
        }

        .progress-times {
            display: flex;
            justify-content: space-between;
            margin-top: 4px;
        }

        .progress-times span {
            font-size: 11px;
            font-weight: 300;
            color: var(--text-dim);
            font-variant-numeric: tabular-nums;
        }

        /* ── Controls ──────────────────────────── */

        .controls {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 36px;
            padding: 14px 0 6px;
            flex-shrink: 0;
        }

        .ctrl-btn {
            background: none;
            border: none;
            color: var(--text);
            cursor: pointer;
            padding: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: transform .12s ease;
        }

        .ctrl-btn:active { transform: scale(0.86); }

        .ctrl-btn svg { width: 26px; height: 26px; }
        .ctrl-btn.play-pause svg { width: 56px; height: 56px; }

        /* ── Secondary Controls (shuffle/repeat) ── */

        .controls-secondary {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 48px;
            padding: 2px 0 4px;
            flex-shrink: 0;
        }

        .ctrl-btn.secondary {
            color: var(--text-dim);
            padding: 6px;
            position: relative;
        }

        .ctrl-btn.secondary svg {
            width: 18px;
            height: 18px;
        }

        .ctrl-btn.secondary.active {
            color: var(--accent-warm);
        }

        .ctrl-btn.secondary .badge-one {
            position: absolute;
            top: 2px;
            right: 0px;
            font-size: 7px;
            font-weight: 700;
            color: var(--accent-warm);
        }

        /* ── Track List ────────────────────────── */

        .track-list-section {
            flex: 1;
            min-height: 200px;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: 16px 0 calc(var(--safe-bottom) + 28px);
        }

        .track-list-header {
            font-size: 11px;
            font-weight: 500;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: var(--text-dim);
            padding: 0 28px 10px;
        }

        .track-item {
            display: flex;
            align-items: center;
            padding: 11px 28px;
            cursor: pointer;
            gap: 14px;
            transition: background .12s ease;
        }

        .track-item:active { background: rgba(255, 255, 255, 0.03); }

        .track-item.active { color: var(--accent-warm); }

        .track-item .num {
            font-size: 13px;
            font-weight: 300;
            color: var(--text-dim);
            width: 22px;
            text-align: right;
            flex-shrink: 0;
            font-variant-numeric: tabular-nums;
        }

        .track-item.active .num { color: var(--accent-warm); }

        .track-item .name {
            font-size: 15px;
            font-weight: 400;
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .track-item .duration {
            font-size: 12px;
            font-weight: 300;
            color: var(--text-dim);
            flex-shrink: 0;
            font-variant-numeric: tabular-nums;
        }

        /* ── Equalizer animation ── */

        .eq-icon {
            display: flex;
            gap: 2px;
            align-items: flex-end;
            height: 14px;
        }

        .eq-bar {
            width: 2px;
            background: var(--accent-warm);
            border-radius: 1px;
            animation: eq .7s ease infinite alternate;
        }

        .eq-bar:nth-child(1) { height: 35%; animation-delay: 0s; }
        .eq-bar:nth-child(2) { height: 70%; animation-delay: .15s; }
        .eq-bar:nth-child(3) { height: 45%; animation-delay: .3s; }

        .eq-icon.paused .eq-bar { animation-play-state: paused; }

        @keyframes eq {
            0%   { height: 15%; }
            100% { height: 100%; }
        }

        /* ── States ────────────────────────────── */

        .loading {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 200px;
            color: var(--text-dim);
            font-size: 13px;
            font-weight: 300;
        }

        .empty-state {
            text-align: center;
            padding: 80px 32px;
            color: var(--text-dim);
        }

        .empty-state p {
            font-size: 14px;
            font-weight: 300;
            line-height: 1.7;
        }

        @keyframes fadeUp {
            from { opacity: 0; transform: translateY(14px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        @media (min-width: 480px) {
            .album-grid { grid-template-columns: repeat(3, 1fr); }
        }

        @media (min-width: 768px) {
            .album-grid { grid-template-columns: repeat(4, 1fr); gap: 22px; }
        }
