/* ==========================================================================
   Sesli Gazete - Eye-Friendly Premium Mobile Design System
   Default: Midnight Slate (Göz Yormayan Koyu/Gece Teması)
   Light: Warm Paper Slate
   ========================================================================== */

:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Surfaces & Backgrounds - Premium Eye-Friendly Dark Slate */
  --bg-body: #0B111E;
  --bg-card: #151D2E;
  --bg-subtle: #1E283D;
  --bg-hover: #26334D;
  --bg-active: #1D3557;

  /* Borders */
  --border-light: rgba(148, 163, 184, 0.14);
  --border-hover: rgba(148, 163, 184, 0.32);
  --border-primary: #38BDF8;

  /* Brand Colors - High Vibrancy on Dark Surfaces */
  --primary: #38BDF8;
  --primary-hover: #0EA5E9;
  --primary-light: rgba(56, 189, 248, 0.16);
  --primary-gradient: linear-gradient(135deg, #38BDF8 0%, #2563EB 100%);
  --accent-green: #34D399;
  --accent-green-light: rgba(52, 211, 153, 0.16);

  /* Typography - Crisp & Extremely Legible */
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Shadows - Deep, Rich, Elevated */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 6px 20px -3px rgba(0, 0, 0, 0.45), 0 2px 6px -1px rgba(0, 0, 0, 0.25);
  --shadow-floating: 0 12px 36px -4px rgba(0, 0, 0, 0.55), 0 4px 12px -2px rgba(0, 0, 0, 0.35);
  --shadow-player: 0 -8px 32px -4px rgba(0, 0, 0, 0.65), 0 -2px 8px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  /* Warm Soft Paper Mode - Zero Harsh White Glare */
  --bg-body: #F4F6F9;
  --bg-card: #FFFFFF;
  --bg-subtle: #EAEEF5;
  --bg-hover: #F0F4F9;
  --bg-active: #E0EBFB;

  --border-light: #D8DFEB;
  --border-hover: #B8C4D8;
  --border-primary: #2563EB;

  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-light: #EFF6FF;
  --primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  --accent-green: #10B981;
  --accent-green-light: #ECFDF5;

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-dim: #94A3B8;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 16px -2px rgba(15, 23, 42, 0.05), 0 1px 3px 0 rgba(15, 23, 42, 0.03);
  --shadow-floating: 0 10px 30px -4px rgba(15, 23, 42, 0.1), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-player: 0 -4px 24px -2px rgba(15, 23, 42, 0.08), 0 -1px 3px 0 rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  background-color: var(--bg-body);
}

body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 190px; /* Space for elevated fixed audio player (+10px) */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.app-header {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 12px 20px;
  box-shadow: var(--shadow-sm);
  transition: background 0.25s ease;
}

.header-container {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-box {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  flex-shrink: 0;
}

.logo-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Main Content & Step Cards
   ========================================================================== */

.main-content {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.step-card:hover {
  border-color: var(--border-hover);
}

.step-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 12px;
}

.step-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-badge {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-title {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  line-height: 1.25;
}

.step-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

.step-actions {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  border: none;
  outline: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: var(--radius-xs);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

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

.btn-ghost {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid transparent;
}

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

#btnToggleAuthorsList {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
}

#btnToggleAuthorsList:hover {
  border-color: var(--primary);
}

#btnToggleAuthorsList.collapsed {
  color: var(--text-primary);
  background: var(--bg-subtle);
  border-color: var(--border-color);
}

