/* ==============================================================
 * Script: static/style.css
 * Purpose: Ultra-modern Linear/Apple-inspired styling for yt-dlp Studio Pro batch downloader.
 * Author: Praful Kumar
 * Created On: 15/09/2026
 *
 * Modification History:
 * - 25/10/2026 : Styled single-line footer author links row with non-wrapping flex layout, pipe dividers (|), and responsive touch-friendly link chips.
 * - 25/10/2026 : Resolved mobile touch event blocking: hidden backdrop with display: none when inactive to prevent WebKit full-screen layer occlusion, elevated bottom navigation to z-index 1300, content-topbar to z-index 1250, enforced pointer-events auto and manipulation on touch targets, disabled child pointer events in mobile buttons.
 * - 25/10/2026 : Added rich single-line Author & Contact Information footer card styles with pulsing heart icon and refined link chips.
 * - 25/10/2026 : Major mobile-first responsive overhaul: Off-canvas drawer with smooth cubic-bezier transitions, backdrop blur, fixed bottom navigation bar, touch target scaling (>=44px), 16px input font prevention for iOS zoom, single-column mobile cards, responsive modals, and persistent mini-player repositioning above bottom nav.
 * - 10/10/2026 : Added .library-loading-state and animated .spinner-ring styles for visual feedback during library loading.
 * - 09/10/2026 : Added table-actions-cluster and dedicated Audio Table column constraint rules for responsive alignment and seamless interaction.
 * - 09/10/2026 : Added complete styling suite for persistent Mini-Player bar, slide-out Playback Queue drawer, Audio Library album-art grid, Video Library responsive card grid, Playlists manager & detail hero view, multi-select bulk actions bar, and custom in-app confirmation & playlist modals.
 * - 03/10/2026 : Added interactive column header sorting styles, 2-row Format & Size layout (with batch folder), 2-row Transcript layout (with Video ID), and stacked vertical action buttons (Play / Finder).
 * - 03/10/2026 : Added 3-row Media Library console styles, column filter grid, batch selector, and 3-subrow media details with duration pills.
 * - 03/10/2026 : Optimized media player layout to single-row unified controls with compact speed presets and dedicated second-row shortcuts bar.
 * - 03/10/2026 : Added styling for sidebar author card (Website, Blog, Git Repo) and advanced media player controls (0.05x speed suite, seek buttons, sizing modes, PiP).
 * - 03/10/2026 : Added styling for Anti-Bot Cookies modal, Netscape textarea, status indicator dot, and .btn-cookies-task.
 * - 03/10/2026 : Added styling for .btn-resume-task and .btn-resume-failed with emerald/sky accent highlights.
 * - 02/10/2026 : Added subfolder-tag badge styles for grouped batch folders in Media Library.
 * - 16/09/2026 : Refined table column widths, added format-size-pill, single-line date/time, and horizontal table-actions-group to eliminate awkward wrapping.
 * - 16/09/2026 : Added format-size-combo styling and aligned transcript buttons in media table.
 * - 16/09/2026 : Applied light-blue header and footer styling, colorful action buttons, and video transcript modal.
 * - 16/09/2026 : Complete modern UI/UX overhaul with tabbed view navigation, interactive quality chips, and Linear/macOS design system.
 * - 16/09/2026 : Revamped layout to two-column light-theme with left sidebar and right body.
 * - 15/09/2026 : Initial creation.
 *
 * Reload / Change Triggers:
 * - Reload Triggered 19 : 25/10/2026
 * - Reload Triggered 18 : 25/10/2026
 * - Reload Triggered 17 : 25/10/2026
 * - Reload Triggered 16 : 25/10/2026
 * - Reload Triggered 15 : 09/10/2026
 * - Reload Triggered 14 : 09/10/2026
 * - Reload Triggered 13 : 03/10/2026
 * - Reload Triggered 12 : 03/10/2026
 * - Reload Triggered 11 : 03/10/2026
 * - Reload Triggered 10 : 03/10/2026
 * - Reload Triggered 9 : 03/10/2026
 * - Reload Triggered 8 : 03/10/2026
 * - Reload Triggered 7 : 02/10/2026
 * - Reload Triggered 6 : 16/09/2026
 * - Reload Triggered 5 : 16/09/2026
 * - Reload Triggered 4 : 16/09/2026
 * - Reload Triggered 3 : 16/09/2026
 * - Reload Triggered 2 : 16/09/2026
 * - Reload Triggered 1 : 15/09/2026
 *
 * Notes:
 * - Light-blue themed header and footer in light mode (#e0f2fe / #bae6fd) with rich colored action buttons.
 * - High-contrast dark mode fallback with deep slate/indigo accents.
 * - Tabbed navigation (.tab-panel) with smooth animations and zero layout shifts.
 * ============================================================== */

:root, [data-theme="light"] {
  --font-main: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Theme Tokens: Default Light Mode with Light-Blue Header/Footer */
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-border: #e2e8f0;
  --surface-border-subtle: #edf2f7;
  --surface-hover: #f1f5f9;
  --surface-active: #e2e8f0;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Distinctive Light Blue Header & Footer System */
  --header-bg: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  --header-border: #bae6fd;
  --header-text: #0369a1;
  --footer-bg: #e0f2fe;
  --footer-border: #bae6fd;

  --sidebar-bg: #ffffff;
  --sidebar-border: #e2e8f0;
  --sidebar-hover: #f1f5f9;
  --sidebar-active: #e0f2fe;
  --sidebar-active-text: #0284c7;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-glow: rgba(37, 99, 235, 0.2);

  --success: #059669;
  --success-light: #ecfdf5;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
  --teal: #0d9488;
  --teal-light: #f0fdfa;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 8px 24px -4px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 15px rgba(37, 99, 235, 0.2);

  /* Status Pill Colors (Light) */
  --pill-queued-bg: #ede9fe;
  --pill-queued-text: #6d28d9;
  --pill-extract-bg: #fef3c7;
  --pill-extract-text: #b45309;
  --pill-download-bg: #e0f2fe;
  --pill-download-text: #0369a1;
  --pill-process-bg: #ccfbf1;
  --pill-process-text: #0f766e;
  --pill-done-bg: #dcfce7;
  --pill-done-text: #15803d;
  --pill-fail-bg: #fee2e2;
  --pill-fail-text: #b91c1c;
  --pill-cancel-bg: #f1f5f9;
  --pill-cancel-text: #64748b;
}

