        /* ─── Player Pill ─── */
        .player-bar {
            position: fixed;
            bottom: 16px;
            left: 50%;
            transform: translateX(-50%);
            width: calc(100% - 32px);
            max-width: 700px;
            height: 72px;
            background: rgba(20, 20, 20, 0.94);
            backdrop-filter: blur(32px) saturate(1.5);
            -webkit-backdrop-filter: blur(32px) saturate(1.5);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 40px;
            display: none;
            align-items: center;
            padding: 0 12px;
            z-index: 200;
            gap: 12px;
            box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 2px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
        }
        .player-bar.active { display: flex; }

        .player-track-info { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

        .player-cover-wrap {
            position: relative;
            width: 54px; height: 54px;
            flex-shrink: 0;
            border-radius: 50%;
            overflow: hidden;
            cursor: pointer;
        }

        .player-cover {
            width: 54px; height: 54px; border-radius: 50%;
            object-fit: cover; background: var(--bg-raised);
            display: block;
            border: 2px solid rgba(255,255,255,0.1);
        }

        @keyframes cd-spin {
            from { transform: rotate(0deg); }
            to   { transform: rotate(360deg); }
        }
        .player-cover.spinning {
            animation: cd-spin 8s linear infinite;
        }

        .player-cover-overlay {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            opacity: 0;
            transition: opacity 0.18s;
            pointer-events: none;
            background: rgba(0,0,0,0.38);
        }
        .player-cover-wrap:hover .player-cover-overlay,
        .player-cover-overlay.paused { opacity: 1; }

        .player-cover-play-icon {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.18s;
        }
        .player-cover-wrap:hover .player-cover-play-icon,
        .player-cover-play-icon.paused { opacity: 1; }


        .player-text { display: none; }
        .player-title { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .player-artist { font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

        .player-skip {
            background: none; border: none; color: rgba(255,255,255,0.35);
            cursor: pointer; padding: 4px; display: flex; align-items: center;
            transition: color 0.15s; flex-shrink: 0;
        }
        .player-skip:hover { color: rgba(255,255,255,0.8); }

        /* Waveform */
        .waveform-pill {
            flex: 1; height: 52px; position: relative;
            overflow: hidden; cursor: grab; min-width: 0;
            user-select: none; -webkit-user-select: none;
        }
        .waveform-pill:active { cursor: grabbing; }

        .waveform-pill::after {
            content: ''; position: absolute; top: 0; right: 0;
            width: 56px; height: 100%;
            background: linear-gradient(to left, rgba(20,20,20,0.96) 0%, transparent 100%);
            pointer-events: none; z-index: 3;
        }
        .waveform-pill::before {
            content: ''; position: absolute; top: 0; left: 0;
            width: 56px; height: 100%;
            background: linear-gradient(to right, rgba(20,20,20,0.96) 0%, transparent 100%);
            pointer-events: none; z-index: 3;
            opacity: 0; transition: opacity 0.25s;
        }
        .waveform-pill.scrolled::before { opacity: 1; }

        .waveform-inner { position: absolute; top: 0; left: 0; height: 100%; will-change: transform; }
        .waveform-canvas { display: block; height: 52px; }

        .waveform-playhead {
            position: absolute; top: 8px; bottom: 8px; width: 2px;
            background: rgba(255,255,255,0.9); border-radius: 1px;
            left: 0; z-index: 4; pointer-events: none;
            box-shadow: 0 0 8px rgba(255,255,255,0.4);
            transition: left 0.08s linear;
        }

        .waveform-times {
            position: absolute; bottom: 3px; left: 0; right: 0;
            display: flex; justify-content: space-between;
            padding: 0 4px; pointer-events: none; z-index: 5;
        }
        .wf-time { font-size: 9px; color: rgba(255,255,255,0.28); font-variant-numeric: tabular-nums; }

        .player-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

        .loop-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255,255,255,0.25);
            transition: color 0.18s;
            flex-shrink: 0;
        }
        .loop-btn:hover { color: rgba(255,255,255,0.7); }
        .loop-btn.active { color: #4ade80; }
        .loop-btn.active:hover { color: #86efac; }
        .volume-wrap { display: none; align-items: center; gap: 6px; opacity: 0.7; will-change: transform; flex-shrink: 0; }
        .vol-icon { display: flex; align-items: center; flex-shrink: 0; color: rgba(255,255,255,0.7); }
        .vol-slider {
            display: block;
            box-sizing: content-box;
            width: 72px;
            height: 4px;
            border-radius: 4px;
            background: linear-gradient(to right, #ffffff var(--vol, 80%), #666666 var(--vol, 80%));
            cursor: grab;
            touch-action: none;
            user-select: none;
            flex-shrink: 0;
            padding: 10px 0;
            background-clip: content-box;
        }
        .vol-slider:active { cursor: grabbing; }

        @media (min-width: 769px) {
            .player-text { display: block; }
            .player-title, .player-artist { max-width: 130px; }
            .volume-wrap { display: flex; }
        }
        /* Transparent header + pull detail-view up behind it (all screen sizes) */
        body:has(#detailView.active) .header {
            background: transparent !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }
        #detailView.active {
            position: fixed;
            inset: 0;
            margin-top: 0;
            overflow: hidden;
        }
        body:has(#detailView.active) {
            overflow: hidden;
        }

        @media (max-width: 768px) {
            #detailView.active {
                position: static;
                inset: auto;
                margin-top: -80px;
                overflow: visible;
            }
            body:has(#detailView.active) {
                overflow: auto;
            }
            /* Mobile: hide outer back btn (blur area), show panel back btn */
            #detailView > .back-btn { display: none; }
            .detail-main-column .back-btn { display: inline-flex; }
            .detail-shell {
                grid-template-columns: 1fr;
                gap: 0;
                padding: 0;
            }
            .detail-view {
                padding-bottom: 100px;
            }
            .detail-visual-column {
                min-height: 400px;
                padding-bottom: 28px; /* extends blur into rounded corner cutouts */
            }
            .detail-visual-stick {
                position: static;
                top: auto;
                padding: 132px 44px 44px;
            }
            .detail-main-column {
                padding: 20px 18px 48px;
                border-radius: 24px 24px 0 0;
                margin: -28px 0 0; /* overlap with extended visual column */
                position: relative;
                top: auto;
                height: auto;
                overflow-y: visible;
                align-self: auto;
                z-index: 2;
            }
            .detail-sticky-actions {
                top: 74px;
            }
            .detail-meta-block {
                margin-top: 14px;
            }
            .releases-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); column-gap: 50px; row-gap: 16px; }
            .grid-view { padding: 20px 16px 140px; }
            .tracklist { margin-top: 18px; }
            .track-duration { display: none; }
            .detail-notes-section .note-entry-title {
                font-size: 28px;
                line-height: 1.08;
            }
            .detail-notes-section .note-entry-text {
                font-size: 15px;
                line-height: 1.72;
                text-align: justify;
            }
            .wf-time { display: none; }
        }

        .loading { display: flex; justify-content: center; padding: 80px; }
        .spinner { width: 24px; height: 24px; border: 2px solid var(--border); border-top-color: var(--text); border-radius: 50%; animation: spin 0.6s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }

        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: #444; }

        .empty-state { text-align: center; padding: 100px 20px; color: var(--text-dim); }
        .empty-state h2 { font-size: 18px; color: var(--text); margin-bottom: 8px; }

        /* ─── Release Type Badge ─── */
        .release-type-badge {
            display: inline-block;
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.06em;
            padding: 2px 7px;
            border-radius: 4px;
            vertical-align: middle;
            text-transform: uppercase;
        }
        .badge-release { background: rgba(255,255,255,0.12); color: var(--text-dim); }
        .badge-demo { background: rgba(0,34,68,0.6); color: #44aaff; }
        .badge-wip { background: rgba(51,34,68,0.6); color: #aa88ff; }
        [data-theme="light"] .badge-release { background: rgba(0,0,0,0.08); color: #888; }
        [data-theme="light"] .badge-demo { background: rgba(0,80,180,0.12); color: #0055cc; }
        [data-theme="light"] .badge-wip { background: rgba(100,0,180,0.1); color: #6600cc; }
    
        /* ─── Share Dropdown ─── */
        .trk-share { position: relative; }
        .trk-share-menu {
            display: none;
            position: absolute;
            bottom: calc(100% + 8px);
            right: 0;
            background: #1c1c1c;
            border: 1px solid #2a2a2a;
            border-radius: 10px;
            padding: 6px;
            z-index: 300;
            min-width: 180px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.6);
        }
        .trk-share-menu.open { display: block; }
        .trk-share-opt {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 9px 12px;
            background: none;
            border: none;
            border-radius: 7px;
            color: var(--text);
            font-family: inherit;
            font-size: 13px;
            cursor: pointer;
            text-align: left;
            transition: background 0.15s;
            white-space: nowrap;
        }
        .trk-share-opt:hover { background: rgba(255,255,255,0.07); }


        /* ─── Search Modal ─── */
        .search-overlay {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 10000;
            background: rgba(0,0,0,0.55);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.22s ease;
        }
        .search-overlay.open { display: flex; opacity: 1; }
        .search-modal {
            background: var(--bg-raised);
            border: 1px solid var(--border);
            border-radius: 18px;
            width: 90%;
            max-width: 560px;
            padding: 24px 24px 20px;
            position: relative;
            box-shadow: 0 28px 80px rgba(0,0,0,0.6), 0 4px 20px rgba(0,0,0,0.3);
            transform: translateY(-10px);
            transition: transform 0.22s ease;
        }
        .search-overlay.open .search-modal { transform: translateY(0); }
        .search-close {
            position: absolute;
            top: 14px;
            right: 14px;
            background: var(--bg-hover);
            border: none;
            color: var(--text-dim);
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            transition: background 0.15s, color 0.15s;
            line-height: 1;
        }
        .search-close:hover { background: var(--border); color: var(--text); }
        .search-input-wrap {
            display: flex;
            align-items: center;
            gap: 10px;
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 11px 16px;
            margin-bottom: 18px;
            transition: border-color 0.15s;
        }
        .search-input-wrap:focus-within { border-color: rgba(255,255,255,0.2); }
        .search-input-wrap svg { opacity: 0.35; flex-shrink: 0; }
        .search-input {
            background: none;
            border: none;
            outline: none;
            color: var(--text);
            font-size: 15px;
            font-family: inherit;
            flex: 1;
            min-width: 0;
        }
        .search-input::placeholder { color: var(--text-dim); }
        .search-section-label {
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.09em;
            text-transform: uppercase;
            color: var(--text-muted);
            margin-bottom: 9px;
        }
        .search-filters-row, .search-sort-row {
            display: flex;
            flex-wrap: wrap;
            gap: 7px;
            margin-bottom: 16px;
        }
        .search-tag {
            background: var(--bg);
            border: 1px solid var(--border);
            border-radius: 20px;
            color: var(--text-dim);
            font-size: 12px;
            font-family: inherit;
            padding: 5px 13px;
            cursor: pointer;
            transition: all 0.15s;
            white-space: nowrap;
        }
        .search-tag:hover { border-color: rgba(255,255,255,0.25); color: var(--text); }
        .search-tag.active { background: var(--text); color: var(--bg); border-color: var(--text); }
        #searchTagFilters .search-tag[data-tag="release"] {
            border-color: rgba(100,220,100,0.32);
            color: rgba(100,220,100,0.82);
        }
        #searchTagFilters .search-tag[data-tag="release"].active {
            background: rgba(100,220,100,0.18);
            border-color: rgba(100,220,100,0.45);
            color: rgba(100,220,100,0.95);
        }
        #searchTagFilters .search-tag[data-tag="demo"] {
            border-color: rgba(70,150,255,0.34);
            color: rgba(95,175,255,0.84);
        }
        #searchTagFilters .search-tag[data-tag="demo"].active {
            background: rgba(45,120,235,0.22);
            border-color: rgba(90,165,255,0.48);
            color: rgba(170,214,255,0.98);
        }
        #searchTagFilters .search-tag[data-tag="wip"] {
            border-color: rgba(255,165,0,0.36);
            color: rgba(255,180,55,0.86);
        }
        #searchTagFilters .search-tag[data-tag="wip"].active {
            background: rgba(255,165,0,0.2);
            border-color: rgba(255,165,0,0.5);
            color: rgba(255,205,120,0.98);
        }
        [data-theme="light"] #searchTagFilters .search-tag[data-tag="release"] {
            border-color: rgba(68,160,68,0.45);
            color: rgba(55,130,55,0.95);
        }
        [data-theme="light"] #searchTagFilters .search-tag[data-tag="release"].active {
            background: rgba(68,160,68,0.18);
            border-color: rgba(68,160,68,0.56);
            color: rgba(40,110,40,0.98);
        }
        [data-theme="light"] #searchTagFilters .search-tag[data-tag="demo"] {
            border-color: rgba(0,95,215,0.38);
            color: rgba(0,85,190,0.94);
        }
        [data-theme="light"] #searchTagFilters .search-tag[data-tag="demo"].active {
            background: rgba(0,95,215,0.16);
            border-color: rgba(0,95,215,0.5);
            color: rgba(0,70,160,0.98);
        }
        [data-theme="light"] #searchTagFilters .search-tag[data-tag="wip"] {
            border-color: rgba(190,120,0,0.42);
            color: rgba(170,105,0,0.94);
        }
        [data-theme="light"] #searchTagFilters .search-tag[data-tag="wip"].active {
            background: rgba(210,130,0,0.16);
            border-color: rgba(190,120,0,0.52);
            color: rgba(145,90,0,0.98);
        }
        .search-divider { height: 1px; background: var(--border); margin: 16px 0; }
        .search-results { max-height: 280px; overflow-y: auto; }
        .search-results::-webkit-scrollbar { width: 3px; }
        .search-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
        .search-result-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 9px 10px;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.15s;
        }
        .search-result-item:hover { background: var(--bg-hover); }
        .search-result-cover {
            width: 40px;
            height: 40px;
            border-radius: 7px;
            background: var(--bg);
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            overflow: hidden;
        }
        .search-result-cover img { width: 100%; height: 100%; object-fit: cover; }
        .search-result-info { flex: 1; min-width: 0; }
        .search-result-title { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .search-result-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
        .search-result-badge {
            font-size: 10px;
            padding: 2px 8px;
            border-radius: 10px;
            border: 1px solid var(--border);
            color: var(--text-dim);
            white-space: nowrap;
            flex-shrink: 0;
        }
        .search-empty { text-align: center; color: var(--text-dim); font-size: 13px; padding: 32px 0; }
        .badge-wip { border-color: rgba(255,165,0,0.4) !important; color: rgba(255,165,0,0.75) !important; }
        .badge-release { border-color: rgba(100,220,100,0.4) !important; color: rgba(100,220,100,0.75) !important; }


/* ─── Video Cover Support (.webm) ─── */
/* Video in player pill - same as img */
video.player-cover {
    width: 54px; height: 54px; border-radius: 50%;
    object-fit: cover; background: var(--bg-raised);
    display: block;
    border: 2px solid rgba(255,255,255,0.1);
}
/* Video in grid cards */
.release-cover-wrap video,
.release-cover-wrap .cover-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}
/* Video in carousel cards */
.carousel-card video,
.carousel-card .cover-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Video in detail view */
.detail-cover video,
.detail-cover .cover-video {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}
/* Video in search results */
.search-result-cover video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

