/* Queue UI v3. Load after player.css. Other player/visualizer styles are untouched. */
#queue-panel {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: min(540px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: min(74vh, 760px);
    max-height: min(74dvh, 760px);
    min-height: 0;
    padding: 0;
    overflow: hidden;
    color: #deedf6;
    background: rgba(7, 18, 32, .97);
    border: 1px solid rgba(101, 193, 211, .28);
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
    text-align: left;
}
#queue-panel[hidden] { display: none !important; }
#queue-panel .queue-panel-header {
    flex: 0 0 auto;
    padding: .9rem 1rem .7rem;
    background: linear-gradient(135deg, rgba(21, 54, 68, .95), rgba(13, 24, 44, .98));
    border-bottom: 1px solid rgba(115, 191, 214, .18);
}
#queue-panel .queue-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:0; padding:0; background: linear-gradient(135deg, rgba(21, 54, 68, .95), rgba(13, 24, 44, .98)); }
#queue-panel .queue-kicker { margin:0 0 .2rem; color:#82c7d4; font-size:.6rem; letter-spacing:.14em; line-height:1.3; }
#queue-panel .queue-heading h2 { margin:0; color:#e5f6fb; font-size:1.02rem; line-height:1.35; }
#queue-panel #queue-close { flex:0 0 auto; width:40px; height:40px; border-radius:10px; font-size:1.4rem; cursor:pointer; }
#queue-panel .queue-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.55rem; padding:.65rem 0 .45rem; }
#queue-panel .queue-summary { margin:0; color:#b1c9d6; font-size:.75rem; line-height:1.45; }
#queue-panel .queue-toolbar-actions { display:flex; flex-wrap:wrap; gap:.4rem; }
#queue-panel .queue-action-status {
    box-sizing:border-box;
    display:block;
    min-height:2.8em;
    margin:.25rem 0 0;
    padding:.45rem .6rem;
    border-radius:8px;
    border-left:2px solid rgba(96, 224, 209, .55);
    background:rgba(24, 71, 80, .28);
    color:#b4ece3;
    font-size:.74rem;
    line-height:1.4;
    overflow-wrap:anywhere;
}
#queue-panel .queue-action-status[data-kind="info"] { color:#c9ddea; border-color:#8bb6d9; }
#queue-panel #queue-list {
    flex:1 1 auto;
    min-height:0;
    padding:.55rem .75rem .85rem;
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
    -webkit-overflow-scrolling:touch;
}
#queue-panel .queue-action-button {
    appearance:none; display:inline-flex; align-items:center; justify-content:center;
    min-width:38px; min-height:38px; padding:.4rem .6rem; border-radius:9px;
    border:1px solid rgba(125,190,225,.25); background:rgba(20,36,57,.92);
    color:#deeff7; font:inherit; font-size:.73rem; line-height:1.2; cursor:pointer;
    touch-action:manipulation;
}
#queue-panel .queue-action-button:hover:not(:disabled) { border-color:#59dcd4; background:rgba(29,80,87,.85); }
#queue-panel button:focus-visible, #queue-panel summary:focus-visible { outline:2px solid #67efe0; outline-offset:2px; }
#queue-panel .queue-action-button:disabled { opacity:.32; cursor:default; }
#queue-panel .queue-section { margin:0 0 .85rem; padding:0; }
#queue-panel .queue-section-heading { margin:.4rem 0 .55rem; color:#85e6df; font-size:.75rem; font-weight:650; letter-spacing:.05em; text-transform:uppercase; }
#queue-panel .queue-album-heading { margin:.65rem .25rem .3rem; color:#9eb6c9; font-size:.73rem; font-weight:500; }
#queue-panel .queue-item {
    display:grid; grid-template-columns:40px 42px minmax(0,1fr); gap:.5rem .6rem;
    align-items:center; padding:.65rem .5rem; margin:.2rem 0; border-radius:11px;
    border:1px solid rgba(104,151,181,.09); background:rgba(17,31,49,.65);
}
#queue-panel .queue-item.current { grid-template-columns:40px 42px minmax(0,1fr) 40px; background:rgba(23,103,111,.22); border-color:rgba(76,226,211,.4); }
#queue-panel .queue-item-play { width:40px; height:40px; padding:0; }
#queue-panel .queue-item.current .queue-item-play { color:#071e28; background:#48dcca; border-color:#65eadd; }
#queue-panel .queue-item-cover { display:flex; align-items:center; justify-content:center; width:42px; height:42px; border-radius:8px; overflow:hidden; background:rgba(110,140,180,.13); color:#9cdae9; }
#queue-panel .queue-item-cover img { display:block; width:100%; height:100%; object-fit:cover; }
#queue-panel .queue-item-details { display:flex; flex-direction:column; gap:.2rem; min-width:0; align-items:flex-start; }
#queue-panel .queue-item-details strong { width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.82rem; line-height:1.35; }
#queue-panel .queue-item-details small { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.69rem; color:#a8bfcd; line-height:1.35; }
#queue-panel .queue-item-details .queue-item-caption { font-size:.62rem; color:#8de5db; }
#queue-panel .queue-next-badge { padding:.12rem .35rem; border-radius:5px; background:rgba(75,216,199,.15); border:1px solid rgba(75,216,199,.25); color:#8bf0df; font-size:.55rem; font-weight:700; letter-spacing:.08em; }
#queue-panel .queue-item-actions { grid-column:3 / -1; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.35rem; }
#queue-panel .queue-item.current .queue-item-actions { grid-column:4; grid-row:1; }
#queue-panel .queue-item-remove { color:#e8b5c3; font-size:1.15rem; }
#queue-panel .queue-item-remove:hover:not(:disabled) { border-color:#e69bad; background:rgba(101,42,62,.5); }
#queue-panel .queue-empty { margin:.5rem 0; padding:.8rem .55rem; color:#a8c0ce; font-size:.79rem; line-height:1.5; }
#queue-panel .queue-earlier { margin-top:.85rem; padding-top:.65rem; border-top:1px solid rgba(125,190,225,.16); }
#queue-panel .queue-earlier > summary { cursor:pointer; font-size:.77rem; color:#b1c9d6; padding:.45rem .2rem; }
#queue-panel .queue-earlier .queue-section-heading { display:none; }
#queue-panel .queue-earlier .queue-item { background:rgba(13,24,40,.6); }
@media (max-width:600px) {
    #queue-panel { max-width:calc(100vw - 16px); width:min(480px,calc(100vw - 16px)); border-radius:13px; }
    #queue-panel .queue-panel-header { padding:.75rem .75rem .6rem; }
    #queue-panel .queue-action-button { min-width:44px; min-height:44px; }
    #queue-panel .queue-item { grid-template-columns:44px 38px minmax(0,1fr); gap:.4rem .5rem; }
    #queue-panel .queue-item.current { grid-template-columns:44px 38px minmax(0,1fr) 44px; }
    #queue-panel .queue-item-cover { width:38px; height:38px; }
    #queue-panel .queue-item-play { width:44px; height:44px; }
    #queue-panel .queue-item-actions { grid-column:2 / -1; }
    #queue-panel #queue-list { padding:.45rem .5rem .75rem; }
}
@media (max-height:480px) {
    #queue-panel { max-height:88vh; max-height:88dvh; }
    #queue-panel .queue-kicker { display:none; }
    #queue-panel .queue-panel-header { padding:.4rem .65rem; }
    #queue-panel .queue-toolbar { padding:.3rem 0; }
    #queue-panel .queue-action-status { min-height:0; padding:.3rem .45rem; margin:.1rem 0 0; }
}