[data-theme="dark"] {
  --bg: #090d16;
  --bg-subtle: #0f172a;
  --surface: #111827;
  --surface-subtle: #162036;
  --surface-border: #1e293b;
  --surface-border-subtle: #1e293b80;
  --surface-hover: #1e293b;
  --surface-active: #243254;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --header-bg: linear-gradient(135deg, #0c1a2e 0%, #0f2642 100%);
  --header-border: #1e3a5f;
  --header-text: #38bdf8;
  --footer-bg: #0c1a2e;
  --footer-border: #1e3a5f;

  --sidebar-bg: #0b1120;
  --sidebar-border: #1e293b;
  --sidebar-hover: #172033;
  --sidebar-active: #1d2a4a;
  --sidebar-active-text: #60a5fa;

  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.15);
  --accent-glow: rgba(59, 130, 246, 0.3);

  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --purple: #8b5cf6;
  --purple-light: rgba(139, 92, 246, 0.15);
  --teal: #14b8a6;
  --teal-light: rgba(20, 184, 166, 0.15);

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 10px 30px -4px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.35);

  /* Status Pill Colors (Dark) */
  --pill-queued-bg: rgba(139, 92, 246, 0.18);
  --pill-queued-text: #c4b5fd;
  --pill-extract-bg: rgba(245, 158, 11, 0.18);
  --pill-extract-text: #fcd34d;
  --pill-download-bg: rgba(59, 130, 246, 0.18);
  --pill-download-text: #93c5fd;
  --pill-process-bg: rgba(20, 184, 166, 0.18);
  --pill-process-text: #5eead4;
  --pill-done-bg: rgba(16, 185, 129, 0.18);
  --pill-done-text: #6ee7b7;
  --pill-fail-bg: rgba(239, 68, 68, 0.18);
  --pill-fail-text: #fca5a5;
  --pill-cancel-bg: rgba(148, 163, 184, 0.18);
  --pill-cancel-text: #cbd5e1;
}

/* ============================================================== */
/* RESET & BASE */
/* ============================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  transition: background 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, pre, .font-mono {
  font-family: var(--font-mono);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* ============================================================== */
/* APP LAYOUT */
/* ============================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ============================================================== */
/* 1. LEFT SIDEBAR NAVIGATION */
/* ============================================================== */
.sidebar-column {
  width: 270px;
  min-width: 270px;
  max-width: 270px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.5rem 1.15rem;
  gap: 1.25rem;
  overflow-y: auto;
  z-index: 40;
  user-select: none;
}

/* App Brand Header */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  flex-shrink: 0;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.brand-title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-pill {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #0284c7;
  background: #e0f2fe;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  align-self: flex-start;
  text-transform: uppercase;
}

/* Sidebar Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
  font-weight: 700;
  border-color: #bae6fd;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.12);
}

.nav-svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active .nav-svg {
  opacity: 1;
  stroke: var(--sidebar-active-text);
}

.nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-counter {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: var(--surface-border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  transition: all 0.18s ease;
}

.nav-counter.accent {
  background: #0284c7;
  color: #ffffff;
}

/* Sidebar Engine Status Card */
.sidebar-status-card {
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.status-card-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.status-dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.status-card-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.status-card-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.status-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-mini-row span:last-child,
.status-mini-row code {
  font-weight: 600;
  color: var(--text-primary);
}

.status-mini-row code {
  font-size: 0.72rem;
  background: var(--surface-border);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-xs);
}

/* Sidebar Quick Action Buttons (Vibrant Styles) */
.sidebar-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Sidebar Footer (Light Blue Card Container) */
.sidebar-footer {
  margin-top: auto;
  padding: 1rem 0.85rem;
  background: var(--footer-bg);
  border: 1px solid var(--footer-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.theme-switcher-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  background: #0284c7;
  border: 1px solid #0369a1;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.theme-switcher-btn:hover {
  background: #0369a1;
}

.sidebar-port-tag {
  font-size: 0.72rem;
  color: var(--header-text);
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
}

/* ============================================================== */
/* 2. RIGHT MAIN CONTENT COLUMN */
/* ============================================================== */
.content-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOPBAR HEADER - LIGHT BLUE BACKGROUND */
.content-topbar {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  padding: 1.15rem 2.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.08);
}

.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.topbar-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--header-text);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.topbar-heading {
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.topbar-stats-pills {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--header-border);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .stat-pill {
  background: rgba(17, 24, 39, 0.85);
  border-color: var(--header-border);
}

.stat-pill-label {
  color: var(--text-muted);
  font-weight: 600;
}

.stat-pill-val {
  color: var(--text-primary);
  font-weight: 700;
}

.stat-pill.success .stat-pill-val {
  color: var(--success);
}

/* Content Viewport & Tab Panels */
.content-viewport {
  flex: 1;
  padding: 2rem 2.25rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.tab-panel {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================== */
/* APPLICATION FOOTER & AUTHOR CONTACT CARD (SINGLE-LINE LINKS)   */
/* ============================================================== */
.content-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-border);
  padding: 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.footer-author-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.footer-author-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.footer-author-heading {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: -0.01em;
}

.footer-author-credit {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-author-credit b {
  color: var(--text-primary);
}

.heart-pulse {
  display: inline-block;
  color: #ef4444;
  animation: heartBeat 1.8s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.footer-author-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  max-width: 100%;
}

.footer-author-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

.footer-author-link:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
}

[data-theme="dark"] .footer-author-link:hover {
  background: rgba(2, 132, 199, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
}

.footer-link-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.footer-link-text {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}

[data-theme="dark"] .footer-link-text {
  color: var(--text-primary);
}

.footer-author-link:hover .footer-link-text {
  color: #0284c7;
}

[data-theme="dark"] .footer-author-link:hover .footer-link-text {
  color: #38bdf8;
}

.footer-author-pipe {
  color: var(--surface-border);
  font-size: 0.82rem;
  font-weight: 400;
  user-select: none;
  opacity: 0.7;
  margin: 0 0.1rem;
}

.footer-bottom-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-pill-brand {
  font-weight: 800;
  color: #ffffff;
  background: #0284c7;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}

.footer-caption {
  color: var(--text-muted);
  font-weight: 500;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
}

.footer-separator {
  color: var(--footer-border);
}

.footer-stat b {
  color: var(--text-primary);
}

/* ============================================================== */
/* PRO CARDS & COMMON ELEMENTS */
/* ============================================================== */
.pro-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pro-card:hover {
  border-color: rgba(2, 132, 199, 0.35);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--surface-border);
}

.card-heading-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.heading-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.heading-icon-badge.accent {
  background: #e0f2fe;
  color: #0284c7;
}

.heading-icon-badge.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.heading-icon-badge.success {
  background: var(--success-light);
  color: var(--success);
}

.heading-icon-badge.purple {
  background: var(--purple-light);
  color: var(--purple);
}

.pro-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.pro-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ============================================================== */
/* TAB 1: STUDIO GRID */
/* ============================================================== */
.studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.75rem;
  align-items: start;
}

.url-counter-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-family: var(--font-mono);
}

.drop-zone-container {
  position: relative;
  width: 100%;
}

.pro-textarea {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.6;
  resize: vertical;
  min-height: 185px;
  transition: all 0.2s ease;
  outline: none;
}

.pro-textarea:focus {
  background: var(--surface);
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.drop-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(2, 132, 199, 0.9);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  z-index: 10;
}

.drop-zone-container.drag-over .drop-overlay {
  display: flex;
}

.drop-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.drop-upload-icon {
  font-size: 2rem;
}

/* Ingestion Action Bar */
.input-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-top: 1rem;
}

