/* ============================================================
   KAYLA'S HUB — Mobile-first curated content
   Design: Warm desert reading nook aesthetic
   Target: iPhone 15 Pro Max (430x932 @3x)
   ============================================================ */

:root {
  /* Warm parchment palette */
  --bg-base: #f4ede4;
  --bg-card: #fffcf7;
  --bg-card-hover: #fff9f0;
  --bg-surface: #ebe3d8;
  --bg-modal: rgba(44, 24, 16, 0.6);

  /* Text */
  --text-primary: #2c1810;
  --text-secondary: #6b5847;
  --text-muted: #9e8e7e;
  --text-inverse: #f4ede4;

  /* Accents */
  --terracotta: #c45d3e;
  --terracotta-soft: #d4795f;
  --terracotta-bg: #fdf0ec;
  --sage: #5a8a62;
  --sage-soft: #7aaa82;
  --sage-bg: #edf5ee;
  --honey: #c49332;
  --honey-soft: #d4a84f;
  --honey-bg: #fdf6e8;
  --lavender: #8b7bb8;
  --lavender-soft: #a898cc;
  --lavender-bg: #f3f0fa;
  --sky: #5a8fa8;
  --sky-soft: #7aafca;
  --sky-bg: #ecf4f8;
  --blush: #c48a90;
  --blush-soft: #d4a0a6;
  --blush-bg: #faf0f1;
  --coral: #d4735a;
  --coral-bg: #fdf2ee;

  /* Category colors */
  --cat-good-news: var(--honey);
  --cat-good-news-bg: var(--honey-bg);
  --cat-resistance: var(--terracotta);
  --cat-resistance-bg: var(--terracotta-bg);
  --cat-local: var(--sky);
  --cat-local-bg: var(--sky-bg);
  --cat-health: var(--sage);
  --cat-health-bg: var(--sage-bg);
  --cat-body: var(--blush);
  --cat-body-bg: var(--blush-bg);
  --cat-creatures: var(--honey);
  --cat-creatures-bg: var(--honey-bg);
  --cat-music: var(--lavender);
  --cat-music-bg: var(--lavender-bg);

  /* Dimensions */
  --header-height: 140px;
  --bottom-nav-height: 80px;
  --card-radius: 16px;
  --btn-radius: 12px;
  --pill-radius: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(44, 24, 16, 0.06);
  --shadow-md: 0 4px 12px rgba(44, 24, 16, 0.08);
  --shadow-lg: 0 8px 24px rgba(44, 24, 16, 0.12);
  --shadow-card: 0 2px 8px rgba(44, 24, 16, 0.06), 0 0 0 1px rgba(44, 24, 16, 0.03);

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Fonts */
  --font-display: 'Young Serif', Georgia, serif;
  --font-body: 'Lexend', -apple-system, sans-serif;
  --font-accent: 'Permanent Marker', cursive;

  /* Safe areas for notch/dynamic island */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-height) + var(--sab));
  /* Subtle warm texture */
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(196, 147, 50, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(196, 93, 62, 0.04) 0%, transparent 60%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
textarea { font-family: inherit; resize: none; }

/* ---- Pull to Refresh ---- */
.pull-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 200;
  transform: translateY(-100%);
  transition: transform 0.3s var(--ease-out);
}

.pull-indicator.visible {
  transform: translateY(var(--sat));
}

.pull-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--bg-surface);
  border-top-color: var(--terracotta);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---- Header ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 237, 228, 0.92);
  padding-top: var(--sat);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: visible;
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(44, 24, 16, 0.08), transparent);
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px 8px;
}

.greeting h1 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.date {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.icon-btn:active {
  background: var(--bg-surface);
  transform: scale(0.92);
}

.badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--terracotta);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: badgePop 0.3s var(--ease-bounce);
}

@keyframes badgePop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* ---- Category Tabs ---- */
.category-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 12px 20px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  max-width: 100vw;
}

.category-tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--pill-radius);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid rgba(44, 24, 16, 0.06);
  transition: all 0.25s var(--ease-out);
  scroll-snap-align: start;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.tab .tab-icon {
  margin-right: 4px;
  font-size: 0.9rem;
}

