:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Softer Dark Mode (Zinc / Charcoal base) */
  --bg-dark: #161618;
  --bg-card: #202024;
  --bg-card-hover: #2a2a30;
  --bg-glass: rgba(22, 22, 24, 0.9);
  
  --primary: #d8cdbe;
  --primary-hover: #c9bea9;
  --primary-glow: rgba(216, 205, 190, 0.15);
  --primary-fg: #141414;
  --accent-orange: #f97316;
  --accent-orange-hover: #ea580c;
  --accent: #f97316;
  --danger: #ef4444;
  
  --text-primary: #f2f2f4;
  --text-secondary: #a8a8b3;
  --text-muted: #787885;
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: #d8cdbe;
  
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.4);
  --backdrop-blur: blur(16px);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    /* Soft Light Grey Mode (No harsh #ffffff) */
    --bg-dark: #e8eaed;
    --bg-card: #f3f4f6;
    --bg-card-hover: #e5e7eb;
    --bg-glass: rgba(232, 234, 237, 0.95);
    
    --primary: #2e2a25;
    --primary-hover: #1c1916;
    --primary-glow: rgba(46, 42, 37, 0.12);
    --primary-fg: #f5f2eb;
    --accent-orange: #ea580c;
    --accent-orange-hover: #c2410c;
    --accent: #ea580c;
    --danger: #dc2626;
    
    --text-primary: #18181b;
    --text-secondary: #52525c;
    --text-muted: #71717a;
    
    --border-light: rgba(0, 0, 0, 0.08);
    --border-focus: #635c53;
    --shadow-main: 0 8px 24px rgba(0, 0, 0, 0.06);
  }
}

[data-theme="light"] {
  /* Soft Light Grey Mode (No harsh #ffffff) */
  --bg-dark: #e8eaed;
  --bg-card: #f3f4f6;
  --bg-card-hover: #e5e7eb;
  --bg-glass: rgba(232, 234, 237, 0.92);
  
  --primary: #2e2a25;
  --primary-hover: #1c1916;
  --primary-glow: rgba(46, 42, 37, 0.12);
  --primary-fg: #f5f2eb;
  --accent-orange: #ea580c;
  --accent-orange-hover: #c2410c;
  --accent: #ea580c;
  --danger: #dc2626;
  
  --text-primary: #18181b;
  --text-secondary: #52525c;
  --text-muted: #71717a;
  
  --border-light: rgba(0, 0, 0, 0.08);
  --border-focus: #635c53;
  --shadow-main: 0 8px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
  /* Softer Dark Mode */
  --bg-dark: #161618;
  --bg-card: #202024;
  --bg-card-hover: #2a2a30;
  --bg-glass: rgba(22, 22, 24, 0.88);
  
  --primary: #d8cdbe;
  --primary-hover: #c9bea9;
  --primary-glow: rgba(216, 205, 190, 0.15);
  --primary-fg: #141414;
  --accent-orange: #f97316;
  --accent-orange-hover: #ea580c;
  --accent: #f97316;
  --danger: #ef4444;
  
  --text-primary: #f2f2f4;
  --text-secondary: #a8a8b3;
  --text-muted: #787885;
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: #d8cdbe;
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.4);
}
/* ───────────────────────────────────────────────────────────
   Minimal palette – fewer borders, no orange accent, no icons
   ─────────────────────────────────────────────────────────── */

/* Strip all borders and shadows globally, except for inputs, buttons with explicit borders, toast, and badges */
*:not(input):not(textarea):not(select):not(.search-bar):not(.quick-add-input-wrap):not(.btn-header-back):not(.app-toast):not(.status-badge) {
  border: none !important;
  box-shadow: none !important;
}

/* ───────────────────────────────────────────────────────────
   Modern Apple-Style Input System
   (Outer containers have borders; inner inputs are completely borderless)
   ─────────────────────────────────────────────────────────── */

.search-bar,
.quick-add-input-wrap,
.modal-body input[type="text"],
.modal-body input[type="url"],
.auth-form-card input[type="email"],
#podcast-search-query,
#feed-url-input,
#magic-email-input,
#transcript-search-input,
.transcript-search-input {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: var(--radius-full) !important;
  color: #ffffff !important;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 450;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

[data-theme="light"] .search-bar,
[data-theme="light"] .quick-add-input-wrap,
[data-theme="light"] .modal-body input[type="text"],
[data-theme="light"] .modal-body input[type="url"],
[data-theme="light"] .auth-form-card input[type="email"],
[data-theme="light"] #podcast-search-query,
[data-theme="light"] #feed-url-input,
[data-theme="light"] #magic-email-input,
[data-theme="light"] #transcript-search-input,
[data-theme="light"] .transcript-search-input,
:root:not([data-theme="dark"]) .search-bar,
:root:not([data-theme="dark"]) .quick-add-input-wrap,
:root:not([data-theme="dark"]) .modal-body input[type="text"],
:root:not([data-theme="dark"]) .modal-body input[type="url"],
:root:not([data-theme="dark"]) .auth-form-card input[type="email"],
:root:not([data-theme="dark"]) #podcast-search-query,
:root:not([data-theme="dark"]) #feed-url-input,
:root:not([data-theme="dark"]) #magic-email-input,
:root:not([data-theme="dark"]) #transcript-search-input,
:root:not([data-theme="dark"]) .transcript-search-input {
  background: rgba(0, 0, 0, 0.05) !important;
  border: 1px solid rgba(0, 0, 0, 0.13) !important;
  color: #111111 !important;
}

.search-bar:hover,
.quick-add-input-wrap:hover,
.modal-body input[type="text"]:hover,
.modal-body input[type="url"]:hover,
.auth-form-card input[type="email"]:hover,
#podcast-search-query:hover,
#feed-url-input:hover,
#magic-email-input:hover,
#transcript-search-input:hover,
.transcript-search-input:hover {
  background: rgba(255, 255, 255, 0.11) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

[data-theme="light"] .search-bar:hover,
[data-theme="light"] .quick-add-input-wrap:hover,
[data-theme="light"] .modal-body input[type="text"]:hover,
[data-theme="light"] .modal-body input[type="url"]:hover,
[data-theme="light"] .auth-form-card input[type="email"]:hover,
[data-theme="light"] #podcast-search-query:hover,
[data-theme="light"] #feed-url-input:hover,
[data-theme="light"] #magic-email-input:hover,
[data-theme="light"] #transcript-search-input:hover,
[data-theme="light"] .transcript-search-input:hover,
:root:not([data-theme="dark"]) .search-bar:hover,
:root:not([data-theme="dark"]) .quick-add-input-wrap:hover,
:root:not([data-theme="dark"]) .modal-body input[type="text"]:hover,
:root:not([data-theme="dark"]) .modal-body input[type="url"]:hover,
:root:not([data-theme="dark"]) .auth-form-card input[type="email"]:hover,
:root:not([data-theme="dark"]) #podcast-search-query:hover,
:root:not([data-theme="dark"]) #feed-url-input:hover,
:root:not([data-theme="dark"]) #magic-email-input:hover,
:root:not([data-theme="dark"]) #transcript-search-input:hover,
:root:not([data-theme="dark"]) .transcript-search-input:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  border-color: rgba(0, 0, 0, 0.22) !important;
}

.search-bar:focus-within,
.quick-add-input-wrap:focus-within,
.modal-body input[type="text"]:focus,
.modal-body input[type="url"]:focus,
.auth-form-card input[type="email"]:focus,
#podcast-search-query:focus,
#feed-url-input:focus,
#magic-email-input:focus,
#transcript-search-input:focus,
.transcript-search-input:focus {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08) !important;
  outline: none !important;
}

[data-theme="light"] .search-bar:focus-within,
[data-theme="light"] .quick-add-input-wrap:focus-within,
[data-theme="light"] .modal-body input[type="text"]:focus,
[data-theme="light"] .modal-body input[type="url"]:focus,
[data-theme="light"] .auth-form-card input[type="email"]:focus,
[data-theme="light"] #podcast-search-query:focus,
[data-theme="light"] #feed-url-input:focus,
[data-theme="light"] #magic-email-input:focus,
[data-theme="light"] #transcript-search-input:focus,
[data-theme="light"] .transcript-search-input:focus,
:root:not([data-theme="dark"]) .search-bar:focus-within,
:root:not([data-theme="dark"]) .quick-add-input-wrap:focus-within,
:root:not([data-theme="dark"]) .modal-body input[type="text"]:focus,
:root:not([data-theme="dark"]) .modal-body input[type="url"]:focus,
:root:not([data-theme="dark"]) .auth-form-card input[type="email"]:focus,
:root:not([data-theme="dark"]) #podcast-search-query:focus,
:root:not([data-theme="dark"]) #feed-url-input:focus,
:root:not([data-theme="dark"]) #magic-email-input:focus,
:root:not([data-theme="dark"]) #transcript-search-input:focus,
:root:not([data-theme="dark"]) .transcript-search-input:focus {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.35) !important;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08) !important;
  outline: none !important;
}

/* Inner inputs inside wrapper bars - absolutely NO borders or backgrounds (only outer wrapper has border) */
.search-bar input,
.quick-add-input-wrap input,
#search-input,
#empty-quick-input,
#feeds-empty-quick-input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: inherit !important;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 450;
  width: 100%;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.search-bar input:focus,
.quick-add-input-wrap input:focus,
#search-input:focus,
#empty-quick-input:focus,
#feeds-empty-quick-input:focus {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* High contrast placeholders */
input::placeholder,
.search-bar input::placeholder,
.quick-add-input-wrap input::placeholder {
  color: var(--text-muted) !important;
  opacity: 0.8 !important;
  font-weight: 400;
}

/* ───────────────────────────────────────────────────────────
   Player Episode Status Badges & Share Buttons
   ─────────────────────────────────────────────────────────── */

.player-episode-status-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.25rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.09) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  transition: all 0.2s ease;
  user-select: none;
}

[data-theme="light"] .status-badge,
:root:not([data-theme="dark"]) .status-badge {
  background: rgba(0, 0, 0, 0.06) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.status-badge.badge-downloaded {
  color: #10b981; /* Emerald green for offline ready */
}

.status-badge.badge-fav {
  color: #ef4444; /* Heart coral red */
}

.status-badge.badge-queue {
  color: #3b82f6; /* Blue for queue */
}

.status-badge svg {
  display: block !important;
}

.status-badge.hidden {
  display: none !important;
}

.mini-status-badges {
  margin-right: 0.15rem;
}

.mini-status-badges .status-badge {
  width: 20px;
  height: 20px;
}

/* App Toast Notification (Apple-style HUD) */
.app-toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-24px);
  background: rgba(24, 24, 28, 0.94);
  color: #ffffff;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

[data-theme="light"] .app-toast,
:root:not([data-theme="dark"]) .app-toast {
  background: rgba(255, 255, 255, 0.95);
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
}

.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Hide SVG icons and font-awesome icons throughout the UI.
   The player controls keep their SVG via .player-bar svg overrides below. */
.empty-icon-wrap svg,
.nav-tab svg,
.shelf-header svg,
.feed-detail-header svg,
.empty-quick-add svg,
.quick-add-icon {
  display: none !important;
}

