.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.chip-row {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-5);
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.chip:hover { color: var(--color-ink); }
.chip.active {
  background: var(--gradient-signal);
  color: white;
  border-color: transparent;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
}

/* .video-card is an <a> (linking to /watch/{publicId}) — grid items are
   blockified automatically, but display/text-decoration/color are reset
   explicitly so it doesn't inherit default anchor styling or break if ever
   reused outside a grid (e.g. a Phase 3b "recommended videos" list). */
.video-card { padding: 0; overflow: hidden; display: block; text-decoration: none; color: inherit; }
.video-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(124,92,252,0.25), rgba(33,209,159,0.15));
  position: relative;
}
.video-duration {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}
.video-meta { padding: var(--space-4); }
.video-meta h4 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-channel {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-faint);
}
.video-stats { display: flex; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-faint); font-family: var(--font-mono); }

.profile-header {
  display: flex;
  align-items: flex-end;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.profile-banner {
  height: 200px;
  border-radius: var(--radius-lg);
  background: var(--gradient-ambient), var(--color-surface);
  margin-bottom: -56px;
  border: 1px solid var(--color-border);
}

.profile-stats {
  display: flex;
  gap: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* ---------------------------------------------------------------------
   Phase 5 frontend: /search results page (app/search.php). Reuses
   .video-grid/.video-card/etc. from above as-is for video results;
   .creator-grid/.creator-card are new, following the same card/grid shape.
--------------------------------------------------------------------- */
.search-section-title {
  font-size: var(--text-md);
  margin-bottom: var(--space-4);
}

.creator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.creator-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
}

.creator-card-meta { min-width: 0; }

.creator-card-name {
  font-weight: 600;
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creator-card-handle {
  color: var(--color-faint);
  font-size: var(--text-xs);
}

.creator-card-subs {
  color: var(--color-faint);
  font-size: var(--text-xs);
  margin-top: 2px;
}

/* Phase 5 infinite scroll: the "load more" sentinel shared by every
   infinite-scrolled video-grid (pages/search.js, pages/home.js — see each
   for its own feed's pagination shape). Hidden by default in markup; JS
   toggles the [hidden] attribute to show this as a loading spinner while a
   page fetch is in flight, matching this app's global [hidden]-wins CSS
   rule (see base.css) rather than a display:none/flex toggle of its own. */
.feed-load-sentinel {
  display: flex;
  justify-content: center;
  padding: var(--space-6) 0;
}
