/*
 * Syncflow playlist.css v1.2
 * Apple Music-inspired playlist interface.
 * This version keeps the visual design but adds a mobile-safe expanded player
 * layout layer so the modal does not stretch, clip, or distort across viewport
 * height changes, iOS browser chrome, compact phones, or landscape mode.
 */

:root {
        --app-max: none;
        --title-h: clamp(52px, 7svh, 76px);
        --site-content-max: 980px;
        --site-page-space: clamp(28px, 7vw, 58px);
        --hero-h: clamp(430px, 68svh, 760px);

        /*
            Change only --page-bg to retheme the full page.
            JS automatically syncs --page-bg-rgb from it, and every gradient,
            blur layer, menu overlay, and cover fade derives from those values.
        */
        --page-bg: #002b22;
        --page-bg-rgb: 0, 43, 34;
        --page-bg-deep: color-mix(in srgb, var(--page-bg) 74%, #000);
        --page-bg-deeper: color-mix(in srgb, var(--page-bg) 58%, #000);
        --page-bg-soft: color-mix(in srgb, var(--page-bg) 84%, #fff);

        /*
            Mini-player spacing is intentionally NOT based on vh/svh/dvh.
            A constant visual gap is more stable across browser chrome states.
            JS updates --mini-viewport-bottom-offset through visualViewport only
            when the browser UI/keyboard covers the visual viewport bottom.
        */
        --mini-h: 55px;
        --mini-side: clamp(9px, 2.6vw, 14px);
        --mini-visual-gap: 8px;
        --mini-viewport-bottom-offset: 0px;
        --mini-safe-nudge: 0px;
        --mini-bottom: calc(var(--mini-visual-gap) + var(--mini-viewport-bottom-offset) + var(--mini-safe-nudge));
        --mini-art-size: 34px;
        --mini-btn-size: 40px;
        --mini-title-font-size: 13px;
        --mini-title-font-weight: 500;
        --playlist-song-title-font-size: var(--mini-title-font-size);
        --playlist-song-title-font-weight: var(--mini-title-font-weight);
        --playlist-bottom-extra: 22px;
        --playlist-bottom: calc(var(--mini-bottom) + var(--mini-h) + var(--playlist-bottom-extra));
        --text: #f5f5f7;
        --soft: rgba(245, 245, 247, .72);
        --muted: rgba(245, 245, 247, .46);
        --faint: rgba(245, 245, 247, .25);
        --mini-bg: rgba(var(--page-bg-rgb), .64);
        --mini-border: rgba(255, 255, 255, .18);

        /*
            Cover color fade controls.
            0% is the top of the cover. 100% is the bottom.
            The bottom stays var(--page-bg), so the hero and playlist connect.
        */
        --cover-color-start: 38%;
        --cover-color-soft: 45%;
        --cover-color-middle: 50%;
        --cover-color-strong: 65%;
        --cover-color-nearly-full: 70%;
        --cover-color-end: 78%;

        /*
            Expanded player manual spacing.
            Change this value to control the extra distance between the
            cover art and the track line while the queue is closed.
        */
        --expanded-cover-track-extra-gap: clamp(8px, 3svh, 22px);
        --ease: cubic-bezier(.2, .8, .2, 1);
    }


    @supports (bottom: env(safe-area-inset-bottom)) {
        :root {
            --mini-safe-nudge: clamp(0px, env(safe-area-inset-bottom, 0px), 3px);
        }
    }

    * {
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
    }

    html,
    body {
        width: 100%;
        height: 100%;
        margin: 0;
    }

    html {
        background: #000;
    }

    body {
        overflow: hidden;
        background: #000;
        color: var(--text);
        font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
        overscroll-behavior: none;
    }

    button {
        border: 0;
        padding: 0;
        margin: 0;
        cursor: pointer;
        font: inherit;
        color: inherit;
        background: transparent;
        touch-action: manipulation;
    }

    button:focus-visible,
    a:focus-visible {
        outline: 2px solid rgba(255, 255, 255, .72);
        outline-offset: 4px;
    }

    .syncflow {
        position: relative;
        width: 100%;
        max-width: var(--app-max);
        height: 100vh;
        height: 100svh;
        height: 100dvh;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        padding-top: var(--title-h);
        overflow: hidden;
        isolation: isolate;
        background:
            radial-gradient(circle at 50% 0%, rgba(var(--page-bg-rgb), .38), transparent 38%),
            linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-deep) 58%, var(--page-bg-deeper) 100%);
    }

    /* Saved for later use. Hidden for now so the playlist cover controls the visual background. */
    .syncflow::before,
    .syncflow::after,
    .animated-bg {
        display: none;
    }

    .animated-bg {
        position: absolute;
        inset: 0;
        z-index: 0;
        overflow: hidden;
        pointer-events: none;
        background: transparent;
    }

    .animated-bg img {
        position: absolute;
        width: 160%;
        height: 160%;
        object-fit: cover;
        border-radius: 999px;
        opacity: 0;
        transition: opacity .75s var(--ease), filter .75s var(--ease);
        animation: rotateCoverBg 44s linear infinite;
        will-change: transform, opacity;
    }

    .animated-bg.has-cover .bg-color {
        opacity: .64;
    }

    .animated-bg.has-cover .bg-shadow {
        opacity: .42;
    }

    .animated-bg .bg-color {
        top: -36%;
        right: -40%;
        z-index: 2;
        filter: blur(48px) saturate(190%);
        mix-blend-mode: screen;
    }

    .animated-bg .bg-shadow {
        left: -44%;
        bottom: -44%;
        z-index: 1;
        filter: blur(64px) saturate(145%);
        animation-direction: reverse;
        animation-delay: -15s;
        mix-blend-mode: soft-light;
    }

    @keyframes rotateCoverBg {
        from { transform: rotate(0deg) scale(1.02); }
        to { transform: rotate(360deg) scale(1.02); }
    }

    .site-header,
    header.site-header {
        position: fixed;
        inset: 0 0 auto 0;
        top: 0;
        width: 100%;
        height: var(--title-h);
        padding: max(0px, env(safe-area-inset-top)) 0 0;
        z-index: 60;
        display: block;
        background: linear-gradient(180deg, rgba(10, 30, 25, .94), rgba(10, 30, 25, .78));
        border-bottom: 1px solid rgba(255, 255, 255, .12);
        box-shadow: 0 14px 34px rgba(0, 0, 0, .20);
        backdrop-filter: saturate(190%) blur(22px);
        -webkit-backdrop-filter: saturate(190%) blur(22px);
    }

    .site-header-inner {
        width: 100%;
        height: 100%;
        margin: 0 auto;
        padding: 0 clamp(22px, 5vw, 38px);
        display: grid;
        grid-template-columns: 58px minmax(0, 1fr) 58px;
        align-items: center;
        gap: 8px;
    }

    .brand {
        min-width: 0;
        justify-self: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #f4f4f5;
        text-decoration: none;
        font-size: clamp(18px, 2.2svh, 36px);
        line-height: 1;
        font-weight: 700;
        letter-spacing: -.055em;
        text-shadow: 0 8px 30px rgba(0, 0, 0, .34);
        white-space: nowrap;
    }

    .header-spacer {
        width: 58px;
        height: 1px;
        justify-self: end;
    }

    .lines {
        position: relative;
        justify-self: start;
        flex: 0 0 auto;
        width: clamp(42px, 4.6vw, 56px);
        height: clamp(42px, 4.6vw, 56px);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: #e9e9ea;
        cursor: pointer;
        z-index: 70;
        transition: background 180ms ease, transform 180ms ease, opacity 180ms ease;
    }

    .lines:hover,
    .lines:focus-visible {
        background: rgba(255, 255, 255, .09);
    }

    .lines:active {
        transform: scale(.94);
        opacity: .78;
    }

    .line {
        position: relative;
        display: block;
        width: 70%;
        height: 18px;
        background: transparent;
        z-index: 1;
    }

    .line::before,
    .line::after {
        content: "";
        position: absolute;
        left: 0;
        width: 100%;
        height: 2.5px;
        border-radius: 999px;
        background: currentColor;
        transform: none;
        animation: none !important;
        transition: clip-path 280ms ease, opacity 220ms ease;
    }

    .line::before {
        top: 3px;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .line::after {
        top: 13px;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .menucross {
        position: absolute;
        inset: 0;
        display: block;
        pointer-events: none;
        z-index: 2;
    }

    .menucross::before,
    .menucross::after {
        content: "";
        position: absolute;
        left: 20%;
        top: 50%;
        width: 60%;
        height: 2.5px;
        border-radius: 999px;
        background: currentColor;
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
        transition: clip-path 320ms ease 80ms;
    }

    .menucross::before { transform: rotate(-45deg); }
    .menucross::after { transform: rotate(45deg); }

    .lines.is-active .line::before { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
    .lines.is-active .line::after { clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%); }
    .lines.is-active .menucross::before,
    .lines.is-active .menucross::after { clip-path: polygon(100% 0, 0 0, 0 100%, 100% 100%); }

    .app-menu {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100svh;
        height: 100dvh;
        z-index: 45;
        overflow: hidden auto;
        padding-top: var(--title-h);
        background: rgba(var(--page-bg-rgb), .34);
        backdrop-filter: blur(30px) saturate(150%);
        -webkit-backdrop-filter: blur(30px) saturate(150%);
        clip-path: circle(0 at 46px 34px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition:
            clip-path 430ms cubic-bezier(.22, .8, .24, 1),
            opacity 260ms ease,
            visibility 430ms ease;
    }

    .app-menu.menuactive {
        clip-path: circle(150vmax at 46px 34px);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .menu-shell {
        position: relative;
        z-index: 1;
        width: min(620px, calc(100% - var(--site-page-space)));
        min-height: calc(100dvh - var(--title-h));
        margin: 0 auto;
        padding: clamp(18px, 4vh, 34px) 0 clamp(28px, 6vh, 56px);
        display: flex;
        flex-direction: column;
    }

    .menu-items {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin: 0;
        padding: 0;
    }

    .menu-row {
        width: 100%;
        min-height: clamp(44px, 6.1svh, 58px);
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        padding: 0 12px;
        border-radius: 12px;
        color: rgba(255, 255, 255, .92);
        text-decoration: none;
        text-align: left;
        font-size: clamp(18px, 3.05svh, 25px);
        line-height: 1;
        font-weight: 440;
        letter-spacing: -.035em;
        background: transparent;
        transition: background 180ms ease, color 180ms ease, transform 180ms ease;
    }

    .menu-row:hover,
    .menu-row:focus-visible {
        background: rgba(255, 255, 255, .10);
        outline: none;
    }

    .menu-row:active { transform: scale(.99); }

    .menu-row.is-active {
        background: rgba(255, 255, 255, .10);
        color: rgba(255, 255, 255, .98);
    }

    .menu-row svg {
        width: 24px;
        height: 24px;
        display: block;
        color: currentColor;
        stroke: currentColor;
        fill: none;
        stroke-width: 2.05;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .menu-row span {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .syncflow.is-menu-open .playlist-section,
    .syncflow.is-menu-open .mini-player {
        filter: blur(14px);
        opacity: .38;
        pointer-events: none;
    }

    .playlist-section {
        position: relative;
        z-index: 4;
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        overflow: hidden;
        padding-bottom: 0;
        background: transparent;
        border: 0;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .playlist-scroller {
        width: 100%;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        padding-bottom: 0;
        scroll-padding-bottom: var(--playlist-bottom);
    }

    .playlist-scroller::-webkit-scrollbar { display: none; }

    .playlist-hero {
        position: relative;
        min-height: var(--hero-h);
        width: 100%;
        overflow: hidden;
        background: var(--page-bg);
    }

    .playlist-cover {
        position: absolute;
        inset: 0;
        overflow: hidden;
        background:
            radial-gradient(circle at 50% 18%, rgba(255, 255, 255, .22), transparent 36%),
            radial-gradient(circle at 20% 58%, rgba(var(--page-bg-rgb), .52), transparent 34%),
            linear-gradient(160deg, var(--page-bg-soft) 0%, var(--page-bg) 52%, var(--page-bg-deep) 100%);
    }

    .playlist-cover img,
    .playlist-cover video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        opacity: 0;
        transform: scale(1.01);
        transition: opacity 360ms ease;
    }

    .playlist-cover.has-image img,
    .playlist-cover.has-video video {
        opacity: 1;
    }

    .playlist-cover.is-empty .playlist-cover-fallback {
        opacity: .32;
    }

    .playlist-cover-fallback {
        position: absolute;
        left: 50%;
        top: 47%;
        transform: translate(-50%, -50%);
        color: rgba(255, 255, 255, .25);
        font-size: min(54vw, 320px);
        line-height: 1;
        font-weight: 900;
        filter: blur(2px);
        pointer-events: none;
        opacity: 0;
    }

    .playlist-cover::before,
    .playlist-cover::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        z-index: 2;
    }

    .playlist-cover::before {
        background:
            linear-gradient(180deg, rgba(0, 0, 0, .04) 0%, rgba(0, 0, 0, .08) 38%, rgba(var(--page-bg-rgb), .72) 78%, var(--page-bg) 100%),
            radial-gradient(circle at 50% 70%, transparent 0%, rgba(var(--page-bg-rgb), .32) 72%, var(--page-bg-deep) 100%);
    }

    .playlist-cover::after {
        background: linear-gradient(90deg, rgba(0, 0, 0, .24), transparent 28%, transparent 72%, rgba(0, 0, 0, .24));
        mix-blend-mode: multiply;
    }

    .playlist-cover-actions {
        position: absolute;
        top: clamp(24px, 5.4svh, 42px);
        right: clamp(20px, 5vw, 42px);
        z-index: 6;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-height: 48px;
        padding: 7px 10px;
        border-radius: 18px;
        color: rgba(255, 255, 255, .96);
        background: rgba(var(--page-bg-rgb), .62);
        border: 1px solid rgba(255, 255, 255, .12);
        box-shadow: 0 15px 35px rgba(0, 0, 0, .28);
        backdrop-filter: blur(18px) saturate(160%);
        -webkit-backdrop-filter: blur(18px) saturate(160%);
    }

    .hero-icon-btn {
        width: 34px;
        height: 34px;
        display: grid;
        place-items: center;
        border-radius: 11px;
        color: inherit;
        transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
    }

    .hero-icon-btn:hover,
    .hero-icon-btn:focus-visible {
        background: rgba(255, 255, 255, .11);
    }

    .hero-icon-btn:active {
        transform: scale(.92);
        opacity: .76;
    }

    .share-icon {
        width: 20px;
        height: 25px;
        display: block;
    }

    .more-icon {
        width: 28px;
        height: 28px;
        display: block;
    }

    .playlist-hero-copy {
        position: absolute;
        left: 50%;
        bottom: clamp(34px, 8vh, 72px);
        z-index: 5;
        width: min(720px, calc(100% - 42px));
        transform: translateX(-50%);
        display: grid;
        justify-items: center;
        text-align: center;
        color: #fff;
        text-shadow: 0 4px 26px rgba(0, 0, 0, .36);
    }

    .playlist-hero-title {
        margin: 0;
        font-size: clamp(34px, 4.8svh, 52px);
        line-height: .98;
        font-weight: 820;
        letter-spacing: -.065em;
    }

    .playlist-hero-subtitle {
        margin-top: 10px;
        font-size: clamp(26px, 4.1svh, 42px);
        line-height: 1.02;
        font-weight: 430;
        letter-spacing: -.055em;
        color: rgba(255, 255, 255, .94);
    }

    .preview-btn {
        margin-top: clamp(22px, 4.2svh, 30px);
        min-height: 58px;
        min-width: 224px;
        padding: 0 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        border-radius: 999px;
        color: #06251d;
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 10px 28px rgba(0, 0, 0, .20);
        font-size: clamp(22px, 3.2svh, 28px);
        line-height: 1;
        font-weight: 750;
        letter-spacing: -.035em;
        transition: transform 160ms ease, opacity 160ms ease;
    }

    .preview-btn:active {
        transform: scale(.97);
        opacity: .86;
    }

    .preview-btn svg {
        width: 24px;
        height: 24px;
        display: block;
        color: currentColor;
    }

    .playlist-info {
        width: min(100%, 980px);
        margin: 0 auto;
        padding: clamp(24px, 4vh, 40px) clamp(22px, 5.6vw, 42px) clamp(28px, 4.5vh, 42px);
    }

    .playlist-description {
        margin: 0;
        color: rgba(255, 255, 255, .68);
        font-size: clamp(21px, 3.05svh, 27px);
        line-height: 1.32;
        font-weight: 410;
        letter-spacing: -.035em;
        text-shadow: 0 3px 20px rgba(0, 0, 0, .28);
    }

    .playlist-more-text {
        margin-left: 8px;
        color: rgba(255, 255, 255, .92);
        font-size: .8em;
        line-height: 1;
        font-weight: 820;
        letter-spacing: .02em;
    }

    .playlist-list-frame {
        width: min(100%, 980px);
        margin: 0 auto;
        padding: 0 clamp(20px, 5.4vw, 42px);
    }

    .playlist-list {
        width: 100%;
        padding: 0 0 var(--playlist-bottom);
    }

    .playlist-row {
        width: 100%;
        min-height: 72px;
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr) 58px;
        align-items: center;
        gap: 16px;
        margin: 0;
        padding: 8px 0 8px 12px;
        border-radius: 0;
        text-align: left;
        opacity: .98;
        position: relative;
        color: inherit;
        transition: opacity .18s var(--ease), transform .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
    }

    .playlist-row::after {
        content: "";
        position: absolute;
        left: 84px;
        right: 0;
        bottom: 0;
        height: 1px;
        background: rgba(255, 255, 255, .085);
    }

    .playlist-row:hover {
        background: rgba(255, 255, 255, .045);
    }

    .playlist-row:active {
        opacity: .74;
        transform: scale(.995);
    }

    .playlist-row.is-current {
        margin: 0 0 8px;
        padding: 8px 0 8px 12px;
        border-radius: 18px;
        background: rgba(255, 255, 255, .20);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
        backdrop-filter: blur(16px) saturate(150%);
        -webkit-backdrop-filter: blur(16px) saturate(150%);
    }

    .playlist-row.is-current::after {
        display: none;
    }

    .playlist-row.is-current .playlist-more {
        min-height: 100%;
        border-left: 1px solid rgba(0, 0, 0, .18);
    }

    .playlist-row.is-current .playlist-title {
        color: rgba(255, 255, 255, .98);
        /* font-weight: 690; */
    }

    .playlist-row.is-current .playlist-artist {
        color: rgba(255, 255, 255, .74);
    }

    .art {
        display: grid;
        place-items: center;
        overflow: hidden;
        color: white;
        background:
            radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .28), transparent 30%),
            linear-gradient(135deg, #db4c69, #375765);
        font-weight: 800;
        user-select: none;
    }

    .art img,
    .art video {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
    }

    .playlist-art {
        width: 56px;
        height: 56px;
        border-radius: 7px;
        font-size: 13px;
        box-shadow: 0 7px 16px rgba(0, 0, 0, .18);
    }

    .playlist-meta {
        min-width: 0;
        padding-right: 4px;
    }

    .playlist-title {
        color: rgba(255, 255, 255, .92);
        font-size: clamp(20px, 2.9svh, 24px);
        line-height: 1.12;
        font-weight: 450;
        letter-spacing: -.035em;
        text-shadow: 0 3px 14px rgba(0, 0, 0, .24);
    }

    .playlist-artist {
        margin-top: 4px;
        color: rgba(255, 255, 255, .62);
        font-size: clamp(19px, 2.7svh, 23px);
        line-height: 1.08;
        font-weight: 410;
        letter-spacing: -.03em;
    }

    .playlist-more {
        min-width: 0;
        height: 100%;
        display: grid;
        place-items: center;
        color: rgba(255, 255, 255, .84);
    }

    .playlist-more svg {
        width: 28px;
        height: 28px;
        display: block;
    }

    .empty-state,
    .playlist-loading,
    .playlist-error {
        padding: 26px 0;
        color: rgba(255, 255, 255, .58);
        text-align: center;
        font-size: 15px;
        line-height: 1.35;
    }

    .playlist-error {
        color: rgba(255, 210, 210, .76);
    }

    .mini-player {
        position: fixed;
        left: max(var(--mini-side), env(safe-area-inset-left, 0px));
        right: max(var(--mini-side), env(safe-area-inset-right, 0px));
        bottom: var(--mini-bottom);
        z-index: 20;
        height: var(--mini-h);
        display: grid;
        grid-template-columns: var(--mini-art-size) minmax(0, 1fr) var(--mini-btn-size) var(--mini-btn-size);
        align-items: center;
        gap: 7px;
        padding: 8px 9px 8px 16px;
        overflow: hidden;
        background: var(--mini-bg);
        border: 1px solid var(--mini-border);
        border-radius: 999px;
        box-shadow:
            0 10px 30px rgba(0, 0, 0, .30),
            inset 0 1px 0 rgba(255, 255, 255, .16),
            inset 0 -1px 0 rgba(255, 255, 255, .06);
        backdrop-filter: saturate(220%) blur(22px);
        -webkit-backdrop-filter: saturate(220%) blur(22px);
        contain: layout paint style;
        will-change: bottom;
    }

    .mini-player::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        border-radius: inherit;
        background:
            radial-gradient(circle at 18% 0%, rgba(255, 255, 255, .18), transparent 30%),
            radial-gradient(circle at 82% 16%, rgba(205, 139, 214, .12), transparent 38%),
            linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
    }

    .mini-art {
        position: relative;
        z-index: 1;
        width: var(--mini-art-size);
        height: var(--mini-art-size);
        border-radius: 6px;
        font-size: 10px;
        box-shadow: 0 5px 12px rgba(0, 0, 0, .30);
    }

    .mini-meta {
        position: relative;
        z-index: 1;
        min-width: 0;
        padding-left: 0;
    }

    .mini-title {
        color: rgba(255, 255, 255, .96);
        font-size: var(--mini-title-font-size);
        line-height: 1.04;
        font-weight: var(--mini-title-font-weight);
        letter-spacing: -.026em;
        text-shadow: 0 2px 12px rgba(0, 0, 0, .24);
    }

    .mini-artist {
        margin-top: 2px;
        color: rgba(255, 255, 255, .58);
        font-size: 12.5px;
        line-height: 1.05;
        font-weight: 500;
        letter-spacing: -.018em;
    }

    .player-btn {
        position: relative;
        z-index: 1;
        width: var(--mini-btn-size);
        height: var(--mini-btn-size);
        display: grid;
        place-items: center;
        border-radius: 999px;
        transition: transform .15s var(--ease), opacity .15s var(--ease);
    }

    .player-btn:active {
        transform: scale(.91);
        opacity: .76;
    }

    .player-icon {
        width: 30px;
        height: 27px;
        display: block;
        color: rgba(255, 255, 255, .96);
        pointer-events: none;
    }

    .player-btn.play .player-icon {
        width: 29px;
        height: 26px;
    }

    .player-icon svg {
        width: 100%;
        height: 100%;
        display: block;
    }

    .player-icon path {
        fill: currentColor;
    }

    .hidden-audio {
        display: none;
    }

    @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        .mini-player {
            background: rgba(32, 30, 35, .88);
        }
    }

    @media (min-width: 520px) {
        :root {
            --title-h: clamp(76px, 10svh, 118px);
            --mini-h: 44px;
            --mini-side: clamp(10px, 1.4vw, 16px);
            --mini-visual-gap: 9px;
            --mini-art-size: 28px;
            --mini-btn-size: 38px;
            --mini-title-font-size: 14px;
            --mini-title-font-weight: 500;
            --playlist-bottom-extra: 24px;
        }

        .brand {
            font-size: 34px;
        }

        .playlist-row {
            grid-template-columns: 58px minmax(0, 1fr) 62px;
            min-height: 74px;
            gap: 18px;
        }

        .playlist-art {
            width: 58px;
            height: 58px;
        }

        .player-icon {
            width: 28px;
            height: 25px;
        }

        .player-btn.play .player-icon {
            width: 27px;
            height: 24px;
        }
    }

    @media (max-height: 720px) {
        :root {
            --title-h: clamp(56px, 7.5svh, 68px);
            --hero-h: clamp(350px, 63svh, 560px);
            --playlist-bottom-extra: 18px;
        }

        .brand {
            font-size: clamp(22px, 3.8svh, 28px);
        }

        .playlist-hero-title {
            font-size: clamp(30px, 4.6svh, 42px);
        }

        .playlist-hero-subtitle {
            font-size: clamp(23px, 3.8svh, 34px);
            margin-top: 8px;
        }

        .preview-btn {
            min-height: 48px;
            min-width: 178px;
            padding: 0 26px;
            font-size: 23px;
            margin-top: 18px;
        }

        .playlist-info {
            padding-top: 22px;
            padding-bottom: 24px;
        }

        .playlist-description {
            font-size: clamp(18px, 3svh, 23px);
        }

        .playlist-row {
            min-height: 62px;
            grid-template-columns: 48px minmax(0, 1fr) 54px;
            gap: 14px;
            padding-left: 10px;
        }

        .playlist-row::after {
            left: 72px;
        }

        .playlist-art {
            width: 48px;
            height: 48px;
        }

        .playlist-title {
            font-size: 20px;
        }

        .playlist-artist {
            font-size: 19px;
        }
    }

    @media (max-width: 380px) {
        :root {
            --mini-side: clamp(8px, 2.8vw, 10px);
            --mini-visual-gap: 7px;
            --mini-h: 44px;
            --mini-art-size: 28px;
            --mini-btn-size: 36px;
            --mini-title-font-size: 12.5px;
            --mini-title-font-weight: 500;
        }

        .site-header-inner {
            padding: 0 22px;
            grid-template-columns: 48px minmax(0, 1fr) 48px;
        }

        .header-spacer {
            width: 48px;
        }

        .playlist-cover-actions {
            top: 18px;
            right: 18px;
        }

        .playlist-info,
        .playlist-list-frame {
            padding-left: 18px;
            padding-right: 18px;
        }

        .playlist-row {
            grid-template-columns: 46px minmax(0, 1fr) 48px;
            min-height: 60px;
            gap: 12px;
        }

        .playlist-row::after {
            left: 68px;
        }

        .playlist-art {
            width: 46px;
            height: 46px;
        }

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

        .playlist-artist {
            font-size: 17px;
        }

        .mini-player {
            gap: 5px;
            padding: 8px 7px 8px 13px;
        }

        .mini-artist {
            font-size: 10.5px;
        }

        .player-icon {
            width: 26px;
            height: 23px;
        }

        .player-btn.play .player-icon {
            width: 25px;
            height: 22px;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .animated-bg img {
            animation-duration: 90s;
        }

        .playlist-row,
        .player-btn,
        .hero-icon-btn,
        .preview-btn,
        .app-menu,
        .line::before,
        .line::after,
        .menucross::before,
        .menucross::after {
            transition-duration: .01ms;
        }
    }


    /* Requested playlist refinements: compact mobile scale, title starts at 94vw, description lives with the play area, and cover blur is scroll-driven. */
    .playlist-scroller {
        overflow-y: auto;
    }

    .playlist-scroll-content {
        min-height: 100%;
        transform: translateZ(0);
    }

    .playlist-hero {
        min-height: calc(94vw + 220px);
        overflow: hidden;
        background: var(--page-bg);
    }

    .playlist-cover {
        --cover-blur: 0px;
        --cover-scale: 1;
        height: 100%;
        bottom: auto;
        will-change: filter, transform;
    }

    .playlist-cover img,
    .playlist-cover video {
        filter: blur(var(--cover-blur));
        transform: scale(var(--cover-scale));
        transform-origin: center center;
        transition: opacity 360ms ease;
        will-change: filter, transform, opacity;
    }

    .playlist-cover-actions {
        top: clamp(18px, 5.2vw, 34px);
        right: clamp(17px, 4.7vw, 34px);
        min-height: 38px;
        padding: 5px 8px;
        border-radius: 16px;
        gap: 4px;
    }

    .hero-icon-btn {
        width: 30px;
        height: 30px;
        border-radius: 10px;
    }

    .share-icon {
        width: 16px;
        height: 21px;
    }

    .more-icon {
        width: 24px;
        height: 24px;
    }

    .playlist-hero-copy {
        position: relative;
        left: auto;
        bottom: auto;
        width: min(620px, calc(100% - 42px));
        margin: 0 auto;
        padding: 94vw 0 28px;
        transform: none;
        display: grid;
        justify-items: center;
        text-align: center;
        color: #fff;
        text-shadow: 0 4px 26px rgba(0, 0, 0, .36);
    }

    .playlist-hero-title {
        margin: 0;
        font-size: clamp(22px, 5vw, 34px);
        line-height: 1.02;
        font-weight: 600;
        letter-spacing: 0em;
    }

    .playlist-hero-subtitle {
        margin-top: 7px;
        font-size: clamp(21px, 5vw, 34px);
        line-height: 1.05;
        font-weight: 430;
        letter-spacing: -.048em;
        color: rgba(255, 255, 255, .94);
    }

    .preview-btn {
        margin-top: 16px;
        min-height: 40px;
        min-width: 130px;
        padding: 0 08px;
        gap: 5px;
        font-size: clamp(17px, 4vw, 22px);
        font-weight: 600;
        letter-spacing: -.032em;
    }

    .preview-btn svg {
        width: 19px;
        height: 19px;
    }

    .playlist-info {
        display: none;
    }

    .playlist-description,
    .playlist-description--hero {
        width: min(100%, 39em);
        margin: 22px auto 0;
        color: rgba(255, 255, 255, .68);
        font-size: clamp(12px, 2.9vw, 13px);
        line-height: 1.34;
        font-weight: 300;
        letter-spacing: -.018em;
        text-align: left;
        text-shadow: 0 3px 20px rgba(0, 0, 0, .28);
    }

    .playlist-more-text {
        margin-left: 7px;
        color: rgba(255, 255, 255, .92);
        font-size: .77em;
        line-height: 1;
        font-weight: 820;
        letter-spacing: .03em;
        white-space: nowrap;
    }

    .playlist-list-frame {
        padding: 2px clamp(18px, 5.4vw, 42px) 0;
    }

    .playlist-list {
        padding-bottom: var(--playlist-bottom);
    }

    .playlist-row {
        min-height: 52px;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 10px;
        padding: 8px 0 8px 5px;
    }

    .playlist-row::after {
        left: 5px;
        background: rgba(255, 255, 255, .075);
    }

    .playlist-row.is-current {
        margin-bottom: 6px;
        padding: 6px 0 6px 6px;
        border-radius: 14px;
        background: rgba(255, 255, 255, .18);
    }

    .playlist-row.is-current .playlist-more {
        border-left-color: rgba(0, 0, 0, .16);
    }

    .playlist-art {
        width: 38px;
        height: 38px;
        border-radius: 6px;
        font-size: 11px;
    }

    .playlist-title {
        font-size: var(--playlist-song-title-font-size);
        line-height: 1.12;
        font-weight: var(--playlist-song-title-font-weight);
        letter-spacing: -.024em;
    }

    .playlist-artist {
        margin-top: 5px;
        font-size: 12.5px;
        line-height: 1.08;
        font-weight: 450;
        letter-spacing: -.018em;
    }

    .playlist-more svg {
        width: 24px;
        height: 24px;
        opacity: .82;
    }

    @media (min-width: 520px) {
        .playlist-hero {
            min-height: clamp(520px, 82svh, 860px);
        }

        .playlist-hero-copy {
            width: min(680px, calc(100% - 64px));
            padding-top: clamp(350px, 56svh, 570px);
            padding-bottom: 36px;
        }

        .playlist-hero-title {
            font-size: clamp(30px, 4.4svh, 44px);
        }

        .playlist-hero-subtitle {
            font-size: clamp(23px, 3.6svh, 34px);
        }

        .playlist-description,
        .playlist-description--hero {
            font-size: clamp(14px, 1.8svh, 17px);
            line-height: 1.38;
            text-align: center;
        }

        .playlist-row {
            grid-template-columns: 48px minmax(0, 1fr) 50px;
            min-height: 58px;
            gap: 13px;
            padding-left: 7px;
        }

        .playlist-row::after {
            left: 68px;
        }

        .playlist-art {
            width: 48px;
            height: 48px;
        }
    }

    @media (max-width: 380px) {
        .playlist-hero {
            min-height: calc(94vw + 232px);
        }

        .playlist-hero-copy {
            width: calc(100% - 36px);
            padding-top: 94vw;
            padding-bottom: 24px;
        }

        .playlist-description,
        .playlist-description--hero {
            font-size: 12.5px;
        }

        .playlist-row {
            grid-template-columns: 40px minmax(0, 1fr) 40px;
            min-height: 50px;
            gap: 9px;
        }

        .playlist-row::after {
            left: 54px;
        }

        .playlist-art {
            width: 40px;
            height: 40px;
        }
    }

    /*
        Automatic cover-to-page blend.
        Edit only --page-bg in :root. Everything below derives from it.
    */
    .syncflow,
    .playlist-scroller,
    .playlist-scroll-content,
    .playlist-hero,
    .playlist-cover,
    .playlist-list-frame {
        background: var(--page-bg);
    }

    .site-header,
    header.site-header {
        background:
            linear-gradient(
                180deg,
                rgba(var(--page-bg-rgb), .94),
                rgba(var(--page-bg-rgb), .78)
            );
    }

    .playlist-hero {
        margin-bottom: -1px;
    }

    .playlist-hero::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -1px;
        z-index: 4;
        height: 18px;
        pointer-events: none;
        background: var(--page-bg);
    }

    .playlist-list-frame {
        position: relative;
        z-index: 5;
        margin: -1px auto 0;
    }

    .playlist-cover::before {
        z-index: 2;
        background:
            linear-gradient(
                180deg,
                rgba(var(--page-bg-rgb), 0) 0%,
                rgba(var(--page-bg-rgb), 0.02) var(--cover-color-start),
                rgba(var(--page-bg-rgb), 0.10) var(--cover-color-soft),
                rgba(var(--page-bg-rgb), 0.32) var(--cover-color-middle),
                rgba(var(--page-bg-rgb), 0.66) var(--cover-color-strong),
                rgba(var(--page-bg-rgb), 0.90) var(--cover-color-nearly-full),
                var(--page-bg) var(--cover-color-end),
                var(--page-bg) 100%
            );
    }

    .playlist-cover::after {
        z-index: 3;
        mix-blend-mode: normal;
        background:
            linear-gradient(
                90deg,
                rgba(0, 0, 0, .24) 0%,
                rgba(0, 0, 0, 0) 28%,
                rgba(0, 0, 0, 0) 72%,
                rgba(0, 0, 0, .24) 100%
            ),
            linear-gradient(
                180deg,
                rgba(0, 0, 0, .10) 0%,
                rgba(0, 0, 0, .08) 46%,
                rgba(0, 0, 0, 0) 100%
            );
        -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
        mask-image: linear-gradient(180deg, #000 0%, #000 72%, transparent 100%);
    }

    .playlist-cover-actions {
        background: rgba(var(--page-bg-rgb), .62);
    }

    .playlist-description,
    .playlist-description--hero {
        --description-lines: 3;
        --description-line-height: 1.34em;
        position: relative;
        max-height: calc(var(--description-line-height) * var(--description-lines));
        overflow: hidden;
        padding-right: 48px;
    }

    .playlist-description-text {
        display: inline;
    }

    .playlist-description.is-not-overflowing,
    .playlist-description--hero.is-not-overflowing {
        max-height: none;
        padding-right: 0;
    }

    .playlist-more-text {
        display: none;
        appearance: none;
        -webkit-appearance: none;
        position: absolute;
        right: 0;
        bottom: 0;
        margin: 0;
        padding: 0 0 0 20px;
        border: 0;
        color: rgba(255, 255, 255, .92);
        background: linear-gradient(90deg, rgba(var(--page-bg-rgb), 0), var(--page-bg) 34%);
        font: inherit;
        font-size: .77em;
        line-height: var(--description-line-height);
        font-weight: 820;
        letter-spacing: .03em;
        white-space: nowrap;
        cursor: pointer;
    }

    .playlist-description.is-overflowing .playlist-more-text,
    .playlist-description--hero.is-overflowing .playlist-more-text {
        display: inline-flex;
        align-items: center;
    }

    .text-popup {
        position: fixed;
        inset: 0;
        z-index: 90;
        display: grid;
        place-items: end center;
        padding: 0 14px calc(var(--mini-bottom) + var(--mini-h) + 14px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 180ms ease, visibility 180ms ease;
    }

    .text-popup.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .text-popup-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, .18);
        backdrop-filter: blur(7px);
        -webkit-backdrop-filter: blur(7px);
    }

    .text-popup-panel {
        position: relative;
        z-index: 1;
        width: min(540px, 100%);
        max-height: min(56dvh, 480px);
        overflow: auto;
        padding: 18px 18px 20px;
        border-radius: 24px;
        color: rgba(255, 255, 255, .92);
        background: rgba(var(--page-bg-rgb), .78);
        border: 1px solid rgba(255, 255, 255, .16);
        box-shadow: 0 18px 55px rgba(0, 0, 0, .34);
        backdrop-filter: blur(26px) saturate(160%);
        -webkit-backdrop-filter: blur(26px) saturate(160%);
        transform: translateY(14px) scale(.98);
        transition: transform 180ms var(--ease);
    }

    .text-popup.is-open .text-popup-panel {
        transform: translateY(0) scale(1);
    }

    .text-popup-title {
        margin: 0 42px 10px 0;
        font-size: 16px;
        line-height: 1.15;
        font-weight: 760;
        letter-spacing: -.02em;
    }

    .text-popup-text {
        margin: 0;
        font-size: 14px;
        line-height: 1.45;
        font-weight: 440;
        letter-spacing: -.012em;
        color: rgba(255, 255, 255, .78);
        white-space: pre-wrap;
    }

    .text-popup-close {
        position: absolute;
        top: 11px;
        right: 11px;
        width: 32px;
        height: 32px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        color: rgba(255, 255, 255, .90);
        background: rgba(255, 255, 255, .10);
        font-size: 22px;
        line-height: 1;
    }


    /* Top playlist action row: plain underlined back link on the left, compact actions on the right. */
    .playlist-cover-actions {
        left: max(clamp(16px, 5vw, 34px), env(safe-area-inset-left, 0px));
        right: max(clamp(16px, 4.6vw, 34px), env(safe-area-inset-right, 0px));
        top: clamp(12px, 3.8vw, 28px);
        width: auto;
        min-height: 36px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        color: rgba(255, 255, 255, .94);
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .hero-back-btn {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
        min-height: 36px;
        padding: 3px 10px;
        border-radius: 999px;
        background: rgba(var(--page-bg-rgb), .34);
        border: 1px solid rgba(255, 255, 255, .10);
        box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
        backdrop-filter: blur(18px) saturate(150%);
        -webkit-backdrop-filter: blur(18px) saturate(150%);
        font-size: clamp(13px, 3.25vw, 15px);
        line-height: 1;
        font-weight: 400;
    }

    .hero-back-btn:active {
        opacity: .72;
        transform: translateX(-1px) scale(.98);
    }

    .cover-action-icons {
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
        min-height: 36px;
        padding: 3px 4px;
        border-radius: 999px;
        background: rgba(var(--page-bg-rgb), .34);
        border: 1px solid rgba(255, 255, 255, .10);
        box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
        backdrop-filter: blur(18px) saturate(150%);
        -webkit-backdrop-filter: blur(18px) saturate(150%);
    }

    .cover-action-icons .hero-icon-btn {
        width: 30px;
        height: 30px;
        border-radius: 10px;
    }

    @media (min-width: 720px) {
        .playlist-cover-actions {
            top: 18px;
        }

        .hero-back-btn {
            font-size: 15px;
        }
    }

    @media (min-width: 720px) {
        .text-popup {
            place-items: center;
            padding: 24px;
        }

        .text-popup-panel {
            max-height: min(62dvh, 520px);
        }
    }


    /* ============================================================
       Marquee song lines (title + artist)
       Long titles/artists no longer truncate with "...". Once text
       overflows its row it holds, glides left to reveal the rest,
       holds again, then glides back — like Apple Music's now-playing
       marquee. Edges fade with a mask instead of clipping.
       ============================================================ */

    .playlist-title,
    .playlist-artist,
    .mini-title,
    .mini-artist,
    .expanded-title,
    .expanded-artist,
    .expanded-queue-song-title,
    .expanded-queue-song-artist {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .song-line {
        min-width: 0;
        display: block;
        position: relative;
    }

    .song-line-viewport {
        display: block;
        min-width: 0;
        overflow: hidden;
    }

    .song-line-text {
        display: inline-block;
        max-width: none;
        white-space: nowrap;
        transform: translate3d(0, 0, 0);
        will-change: transform;
    }

    .song-line.song-line--slider.is-current-marquee.is-marquee .song-line-viewport {
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 14px), transparent 100%);
    }

    .song-line.song-line--slider.is-current-marquee.is-marquee .song-line-text {
        animation: songLineMarquee var(--song-line-duration, 22s) var(--ease) infinite;
    }

    @keyframes songLineMarquee {
        0%, 18% {
            transform: translate3d(0, 0, 0);
        }

        50%, 68% {
            transform: translate3d(var(--song-line-shift, 0px), 0, 0);
        }

        100% {
            transform: translate3d(0, 0, 0);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .song-line.song-line--slider.is-current-marquee.is-marquee .song-line-text {
            animation: none;
        }

        .song-line.song-line--slider.is-current-marquee.is-marquee .song-line-viewport {
            -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 14px), transparent 100%);
            mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 14px), transparent 100%);
        }
    }

    /* ============================================================
       Expanded "Now Playing" player — Apple Music style full sheet.
       Everything below is ONE layout system: a single CSS Grid, laid
       out with grid-areas and normal flow. There are no stacked /
       duplicated position:absolute or position:fixed overrides —
       every element is positioned exactly once, so nothing here can
       fight the cascade or drift out of alignment.
       ============================================================ */

    body.is-expanded-player-open {
        overflow: hidden;
    }

    .syncflow.is-player-open .site-header,
    .syncflow.is-player-open .playlist-section,
    .syncflow.is-player-open .mini-player {
        opacity: 0;
        transform: scale(.985);
        filter: blur(20px);
        pointer-events: none;
        transition: opacity 260ms ease, transform 260ms var(--ease), filter 260ms ease;
    }

    .mini-player {
        cursor: pointer;
    }

    .expanded-player-modal {
        --expanded-bg-rgb: var(--page-bg-rgb);
        position: fixed;
        inset: 0;
        z-index: 120;
        overflow: hidden;
        color: #fff;
        background: #050505;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(100%);
        transition:
            transform 430ms cubic-bezier(.20, .86, .20, 1),
            opacity 230ms ease,
            visibility 430ms ease;
        isolation: isolate;
        overscroll-behavior: none;
    }

    .expanded-player-modal.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .expanded-player-bg,
    .expanded-player-dim {
        position: absolute;
        inset: 0;
        pointer-events: none;
    }

    .expanded-player-bg {
        z-index: 0;
        overflow: hidden;
        background:
            radial-gradient(circle at 72% 4%, rgba(255, 255, 255, .22), transparent 30%),
            radial-gradient(circle at 16% 36%, rgba(var(--expanded-bg-rgb), .58), transparent 44%),
            linear-gradient(180deg, rgba(var(--expanded-bg-rgb), .38) 0%, rgba(0, 0, 0, .86) 62%, #050505 100%);
    }

    .expanded-player-bg img {
        position: absolute;
        width: 150%;
        height: 150%;
        object-fit: cover;
        opacity: 0;
        border-radius: 999px;
        filter: blur(58px) saturate(175%) brightness(.82);
        transform: scale(1.04);
        transition: opacity 420ms ease, filter 420ms ease;
        will-change: transform, opacity;
    }

    .expanded-player-modal.has-cover .expanded-bg-color {
        opacity: .48;
        top: -36%;
        right: -42%;
        animation: expandedBgDrift 38s linear infinite;
        mix-blend-mode: screen;
    }

    .expanded-player-modal.has-cover .expanded-bg-shadow {
        opacity: .35;
        left: -42%;
        bottom: -38%;
        filter: blur(72px) saturate(145%) brightness(.72);
        animation: expandedBgDrift 52s linear infinite reverse;
        animation-delay: -11s;
        mix-blend-mode: soft-light;
    }

    .expanded-player-dim {
        z-index: 1;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, .05) 0%, rgba(0, 0, 0, .20) 24%, rgba(0, 0, 0, .78) 100%),
            radial-gradient(circle at 50% 44%, rgba(255, 255, 255, .08), transparent 44%);
        backdrop-filter: blur(18px) saturate(150%);
        -webkit-backdrop-filter: blur(18px) saturate(150%);
    }

    @keyframes expandedBgDrift {
        0% { transform: rotate(0deg) scale(1.04) translate3d(0, 0, 0); }
        50% { transform: rotate(180deg) scale(1.09) translate3d(2.5%, -1.5%, 0); }
        100% { transform: rotate(360deg) scale(1.04) translate3d(0, 0, 0); }
    }

    /* ---- Sheet: one grid, everything positioned by grid-area ---- */

    .expanded-player-sheet {
        --ep-side: max(30px, env(safe-area-inset-left, 0px));
        --ep-side-r: max(30px, env(safe-area-inset-right, 0px));
        --ep-top: max(10px, env(safe-area-inset-top, 0px));
        --ep-bottom: max(30px, env(safe-area-inset-bottom, 0px));
        --ep-gap: clamp(16px, 3svh, 26px);
        position: relative;
        z-index: 2;
        width: 100%;
        max-width: 460px;
        height: 100%;
        min-height: 100svh;
        min-height: 100dvh;
        margin: 0 auto;
        padding: var(--ep-top) var(--ep-side-r) var(--ep-bottom) var(--ep-side);
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) 0px auto;
        grid-template-areas:
            "handle"
            "main"
            "queue"
            "footer";
        row-gap: clamp(10px, 2svh, 16px);
        overflow: hidden;
    }

    .expanded-down-btn {
        grid-area: handle;
        justify-self: center;
        width: 58px;
        height: 32px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        color: rgba(255, 255, 255, .64);
        transition: transform 170ms ease, opacity 170ms ease, background 170ms ease;
    }

    .expanded-down-btn:hover,
    .expanded-down-btn:focus-visible {
        background: rgba(255, 255, 255, .08);
    }

    .expanded-down-btn:active {
        transform: scale(.92);
        opacity: .72;
    }

    .expanded-down-btn svg {
        width: 24px;
        height: 8px;
        display: block;
        fill: currentColor;
    }

    /* Now-playing body: art, track line, progress, controls — centered as a group */

    .expanded-main {
        grid-area: main;
        min-height: 0;
        display: grid;
        grid-template-rows: auto auto auto auto;
        grid-template-areas:
            "art"
            "track"
            "progress"
            "controls";
        row-gap: var(--ep-gap);
        align-content: center;
        justify-items: stretch;
        transition: opacity 240ms ease, filter 240ms ease;
    }

    .expanded-cover-art {
        grid-area: art;
        justify-self: center;
        width: min(72vw, 320px, 40svh);
        aspect-ratio: 1;
        height: auto;
        border-radius: 12px;
        overflow: hidden;
        box-shadow:
            0 28px 65px rgba(0, 0, 0, .44),
            0 1px 0 rgba(255, 255, 255, .08) inset;
        font-size: clamp(64px, 18vw, 112px);
        transition: width 260ms var(--ease), height 260ms var(--ease), border-radius 220ms ease, box-shadow 220ms ease;
    }

    .expanded-cover-art img,
    .expanded-cover-art video {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
    }

    .expanded-track-line {
        grid-area: track;
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 40px;
        align-items: center;
        gap: 12px;
        /* margin-top:4svh; */
    }

    .expanded-track-text,
    .expanded-queue-meta,
    .playlist-meta,
    .mini-meta {
        min-width: 0;
    }

    .expanded-title {
        font-size: clamp(15px, 4.1vw, 17px);
        line-height: 1.15;
        font-weight: 500;
        letter-spacing: -.034em;
        color: rgba(255, 255, 255, .98);
    }

    .expanded-artist {
        margin-top: 5px;
        font-size: clamp(15px, 4.1vw, 17px);
        line-height: 1.15;
        font-weight: 450;
        letter-spacing: -.03em;
        color: rgba(255, 255, 255, .58);
    }


    .expanded-track-more-btn {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        justify-self: end;
        border-radius: 999px;
        color: rgba(255, 255, 255, .70);
        transition: background 160ms ease, color 160ms ease, transform 160ms ease, opacity 160ms ease;
    }

    .expanded-track-more-btn:hover,
    .expanded-track-more-btn:focus-visible {
        background: rgba(255, 255, 255, .08);
        color: rgba(255, 255, 255, .96);
    }

    .expanded-track-more-btn:active {
        transform: scale(.92);
        opacity: .74;
    }

    .expanded-track-more-btn:disabled {
        opacity: .38;
        pointer-events: none;
    }

    .expanded-track-more-btn svg {
        width: 28px;
        height: 28px;
        display: block;
    }

    .expanded-repeat-btn,
    .expanded-playlist-btn {
        display: grid;
        place-items: center;
        color: rgba(255, 255, 255, .70);
        transition: background 160ms ease, color 160ms ease, transform 160ms ease, opacity 160ms ease;
    }

    .expanded-repeat-btn {
        display: none !important;
        width: 38px;
        height: 38px;
        border-radius: 999px;
        justify-self: end;
    }

    .expanded-repeat-btn svg {
        width: 31px;
        height: 27px;
        display: block;
    }

    .expanded-repeat-btn.is-active {
        color: rgba(255, 255, 255, .98);
        background: rgba(255, 255, 255, .12);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10);
    }

    .expanded-repeat-btn:active,
    .expanded-playlist-btn:active,
    .expanded-control-btn:active {
        transform: scale(.92);
        opacity: .74;
    }

    .expanded-progress-wrap {
        grid-area: progress;
        width: 100%;
    }

    .expanded-progress {
        --progress-pct: 0%;
        width: 100%;
        display: block;
        accent-color: rgba(255, 255, 255, .92);
        cursor: pointer;
    }

    .expanded-progress[type="range"] {
        -webkit-appearance: none;
        appearance: none;
        height: 18px;
        background: transparent;
        margin: 0;
    }

    .expanded-progress[type="range"]::-webkit-slider-runnable-track {
        height: 7px;
        border-radius: 999px;
        background:
            linear-gradient(90deg, rgba(255, 255, 255, .82) 0%, rgba(255, 255, 255, .82) var(--progress-pct), rgba(255, 255, 255, .34) var(--progress-pct), rgba(255, 255, 255, .34) 100%);
    }

    .expanded-progress[type="range"]::-moz-range-track {
        height: 7px;
        border-radius: 999px;
        background: rgba(255, 255, 255, .34);
    }

    .expanded-progress[type="range"]::-moz-range-progress {
        height: 7px;
        border-radius: 999px;
        background: rgba(255, 255, 255, .82);
    }

    .expanded-progress[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 0;
        height: 0;
    }

    .expanded-progress[type="range"]::-moz-range-thumb {
        width: 0;
        height: 0;
        border: 0;
    }

    .expanded-time-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 5px;
        color: rgba(255, 255, 255, .52);
        font-size: 13px;
        line-height: 1;
        font-weight: 400;
        letter-spacing: -.018em;
    }

    .expanded-control-row {
        grid-area: controls;
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        align-items: center;
        justify-items: center;
    }

    .expanded-control-btn {
        width: clamp(56px, 22vw, 72px);
        height: clamp(56px, 22vw, 72px);
        display: grid;
        place-items: center;
        border-radius: 999px;
        color: rgba(255, 255, 255, .97);
        transition: transform 150ms var(--ease), opacity 150ms var(--ease), background 150ms ease;
    }

    .expanded-control-btn:hover,
    .expanded-control-btn:focus-visible {
        background: rgba(255, 255, 255, .08);
    }

    .expanded-control-btn .player-icon {
        color: currentColor;
    }

    .expanded-play-btn .player-icon {
        width: clamp(56px, 22vw, 72px);
        height: clamp(56px, 22vw, 72px);
    }

    .expanded-prev-btn .player-icon,
    .expanded-next-btn .player-icon {
        width: clamp(38px, 30vw, 90px);
        height: clamp(34px, 9vw, 41px);
    }

    /* Footer: queue toggle button, always in its own row */

    .expanded-bottom-bar {
        grid-area: footer;
        width: 100%;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        /* padding-right: 70px; */
    }

    .expanded-playlist-btn {
        width: 30px;
        height: 30px;
        padding: 5px;
        padding-top: 0px;
        border-radius: 8px;
        color: rgba(255, 255, 255, .68);
    }

    .expanded-playlist-btn.is-active {
        color: rgb(0 0 0);
        background: rgb(255 255 255 / 37%);
    }

    .expanded-playlist-btn svg {
        width: 100%;
        height: 100%;
        display: block;
        fill: rgb(255 255 255 / 90%);
    }

    /* Queue */

    .expanded-queue-shell {
        grid-area: queue;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        min-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(16px);
        transition: opacity 230ms ease, visibility 230ms ease, transform 260ms var(--ease);
        margin-top: 8px;
    }

    .expanded-queue-heading {
        min-height: 40px;
        margin: 0 0 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
    }

    .expanded-queue-title {
        margin: 0;
        font-size: clamp(18px, 2.4svh, 22px);
        line-height: 1;
        font-weight: 600;
        letter-spacing: -.04em;
        color: rgba(255, 255, 255, .96);
    }

    .expanded-queue-actions {
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        color: rgba(255, 255, 255, .58);
    }

    .expanded-queue-action-btn {
        width: 38px;
        height: 38px;
        display: grid;
        place-items: center;
        border-radius: 999px;
        color: rgba(255, 255, 255, .58);
        transition: background 160ms ease, color 160ms ease, transform 160ms ease, opacity 160ms ease;
    }

    .expanded-queue-action-btn:hover,
    .expanded-queue-action-btn:focus-visible {
        background: rgba(255, 255, 255, .08);
    }

    .expanded-queue-action-btn:active {
        transform: scale(.92);
        opacity: .74;
    }

    .expanded-queue-action-btn.is-active {
        color: rgba(255, 255, 255, .96);
    }

    .expanded-queue-action-btn svg {
        width: 100%;
        height: 100%;
        display: block;
        fill: currentColor;
    }

    .expanded-queue-list {
        min-height: 0;
        overflow: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0px;
        -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 calc(100% - 40px), transparent 100%);
        mask-image: linear-gradient(180deg, #000 0%, #000 calc(100% - 40px), transparent 100%);
    }

    .expanded-queue-list::-webkit-scrollbar {
        display: none;
    }

    .expanded-queue-row {
        width: 100%;
        min-height: 56px;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) auto;
        align-items: center;
        gap: 20px;
        padding: 7px 0;
        color: rgba(255, 255, 255, .96);
        text-align: left;
        border-radius: 12px;
        transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
    }
    .expanded-queue-row:active {
        transform: scale(.99);
        opacity: .76;
    }

    .expanded-queue-art {
        width: 44px;
        height: 44px;
        border-radius: 8px;
        font-size: 11px;
    }

    .expanded-queue-song-title,
    .expanded-queue-song-artist {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .expanded-queue-song-title {
        font-size: 14.5px;
        line-height: 1.2;
        font-weight: 400;
        letter-spacing: -.02em;
    }

    .expanded-queue-song-artist {
        margin-top: 4px;
        font-size: 13px;
        line-height: 1.2;
        font-weight: 430;
        letter-spacing: -.015em;
        color: rgba(255, 255, 255, .54);
    }

    .expanded-queue-duration {
        align-self: center;
        white-space: nowrap;
        padding-left: 4px;
        color: rgba(255, 255, 255, .54);
        font-size: 13px;
        font-weight: 400;
        letter-spacing: -.02em;
    }

    .expanded-queue-empty {
        padding: 30px 4px;
        color: rgba(255, 255, 255, .56);
        font-size: 15px;
        line-height: 1.35;
    }

    /* ---- Queue open: header collapses to a compact row, list expands ---- */

    .expanded-player-modal.is-queue-open .expanded-player-sheet {
        grid-template-columns: 56px minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr) auto auto auto;
        grid-template-areas:
            "handle handle"
            "header-art header-track"
            "queue queue"
            "progress progress"
            "controls controls"
            "footer footer";
        row-gap: clamp(12px, 2svh, 16px);
        column-gap: 12px;
    }

    .expanded-player-modal.is-queue-open .expanded-main {
        display: contents;
    }

    .expanded-player-modal.is-queue-open .expanded-cover-art {
        grid-area: header-art;
        width: 56px;
        height: 56px;
        justify-self: start;
        align-self: center;
        border-radius: 8px;
        font-size: 22px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, .32);
    }

    .expanded-player-modal.is-queue-open .expanded-track-line {
        grid-area: header-track;
        align-self: center;
        min-height: 56px;
        gap: 8px;
    }

    .expanded-player-modal.is-queue-open .expanded-track-more-btn {
        width: 36px;
        height: 36px;
    }

    .expanded-player-modal.is-queue-open .expanded-title {
        font-size: 16.5px;
        line-height: 1.2;
        font-weight: 650;
    }

    .expanded-player-modal.is-queue-open .expanded-artist {
        margin-top: 4px;
        font-size: 14px;
        line-height: 1.2;
        font-weight: 430;
    }

    .expanded-player-modal.is-queue-open .expanded-repeat-btn {
        width: 36px;
        height: 36px;
    }

    .expanded-player-modal.is-queue-open .expanded-queue-shell {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    @media (min-width: 720px) {
        .expanded-queue-title {
            font-size: 22px;
        }
    }

    @media (max-height: 720px) {
        .expanded-player-sheet {
            --ep-gap: clamp(10px, 2svh, 16px);
        }

        .expanded-cover-art {
            width: min(58vw, 240px, 34svh);
        }

        .expanded-title {
            font-size: clamp(17px, 4.6vw, 20px);
        }

        .expanded-artist {
            font-size: clamp(14px, 3.8vw, 16px);
        }

        .expanded-control-btn {
            height: clamp(48px, 18vw, 60px);
        }

        .expanded-queue-row {
            min-height: 52px;
        }
    }

    @media (max-width: 380px) {
        .expanded-player-sheet {
            --ep-side: 16px;
            --ep-side-r: 16px;
        }

        .expanded-cover-art {
            width: min(78vw, 280px, 38svh);
        }

        .expanded-player-modal.is-queue-open .expanded-player-sheet {
            grid-template-columns: 48px minmax(0, 1fr);
        }

        .expanded-player-modal.is-queue-open .expanded-cover-art {
            width: 48px;
            height: 48px;
        }

        .expanded-queue-row {
            grid-template-columns: 40px minmax(0, 1fr) auto;
            gap: 10px;
        }

        .expanded-queue-art {
            width: 40px;
            height: 40px;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .expanded-player-modal,
        .expanded-main,
        .expanded-queue-shell,
        .expanded-control-btn,
        .expanded-repeat-btn,
        .expanded-track-more-btn,
        .expanded-playlist-btn {
            transition-duration: .01ms;
        }

        .expanded-player-bg img {
            animation-duration: 120s;
        }
    }

/* ==========================================================================
   v1.2 Mobile-safe expanded player structure
   --------------------------------------------------------------------------
   These rules intentionally sit last. They preserve the existing Apple Music
   styling, but make the sheet depend on the fixed modal's real height instead
   of stacking multiple viewport heights inside it.
   ========================================================================== */

.app-menu {
    height: auto;
    min-height: 0;
}

.menu-shell {
    min-height: calc(100% - var(--title-h));
}

.expanded-player-modal {
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: none;
}

.expanded-player-sheet {
    --ep-fluid-side: clamp(16px, 7vw, 35px);
    --ep-side: max(var(--ep-fluid-side), env(safe-area-inset-left, 0px));
    --ep-side-r: max(var(--ep-fluid-side), env(safe-area-inset-right, 0px));
    --ep-top: max(8px, env(safe-area-inset-top, 0px));
    --ep-bottom: max(14px, env(safe-area-inset-bottom, 0px));
    --ep-gap: clamp(12px, 2.4svh, 24px);
    height: 100%;
    min-height: 0;
    max-height: 100%;
    padding: var(--ep-top) var(--ep-side-r) var(--ep-bottom) var(--ep-side);
    grid-template-rows: auto minmax(0, 1fr) 0 minmax(42px, auto);
    row-gap: clamp(8px, 1.8svh, 14px);
    overflow: hidden;
}

.expanded-main {
    min-height: 0;
    row-gap: var(--ep-gap);
    align-content: center;
}

.expanded-cover-art {
    width: min(75vw, 350px, 58svh);
    max-width: 100%;
    max-height: min(72vw, 320px, 45svh);
    aspect-ratio: 1;
    height: auto;
}

.expanded-track-line,
.expanded-progress-wrap,
.expanded-control-row,
.expanded-bottom-bar {
    min-width: 0;
}

.expanded-player-modal:not(.is-queue-open) .expanded-track-line {
    margin-top: var(--expanded-cover-track-extra-gap);
}

.expanded-title,
.expanded-artist,
.expanded-queue-song-title,
.expanded-queue-song-artist {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expanded-control-btn {
    width: clamp(52px, 18vw, 72px);
    height: clamp(52px, 18vw, 72px);
}

.expanded-play-btn .player-icon {
    width: clamp(52px, 18vw, 72px);
    height: clamp(52px, 18vw, 72px);
}

.expanded-prev-btn .player-icon,
.expanded-next-btn .player-icon {
    width: clamp(38px, 21vw, 72px);
    height: clamp(32px, 8vw, 42px);
}

.expanded-queue-shell {
    min-height: 0;
    overflow: hidden;
}

.expanded-queue-list {
    min-height: 0;
    overscroll-behavior: contain;
    /* padding-bottom: clamp(12px, 2svh, 24px); */
}

.expanded-player-modal.is-queue-open .expanded-player-sheet {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto minmax(38px, auto);
    row-gap: clamp(8px, 1.7svh, 14px);
}

.expanded-player-modal.is-queue-open .expanded-queue-shell {
    min-height: 0;
    overflow: hidden;
}

.expanded-player-modal.is-queue-open .expanded-queue-list {
    min-height: 0;
    max-height: 100%;
}

/* Compact-height phones: reduce spacing before the layout starts clipping. */
@media (max-height: 720px) {
    .expanded-player-sheet {
        --ep-top: max(6px, env(safe-area-inset-top, 0px));
        --ep-bottom: max(10px, env(safe-area-inset-bottom, 0px));
        --ep-gap: clamp(9px, 1.8svh, 16px);
    }

    .expanded-down-btn {
        height: 28px;
    }

    .expanded-cover-art {
        width: min(62vw, 250px, 32svh);
        max-height: min(62vw, 250px, 32svh);
    }

    .expanded-title {
        font-size: clamp(17px, 4.5vw, 20px);
    }

    .expanded-artist {
        font-size: clamp(13px, 3.7vw, 16px);
    }

    .expanded-control-btn,
    .expanded-play-btn .player-icon {
        width: clamp(48px, 16vw, 60px);
        height: clamp(48px, 16vw, 60px);
    }

    .expanded-prev-btn .player-icon,
    .expanded-next-btn .player-icon {
        width: clamp(34px, 18vw, 60px);
        height: clamp(28px, 7vw, 38px);
    }

    .expanded-bottom-bar {
        min-height: 42px;
    }

    .expanded-queue-row {
        min-height: 52px;
    }
}

/* Very short screens: keep all controls usable without visual stretching. */
@media (max-height: 590px) {
    .expanded-player-sheet {
        --ep-gap: clamp(7px, 1.5svh, 11px);
        row-gap: 7px;
    }

    .expanded-down-btn {
        height: 24px;
    }

    .expanded-down-btn svg {
        width: 22px;
        height: 7px;
    }

    .expanded-cover-art {
        width: min(54vw, 190px, 27svh);
        max-height: min(54vw, 190px, 27svh);
        border-radius: 10px;
    }

    .expanded-track-line {
        gap: 8px;
    }

    .expanded-track-more-btn {
        width: 34px;
        height: 34px;
    }

    .expanded-title {
        font-size: clamp(15px, 4vw, 18px);
    }

    .expanded-artist {
        margin-top: 3px;
        font-size: clamp(12px, 3.4vw, 14px);
    }

    .expanded-progress[type="range"] {
        height: 14px;
    }

    .expanded-time-row {
        margin-top: 4px;
        font-size: 12px;
    }

    .expanded-control-btn,
    .expanded-play-btn .player-icon {
        width: 46px;
        height: 46px;
    }

    .expanded-prev-btn .player-icon,
    .expanded-next-btn .player-icon {
        width: 38px;
        height: 28px;
    }

    .expanded-bottom-bar {
        min-height: 34px;
    }

    .expanded-playlist-btn {
        width: 28px;
        height: 28px;
    }

    .expanded-player-modal.is-queue-open .expanded-player-sheet {
        grid-template-columns: 46px minmax(0, 1fr);
        row-gap: 7px;
    }

    .expanded-player-modal.is-queue-open .expanded-cover-art {
        width: 46px;
        height: 46px;
    }

    .expanded-player-modal.is-queue-open .expanded-track-line {
        min-height: 46px;
    }

    .expanded-player-modal.is-queue-open .expanded-title {
        font-size: 15px;
    }

    .expanded-player-modal.is-queue-open .expanded-artist {
        font-size: 12.5px;
    }

    .expanded-player-modal.is-queue-open .expanded-queue-heading {
        min-height: 32px;
        margin-bottom: 8px;
    }

    .expanded-player-modal.is-queue-open .expanded-queue-row {
        min-height: 48px;
        padding: 5px 0;
    }

    .expanded-player-modal.is-queue-open .expanded-queue-art {
        width: 38px;
        height: 38px;
    }
}

/* Narrow phones: keep text and queue rows from fighting the side padding. */
@media (max-width: 380px) {
    .expanded-player-sheet {
        --ep-fluid-side: 16px;
    }

    .expanded-cover-art {
        width: min(76vw, 280px, 36svh);
        max-height: min(76vw, 280px, 36svh);
    }

    .expanded-track-line {
        grid-template-columns: minmax(0, 1fr) 36px;
    }

    .expanded-track-more-btn {
        width: 34px;
        height: 34px;
    }

    .expanded-player-modal.is-queue-open .expanded-player-sheet {
        grid-template-columns: 46px minmax(0, 1fr);
        column-gap: 10px;
    }

    .expanded-player-modal.is-queue-open .expanded-cover-art {
        width: 46px;
        height: 46px;
    }

    .expanded-queue-row {
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 10px;
    }

    .expanded-queue-art {
        width: 38px;
        height: 38px;
    }
}

/* Landscape phones: use a two-column now-playing layout instead of squeezing vertically. */
@media (orientation: landscape) and (max-height: 540px) {
    .expanded-player-sheet {
        max-width: 720px;
        --ep-fluid-side: clamp(16px, 4vw, 28px);
    }

    .expanded-player-modal:not(.is-queue-open) .expanded-main {
        grid-template-columns: minmax(120px, min(34vw, 36svh)) minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "art track"
            "art progress"
            "art controls";
        align-content: center;
        column-gap: clamp(16px, 4vw, 28px);
        row-gap: clamp(8px, 2svh, 14px);
    }

    .expanded-player-modal:not(.is-queue-open) .expanded-cover-art {
        align-self: center;
        width: min(34vw, 36svh, 220px);
        max-height: min(34vw, 36svh, 220px);
    }

    .expanded-player-modal:not(.is-queue-open) .expanded-track-line,
    .expanded-player-modal:not(.is-queue-open) .expanded-progress-wrap,
    .expanded-player-modal:not(.is-queue-open) .expanded-control-row {
        align-self: center;
    }

    .expanded-player-modal:not(.is-queue-open) .expanded-track-line {
        margin-top: 0;
    }

    .expanded-player-modal:not(.is-queue-open) .expanded-control-row {
        justify-items: start;
        grid-template-columns: auto auto auto;
        gap: clamp(10px, 3vw, 22px);
    }

    .expanded-player-modal:not(.is-queue-open) .expanded-bottom-bar {
        min-height: 30px;
    }
}


/* ==========================================================================
   Queue-owned current song structure
   --------------------------------------------------------------------------
   The expanded slider keeps its own cover/title/artist block. When the queue
   opens, that block is hidden, and the queue renders its own compact current
   song row above the queue controls and upcoming songs.
   ========================================================================== */

.expanded-main {
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "nowplaying"
        "progress"
        "controls";
}

.expanded-slider-track-structure {
    grid-area: nowplaying;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas:
        "art"
        "track";
    row-gap: var(--ep-gap);
    align-items: center;
    justify-items: stretch;
}

.expanded-slider-track-structure .expanded-cover-art {
    grid-area: art;
}

.expanded-slider-track-structure .expanded-track-line {
    grid-area: track;
}

.expanded-player-modal.is-queue-open .expanded-slider-track-structure {
    display: none !important;
}

.expanded-player-modal.is-queue-open .expanded-player-sheet {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) auto auto minmax(38px, auto) !important;
    grid-template-areas:
        "handle"
        "queue"
        "progress"
        "controls"
        "footer" !important;
    column-gap: 0 !important;
}

.expanded-player-modal.is-queue-open .expanded-main {
    display: contents;
}

.expanded-queue-shell {
    grid-template-rows: auto auto minmax(0, 1fr);
}

.expanded-queue-current {
    width: 100%;
    min-width: 0;
    min-height: 56px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 18px;
    margin: 0 0 16px;
    padding: 6px 0;
    color: rgba(255, 255, 255, .96);
}

.expanded-player-modal:not(.is-queue-open) .expanded-queue-current {
    display: none;
}

.expanded-queue-current-art {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    font-size: 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .32);
}

.expanded-queue-current-meta {
    min-width: 0;
}

.expanded-queue-current-title,
.expanded-queue-current-artist {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.expanded-queue-current-title {
    font-size: 16.5px;
    line-height: 1.2;
    font-weight: 500;
    letter-spacing: -.025em;
    color: rgba(255, 255, 255, .98);
}

.expanded-queue-current-artist {
    margin-top: 4px;
    font-size: 16.5px;
    line-height: 1.2;
    font-weight: 430;
    letter-spacing: -.018em;
    color: rgba(255, 255, 255, .58);
}

.expanded-queue-current-more-btn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    justify-self: end;
    border-radius: 999px;
    color: rgba(255, 255, 255, .70);
    transition: background 160ms ease, color 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.expanded-queue-current-more-btn:hover,
.expanded-queue-current-more-btn:focus-visible {
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .96);
}

.expanded-queue-current-more-btn:active {
    transform: scale(.92);
    opacity: .74;
}

.expanded-queue-current-more-btn:disabled {
    opacity: .38;
    pointer-events: none;
}

.expanded-queue-current-more-btn svg {
    width: 28px;
    height: 28px;
    display: block;
}

.expanded-player-modal.is-queue-open .expanded-queue-heading {
    margin-bottom: 12px;
}

@media (max-height: 590px) {
    .expanded-player-modal.is-queue-open .expanded-player-sheet {
        grid-template-columns: minmax(0, 1fr) !important;
        row-gap: 7px;
    }

    .expanded-queue-current {
        min-height: 46px;
        grid-template-columns: 46px minmax(0, 1fr) 34px;
        gap: 10px;
        margin-bottom: 10px;
        padding: 4px 0;
    }

    .expanded-queue-current-art {
        width: 46px;
        height: 46px;
        border-radius: 8px;
        font-size: 16px;
    }

    .expanded-queue-current-title {
        font-size: 15px;
    }

    .expanded-queue-current-artist {
        font-size: 12.5px;
    }

    .expanded-queue-current-more-btn {
        width: 34px;
        height: 34px;
    }
}

@media (max-width: 380px) {
    .expanded-player-modal.is-queue-open .expanded-player-sheet {
        grid-template-columns: minmax(0, 1fr) !important;
        column-gap: 0 !important;
    }

    .expanded-queue-current {
        grid-template-columns: 46px minmax(0, 1fr) 34px;
        gap: 10px;
    }

    .expanded-queue-current-art {
        width: 46px;
        height: 46px;
    }
}