/* Reduce orange accent – keep it only on active/interactive states */
:root {
  --accent-orange: var(--text-muted);
  --accent-orange-hover: var(--text-secondary);
}

/* ───────────────────────────────────────────────────────────
   Top navigation modern back button
   ─────────────────────────────────────────────────────────── */
.btn-header-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem 0.35rem 0.55rem;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  user-select: none;
}

.btn-header-back:hover {
  background: var(--bg-card-hover);
  color: var(--accent-orange);
}

.btn-header-back.hidden {
  display: none !important;
}

.btn-header-back svg {
  display: block !important;
  flex-shrink: 0;
}

/* ───────────────────────────────────────────────────────────
   Empty-episode screen – plain text only, no colours, no icons
   ─────────────────────────────────────────────────────────── */
.empty-state.onboarding-card,
.empty-episode {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  color: var(--text-muted);
  background: transparent;
  text-align: center;
  padding: 2rem;
  gap: 0.75rem;
}
.empty-state.onboarding-card svg,
.empty-state.onboarding-card .empty-icon-wrap,
.empty-episode svg,
.empty-episode .empty-icon-wrap {
  display: none !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─────────────────────────────────────────────────────────────────────────
   MODERN MINIMALIST LOWERCASE UI TYPOGRAPHY
   Applied across all UI chrome (navigation, buttons, badges, chips, labels,
   shelf titles, modal chrome, search inputs, and status indicators)
   while preserving natural casing for user podcast/episode titles & notes.
   ───────────────────────────────────────────────────────────────────────── */
.app-header,
.app-header button,
.app-header button *,
.app-header h1,
.app-header span,
.logo-area,
.logo-area *,
.nav-tabs,
.nav-tabs *,
.nav-tab,
.nav-tab *,
.tab-badge,
.tab-badge *,
.header-actions,
.header-actions *,
.btn,
.btn *,
button,
button *,
.chip-filter,
.chip-filter *,
.bottom-action-dock,
.bottom-action-dock *,
.shelf-header,
.shelf-header *,
.btn-shelf-toggle,
.btn-shelf-toggle *,
.continue-sticky-bar,
.continue-sticky-bar *,
.btn-continue-sticky-collapse,
.btn-continue-sticky-collapse *,
.btn-back-nav,
.btn-back-nav *,
.btn-pill-action,
.btn-pill-action *,
.feed-link-badge,
.feed-link-badge *,
.category-chip,
.category-chip *,
.subgenre-chip,
.subgenre-chip *,
.badge,
.badge *,
.shelf-title,
.shelf-header-group,
.dir-section-title,
.search-dir-status,
.modal-header,
.modal-header *,
.modal-footer,
.modal-footer *,
.modal-card h2,
.modal-body p,
.add-modal-section label,
.filter-chip,
.status-pill,
.status-pill *,
.user-status-pill,
.user-status-pill *,
.user-pill-details,
.user-pill-details *,
.dock-sort-label,
.dock-sort-select,
.dock-sort-select *,
#sort-order,
#sort-order *,
#sort-order option,
.legend-btn,
.legend-btn *,
.legend-label,
.timeline-legend,
.timeline-legend *,
.waveform-time-label,
.time-label,
.btn-playback-rate,
.playback-speed-btn,
.empty-state h3,
.empty-state p,
.empty-state-btn,
.empty-state button,
.quick-add-input-wrap input,
.quick-add-input-wrap input::placeholder,
.search-bar input,
.search-bar input::placeholder,
.header-search input,
.header-search input::placeholder,
.app-brand h1,
.app-brand span,
.status-banner,
.toast,
.timer-btn,
.view-title,
.settings-group-title,
.settings-item-label,
.settings-item-desc,
.episode-card-actions,
.episode-card-actions *,
.episode-meta .date-line,
.episode-meta .date-line *,
.episode-meta .time-line,
.episode-meta .time-line *,
.notes-toggle-btn,
.btn-theme,
.theme-option,
.confirm-title,
.confirm-msg,
.sleep-status-text,
.tooltip,
.waveform-tooltip,
[data-tooltip]::before,
[data-tooltip]::after,
input,
input::placeholder,
textarea,
textarea::placeholder,
select,
select option {
  text-transform: lowercase !important;
}

/* Explicit exception to ALWAYS preserve natural casing for podcast titles, episode titles, author names, and descriptions/notes */
.episode-title,
.episode-title *,
.track-title,
.track-title *,
.feed-detail-title,
.feed-detail-title *,
.feed-detail-author,
.feed-detail-author *,
.feed-detail-desc,
.feed-detail-desc *,
.feed-card-title,
.feed-card-title *,
.feed-card-author,
.feed-card-author *,
.modal-notes-title,
.modal-notes-title *,
.modal-notes-body,
.modal-notes-body *,
.show-notes-content,
.show-notes-content *,
.search-result-title,
.search-result-title *,
.search-result-author,
.search-result-author *,
.episode-podcast,
.episode-podcast *,
.track-podcast,
.track-podcast * {
  text-transform: none !important;
}


html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-family);
  font-weight: 300;
  letter-spacing: -0.01em;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  padding-bottom: 2rem;
  transition: padding-bottom 0.3s ease;
}

body.has-active-episode .app-container {
  padding-bottom: 130px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-glass);
/*  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);*/
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.logo-area h1 {
  font-size: 1.5rem;
  font-weight: 450;
  color: var(--text-primary);
}