/* ─── Studio Notes ─────────────────────────────── */

/* Dive Deeper button in detail-actions */
.dive-deeper-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.dive-deeper-btn:hover {
    border-color: var(--text-dim);
    color: var(--text);
}


/* Notes reading area — hidden by default, shown when notes-active */
.notes-reading-area {
    display: none;
    max-width: 860px;
    margin: 0 auto;
}
#detailContent.notes-active .detail-header,
#detailContent.notes-active .tracklist { display: none; }
#detailView:has(#detailContent.notes-active) .back-btn {
    display: inline-flex;
    margin: 24px 0 0 28px;
}
#detailView:has(#detailContent.notes-active) #detailContent {
    display: grid;
    grid-template-columns: 200px 1fr;
    column-gap: 32px;
    align-items: start;
}
#detailView:has(#detailContent.notes-active) #detailContent > .back-btn {
    grid-column: 1;
    justify-self: start;
    margin: 24px 0 8px;
}
#detailView:has(#detailContent.notes-active) #detailContent > .notes-reading-area {
    grid-column: 1 / -1;
}
#detailContent.notes-active .notes-reading-area {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    padding: 8px 28px 24px;
}

/* Sticky sidebar (desktop) */
.notes-sidebar {
    position: sticky;
    top: 84px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.notes-sidebar-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    object-fit: cover;
    display: block;
}
.notes-sidebar-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.notes-sidebar-sub {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: -6px;
}
.notes-sidebar-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notes text column */
.notes-content {
    max-width: 60ch;
    justify-self: start;
}
.notes-heading {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 24px;
}

