.apx-player {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 9999;
    pointer-events: none;
    font-family: inherit;
    color: #fff;
}

.apx-player * { box-sizing: border-box; }
.apx-player .apx-main,
.apx-player .apx-panel { pointer-events: auto; }
.apx-core { display: none; }

.apx-main {
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(420px, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 10px 16px;
    border-radius: 18px;
    background: linear-gradient(90deg, rgba(7,9,14,.98), rgba(7,9,14,.96));
    box-shadow: 0 14px 48px rgba(0,0,0,.34);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.apx-left,
.apx-center,
.apx-right { min-width: 0; }

.apx-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.apx-cover {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    border: 0;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255,255,255,.06);
}

.apx-cover img,
.apx-queue-cover img,
.apx-library-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.apx-meta { min-width: 0; }

.apx-title,
.apx-artist,
.apx-queue-title,
.apx-queue-artist,
.apx-library-name,
.apx-library-sub,
.apx-mobile-kicker,
.apx-mobile-queue-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.apx-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.apx-artist {
    margin-top: 4px;
    color: rgba(255,255,255,.70);
    font-size: 12px;
    line-height: 1.2;
}

.apx-center {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr);
    gap: 16px;
    align-items: center;
    min-width: 0;
}

.apx-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: nowrap;
}

.apx-btn,
.apx-play,
.apx-panel-close,
.apx-auth-link,
.apx-queue-item,
.apx-library-item,
.apx-cover {
    transition: transform .16s ease, background .16s ease, color .16s ease, opacity .16s ease, border-color .16s ease;
}

.apx-btn,
.apx-panel-close {
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.92);
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

.apx-download {
    text-decoration: none;
}

.apx-btn:hover,
.apx-panel-close:hover,
.apx-cover:hover,
.apx-queue-item:hover,
.apx-library-item:hover,
.apx-auth-link:hover {
    transform: translateY(-1px);
}

.apx-btn.is-active,
.apx-btn.is-one,
.apx-like.is-active,
.apx-sleep.is-active {
    color: #30d7ff;
}

.apx-btn[disabled],
.apx-download.is-disabled {
    opacity: .35;
    pointer-events: none;
}

.apx-play {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #18c6f0;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(24,198,240,.30);
}

.apx-play a {
    color: inherit;
    text-decoration: none;
    line-height: 1;
}

.apx-progress-wrap {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.apx-time {
    font-size: 11px;
    color: rgba(255,255,255,.74);
    text-align: center;
    font-weight: 600;
}

.apx-progress {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    cursor: pointer;
    outline: none;
}

.apx-progress-buffered,
.apx-progress-fill,
.apx-progress-thumb {
    position: absolute;
    left: 0;
    top: 0;
    border-radius: inherit;
}

.apx-progress-buffered {
    width: 0;
    height: 100%;
    background: rgba(255,255,255,.22);
}

.apx-progress-fill {
    width: 0;
    height: 100%;
    background: #1fc8f1;
}

.apx-progress-thumb {
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border-radius: 50%;
    background: #fff;
    left: var(--thumb-left, 0%);
    transform: translateX(-50%);
    display: none;
}

.apx-progress:hover .apx-progress-thumb,
.apx-progress:focus .apx-progress-thumb { display: block; }

.apx-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.apx-like,
.apx-download,
.apx-library-toggle,
.apx-mute {
    display: inline-flex;
}

.apx-add,
.apx-sleep { display: none; }

.apx-volume {
    width: 110px;
    display: flex;
    align-items: center;
}

.apx-volume-range {
    width: 100%;
    accent-color: #f1d73a;
}

.apx-speed-wrap {
    display: none;
}

.apx-panels {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    display: flex;
    gap: 12px;
    max-width: min(980px, calc(100vw - 24px));
}

.apx-panel {
    width: min(420px, calc(100vw - 24px));
    max-height: min(72vh, 760px);
    display: none;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(12,14,20,.98);
    box-shadow: 0 16px 50px rgba(0,0,0,.36);
}

.apx-panel.is-open { display: block; }

.apx-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.apx-panel-title {
    font-size: 16px;
    font-weight: 700;
}

.apx-panel-subtitle {
    padding: 10px 16px 4px;
    font-size: 12px;
    color: rgba(255,255,255,.66);
}

.apx-queue-list,
.apx-library-body {
    padding: 8px;
    max-height: calc(min(72vh, 760px) - 70px);
    overflow: auto;
}

.apx-empty {
    padding: 22px 16px;
    text-align: center;
    line-height: 1.5;
    color: rgba(255,255,255,.72);
}

.apx-queue-item,
.apx-library-item {
    width: 100%;
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 10px;
    align-items: center;
    text-align: left;
    color: #fff;
    background: transparent;
    border: 0;
    text-decoration: none;
    border-radius: 14px;
    padding: 8px;
    cursor: pointer;
}

.apx-queue-item.is-current,
.apx-queue-item:hover,
.apx-library-item:hover {
    background: rgba(255,255,255,.08);
}

.apx-queue-cover,
.apx-library-cover {
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255,255,255,.06);
}