.offline-badge {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.offline-badge.hidden {
  display: none !important;
}

.user-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  padding: 0.42rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.user-status-pill:hover,
.user-status-pill:focus-within,
.user-status-pill.is-expanded {
  padding: 0.42rem 0.85rem;
  border-color: var(--border-medium);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user-pill-details {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  transition: max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, margin-left 0.2s ease;
  margin-left: 0;
}

.user-status-pill:hover .user-pill-details,
.user-status-pill:focus-within .user-pill-details,
.user-status-pill.is-expanded .user-pill-details {
  max-width: 320px;
  opacity: 1;
  pointer-events: auto;
  margin-left: 0.5rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  transition: background 0.3s, box-shadow 0.3s;
}

.status-indicator.online {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.btn-pill-action {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.btn-pill-action:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.btn-autoplay-toggle {
  position: relative;
  transition: color 0.2s, opacity 0.2s;
  color: var(--text-muted);
}

.btn-autoplay-toggle.active {
  color: var(--primary, #f97316);
}

.btn-autoplay-toggle .autoplay-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-autoplay-toggle.active .autoplay-dot {
  opacity: 1;
}

.queue-section-header.auto-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--primary, #f97316);
  font-weight: 600;
}

.queue-context-badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  color: var(--primary, #f97316);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  width: 100%;
}

.chip-filter {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.chip-filter:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.chip-filter.active {
  background: var(--text-primary);
  color: var(--bg-dark);
  border-color: var(--text-primary);
  font-weight: 500;
}



/*.continue-sticky-bar {
  position: sticky;
  bottom: 0px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 40;
  pointer-events: none;
  margin-top: 0.85rem;
  padding-bottom: 0.5rem;
}
body.has-active-episode .continue-sticky-bar {
  bottom: 54px;
}*/
/* Container that holds the toggle pill */
.continue-toggle-wrap {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
  transition: all 0.2s ease;
}

.continue-shelf {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}
.continue-shelf {
    padding: 0;
    margin-bottom: 1.5rem;
  }

[data-theme="light"] .continue-shelf,
:root:not([data-theme="dark"]) .continue-shelf {
  background: transparent;
}

.continue-shelf.is-expanded .continue-toggle-wrap {
  position: sticky;
  bottom: 15px; /* Above the player bar */
  left: 0;
  right: 0;
  z-index: 80;
  pointer-events: none; /* Let clicks pass through empty sides */
  display: flex;
  justify-content: center;
}
body.has-active-episode .continue-shelf.is-expanded .continue-toggle-wrap {
  bottom: 65px;
}

/* Ensure the button inside is clickable and has elevation while sticky */
.continue-shelf.is-expanded .continue-toggle-wrap #btn-toggle-continue {
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
}

@media (max-width: 768px) {
  .continue-shelf.is-expanded .continue-toggle-wrap {
    bottom: 120px; /* Clearance on mobile */
  }
}

.continue-sticky-bar.hidden {
  display: none !important;
}

.btn-continue-sticky-collapse {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(22, 22, 26, 0.94);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-continue-sticky-collapse:hover {
  transform: translateY(-2px);
  background: #000000;
  border-color: rgba(255, 255, 255, 0.35);
}

.shelf-header {
  display: flex;
  align-items: center;
  justify-content: center;
    margin: 0.85rem 0;
  padding: 0;
}

.shelf-header-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.35rem 0.2rem 0.85rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.shelf-title {
  font-size: 0.82rem;
  font-weight: 450;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.btn-shelf-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

[data-theme="light"] .btn-shelf-toggle,
:root:not([data-theme="dark"]) .btn-shelf-toggle {
  background: rgba(0, 0, 0, 0.05);
}

.btn-shelf-toggle:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.btn-shelf-toggle .chevron-icon {
  transition: transform 0.25s ease;
}

.continue-shelf.is-expanded .btn-shelf-toggle .chevron-icon {
  transform: rotate(180deg);
}

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
}

@media (min-width: 880px) {
  .shelf-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }
}
@media (min-width: 1150px) {
  .shelf-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

@media (min-width: 1400px) {
  .shelf-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 2000px) {
  .shelf-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 2400px) {
  .shelf-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1.15rem;
  }
}

.ep-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  overflow: hidden;
  margin: 0.35rem 0;
  cursor: pointer;
  position: relative;
  transition: height 0.15s ease, background 0.15s ease;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.ep-progress-track:hover {
  height: 10px;
  background: rgba(255, 255, 255, 0.22);
}

[data-theme="light"] .ep-progress-track,
:root:not([data-theme="dark"]) .ep-progress-track {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ep-progress-track:hover,
:root:not([data-theme="dark"]) .ep-progress-track:hover {
  background: rgba(0, 0, 0, 0.16);
}

.ep-progress-fill {
  height: 100%;
  background: var(--accent-orange);
  border-radius: 9999px;
  transition: width 0.1s ease;
  pointer-events: none;
}

.ep-resume-time {
  color: var(--accent-orange);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.ep-resume-time:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.nav-tabs {
  display: flex;
  gap: 0.2rem;
  background: var(--bg-glass);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-weight: 600;
}

[data-theme="light"] .nav-tab.active {
  background: rgba(0, 0, 0, 0.08);
}

.tab-badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  line-height: 1;
}

.nav-tab.active .tab-badge {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
}

[data-theme="light"] .nav-tab.active .tab-badge {
  background: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

.header-search {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-header-add {
  white-space: nowrap;
  border-radius: var(--radius-sm);
  font-weight: 500;
  padding: 0.45rem 1rem;
}

/* Settings gear icon in header */
.btn-header-settings {
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
}
.btn-header-settings:hover,
.btn-header-settings.is-active {
  opacity: 1;
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
}

.search-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.55rem;
  width: 36px;
  height: 36px;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar .search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s ease;
  pointer-events: none;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  width: 0;
  opacity: 0;
  background: transparent !important;
  border: none !important;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Expanded state: on hover, focus-within, or when search text is present */
.search-bar:hover,
.search-bar:focus-within,
.search-bar.has-text,
.search-bar.is-expanded {
  width: 290px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card-hover, var(--bg-card));
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.search-bar:hover .search-icon,
.search-bar:focus-within .search-icon,
.search-bar.has-text .search-icon,
.search-bar.is-expanded .search-icon {
  color: var(--text-primary);
}

.search-bar:hover input,
.search-bar:focus-within input,
.search-bar.has-text input,
.search-bar.is-expanded input {
  width: 100%;
  opacity: 1;
  pointer-events: auto;
}

.btn-clear-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  margin: 0;
  transition: all 0.15s ease;
}

.btn-clear-search:hover {
  background: rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
  transform: scale(1.08);
}

[data-theme="light"] .btn-clear-search {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .btn-clear-search:hover {
  background: rgba(0, 0, 0, 0.18);
}

/* Container for the live preview strip */
.search-discover-preview {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  padding: 0rem 0.5rem;
  z-index: 10000;
  backdrop-filter: blur(12px);
}

.search-discover-preview.hidden {
  display: none !important;
}

/* Horizontal scroll strip */
.discover-preview-scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 1px;
}

.discover-preview-scroll::-webkit-scrollbar {
  display: none;
}

/* 5 compact preview cards */
.discover-preview-item {
  flex: 0 0 250px;
  max-width: 250px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-subtle, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, transform 0.15s ease;
}

.discover-preview-item:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.08));
}

.discover-preview-item img {
  width: 60px;
  height: 60px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Constrained text container so titles never stretch or overflow */
.discover-preview-item-info {
  flex: 1 1 auto;
  min-width: 0; /* Critical for ellipsis truncation inside flex */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.discover-preview-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discover-preview-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inline "+" save button */
.discover-preview-add-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.discover-preview-add-btn:hover:not(:disabled) {
  background: var(--primary, #f97316);
  color: #fff;
  border-color: var(--primary, #f97316);
}

.discover-preview-add-btn.is-subbed {
  border-color: transparent;
  color: #22c55e;
  cursor: default;
  font-size: 0.8rem;
}

/* Trailing "see all in discover →" button styled as last card */
.discover-preview-see-all-card {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: transparent;
  border: 1px dashed var(--border-default);
  border-radius: 8px;
  color: var(--primary, #f97316);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.discover-preview-see-all-card:hover {
  background: rgba(249, 115, 22, 0.1);
}

select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-fg, #141414);
  box-shadow: none;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--primary-fg, #141414);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-confirm-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 400;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-confirm-action:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

[data-theme="light"] .btn-confirm-action,
:root:not([data-theme="dark"]) .btn-confirm-action {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .btn-confirm-action:hover,
:root:not([data-theme="dark"]) .btn-confirm-action:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.25);
  color: #dc2626;
}

/* Main Content & Tab Panels */
.main-content {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem 1.5rem 2rem 1.5rem;
  flex: 1;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Status Banner */
.status-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.episode-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
}

@media (min-width: 850px) {
  .episode-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

@media (min-width: 1400px) {
  .episode-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 2000px) {
  .episode-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 2400px) {
  .episode-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.15rem;
  }
}

.episode-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  backdrop-filter: var(--backdrop-blur);
  transition: all 0.25s ease;
  content-visibility: auto;
  contain-intrinsic-size: auto 150px;
  position: relative;
  gap: 0.65rem;
  min-width: 0;
  overflow: hidden;
}

.episode-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.episode-card.playing {
  border-color: var(--accent-orange);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 1px var(--accent-orange), 0 4px 20px rgba(249, 115, 22, 0.28);
}

.episode-card.is-played {
  opacity: 0.6;
}

.episode-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  overflow: hidden;
}

.episode-artwork {
  width: 52px;
  height: 52px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: #18181b;
}

.episode-header-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.episode-podcast-name {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--primary);
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
  cursor: pointer;
}

.episode-podcast-name:hover {
  text-decoration: underline;
}

.episode-title {
  font-size: 0.925rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.episode-desc {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Search match highlight in episode cards & feed lists */
mark.search-highlight {
  background: rgba(249, 115, 22, 0.22);
  color: var(--accent-orange, #ea580c);
  font-weight: 600;
  border-radius: 4px;
  padding: 0.05em 0.25em;
  margin: 0 -0.05em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background 0.15s ease, color 0.15s ease;
}

[data-theme="dark"] mark.search-highlight {
  background: rgba(249, 115, 22, 0.3);
  color: #fdba74;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) mark.search-highlight {
    background: rgba(249, 115, 22, 0.3);
    color: #fdba74;
  }
}

[data-theme="light"] mark.search-highlight {
  background: rgba(234, 88, 12, 0.16);
  color: #c2410c;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) mark.search-highlight {
    background: rgba(234, 88, 12, 0.16);
    color: #c2410c;
  }
}

.episode-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.episode-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.episode-meta .date-line {
  color: var(--text-muted);
  font-size: 0.73rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.episode-meta .time-line {
  color: var(--text-secondary);
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.episode-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

@media (hover: hover) and (min-width: 769px) {
  .episode-card-actions .btn-fav-ep:not(.is-favorited),
  .episode-card-actions .btn-download-ep,
  .episode-card-actions .btn-transcript-ep,
  .episode-card-actions .btn-queue-ep,
  .episode-card-actions .btn-share-ep,
  .episode-card-actions .btn-mark-played {
    opacity: 0;
    max-width: 0;
    width: 0;
    padding: 0;
    margin: 0;
    border: none;
    pointer-events: none;
    overflow: hidden;
    transform: scale(0.85);
    transition: opacity 0.18s ease,
                max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                width 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.18s ease;
  }

  .episode-card:hover .episode-card-actions .btn-fav-ep,
  .episode-card:hover .episode-card-actions .btn-download-ep,
  .episode-card:hover .episode-card-actions .btn-transcript-ep,
  .episode-card:hover .episode-card-actions .btn-queue-ep,
  .episode-card:hover .episode-card-actions .btn-share-ep,
  .episode-card:hover .episode-card-actions .btn-mark-played,
  .episode-card:focus-within .episode-card-actions .btn-fav-ep,
  .episode-card:focus-within .episode-card-actions .btn-download-ep,
  .episode-card:focus-within .episode-card-actions .btn-transcript-ep,
  .episode-card:focus-within .episode-card-actions .btn-queue-ep,
  .episode-card:focus-within .episode-card-actions .btn-share-ep,
  .episode-card:focus-within .episode-card-actions .btn-mark-played {
    opacity: 1;
    max-width: 32px;
    width: 32px;
    pointer-events: auto;
    border: 1px solid var(--border-light);
    transform: scale(1);
  }
}

.btn-play-ep {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-card-hover);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-play-ep svg {
  width: 14px;
  height: 14px;
}

.btn-play-ep:hover {
  background: var(--border-light);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.episode-card.playing .btn-play-ep {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #fff;
}

.btn-mark-played {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-mark-played svg {
  width: 14px;
  height: 14px;
}

.btn-mark-played:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.btn-mark-played.is-completed {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.btn-queue-ep,
.btn-transcript-ep {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-queue-ep svg,
.btn-transcript-ep svg {
  width: 14px;
  height: 14px;
}

.btn-queue-ep:hover,
.btn-transcript-ep:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.btn-queue-ep svg {
  width: 14px;
  height: 14px;
}

.btn-queue-ep:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.btn-queue-ep.is-queued {
  background: rgba(224, 90, 43, 0.15);
  color: var(--accent-orange);
  border-color: var(--accent-orange);
}

.btn-fav-ep {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s ease;
  padding: 0;
}

.btn-fav-ep svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}

.btn-fav-ep:hover {
  background: var(--bg-card-hover);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  transform: scale(1.05);
}

.btn-fav-ep.is-favorited {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  opacity: 1 !important;
  max-width: 32px !important;
  width: 32px !important;
  pointer-events: auto !important;
}

.btn-fav-ep.is-favorited:hover {
  background: rgba(239, 68, 68, 0.22) !important;
  transform: scale(1.08);
}

.btn-download-ep {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-download-ep svg {
  width: 14px;
  height: 14px;
}

.btn-download-ep:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.btn-download-ep.is-downloaded {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.35);
}

.btn-download-ep.is-downloading {
  color: var(--accent);
  border-color: var(--accent);
  pointer-events: none;
}

.btn-download-ep.is-downloading svg {
  animation: spin 1s linear infinite;
}

.btn-share-ep {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-share-ep svg {
  width: 14px;
  height: 14px;
}

.btn-share-ep:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-secondary);
  transform: scale(1.05);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 2rem 4rem;
  background: radial-gradient(circle at 50% 0%, rgba(249, 115, 22, 0.05), transparent 70%), var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  max-width: 100%;
  width: 100%;
  margin: 1.5rem auto;
  box-sizing: border-box;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
}

.empty-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.2);
  color: var(--accent-orange);
  box-shadow: 0 0 25px rgba(249, 115, 22, 0.15);
}

.empty-state h3 {
  font-size: 1.65rem;
  font-weight: 550;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.empty-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 1.75rem auto;
  font-size: 0.95rem;
  font-weight: 350;
  line-height: 1.6;
}

.empty-quick-add {
  max-width: 780px;
  margin: 0 auto 1.75rem auto;
  width: 100%;
}

.empty-category-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin: 1rem 0 0.5rem 0;
}

.quick-add-form {
  width: 100%;
}

.quick-add-input-wrap {
  display: flex;
  align-items: center;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 0.45rem 0.5rem 0.45rem 1.15rem;
  gap: 0.65rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .quick-add-input-wrap,
:root:not([data-theme="dark"]) .quick-add-input-wrap {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.quick-add-input-wrap:focus-within {
  border-color: var(--accent-orange);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2), 0 8px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .quick-add-input-wrap:focus-within,
:root:not([data-theme="dark"]) .quick-add-input-wrap:focus-within {
  background: #ffffff;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15), 0 8px 30px rgba(0, 0, 0, 0.08);
}

.quick-add-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.quick-add-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-primary);
  min-width: 0;
}

.quick-add-input-wrap input::placeholder {
  color: var(--text-muted);
  font-weight: 350;
}

.btn-quick-submit {
  padding: 0.5rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--accent-orange);
  color: #fff;
  transition: all 0.2s ease;
}

.btn-quick-submit:hover {
  background: var(--accent-orange-hover);
  transform: translateY(-1px);
}

.quick-results-container {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: min(440px, 60vh);
  overflow-y: auto;
  padding-right: 2px;
}

.dir-filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 2rem;
}

#btn-empty-opml-trigger {
  border-radius: var(--radius-full);
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

#btn-empty-opml-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* ── Elegant 2026 Curated Shows Grid ── */

.starter-suggestions-section {
  width: 100%;
  margin: 2rem 0 0.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.starter-suggestions-header {
  text-align: center;
}

.starter-suggestions-title {
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.starter-suggestions-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 350;
}

.starter-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  width: 100%;
  max-width: 900px;
}

.starter-filter-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 450;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.starter-filter-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.starter-filter-pill.active {
  background: var(--text-primary);
  color: var(--bg-dark);
  border-color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .starter-filter-pill {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .starter-filter-pill:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .starter-filter-pill.active {
  background: #18181b;
  color: #ffffff;
  border-color: #18181b;
}

/* Modern Card Grid */
.starter-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
  text-align: left;
  margin-top: 0.5rem;
}

@media (max-width: 580px) {
  .starter-suggestions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }

  .starter-show-card {
    padding: 0.65rem 0.6rem !important;
  }

  .starter-show-card .feed-art {
    width: 36px !important;
    height: 36px !important;
  }

  .starter-show-card .feed-info h4 {
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
  }

  .starter-show-card .feed-info p {
    font-size: 0.68rem !important;
  }

  .starter-show-card .starter-chip-add {
    font-size: 0.72rem !important;
    padding: 0.25rem 0.5rem !important;
  }
}

@media (min-width: 1280px) {
  .starter-suggestions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.starter-show-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.starter-show-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(249, 115, 22, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .starter-show-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .starter-show-card:hover {
  border-color: rgba(249, 115, 22, 0.4);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.08);
}

.starter-show-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.starter-show-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(249, 115, 22, 0.12);
  color: var(--accent-orange);
  border: 1px solid rgba(249, 115, 22, 0.25);
  white-space: nowrap;
}

.starter-show-info {
  flex: 1;
}

.starter-show-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  cursor: pointer;
  transition: color 0.15s ease;
}

.starter-show-name:hover {
  color: var(--accent-orange);
}

.starter-show-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .starter-show-actions {
  border-top-color: rgba(0, 0, 0, 0.05);
}

.starter-chip-preview-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.starter-chip-preview-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

[data-theme="light"] .starter-chip-preview-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.starter-chip-add {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-orange);
  background: var(--bg-glass);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: var(--radius-full);
  cursor: pointer;
  padding: 0.25rem 0.7rem;
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.starter-chip-add:hover {
  background: var(--accent-orange);
  color: #fff;
  border-color: var(--accent-orange);
  transform: translateY(-1px);
}

.starter-chip-add.subscribed {
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
  font-weight: 500;
  cursor: default;
}

/* Feeds Tab Quick Filter Bar */
.feeds-filter-bar {
  margin-bottom: 1rem;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feeds-filter-bar.hidden {
  display: none;
}

.feeds-sort-select {
  flex-shrink: 0;
  margin-left: auto;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  max-width: 45%;
}

.feeds-sort-select:hover,
.feeds-sort-select:focus {
  color: var(--text-primary);
  outline: none;
}

.feeds-filter-chips {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.2rem 0;
}

.feeds-filter-chips::-webkit-scrollbar {
  display: none;
}

.feed-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.feed-filter-chip:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.08));
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.feed-filter-chip.active {
  background: var(--primary);
  color: var(--primary-fg, #141414);
  border-color: transparent;
  font-weight: 600;
}

.feed-filter-chip .chip-count {
  opacity: 0.75;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.feeds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  width: 100%;
}

@media (min-width: 880px) {
  .feeds-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

@media (min-width: 1680px) {
  .feeds-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 2000px) {
  .feeds-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 2400px) {
  .feeds-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.15rem;
  }
}

.feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.feed-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.feed-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  position: relative;
}

.feed-art {
  width: 48px;
  height: 48px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.feed-info {
  flex: 1;
  min-width: 0;
  padding-right: 3.75rem;
}

.feed-info h4,
.recent-ep-title,
.track-title {
  font-size: 0.925rem;
  font-weight: 100 !important;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.2rem;
  text-transform: none !important;
}

.feed-info p {
  font-size: 0.775rem;
  font-weight: 300;
  color: var(--text-secondary);
}

.feed-header-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-feed-share,
.btn-feed-unsubscribe {
  background: transparent;
  border: none;
  color: var(--text-muted);
  opacity: 0.55;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.feed-card:hover .btn-feed-share,
.feed-card:hover .btn-feed-unsubscribe {
  opacity: 0.85;
}

.btn-feed-share:hover {
  opacity: 1 !important;
  color: var(--primary);
  background: rgba(249, 115, 22, 0.12);
}

.btn-feed-unsubscribe:hover {
  opacity: 1 !important;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

.feed-card-desc {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0.1rem 0 0.25rem 0;
}

.feed-recent-widget {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  margin-top: 0.25rem;
}

[data-theme="light"] .feed-recent-widget,
:root:not([data-theme="dark"]) .feed-recent-widget {
  background: rgba(0, 0, 0, 0.02);
}

.feed-recent-header {
  font-size: 0.7rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.feed-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.recent-ep-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.4rem;
  border-radius: 5px;
  background: transparent;
  transition: background 0.15s ease;
  min-width: 0;
}

.recent-ep-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .recent-ep-row:hover,
:root:not([data-theme="dark"]) .recent-ep-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.recent-ep-row.active {
  background: var(--primary-glow);
}

.recent-ep-row.is-played .recent-ep-title {
  color: var(--text-muted);
}

.recent-ep-row.is-played .btn-recent-play {
  opacity: 0.6;
}

.recent-ep-row.is-in-progress .recent-ep-duration {
  color: var(--accent-orange);
  font-weight: 500;
}

.btn-recent-play {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

[data-theme="light"] .btn-recent-play,
:root:not([data-theme="dark"]) .btn-recent-play {
  background: rgba(0, 0, 0, 0.07);
}

.btn-recent-play:hover {
  transform: scale(1.1);
  background: var(--text-primary);
  color: var(--bg-dark);
}

.btn-recent-play.is-playing {
  background: var(--accent-orange);
  color: #ffffff;
}

.recent-ep-title {
  flex: 1;
  min-width: 0;
  font-size: 0.775rem;
  font-weight: 300;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-ep-row.active .recent-ep-title {
  font-weight: 450;
  color: var(--primary);
}

.recent-ep-duration {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 300;
}

/* ───────────────────────────────────────────────────────────
   Modal Scroll Navigation (Wikipedia-style quick jumps)
   ─────────────────────────────────────────────────────────── */

.modal-scroll-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.75rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}

.modal-scroll-link {
  background: transparent;
  border: none !important;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.modal-scroll-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-scroll-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

[data-theme="light"] .modal-scroll-link.active,
:root:not([data-theme="dark"]) .modal-scroll-link.active {
  background: rgba(0, 0, 0, 0.07) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

.add-modal-scrollable-body {
  overflow-y: auto !important;
  scroll-behavior: smooth;
  max-height: calc(88vh - 125px);
  padding: 1.25rem 1.75rem;
  position: relative;
}

.add-modal-section {
  margin-bottom: 1.5rem;
}

/* Modal Search Box & Input Styling */
.modal-search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

.modal-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.45rem 0.85rem;
  transition: all 0.2s ease;
  min-height: 42px;
  box-sizing: border-box;
}

.modal-search-input-wrap:focus-within {
  border-color: var(--border-focus);
  background: var(--bg-card-hover, var(--bg-card));
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

.modal-search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.modal-search-input-wrap input {
  flex: 1;
  min-width: 0;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0 !important;
  margin: 0 !important;
}

.btn-modal-search-submit {
  flex-shrink: 0;
  height: 42px;
  padding: 0 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-rss-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  width: 100%;
}

.add-modal-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 1.5rem 0 1.25rem 0;
}

.add-modal-rss-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

/* ───────────────────────────────────────────────────────────
   Directory Results Toolbar & Enlarge Toggle
   ─────────────────────────────────────────────────────────── */

.dir-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding: 0 0.1rem;
}

.dir-results-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.btn-toggle-enlarge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="light"] .btn-toggle-enlarge,
:root:not([data-theme="dark"]) .btn-toggle-enlarge {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
}

.btn-toggle-enlarge:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ───────────────────────────────────────────────────────────
   Directory Search Results:
   1) Default: 4.5 cards per row visible with horizontal slide
   2) Enlarged: 5 feeds per row grid with flow
   ─────────────────────────────────────────────────────────── */

.search-directory-results {
  position: relative;
  transition: all 0.25s ease;
}

/* Default: Horizontal Slider 4.5 cards per row */
.search-directory-results.dir-carousel-view .dir-search-list {
  display: flex !important;
  flex-direction: row !important;
  gap: 0.85rem !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x mandatory;
  padding: 0.35rem 0.15rem 1rem 0.15rem;
  -webkit-overflow-scrolling: touch;
}

.search-directory-results.dir-carousel-view .dir-search-card {
  flex: 0 0 calc((100% - 3.5 * 0.85rem) / 4.5) !important;
  min-width: calc((100% - 3.5 * 0.85rem) / 4.5) !important;
  max-width: calc((100% - 3.5 * 0.85rem) / 4.5) !important;
  scroll-snap-align: start;
}

@media (max-width: 900px) {
  .search-directory-results.dir-carousel-view .dir-search-card {
    flex: 0 0 calc((100% - 2.5 * 0.75rem) / 3.5) !important;
    min-width: calc((100% - 2.5 * 0.75rem) / 3.5) !important;
    max-width: calc((100% - 2.5 * 0.75rem) / 3.5) !important;
  }
}

@media (max-width: 600px) {
  .search-directory-results.dir-carousel-view .dir-search-card {
    flex: 0 0 calc((100% - 1.5 * 0.65rem) / 2.5) !important;
    min-width: calc((100% - 1.5 * 0.65rem) / 2.5) !important;
    max-width: calc((100% - 1.5 * 0.65rem) / 2.5) !important;
  }
}

/* Enlarged: Normal feed grid with 5 feeds per row and flow */
.search-directory-results.is-enlarged .dir-search-list {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 0.85rem !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  padding: 0.35rem 0.15rem 2rem 0.15rem;
}

@media (max-width: 1050px) {
  .player-main-controls-row {
    display: flex;
    flex-direction: column;
    padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px)) 1rem !important;
    gap: 0.4rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  
  .search-directory-results.is-enlarged .dir-search-list {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 760px) {
  .search-directory-results.is-enlarged .dir-search-list {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .search-directory-results.is-enlarged .dir-search-list {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

.search-directory-results.is-enlarged .dir-search-card {
  flex: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

/* Modern Card Layout (Feed Card format) */
.dir-search-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  text-align: left;
  user-select: none;
}

.dir-search-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.dir-search-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.15);
}

.dir-search-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.dir-search-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.05em;
}

.dir-search-artist {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.dir-search-tags {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.dir-search-card .btn-sub-dir {
  width: 100%;
  margin-top: auto;
  padding: 0.35rem 0.5rem;
  font-size: 0.76rem;
  border-radius: var(--radius-full);
}

/* ───────────────────────────────────────────────────────────
   Sticky Disenlarge Button Bar
   "the disenlarge needs to never leave the screen and should stay sticky add the bottom"
   ─────────────────────────────────────────────────────────── */

.dir-sticky-collapse-bar {
  position: sticky;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
  margin-top: 0.5rem;
}

.dir-sticky-collapse-bar.hidden {
  display: none !important;
}

.btn-sticky-collapse {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(22, 22, 26, 0.94);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: var(--radius-full);
  padding: 0.55rem 1.35rem;
  font-size: 0.84rem;
  font-weight: 550;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-sticky-collapse:hover {
  transform: scale(1.02);
  background: rgba(30, 30, 36, 0.98);
}

[data-theme="light"] .btn-sticky-collapse,
:root:not([data-theme="dark"]) .btn-sticky-collapse {
  background: rgba(255, 255, 255, 0.95);
  color: #111111;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
}

.theme-switch-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-theme {
  text-transform: lowercase;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
}

.btn-theme.active {
  background: var(--text-primary);
  color: var(--bg-dark);
  border-color: var(--text-primary);
  font-weight: 600;
}

.feed-detail-header {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem 2rem;
  margin: 0 auto 2rem auto;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.feed-detail-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.feed-detail-top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-feed-mute {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn-feed-mute svg {
  flex-shrink: 0;
}

.btn-feed-mute.is-muted {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--danger);
}

.btn-feed-mute.is-muted:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
}

.btn-back-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-back-nav:hover {
  background: var(--bg-hover, var(--border-light));
  border-color: var(--text-secondary);
  color: var(--text-primary);
  transform: translateX(-2px);
}

.feed-detail-main {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

@media (max-width: 650px) {
  .feed-detail-header {
    padding: 1.25rem 1rem;
    margin-bottom: 1.25rem;
  }
  .feed-detail-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }
}

.feed-detail-art {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.feed-detail-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.feed-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.feed-detail-author {
  font-size: 0.88rem;
  color: var(--accent-orange);
  font-weight: 500;
}

.feed-detail-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 620px;
}

.feed-detail-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.feed-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
  color: var(--primary);
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.feed-link-badge:hover {
  text-decoration: underline;
}

.feed-link-badge.feed-muted-badge {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.feed-link-badge.feed-muted-badge:hover {
  text-decoration: none;
}

[data-theme="light"] .feed-link-badge {
  background: rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .feed-link-badge {
    background: rgba(0, 0, 0, 0.04);
  }
}

#panel-settings {
  display: none;
}

#panel-settings.active {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 860px) {
  #panel-settings.active {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: start;
  }

  /* Experimental card has multiple toggles, make it span cleanly or fit gracefully */
  #panel-settings .experimental-card {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1400px) {
  #panel-settings.active {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }

  #panel-settings .experimental-card {
    grid-column: span 2;
  }
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.settings-card h3 {
  font-size: 1.1rem;
  font-weight: 450;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.settings-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 300;
  margin-bottom: 1rem;
}

.settings-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.favorites-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.favorites-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.favorites-header-card h3 {
  font-size: 1.15rem;
  font-weight: 450;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
}

.favorites-header-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 350;
  margin: 0;
}

.favorites-count {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 450;
}

.downloads-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.downloads-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.downloads-header-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.downloads-header-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.offline-storage-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.offline-storage-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.btn-remove-download {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-remove-download:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}

.bottom-action-dock {
  position: fixed;
  bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  right: 0.75rem;
  z-index: 30;
  transition: bottom 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Unify Discover search result cards to match standard feed/episode cards */
/* Clean Discover View */
.discover-view-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.discover-search-box {
  width: 100%;
  max-width: 85vw;
  margin: 0 auto;
}

.quick-results-container .dir-search-list {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(280px, 1fr)) !important;
  gap: 0.75rem !important;
  width: 100% !important;
  margin-top: 1rem !important;
}
/* Tablet / Medium screens: 3 columns */
@media (max-width: 1200px) {
    .quick-results-container .dir-search-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Mobile / Small screens: 2 columns 
@media (max-width: 768px) {
    .quick-results-container .dir-search-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}*/

.quick-results-container .dir-search-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.85rem !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.85rem 1rem !important;
  box-sizing: border-box !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-results-container .dir-search-card:hover {
  background: var(--bg-card-hover) !important;
  border-color: var(--text-muted) !important;
  transform: translateY(-2px);
}

.quick-results-container .dir-search-art {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  border-radius: var(--radius-sm) !important;
  object-fit: cover !important;
}

.quick-results-container .dir-search-info {
  flex: 1 !important;
  min-width: 0 !important;
}

.quick-results-container .dir-search-title {
  font-size: 0.925rem !important;
  font-weight: 400 !important;
  color: var(--text-primary) !important;
  line-height: 1.35 !important;
  text-transform: none !important; /* Preserves podcast title casing */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quick-results-container .dir-search-artist {
  font-size: 0.76rem !important;
  color: var(--primary) !important;
  font-weight: 500 !important;
  text-transform: none !important;
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discover-opml-footer {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

body.has-active-episode .bottom-action-dock {
  bottom: 110px;
}

body.has-active-episode.has-mini-player .bottom-action-dock {
  bottom: calc(55px + env(safe-area-inset-bottom, 0px)) !important;
}

.bottom-action-dock.dock-hidden {
  display: none !important;
}

.dock-filters {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dock-divider {
  width: 1px;
  height: 20px;
  background: var(--border-light);
  margin: 0 0.25rem;
}

.bottom-action-dock .chip-filter {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.bottom-action-dock .chip-filter:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.bottom-action-dock .chip-filter.active {
  background: rgba(0, 0, 0, 0.08);
  border-color: transparent;
  font-weight: 600;
}

.bottom-action-dock select {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-radius: 6px;
  border: 1px solid transparent;
  outline: none;
  cursor: pointer;
}

.btn-dock-refresh {
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-dock-refresh:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: transparent !important;
  border-top: none !important;
  box-shadow: none !important;
  padding: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateY(105%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  overflow: visible;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.player-main-controls-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) auto minmax(220px, 1.25fr);
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 2rem;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-glass);
  border-top: none;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .player-main-controls-row {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.85rem calc(0.5rem + env(safe-area-inset-bottom, 0px)) 0.85rem;
    gap: 0.5rem;
    background: var(--bg-glass);
  }

  .search-discover-preview {
    position: fixed;
    top: 56px;
    left: 10px;
    right: 10px;
    width: auto;
  }

  .discover-preview-item {
    flex: 0 0 200px;
    max-width: 200px;
  }
}

.player-bar.active-episode {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

body.has-active-episode.has-mini-player .player-bar {
  transform: translateY(105%);
  opacity: 0;
  pointer-events: none;
}

/* Compact Mini Player - Solid White in Light Mode, Solid Dark in Dark Mode */
.player-mini {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--bg-glass);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(105%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

[data-theme="dark"] .player-mini {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .player-mini {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  }
}

body.has-active-episode.has-mini-player .player-mini {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mini-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  pointer-events: auto !important; /* Enable clicks/touch */
  z-index: 10;
}

.mini-progress-fill {
  width: 0%;
  height: 100%;
/*  background: var(--primary);*/
  background: var(--accent-orange, #f97316);
  transition: width 0.2s linear;
  pointer-events: none;
}

.mini-track-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  user-select: none;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.mini-track-info:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mini-artwork {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: #1f2937;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mini-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.mini-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.mini-podcast {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.mini-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.mini-play-btn,
.mini-toggle-btn,
.mini-queue-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.mini-queue-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-orange);
  pointer-events: none;
}

.mini-queue-dot.hidden {
  display: none !important;
}

.mini-play-btn:hover,
.mini-toggle-btn:hover,
.mini-queue-btn:hover,
#btn-collapse-player:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary);
}

.player-track-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

#player-artwork {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #1f2937;
  flex-shrink: 0;
}

.track-text {
  min-width: 0;
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.track-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.15s ease;
  line-height: 1.25;
}

.track-title:hover {
  color: var(--accent-orange);
  text-decoration: underline;
}

.track-podcast {
  font-size: 0.76rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.15s ease;
  display: inline-block;
  max-width: 100%;
  line-height: 1.25;
}

.track-podcast:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.player-center-controls {
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border-radius: var(--radius-full);
  transition: color 0.2s;
}

.btn-icon:hover {
  color: var(--text-primary);
}

.btn-subtext {
  position: absolute;
  font-size: 0.6rem;
  font-weight: 700;
}

.btn-play-pause {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--text-primary);
  color: var(--bg-dark);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

[data-theme="light"] .player-main-controls-row .track-title,
:root:not([data-theme="dark"]) .player-main-controls-row .track-title {
  color: #111827 !important;
}

[data-theme="light"] .player-main-controls-row .track-podcast,
:root:not([data-theme="dark"]) .player-main-controls-row .track-podcast {
  color: #4b5563 !important;
}

[data-theme="light"] .player-main-controls-row .btn-icon,
:root:not([data-theme="dark"]) .player-main-controls-row .btn-icon {
  color: #374151 !important;
}

[data-theme="light"] .player-main-controls-row .btn-icon:hover,
:root:not([data-theme="dark"]) .player-main-controls-row .btn-icon:hover {
  color: #111827 !important;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .player-main-controls-row .btn-play-pause,
:root:not([data-theme="dark"]) .player-main-controls-row .btn-play-pause {
  background: #111827 !important;
  color: #ffffff !important;
}

[data-theme="light"] .player-main-controls-row .btn-pill,
:root:not([data-theme="dark"]) .player-main-controls-row .btn-pill {
  background: rgba(0, 0, 0, 0.06) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #111827 !important;
}

[data-theme="dark"] .player-main-controls-row .track-title {
  color: #f4f4f5 !important;
}

[data-theme="dark"] .player-main-controls-row .track-podcast {
  color: #a1a1aa !important;
}

[data-theme="dark"] .player-main-controls-row .btn-icon {
  color: #d4d4d8 !important;
}

[data-theme="dark"] .player-main-controls-row .btn-icon:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .player-main-controls-row .btn-play-pause {
  background: #ffffff !important;
  color: #111827 !important;
}

[data-theme="dark"] .player-main-controls-row .btn-pill {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f4f4f5 !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .player-main-controls-row .track-title {
    color: #f4f4f5 !important;
  }
  :root:not([data-theme="light"]) .player-main-controls-row .track-podcast {
    color: #a1a1aa !important;
  }
  :root:not([data-theme="light"]) .player-main-controls-row .btn-icon {
    color: #d4d4d8 !important;
  }
  :root:not([data-theme="light"]) .player-main-controls-row .btn-icon:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08);
  }
  :root:not([data-theme="light"]) .player-main-controls-row .btn-play-pause {
    background: #ffffff !important;
    color: #111827 !important;
  }
  :root:not([data-theme="light"]) .player-main-controls-row .btn-pill {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #f4f4f5 !important;
  }
}

.btn-play-pause:hover {
  transform: scale(1.06);
}

.time-scrubber {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  max-width: 580px;
}

.time-scrubber-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.time-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 36px;
}

#seek-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: linear-gradient(to right, var(--accent-orange) var(--seek-pct, 0%), rgba(255, 255, 255, 0.15) var(--seek-pct, 0%));
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  transition: height 0.15s ease;
}

#seek-bar:hover {
  height: 8px;
}

[data-theme="light"] #seek-bar,
:root:not([data-theme="dark"]) #seek-bar {
  background: linear-gradient(to right, var(--accent-orange) var(--seek-pct, 0%), rgba(0, 0, 0, 0.12) var(--seek-pct, 0%));
}

#seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-orange);
  cursor: pointer;
}

.player-right-options {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.btn-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

#queue-badge {
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #141414;
  background: var(--accent);
  top: -4px;
  right: -4px;
}

#sleep-badge {
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-fg, #141414);
  background: var(--primary);
  top: -4px;
  right: -4px;
  width: auto;
}

/* Modals */
@keyframes modalOverlayFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: modalOverlayFade 0.18s ease-out;
}

