/* Listening playlist panel (selected .chksoras items) */
#btplayselected { display: none !important; } /* replaced by #plpanel */

#plpanel {
    --pl-navy: #122d64;
    --pl-navy-2: #1c3d80;
    --pl-wine: #9c2d57;
    --pl-gold: #f5a623;
    --pl-bg: #ffffff;
    --pl-soft: #f3f5fa;
    --pl-line: #e3e7f0;
    --pl-text: #23324f;
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 380px;
    max-width: calc(100vw - 24px);
    z-index: 10000;
    direction: rtl;
    font-family: inherit;
    color: var(--pl-text);
    background: var(--pl-bg);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(18, 45, 100, .28), 0 2px 8px rgba(18, 45, 100, .12);
    overflow: hidden;
    transform: translateY(30px) scale(.97);
    opacity: 0;
    visibility: hidden;
    transition: transform .3s cubic-bezier(.2, .9, .3, 1.2), opacity .25s ease, visibility .25s;
}
#plpanel.pl-show { transform: none; opacity: 1; visibility: visible; }
#plpanel *, #plpanel *:before, #plpanel *:after { box-sizing: border-box; }
#plpanel button { font-family: inherit; cursor: pointer; border: 0; background: none; padding: 0; color: inherit; }

/* header */
#plpanel .pl-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--pl-navy) 0%, var(--pl-navy-2) 100%);
    color: #fff;
    cursor: pointer;
    user-select: none;
}
#plpanel .pl-head-ico {
    width: 36px; height: 36px; flex: 0 0 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: var(--pl-gold); font-size: 16px;
}
#plpanel .pl-head-title { flex: 1; min-width: 0; line-height: 1.3; }
#plpanel .pl-head-title strong { display: block; font-size: 16px; font-weight: bold; }
#plpanel .pl-head-title small { display: block; font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#plpanel .pl-count {
    min-width: 28px; height: 28px; padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 14px; background: var(--pl-gold); color: var(--pl-navy);
    font: bold 14px/1 Arial, Helvetica, sans-serif;
}
#plpanel .pl-count.pl-bump { animation: plBump .45s ease; }
@keyframes plBump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
#plpanel .pl-hbtn {
    width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; opacity: .8; transition: background .2s, opacity .2s, transform .3s;
}
#plpanel .pl-hbtn:hover { opacity: 1; background: rgba(255, 255, 255, .15); }
#plpanel.pl-min .pl-toggle { transform: rotate(180deg); }

/* now playing */
#plpanel .pl-now {
    padding: 12px 14px 10px;
    background: var(--pl-soft);
    border-bottom: 1px solid var(--pl-line);
}
#plpanel .pl-now-title {
    font-size: 14px; font-weight: bold; color: var(--pl-navy);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 8px;
}
#plpanel .pl-now-title span { color: #8a94a8; font-weight: normal; font-size: 12px; }
#plpanel .pl-ctrls { display: flex; align-items: center; gap: 8px; }
#plpanel .pl-cbtn {
    width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--pl-navy); background: #fff; border: 1px solid var(--pl-line);
    transition: background .2s, color .2s, transform .15s;
}
#plpanel .pl-cbtn:hover { background: var(--pl-navy); color: #fff; }
#plpanel .pl-cbtn:active { transform: scale(.92); }
#plpanel .pl-cbtn.pl-main {
    width: 44px; height: 44px; font-size: 16px;
    background: var(--pl-wine); color: #fff; border-color: var(--pl-wine);
    box-shadow: 0 4px 12px rgba(156, 45, 87, .35);
}
#plpanel .pl-cbtn.pl-main:hover { background: #82224a; }
#plpanel .pl-progress {
    flex: 1; height: 6px; border-radius: 3px; background: #dde2ec;
    overflow: hidden; direction: ltr; cursor: pointer;
}
#plpanel .pl-progress i {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--pl-gold), var(--pl-wine));
    transition: width .25s linear;
}
#plpanel .pl-time { font: 11px/1 Arial, Helvetica, sans-serif; color: #8a94a8; direction: ltr; min-width: 34px; text-align: center; }

