:root {
  --bg: #0b0b0f;
  --bg-elev: #15161c;
  --bg-card: #1a1c23;
  --text: #f4f4f6;
  --muted: #9ba0ad;
  --accent: #e8a33d;
  --border: #272a33;
  --nav-h: 56px;
  --bar-h: 58px;
  --pad: 1.25rem;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; max-width: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans Arabic", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button, select, input { font-family: inherit; }

/* ---------- header (the only sticky element) ---------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 var(--pad);
  background: rgba(11, 11, 15, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  min-width: 0;
}

/* Desktop: links sit inline next to the logo. */
.main-nav {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  height: var(--nav-h);
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--accent); }

.nav-link.active::after {
  content: "";
  position: absolute;
  inset-inline: 0.7rem;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}

.nav-count {
  min-width: 1.2rem;
  padding: 0.02rem 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1206;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.nav-search {
  width: clamp(130px, 18vw, 220px);
  min-width: 0;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.86rem;
}

.nav-search::placeholder { color: var(--muted); }

.nav-search:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

.lang-toggle {
  flex: 0 0 auto;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
}

.lang-toggle:hover { border-color: var(--accent); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  height: 60vh;
  min-height: 340px;
  max-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

/* Blurred, over-scaled copy fills the frame so a low-res thumb never
   looks pixelated; the sharp copy sits on top, contained. */
.hero-blur,
.hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero-blur {
  filter: blur(28px) saturate(1.15);
  transform: scale(1.18);
}

.hero-img {
  background-size: contain;
  background-repeat: no-repeat;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to left, rgba(11,11,15,0.97) 0%, rgba(11,11,15,0.86) 34%, rgba(11,11,15,0.45) 62%, rgba(11,11,15,0.2) 100%),
    linear-gradient(to top, var(--bg) 0%, rgba(11,11,15,0.55) 32%, rgba(11,11,15,0) 70%);
}

html[dir="ltr"] .hero-scrim {
  background:
    linear-gradient(to right, rgba(11,11,15,0.97) 0%, rgba(11,11,15,0.86) 34%, rgba(11,11,15,0.45) 62%, rgba(11,11,15,0.2) 100%),
    linear-gradient(to top, var(--bg) 0%, rgba(11,11,15,0.55) 32%, rgba(11,11,15,0) 70%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 560px;
  padding: 0 var(--pad) 2rem;
}

.hero-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.hero-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  margin: 0 0 1rem;
  color: #cfd3dc;
  font-size: 0.85rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

.hero-play {
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #1a1206;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.hero-play:hover { background: #f2b355; }

/* ---------- filters: one compact, non-sticky row ---------- */

.toolbar {
  padding: 0.9rem var(--pad) 0.2rem;
}

.toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.pill {
  padding: 0.34rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  max-width: 100%;
}

.pill:focus { outline: none; border-color: var(--accent); }
.pill:hover { border-color: #3a3f4b; }

.pill-btn { color: var(--muted); background: transparent; }
.pill-btn:hover { color: var(--text); border-color: var(--accent); }

/* ---------- smart filter chips (type / region / era) ---------- */

.chip-filters {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.chip-group {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.chip-label {
  flex: 0 0 auto;
  width: 4.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Chips scroll sideways rather than wrapping into a tall block that pushes
   the rows off-screen. */
.chip-row {
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.24rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 0.76rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.chip:hover { color: var(--text); border-color: #3a3f4b; }

.chip-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1206;
  font-weight: 600;
}

.chip-count {
  font-size: 0.66rem;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

.chip-on .chip-count { opacity: 0.75; }

/* ---------- secondary options (length / sort) ---------- */

.more-options { position: relative; }

.more-options > summary {
  display: inline-block;
  list-style: none;
  user-select: none;
}

.more-options > summary::-webkit-details-marker { display: none; }
.more-options[open] > summary { color: var(--text); border-color: var(--accent); }

.more-panel {
  position: absolute;
  z-index: 20;
  inset-inline-start: 0;
  top: calc(100% + 0.35rem);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.more-panel .pill { width: 100%; }

.ai-notice {
  color: var(--muted);
  font-size: 0.74rem;
  margin-inline-start: auto;
}

/* ---------- layout ---------- */

main { padding: 0.75rem 0 3.5rem; }

.status {
  padding: 0 var(--pad);
  color: var(--muted);
  min-height: 1.2rem;
  font-size: 0.86rem;
}

.row-title {
  margin: 0 0 0.55rem;
  padding: 0 var(--pad);
  font-size: 1rem;
  font-weight: 700;
}

/* ---------- carousel rows ---------- */

.row {
  position: relative;
  margin-bottom: 1.6rem;
}

.row-scroller {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scroll-padding-inline-start: var(--pad);
  /* room for the hover lift so nothing is clipped */
  padding: 0.5rem var(--pad) 0.9rem;
  scrollbar-width: none;
}

.row-scroller::-webkit-scrollbar { display: none; }

/* Edge fades as overlays (not a mask) so hover-scaled cards never get cut. */
.row::before,
.row::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42px;
  pointer-events: none;
  z-index: 3;
}

.row::before {
  inset-inline-start: 0;
  background: linear-gradient(to var(--fade-start, right), var(--bg), rgba(11, 11, 15, 0));
}

.row::after {
  inset-inline-end: 0;
  background: linear-gradient(to var(--fade-end, left), var(--bg), rgba(11, 11, 15, 0));
}

html[dir="rtl"] .row::before { --fade-start: left; }
html[dir="rtl"] .row::after { --fade-end: right; }

.row-arrow {
  position: absolute;
  top: 44%;
  transform: translateY(-50%);
  z-index: 6;
  width: 34px;
  height: 56px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s;
}

.row:hover .row-arrow { opacity: 1; }
.row-arrow:hover { background: rgba(0, 0, 0, 0.85); }
.row-arrow.prev { inset-inline-start: 2px; }
.row-arrow.next { inset-inline-end: 2px; }

/* ---------- cards ---------- */

.card {
  flex: 0 0 auto;
  width: 212px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}

.thumb-wrap {
  position: relative;
  background: #000;
  line-height: 0;
}

.card img.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Episode number, so a series row reads in order at a glance. */
.episode-badge {
  position: absolute;
  top: 0.35rem;
  inset-inline-start: 0.35rem;
  background: var(--accent);
  color: #1a1206;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.08rem 0.4rem;
  border-radius: 5px;
}

.duration-badge {
  position: absolute;
  bottom: 0.35rem;
  inset-inline-end: 0.35rem;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.08rem 0.34rem;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

.card-body { padding: 0.55rem 0.6rem 0.65rem; }

.channel-tag {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-size: 0.64rem;
  font-weight: 600;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.card-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}

/* ---------- results grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.9rem;
  padding: 0 var(--pad);
}

.grid .card { width: auto; }

.load-more-wrap { text-align: center; margin-top: 1.75rem; }

.load-more {
  padding: 0.55rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
}

.load-more:hover { border-color: var(--accent); }

/* ---------- api key panel ---------- */

.key-panel {
  max-width: 600px;
  margin: 0 auto 1.25rem;
  padding: 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.key-panel h3 { margin: 0 0 0.45rem; font-size: 1rem; }

.key-panel p {
  margin: 0 0 0.9rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.key-row { display: flex; gap: 0.45rem; }

.key-row input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.key-row button {
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #1a1206;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- modal ---------- */

.hidden { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem 1.4rem;
}

.close-btn {
  position: absolute;
  top: 0.5rem;
  inset-inline-end: 0.75rem;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.player-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 1.5rem;
}

.player-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.player-title { margin: 0.9rem 0 0.3rem; font-size: 1.1rem; }

.player-desc {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* AI summary and tags in the player */

.player-summary {
  margin: 0 0 0.85rem;
  padding-inline-start: 0.7rem;
  border-inline-start: 2px solid var(--accent);
  color: #d8dbe3;
  font-size: 0.9rem;
  line-height: 1.6;
}

.player-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.player-tag {
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(232, 163, 61, 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.player-tag-soft {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-weight: 400;
}

#channelLink {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

#channelLink:hover { text-decoration: underline; }

/* ---------- my list: card button, player button ---------- */

.list-btn {
  position: absolute;
  top: 0.35rem;
  inset-inline-end: 0.35rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.68);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.list-btn:hover { border-color: var(--accent); }

.list-btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1206;
  font-weight: 700;
}

.player-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}

.list-pill {
  padding: 0.34rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.list-pill:hover { border-color: var(--accent); }
.list-pill.on { background: var(--accent); border-color: var(--accent); color: #1a1206; }

/* ---------- pages (series, topics, channels, my list) ---------- */

.page-head { padding: 0.4rem var(--pad) 1rem; }

.page-title {
  margin: 0.25rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

.page-sub { margin: 0; color: var(--muted); font-size: 0.88rem; }

.page-note {
  margin: 0;
  padding: 0 var(--pad) 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.back-link:hover { color: var(--accent); }
.back-arrow { font-size: 1.1rem; line-height: 1; }
html[dir="rtl"] .back-arrow { transform: scaleX(-1); }

.series-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.series-head {
  display: flex;
  align-items: flex-end;
  gap: 1.1rem;
  padding: 0 var(--pad) 1.4rem;
}

.series-cover {
  flex: 0 0 auto;
  width: 280px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  background: #000;
}

.series-info { min-width: 0; }
.series-info .page-title { margin-top: 0.5rem; }
.series-info .hero-play { margin-top: 0.9rem; }
.hero-play:disabled { opacity: 0.5; cursor: default; }

.big-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.9rem;
  padding: 0 var(--pad);
}

.big-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 170px;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--tint, var(--bg-card));
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.big-card:hover { transform: translateY(-3px); border-color: var(--accent); }

.big-card-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
}

.big-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(11, 11, 15, 0.92), rgba(11, 11, 15, 0.1) 75%);
}

.big-card-title { font-size: 1.3rem; font-weight: 700; line-height: 1.3; }
.big-card-sub { color: var(--accent); font-size: 0.85rem; font-weight: 600; }

/* ---------- moroccan films: external platforms ---------- */

.platforms { margin: 0.6rem 0 2rem; }
.platforms .page-sub { padding: 0 var(--pad); margin-bottom: 0.8rem; }

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  padding: 0 var(--pad);
}

.platform-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.platform-card:hover,
.platform-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); }

.platform-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.05rem;
  font-weight: 700;
}

.platform-arrow { color: var(--accent); font-size: 0.95rem; }
.platform-desc { color: var(--muted); font-size: 0.82rem; line-height: 1.5; }

/* ---------- narrow screens ---------- */

/* The nav moves to a bottom bar. backdrop-filter on the header would make it
   the containing block for a fixed child, so it is dropped here. */
@media (max-width: 900px) {
  .topnav { backdrop-filter: none; background: var(--bg); }
  body { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px)); }

  .main-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    height: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    gap: 0;
    background: var(--bg-elev);
    border-top: 1px solid var(--border);
  }

  .nav-link {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 0 0.2rem;
    font-size: 0.74rem;
  }

  /* Five tabs fit the bar comfortably; Channels stays in the desktop nav. */
  .nav-link[data-section="channels"] { display: none; }

  /* Top marker instead of an underline, since the bar sits at the bottom. */
  .nav-link.active::after { inset-inline: 22%; top: 0; bottom: auto; border-radius: 0 0 2px 2px; }
  .nav-count { font-size: 0.62rem; min-width: 1.05rem; }
  .list-btn { width: 32px; height: 32px; }
}

@media (max-width: 760px) {
  .series-head { flex-direction: column; align-items: stretch; }
  .series-cover { width: 100%; }
}

@media (max-width: 760px) {
  .hero { height: 52vh; min-height: 300px; }
  .hero-inner { max-width: 100%; }
}

@media (max-width: 480px) {
  :root { --pad: 0.85rem; }

  .brand { font-size: 1.05rem; }
  .nav-right { flex: 1; min-width: 0; justify-content: flex-end; }
  .nav-search { flex: 1; width: auto; min-width: 0; }
  .lang-toggle { padding: 0.35rem 0.6rem; font-size: 0.74rem; }

  /* Stack the hero instead of overlaying text, so nothing can be clipped. */
  .hero { display: block; height: auto; min-height: 0; max-height: none; }
  .hero-blur, .hero-scrim { display: none; }
  .hero-img {
    position: relative;
    inset: auto;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
  }
  .hero-inner {
    position: relative;
    max-width: 100%;
    padding: 0.75rem var(--pad) 0.5rem;
  }
  .hero-title {
    font-size: 1.02rem;
    text-shadow: none;
    -webkit-line-clamp: 3;
  }
  .hero-meta { font-size: 0.78rem; text-shadow: none; margin-bottom: 0.7rem; }
  .hero-play { padding: 0.5rem 1.1rem; font-size: 0.85rem; }

  /* Selects size to their longest option, which overflows a 375px screen;
     a 2-column grid keeps them inside the viewport. */
  .toolbar { padding-top: 0.7rem; }
  .toolbar-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }
  .pill {
    width: 100%;
    min-width: 0;
    font-size: 0.74rem;
    padding: 0.32rem 0.55rem;
  }

  /* Facet labels stack above their chips — 4.5rem of label plus a scroller
     leaves too little room for a chip to be readable at this width. */
  .chip-group { flex-direction: column; align-items: stretch; gap: 0.2rem; }
  .chip-label { width: auto; font-size: 0.66rem; }
  .chip { font-size: 0.72rem; padding: 0.22rem 0.55rem; }
  .ai-notice { grid-column: 1 / -1; margin-inline-start: 0; }
  .more-panel { inset-inline-start: auto; inset-inline-end: 0; }

  .card { width: 150px; }
  .card-title { font-size: 0.76rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }

  .row::before, .row::after { width: 18px; }
  .row-arrow { display: none; }
}