[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.38);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .modal-overlay {
    background: rgba(15, 23, 42, 0.38);
  }
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

/* 90% Wider Modals for Discovery & Feed Browsing */
.modal-card-wide,
.add-modal-card {
  width: 90% !important;
  max-width: 1060px !important;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.add-modal-card .modal-body {
  overflow-y: auto;
  flex: 1;
}



/* Dedicated Auth / Sync Modal Styling */
/* Dedicated Auth / Sync Modal Styling */
.auth-modal-card {
  max-width: 430px;
  padding: 1.75rem 2rem;
  border-radius: 20px;
  background: #252321;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05);
  text-align: left;
}

[data-theme="light"] .auth-modal-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .auth-modal-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
  }
}

.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 0.25rem;
}

.auth-icon-badge {
  display: none !important;
}

.auth-btn-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-btn-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

[data-theme="light"] .auth-btn-close:hover {
  background: rgba(0, 0, 0, 0.06);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .auth-btn-close:hover {
    background: rgba(0, 0, 0, 0.06);
  }
}

.auth-modal-intro {
  margin-bottom: 1.25rem;
}

.auth-modal-title {
  font-size: 1.35rem;
  font-weight: 550;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0 0 0.4rem 0;
}

.auth-modal-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.auth-feature-pills {
  display: none;
}