.tab:active {
  transform: scale(0.95);
}

.tab.active {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

/* Category-specific active tab colors */
.tab.active[data-category="good-news"] { background: var(--cat-good-news); border-color: var(--cat-good-news); }
.tab.active[data-category="resistance"] { background: var(--cat-resistance); border-color: var(--cat-resistance); }
.tab.active[data-category="local"] { background: var(--cat-local); border-color: var(--cat-local); }
.tab.active[data-category="health"] { background: var(--cat-health); border-color: var(--cat-health); }
.tab.active[data-category="body"] { background: var(--cat-body); border-color: var(--cat-body); }
.tab.active[data-category="creatures"] { background: var(--cat-creatures); border-color: var(--cat-creatures); }
.tab.active[data-category="music"] { background: var(--cat-music); border-color: var(--cat-music); }

/* ---- Now Playing (Spotify) ---- */
.now-playing {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 16px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #1a1512 0%, #2a2018 100%);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.2s var(--ease-out);
}

.now-playing:active {
  transform: scale(0.98);
}

.np-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

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

.np-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1DB954;
  margin-bottom: 2px;
}

.np-track {
  font-size: 0.85rem;
  font-weight: 500;
  color: #f0e8df;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  font-size: 0.75rem;
  color: #9e8e7e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
  flex-shrink: 0;
}

.np-bars span {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: #1DB954;
  animation: eqBar 0.8s ease-in-out infinite alternate;
}

.np-bars span:nth-child(1) { height: 8px; animation-delay: 0s; }
.np-bars span:nth-child(2) { height: 14px; animation-delay: 0.2s; }
.np-bars span:nth-child(3) { height: 10px; animation-delay: 0.4s; }
.np-bars span:nth-child(4) { height: 16px; animation-delay: 0.1s; }

@keyframes eqBar {
  0% { height: 4px; }
  100% { height: 18px; }
}

/* ---- Main Feed ---- */
.feed {
  padding: 8px 16px 24px;
}

/* ---- Article Card ---- */
.article-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  overflow: hidden;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease;
  animation: cardEnter 0.4s var(--ease-out) backwards;
}

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
}

.article-card:active {
  transform: scale(0.985);
}

.card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--bg-surface);
}

.card-image-placeholder {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: var(--bg-surface);
}

/* Category color strip on cards */
.card-body {
  padding: 16px;
  position: relative;
}

.card-category-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.card-category-dot.good-news { background: var(--cat-good-news); }
.card-category-dot.resistance { background: var(--cat-resistance); }
.card-category-dot.local { background: var(--cat-local); }
.card-category-dot.health { background: var(--cat-health); }
.card-category-dot.body { background: var(--cat-body); }
.card-category-dot.creatures { background: var(--cat-creatures); }
.card-category-dot.music { background: var(--cat-music); }

.card-source {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}

.card-source .time-ago {
  margin-left: auto;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-description {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-secondary);
  font-weight: 300;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px 14px;
  border-top: 1px solid rgba(44, 24, 16, 0.04);
}

.card-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--btn-radius);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.card-action-btn:active {
  transform: scale(0.94);
}

.card-action-btn.share-btn:hover,
.card-action-btn.share-btn:active {
  background: var(--terracotta-bg);
  color: var(--terracotta);
}

.card-action-btn.bookmark-btn:hover,
.card-action-btn.bookmark-btn:active {
  background: var(--honey-bg);
  color: var(--honey);
}

.card-action-btn.bookmark-btn.saved {
  background: var(--honey-bg);
  color: var(--honey);
}

.card-action-btn.open-btn {
  margin-left: auto;
  color: var(--text-secondary);
}