/* list */
#plpanel .pl-list {
    list-style: none; margin: 0; padding: 6px 0;
    max-height: 300px; overflow-y: auto;
    scrollbar-width: thin;
}
#plpanel .pl-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; margin: 0;
    border-right: 3px solid transparent;
    background: #fff;
    transition: background .2s, border-color .2s;
    animation: plIn .3s ease;
}
@keyframes plIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
#plpanel .pl-item:hover { background: var(--pl-soft); }
#plpanel .pl-item.pl-playing { background: #fbf1f5; border-right-color: var(--pl-wine); }
#plpanel .pl-drag { color: #c3c9d6; cursor: grab; font-size: 13px; }
#plpanel .pl-num {
    width: 26px; height: 26px; flex: 0 0 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--pl-soft); color: var(--pl-navy);
    font: bold 11px/1 Arial, Helvetica, sans-serif;
}
#plpanel .pl-item.pl-playing .pl-num { background: var(--pl-wine); color: #fff; }
#plpanel .pl-eq { display: none; gap: 2px; align-items: flex-end; height: 12px; }
#plpanel .pl-eq b { width: 3px; background: #fff; animation: plEq .9s ease-in-out infinite; }
#plpanel .pl-eq b:nth-child(2) { animation-delay: .2s; }
#plpanel .pl-eq b:nth-child(3) { animation-delay: .4s; }
@keyframes plEq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
#plpanel .pl-item.pl-playing.pl-running .pl-num span { display: none; }
#plpanel .pl-item.pl-playing.pl-running .pl-eq { display: inline-flex; }
#plpanel .pl-info { flex: 1; min-width: 0; cursor: pointer; line-height: 1.35; }
#plpanel .pl-info strong { display: block; font-size: 14px; color: var(--pl-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#plpanel .pl-info small { display: block; font-size: 11px; color: #8a94a8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#plpanel .pl-rm {
    width: 26px; height: 26px; border-radius: 50%;
    color: #b5bccb; opacity: 0; transition: opacity .2s, background .2s, color .2s;
}
#plpanel .pl-item:hover .pl-rm { opacity: 1; }
#plpanel .pl-rm:hover { background: #fde8ee; color: var(--pl-wine); }
#plpanel .pl-placeholder { height: 42px; background: var(--pl-soft); border: 2px dashed var(--pl-line); margin: 2px 10px; border-radius: 8px; }

/* footer */
#plpanel .pl-foot {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--pl-line);
}
#plpanel .pl-playall {
    flex: 1; height: 40px; border-radius: 20px;
    background: var(--pl-navy); color: #fff; font-size: 15px; font-weight: bold;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .2s, transform .15s;
}
#plpanel .pl-playall i { color: var(--pl-gold); }
#plpanel .pl-playall:hover { background: var(--pl-navy-2); }
#plpanel .pl-playall:active { transform: scale(.98); }
#plpanel .pl-rep {
    display: inline-flex; align-items: center; gap: 4px;
    height: 40px; padding: 0 10px; border-radius: 20px;
    background: var(--pl-soft); font-size: 12px; color: var(--pl-navy);
}
#plpanel .pl-rep select {
    border: 0; background: transparent; color: var(--pl-navy);
    font: bold 13px Arial, Helvetica, sans-serif; cursor: pointer; padding: 0 2px;
}
#plpanel .pl-clear {
    height: 40px; padding: 0 12px; border-radius: 20px;
    font-size: 13px; color: var(--pl-wine);
    transition: background .2s;
}
#plpanel .pl-clear:hover { background: #fde8ee; }

/* minimized */
#plpanel.pl-min .pl-body { display: none; }

/* page rows that are in the playlist */
li.trpoem.pl-inlist { box-shadow: inset -3px 0 0 #9c2d57; }

/* small screens: bottom sheet that slides up from the bottom edge */
@media (max-width: 767px) {
    #plpanel {
        left: 0; right: 0; bottom: 0;
        width: 100%; max-width: 100%;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -10px 30px rgba(18, 45, 100, .25);
        padding-bottom: env(safe-area-inset-bottom, 0);
        opacity: 1;
        transform: translateY(105%);
        transition: transform .38s cubic-bezier(.22, .9, .3, 1), visibility .38s;
    }
    #plpanel.pl-show { transform: translateY(0); }
    /* grab handle */
    #plpanel .pl-head { position: relative; padding-top: 18px; }
    #plpanel .pl-head:before {
        content: ""; position: absolute; top: 7px; left: 50%;
        width: 40px; height: 4px; margin-left: -20px;
        border-radius: 2px; background: rgba(255, 255, 255, .45);
    }
    #plpanel .pl-list { max-height: 38vh; }
    #plpanel .pl-rm { opacity: 1; }
    #plpanel .pl-body { animation: plSheet .3s ease; }
    @keyframes plSheet { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

    /* keep the page content and the scroll-up button above the sheet */
    body.pl-open { padding-bottom: 80px; }
    body.pl-open #scrollup { bottom: calc(var(--pl-h, 80px) + 12px) !important; transition: bottom .3s; }
}
