/* ===== AIRBNB-INSPIRED DESIGN SYSTEM — Primary: #A6AD80 ===== */

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

:root {
  /* Primary palette */
  --primary: #A6AD80;
  --primary-dark: #8B9468;
  --primary-light: #C5CBA8;
  --primary-bg: #F4F5EF;
  --primary-subtle: #ECEEE4;

  /* Neutrals (Airbnb-style) */
  --bg: #FFFFFF;
  --bg-secondary: #F7F7F7;
  --surface: #FFFFFF;
  --text: #222222;
  --text-secondary: #717171;
  --text-tertiary: #B0B0B0;
  --border: #DDDDDD;
  --border-light: #EBEBEB;
  --divider: #F0F0F0;

  /* Semantic */
  --danger: #E53E3E;
  --danger-light: #FFF5F5;
  --success: #38A169;
  --warning: #D69E2E;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 6px 20px rgba(0,0,0,0.12);
  --shadow-xl: 0 12px 28px rgba(0,0,0,0.12), 0 8px 10px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);

  /* Radius (Airbnb uses generous rounding) */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Layout */
  --player-height: 80px;
  --header-height: 80px;
  --max-width: 1120px;

  /* Transitions */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --duration: 0.25s;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ===== TYPOGRAPHY (Airbnb-style hierarchy) ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* ===== BUTTONS ===== */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
  line-height: 1.4;
}
button:hover, .btn:hover {
  background: var(--bg-secondary);
  border-color: var(--text);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: scale(1.02);
}
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #C53030; border-color: #C53030; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn-icon {
  padding: 8px;
  border: none;
  background: transparent;
  font-size: 20px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
}
.btn-icon:hover { background: var(--bg-secondary); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--text);
  font-weight: 600;
}
.btn-outline:hover {
  background: var(--text);
  color: #fff;
}

/* ===== INPUTS ===== */
input, textarea, select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  line-height: 1.4;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 2px rgba(34,34,34,0.1);
}
input::placeholder, textarea::placeholder {
  color: var(--text-tertiary);
}
textarea { resize: vertical; min-height: 120px; }

/* ===== HEADER (Airbnb-style sticky nav) ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  z-index: 100;
  transition: box-shadow var(--duration) var(--ease);
}
.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}
.site-header .logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-header .logo .logo-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.site-header nav {
  display: flex;
  gap: 2px;
  align-items: center;
}
.site-header nav a, .site-header nav button {
  padding: 10px 14px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  background: none;
  transition: all var(--duration) var(--ease);
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-header nav a:hover, .site-header nav button:hover {
  background: var(--bg-secondary);
  color: var(--text);
  text-decoration: none;
}
.site-header nav a.active {
  color: var(--text);
  font-weight: 600;
  background: var(--primary-bg);
}
.site-header nav .nav-icon {
  font-size: 20px;
  line-height: 1;
}
.site-header .user-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: box-shadow var(--duration) var(--ease);
}
.site-header .user-menu:hover {
  box-shadow: var(--shadow-md);
}
.site-header .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

/* ===== MAIN CONTENT ===== */
#main {
  margin-top: var(--header-height);
  padding: var(--space-xl) var(--space-lg);
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  min-height: calc(100vh - var(--header-height));
}
body.player-active #main { padding-bottom: calc(var(--player-height) + var(--space-xl)); }

/* ===== SECTION TITLES (Airbnb bold headings) ===== */
.section-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.04em;
  color: var(--text);
}
.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  font-weight: 400;
  line-height: 1.5;
}

/* ===== CARDS (Airbnb listing-style) ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  margin-bottom: var(--space-lg);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.card-clickable { cursor: pointer; }
.card-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Podcast/episode covers: 1:1 square */
.card-image.card-image-square {
  aspect-ratio: 1/1;
}
.card-image .card-image-placeholder {
  font-size: 48px;
  opacity: 0.5;
}
.card-image .card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--surface);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.card-body {
  padding: var(--space-md);
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
  line-height: 1.3;
}
.card-meta {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.4;
}
.card-description {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card grid (Airbnb listing grid) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}
.card-grid .card {
  margin-bottom: 0;
}

/* Card list (stacked) */
.card-list .card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--border-light);
}
.card-list .card:hover {
  border-color: var(--border);
}
.card-list .card-image {
  width: 120px;
  min-width: 120px;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
}

