/* === Custom Properties === */
:root {
  --bg: #1a1a1a;
  --surface: #242424;
  --surface-hover: #2e2e2e;
  --surface-active: #353535;
  --primary: #3d6b4e;
  --primary-hover: #4a7c59;
  --text: #ffffff;
  --text-secondary: #a0a0a0;
  --border: #333333;
  --radius: 8px;
  --radius-lg: 12px;
  --player-height: 90px;
}

/* === Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

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

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input[type="search"] {
  font: inherit;
  color: inherit;
}

/* === Two-Column Layout === */
main.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
  overflow: hidden;
}

body.player-active main.two-col {
  height: calc(100vh - var(--player-height));
}

.col {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.col:last-child {
  border-right: none;
}

.col-header {
  flex-shrink: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  min-height: 55px;
}

.col-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* === Search (Modal) === */
.search-bar {
  position: relative;
}

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

#search-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

#search-input:focus {
  border-color: var(--primary);
}

#search-input::placeholder {
  color: var(--text-secondary);
}

.modal-search {
  width: 650px;
  max-height: 80vh;
}

.search-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.modal-search .search-bar {
  margin-bottom: 16px;
}

.modal-search .podcast-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  overflow: hidden;
}

/* === Podcast Grid === */
.podcast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.podcast-card {
  display: flex;
  flex-direction: column;
  padding: 8px;
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  min-width: 0;
  position: relative;
  contain: layout style;
}

.podcast-card:hover {
  background: var(--surface-hover);
}

.podcast-card-artwork-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
  aspect-ratio: 1;
  background: #222;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.podcast-card-artwork-wrap::after {
  content: '\1F3A7';
  font-size: 2.5rem;
  position: absolute;
  opacity: 0.3;
  pointer-events: none;
}

.podcast-card-artwork {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.podcast-card-text {
  min-width: 0;
}

.podcast-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podcast-card-author {
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Subscribe Button on Card === */
.btn-card-sub {
  position: absolute;
  bottom: 6px;
  right: 6px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: var(--text);
  transition: color 0.15s, background 0.15s;
}

.btn-card-sub:hover {
  background: var(--primary);
  color: #fff;
}

.btn-card-sub.subscribed {
  background: var(--primary);
  color: #fff;
}

.btn-card-sub.subscribed:hover {
  background: var(--primary-hover);
}

/* === Mosaic Mode === */
.podcast-grid.mosaic {
  gap: 4px;
}

.podcast-grid.mosaic .podcast-card {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.podcast-grid.mosaic .podcast-card:hover {
  background: transparent;
}

.podcast-grid.mosaic .podcast-card-artwork-wrap {
  margin-bottom: 0;
}

.podcast-grid.mosaic .podcast-card-artwork {
  border-radius: 0;
}

.podcast-grid.mosaic .podcast-card-text {
  display: none;
}

/* === Hamburger Button === */
.btn-hamburger {
  flex-shrink: 0;
}

/* === Category Mode === */
.btn-category-mode {
  flex-shrink: 0;
  gap: 4px;
}

.btn-category-mode.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-category-mode[hidden] {
  display: none;
}

.podcast-card.category-mode {
  cursor: pointer;
}

.btn-card-menu {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}

.podcast-card:hover .btn-card-menu {
  opacity: 1;
}

.btn-card-menu:hover {
  background: rgba(0, 0, 0, 0.8);
}

.card-popup-menu {
  position: fixed;
  background: #3a3a3a;
  border: 1px solid #555;
  border-radius: var(--radius);
  min-width: 140px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.card-popup-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.15s;
}

.card-popup-menu button:hover {
  background: var(--border);
}

.card-popup-menu button.destructive {
  color: #e55;
}

/* Tag popup */
.tag-popup-heading {
  padding: 8px 12px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.tag-popup-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
}

.tag-popup-item:hover {
  background: var(--border);
}

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

.tag-popup-empty {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-style: italic;
}

.card-select-check {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.6);
  z-index: 2;
  transition: background 0.15s, border-color 0.15s;
}

.card-select-check.selected {
  background: var(--primary);
  border-color: var(--primary);
}

.category-done-btn {
  background: var(--surface-hover);
  color: var(--text-secondary);
  border-color: var(--border);
}

.category-done-btn.has-changes {
  background: #2d6bcf;
  color: #fff;
  border-color: #2d6bcf;
}

.category-done-btn:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.category-done-btn.has-changes:hover {
  background: #2d6bcf;
  color: #fff;
}

.btn-category-mode:hover {
  color: inherit;
}

.btn-category-mode.active:hover {
  background: var(--primary);
  color: #fff;
}

/* === Card Category Text (non-mosaic only, hidden via .podcast-card-text) === */
.podcast-card-category {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Library Toolbar Row === */
.library-toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.btn-add {
  flex-shrink: 0;
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

.btn-add:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* === Library Toolbar (Category Filters) === */
.library-toolbar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}

.library-toolbar::-webkit-scrollbar {
  display: none;
}

.group-btn {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.group-btn:hover {
  color: var(--text);
  background: var(--surface-active);
}

.group-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.group-btn-fav {
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.group-btn-fav.active {
  color: #fff;
}

.group-btn-fav svg {
  display: block;
}

.group-btn.partial {
  background: var(--surface-active);
  border-color: var(--primary);
  color: var(--primary);
}

/* === Feed Header === */
.feed-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
}

.feed-header .section-title {
  margin-bottom: 0;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* === Feed Date Dividers === */
.feed-date-divider {
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  background: var(--primary);
  border-radius: 20px;
  margin: 12px 0 4px;
  display: inline-block;
}

.feed-date-divider:first-child {
  margin-top: 0;
}

.feed-load-more {
  display: block;
  width: 100%;
  margin-top: 12px;
  text-align: center;
}

/* === Episodes === */
.episode-list {
  display: flex;
  flex-direction: column;
}

.episode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.episode-row:last-child {
  border-bottom: none;
}

.episode-play {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  transition: background 0.15s;
}

.episode-play:hover {
  background: var(--primary-hover);
}

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

.episode-title {
  font-size: 1rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-meta {
  font-size: 0.85rem;
}

/* === Feed Episode Row === */
.feed-episode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.feed-episode-row:last-child {
  border-bottom: none;
}

.feed-episode-artwork {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #222;
  cursor: pointer;
}

/* Fallback for broken/missing artwork */
.artwork-fallback,
.podcast-card-artwork:not([src]) {
  visibility: hidden;
}

.feed-episode-podcast {
  font-size: 0.85rem;
}

.episode-desc {
  font-size: 0.8rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 2px 0;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-primary.btn-subscribed {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-primary.btn-subscribed:hover {
  background: var(--surface-active);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
}

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

.btn-danger {
  background: #c0392b;
  color: #fff;
  border: 1px solid #a93226;
}

.btn-danger:hover {
  background: #e74c3c;
}

.btn-danger-text {
  color: #e55;
}

.btn-danger-text:hover {
  color: #ff6b6b;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color 0.15s;
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  gap: 6px;
}

.btn-mosaic {
  flex-shrink: 0;
}

.btn-mosaic.active,
#mosaic-toggle.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* === Podcast Detail (Modal) === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 700px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
}

.btn-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.5rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

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

.podcast-header {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
}

.podcast-artwork-lg {
  width: 160px;
  height: 160px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-hover);
}

.podcast-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.podcast-info h1 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-bottom: 4px;
}

.podcast-info .text-secondary {
  margin-bottom: 12px;
}

.podcast-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.podcast-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === Settings Panel === */
.settings-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 139;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.settings-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 350px;
  z-index: 140;
  background: var(--bg);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0.25s;
  display: flex;
  flex-direction: column;
}

.settings-panel.open {
  transform: translateX(0);
  visibility: visible;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.settings-header h2 {
  font-size: 1.2rem;
}

.settings-header .btn-modal-close {
  position: static;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.settings-section {
  margin-bottom: 28px;
}

.settings-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

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

/* === Group Manager === */
.group-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  cursor: grab;
  user-select: none;
}

.group-item.dragging {
  opacity: 0.4;
}

.group-item.drag-over {
  border-top: 2px solid var(--primary);
}

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

.group-drag-handle {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  cursor: grab;
}

.group-item-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.btn-delete-group {
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  transition: color 0.15s, background 0.15s;
}

.btn-delete-group:hover {
  color: #e55;
  background: var(--surface-hover);
}

.group-add-form {
  display: flex;
  gap: 8px;
}

.group-add-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
}

.group-add-input:focus {
  border-color: var(--primary);
}

.group-add-input::placeholder {
  color: var(--text-secondary);
}

/* === Player Bar === */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--player-height);
  background: #1f1f1f;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.player-bar[hidden] {
  display: none;
}

.player-artwork {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--primary);
}

.player-artwork:not([src]),
.player-artwork[src=""] {
  visibility: hidden;
}

.player-artwork-wrap {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--primary);
  position: relative;
  overflow: hidden;
}