.apx-queue-meta,
.apx-library-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.apx-queue-title,
.apx-library-name {
    font-size: 14px;
    font-weight: 600;
}

.apx-queue-artist,
.apx-queue-duration,
.apx-library-sub {
    font-size: 12px;
    color: rgba(255,255,255,.66);
}

.apx-library-section + .apx-library-section { margin-top: 10px; }
.apx-library-section h4 {
    margin: 6px 8px 8px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,.7);
}

.apx-auth-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: #1db954;
    color: #fff;
    text-decoration: none;
    margin-top: 10px;
}

.apx-mobile-top { display: none; }

html.apx-lock-scroll,
body.apx-lock-scroll {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: none;
}

@media (max-width: 1260px) {
    .apx-main {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .apx-center {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .apx-controls {
        justify-content: center;
    }

    .apx-right {
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .apx-player {
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom, 0px));
        z-index: 10050;
    }

    .apx-main {
        display: grid;
        grid-template-columns: minmax(0,1fr) auto auto;
        grid-template-areas:
            'left right center'
            'progress progress progress';
        gap: 10px 12px;
        align-items: center;
        padding: 10px 12px 11px;
        min-height: 88px;
        max-height: 112px;
        border-radius: 28px;
        background: linear-gradient(135deg, rgba(52,61,84,.96), rgba(34,39,54,.97));
        box-shadow: 0 16px 46px rgba(0,0,0,.34);
        overflow: hidden;
        touch-action: none;
    }

    .apx-mobile-top { display: none !important; }

    .apx-left {
        grid-area: left;
        gap: 12px;
        min-width: 0;
    }

    .apx-cover {
        width: 56px;
        height: 56px;
        flex-basis: 56px;
        border-radius: 16px;
    }

    .apx-title {
        font-size: 16px;
        line-height: 1.08;
        font-weight: 800;
        letter-spacing: -.02em;
    }

    .apx-artist {
        font-size: 12px;
        margin-top: 4px;
    }

    .apx-right {
        grid-area: right;
        gap: 8px;
        justify-content: flex-end;
    }

    .apx-right > * { display: none; }
    .apx-right .apx-like {
        display: inline-flex;
        width: 42px;
        min-width: 42px;
        height: 42px;
        border-radius: 14px;
        background: rgba(255,255,255,.08);
    }

    .apx-center {
        grid-area: center;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        min-width: auto;
    }

    .apx-controls {
        justify-content: flex-end;
        gap: 0;
    }

    .apx-controls .apx-btn { display: none; }

    .apx-controls .apx-play {
        width: 52px;
        height: 52px;
        flex: 0 0 52px;
        border-radius: 50%;
        background: #f1ff00;
        color: #1c2230;
        font-size: 18px;
        box-shadow: 0 12px 34px rgba(241,255,0,.32);
    }

    .apx-progress-wrap {
        grid-area: progress;
        grid-template-columns: 1fr;
        gap: 0;
        margin-top: 0;
    }

    .apx-progress-wrap .apx-time { display: none !important; }

    .apx-progress {
        height: 3px;
        background: rgba(255,255,255,.14);
    }

    .apx-progress-buffered { background: rgba(255,255,255,.22); }
    .apx-progress-fill { background: #24d0ff; }
    .apx-progress-thumb { display: none !important; }

    .apx-panels {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px) + 100px);
        max-width: none;
        z-index: 10060;
        pointer-events: none;
    }

    .apx-panel {
        width: 100%;
        max-height: 58vh;
        pointer-events: auto;
        border-radius: 22px;
    }

}
@media (max-width: 767px) {
    .apx-player.is-mobile-expanded {
        inset: 0;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 10080;
        pointer-events: auto;
        background:
            linear-gradient(180deg, #55607a 0%, #4b556d 44%, #434c61 100%);
    }

    .apx-player.is-mobile-expanded .apx-main {
        position: fixed;
        inset: 0;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "top"
            "cover"
            "center"
            "actions";
        grid-template-rows: auto auto auto 1fr;
        gap: 18px;
        align-content: start;
        padding:
            calc(env(safe-area-inset-top, 0px) + 12px)
            16px
            calc(env(safe-area-inset-bottom, 0px) + 14px);
        min-height: 100dvh;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: hidden;
        touch-action: pan-y;
    }

    .apx-player.is-mobile-expanded .apx-mobile-top {
        grid-area: top;
        display: grid !important;
        grid-template-columns: 40px minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        min-height: 40px;
    }

    .apx-player.is-mobile-expanded .apx-mobile-headings {
        display: block;
        min-width: 0;
        text-align: center;
    }

    .apx-player.is-mobile-expanded .apx-mobile-kicker {
        display: block;
        font-size: 11px;
        line-height: 1.2;
        color: rgba(255,255,255,.70);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .apx-player.is-mobile-expanded .apx-mobile-queue-title {
        display: block;
        margin-top: 2px;
        font-size: 14px;
        font-weight: 700;
        line-height: 1.2;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .apx-player.is-mobile-expanded .apx-mobile-collapse {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: 0;
        padding: 0;
        border-radius: 14px;
        background: rgba(255,255,255,.08);
        color: rgba(255,255,255,.92);
        font-size: 24px;
    }

    .apx-player.is-mobile-expanded .apx-mobile-top-actions {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
    }

    .apx-player.is-mobile-expanded .apx-mobile-top-actions .apx-btn {
        display: inline-flex;
        width: 40px;
        min-width: 40px;
        height: 40px;
        border-radius: 14px;
        background: rgba(255,255,255,.08);
        color: rgba(255,255,255,.92);
    }

    .apx-player.is-mobile-expanded .apx-left {
        grid-area: cover;
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        align-content: start;
        gap: 14px;
        min-width: 0;
    }

    .apx-player.is-mobile-expanded .apx-cover {
        width: min(68vw, 260px);
        height: min(68vw, 260px);
        flex-basis: auto;
        border-radius: 22px;
        box-shadow: 0 16px 42px rgba(0,0,0,.24);
    }

    .apx-player.is-mobile-expanded .apx-meta {
        width: 100%;
        max-width: min(92vw, 420px);
        text-align: center;
    }

    .apx-player.is-mobile-expanded .apx-title {
        font-size: clamp(24px, 6vw, 32px);
        line-height: 1.08;
        font-weight: 800;
        letter-spacing: -.02em;
        white-space: normal;
        word-break: break-word;
    }

    .apx-player.is-mobile-expanded .apx-artist {
        margin-top: 6px;
        font-size: 14px;
        line-height: 1.3;
        color: rgba(255,255,255,.78);
        white-space: normal;
        word-break: break-word;
    }

    .apx-player.is-mobile-expanded .apx-center {
        grid-area: center;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "progress"
            "controls";
        gap: 16px;
        min-width: 0;
    }

    .apx-player.is-mobile-expanded .apx-progress-wrap {
        grid-area: progress;
        grid-template-columns: 44px 1fr 44px;
        gap: 10px;
        align-items: center;
    }

    .apx-player.is-mobile-expanded .apx-progress-wrap .apx-time {
        display: block !important;
        font-size: 12px;
        color: rgba(255,255,255,.82);
    }

    .apx-player.is-mobile-expanded .apx-progress {
        height: 5px;
        background: rgba(255,255,255,.20);
    }

    .apx-player.is-mobile-expanded .apx-progress-fill {
        background: #24d0ff;
    }

    .apx-player.is-mobile-expanded .apx-progress-thumb {
        display: block !important;
        width: 12px;
        height: 12px;
        margin-top: -6px;
        background: #fff;
    }

    .apx-player.is-mobile-expanded .apx-controls {
        grid-area: controls;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 14px;
        flex-wrap: nowrap;
    }

    .apx-player.is-mobile-expanded .apx-controls .apx-btn {
        display: inline-flex;
        width: 48px;
        min-width: 48px;
        height: 48px;
        border-radius: 50%;
        background: rgba(255,255,255,.08);
        color: rgba(255,255,255,.92);
        font-size: 20px;
    }

    .apx-player.is-mobile-expanded .apx-controls .apx-play {
        width: 72px;
        height: 72px;
        flex: 0 0 72px;
        border-radius: 50%;
        font-size: 24px;
        background: #f1ff00;
        color: #1c2230;
        box-shadow: 0 12px 34px rgba(241,255,0,.32);
    }

    .apx-player.is-mobile-expanded .apx-right {
        grid-area: actions;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
        align-content: start;
        min-width: 0;
    }

    .apx-player.is-mobile-expanded .apx-right > * {
        display: flex;
        min-width: 0;
    }

    .apx-player.is-mobile-expanded .apx-like,
    .apx-player.is-mobile-expanded .apx-add,
    .apx-player.is-mobile-expanded .apx-download,
    .apx-player.is-mobile-expanded .apx-sleep,
    .apx-player.is-mobile-expanded .apx-library-toggle,
    .apx-player.is-mobile-expanded .apx-mute {
        width: 100%;
        min-height: 44px;
        border-radius: 14px;
        background: rgba(255,255,255,.08);
        font-size: 18px;
        align-items: center;
        justify-content: center;
    }

    .apx-player.is-mobile-expanded .apx-add,
    .apx-player.is-mobile-expanded .apx-sleep,
    .apx-player.is-mobile-expanded .apx-speed-wrap {
        display: inline-flex;
    }

    .apx-player.is-mobile-expanded .apx-volume {
        grid-column: 2 / span 2;
        width: 100%;
        min-height: 44px;
        border-radius: 14px;
        background: rgba(255,255,255,.08);
        padding: 0 12px;
    }

    .apx-player.is-mobile-expanded .apx-speed-wrap {
        grid-column: 3 / -1;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        min-height: 44px;
        padding: 0 10px;
        border-radius: 14px;
        background: rgba(255,255,255,.08);
        font-size: 13px;
    }

    .apx-player.is-mobile-expanded .apx-speed {
        border: 0;
        background: transparent;
        color: #fff;
        outline: none;
    }

    .apx-player.is-mobile-expanded .apx-panels {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
        top: auto;
        height: min(40dvh, 320px);
        max-width: none;
        z-index: 10090;
        pointer-events: none;
    }

    .apx-player.is-mobile-expanded .apx-panel {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 22px;
        background: rgba(17,19,24,.98);
        pointer-events: auto;
    }

    .apx-player.is-mobile-expanded .apx-queue-list,
    .apx-player.is-mobile-expanded .apx-library-body {
        height: calc(100% - 70px);
        max-height: none;
        overflow: auto;
    }
}


/* ===== SVG icon pack ===== */
.apx-svg {
    display: block;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    color: inherit;
    pointer-events: none;
}

.apx-btn,
.apx-panel-close,
.apx-play a,
.apx-mobile-collapse {
    line-height: 0;
}

.apx-btn .apx-svg,
.apx-panel-close .apx-svg,
.apx-mobile-top-actions .apx-btn .apx-svg,
.apx-mobile-collapse .apx-svg,
.apx-speed-wrap > span .apx-svg {
    width: 20px;
    height: 20px;
}

.apx-panel-close .apx-svg {
    width: 18px;
    height: 18px;
}

.apx-mute .apx-svg,
.apx-download .apx-svg {
    width: 21px;
    height: 21px;
}

.apx-play {
    background: transparent;
    box-shadow: none;
    color: #18c6f0;
    font-size: 0;
}

.apx-play a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.apx-play .apx-svg {
    width: 58px;
    height: 58px;
    filter: drop-shadow(0 10px 28px rgba(24,198,240,.30));
}

.apx-speed-wrap > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: rgba(255,255,255,.92);
    flex: 0 0 16px;
}

.apx-speed-wrap > span .apx-svg {
    width: 16px;
    height: 16px;
}

.apx-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.apx-row-icon .apx-svg {
    width: 18px;
    height: 18px;
}

.apx-btn.is-active .apx-svg,
.apx-btn.is-one .apx-svg,
.apx-like.is-active .apx-svg,
.apx-sleep.is-active .apx-svg {
    color: #30d7ff;
}

@media (max-width: 767px) {
    .apx-player.is-mobile-expanded .apx-controls .apx-play {
        background: transparent;
        box-shadow: none;
        color: #f1ff00;
    }

    .apx-player.is-mobile-expanded .apx-controls .apx-play .apx-svg {
        width: 72px;
        height: 72px;
        filter: drop-shadow(0 12px 34px rgba(241,255,0,.32));
    }

    .apx-player.is-mobile-expanded .apx-controls .apx-btn .apx-svg,
    .apx-player.is-mobile-expanded .apx-mobile-top-actions .apx-btn .apx-svg,
    .apx-player.is-mobile-expanded .apx-mobile-collapse .apx-svg,
    .apx-player.is-mobile-expanded .apx-right .apx-btn .apx-svg,
    .apx-player.is-mobile-expanded .apx-right .apx-download .apx-svg {
        width: 22px;
        height: 22px;
    }
}