/* ===== PODCAST & EPISODE LIST ===== */
.episode-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}
.episode-item:last-child { border-bottom: none; }
.episode-item:hover {
  background: var(--bg-secondary);
  margin: 0 calc(-1 * var(--space-md));
  padding: var(--space-md);
  border-radius: var(--radius);
}
.episode-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease);
}
.episode-play-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.08);
}
.episode-info { flex: 1; min-width: 0; }
.episode-info h4 {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.episode-info p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.episode-duration {
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
  font-weight: 500;
}
.episode-progress-bar {
  width: 60px;
  height: 4px;
  background: var(--divider);
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}
.episode-progress-bar .fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* ===== PLAYER BAR (Airbnb-style bottom bar) ===== */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-height);
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  gap: var(--space-lg);
  z-index: 200;
}
.player-info {
  flex: 1;
  min-width: 0;
}
.player-info .title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.player-info .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}
.player-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.player-controls button {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-controls button:hover {
  background: var(--bg-secondary);
}
.player-controls .play-pause {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.player-controls .play-pause:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}
.player-progress {
  flex: 2;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.player-progress .time {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 42px;
  text-align: center;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--divider);
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  transition: height 0.15s;
}
.progress-bar:hover { height: 6px; }
.progress-bar .fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  position: relative;
}
.progress-bar .fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s;
}
.progress-bar:hover .fill::after { opacity: 1; }
.player-speed {
  font-size: 13px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  background: none;
  color: var(--text-secondary);
  font-weight: 600;
}
.player-speed:hover {
  border-color: var(--text);
  color: var(--text);
}
.player-volume {
  display: flex;
  align-items: center;
  gap: 4px;
}
.player-volume input[type="range"] {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  background: var(--divider);
  border-radius: var(--radius-full);
  border: none;
  padding: 0;
}
.player-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

/* ===== ARTICLE ===== */
.article-content {
  line-height: 1.8;
  font-size: 17px;
  color: var(--text);
  /* Override md-preview scrollable box when used for article display */
  max-height: none;
  overflow-y: visible;
  border: none;
  padding: 0;
  min-height: auto;
}
.article-content h2 {
  margin: 32px 0 16px;
  font-size: 24px;
  font-weight: 700;
}
.article-content p { margin-bottom: 20px; }
.article-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 16px 0;
}
.article-actions {
  display: flex;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  align-items: center;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}
.favorite-btn {
  font-size: 24px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
  border-radius: 50%;
  transition: transform var(--duration) var(--ease);
}
.favorite-btn:hover { transform: scale(1.2); }
.favorite-btn.active { color: #E53E3E; }

/* ===== COMMENTS ===== */
.comment {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--divider);
}
.comment:last-child { border-bottom: none; }
.comment-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 6px;
}
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.comment-username { font-weight: 600; font-size: 14px; }
.comment-time { font-size: 13px; color: var(--text-secondary); }
.comment-body {
  font-size: 15px;
  margin-left: 44px;
  line-height: 1.5;
  color: var(--text);
}
.comment-actions { margin-left: 44px; margin-top: 6px; }
.comment-actions button {
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}
.comment-actions button:hover {
  background: var(--bg-secondary);
  color: var(--text);
}
.comment-replies { margin-left: 44px; }
.comment-form { margin: var(--space-lg) 0; }
.comment-form textarea {
  min-height: 80px;
  margin-bottom: var(--space-sm);
  border-radius: var(--radius);
}

/* Comment sort bar */
.comments-sort-bar {
  display: flex;
  gap: 6px;
  margin-bottom: var(--space-md);
}
.comments-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.comments-sort-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}
.comments-sort-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Comment like button */
.comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}
.comment-like-btn:hover {
  background: var(--bg-secondary);
  color: var(--primary-dark);
}
.comment-like-btn.active {
  color: var(--primary-dark);
}
.comment-like-display {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 4px 8px;
}

/* Login to comment prompt */
.comment-login-prompt {
  margin: var(--space-lg) 0;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius);
  text-align: center;
}

/* Episode comments section */
.episode-item-wrap {
  border-bottom: 1px solid var(--divider);
}
.episode-item-wrap:last-child { border-bottom: none; }
.episode-item-wrap .episode-item { border-bottom: none; }
.episode-comments-section {
  background: var(--bg-secondary);
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: var(--space-sm);
}
.episode-comment-toggle {
  flex-shrink: 0;
  color: var(--text-secondary);
}
.episode-comment-toggle:hover {
  color: var(--primary-dark);
}