.card-action-btn.open-btn:hover,
.card-action-btn.open-btn:active {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.card-action-btn svg {
  width: 16px;
  height: 16px;
}

/* ---- Shared article card (from Alex) ---- */
.shared-card {
  position: relative;
}

.shared-card .shared-note {
  padding: 12px 16px;
  background: var(--coral-bg);
  border-left: 3px solid var(--coral);
  margin: 0 16px 8px;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

.shared-card .shared-note::before {
  content: attr(data-from) ' says: ';
  font-style: normal;
  font-weight: 600;
  color: var(--coral);
}

.shared-card .shared-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0 16px 12px;
}

.mark-read-btn {
  padding: 6px 12px;
  border-radius: var(--pill-radius);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--sage-bg);
  color: var(--sage);
  margin-left: auto;
  transition: all 0.2s ease;
}

.mark-read-btn:active {
  transform: scale(0.95);
  background: var(--sage);
  color: white;
}

/* ---- Skeleton Loading ---- */
.skeleton-container { padding: 0; }

.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  overflow: hidden;
}

.skeleton-text {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(90deg, var(--bg-surface) 25%, #e8dfd4 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-title {
  height: 20px;
  margin: 16px 16px 8px;
  width: 75%;
}

.skeleton-desc {
  height: 14px;
  margin: 0 16px 8px;
  width: 90%;
}

.skeleton-meta {
  height: 12px;
  margin: 0 16px 16px;
  width: 40%;
}

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

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 32px;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  animation: gentleBob 3s ease-in-out infinite;
}

@keyframes gentleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* ---- Load More ---- */
.load-more-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: var(--btn-radius);
  background: var(--bg-card);
  border: 1px solid rgba(44, 24, 16, 0.08);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.load-more-btn:active {
  background: var(--bg-surface);
  transform: scale(0.98);
}

/* ---- Shared View ---- */
.shared-view,
.saved-view {
  padding: 8px 16px 24px;
}

.shared-header,
.saved-header {
  padding: 0 4px 16px;
}

.shared-header h2,
.saved-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
}

.shared-subtitle,
.saved-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 300;
  margin-top: 2px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--sab) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  border-radius: var(--pill-radius);
  background: var(--text-primary);
  color: var(--text-inverse);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  opacity: 0;
  transition: all 0.35s var(--ease-out);
  pointer-events: none;
}

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

/* ---- Share Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + var(--sab));
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } }

.modal {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.3s var(--ease-out);
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.modal-article-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.modal textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(44, 24, 16, 0.12);
  border-radius: 12px;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 16px;
  transition: border-color 0.2s ease;
}

.modal textarea:focus {
  outline: none;
  border-color: var(--terracotta-soft);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.btn-secondary {
  flex: 1;
  padding: 14px;
  border-radius: var(--btn-radius);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  flex: 1;
  padding: 14px;
  border-radius: var(--btn-radius);
  background: var(--terracotta);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(196, 93, 62, 0.3);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(196, 93, 62, 0.2);
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + var(--sab));
  padding-bottom: var(--sab);
  background: var(--bg-card);
  border-top: 1px solid rgba(44, 24, 16, 0.06);
  display: flex;
  align-items: stretch;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(44, 24, 16, 0.04);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  position: relative;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s var(--ease-bounce);
}

.nav-item:active svg {
  transform: scale(0.85);
}

.nav-item.active {
  color: var(--terracotta);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--terracotta);
  border-radius: 0 0 2px 2px;
}

/* ---- TV Shows / Episodes ---- */
.tv-view {
  padding: 8px 16px 24px;
}

.tv-header {
  padding: 0 4px 12px;
}

.tv-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
}

.tv-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 300;
  margin-top: 2px;
}

/* Show search */
.show-search {
  margin-bottom: 20px;
  position: relative;
}

.search-input-wrap {
  position: relative;
}

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

.show-search input {
  width: 100%;
  padding: 14px 16px 14px 42px;
  border: 1px solid rgba(44, 24, 16, 0.1);
  border-radius: var(--card-radius);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.show-search input:focus {
  outline: none;
  border-color: var(--terracotta-soft);
  box-shadow: 0 0 0 3px rgba(196, 93, 62, 0.1);
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid rgba(44, 24, 16, 0.08);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(44, 24, 16, 0.04);
  transition: background 0.15s ease;
  cursor: pointer;
}

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

.search-result-item:active {
  background: var(--bg-surface);
}

.search-result-img {
  width: 44px;
  height: 62px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-surface);
}

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

