/* Only playlist UI and its two entry points; existing cards/tools remain unchanged. */
#songFilterMenu { min-width: 238px; max-width: min(320px, calc(100vw - 48px)); max-height: 62vh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
#songFilterLabel { max-width: min(240px, 40vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#playlistFilterItems:not(:empty) { border-top: 1px solid #e5efed; margin-top: 6px; padding-top: 8px; }
.playlist-filter-heading { display: block; padding: 4px 12px 7px; color: #82918f; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.song-filter-option .playlist-filter-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.song-filter-option .playlist-filter-count { color: #7b878b; font-size: .85em; }
.song-filter-option.playlist-manage-entry { border-top: 1px solid #e5efed; border-radius: 0 0 8px 8px; margin-top: 6px; color: #218c77; min-height: 44px; }
.playlist-icon { display: block; width: 22px; height: 22px; flex-shrink: 0; }
.playlist-song-action .action-icon { color: #29b794; }
#songActionsModal.playlist-has-entry { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.playlist-overlay[hidden], .playlist-overlay [hidden] { display: none !important; }
.playlist-overlay { position: fixed; inset: 0; z-index: 11000; background: rgba(23, 37, 49, .36); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.playlist-dialog { width: 600px; max-width: 100%; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); display: flex; flex-direction: column; background: #fff; color: #243746; border: 1px solid #d8f2ea; border-radius: 24px; box-shadow: 0 24px 80px rgba(23, 37, 49, .2); text-align: start; overflow: hidden; }
.playlist-dialog *, .playlist-dialog *::before, .playlist-dialog *::after { box-sizing: border-box; }
.playlist-dialog button, .playlist-dialog input { font: inherit; }
.playlist-dialog button { cursor: pointer; touch-action: manipulation; }
.playlist-dialog button:disabled { cursor: default; opacity: .5; }
.playlist-dialog button:focus-visible, .playlist-dialog input:focus-visible { outline: 3px solid #817bff; outline-offset: 3px; }
.playlist-dialog-header { display: flex; align-items: flex-start; gap: 14px; padding: 26px 24px 20px; background: linear-gradient(120deg, #f1fcf8, #f6f5ff); border-bottom: 1px solid #e9f1f0; }
.playlist-emblem { display: grid; place-items: center; width: 46px; height: 46px; flex-shrink: 0; border-radius: 15px; color: white; background: linear-gradient(135deg, #36cfaa, #6c63ff); box-shadow: 0 5px 15px #43d9a326; }
.playlist-emblem .playlist-icon { width: 27px; height: 27px; }
.playlist-heading { flex: 1; min-width: 0; }
.playlist-heading h2 { font-size: 22px; line-height: 1.3; margin: 1px 0 7px; font-weight: 750; }
.playlist-heading p { font-size: 13px; line-height: 1.55; color: #6b7c85; margin: 0; }
.playlist-icon-button { display: inline-flex; justify-content: center; align-items: center; width: 38px; min-width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: #71818c; }
#playlistClose { background: #fff; font-size: 25px; margin-top: -4px; }
.playlist-icon-button:hover { background: #edf7f4; color: #258c77; }
.playlist-icon-button.playlist-delete:hover { color: #cf4965; background: #fff1f4; }
.playlist-dialog-body { padding: 20px 24px 8px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; scrollbar-width: thin; }
.playlist-song { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 22px; background: #f7f9fc; border: 1px solid #e9edf4; border-radius: 13px; }
.playlist-song img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; }
.playlist-song strong { font-size: 14px; overflow-wrap: anywhere; }
.playlist-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.playlist-list-heading h3 { font-size: 13px; font-weight: 700; color: #687984; margin: 0; }
#playlistSelectionCount { font-size: 12px; color: #657b92; text-align: end; }
.playlist-rows { display: grid; gap: 8px; }
.playlist-row { display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 12px; border: 1px solid #e5ecef; border-radius: 13px; min-height: 68px; transition: background .15s, border-color .15s; }
.playlist-row.is-selected { background: linear-gradient(110deg, #edf9f4, #f4f2ff); border-color: #97dfcd; }
.playlist-row-label { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 3px 0; cursor: pointer; }
.playlist-row-label input { width: 20px; height: 20px; margin: 0; accent-color: #31b899; flex-shrink: 0; }
.playlist-row-label > .playlist-icon { color: #7e76da; }
.playlist-row-copy { display: flex; flex-direction: column; min-width: 0; }
.playlist-row-copy strong { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; line-height: 1.4; }
.playlist-row-copy small { font-size: 12px; color: #80909b; margin-top: 3px; }
.playlist-row-actions { display: flex; flex-shrink: 0; }
.playlist-empty { padding: 24px 16px; border: 1px dashed #d4e7e0; border-radius: 14px; text-align: center; background: #fafdfc; }
.playlist-empty > .playlist-icon { width: 36px; height: 36px; margin: 0 auto 12px; color: #9a91e9; }
.playlist-empty strong { display: block; font-size: 15px; }
.playlist-empty p { font-size: 13px; color: #7a8b94; margin: 8px 0 0; }
.playlist-form { margin-top: 22px; padding-top: 18px; border-top: 1px solid #edf1f4; }
.playlist-form label { display: block; font-size: 13px; font-weight: 650; margin-bottom: 9px; }
.playlist-form-fields { display: flex; gap: 8px; }
.playlist-form input { min-width: 0; flex: 1; width: 100%; padding: 11px 12px; font-size: 16px; border: 1px solid #d8e5e3; border-radius: 10px; background: #fcfdfd; color: #243746; }
.playlist-form input::placeholder { font-size: 13px; color: #98a4ae; }
.playlist-button { min-height: 44px; border-radius: 10px; padding: 10px 16px; font-size: 13px !important; font-weight: 650 !important; border: 1px solid transparent; line-height: 1.35; }
.playlist-create { background: #edf9f5; border-color: #b6e7d9; color: #23876f; }
.playlist-primary { color: white; background: linear-gradient(110deg, #36c9a4, #6c63ff); box-shadow: 0 4px 12px #6c63ff22; }
.playlist-secondary { color: #62727e; background: white; border-color: #dfe7eb; }
.playlist-text-button { border: 0; background: transparent; color: #7272bf; font-size: 13px !important; padding: 8px 0; }
.playlist-error { font-size: 12px; color: #be3c58; margin: 7px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.playlist-error:empty { display: none; }
.playlist-independent { font-size: 12px; color: #81919c; margin: 16px 0 8px; line-height: 1.5; }
.playlist-dialog-footer { padding: 16px 24px; border-top: 1px solid #e9f0f2; background: #fcfdfd; }
.playlist-dialog-footer > .playlist-error { margin: 0 0 12px; }
.playlist-footer-actions { display: flex; align-items: center; gap: 8px; }
.playlist-local-note { flex: 1; color: #88969e; font-size: 11px; line-height: 1.5; padding-right: 8px; }
.playlist-delete-confirm { padding: 14px; background: #fff7f8; border: 1px solid #f5d3db; border-radius: 12px; margin-top: 12px; }
.playlist-delete-confirm strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.playlist-delete-confirm p { font-size: 13px; color: #866b75; margin: 7px 0 12px; }
.playlist-delete-confirm button + button { margin-inline-start: 8px; }
.playlist-danger { color: #bc3b59; border-color: #ebbdc8; background: white; }
.playlist-results-status { padding: 70px 20px; text-align: center; color: #768b98; }
.playlist-results-status h3 { color: #334b5c; margin: 12px 0; font-size: 21px; }
.playlist-results-status p { margin-bottom: 20px; }
.playlist-results-status .playlist-icon { margin: auto; width: 42px; height: 42px; color: #968ee7; }
.playlist-unavailable { font-size: 13px; color: #86929b; text-align: center; padding: 12px; }
.playlist-pagination { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 13px; }
.playlist-pagination[hidden] { display: none; }
.playlist-pagination button { width: 34px; height: 34px; border: 1px solid #d6ece5; border-radius: 8px; color: #299e80; background: #f8fcfa; cursor: pointer; touch-action: manipulation; }
.playlist-pagination button:disabled { opacity: .35; cursor: default; }
@media (max-width: 600px) {
    .playlist-overlay { padding: 12px; align-items: center; }
    .playlist-dialog { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 20px; }
    .playlist-dialog-header { padding: 20px 16px 16px; gap: 10px; }
    .playlist-heading h2 { font-size: 19px; }
    .playlist-emblem { width: 40px; height: 40px; border-radius: 12px; }
    .playlist-dialog-body { padding: 16px 16px 8px; }
    .playlist-dialog-footer { padding: 14px 16px max(14px, env(safe-area-inset-bottom)); }
    .playlist-icon-button { width: 40px; min-width: 40px; height: 44px; }
    .playlist-row { padding: 6px 4px 6px 10px; gap: 2px; }
    .playlist-row-label { gap: 8px; }
    .playlist-form-fields { flex-wrap: wrap; }
    .playlist-create { width: 100%; }
    .playlist-footer-actions { flex-wrap: wrap; }
    .playlist-local-note { flex-basis: 100%; padding: 0 0 2px; }
    .playlist-footer-actions .playlist-button { flex: 1; }
    .playlist-pagination { font-size: 12px; gap: 5px; }
    #songFilterLabel { max-width: 35vw; }
}