.actions-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Supported Platform Chips */
.supported-platforms-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-border);
}

.support-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-right: 0.25rem;
}

.platform-chip {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

/* Output Configuration Stack */
.options-body-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Segmented Mode Switcher (Video vs Audio) */
.segmented-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 0.3rem;
  gap: 0.35rem;
}

.segmented-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0369a1;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.segmented-btn:hover {
  color: #0c4a6e;
}

.segmented-btn.active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.18);
}

[data-theme="dark"] .segmented-mode-switch {
  background: #0f172a;
  border-color: #1e293b;
}

[data-theme="dark"] .segmented-btn.active {
  background: #1e293b;
  color: #38bdf8;
}

/* Select Form Fields */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-group.hidden {
  display: none;
}

.option-field-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-caption {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.custom-select-wrap {
  position: relative;
  width: 100%;
}

.pro-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.pro-select:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
  background: var(--surface);
}

.custom-select-wrap::after {
  content: "▾";
  position: absolute;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.85rem;
}

/* Modern Switches */
.switches-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
}

[data-theme="dark"] .switches-grid {
  background: var(--bg-subtle);
  border-color: var(--surface-border);
}

.modern-switch-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.modern-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.modern-switch-slider {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background-color: #cbd5e1;
  border-radius: 9999px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.modern-switch-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.modern-switch-input:checked + .modern-switch-slider {
  background-color: #0284c7;
}

.modern-switch-input:checked + .modern-switch-slider::before {
  transform: translateX(16px);
}

.switch-caption {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Destination Pill Box */
.destination-pill-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
}

[data-theme="dark"] .destination-pill-box {
  background: var(--bg-subtle);
  border-color: var(--surface-border);
}

.destination-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.dest-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0369a1;
}

.dest-path {
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CTA Download Button */
.btn-primary-gradient {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.95rem 1.5rem;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.btn-primary-gradient:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  box-shadow: 0 6px 22px rgba(2, 132, 199, 0.5);
  transform: translateY(-1px);
}

/* ============================================================== */
/* TAB 2: ACTIVE QUEUE */
/* ============================================================== */
.queue-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.queue-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  gap: 0.85rem;
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0284c7;
  margin-bottom: 0.5rem;
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.5;
}

/* Task Item Card */
.task-item {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card);
}

.task-item:hover {
  border-color: #bae6fd;
  box-shadow: var(--shadow-hover);
}

.task-thumb {
  width: 120px;
  height: 68px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #0f172a;
  border: 1px solid var(--surface-border);
  flex-shrink: 0;
}

.task-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.task-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.task-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-badges {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.status-pill {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
}

.status-pill.queued { background: var(--pill-queued-bg); color: var(--pill-queued-text); }
.status-pill.extracting_info { background: var(--pill-extract-bg); color: var(--pill-extract-text); }
.status-pill.downloading { background: var(--pill-download-bg); color: var(--pill-download-text); }
.status-pill.processing { background: var(--pill-process-bg); color: var(--pill-process-text); }
.status-pill.completed { background: var(--pill-done-bg); color: var(--pill-done-text); }
.status-pill.failed { background: var(--pill-fail-bg); color: var(--pill-fail-text); }
.status-pill.cancelled { background: var(--pill-cancel-bg); color: var(--pill-cancel-text); }

.task-progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--surface-border);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.task-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 9999px;
  transition: width 0.25s ease;
}

.task-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

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

.btn-resume-task {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  font-weight: 700;
}

.btn-resume-task:hover {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

.btn-resume-failed {
  color: #0284c7;
  border-color: rgba(2, 132, 199, 0.3);
}

.btn-resume-failed:hover {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #0284c7;
}

/* ============================================================== */
/* TAB 3: DOWNLOADED MEDIA LIBRARY */
/* ============================================================== */
.library-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
}

.pro-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.pro-table th {
  background: #f0f9ff;
  color: #0369a1;
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid #bae6fd;
  white-space: nowrap;
}

[data-theme="dark"] .pro-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-bottom-color: var(--surface-border);
}

.pro-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.pro-table tbody tr {
  transition: background 0.15s ease;
}

.pro-table tbody tr:hover {
  background: #f8fafc;
}

[data-theme="dark"] .pro-table tbody tr:hover {
  background: var(--surface-hover);
}

.pro-table tbody tr:last-child td {
  border-bottom: none;
}

/* Specific Library Table Column Constraints */
.library-table .library-col-media {
  min-width: 280px;
  max-width: 520px;
}

.library-table .library-col-transcript {
  width: 140px;
  min-width: 140px;
  white-space: nowrap;
  text-align: center;
}

.library-table .library-col-format-size {
  width: 220px;
  min-width: 220px;
  white-space: nowrap;
}

.library-table .library-col-downloaded {
  width: 150px;
  min-width: 150px;
  white-space: nowrap;
}

.library-table .library-col-actions {
  width: 120px;
  min-width: 120px;
  white-space: nowrap;
  text-align: center;
}

/* Dedicated Audio Table Column Constraints */
.audio-table .col-chk {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  text-align: center;
}

.audio-table .col-num {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  text-align: center;
  color: var(--text-muted);
}

.audio-table .col-track-info {
  min-width: 260px;
  max-width: 480px;
}

.audio-table .col-album {
  min-width: 130px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-table .col-duration {
  width: 90px;
  min-width: 90px;
  text-align: center;
}

.audio-table .col-format {
  width: 90px;
  min-width: 90px;
  text-align: center;
}

.audio-table .col-size {
  width: 90px;
  min-width: 90px;
  text-align: center;
}

.audio-table .col-actions {
  width: 150px;
  min-width: 150px;
  text-align: center;
  white-space: nowrap;
}

.audio-table-row {
  transition: background 0.15s ease;
}

.audio-table-row:hover {
  background: var(--surface-hover);
}

/* Table Actions Cluster */
.table-actions-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.table-actions-cluster .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
  line-height: 1.2;
}