/* ===== PLAYLIST ===== */
.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-md);
}
.playlist-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-lg);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}
.playlist-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.playlist-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}
.playlist-card:hover::before { opacity: 1; }
.playlist-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}
.playlist-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ===== AUTH ===== */
.auth-container {
  max-width: 440px;
  margin: var(--space-3xl) auto;
  padding: var(--space-xl);
}
.auth-container h2 {
  text-align: center;
  margin-bottom: var(--space-xl);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.form-group { margin-bottom: var(--space-md); }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-error {
  color: var(--danger);
  font-size: 14px;
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--danger-light);
  border-radius: var(--radius-sm);
}
.auth-switch {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 15px;
  color: var(--text-secondary);
}
.auth-switch a {
  color: var(--primary-dark);
  font-weight: 600;
  text-decoration: underline;
}
.auth-switch a:hover { color: var(--primary); }

/* ===== ADMIN ===== */
.admin-layout {
  max-width: 1080px;
  margin: 0 auto;
}
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--divider);
  padding-bottom: 0;
  overflow-x: auto;
}
.admin-tabs button {
  padding: 12px 18px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all var(--duration) var(--ease);
  border-radius: 0;
}
.admin-tabs button:hover {
  color: var(--text);
  background: none;
}
.admin-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--primary);
  font-weight: 700;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--duration) var(--ease);
}
.stat-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.stat-card .number {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.04em;
}
.stat-card .label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-top: 4px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--divider);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 700;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--bg-secondary); }

.admin-form {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.admin-form h3 {
  margin-bottom: var(--space-md);
  font-size: 18px;
  font-weight: 700;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* ===== TAGS ===== */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-bg);
  border: none;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-secondary);
}
.empty-state .icon {
  font-size: 56px;
  margin-bottom: var(--space-md);
  opacity: 0.6;
}
.empty-state p {
  font-size: 16px;
  font-weight: 500;
}

/* ===== LOADING ===== */
.loading {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-secondary);
  font-size: 15px;
}
.loading::after {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  margin: var(--space-md) auto 0;
  border: 3px solid var(--divider);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: var(--shadow-xl);
  animation: toastIn 0.3s var(--ease), toastOut 0.3s var(--ease) 2.7s;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(20px); } }

/* ===== DIVIDER ===== */
.divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: var(--space-lg) 0;
}

/* ===== BACK LINK ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  padding: 6px 0;
  transition: color var(--duration) var(--ease);
}
.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

/* ===== PODCAST COVER PLACEHOLDER ===== */
.cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 40px;
}
.cover-placeholder-sm {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

/* ===== UPLOAD DROP ZONE ===== */
.upload-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, background 0.2s;
}
.upload-drop-zone:hover {
  border-color: var(--primary);
  background: rgba(166,173,128,0.03);
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }
  #main { padding: var(--space-md); }
  .site-header { padding: 0 var(--space-md); }
  .site-header .logo { font-size: 18px; }
  .site-header nav a span.nav-label,
  .site-header nav button span.nav-label { display: none; }
  .site-header nav a, .site-header nav button {
    padding: 8px;
  }
  .player-bar { padding: 0 var(--space-md); gap: var(--space-sm); }
  .player-progress { display: none; }
  .player-volume { display: none; }
  .player-bar { height: 68px; }
  .form-row { grid-template-columns: 1fr; }
  .admin-table { font-size: 13px; }
  .admin-table th, .admin-table td { padding: 8px 10px; }
  .card-grid { grid-template-columns: 1fr; }
  .playlist-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 26px; }
  .auth-container { padding: var(--space-md); margin-top: var(--space-xl); }
}

@media (max-width: 480px) {
  .site-header nav { gap: 0; }
  .player-controls button { font-size: 18px; width: 32px; height: 32px; }
  .player-controls .play-pause { width: 38px; height: 38px; font-size: 16px; }
}

