/* Private audio playlists: add buttons, picker and the playlists page. */
.add-to-playlist { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; min-height: 0; margin: 4px 0 0; padding: 0; border: 1px solid #d3e3dc; border-radius: 50%; background: #eef4f1; color: #1e5551; cursor: pointer; }
.add-to-playlist svg { width: 19px; height: 19px; pointer-events: none; }
.add-to-playlist:hover { background: #e1ede8; border-color: #9cc4b6; }
.add-to-playlist:focus-visible { outline: 2px solid #1e5551; outline-offset: 2px; }
.voice-version .add-to-playlist { display: grid; }

/* Audio library: a slim square in the row's own tint, as tall as the row. */
:is(#audiosView, #recordingShelf) .audio-track-item { display: flex; align-items: stretch; gap: 6px; }
:is(#audiosView, #recordingShelf) .audio-track-item > .audio-track { flex: 1 1 auto; min-width: 0; }
:is(#audiosView .audio-library-song, #recordingShelf .audio-shelf-tracks) .audio-track-item > .add-to-playlist { width: 34px; height: auto; min-height: 30px; margin: 0; padding: 0; border-radius: 8px; border-color: #d3e3dc; }
:is(#audiosView, #recordingShelf) .audio-track-item + .audio-track-item, :is(#audiosView, #recordingShelf) .audio-track + .audio-track-item, :is(#audiosView, #recordingShelf) .audio-track-item + .audio-track { margin-top: 6px; }

/* Keertana page: a reader's own upload keeps its delete button beside the row. */
#recordingShelf .audio-track-item > .voice-delete { flex: none; width: 34px; height: auto; min-height: 30px; margin: 0; border-radius: 8px; }
#recordingShelf .audio-shelf-tracks { display: grid; gap: 4px; }

/* Player dock: round icon after the singer line, on the dark theme. */
#musicPlayer #musicAddToPlaylist { display: inline-grid; place-items: center; width: 30px; height: 30px; min-height: 0; margin: 0 0 0 8px; padding: 0; vertical-align: middle; border-radius: 50%; border-color: #d5b46b99; background: transparent; color: #f1d79f; }
#musicPlayer #musicAddToPlaylist svg { width: 17px; height: 17px; }
#musicPlayer #musicAddToPlaylist[hidden] { display: none; }

.playlist-picker-track { margin: -4px 0 12px; color: #5c6b66; font-size: 14px; overflow-wrap: anywhere; }

#playlistsView .saved-heading { flex-wrap: wrap; gap: 12px; }
#playlistCount { display: block; color: #5c6b66; font-size: 14px; }
.playlist-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.playlist-actions[hidden] { display: none; }
.playlist-actions button { min-height: 40px; padding: 6px 14px; border: 1px solid #c9a35a; border-radius: 999px; background: #fffaf0; color: #1e5551; cursor: pointer; }
.playlist-actions #playlistPlayAll { background: #1e5551; border-color: #1e5551; color: #fff8e8; }
.playlist-actions #playlistPlayAll:disabled { opacity: .5; cursor: default; }
.playlist-actions #playlistDelete { color: #8a3b2b; }
.playlist-tracks { display: grid; gap: 8px; }
.playlist-track { display: flex; align-items: center; gap: 8px; }
.playlist-track-play { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid #e3d5bb; border-radius: 14px; background: #fffdf7; color: inherit; text-align: left; cursor: pointer; }
.playlist-track-play:hover, .playlist-track-play:focus-visible { border-color: #d9ad58; background: #fbf4e6; outline: none; }
.playlist-track-copy { min-width: 0; display: flex; flex-direction: column; }
.playlist-track-copy b { font-weight: 400; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-track-copy small { color: #7a6f60; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-track-remove { flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid #e3d5bb; border-radius: 50%; background: #fffdf7; color: #8a3b2b; font-size: 20px; cursor: pointer; }
.playlist-unavailable { color: #7a6f60; font-size: 14px; }


/* Public reading exposes no personal features; guests in member mode see the
   add buttons (they prompt sign-in) but not the private page. Kept here so
   the locked public-reading.css stays unchanged. */
html[data-public-reading="true"] :is([data-view="playlists"], #playlistsView, #playlistOverlay, .add-to-playlist) { display: none !important; }
html:not([data-personal-access="true"]) :is([data-view="playlists"], #playlistsView) { display: none !important; }