.player-artwork-wrap .player-artwork {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  visibility: visible;
}

.player-info {
  width: 180px;
  flex-shrink: 0;
  min-width: 0;
}

.player-title {
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-podcast {
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-play-ctrl,
.btn-pause-ctrl {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
}

.btn-play-ctrl {
  background: var(--primary);
  color: #fff;
}

.btn-play-ctrl:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.btn-pause-ctrl {
  background: var(--text);
  color: #000;
}

.btn-pause-ctrl:hover:not(:disabled) {
  transform: scale(1.05);
}

.btn-play-ctrl:disabled,
.btn-pause-ctrl:disabled {
  background: var(--surface-active);
  color: var(--text-secondary);
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.btn-speed {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 6px;
  border-radius: 4px;
  min-width: 32px;
  text-align: center;
  transition: color 0.15s, background 0.15s;
}

.btn-speed:hover {
  color: var(--text);
  background: var(--surface-active);
}

.player-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.player-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: center;
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* === Range Inputs === */
.seek-bar,
.volume-bar {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.seek-bar {
  flex: 1;
}

.volume-bar {
  width: 80px;
}

.seek-bar::-webkit-slider-thumb,
.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
}

.seek-bar::-moz-range-thumb,
.volume-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  border: none;
  cursor: pointer;
}

/* === Loading === */
.loading {
  display: flex;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

/* === Toast === */
.toast-container {
  position: fixed;
  bottom: calc(var(--player-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  white-space: nowrap;
  animation: fadeIn 0.2s ease;
}

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

/* === Episode Detail Modal === */
.modal-episode {
  width: 500px;
}

.episode-detail-header {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.episode-detail-artwork {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-hover);
}

.episode-detail-artwork:not([src]),
.episode-detail-artwork[src=""] {
  display: none;
}

.episode-detail-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.episode-detail-info h2 {
  font-size: 1.1rem;
  line-height: 1.3;
  margin-bottom: 4px;
}

.episode-detail-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 20px;
  white-space: pre-line;
}

/* === Archive Mode === */
.archive-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
}

.archive-mode {
  --primary: #9b3a3a;
  --primary-hover: #b34747;
}

/* === Utility === */
.text-secondary {
  color: var(--text-secondary);
}

.text-sm {
  font-size: 0.8rem;
  margin-top: 6px;
}