/* Media Title Cell */
.media-title-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}

.media-file-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.media-file-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.media-file-name {
  word-break: break-word;
}

.subfolder-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.25);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
}

/* Format & Size Pill */
.format-size-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.65rem;
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.ext-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  background: #e0f2fe;
  color: #0369a1;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

[data-theme="dark"] .ext-badge {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
}

.size-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Downloaded At Single-Line Cell */
.downloaded-at-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.downloaded-at-cell .date-part {
  font-weight: 600;
}

.downloaded-at-cell .time-part {
  color: var(--text-muted);
  font-size: 0.76rem;
}

/* Horizontal Actions Group */
.table-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  white-space: nowrap;
}

/* ============================================================== */
/* TAB 4: SYSTEM & STORAGE DIAGNOSTICS */
/* ============================================================== */
.diagnostics-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.diag-stat-card {
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color 0.2s ease;
}

.diag-stat-card:hover {
  border-color: #0284c7;
}

.diag-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.diag-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.diag-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
}

.diag-pill.green {
  background: var(--success-light);
  color: var(--success);
}

.diag-pill.blue {
  background: #e0f2fe;
  color: #0369a1;
}

.diag-main-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.diag-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ============================================================== */
/* COLORFUL, PURPOSEFUL ACTION BUTTONS */
/* ============================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
}

.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
}

/* 1. PLAY BUTTON: Vibrant Emerald Green */
.btn-play-media {
  background: #059669 !important;
  color: #ffffff !important;
  border: 1px solid #047857 !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-play-media:hover {
  background: #047857 !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
  transform: translateY(-1px);
}

/* 2. TRANSCRIPT BUTTON: Vibrant Purple */
.btn-transcript-file,
.btn-copy-transcript {
  background: #7c3aed !important;
  color: #ffffff !important;
  border: 1px solid #6d28d9 !important;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.btn-transcript-file:hover,
.btn-copy-transcript:hover {
  background: #6d28d9 !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

/* 3. FINDER BUTTON: Royal Indigo */
.btn-finder-file,
.btn-finder-task,
#sidebar-btn-finder,
#btn-open-library-folder,
#btn-open-target-folder {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border: 1px solid #4338ca !important;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.btn-finder-file:hover,
.btn-finder-task:hover,
#sidebar-btn-finder:hover,
#btn-open-library-folder:hover,
#btn-open-target-folder:hover {
  background: #4338ca !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  transform: translateY(-1px);
}

/* 4. REFRESH BUTTON: Cyan/Sky Blue */
#btn-refresh-library {
  background: #0284c7 !important;
  color: #ffffff !important;
  border: 1px solid #0369a1 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

#btn-refresh-library:hover {
  background: #0369a1 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
  transform: translateY(-1px);
}

/* 5. PASTE CLIPBOARD: Sky Blue */
#btn-paste {
  background: #0284c7 !important;
  color: #ffffff !important;
  border: 1px solid #0369a1 !important;
}

#btn-paste:hover {
  background: #0369a1 !important;
  box-shadow: 0 3px 10px rgba(2, 132, 199, 0.35);
}

/* 6. SAMPLE LINKS: Amber / Gold */
#btn-sample {
  background: #d97706 !important;
  color: #ffffff !important;
  border: 1px solid #b45309 !important;
}

#btn-sample:hover {
  background: #b45309 !important;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.35);
}

/* 7. IMPORT .TXT: Teal */
.file-btn-label {
  background: #0d9488 !important;
  color: #ffffff !important;
  border: 1px solid #0f766e !important;
  cursor: pointer;
}

.file-btn-label:hover {
  background: #0f766e !important;
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.35);
}

/* 8. CLEAR COMPLETED / CLEAR ALL: Warm Coral / Rose Red */
#btn-clear-completed,
#btn-clear-urls,
#sidebar-btn-clear,
.btn-ghost-danger {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}

#btn-clear-completed:hover,
#btn-clear-urls:hover,
#sidebar-btn-clear:hover,
.btn-ghost-danger:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
}

/* 9. CANCEL & REMOVE BUTTONS IN QUEUE */
.btn-cancel-task {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}

.btn-cancel-task:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}

.btn-remove-task {
  background: var(--bg-subtle) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--surface-border) !important;
}

.btn-remove-task:hover {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}

/* 10. DOWNLOAD TRANSCRIPT BUTTON IN MODAL */
.btn-download-transcript {
  background: #059669 !important;
  color: #ffffff !important;
  border: 1px solid #047857 !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-download-transcript:hover {
  background: #047857 !important;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

/* Badges */
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

.badge-accent {
  background: #0284c7;
  color: #ffffff;
  border-color: #0369a1;
}

/* ============================================================== */
/* MODAL & TRANSCRIPT VIEWER */
/* ============================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
  transition: opacity 0.2s ease;
}

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

.modal-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.modal-title-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.modal-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0284c7;
}

.modal-badge.purple {
  color: #7c3aed;
}

.modal-header h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--header-border);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-close-modal:hover {
  background: #fee2e2;
  color: #dc2626;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}

.modal-body video,
.modal-body audio {
  width: 100%;
  max-height: 480px;
  border-radius: var(--radius-sm);
  outline: none;
}

/* TRANSCRIPT MODAL SPECIFIC */
.transcript-modal-card {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.transcript-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: #f0f9ff;
  border-bottom: 1px solid #bae6fd;
}

[data-theme="dark"] .transcript-action-bar {
  background: var(--bg-subtle);
  border-bottom-color: var(--surface-border);
}

.transcript-meta-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.transcript-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.transcript-body-container {
  padding: 1.5rem;
  overflow-y: auto;
  background: var(--surface);
  max-height: 60vh;
}

.transcript-text {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============================================================== */
/* TOAST NOTIFICATIONS */
/* ============================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 110;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  font-size: 0.85rem;
  font-weight: 700;
  animation: slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Utilities */
.hidden { display: none !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-right { text-align: right !important; }

/* ============================================================== */
/* ANTI-BOT COOKIES MODAL & ACTIONS */
/* ============================================================== */
.clickable-pill {
  cursor: pointer;
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  color: #b45309 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.clickable-pill:hover {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18);
}

.cookies-modal-card {
  max-width: 680px;
}

.cookies-modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--surface);
  align-items: stretch;
}

.cookies-intro-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  font-size: 0.84rem;
  color: #166534;
  line-height: 1.55;
}

[data-theme="dark"] .cookies-intro-box {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
}

.cookies-status-display {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.8rem;
  color: var(--text-primary);
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  flex-shrink: 0;
}