.auth-pill {
  display: none;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.auth-input-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.15s ease;
}

.auth-input-wrapper input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

[data-theme="light"] .auth-input-wrapper input {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.12);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .auth-input-wrapper input {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.12);
  }
}

.auth-input-wrapper input:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

[data-theme="light"] .auth-input-wrapper input:focus {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(46, 42, 37, 0.1);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .auth-input-wrapper input:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(46, 42, 37, 0.1);
  }
}

.auth-input-wrapper:focus-within .auth-input-icon {
  color: var(--text-primary);
}

.auth-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
}

.btn-auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 46px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.btn-auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-auth-cancel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  text-align: center;
  width: 100%;
}

.btn-auth-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

[data-theme="light"] .btn-auth-cancel {
  background: #f4f4f5;
  border-color: rgba(0, 0, 0, 0.08);
  color: #18181b;
}

[data-theme="light"] .btn-auth-cancel:hover {
  background: #e4e4e7;
}

.auth-privacy-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.modal-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.2rem 0;
  margin-bottom: 0.85rem;
}

.category-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 450;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  white-space: nowrap;
}

[data-theme="light"] .category-chip,
:root:not([data-theme="dark"]) .category-chip {
  background: rgba(0, 0, 0, 0.03);
  color: #3f3f46;
  border-color: rgba(0, 0, 0, 0.08);
}

