.pl-add-row { display: flex; gap: 8px; margin-bottom: 14px; }
.pl-add-row input {
    flex: 1; padding: 10px 12px; border-radius: 10px;
    border: 1.5px solid var(--border); background: var(--card2);
    color: var(--text); font-size: 13px; outline: none; transition: border-color .15s;
}
.pl-add-row input:focus { border-color: #10b981; }
.pl-add-btn {
    padding: 10px 14px; border-radius: 10px; background: #10b981;
    color: #fff; border: none; font-weight: 700; font-size: 14px;
    cursor: pointer; white-space: nowrap; transition: opacity .15s;
}
.pl-add-btn:hover { opacity: .88; }

.pl-list { display: flex; flex-direction: column; gap: 8px; }
.pl-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border-radius: 12px; background: var(--card2); border: 1px solid var(--border);
    transition: border-color .15s;
}
.pl-item:hover { border-color: #10b981; }
.pl-item.pl-active { border-color: #10b981; background: rgba(16,185,129,.07); }
.pl-thumb { width: 46px; height: 34px; border-radius: 6px; object-fit: cover; background: var(--border); flex-shrink: 0; }
.pl-info { flex: 1; min-width: 0; }
.pl-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-by    { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pl-play-btn {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: #10b981; color: #fff; border: none; cursor: pointer;
    font-size: 14px; display: flex; align-items: center; justify-content: center;
    transition: opacity .15s;
}
.pl-play-btn:hover { opacity: .85; }
.pl-del-btn {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: none; border: none; color: var(--muted); cursor: pointer;
    font-size: 12px; transition: color .15s;
}
.pl-del-btn:hover { color: #ef4444; }
.pl-empty { text-align: center; padding: 30px; color: var(--muted); }
.pl-empty i { font-size: 32px; display: block; margin-bottom: 8px; }

/* ── iframe مخفي دائم خارج المودال (لا يتوقف عند الإغلاق) ── */
#plPersistFrame {
    position: fixed; width: 0; height: 0;
    opacity: 0; pointer-events: none; border: 0;
    bottom: 0; left: 0; z-index: -1;
}

/* placeholder داخل المودال يُظهر صورة مصغّرة بدلاً من iframe */
#plPlayerThumb {
    display: none; position: relative; margin-bottom: 14px;
    border-radius: 12px; overflow: hidden; cursor: pointer;
}
#plPlayerThumb img { width: 100%; display: block; border-radius: 12px; }
#plPlayerThumb .pl-thumb-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 48px; border-radius: 12px;
    transition: background .15s;
}
#plPlayerThumb:hover .pl-thumb-overlay { background: rgba(0,0,0,.3); }
#plPlayerThumb .pl-thumb-label {
    position: absolute; bottom: 8px; left: 0; right: 0;
    text-align: center; color: #fff; font-size: 12px; font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
/* الـ iframe الكامل داخل المودال عند الفتح */
#plPlayerInModal {
    display: none; margin-bottom: 14px; border-radius: 12px;
    overflow: hidden; background: #000; aspect-ratio: 16/9;
}
#plPlayerInModal iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ── شريط التشغيل المصغّر (أسفل الشاشة) ── */
#plMiniBar {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    height: 60px; background: var(--card2);
    border-top: 2px solid #10b981;
    box-shadow: 0 -4px 24px rgba(0,0,0,.3);
    z-index: 1200; align-items: center; padding: 0 14px; gap: 12px;
    animation: plMiniIn .25s ease;
}
@keyframes plMiniIn { from { transform: translateY(100%); } to { transform: translateY(0); } }

#plMiniBar .pmb-thumb-wrap {
    position: relative; flex-shrink: 0; width: 44px; height: 44px;
}
#plMiniBar .pmb-thumb {
    width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
    background: #0f172a; border: 1.5px solid rgba(16,185,129,.4);
    display: block;
}
#plMiniBar .pmb-yt-badge {
    position: absolute; top: -7px; right: -7px;
    width: 20px; height: 20px; border-radius: 50%;
    background: #ff0000; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; border: 2px solid var(--card2);
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
    animation: pmb-pulse 2s ease-in-out infinite;
}
@keyframes pmb-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.15); }
}
#plMiniBar .pmb-info { flex: 1; min-width: 0; }
#plMiniBar .pmb-title {
    font-size: 13px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#plMiniBar .pmb-sub {
    font-size: 11px; color: #10b981; margin-top: 2px;
    display: flex; align-items: center; gap: 4px;
}
#plMiniBar .pmb-sub i { font-size: 9px; }

.pmb-btn {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    border: none; cursor: pointer; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    transition: opacity .15s, transform .1s;
}
.pmb-btn:hover { opacity: .85; transform: scale(1.05); }
.pmb-expand { background: var(--card2); color: var(--text); border: 1.5px solid var(--border); }
.pmb-expand:hover { border-color: #10b981; color: #10b981; }
.pmb-stop   { background: #ef4444; color: #fff; }

/* ارفع صندوق الكتابة لئلا يُغطّى بالشريط */
body.pl-mini-active #chatComposer,
body.pl-mini-active .composer { padding-bottom: 60px; }