/* Individual note entry */
.note-entry {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 80px;
}
.note-entry:last-child {
    border-bottom: none;
}
.note-entry-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.note-entry-title {
    font-size: 40px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.note-image {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 14px;
    display: block;
}
.note-entry-text {
    font-size: 17px;
    color: var(--text);
    opacity: 0.88;
    line-height: 1.8;
    white-space: pre-wrap;
}
.notes-empty {
    font-size: 13px;
    color: var(--text-muted);
}

/* ─── #notes Feed View ─── */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 24px 28px;
    max-width: 1000px;
    margin: 0 auto;
}
.note-card {
    background: var(--bg-raised);
    border-radius: 1px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.note-card--linked {
    cursor: pointer;
    transition: background 0.15s;
}
.note-card--linked:hover {
    background: var(--bg-hover);
}
.note-card-image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}
.note-card-body {
    padding: 14px;
}
.note-card-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.note-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}
.note-card-excerpt {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 8px;
}
.note-card-release {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}
.note-card-cover {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
    .notes-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }
}

/* ─── Mode Toggle (Releases / Sample Packs) ─── */
.mode-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 18px 28px 8px;
    flex-wrap: wrap;
    position: sticky;
    top: 66px;
    z-index: 90;
    transition: padding 0.18s ease, background 0.18s ease, backdrop-filter 0.18s ease, -webkit-backdrop-filter 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.mode-toggle.hidden { display: none; }