.status-indicator-dot.active {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-indicator-dot.warning {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.cookies-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cookies-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cookies-textarea {
  width: 100%;
  min-height: 160px;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: all 0.2s ease;
}

.cookies-textarea:focus {
  border-color: #0284c7;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.cookies-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.btn-cookies-task {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
  font-weight: 700 !important;
}

.btn-cookies-task:hover {
  background: #f59e0b !important;
  color: #ffffff !important;
  border-color: #d97706 !important;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

/* ============================================================== */
/* AUTHOR PROFILE SECTION (SIDEBAR)                               */
/* ============================================================== */
.sidebar-author-card {
  margin-top: 1rem;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

[data-theme="dark"] .sidebar-author-card {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.author-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.author-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
  color: #ffffff;
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
  flex-shrink: 0;
}

.author-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.author-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.author-role {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.author-links-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.author-link-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.65rem;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
}

.author-link-pill span {
  flex: 1;
  margin-left: 0.45rem;
}

.author-link-pill .link-arrow {
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: transform 0.15s ease, color 0.15s ease;
}

.author-link-pill:hover {
  background: var(--surface-hover);
  border-color: #0284c7;
  color: #0284c7;
  transform: translateX(2px);
}

.author-link-pill:hover .link-arrow {
  color: #0284c7;
  transform: translate(1px, -1px);
}

[data-theme="dark"] .author-link-pill {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

[data-theme="dark"] .author-link-pill:hover {
  background: #253349;
  border-color: #38bdf8;
  color: #38bdf8;
}

/* ============================================================== */
/* ADVANCED IN-BROWSER MEDIA PLAYER MODAL & CONTROLS              */
/* ============================================================== */
.media-player-modal-card {
  width: 92vw;
  max-width: 860px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--surface-border);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s ease;
}

.media-player-modal-card.size-standard {
  max-width: 860px;
}

.media-player-modal-card.size-wide {
  max-width: 1180px;
}

.media-player-modal-card.size-full {
  max-width: 96vw;
  height: 94vh;
  max-height: 94vh;
}

.media-player-modal-header {
  padding: 0.9rem 1.25rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.media-modal-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 480px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.player-window-sizes {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--header-border);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

[data-theme="dark"] .player-window-sizes {
  background: rgba(15, 23, 42, 0.6);
  border-color: #334155;
}

.btn-player-size {
  border: none;
  background: transparent;
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-player-size:hover:not(.active) {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.btn-player-size.active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .btn-player-size.active {
  background: #1e293b;
  color: #38bdf8;
}

.player-video-viewport {
  padding: 0;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  flex: 1;
}

.player-video-viewport video {
  width: 100%;
  max-height: calc(85vh - 220px);
  object-fit: contain;
  background: #000000;
  display: block;
}

.size-full .player-video-viewport video {
  max-height: calc(94vh - 180px);
}

.player-video-viewport audio {
  width: 90%;
  margin: 2.5rem 0;
}

.player-control-console {
  padding: 0.75rem 1.15rem;
  background: var(--surface-subtle);
  border-top: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.player-controls-row::-webkit-scrollbar {
  display: none;
}

.player-btn-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.player-ctrl-btn {
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.player-ctrl-btn:hover {
  background: var(--surface-hover);
  border-color: #0284c7;
  color: #0284c7;
  transform: translateY(-1px);
}

.player-ctrl-btn.primary-play-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid #0284c7;
  font-weight: 700;
  padding: 0.38rem 0.85rem;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.player-ctrl-btn.primary-play-btn:hover {
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
  color: #ffffff;
}

.player-time-badge {
  padding: 0.32rem 0.55rem;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.player-row-divider {
  width: 1px;
  height: 22px;
  background: var(--surface-border);
  margin: 0 0.15rem;
  flex-shrink: 0;
}

.player-speed-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--surface);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  flex-shrink: 0;
}

.speed-cluster-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.1rem;
}

.speed-step-btn {
  padding: 0.22rem 0.45rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.speed-step-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.speed-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.player-speed-dropdown {
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 0.22rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0284c7;
  cursor: pointer;
  outline: none;
}

.player-speed-dropdown:focus {
  border-color: #0284c7;
}

.speed-reset-btn {
  padding: 0.22rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.speed-reset-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-dim);
}

.speed-mini-presets {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.2rem;
  border-left: 1px solid var(--surface-border-subtle);
  padding-left: 0.35rem;
}

.speed-preset-chip {
  padding: 0.18rem 0.4rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.speed-preset-chip:hover {
  border-color: #0284c7;
  color: #0284c7;
}

.speed-preset-chip.active {
  background: #e0f2fe;
  color: #0284c7;
  border-color: #7dd3fc;
  font-weight: 800;
}

[data-theme="dark"] .speed-preset-chip.active {
  background: #0369a1;
  color: #ffffff;
  border-color: #38bdf8;
}

/* Row 2: Dedicated Keyboard Shortcuts Bar */
.player-shortcuts-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--surface-border-subtle);
}

.shortcut-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.shortcut-desc {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
}

[data-theme="dark"] .shortcut-desc {
  color: #94a3b8;
}

.shortcut-sep {
  color: var(--text-dim);
  font-size: 0.7rem;
  user-select: none;
}

.kbd-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-bottom: 2px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-primary);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .kbd-pill {
  background: #1e293b;
  border-color: #334155;
  border-bottom-color: #475569;
  color: #f8fafc;
}

/* ============================================================== */
/* 3-ROW MEDIA LIBRARY CONSOLE & COLUMN FILTERS                   */
/* ============================================================== */

.library-hero-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Row 1: Stats & Overview Bar */
.library-row-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--surface-border-subtle);
}

.library-top-metrics {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.lib-metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.lib-metric-pill.highlight-duration {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.3);
  color: #0284c7;
}

[data-theme="dark"] .lib-metric-pill.highlight-duration {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.lib-metric-val {
  font-weight: 700;
  color: var(--text-primary);
}

.lib-action-btn-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Row 2: Column-Matched Filter Controls */
.library-row-filters {
  display: grid;
  grid-template-columns: 2.2fr 1.1fr 1.8fr 1.2fr 0.7fr;
  gap: 0.75rem;
  align-items: flex-end;
  background: var(--bg-subtle);
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--surface-border);
}

.col-filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.col-filter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
}

.filter-col-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.input-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-svg {
  position: absolute;
  left: 0.6rem;
  color: var(--text-dim);
  pointer-events: none;
}

.filter-input {
  width: 100%;
  height: 34px;
  padding: 0.3rem 0.6rem 0.3rem 2rem;
  border-radius: 6px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.8rem;
  outline: none;
  transition: all 0.15s ease;
}

.filter-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

.btn-clear-search {
  position: absolute;
  right: 0.4rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px 4px;
  border-radius: 4px;
}

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

.filter-select {
  height: 34px;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-select:focus {
  border-color: var(--brand-primary);
}

.filter-select-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.btn-block-filter {
  height: 34px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Row 3: Batch Selector, Media Type Chips & Filtered Time */
.library-row-pills {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0.25rem 0.25rem 0.25rem;
}

.pills-left-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.batch-filter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 7px;
  padding: 0 0.5rem;
  height: 32px;
}

.batch-folder-select {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  max-width: 240px;
}

.media-type-chips {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}

.type-chip {
  background: transparent;
  border: none;
  border-radius: 5px;
  padding: 0.25rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.type-chip:hover {
  color: var(--text-primary);
}

.type-chip.active {
  background: var(--surface);
  color: var(--brand-primary, #0284c7);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chip-count {
  font-size: 0.7rem;
  background: var(--bg-subtle);
  border-radius: 10px;
  padding: 1px 5px;
}

.type-chip.active .chip-count {
  background: rgba(14, 165, 233, 0.15);
  color: var(--brand-primary, #0284c7);
}

.pills-right-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.filtered-playtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 7px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  color: #059669;
}

[data-theme="dark"] .filtered-playtime-badge {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
  color: #34d399;
}

.filtered-playtime-badge .f-val {
  font-weight: 700;
  color: var(--text-primary);
}

.filtered-count-badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Interactive Sortable Headers */
.sortable-header {
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.sortable-header:hover {
  background: rgba(14, 165, 233, 0.08);
  color: var(--brand-primary);
}

.th-sort-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.th-sort-wrapper.justify-center {
  justify-content: center;
  width: 100%;
}

.sort-indicator {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-dim);
  transition: color 0.15s ease, transform 0.15s ease;
}

.sortable-header:hover .sort-indicator {
  color: var(--brand-primary);
}

.sortable-header.active-sort .sort-indicator {
  color: #0284c7;
  font-weight: 800;
}

[data-theme="dark"] .sortable-header.active-sort .sort-indicator {
  color: #38bdf8;
}

/* 2-Row Media File Column Formatting */
.media-file-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.media-subrow-1 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.media-cell-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
}

.media-cell-title:hover {
  color: var(--brand-primary);
}

.media-duration-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  color: #0284c7;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

[data-theme="dark"] .media-duration-pill {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

.media-subrow-2 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.media-filename-txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 440px;
}

.btn-copy-name {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 3px;
  font-size: 0.75rem;
}

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

/* 2-Row Transcript Column Formatting (Button on Row 1, Video ID on Row 2) */
.transcript-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  justify-content: center;
}

.transcript-subrow-2 {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 2-Row Format & Size Column Formatting (Format/Size/Duration on Row 1, Batch folder on Row 2) */
.format-size-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.format-size-row-1 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.format-size-row-2 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.subfolder-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.video-id-tag {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--surface-border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
}

/* 2-Row Stacked Actions Column (Play on Row 1, Finder on Row 2) */
.table-actions-vertical-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  max-width: 105px;
  margin: 0 auto;
}

.btn-block-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ==============================================================
 * PERSISTENT BOTTOM MINI-PLAYER BAR
 * ============================================================== */
.mini-player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 74px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1.5rem;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

[data-theme="light"] .mini-player-bar {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.mini-player-bar.hidden {
  display: none !important;
}

/* Mini Player Left: Artwork & Metadata */
.mini-player-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 280px;
  min-width: 200px;
  flex-shrink: 0;
}

.mini-player-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--surface-subtle);
  flex-shrink: 0;
}

[data-theme="light"] .mini-player-thumb {
  border-color: var(--surface-border);
}

.mini-player-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  overflow: hidden;
}

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