.category-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

[data-theme="light"] .category-chip:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

.category-chip.active {
  background: var(--text-primary);
  color: var(--bg-dark);
  border-color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .category-chip.active,
:root:not([data-theme="dark"]) .category-chip.active {
  background: #18181b;
  color: #ffffff;
  border-color: #18181b;
}

.subgenre-chips-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  max-height: 105px;
  overflow-y: auto;
  margin: 0.2rem 0 0.8rem 0;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-light);
  scrollbar-width: thin;
  animation: fadeIn 0.2s ease-out;
}

[data-theme="light"] .subgenre-chips-container,
:root:not([data-theme="dark"]) .subgenre-chips-container {
  background: #f4f4f5;
  border-color: rgba(0, 0, 0, 0.1);
}

.subgenre-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-orange, #ea580c);
  text-transform: none;
  margin-right: 0.25rem;
}

.subgenre-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.22rem 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

[data-theme="light"] .subgenre-chip,
:root:not([data-theme="dark"]) .subgenre-chip {
  background: #ffffff;
  color: #18181b;
  border-color: rgba(0, 0, 0, 0.15);
}

.subgenre-chip:hover {
  background: rgba(249, 115, 22, 0.15);
  border-color: var(--accent-orange, #ea580c);
  color: var(--accent-orange, #ea580c);
  transform: translateY(-1px);
}

.subgenre-chip.active {
  background: var(--accent-orange, #ea580c) !important;
  color: #ffffff !important;
  border-color: var(--accent-orange, #ea580c) !important;
  font-weight: 600;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 450;
  letter-spacing: -0.01em;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-body input[type="url"] {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  width: 100%;
  outline: none;
}

.help-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.timer-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.timer-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.timer-btn.active {
  background: var(--primary);
  color: var(--primary-fg, #141414);
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 0 16px var(--primary-glow);
}

.timer-btn.active:hover {
  background: var(--primary-hover);
  color: var(--primary-fg, #141414);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

.timer-btn.timer-cancel {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.04);
}

.timer-btn.timer-cancel:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
  transform: translateY(-1px);
}

.timer-btn.timer-cancel.is-inactive {
  opacity: 0.45;
  cursor: default;
  border-color: var(--border-light);
  color: var(--text-muted);
  background: transparent;
  transform: none;
}

.fade-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 480px) {
  .timer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .timer-btn {
    font-size: 0.82rem;
    padding: 0.65rem 0.4rem;
  }
}

.hidden {
  display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .app-header {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.3rem 0.3rem !important;
    padding: 0.60rem !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
  }

  .logo-area {
    order: 1 !important;
  }

  .header-actions {
    order: 2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
  }

  /* Nav tabs always sit cleanly on row 2, never overlapping or hidden */
  .nav-tabs {
    order: 3 !important;
    width: 100% !important;
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 0.15rem !important;
  }
  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .header-search {
    position: relative;
    display: inline-flex;
  }

  .header-search .search-bar:focus-within,
  .header-search .search-bar.has-text,
  .header-search .search-bar.is-expanded {
    position: fixed; /* Fixes it relative to the screen viewport */
    top: 12px;
    left: 12px;
    right: 12px;
    width: auto !important;
    z-index: 9999;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-focus) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
    box-sizing: border-box;
  }

  .logo-area {
    grid-area: logo;
    min-width: 0;
  }

  .header-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    max-width: 100%;
  }

  .user-status-pill {
    max-width: none;
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
  }

  .user-status-pill.is-expanded {
    max-width: 220px;
    padding: 0.35rem 0.65rem;
  }

  #user-email-label {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }

  .header-search {
    grid-area: search;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .header-search .search-bar {
    width: 36px;
    box-sizing: border-box;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease;
  }

  .header-search .search-bar:focus-within,
  .header-search .search-bar.has-text,
  .header-search .search-bar.is-expanded {
    width: 100%;
  }

  .nav-tabs {
    grid-area: nav;
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
    gap: 0.2rem;
  }

  .nav-tab {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 0.2rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .btn-header-add {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .app-container {
    padding-bottom: 70px;
  }

  body.has-active-episode .app-container {
    padding-bottom: 170px;
  }

  .main-content {
    padding: 0 0.5rem 1rem 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .episode-list,
  .shelf-grid,
  .feeds-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
  }

  .episode-card {
    padding: 0.6rem 0.65rem;
    gap: 0.45rem;
  }

  /* On mobile: hide progress scrub bar in all lists unless this is the currently active/playing episode */
  .episode-card .ep-progress-track {
    display: none;
  }

  .episode-card.playing .ep-progress-track {
    display: block;
  }

  .episode-card-top {
    gap: 0.45rem;
  }

  .episode-artwork {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
  }

  .episode-podcast-name {
    font-size: 0.65rem;
    margin-bottom: 0.1rem;
  }

  .episode-title {
    font-size: 0.8rem;
    line-height: 1.25;
  }

  .episode-desc {
    font-size: 0.7rem;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .episode-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  .episode-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 0.65rem;
    gap: 0.2rem;
  }

  .episode-meta .date-line {
    font-size: 0.65rem;
    white-space: nowrap;
  }

  .episode-meta .time-line {
    font-size: 0.65rem;
    white-space: nowrap;
  }

  .episode-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;
    width: 100%;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .btn-play-ep,
  .btn-mark-played,
  .btn-queue-ep,
  .btn-download-ep,
  .btn-fav-ep,
  .btn-share-ep {
    width: 25px;
    height: 25px;
    flex-shrink: 0;
  }

  .btn-play-ep svg,
  .btn-mark-played svg,
  .btn-queue-ep svg,
  .btn-download-ep svg,
  .btn-fav-ep svg,
  .btn-share-ep svg {
    width: 11px;
    height: 11px;
  }

  .feed-card {
    padding: 0.65rem;
    gap: 0.45rem;
  }

  .feed-art {
    width: 36px;
    height: 36px;
  }

  .feed-info h4 {
    font-size: 0.8rem;
    line-height: 1.25;
  }

  .feed-info p {
    font-size: 0.68rem;
  }

  .bottom-action-dock {
    bottom: calc(1px + env(safe-area-inset-bottom, 0px));
    right: 0;
    left: 0;
    z-index: 110;
    width: 100vw;
    border-radius: 0;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.35rem 0.5rem;
    gap: 0.35rem;
    box-sizing: border-box;
  }
  body.has-active-episode .bottom-action-dock {
    bottom: 135px;
  }

  .bottom-action-dock::-webkit-scrollbar {
    display: none;
  }

  .dock-filters {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
  }

  body.has-active-episode:not(.has-mini-player) .bottom-action-dock {
    bottom: calc(175px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 120;
  }

  body.has-active-episode.has-mini-player .bottom-action-dock {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    z-index: 120;
  }

  .bottom-action-dock .chip-filter {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .bottom-action-dock select {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
    flex-shrink: 0;
  }

  .btn-dock-refresh {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    flex-shrink: 0;
  }

  .player-mini {
    height: 55px;
    padding: 0 0.8rem;
    gap: 0.5rem;
  }

  .mini-artwork {
    width: 34px;
    height: 34px;
  }

  .mini-title {
    font-size: 0.8rem;
  }

  .mini-podcast {
    font-size: 0.7rem;
  }

  .player-bar {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    gap: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    transform: translateY(105%);
    opacity: 0;
    pointer-events: none;
    background: transparent !important;
    border-top: none !important;
    box-shadow: none !important;
  }

  .player-bar.active-episode {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .player-track-info {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    overflow: visible;
  }

  #player-artwork {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    margin: 0 !important;
  }

  .track-text {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .track-title {
    font-size: 0.88rem;
    font-weight: 600;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
    color: var(--text-primary);
  }

  .track-podcast {
    font-size: 0.74rem;
    color: var(--text-secondary);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
  }

  .timeline-legend {
    flex-shrink: 0;
    margin-left: auto;
    display: inline-flex !important;
    align-items: center;
    gap: 0.25rem;
    z-index: 5;
    pointer-events: auto;
  }

  .timeline-legend.hidden {
    display: none !important;
  }

  .timeline-legend .legend-btn {
    padding: 0.2rem 0.42rem;
    font-size: 0.68rem;
    line-height: 1;
    white-space: nowrap;
    border-radius: 999px;
  }

  @media (max-width: 380px) {
    .track-text {
      max-width: calc(100% - 130px);
    }
    .timeline-legend .legend-btn {
      padding: 0.16rem 0.32rem;
      font-size: 0.62rem;
    }
  }

  .player-center-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }

  .player-center-controls .control-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    width: 100%;
  }

  .time-scrubber {
    width: 100%;
    max-width: 100%;
  }

  .player-right-options {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.25rem;
    gap: 0.25rem;
  }

  /* Mobile empty state & search directory overflow fixes */
  .empty-state {
    padding: 1.5rem 0.85rem;
    margin: 1rem auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .empty-quick-add {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .quick-add-input-wrap {
    padding: 0.25rem 0.35rem 0.25rem 0.5rem;
    gap: 0.35rem;
    box-sizing: border-box;
    width: 100%;
  }

  .quick-add-input-wrap input {
    font-size: 0.82rem;
    min-width: 0;
  }

  .btn-quick-submit {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }

  .dir-search-card {
    padding: 0.5rem;
    gap: 0.4rem;
    box-sizing: border-box;
  }

  .dir-search-art {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    object-fit: cover;
  }

  .dir-search-title {
    font-size: 0.78rem;
  }

  .dir-search-artist {
    font-size: 0.7rem;
  }

  .starter-suggestions-section {
    padding-top: 1rem;
    margin-top: 1rem;
  }

  .starter-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem;
    margin-top: 1rem;
  }

  .starter-suggestion-chip {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }

  .modal-card {
    padding: 1.25rem 1rem;
    width: 95%;
    max-width: 95%;
    margin: 0 auto;
    box-sizing: border-box;
  }

  /* Full-Screen Edge-to-Edge Add Podcast Modal on Mobile */
  #add-modal {
    padding: 0 !important;
    background: var(--bg-primary) !important;
  }

  #add-modal .modal-card,
  #add-modal .add-modal-card {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: var(--bg-primary) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  #add-modal .modal-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  #add-modal .modal-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
  }

  #add-modal .add-modal-scrollable-body {
    flex: 1;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1rem calc(5.2rem + env(safe-area-inset-bottom, 0px)) 1rem !important;
    order: 1;
  }

  #add-modal .modal-scroll-nav {
    order: 2;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px)) 0.75rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    border-bottom: none;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
  }

  #add-modal .modal-scroll-link {
    flex: 1;
    text-align: center;
    padding: 0.45rem 0.35rem;
    font-size: 0.78rem;
    font-weight: 550;
    border-radius: var(--radius-full);
    white-space: nowrap;
  }

  #add-modal .dir-sticky-collapse-bar {
    bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px));
  }

  .auth-modal-card {
    padding: 1.5rem 1.25rem;
    width: 92%;
    max-width: 400px;
    border-radius: 18px;
  }
}

.spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.btn-play-pause .icon-spinner {
  color: var(--bg-dark);
}

.skeleton-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  align-items: center;
}

.skeleton-art {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: var(--border-light);
  flex-shrink: 0;
}

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: var(--border-light);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.timeline-sentinel {
  height: 20px;
  width: 100%;
  margin: 0.5rem 0;
}

.queue-modal-card {
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.queue-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.queue-count-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.queue-modal-body {
  overflow-y: auto;
  max-height: calc(85vh - 120px);
  padding-right: 0.25rem;
}

.queue-now-playing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0;
}

.queue-now-playing-label {
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--accent-orange);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.queue-now-playing-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.queue-item-artwork {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-card-hover);
}

.queue-item-info {
  flex: 1;
  min-width: 0;
}

.queue-item-title {
  font-size: 0.88rem;
  font-weight: 450;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.queue-item-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.queue-now-playing-indicator {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
  padding-right: 0.5rem;
}

.queue-now-playing-indicator span {
  width: 3px;
  background: var(--accent-orange);
  border-radius: 1px;
  animation: soundBar 1s ease-in-out infinite alternate;
}

.queue-now-playing-indicator span:nth-child(1) { height: 60%; animation-delay: 0.1s; }
.queue-now-playing-indicator span:nth-child(2) { height: 100%; animation-delay: 0.3s; }
.queue-now-playing-indicator span:nth-child(3) { height: 40%; animation-delay: 0.2s; }

@keyframes soundBar {
  0% { height: 25%; }
  100% { height: 100%; }
}

.queue-section-header {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.5rem;
}

.auto-queue-row {
  opacity: 0.9;
}

.btn-queue-item-add {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-queue-item-add:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-text-subtle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  transition: color 0.15s ease;
}

.btn-text-subtle:hover {
  color: var(--text-primary);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.queue-item-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  user-select: none;
}

.queue-item-row:hover {
  background: var(--bg-card-hover);
}

.queue-item-row.is-dragging {
  opacity: 0.45;
  border: 1px dashed var(--accent);
}

.queue-item-row.drag-over-above {
  border-top: 2px solid var(--accent);
}

.queue-item-row.drag-over-below {
  border-bottom: 2px solid var(--accent);
}

.queue-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: grab;
  padding: 0.15rem;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.queue-drag-handle:hover {
  color: var(--text-primary);
}

.queue-drag-handle:active {
  cursor: grabbing;
}

.queue-item-index {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.queue-item-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-queue-item-play,
.btn-queue-item-remove {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.btn-queue-item-play:hover {
  background: var(--text-primary);
  color: var(--bg-dark);
  border-color: var(--text-primary);
}

.btn-queue-item-remove:hover {
  background: rgba(224, 90, 43, 0.15);
  color: var(--accent-orange);
  border-color: var(--accent-orange);
}

.queue-empty-box {
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
}

.queue-empty-box p {
  font-size: 0.92rem;
  font-weight: 450;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.queue-empty-box span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

#btn-player-mark-played:hover {
  color: var(--accent-orange);
}

#btn-player-fav:hover {
  color: #ef4444;
}

#btn-player-fav.is-favorited {
  display: none;
}

#btn-player-fav.is-favorited .icon-fav-unfilled {
  display: none !important;
}

#btn-player-fav.is-favorited .icon-fav-filled {
  display: block !important;
}

#btn-player-notes:hover {
  color: var(--accent-orange);
}

.player-track-info {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.4rem;
  margin: 0;
  transition: background 0.15s ease;
}

.player-track-info:hover {
  background: var(--bg-card-hover);
}

.player-track-info:hover .track-title {
  color: var(--accent-orange);
}

.show-notes-modal-card {
  max-height: 90vh;
  width: 92%;
  max-width: 640px;
  min-width: 0;
  box-sizing: border-box;
  overflow-y: auto !important;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 24px;
  background: var(--bg-card, #1c1c1e);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  padding: 1.5rem 1.75rem 2rem 1.75rem;
  scrollbar-width: thin;
}

.btn-apple-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 20;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(120, 120, 128, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  padding: 0;
}

.btn-apple-close:hover {
  background: rgba(120, 120, 128, 0.35);
  transform: scale(1.05);
}

.btn-apple-close:active {
  transform: scale(0.95);
}

.show-notes-modal-card .show-notes-modal-body,
.show-notes-modal-card .modal-body {
  padding: 0px;
  overflow-y: visible !important;
  max-height: none !important;
  flex: none !important;
  padding-top: 0;
}

#show-notes-art,
.show-notes-art {
  display: block;
  margin: 0.5rem auto 1.25rem auto;
  width: 340px;
  height: 340px;
  aspect-ratio: 1 / 1;
  max-width: 80%;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 3. Keep the close button neatly pinned in the top-right corner while scrolling */
.show-notes-modal-card .btn-apple-close,
.show-notes-modal-card .btn-close-notes,
.show-notes-modal-card .btn-close {
  position: sticky;
  top: 0.75rem;          /* Sticks 12px from the top edge during scroll */
  align-self: flex-end;  /* Pushes it all the way to the right side */
  margin-right: -0.25rem;/* Aligns nicely with the padding edge */
  margin-bottom: -32px;  /* Pulls subsequent artwork up so it overlaps nicely */
  z-index: 100;          /* Stays above artwork, titles, and show notes text */
  
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Frosted translucent glass background so text under it remains subtle */
  background: rgba(120, 120, 128, 0.35);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary, #ffffff);
  
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}

.show-notes-modal-card .btn-apple-close:hover,
.show-notes-modal-card .btn-close-notes:hover {
  background: rgba(120, 120, 128, 0.55);
  transform: scale(1.06);
}

.show-notes-modal-card .btn-apple-close:active,
.show-notes-modal-card .btn-close-notes:active {
  transform: scale(0.94);
}

.show-notes-header-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.25rem;
  padding: 0 0.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}

/* Bigger Feed Link Button */
.show-notes-podcast-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: var(--primary, #f97316);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  transition: background 0.15s ease, opacity 0.15s ease;
  margin-bottom: 0.35rem;
}

.show-notes-podcast-link:hover {
  background: rgba(249, 115, 22, 0.1);
  opacity: 0.9;
}

.podcast-link-arrow {
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.show-notes-podcast-link:hover .podcast-link-arrow {
  transform: translateX(2px);
}

.show-notes-modal-card .show-notes-tabs {
  justify-content: center; /* Centers the 'show notes / transcript' tabs */
  margin-top: 1rem;
}
/* Container below metadata */
.show-notes-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0 0.25rem 0;
  width: 100%;
}

/* Apple Podcasts prominent action pill button */
.show-notes-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: var(--primary, #f97316);
  color: #fff;
  border: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1.6rem;
  border-radius: 9999px; /* full rounded pill */
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.show-notes-play-btn:hover {
  background: #ea580c;
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45);
}

.show-notes-play-btn:active {
  transform: scale(0.97);
}

/* Pause state appearance */
.show-notes-play-btn.is-playing {
  background: var(--bg-hover, rgba(255, 255, 255, 0.15));
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.show-notes-play-btn.is-playing:hover {
  background: var(--bg-card);
}

.notes-play-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
/* Mobile Responsiveness */
@media (max-width: 640px) {
  #show-notes-art,
  .show-notes-art {
    width: 240px;
    height: 240px;
    max-width: 75%;
  }

  .show-notes-play-btn {
    font-size: 0.88rem;
    padding: 0.55rem 1.35rem;
  }
  .show-notes-modal-card {
    padding: 1.25rem 1rem 1.5rem 1rem;
    width: 94%;
    max-width: 94%;
  }
  .show-notes-modal-card .show-notes-modal-body,
  .show-notes-modal-card .modal-body {
    padding: 0 5px;
  }
}

.show-notes-podcast-tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-orange);
  text-transform: none;
  letter-spacing: normal;
  display: block;
  margin-bottom: 0.35rem;
}

.show-notes-episode-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0 0 0.5rem 0;
}

.show-notes-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.meta-sep {
  opacity: 0.4;
  font-size: 0.75rem;
}

.show-notes-modal-body {
  overflow-y: auto;
  max-height: calc(85vh - 120px);
  padding-right: 0.35rem;
}