.mode-toggle-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}
.mode-toggle-group-primary {
    gap: 4px;
    padding: 2px;
    border: 1px solid var(--toggle-border-strong);
    border-radius: 999px;
    background: var(--toggle-surface);
    backdrop-filter: blur(12px) saturate(1.06);
    -webkit-backdrop-filter: blur(12px) saturate(1.06);
}
.mode-toggle-group-view {
    position: relative;
    gap: 0;
    padding: 2px;
    border: 1px solid var(--toggle-border-strong);
    border-radius: 999px;
    background: var(--toggle-surface);
    backdrop-filter: blur(12px) saturate(1.06);
    -webkit-backdrop-filter: blur(12px) saturate(1.06);
}
.mode-toggle-group-view::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--toggle-slider-bg);
    box-shadow: var(--toggle-slider-shadow);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.mode-toggle-group-view:has(#toggleGrid.active)::before {
    transform: translateX(30px);
}
.mode-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mode-toggle-btn:hover {
    color: var(--text);
    border-color: var(--toggle-border-strong);
}
.mode-toggle-btn.active {
    background: var(--toggle-active-bg);
    color: var(--toggle-active-text);
    border-color: var(--toggle-active-border);
}
.mode-toggle-group-primary .mode-toggle-btn {
    border: none;
}
.mode-toggle-btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}
.mode-toggle-group-view .mode-toggle-btn {
    position: relative;
    z-index: 1;
    border: none;
    background: transparent;
    color: var(--text-dim);
}
.mode-toggle-group-view .mode-toggle-btn:hover {
    border-color: transparent;
    background: transparent;
    transform: none;
}
.mode-toggle-group-view .mode-toggle-btn.active {
    background: transparent;
    border-color: transparent;
    color: var(--toggle-active-text);
}
.mode-toggle-btn-icon svg {
    width: 14px;
    height: 14px;
}