.mini-player-artist {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mini Player Center: Controls & Scrubber */
.mini-player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  max-width: 580px;
  gap: 0.35rem;
}

.mini-controls-cluster {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mini-ctrl-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.15s ease;
  user-select: none;
}

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

[data-theme="light"] .mini-ctrl-btn:hover {
  background: var(--surface-hover);
}

.mini-ctrl-btn.active {
  color: var(--accent) !important;
  background: var(--accent-light) !important;
}

.mini-btn-play-main {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff !important;
  box-shadow: 0 2px 10px var(--accent-glow);
}

.mini-btn-play-main:hover {
  background: var(--accent-hover);
  transform: scale(1.06);
}

.mini-progress-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mini-time-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 38px;
  text-align: center;
  flex-shrink: 0;
}

.mini-scrubber-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

.mini-seek-scrubber {
  width: 100%;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  transition: height 0.15s ease;
}

.mini-seek-scrubber:hover {
  height: 7px;
}

.mini-seek-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 6px var(--accent-glow);
  transition: transform 0.15s ease;
}

.mini-seek-scrubber:hover::-webkit-slider-thumb {
  transform: scale(1.2);
}

.mini-seek-scrubber::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

/* Mini Player Right: Volume, Speed, Queue Drawer & Expand */
.mini-player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  width: 300px;
  min-width: 220px;
  flex-shrink: 0;
}

.mini-speed-badge {
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mini-speed-badge:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mini-volume-cluster {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mini-ctrl-btn-sm {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px;
}

.mini-volume-slider {
  width: 75px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}

.mini-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-secondary);
  cursor: pointer;
}

.btn-mini-queue {
  position: relative;
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 5px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.btn-mini-queue:hover, .btn-mini-queue.active {
  border-color: var(--purple);
  color: var(--purple);
  background: var(--purple-light);
}

.queue-count-pill {
  background: var(--purple);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
}

.btn-mini-expand {
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-mini-expand:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

/* ==============================================================
 * SLIDE-OUT PLAYBACK QUEUE DRAWER
 * ============================================================== */
.playback-queue-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 74px;
  width: 380px;
  max-width: 90vw;
  background: var(--surface);
  border-left: 1px solid var(--surface-border);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.22);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.playback-queue-drawer.open {
  transform: translateX(0);
}

.queue-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--surface-border);
}

.drawer-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 4px;
}

.drawer-badge.purple {
  background: var(--purple-light);
  color: var(--purple);
}

.drawer-heading {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 0.2rem;
  color: var(--text-primary);
}

.btn-close-drawer {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-close-drawer:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.queue-drawer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.25rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--surface-border-subtle);
}

.drawer-stats-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.4rem;
}

.drawer-actions-duo {
  display: flex;
  gap: 0.4rem;
}

.queue-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

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

.queue-drawer-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border-subtle);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.queue-drawer-item:hover {
  background: var(--surface-hover);
  border-color: var(--surface-border);
}

.queue-drawer-item.active-item {
  background: rgba(37, 99, 235, 0.09);
  border-color: var(--accent);
}

