.audio-frame {
    width: 280px;               /* compact width */
    margin: 20px auto;          /* center horizontally */
    background-color: rgba(0,0,0,0.85);
    padding: 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    box-sizing: border-box;
    align-items: stretch;       /* ensures children fill frame width */
    text-align: left;
}

/* Controls */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
}

.audio-controls button {
    background-color: #222;
    color: white;
    border: none;
    padding: 4px 6px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
}

.audio-controls button:hover {
    background-color: #0d6efd;
}

#currentTrack {
    flex-grow: 1;
    text-align: center;
    font-size: 0.8em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Progress and volume sliders */
input[type="range"] {
    width: 100%;
    accent-color: #0d6efd;
    height: 6px;
    border-radius: 3px;
}

/* Playlist Scrollable */
.playlist {
    display: flex;
    flex-direction: column;
    max-height: 150px;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    gap: 4px;
}

.playlist button {
    display: block;
    width: 100%;                 /* fills frame width */
    max-width: 100%;
    text-align: left;
    background-color: #222;
    color: white;
    border: none;
    padding: 6px;
    border-radius: 5px;
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    box-sizing: border-box;
}

.playlist button:hover,
.playlist button.active {
    background-color: #0d6efd;
}