.authors-collapsible-body {
  transition: opacity 0.2s ease;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.btn-cta {
  padding: 12px 24px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   Step 1: Date Filter Toolbar & Flatpickr Styling
   ========================================================================== */

.date-filter-toolbar {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.date-toolbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.date-toolbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.date-picker-custom-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-input-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.datepicker-box {
  position: relative;
  display: flex;
  align-items: center;
}

.date-input-control {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 32px 7px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 136px;
  text-align: center;
}

.date-input-control:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.date-input-control:focus {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-clear-date {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-hover);
  border: none;
  border-radius: var(--radius-full);
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
  padding: 0;
}

.btn-clear-date:hover {
  background: #EF4444;
  color: #FFFFFF;
}

.date-chips-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-chip {
  border: 1.5px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.date-chip:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.date-chip.active {
  background: var(--primary-gradient);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.date-chip-label {
  letter-spacing: -0.01em;
}

.date-chip-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  line-height: 1;
}

.date-chip.active .date-chip-badge {
  background: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
}

/* Custom Flatpickr Theme styling */
.flatpickr-calendar {
  background: var(--bg-card) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-floating) !important;
  border: 1.5px solid var(--border-light) !important;
  font-family: var(--font-family) !important;
  color: var(--text-primary) !important;
}

.flatpickr-months {
  background: var(--bg-subtle) !important;
  border-bottom: 1px solid var(--border-light);
}

.flatpickr-months .flatpickr-month {
  color: var(--text-primary) !important;
  fill: var(--text-primary) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  color: var(--text-primary) !important;
  background: var(--bg-subtle) !important;
}

.flatpickr-weekdays {
  background: var(--bg-subtle) !important;
}

span.flatpickr-weekday {
  color: var(--text-muted) !important;
}

.flatpickr-day {
  color: var(--text-secondary) !important;
}

.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
}

.flatpickr-day:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

/* ==========================================================================
   Newspaper Cards
   ========================================================================== */

.newspaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.newspaper-card {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.newspaper-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.newspaper-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
}

.newspaper-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.newspaper-dot {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--bg-card), 0 2px 4px rgba(0, 0, 0, 0.25);
}

.newspaper-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.newspaper-count {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Custom Checkbox */
.custom-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-hover);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  background: var(--bg-card);
}

.newspaper-card.selected .custom-checkbox,
.author-item.selected .custom-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}

.custom-checkbox svg {
  display: none;
  stroke: #FFFFFF;
  stroke-width: 3;
}

.newspaper-card.selected .custom-checkbox svg,
.author-item.selected .custom-checkbox svg {
  display: block;
}

/* ==========================================================================
   Step 2: Authors List & Search
   ========================================================================== */

.author-filters-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.author-filters-row .search-wrap {
  flex: 1;
  min-width: 250px;
  margin-bottom: 0;
}

.undated-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  user-select: none;
}

.undated-toggle-label:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.undated-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.search-wrap {
  position: relative;
  margin-bottom: 16px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.search-wrap input:focus {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-wrap input::placeholder {
  color: var(--text-dim);
}

.author-groups-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.newspaper-group {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.group-header {
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.group-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.collapse-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.collapse-group-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.collapse-group-btn.collapsed {
  background: var(--bg-hover);
  color: var(--primary);
  border-color: var(--border-color);
}

.group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.authors-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
  padding: 12px;
  max-height: 480px;
  overflow-y: auto;
}

.authors-subgroup-header {
  grid-column: 1 / -1;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 7px 12px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  margin-bottom: 2px;
}

.author-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  cursor: pointer;
  transition: all 0.18s ease;
  gap: 10px;
}

.author-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.author-item.selected {
  background: var(--primary-light);
  border-color: var(--primary);
}

.author-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
}

.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.author-details {
  overflow: hidden;
  min-width: 0;
}

.author-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.author-article {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
  margin-top: 1px;
}

/* Author Checkbox with Date */
.author-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  user-select: none;
}

.checkbox-indicator {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-hover);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.checkbox-indicator svg {
  display: none;
  stroke: #FFFFFF;
  stroke-width: 3;
}