.q-item-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.q-item-thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #000;
}

.q-item-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

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

.q-item-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.q-item-btn-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  font-size: 0.8rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.q-item-btn-remove:hover {
  color: var(--danger);
  background: var(--danger-light);
}

/* ==============================================================
 * AUDIO & VIDEO LIBRARY VIEW SWITCHERS & CARDS
 * ============================================================== */
.view-switcher-group {
  display: inline-flex;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  padding: 2px;
  background: var(--surface-subtle);
  gap: 2px;
}

.btn-view-toggle {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

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

.btn-view-toggle.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Audio Album Art Grid */
.audio-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  padding: 0.5rem 0;
}

.audio-grid-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.audio-grid-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--purple);
}

.audio-card-cover-wrap {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  background: var(--surface-subtle);
}

.audio-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.audio-grid-card:hover .audio-card-cover {
  transform: scale(1.05);
}

.audio-card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.audio-grid-card:hover .audio-card-play-overlay {
  opacity: 1;
}

.audio-card-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
  transform: scale(0.9);
  transition: transform 0.15s ease;
}

.audio-grid-card:hover .audio-card-play-btn {
  transform: scale(1);
}

.audio-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.audio-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-card-artist {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: auto;
  padding-top: 0.4rem;
  border-top: 1px solid var(--surface-border-subtle);
}

/* Video Card Grid */
.video-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  padding: 0.5rem 0;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.video-card-thumb-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  position: relative;
  background: #000;
  overflow: hidden;
}

.video-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-card:hover .video-card-thumb {
  transform: scale(1.04);
}

.video-duration-pill {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.video-format-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #38bdf8;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.video-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.video-card:hover .video-play-badge {
  opacity: 1;
}

.video-play-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.video-card-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

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

.video-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.video-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--surface-border-subtle);
  margin-top: auto;
}

/* ==============================================================
 * PLAYLISTS GRID & DETAIL HERO
 * ============================================================== */
.playlists-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 0.5rem 0;
}

.playlist-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.playlist-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--teal);
}

.playlist-card-cover {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25);
}

.playlist-card-type-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
}

.playlist-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.playlist-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.playlist-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.playlist-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--surface-border-subtle);
}

/* Playlist Detail View */
.playlist-detail-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-hero-layout {
  display: flex;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  align-items: center;
}

.playlist-hero-cover {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.25);
}

.playlist-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.playlist-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.playlist-hero-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.playlist-hero-stats {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.playlist-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* ==============================================================
 * MULTI-SELECT BULK ACTIONS BAR
 * ============================================================== */
.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 16px var(--accent-glow);
  gap: 1rem;
}

