/* ── Discover / Tags ── */
.tag-presets {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 20px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.discover-search {
  width: min(100%, 620px); min-height: 48px; margin: 0 0 22px;
  display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 16px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.discover-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.discover-search svg { width: 19px; height: 19px; flex: 0 0 auto; color: var(--text-muted); }
.discover-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.discover-search input::placeholder { color: var(--text-muted); }
.discover-search button { border: 0; border-radius: var(--radius-sm); padding: 9px 17px; background: var(--accent); color: #000; font: inherit; font-weight: 700; cursor: pointer; }
.discover-search-empty { margin: -12px 0 20px; color: var(--text-muted); font-size: 13px; }
.tag-presets-label {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-dim); margin-right: 4px;
}
.tag-chip-preset {
  background: var(--accent-dim); border-color: var(--accent);
  color: var(--accent);
}
.tag-chip-preset:hover { box-shadow: 0 0 16px rgba(162,230,64,.18); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-chip {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: 10px 20px; border-radius: 24px;
  cursor: pointer; font-size: 14px; transition: all var(--transition);
  font-family: inherit; font-weight: 500;
}
.tag-chip:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 16px rgba(162,230,64,.1);
}
.tag-chip .tag-count { font-size: 11px; color: var(--text-dim); margin-left: 8px; font-weight: 400; }
.tag-detail-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.tag-back-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 13px;
  font-family: inherit; font-weight: 500; transition: all var(--transition);
}
.tag-back-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Spotify Library Tabs ── */
.sp-tabs {
  display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.sp-tabs::-webkit-scrollbar { display: none; }
.sp-tab {
  padding: 10px 22px; border-radius: 50px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  background: var(--bg-elevated); color: var(--text-muted);
  transition: all .2s ease;
}
.sp-tab:hover { background: var(--bg-card); color: var(--text); }
.sp-tab.active { background: var(--accent); color: #000; }
.playlist-page-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:18px; }
.playlist-heading-actions { display:flex; align-items:center; gap:8px; }
.playlist-heading-icon { display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.playlist-heading-icon svg { width:17px; height:17px; flex:0 0 17px; }

/* Muted one-line subtitle under a page/sub-view heading. */
.page-subtitle {
  font-size: 13px; color: var(--text-muted); margin: -12px 0 20px;
}

/* Header row for a sub-view that pairs a title with its own secondary nav
   (e.g. Spotify sub-view inside the Library tabs). Keeps the sub-tabs
   visually anchored to *this* section's heading instead of reading as a
   second full-width tab bar stacked under the top-level Library tabs. */
.sp-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.sp-header .page-title { margin-bottom: 2px; }
.sp-header .page-subtitle { margin: 0; }

/* Secondary sub-navigation: nested inside a page that already has peer nav.
   Rendered as a compact segmented pill control (own pill "track" background,
   small selected pill inside) so it reads unmistakably as sub-nav, not a
   second row of primary tabs. */
.sp-tabs--sub {
  gap: 2px; margin-bottom: 0; flex-shrink: 0;
  padding: 3px; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 999px;
}
.sp-tabs--sub .sp-tab {
  padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: none; color: var(--text-muted); border-bottom: none;
}
.sp-tabs--sub .sp-tab:hover { background: var(--bg-card); color: var(--text); }
.sp-tabs--sub .sp-tab.active {
  background: var(--accent); color: #000; border-bottom: none;
}
.sp-section-title {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px;
}

/* ── Playlist Detail ── */
.playlist-hero {
  display: flex; gap: 20px; align-items: center; margin-bottom: 24px;
  padding: 24px; background: var(--bg-card); border-radius: 16px;
  border: 1px solid var(--border);
}
.playlist-hero-img {
  width: 100px; height: 100px; border-radius: 12px; object-fit: cover;
  box-shadow: 0 4px 20px rgba(0,0,0,.4); flex-shrink: 0;
}
.playlist-hero-info { flex: 1; min-width: 0; }
.playlist-hero-info h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
#libDetailName { cursor:text; touch-action:manipulation; border-radius:6px; }
#libDetailName:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.playlist-hero-info p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.playlist-hero-desc { white-space: pre-line; line-height: 1.4; }
.playlist-hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }

/* Shared hero action button classes (replace per-button inline styles). */
.btn-hero-primary { width: auto; padding: 12px 28px; background: var(--accent); color: #000; }
.btn-hero-secondary { width: auto; padding: 12px 28px; background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }
.btn-hero-danger { width: auto; padding: 12px 28px; background: var(--red); color: #fff; }
.album-hero-actions { min-width:220px; }
.album-icon-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; width:100%; }
.album-action-icon { width:52px; height:52px; display:grid; place-items:center; border:1px solid var(--border); border-radius:14px; background:var(--bg-elevated); color:var(--text); cursor:pointer; transition:transform var(--transition),border-color var(--transition),background var(--transition); }
.album-action-icon svg { width:23px; height:23px; }
.album-action-icon:hover { transform:translateY(-2px); border-color:var(--accent); background:var(--accent-dim); }
.album-save-button { position:relative; overflow:visible; }
.album-save-button .bookmark-shape { transition:fill .18s ease,stroke .18s ease,transform .18s ease; transform-origin:center; }
.album-save-check { position:absolute; right:-5px; top:-5px; display:grid; place-items:center; width:19px; height:19px; border:2px solid var(--bg-card); border-radius:50%; background:var(--accent); color:#071008; font-size:11px; font-weight:900; opacity:0; transform:scale(.45); transition:opacity .18s ease,transform .22s cubic-bezier(.2,.8,.2,1.3); }
.album-action-icon.saved { color:var(--accent-contrast,#071008); border-color:var(--accent); background:var(--accent); box-shadow:0 0 0 3px var(--accent-dim),0 8px 22px color-mix(in srgb,var(--accent) 34%,transparent); }
.album-action-icon.saved .bookmark-shape { fill:currentColor; stroke:currentColor; transform:scale(1.08); }
.album-action-icon.saved .album-save-check { opacity:1; transform:scale(1); }
.album-action-icon.saved:hover { background:color-mix(in srgb,var(--accent) 86%,white); border-color:var(--accent); }
@keyframes albumSavedPop { 0%{transform:scale(.86)} 55%{transform:scale(1.1)} 100%{transform:scale(1)} }
.album-action-icon.just-saved { animation:albumSavedPop .32s ease; }
.album-action-play { background:var(--accent); color:#000; border-color:var(--accent); }
.album-action-play:hover { background:var(--accent); box-shadow:0 0 20px var(--accent-glow); }
.library-hero-actions .btn-download { width:100%; }
.external-playlist-hero-actions .btn-download { width:100%; }
.playlist-local-save-option { width:100%; display:flex; align-items:center; justify-content:flex-start; gap:7px; color:var(--text-muted); font-size:12px; cursor:pointer; }
.playlist-local-save-option input { width:14px; height:14px; accent-color:var(--accent); }
.library-action-danger { color:var(--red); }
.library-action-danger:hover { color:#fff; border-color:var(--red); background:var(--red); }

/* In-playlist song picker: suggestions first, live track search when typed. */
.playlist-song-picker-overlay { position:fixed; inset:0; z-index:1000; display:grid; place-items:center; padding:18px; background:rgba(0,0,0,.68); backdrop-filter:blur(8px); }
.playlist-song-picker { width:min(620px,100%); max-height:min(760px,88dvh); display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--border); border-radius:20px; background:var(--bg-card); box-shadow:0 24px 70px rgba(0,0,0,.55); }
.playlist-song-picker>header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:20px 20px 12px; }
.playlist-song-picker h2 { margin:0; font-size:22px; }
.playlist-song-picker header p { margin:4px 0 0; color:var(--text-muted); font-size:13px; }
.playlist-song-picker-close { width:40px; height:40px; flex:0 0 40px; border:1px solid var(--border); border-radius:50%; background:var(--bg-elevated); color:var(--text); font-size:25px; line-height:1; cursor:pointer; }
.playlist-song-picker-search { display:flex; align-items:center; gap:10px; margin:4px 20px 14px; padding:0 14px; border:1px solid var(--border); border-radius:14px; background:var(--bg-elevated); }
.playlist-song-picker-search:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-dim); }
.playlist-song-picker-search svg { width:20px; height:20px; flex:0 0 20px; color:var(--text-muted); }
.playlist-song-picker-search input { width:100%; min-width:0; height:48px; border:0; outline:0; background:transparent; color:var(--text); font:inherit; font-size:16px; }
.playlist-song-picker-heading { padding:0 20px 10px; color:var(--text-muted); font-size:12px; font-weight:800; letter-spacing:.07em; text-transform:uppercase; }
.playlist-song-picker-results { min-height:180px; overflow-y:auto; padding:0 12px 14px; overscroll-behavior:contain; }
.playlist-song-picker-row { display:grid; grid-template-columns:48px minmax(0,1fr) auto; align-items:center; gap:12px; min-height:64px; padding:8px; border-radius:12px; }
.playlist-song-picker-row:hover { background:var(--bg-elevated); }
.playlist-song-picker-row img,.playlist-song-picker-art { width:48px; height:48px; border-radius:8px; object-fit:cover; background:var(--bg-elevated); }
.playlist-song-picker-art { display:grid; place-items:center; color:var(--accent); font-size:20px; }
.playlist-song-picker-row div { min-width:0; }
.playlist-song-picker-row strong,.playlist-song-picker-row small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.playlist-song-picker-row strong { font-size:14px; }
.playlist-song-picker-row small { margin-top:3px; color:var(--text-muted); font-size:12px; }
.playlist-song-picker-row button { min-width:72px; min-height:38px; padding:0 13px; border:1px solid var(--accent); border-radius:999px; background:var(--accent); color:#071008; font-weight:750; cursor:pointer; }
.playlist-song-picker-row button:disabled { border-color:var(--border); background:var(--bg-elevated); color:var(--text-muted); cursor:default; }
.playlist-song-picker-loading,.playlist-song-picker-empty { padding:34px 16px; color:var(--text-muted); text-align:center; }

/* Local Downloads: collection cards for albums/playlists, compact rows for singles. */
.local-download-mixed { display:flex; flex-direction:column; gap:26px; width:100%; }
.local-download-section { width:100%; min-width:0; }
.local-download-section-title { margin:0 0 12px; color:var(--text-muted); font-size:13px; font-weight:750; letter-spacing:.04em; text-transform:uppercase; }
.local-download-collections { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,220px)); gap:18px; }
.local-download-collection { width:100%; }
.local-download-collection .local-offline-play { opacity:1; transform:none; }
.local-download-delete { width:36px; height:36px; display:grid; place-items:center; border:1px solid var(--border); border-radius:50%; background:color-mix(in srgb,var(--bg-elevated) 92%,transparent); color:var(--text-muted); cursor:pointer; transition:color .18s ease,background .18s ease,border-color .18s ease,transform .18s ease; }
.local-download-delete svg { width:18px; height:18px; pointer-events:none; }
.local-download-delete:hover,.local-download-delete:focus-visible { color:#fff; background:var(--red); border-color:var(--red); transform:scale(1.06); }
.local-download-collection-delete { position:absolute; top:8px; left:8px; z-index:4; opacity:0; transform:translateY(-4px); }
.local-download-collection:hover .local-download-collection-delete,.local-download-collection-delete:focus-visible { opacity:1; transform:none; }
.song-list-host .song-row .local-download-song-delete { flex:0 0 36px; }
.local-download-section .song-row .card-play-btn { opacity:1; visibility:visible; transform:none; }
.local-download-list { display:flex; flex-direction:column; gap:8px; width:100%; }
.local-download-row {
  display:grid; grid-template-columns:56px minmax(0,1fr) auto 40px 20px;
  align-items:center; gap:14px; min-height:72px; padding:8px 14px 8px 8px;
  border:1px solid var(--border); border-radius:14px;
  background:color-mix(in srgb,var(--bg-card) 92%,transparent);
  cursor:pointer; transition:background .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease;
}
.local-download-row:hover {
  background:color-mix(in srgb,var(--bg-elevated) 88%,var(--accent) 12%);
  border-color:color-mix(in srgb,var(--accent) 42%,var(--border));
  transform:translateX(3px); box-shadow:0 8px 24px rgba(0,0,0,.2);
}
.local-download-row:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.local-download-row-cover { width:56px; height:56px; border-radius:10px; object-fit:cover; background:var(--bg-elevated); }
.local-download-row-placeholder { display:grid; place-items:center; color:var(--accent); font-size:22px; }
.local-download-row-info { min-width:0; }
.local-download-row-title { font-size:15px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.local-download-row-sub { margin-top:4px; color:var(--text-muted); font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.local-download-offline-badge { padding:4px 9px; border-radius:999px; color:var(--accent); background:color-mix(in srgb,var(--accent) 12%,transparent); font-size:11px; font-weight:700; }
.local-offline-play { width:36px; height:36px; display:grid; place-items:center; border:0; border-radius:50%; background:var(--accent); color:#071008; cursor:pointer; opacity:.78; transform:scale(.94); transition:opacity .18s ease,transform .18s ease,box-shadow .18s ease; }
.local-offline-play svg { width:18px; height:18px; }
.local-download-row:hover .local-offline-play,.local-offline-play:focus-visible { opacity:1; transform:scale(1); box-shadow:var(--shadow-glow); }
.local-download-row-arrow { color:var(--text-muted); font-size:26px; transition:color .18s ease,transform .18s ease; }
.local-download-row:hover .local-download-row-arrow { color:var(--accent); transform:translateX(2px); }
.song-list-host { width:100%; }
.song-list-host .song-list { gap:6px; }
.song-list-host .song-row { min-height:62px; border:1px solid transparent; border-radius:12px; padding:8px 10px; }
.song-list-host .song-row:hover { border-color:color-mix(in srgb,var(--accent) 34%,var(--border)); background:color-mix(in srgb,var(--bg-elevated) 90%,var(--accent) 10%); }
.song-list-host .song-row .kebab-btn { opacity:.35; transition:opacity .18s ease,background .18s ease,color .18s ease; }
.song-list-host .song-row:hover .kebab-btn,.song-list-host .song-row .kebab-btn:focus-visible { opacity:1; color:var(--accent); background:color-mix(in srgb,var(--accent) 12%,transparent); }
@media(max-width:640px) {
  .local-download-collections { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .local-download-collection-delete { opacity:1; transform:none; }
  .local-download-row { grid-template-columns:48px minmax(0,1fr) 38px 14px; gap:10px; min-height:64px; padding:8px; }
  .local-download-row-cover { width:48px; height:48px; }
  .local-download-offline-badge { display:none; }
}

/* ── Imported playlists (Library → Downloaded) ──
   Its own section under the Navidrome grid, separated by a rule so the two
   grids never read as one list: these playlists are NOT in Navidrome, they
   only stream, and the badge on each card says so at a glance. */
.imported-section {
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border);
}
.imported-card .imported-card-play { opacity:1; transform:none; }
.imported-title {
  font-size: 16px; font-weight: 700; letter-spacing: -0.2px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.imported-count { font-size: 12px; font-weight: 500; color: var(--text-dim); }
.imported-sub {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
  margin: 5px 0 16px; max-width: 560px;
}
/* Top-RIGHT on purpose: the kebab (.card .kebab-btn) owns top-left. */
.imported-badge {
  position: absolute; top: 8px; right: 8px; z-index: 4;
  background: var(--accent-dim); border: 1px solid var(--accent); color: var(--accent);
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; pointer-events: none;
}
.imported-card:hover { border-color: var(--accent); }

/* ── "Save to Library" on an imported playlist ──
   Lives in the detail hero's note (#plDetailNote) and in the search banner's
   action row, so it must wrap rather than widen its host. */
.import-save {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px;
}
.import-banner-actions .import-save { margin-top: 0; }
.import-save-hint {
  font-size: 11px; color: var(--text-muted); line-height: 1.4;
  flex: 1 1 180px; min-width: 0;
}
.import-save-btn { border-color: var(--accent); color: var(--accent); }
.import-save-btn:disabled { cursor: default; }
.import-save-btn--done {
  background: var(--accent-dim); border-color: var(--accent);
  color: var(--accent); opacity: .9;
}

@media (max-width: 640px) {
  .imported-section { margin-top: 24px; padding-top: 18px; }
  .import-save-btn { flex: 1 1 auto; text-align: center; }
}

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state p { font-size: 15px; }
.search-fallback h3 { margin:0 0 7px; color:var(--text); font-size:19px; }
.search-fallback-actions { display:flex; justify-content:center; flex-wrap:wrap; gap:8px; margin-top:18px; }
.search-fallback-actions button { padding:9px 13px; border:1px solid var(--border); border-radius:999px; background:var(--bg-elevated); color:var(--text); font:inherit; cursor:pointer; }
.search-fallback-actions button:hover, .search-fallback-actions button:focus-visible { border-color:var(--accent); color:var(--accent); outline:none; }

/* Podcasts page */
.podcast-discovery { margin-bottom:24px; padding:18px; border:1px solid var(--border); border-radius:var(--radius); background:var(--bg-card); }
.podcast-discovery-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:13px; }
.podcast-discovery-heading h3 { margin:0; font-size:17px; }
.podcast-discovery-heading p { margin:4px 0 0; color:var(--text-muted); font-size:12px; }
.podcast-discovery-heading select { min-height:38px; padding:0 34px 0 12px; color:var(--text); background:var(--bg-elevated); border:1px solid var(--border); border-radius:10px; font:inherit; font-size:13px; }
.podcast-content-search { display:flex; align-items:center; gap:9px; min-height:46px; padding:0 12px; border:1px solid var(--border); border-radius:12px; background:var(--bg-elevated); }
.podcast-content-search:focus-within { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-dim); }
.podcast-content-search svg { width:19px; height:19px; flex:none; color:var(--text-muted); }
.podcast-content-search input { flex:1; min-width:0; border:0; outline:0; color:var(--text); background:transparent; font:inherit; font-size:14px; }
.podcast-content-search button { display:none; border:0; background:transparent; color:var(--text-muted); font-size:23px; cursor:pointer; }
.podcast-content-results:not(:empty) { display:grid; gap:9px; margin-top:13px; }
.podcast-search-result { display:grid; grid-template-columns:64px minmax(0,1fr) auto; gap:12px; align-items:center; padding:10px; border:1px solid var(--border); border-radius:12px; background:color-mix(in srgb,var(--bg-elevated) 82%,transparent); cursor:pointer; transition:border-color .15s,transform .15s,background .15s; }
.podcast-search-result:hover { border-color:color-mix(in srgb,var(--accent) 55%,var(--border)); background:var(--bg-elevated); transform:translateY(-1px); }
.podcast-search-result img { width:64px; height:64px; border-radius:10px; object-fit:cover; background:var(--bg); }
.podcast-result-title { font-size:14px; font-weight:700; }
.podcast-result-byline,.podcast-result-meta { margin-top:3px; color:var(--text-muted); font-size:11.5px; }
.podcast-result-description { display:-webkit-box; margin-top:5px; overflow:hidden; color:var(--text-muted); font-size:12px; line-height:1.35; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.podcast-result-kind { align-self:start; padding:4px 8px; border-radius:999px; color:var(--accent); background:var(--accent-dim); font-size:10px; font-weight:700; text-transform:uppercase; }
@media(max-width:640px){.podcast-discovery{padding:13px}.podcast-discovery-heading{align-items:stretch;flex-direction:column}.podcast-discovery-heading select{width:100%}.podcast-search-result{grid-template-columns:52px minmax(0,1fr)}.podcast-search-result img{width:52px;height:52px}.podcast-result-kind{display:none}.podcast-result-description{-webkit-line-clamp:1}}
.podcast-show-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 10px; cursor: pointer; transition: background 0.15s;
}
.podcast-show-card:hover { background: var(--bg-elevated); }
.podcast-show-info { flex: 1; min-width: 0; }
.podcast-show-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podcast-show-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.podcast-ep-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 8px;
}
.podcast-ep-row .ep-name { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podcast-ep-row .ep-size { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.podcast-ep-row .ep-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.btn-delete-ep, .btn-delete-show {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 12px; padding: 4px 10px; cursor: pointer; white-space: nowrap;
}
.btn-delete-ep:hover, .btn-delete-show:hover { border-color: #e74c3c; color: #e74c3c; }
.btn-check-new, .btn-dl-missing {
  background: none; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  color: var(--accent); font-size: 12px; padding: 4px 10px; cursor: pointer; white-space: nowrap;
}
.btn-check-new:hover, .btn-dl-missing:hover { background: var(--accent); color: #000; }
.missing-ep-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 8px;
}
.missing-ep-row .ep-name { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.missing-ep-row .ep-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.missing-section-header { font-size: 14px; font-weight: 600; color: var(--accent); margin: 20px 0 10px; display: flex; align-items: center; justify-content: space-between; }
.missing-section-header .missing-count { font-weight: 400; font-size: 12px; color: var(--text-muted); }
.podcast-ep-row .ep-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.podcast-sub-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 8px;
}
.podcast-sub-card img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.podcast-sub-info { flex: 1; min-width: 0; }
.podcast-sub-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podcast-sub-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.podcast-sub-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.podcast-sub-actions select { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 6px; font-size: 12px; }
.btn-unsub { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 12px; padding: 4px 10px; cursor: pointer; }
.btn-unsub:hover { border-color: #e74c3c; color: #e74c3c; }
.liked-songs-shortcut {
  width: min(360px, 100%);
  min-height: 58px;
  margin: 0 0 18px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
}
.liked-songs-shortcut:hover { border-color: var(--accent); }
.default-playlist-shortcuts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.default-playlist-shortcuts .liked-songs-shortcut { margin-bottom:0; }
.local-downloads-icon,.local-downloads-hero { background:linear-gradient(135deg,var(--accent),#1677b8)!important; color:#fff; }
.local-downloads-hero { display:flex; align-items:center; justify-content:center; font-size:48px; }
@media (max-width:640px) { .default-playlist-shortcuts { grid-template-columns:1fr; } }
.liked-songs-shortcut .card-body { padding: 0; min-width: 0; flex: 1; }
.liked-songs-shortcut-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 19px;
  background: linear-gradient(135deg,var(--accent),color-mix(in srgb,var(--accent) 24%,var(--bg-card)));
  box-shadow:0 0 18px var(--accent-glow);
}
.liked-songs-shortcut-arrow { color: var(--text-muted); font-size: 24px; line-height: 1; }
.playlist-list-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 14px;
}
.playlist-list-header h3 { margin: 0; font-size: 16px; }
.playlist-list-title-row {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.playlist-folder-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
.playlist-search-control {
  width:100%; display:flex; align-items:center; gap:9px; padding:0 13px;
  color:var(--text-muted); border:1px solid var(--border); border-radius:10px;
  background:var(--bg-elevated); transition:border-color var(--transition);
}
.playlist-search-control svg { width:18px; height:18px; flex:0 0 18px; }
.playlist-folder-actions select {
  min-width:118px; padding:9px 34px 9px 13px; border:1px solid var(--border);
  border-radius:999px; background:var(--bg-elevated); color:var(--text); outline:none;
}
.playlist-folder-actions #newPlaylistFolder { flex-shrink:0; border-radius:999px; white-space:nowrap; }
.playlist-cover-grid { display:grid; overflow:hidden; padding:0!important; background:var(--bg-elevated); }
.playlist-cover-grid.cover-count-1 { grid-template-columns:1fr; }
.playlist-cover-grid.cover-count-2 { grid-template-columns:repeat(2,1fr); }
.playlist-cover-grid.cover-count-3,.playlist-cover-grid.cover-count-4 { grid-template-columns:repeat(2,1fr); grid-template-rows:repeat(2,1fr); }
.playlist-cover-grid.cover-count-3 img:first-child { grid-row:1 / 3; }
.playlist-cover-grid img { width:100%; height:100%; min-width:0; min-height:0; object-fit:cover; display:block; }
.playlist-cover-empty { display:grid; place-items:center; font-size:30px; color:var(--text); background:linear-gradient(135deg,var(--accent),#1a1a2e); }
.playlist-list-header input {
  width: 100%; min-width:0; padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.playlist-search-control:focus-within { border-color:color-mix(in srgb,var(--accent) 55%,var(--border)); }
@media (max-width: 520px) {
  .liked-songs-shortcut { width: 100%; }
  #pageLibrary { padding-inline:12px; }
  #pageLibrary>#libraryTabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); width:100%; gap:5px; padding:5px; margin-bottom:16px; overflow:visible; border:1px solid var(--border); border-radius:15px; background:var(--bg-elevated); }
  #pageLibrary>#libraryTabs .sp-tab { min-width:0; padding:9px 3px; border:0; border-radius:10px; font-size:clamp(9px,2.8vw,11px); overflow:hidden; text-overflow:ellipsis; }
  .playlist-page-heading { margin-bottom:10px; }
  .playlist-page-heading .page-title { font-size:21px; }
  .playlist-heading-actions { gap:7px; }
  .playlist-heading-icon { width:42px; height:42px; min-width:42px; padding:0; border-radius:12px; }
  .playlist-heading-icon svg { width:20px; height:20px; }
  .playlist-heading-icon span { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
  .playlist-list-header { gap:9px; margin-top:18px; }
  .playlist-list-title-row { flex:0 0 auto; }
  .playlist-list-title-row h3 { font-size:15px; }
  .playlist-search-control { min-width:0; min-height:42px; }
  .playlist-search-control input { min-width:0; width:100%; }
}
/* Primary SPA surfaces are mutually exclusive. The router also sets inline
   visibility; these selectors are a defensive boundary for restored sessions
   and mobile navigation so Home can never paint beneath Search history. */
body[data-page="search"] #pageHome,
body[data-page="home"] #pageSearch { display:none!important; }

body[data-page="search"] #pageSearch {
  position:relative;
  z-index:1;
  min-height:calc(100vh - var(--nav-height));
  background:var(--bg);
}