/* ─── Sample Packs ─── */
.packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px 28px 140px;
}
.pack-card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}
.pack-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.12); }
.pack-card-cover { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg-hover); display: block; }
.pack-card-info { padding: 12px 14px; }
.pack-card-title { font-size: 14px; font-weight: 500; color: var(--text); }
.pack-card-count { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.pack-card-placeholder { width: 100%; aspect-ratio: 1; background: var(--bg-hover); display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--text-muted); }

/* Pack detail header */
.pack-detail-header {
    display: flex;
    gap: 28px;
    padding: 28px;
    align-items: flex-start;
}
.pack-detail-cover {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
    background: var(--bg-hover);
}
.pack-detail-cover-placeholder {
    width: 180px;
    height: 180px;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-muted);
}
.pack-detail-meta { flex: 1; min-width: 0; }
.pack-detail-title { font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.pack-detail-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 14px; }
.pack-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pack-dl-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}
.pack-dl-all-btn:hover { opacity: 0.82; }

/* Category filter chips */
.sample-category-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0 28px 16px;
}
.sample-cat-chip {
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.sample-cat-chip:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }
.sample-cat-chip.active { background: var(--cat-color, var(--accent)); color: #fff; border-color: transparent; }
.sample-cat-chip[data-cat="all"].active { background: var(--accent); color: var(--bg); }
[data-theme="light"] .sample-cat-chip[data-cat="all"].active { background: #111; color: #fff; }
[data-theme="light"] .sample-cat-chip.active { color: #fff; }

/* Sample list */
.sample-list { padding: 0 28px 140px; }
.sample-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.sample-row:last-child { border-bottom: none; }
.sample-row.hidden-by-filter { display: none; }
.sample-play-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    font-size: 10px;
    padding: 0;
}
.sample-play-btn:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.sample-play-btn.playing { background: var(--accent); color: var(--bg); border-color: var(--accent); }
[data-theme="light"] .sample-play-btn:hover,
[data-theme="light"] .sample-play-btn.playing { background: #111; color: #fff; border-color: #111; }
.sample-name { flex: 1; font-weight: 500; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample-category-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
    color: #fff;
    background: var(--cat-color, #555);
}
.sample-meta { color: var(--text-dim); font-size: 11px; white-space: nowrap; flex-shrink: 0; }
.sample-size { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.sample-dl-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    transition: all 0.15s;
}
.sample-dl-btn:hover { border-color: var(--text); color: var(--text); }

/* Disclaimer modal */
.disclaimer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.disclaimer-modal {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.disclaimer-modal h3 { font-size: 16px; margin-bottom: 12px; color: var(--text); }
.disclaimer-modal p { font-size: 13px; color: var(--text-dim); line-height: 1.65; margin-bottom: 18px; }
.disclaimer-check-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.disclaimer-check-row input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; width: auto; cursor: pointer; }
.disclaimer-check-row label { font-size: 13px; color: var(--text); cursor: pointer; }
.disclaimer-actions { display: flex; gap: 10px; justify-content: flex-end; }
.disclaimer-cancel-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.disclaimer-cancel-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.disclaimer-dl-btn {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}
.disclaimer-dl-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.disclaimer-dl-btn:not(:disabled):hover { opacity: 0.82; }
[data-theme="light"] .disclaimer-dl-btn { background: #111; color: #fff; }

/* Search: source toggle (Releases / Sample Packs / Both) */
.search-source-row {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.search-source-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: none;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.search-source-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.search-source-btn.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
[data-theme="light"] .search-source-btn.active { background: #111; color: #fff; border-color: #111; }

/* Badge for sample pack results in search */
.search-result-badge.badge-samplepack {
    background: rgba(155, 109, 214, 0.2);
    color: #9b6dd6;
    border-color: rgba(155, 109, 214, 0.3);
}

@media (max-width: 768px) {
    #detailView:has(#detailContent.notes-active) #detailContent {
        display: block;
    }
    #detailView:has(#detailContent.notes-active) #detailContent > .back-btn {
        margin: 10px 0 10px 14px;
    }
    #detailContent.notes-active .notes-reading-area {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 16px 16px 24px;
    }
    .notes-sidebar {
        position: static;
        top: auto;
        display: grid;
        grid-template-columns: 112px 1fr;
        gap: 8px 14px;
        align-items: start;
    }
    .notes-sidebar-cover {
        grid-column: 1;
        grid-row: 1 / span 3;
        width: 112px;
        aspect-ratio: 1;
    }
    .notes-sidebar-title {
        grid-column: 2;
        grid-row: 1;
    }
    .notes-sidebar-sub {
        grid-column: 2;
        grid-row: 2;
        margin-top: 0;
    }
    .notes-sidebar-play {
        grid-column: 2;
        grid-row: 3;
        margin-top: 4px;
    }
    .notes-content {
        max-width: none;
        width: 100%;
    }
    .note-entry-title {
        font-size: 28px;
        line-height: 1.08;
        margin-bottom: 12px;
    }
    .note-entry-text {
        font-size: 15px;
        line-height: 1.7;
    }
    .packs-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 16px 16px 140px; }
    .pack-detail-header { flex-direction: column; padding: 20px 16px; gap: 16px; }
    .pack-detail-cover,
    .pack-detail-cover-placeholder { width: 100%; height: auto; aspect-ratio: 1; }
    .sample-category-filters { padding: 0 16px 12px; }
    .sample-list { padding: 0 16px 140px; }
    .sample-meta, .sample-size { display: none; }
    .mode-toggle {
        --mobile-toggle-height: 38px;
        padding: 14px 16px 6px;
        gap: 6px;
        align-items: center;
        top: 64px;
        flex-wrap: nowrap;
    }
    .mode-toggle-group-primary,
    .mode-toggle-group-view {
        height: var(--mobile-toggle-height);
        padding: 2px;
    }
    .mode-toggle-group-primary {
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
        gap: 3px;
    }
    .mode-toggle-group-primary .mode-toggle-btn {
        flex: 1 1 0;
        min-width: 0;
    }
    .mode-toggle-btn {
        height: calc(var(--mobile-toggle-height) - 4px);
        padding: 0 10px;
        font-size: clamp(10px, 2.9vw, 12px);
        line-height: 1;
        border-radius: 999px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mode-toggle-group-view {
        flex: 0 0 auto;
        gap: 0;
    }
    .mode-toggle-btn-icon {
        width: calc(var(--mobile-toggle-height) - 4px);
        height: calc(var(--mobile-toggle-height) - 4px);
        border-radius: 999px;
    }
    .mode-toggle-btn-icon svg {
        width: 16px;
        height: 16px;
    }
    .mode-toggle-group-view::before {
        top: 2px;
        left: 2px;
        width: calc(var(--mobile-toggle-height) - 4px);
        height: calc(var(--mobile-toggle-height) - 4px);
    }
    .mode-toggle-group-view:has(#toggleGrid.active)::before {
        transform: translateX(calc(var(--mobile-toggle-height) - 4px));
    }
    .mode-toggle-group-view .mode-toggle-btn {
        color: var(--text-dim);
    }
    .mode-toggle-group-view .mode-toggle-btn.active {
        color: var(--text);
    }
}