.search-result-name {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.search-result-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-result-add {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sage-bg);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.search-result-add:active {
  background: var(--sage);
  color: white;
  transform: scale(0.9);
}

/* Episode sections */
.episode-section {
  margin-bottom: 24px;
}

.episode-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding: 0 4px;
}

/* Episode card */
.episode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
  animation: cardEnter 0.3s var(--ease-out) backwards;
}

.episode-card-art {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-surface);
}

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

.episode-card-show {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

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

.episode-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.episode-card-date {
  flex-shrink: 0;
  text-align: right;
}

.episode-date-day {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.episode-date-month {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.episode-card-today .episode-date-day {
  color: var(--terracotta);
}

.episode-card-tomorrow .episode-date-day {
  color: var(--sage);
}

/* Tracked shows grid */
.tracked-shows-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tracked-show-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 2/3;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.tracked-show-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tracked-show-card .show-name-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 8px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  font-size: 0.72rem;
  font-weight: 500;
  color: white;
  line-height: 1.3;
}

.tracked-show-card .show-network {
  font-size: 0.6rem;
  opacity: 0.7;
  margin-top: 2px;
}

.tracked-show-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tracked-show-card:active .tracked-show-remove {
  opacity: 1;
}

/* ---- Responsive: Tablet+ ---- */
@media (min-width: 768px) {
  body {
    max-width: 600px;
    margin: 0 auto;
  }

  .bottom-nav {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
    border-left: 1px solid rgba(44, 24, 16, 0.06);
    border-right: 1px solid rgba(44, 24, 16, 0.06);
  }

  .header {
    max-width: 600px;
    margin: 0 auto;
    left: 0;
    right: 0;
  }
}

/* ---- Responsive: Desktop ---- */
@media (min-width: 1024px) {
  body {
    max-width: 480px;
  }

  .bottom-nav {
    max-width: 480px;
  }

  .card-image {
    height: 220px;
  }
}

/* ---- Dark mode ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-base: #1a1512;
    --bg-card: #241e19;
    --bg-card-hover: #2e261f;
    --bg-surface: #302820;
    --bg-modal: rgba(0, 0, 0, 0.7);

    --text-primary: #f0e8df;
    --text-secondary: #b0a393;
    --text-muted: #7a6e62;
    --text-inverse: #1a1512;

    --terracotta: #e07a5f;
    --terracotta-soft: #d4795f;
    --terracotta-bg: rgba(224, 122, 95, 0.12);
    --sage: #81b29a;
    --sage-soft: #7aaa82;
    --sage-bg: rgba(129, 178, 154, 0.12);
    --honey: #d4a04a;
    --honey-soft: #d4a84f;
    --honey-bg: rgba(212, 160, 74, 0.12);
    --lavender: #a898cc;
    --lavender-soft: #a898cc;
    --lavender-bg: rgba(168, 152, 204, 0.12);
    --sky: #7aafca;
    --sky-soft: #7aafca;
    --sky-bg: rgba(122, 175, 202, 0.12);
    --blush: #d4a0a6;
    --blush-soft: #d4a0a6;
    --blush-bg: rgba(212, 160, 166, 0.12);
    --coral: #e8856e;
    --coral-bg: rgba(232, 133, 110, 0.1);

    --cat-good-news: var(--honey);
    --cat-resistance: var(--terracotta);
    --cat-local: var(--sky);
    --cat-health: var(--sage);
    --cat-body: var(--blush);
    --cat-creatures: var(--honey);
    --cat-music: var(--lavender);

    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
  }

  meta[name="theme-color"] { content: #1a1512; }
}

/* ---- Haptic feedback simulation (visual) ---- */
@keyframes tapPulse {
  0% { box-shadow: 0 0 0 0 rgba(196, 93, 62, 0.3); }
  100% { box-shadow: 0 0 0 12px rgba(196, 93, 62, 0); }
}

/* ---- Accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard users */
:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

/* ---- Utility ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