.bulk-count-badge {
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.bulk-btns-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==============================================================
 * CUSTOM IN-APP MODALS (RULE 18 - NO NATIVE BROWSER DIALOGS)
 * ============================================================== */
.confirm-modal-card {
  max-width: 440px;
}

.confirm-modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.confirm-message {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.confirm-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.playlist-modal-card {
  max-width: 480px;
}

.add-to-playlist-modal-card {
  max-width: 440px;
}

.add-to-playlist-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 280px;
  overflow-y: auto;
  margin: 0.8rem 0;
}

.playlist-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: var(--surface-subtle);
  border: 1px solid var(--surface-border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.playlist-picker-item:hover {
  background: var(--surface-hover);
  border-color: var(--teal);
}

/* Audio & Video Toolbars & Table Cells */
.audio-toolbar-row, .video-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.audio-search-box, .video-search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.audio-filters-cluster, .video-filters-cluster {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.audio-info-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.audio-info-thumb {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  background: var(--surface-subtle);
  flex-shrink: 0;
  border: 1px solid var(--surface-border-subtle);
}

.audio-info-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.audio-info-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.audio-info-artist {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.audio-grid-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.btn-video-card-play, .btn-audio-grid-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--accent-glow);
  transform: scale(0.9);
  transition: transform 0.15s ease;
}

.audio-grid-card:hover .btn-audio-grid-play, .video-card:hover .btn-video-card-play {
  transform: scale(1);
}

.audio-card-overlay, .video-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.audio-grid-card:hover .audio-card-overlay, .video-card:hover .video-card-overlay {
  opacity: 1;
}

.audio-card-dur {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 3px;
}

/* ============================================================== */
/* MOBILE RESPONSIVE NAVIGATION & DRAWER SYSTEM (RULE 18 & A11Y) */
/* ============================================================== */
.sidebar-drawer-header {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

.mobile-topbar-header {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

/* Responsive */
@media (max-width: 1180px) {
  .studio-grid { grid-template-columns: 1fr; }
  .diagnostics-cards-grid { grid-template-columns: 1fr; }
  .library-row-filters { grid-template-columns: 1fr 1fr; }
  .mini-player-left { width: 220px; }
  .mini-player-right { width: 220px; }
}

@media (max-width: 768px) {
  /* Prevent iOS Safari auto-zoom on input focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  body.drawer-locked {
    overflow: hidden !important;
    touch-action: none;
  }

  .app-layout {
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* 1. Off-Canvas Sidebar Drawer */
  .sidebar-column {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw) !important;
    min-width: min(320px, 86vw) !important;
    max-width: 86vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 1200 !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.55);
    border-right: 1px solid var(--sidebar-border);
    border-bottom: none;
    padding: 1.25rem 1rem;
    gap: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--sidebar-bg);
  }

  .sidebar-column.mobile-open {
    transform: translateX(0);
  }

  .sidebar-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .drawer-header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .brand-avatar-mini {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .drawer-header-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
  }

  .btn-drawer-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .btn-drawer-close:active {
    transform: scale(0.95);
    background: var(--surface-hover);
  }

  .sidebar-backdrop {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-backdrop.active {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
  }

  /* 2. Mobile Top Bar */
  .content-topbar {
    padding: 0.65rem 0.85rem;
    position: sticky;
    top: 0;
    z-index: 1250 !important;
    border-bottom: 1px solid var(--header-border);
    background: var(--header-bg);
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.08);
  }

  .desktop-topbar-left,
  .desktop-topbar-right {
    display: none !important;
  }

  .mobile-topbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.65rem;
  }

  .mobile-btn-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.15s ease;
  }

  .mobile-btn-menu:active {
    transform: scale(0.94);
  }

  .mobile-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
  }

  .brand-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
    flex-shrink: 0;
  }

  .mobile-brand-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .mobile-brand-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-brand-sub {
    font-size: 0.72rem;
    font-weight: 700;
    color: #0284c7;
    line-height: 1.1;
  }

  [data-theme="dark"] .mobile-brand-sub {
    color: #38bdf8;
  }

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

  .mobile-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: var(--radius-sm);
    background: var(--surface-subtle);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.15s ease;
  }

  .mobile-pill-btn:active {
    transform: scale(0.92);
  }

  /* 3. Mobile Bottom Navigation Bar (iOS / Android standards) */
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--sidebar-border);
    z-index: 1300 !important;
    pointer-events: auto !important;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
  }

  [data-theme="light"] .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    gap: 3px;
    cursor: pointer !important;
    padding: 4px 0;
    touch-action: manipulation !important;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.15s ease;
  }

  .mobile-nav-btn * {
    pointer-events: none !important;
  }

  .mobile-nav-btn:active {
    opacity: 0.75;
    transform: scale(0.96);
  }

  .mobile-nav-btn.active {
    color: #0284c7;
    font-weight: 800;
  }

  [data-theme="dark"] .mobile-nav-btn.active {
    color: #38bdf8;
  }

  .mobile-nav-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #0284c7;
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.4);
  }

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

  /* 4. Content Viewport Clearance */
  .content-viewport {
    padding: 1rem 0.85rem;
    padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px));
  }

  body.has-mini-player .content-viewport {
    padding-bottom: calc(145px + env(safe-area-inset-bottom, 0px));
  }

  .content-footer {
    display: flex !important;
    padding: 1.25rem 1rem;
    margin-bottom: calc(65px + env(safe-area-inset-bottom, 0px));
    gap: 0.85rem;
  }

  .footer-author-card {
    padding: 0.85rem 0.5rem;
  }

  .footer-author-links-row {
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    justify-content: center;
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .footer-author-links-row::-webkit-scrollbar {
    display: none;
  }

  .footer-author-link {
    font-size: 0.74rem;
    padding: 0.28rem 0.45rem;
    gap: 0.25rem;
  }

  .footer-link-text {
    font-size: 0.72rem;
  }

  .footer-author-pipe {
    display: inline-block !important;
    font-size: 0.72rem;
    opacity: 0.5;
    margin: 0;
  }

  .footer-bottom-meta {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
  }

  /* 5. Mini-Player Bar Mobile Docking */
  .mini-player-bar {
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    height: 62px;
    padding: 0 0.75rem;
    gap: 0.55rem;
    z-index: 1040;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.25);
  }

  .mini-player-left {
    width: 135px;
    min-width: 100px;
    gap: 0.55rem;
  }

  .mini-player-thumb {
    width: 38px;
    height: 38px;
    border-radius: 6px;
  }

  .mini-player-title {
    font-size: 0.8rem;
    max-width: 85px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mini-player-sub {
    font-size: 0.68rem;
    max-width: 85px;
  }

  .mini-player-center {
    gap: 0.35rem;
  }

  .mini-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .mini-play-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .mini-player-right {
    width: auto;
    min-width: auto;
    gap: 0.35rem;
  }

  .mini-volume-cluster,
  .mini-speed-badge {
    display: none !important;
  }

  .playback-queue-drawer {
    width: 100% !important;
    max-width: 100% !important;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    height: calc(100vh - 120px);
  }

  /* 6. Batch Downloader Form Mobile Optimization */
  .studio-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .input-hero-card,
  .options-hero-card,
  .pro-card {
    padding: 1.15rem 0.95rem;
    border-radius: var(--radius-md);
  }

  .card-top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .url-counter-badge {
    align-self: flex-start;
  }

  .input-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .actions-left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .actions-left .btn,
  .actions-left .file-btn-label {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
  }

  #btn-clear-urls {
    width: 100%;
    min-height: 42px;
  }

  .options-body-stack {
    gap: 1rem;
  }

  .segmented-mode-switch {
    grid-template-columns: 1fr 1fr;
  }

  .segmented-btn {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
  }

  .option-field-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .custom-select-wrap,
  .pro-select {
    width: 100%;
    min-height: 44px;
  }

  .switches-grid {
    padding: 0.75rem 0.85rem;
    gap: 0.75rem;
  }

  .destination-pill-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .destination-info {
    width: 100%;
    word-break: break-all;
  }

  #btn-start-download {
    min-height: 52px;
    font-size: 1.02rem;
    width: 100%;
  }

  /* 7. Active Queue Cards Mobile Polish */
  .task-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .task-thumb {
    width: 90px;
    height: 54px;
  }

  .task-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .task-title {
    font-size: 0.88rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .task-badges {
    align-self: flex-start;
  }

  .task-actions {
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid var(--surface-border);
    padding-top: 0.55rem;
    gap: 0.45rem;
  }

  .task-actions .btn {
    min-height: 38px;
    padding: 0.35rem 0.75rem;
  }

  /* 8. Media Library, Audio & Video Consoles */
  .library-row-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .library-top-metrics {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .lib-metric-pill {
    padding: 0.25rem 0.55rem;
    font-size: 0.75rem;
  }

  .lib-action-btn-group {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }

  .lib-action-btn-group .btn {
    flex: 1;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .library-row-filters {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .filter-input,
  .filter-select {
    min-height: 44px;
    width: 100%;
  }

  .library-row-pills {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .subfolder-filter-wrap {
    width: 100%;
  }

  .subfolder-select {
    width: 100%;
    min-height: 40px;
  }

  .video-toolbar-row {
    flex-direction: column;
    gap: 0.65rem;
  }

  .video-filters-cluster {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .video-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }

  .playlists-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .detail-hero-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    padding: 1.25rem 1rem;
  }

  .detail-hero-cover {
    width: 140px;
    height: 140px;
  }

  /* 9. Media Player Modal & Dialogs */
  .media-player-modal-card {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 92vh !important;
    border-radius: var(--radius-lg);
  }

  .player-single-row {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .player-transport-cluster {
    width: 100%;
    justify-content: center;
    gap: 0.45rem;
  }

  .player-ctrl-btn {
    min-height: 40px;
    padding: 0.4rem 0.65rem;
  }

  .primary-play-btn {
    min-height: 44px;
    padding: 0.5rem 1.15rem;
  }

  .player-speed-cluster {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .player-shortcuts-row {
    display: none !important;
  }

  .modal-card,
  .transcript-modal-card,
  .cookies-modal-card {
    width: 94vw !important;
    max-width: 94vw !important;
    max-height: 88vh !important;
    padding: 1.25rem 1rem;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================================== */
/* MEDIA LIBRARY LOADING SKELETON & SPINNER                       */
/* ============================================================== */
.library-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 56px 24px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
}

.library-loading-state.hidden {
  display: none !important;
}

.spinner-ring {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spinRing 0.75s linear infinite;
}

@keyframes spinRing {
  to { transform: rotate(360deg); }
}