/* Markdown editor */
.md-toggle { display:flex; gap:2px; background:var(--bg-secondary); border-radius:var(--radius-sm); padding:2px; }
.md-tab-btn { font-size:12px!important; padding:4px 10px!important; border-radius:4px!important; background:transparent!important; color:var(--text-secondary)!important; border:none!important; display:flex; align-items:center; gap:4px; }
.md-tab-btn.active { background:#fff!important; color:var(--text-primary)!important; box-shadow:0 1px 2px rgba(0,0,0,0.08); }
.md-preview { min-height:200px; max-height:500px; overflow-y:auto; padding:16px 20px; border:1px solid var(--border); border-radius:var(--radius-sm); background:#fff; font-size:15px; line-height:1.7; }
.md-preview h1,.md-preview h2,.md-preview h3 { margin:16px 0 8px; font-weight:700; }
.md-preview h1 { font-size:24px; } .md-preview h2 { font-size:20px; } .md-preview h3 { font-size:17px; }
.md-preview p { margin:0 0 12px; }
.md-preview ul,.md-preview ol { margin:0 0 12px; padding-left:24px; }
.md-preview blockquote { margin:0 0 12px; padding:8px 16px; border-left:3px solid var(--primary); background:var(--bg-secondary); border-radius:0 var(--radius-sm) var(--radius-sm) 0; }
.md-preview code { background:var(--bg-secondary); padding:2px 6px; border-radius:3px; font-size:13px; }
.md-preview pre { background:var(--bg-secondary); padding:12px 16px; border-radius:var(--radius-sm); overflow-x:auto; margin:0 0 12px; }
.md-preview pre code { background:none; padding:0; }
.md-preview img { max-width:100%; border-radius:var(--radius-sm); }
.md-preview a { color:var(--primary-dark); text-decoration:underline; }

/* Image grid for uploaded images */
.image-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:12px; }
.image-card { border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; background:#fff; }
.image-card-thumb { width:100%; aspect-ratio:1; background-size:cover; background-position:center; background-color:var(--bg-secondary); }
.image-card-info { padding:8px 10px 4px; }
.image-card-actions { padding:4px 10px 8px; display:flex; gap:4px; }

/* Cover preview inline */
.input-with-preview { display:flex; align-items:center; gap:8px; }
.input-with-preview input { flex:1; }
.cover-preview-sm { width:40px; height:40px; border-radius:6px; overflow:hidden; flex-shrink:0; background:var(--bg-secondary); }
.cover-preview-sm img { width:100%; height:100%; object-fit:cover; }
/* Article cover preview: 16:9 */
.cover-preview-sm.cover-preview-wide { width:64px; height:36px; border-radius:4px; }

/* Tag selector (admin) */
.tag-selector { position:relative; }
.tag-selected-list { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; min-height:28px; align-items:center; }
.tag-dropdown-wrap { display:flex; gap:6px; margin-bottom:6px; }
.tag-dropdown { position:relative; background:#fff; border:1px solid var(--border); border-radius:var(--radius-sm); max-height:200px; overflow-y:auto; padding:4px 0; box-shadow:0 4px 12px rgba(0,0,0,0.08); z-index:10; }
.tag-option { display:flex; align-items:center; gap:8px; padding:7px 14px; cursor:pointer; font-size:13px; transition:background 0.15s; }
.tag-option:hover { background:var(--bg-secondary); }
.tag-option input[type="checkbox"] { accent-color:var(--primary); width:15px; height:15px; cursor:pointer; }
.tag-add-input { display:flex; gap:6px; align-items:center; margin-top:6px; }
.tag-removable { display:inline-flex; align-items:center; gap:4px; cursor:default; }
.tag-remove { cursor:pointer; font-size:15px; line-height:1; opacity:0.6; font-weight:700; }
.tag-remove:hover { opacity:1; color:var(--danger); }

/* Tag filter bar (articles page) */
.tag-filter-bar { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:var(--space-lg); padding-bottom:var(--space-md); }
.tag-filter-btn { padding:6px 16px; border-radius:20px; border:1px solid var(--border); background:#fff; font-size:13px; font-weight:500; cursor:pointer; transition:all 0.2s; color:var(--text-secondary); }
.tag-filter-btn:hover { border-color:var(--primary); color:var(--text-primary); }
.tag-filter-btn.active { background:var(--primary); color:#fff; border-color:var(--primary); }

/* ===== EPISODE UPLOAD ZONES ===== */
.ep-upload-zone {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ep-drop-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: var(--text-secondary);
}
.ep-drop-area:hover {
  border-color: var(--primary);
  background: rgba(166,173,128,0.05);
}
.ep-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  min-height: 44px;
}
.ep-multi-form {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-md);
  background: var(--bg-secondary);
}
@keyframes ep-spin { to { transform: rotate(360deg); } }
.ep-spin { animation: ep-spin 1s linear infinite; }