.show-notes-content {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
  word-break: break-word;
}

.show-notes-content p {
  margin-bottom: 0.9rem;
}

.show-notes-content a {
  color: rgba(249, 115, 22, 0.88);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(249, 115, 22, 0.3);
  transition: color 0.15s, text-decoration-color 0.15s;
  word-break: break-all;
}

.show-notes-content a:hover {
  color: var(--accent-orange-hover);
  text-decoration-color: var(--accent-orange);
}

.show-notes-content ul,
.show-notes-content ol {
  margin: 0.6rem 0 1rem 1.25rem;
  padding: 0;
}

.show-notes-content li {
  margin-bottom: 0.35rem;
}

.show-notes-content blockquote {
  border-left: 3px solid var(--border-light);
  padding-left: 0.85rem;
  margin: 0.75rem 0;
  color: var(--text-muted);
  font-style: italic;
}

/* Timecode chips — subtle orange accent */
.note-timestamp {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.48rem;
  border-radius: 5px;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.24);
  color: var(--accent-orange);
  font-size: 0.82rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  cursor: pointer;
  vertical-align: baseline;
  transition: all 0.15s ease;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.note-timestamp:hover {
  background: rgba(249, 115, 22, 0.18);
  color: var(--accent-orange-hover);
  border-color: rgba(249, 115, 22, 0.5);
  transform: translateY(-0.5px);
}

.show-notes-duration {
  color: rgba(249, 115, 22, 0.9);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.episode-desc-link {
  color: var(--accent-orange);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  display: inline-block;
  margin-top: 0.25rem;
  transition: opacity 0.15s;
}

.episode-desc-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────────────────
   FULL-EPISODE WAVEFORM & SPEECH/MUSIC TIMELINE CREST
   Positioned above player bar (over page content, tucked under player top border)
   ───────────────────────────────────────────────────────────────────────── */

.waveform-timeline-wrap {
  display: none;
  position: relative;
  width: 100%;
  height: 28px;
  cursor: pointer;
  user-select: none;
  background: var(--bg-glass);
  border-bottom: none !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
  z-index: 10;
  flex-direction: column;
  justify-content: flex-end;
  touch-action: none;
  pointer-events: auto;
  overflow: visible;
  padding: 0;
  margin: 0 !important;
  box-sizing: border-box;
  transition: opacity 0.25s ease;
}

[data-theme="dark"] .waveform-timeline-wrap {
  background: var(--bg-glass);
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .waveform-timeline-wrap {
    background: var(--bg-glass);
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
}

.player-bar.active-episode .waveform-timeline-wrap {
  display: flex;
}

@media (max-width: 768px) {
  .search-container,
  .search-bar-wrap {
    position: relative;
    width: 100%;
    left: 0;
    right: 0;
    box-sizing: border-box;
    padding: 0 1rem;
  }

  .search-input,
  #search-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 0 auto;
    font-size: 0.95rem;
    height: 40px;
    border-radius: 9999px;
  }

  .waveform-timeline-wrap {
    height: 24px;
    padding: 0;
    margin: 0 !important;
  }
}

.episode-waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto;
  background: transparent !important;
  margin: 0;
  padding: 0;
  vertical-align: bottom;
}

@media (max-width: 768px) {
  .episode-waveform-canvas {
    height: 100%;
  }
}

.waveform-time-row {
  position: absolute;
  top: 31px;
  left: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
  user-select: none;
  z-index: 4;
}

@media (max-width: 768px) {
  .waveform-time-row {
    padding: 0;
    right: 0;
    left: 0;
  }
}

.waveform-time-label {
  pointer-events: auto;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Outfit", system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #4b5563;
  line-height: 1;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

[data-theme="dark"] .waveform-time-label {
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .waveform-time-label {
    color: #a1a1aa;
    background: rgba(255, 255, 255, 0.1);
  }
}

.waveform-time-label.time-remaining {
  cursor: pointer;
}

.waveform-time-label.time-remaining:hover {
  color: var(--text-primary);
}

.waveform-progress-overlay {
  display: none;
}

.waveform-playhead-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 2px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.9), 0 0 3px #fff;
  pointer-events: none;
  transition: left 0.1s linear;
  z-index: 3;
}

.waveform-hover-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.7);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 3;
}

.waveform-timeline-wrap:hover .waveform-hover-cursor {
  opacity: 1;
}

.waveform-tooltip {
  position: absolute;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  padding: 0.25rem 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  z-index: 20;
  color: var(--text-primary);
}

.time-scrubber-bottom,
.time-scrubber-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.timeline-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  flex-shrink: 0;
}

.legend-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.legend-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.legend-btn.is-active-mode {
  background: rgba(249, 115, 22, 0.12);
  border-color: var(--accent-orange);
  color: var(--text-primary);
}

.legend-btn.legend-music.is-active-mode {
  background: rgba(168, 85, 247, 0.12);
  border-color: #a855f7;
  color: var(--text-primary);
}

.legend-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.legend-btn.is-active-mode .legend-dot {
  transform: scale(1.3);
}

.speech-dot {
  background: #f97316;
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.5);
}

.music-dot {
  background: #a855f7;
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.5);
}

.legend-jump-icon {
  font-size: 0.62rem;
  opacity: 0.7;
}

.probe-status-pill {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 0.25rem;
}

/* Scan progress bar — shows inside waveform area while FFT classifier is running */
.scan-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 0 0 4px 4px;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
  display: flex;
  align-items: center;
}
.scan-progress-bar.hidden { display: none; }

.scan-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-orange, #f97316), var(--accent-purple, #a855f7));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.scan-progress-label {
  position: absolute;
  right: 6px;
  bottom: 5px;
  font-size: 0.6rem;
  color: var(--text-muted);
  font-style: italic;
  pointer-events: none;
  white-space: nowrap;
}

.sr-only-range {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ─────────────────────────────────────────────────────────────────────────
   EXPERIMENTAL SETTINGS CARD
   ───────────────────────────────────────────────────────────────────────── */

.experimental-card {
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.experimental-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.experimental-card-header h3 {
  margin: 0;
}

.experimental-badge {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.18);
  color: var(--accent-orange);
  border: 1px solid rgba(249, 115, 22, 0.35);
  line-height: 1.4;
}

.experimental-row {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-light);
}

.experimental-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.experimental-toggle-label div:first-child {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.experimental-toggle-label strong {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.experimental-toggle-label span {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 300;
}

/* Toggle switch pill */
.toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--border-light);
  transition: background 0.2s ease;
  cursor: pointer;
}

.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-track {
  background: var(--accent-orange);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(18px);
}

.toggle-switch input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}

/* Status text below toggles */
.experimental-status {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-height: 1rem;
  transition: opacity 0.3s;
}

.experimental-status.ok {
  color: #4ade80;
}

.experimental-status.warn {
  color: var(--accent-orange);
}

/* ─────────────────────────────────────────────────────────────────────────
   TRANSCRIPT TAB & VIEWER
   ───────────────────────────────────────────────────────────────────────── */

.modal-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
}

.modal-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.modal-tab-btn:hover {
  color: var(--text-primary);
}

.modal-tab-btn.active {
  color: var(--accent-orange);
  border-bottom-color: var(--accent-orange);
  font-weight: 600;
}

.transcript-source-pill {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.show-transcript-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.transcript-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.transcript-search-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
}

.transcript-search-input:focus {
  border-color: var(--accent-orange);
}

.btn-transcript-upload {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-transcript-upload:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.transcript-cues-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  flex: 1;
  min-height: 200px;
  padding-right: 0.5rem;
}

.transcript-cue {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.5;
}

.transcript-cue:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-light);
}

.transcript-cue.is-active {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.35);
}

.transcript-cue-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-orange);
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.45rem;
  height: fit-content;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.transcript-cue-time:hover {
  background: var(--accent-orange);
  color: #fff;
}

.transcript-cue-text {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.transcript-cue-text mark {
  background: rgba(249, 115, 22, 0.3);
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
}

.transcript-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-secondary);
}

.transcript-empty-state h4 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 1.05rem;
}

.transcript-empty-state p {
  font-size: 0.85rem;
  max-width: 420px;
  margin: 0 auto 1.25rem auto;
  line-height: 1.5;
}

.transcript-segment-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1rem;
}

.segment-jump-pill {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.segment-jump-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.segment-jump-pill.is-music {
  color: #a855f7;
  border-color: rgba(168, 85, 247, 0.3);
}

.segment-jump-pill.is-speech {
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.3);
}

/* ── Live Caption Popup ────────────────────────────────────────── */
.live-caption-popup {
  position: fixed;
  bottom: calc(var(--player-bar-height, 110px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  max-width: min(640px, 92vw);
  width: max-content;
  background: rgba(15, 15, 15, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.55rem 2.2rem 0.55rem 1rem;
  z-index: 1100;
  pointer-events: auto;
  animation: caption-fadein 0.25s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,0.45);
}
.live-caption-popup.hidden { display: none; }

@keyframes caption-fadein {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.live-caption-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #fff;
  text-align: center;
  white-space: pre-wrap;
}

.live-caption-close {
  position: absolute;
  top: 4px;
  right: 8px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s;
}
.live-caption-close:hover { color: rgba(255,255,255,0.85); }

/* ── Inline classifier / transcript section inside show notes ──── */
.notes-analysis-section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.notes-analysis-section .analysis-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.9rem;
}

.notes-analysis-section .analysis-header .source-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  background: rgba(249,115,22,0.15);
  color: var(--accent-orange);
  border: 1px solid rgba(249,115,22,0.3);
  text-transform: uppercase;
}

.notes-enable-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 0.75rem 0.5rem 0;
}

.notes-enable-hint a,
.notes-enable-hint button.inline-link {
  color: var(--accent-orange);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
}

/* ── Apple-Style Volume Popover ────────────────────────────────── */
.volume-popover-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.volume-popover-card {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  transform: none;
  background: var(--accent-orange);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 1200;
  white-space: nowrap;
  animation: popover-fadein 0.18s ease-out;
}

@media (max-width: 768px) {
  .volume-popover-card {
    right: auto; /* Clearance on mobile */
  }
}

@keyframes popover-fadein {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.volume-popover-card.hidden {
  display: none !important;
}

.volume-popover-mute-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  transition: color 0.15s ease;
}

.volume-popover-mute-btn:hover {
  color: var(--text-primary);
}

.volume-slider-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.volume-slider-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.volume-slider-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.volume-popover-percent {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── 2026 Storage Permission Banner ────────────────────────────── */
.storage-permission-banner {
  background: rgba(234, 88, 12, 0.12);
  border: 1px solid rgba(234, 88, 12, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin: 1rem 0 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  animation: popover-fadein 0.25s ease;
}

.storage-permission-banner.hidden {
  display: none !important;
}

.storage-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.storage-banner-icon {
  color: #ea580c;
  flex-shrink: 0;
  margin-top: 2px;
}

.storage-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.storage-banner-text strong {
  font-size: 0.95rem;
  color: #ea580c;
}

.storage-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .storage-permission-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  .storage-banner-actions {
    justify-content: flex-end;
  }
}