.checkbox-date-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.author-item:hover .author-checkbox {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.author-item.selected .author-checkbox {
  background: var(--primary-gradient);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.author-item.selected .author-checkbox .checkbox-indicator {
  background: #FFFFFF;
  border-color: #FFFFFF;
}

.author-item.selected .author-checkbox .checkbox-indicator svg {
  display: block;
  stroke: #0284C7;
}

.author-item.selected .author-checkbox .checkbox-date-text {
  color: #FFFFFF;
  font-weight: 700;
}

/* Action Dock at Step 2 */
.action-dock {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 18px;
  flex-wrap: wrap;
  gap: 14px;
}

.dock-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: var(--radius-full);
  box-shadow: 0 0 0 3px var(--accent-green-light);
}

.dock-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1.5px solid var(--border-light);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.select-wrapper select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ==========================================================================
   Step 3: Playlist & Reader
   ========================================================================== */

.playlist-drawer {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.15s ease;
}

.playlist-item:last-child {
  border-bottom: none;
}

.playlist-item:hover {
  background: var(--bg-hover);
}

.playlist-item.active {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
}

.playlist-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.playlist-item-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.playlist-item-num.active {
  color: var(--primary);
}

.playlist-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.playlist-meta {
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.playlist-author-line {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.playlist-author-name {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-author-newspaper {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  flex-shrink: 0;
}

.playlist-track-title {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
  margin-top: 2px;
}

.status-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.status-badge.ready {
  color: #34D399;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.status-badge.pending {
  color: #FBBF24;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-badge.error {
  color: #F87171;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.reader-panel {
  margin-top: 16px;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.reader-title {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.35;
}

.reader-meta {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.reader-body {
  color: var(--text-secondary);
  font-size: 15.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 8px;
}

/* ==========================================================================
   Floating Audio Player Bar (Mobile-First / Sticky Bottom)
   ========================================================================== */

.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1.5px solid var(--border-light);
  padding: 21px 24px calc(21px + env(safe-area-inset-bottom, 12px));
  min-height: 110px;
  z-index: 50;
  box-shadow: var(--shadow-player);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.25s ease;
}

.player-queue-top {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.player-queue-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.player-queue-badge svg {
  color: var(--primary);
  flex-shrink: 0;
}

.queue-counter-bold {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  background: rgba(37, 99, 235, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.player-progress-container {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}

.time-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: center;
  letter-spacing: -0.01em;
}

.progress-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: height 0.15s ease;
  border: 1px solid var(--border-light);
}

.progress-bar-wrap:hover {
  height: 9px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.1s linear;
}

.player-main {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.player-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.player-text {
  overflow: hidden;
  min-width: 0;
}

.player-track-author-line {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track-author {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track-badge {
  font-size: 11px;
  padding: 2.5px 8px;
  border-radius: var(--radius-xs);
  color: #FFFFFF;
  background: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
}

.player-track-title {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

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

.voice-toggle-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  min-width: 48px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.voice-toggle-btn:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.speed-btn {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  min-width: 42px;
}

.play-pause-btn {
  background: var(--primary-gradient);
  color: #FFFFFF;
  width: 50px;
  height: 50px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
}

.play-pause-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55);
}

/* ==========================================================================
   Loading & Feedback
   ========================================================================== */

.loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-full);
  border-top-color: var(--primary);
  animation: spin 0.75s linear infinite;
}

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

/* ==========================================================================
   Mobile-First & Large Screen Responsive Adjustments
   ========================================================================== */

@media (min-width: 769px) {
  /* Notebook & Large Screen - ensure author names are fully visible without truncation */
  .authors-list {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 10px;
  }

  .author-item {
    padding: 12px 14px;
  }

  .author-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: normal;
    line-height: 1.35;
    font-size: 14.5px;
  }

  .author-meta {
    flex: 1;
    min-width: 0;
  }

  .author-details {
    flex: 1;
    min-width: 0;
    overflow: visible;
  }

  .author-article {
    max-width: 250px;
  }

  /* Player Bar author name full visibility */
  .player-track-author-line {
    white-space: normal;
    overflow: visible;
    flex-wrap: wrap;
  }

  .player-track-author {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 15px;
  }

  /* Playlist author name full visibility */
  .playlist-author-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .playlist-track-title {
    max-width: 520px;
  }
}

@media (max-width: 768px) {
  body {
    padding-bottom: 210px;
  }

  .main-content {
    padding: 16px 12px;
    gap: 16px;
  }

  .step-card {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  .newspaper-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .authors-list {
    grid-template-columns: 1fr;
    max-height: 360px;
  }

  .action-dock {
    flex-direction: column;
    align-items: stretch;
  }

  .dock-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .select-wrapper select {
    width: 100%;
  }

  .btn-cta {
    width: 100%;
    padding: 14px;
    font-size: 15px;
  }

  .player-track-title {
    max-width: 150px;
  }
}

@media (max-width: 480px) {
  body {
    padding-bottom: 225px;
  }

  .newspaper-grid {
    grid-template-columns: 1fr;
  }

  .btn-text-desktop {
    display: none;
  }

  .player-main {
    gap: 8px;
  }

  .player-avatar {
    width: 44px;
    height: 44px;
  }

  .player-track-title {
    max-width: 120px;
    font-size: 11.5px;
  }

  .player-track-author {
    font-size: 13px;
  }

  .ctrl-btn {
    padding: 7px;
  }

  .play-pause-btn {
    width: 44px;
    height: 44px;
  }
}
