/* =====================================================================
   Alkafeel+ — components, style v2 ("official", close to alkafeel.tv).
   No ornaments: no stars, arches, patterns, blobs or arc rings.
   Motion: transform / opacity only. Uses tokens.css only (no raw colors).
   Used by home.html + player.html (body.ui-v2). Header / tab bar / footer
   live in shell.css (shared by every page).
   ===================================================================== */

/* ---------- Layout helpers ---------- */
main { container-type: inline-size; }          /* rails size their cards from the page width (cqw) */
.ui-v2 { --pad: var(--gutter); }                /* full width: content runs edge to edge with one gutter */

/* ---------- Logo slot (sign-in sheet) ---------- */
.logo-slot { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; color: var(--c-text); flex: none; }
.logo-slot img { height: 36px; width: auto; }
.logo-word { font-size: 24px; font-weight: var(--fw-bold); line-height: 1; letter-spacing: 0; }
.logo-word b { color: var(--c-primary); font-weight: var(--fw-bold); margin-inline-start: 1px; }

/* Live dot (functional indicator, not decoration) */
.live-dot { width: 8px; height: 8px; border-radius: var(--r-round); background: var(--c-live); flex: none; animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }

/* ---------- Buttons (alkafeel.tv .btn: dark #12151E pill, 2px green border, text #E3DFDF, 700;
   hover = green fill. Text on the green fill uses --c-on-primary (4.9:1) instead of
   alkafeel's #1E1B29 (4.0:1) so every button label passes WCAG AA 4.5:1) ---------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 48px; padding-inline: var(--sp-7); border-radius: var(--r-pill);
  background: var(--c-bg); border: 2px solid var(--c-primary); color: var(--c-text-2);
  font-size: var(--fs-14); font-weight: var(--fw-bold); line-height: 1; white-space: nowrap;
  transition: transform var(--dur-1) var(--ease-out);
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--c-primary); opacity: 0; transition: opacity var(--dur-1) var(--ease-out); }
.btn:hover::before, .btn:focus-visible::before { opacity: 1; }
.btn:hover, .btn:focus-visible { color: var(--c-on-primary); }
.btn:focus-visible { outline: 2px solid var(--c-text); outline-offset: 3px; }
.btn:active { transform: scale(.97); }
.btn-lg { min-height: 54px; padding-inline: 34px; font-size: var(--fs-15); }
.btn-sm { min-height: 40px; padding-inline: var(--sp-5); font-size: var(--fs-13); }
.btn-primary { color: var(--c-text); }
/* secondary = alkafeel.tv tab style (#20212B + 2px #2D303D); hover keeps the same green fill */
.btn-secondary, .btn-ghost { background: var(--c-surface-a70); border-color: var(--c-line); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.btn-secondary:hover, .btn-ghost:hover, .btn-secondary:focus-visible, .btn-ghost:focus-visible { border-color: var(--c-primary); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: var(--r-round); background: var(--c-surface); border: 1px solid var(--c-line); color: var(--c-text);
}
.icon-btn svg { width: 20px; height: 20px; }

/* Quality-style badges (alkafeel.tv .banner-meta li.quality > span) */
.q { display: inline-block; font-size: var(--fs-11); font-weight: var(--fw-bold); line-height: 1; padding: 5px 10px; border: 2px solid var(--c-text); color: var(--c-text); }
.q-solid { background: var(--c-text); color: var(--c-badge-ink); padding: 7px 11px; border: 0; }

/* skip link: dark text on the green fill (AA) */
.skip { color: var(--c-on-primary); }

/* ---------- Skeleton (shimmer: transform only) ---------- */
.skel { position: relative; overflow: hidden; background: var(--c-skeleton); border-radius: var(--r-card); }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--c-shimmer), transparent);
  transform: translateX(100%); animation: shimmer var(--dur-shimmer) linear infinite;
}
@keyframes shimmer { to { transform: translateX(-100%); } }
.skel-line { height: 12px; border-radius: 6px; margin-top: var(--sp-3); }
.skel-title { height: clamp(32px, 3.4vw, 48px); width: min(420px, 86%); margin-top: var(--sp-4); }
.skel-btn { width: 168px; height: 54px; border-radius: var(--r-pill); }
.skel-chip { width: 104px; height: 40px; border-radius: var(--r-pill); }
.skel-card { aspect-ratio: 16 / 9; }

/* ---------- Hero (full-bleed artwork + gradient scrim) ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero-media { position: relative; height: min(80vw, 440px); background: var(--c-surface); overflow: hidden; }
.hero-media.skel { border-radius: 0; }
.hero-media picture, .hero-media img { width: 100%; height: 100%; }
.hero-media img { object-fit: cover; object-position: var(--focus-m, 50% 40%); }
.hero-scrim {
  position: absolute; inset-inline: 0; top: 0; height: min(80vw, 440px); z-index: 1; pointer-events: none;
  /* top band under the transparent header: artwork corners (logos, watermarks) never compete with the header controls */
  background: linear-gradient(to bottom, var(--c-bg) 0, var(--c-bg-a92) 64px, var(--c-bg-a0) 190px),
    linear-gradient(to top, var(--c-bg) 0%, var(--c-bg-a92) 26%, var(--c-bg-a55) 52%, var(--c-bg-a0) 78%);
}
.hero-body { position: relative; z-index: 2; margin-top: calc(-1 * var(--sp-10)); }
.hero-copy { max-width: 600px; }
.hero-kicker { font-size: var(--fs-14); font-weight: var(--fw-bold); color: var(--c-primary); line-height: 1.5; margin-bottom: var(--sp-2); }
/* Arabic-script titles carry diacritics above and below the line → generous line-height, no overlap */
.hero-title { font-size: var(--fs-hero); line-height: 1.32; text-wrap: balance; text-shadow: 0 2px 18px var(--c-bg-a55); }
.hero-title:lang(en) { line-height: 1.2; }
.hero-sub { margin-top: var(--sp-3); font-size: clamp(16px, .5vw + 13px, 20px); font-weight: var(--fw-semi); color: var(--c-text-2); line-height: 1.55; text-shadow: 0 1px 12px var(--c-bg-a55); }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-4); font-size: var(--fs-14); color: var(--c-text-body); }
.hero-meta li { display: inline-flex; align-items: center; gap: var(--sp-3); }
.hero-meta li + li::before { content: ""; width: 4px; height: 4px; border-radius: var(--r-round); background: var(--c-text-dim); }
.hero-desc { margin-top: var(--sp-3); font-size: var(--fs-15); line-height: var(--lh-text); color: var(--c-text-2); max-width: 600px; }
.hero-kicker .live-dot { display: inline-block; vertical-align: middle; margin-inline-end: var(--sp-2); }

/* ---------- Description: 2 lines + inline "عرض المزيد" (app.js fitClamp cuts the text; the link follows it) ---------- */
.ak-clamp { overflow-wrap: break-word; }
.ak-more {
  display: inline; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; vertical-align: baseline;
  font: inherit; font-weight: var(--fw-bold); color: var(--c-primary); white-space: nowrap;
}
.ak-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.ak-more:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; border-radius: var(--r-xs); }
.ak-more[hidden] { display: none; }
/* one line: the end of the text fades out (direction-aware) and «عرض المزيد» sits on the faded part */
.ak-clamp.is-clamped:not(.is-open) .ak-ct {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 84px), transparent calc(100% - 30px)); mask-image: linear-gradient(to right, #000 calc(100% - 84px), transparent calc(100% - 30px));
}
.ak-clamp.is-clamped[dir="rtl"]:not(.is-open) .ak-ct {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 84px), transparent calc(100% - 30px)); mask-image: linear-gradient(to left, #000 calc(100% - 84px), transparent calc(100% - 30px));
}
.ak-clamp.is-clamped:not(.is-open) .ak-more { position: relative; margin-inline-start: -26px; }   /* sits on the fully faded tail only */
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); max-width: 520px; }
.hero-ctas .btn-primary { flex: 0 0 auto; }
.hero-ctas .skel-btn { flex: 0 0 auto; }
/* phones + tablets: a compact watch button, centred under the copy */
@media (max-width: 899px) {
  .hero-ctas { justify-content: center; max-width: none; }
  .hero-ctas .btn-lg { min-height: 46px; padding-inline: var(--sp-6); font-size: var(--fs-14); }
  .hero-ctas .skel-btn { width: 160px; }
}

/* ---------- Hero carousel: slides share one grid cell (tallest slide sets the height) ---------- */
.hero { touch-action: pan-y; }
.hero-track { display: grid; opacity: 0; transition: opacity 700ms var(--ease-out); }
.hero.is-in .hero-track { opacity: 1; }
.hero-slide {
  grid-area: 1 / 1; position: relative; min-width: 0;
  opacity: 0; visibility: hidden;
}
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
/* switch = a slide: the new one comes in from --hero-from (set per move in app.js), the old one leaves the other way */
.hero-slide.is-entering { animation: hero-in 500ms var(--ease) both; }
.hero-slide.is-leaving { opacity: 1; visibility: visible; animation: hero-out 500ms var(--ease) both; }
.hero.is-in .hero-slide.is-leaving .rv { opacity: 1; transform: none; transition: none; }   /* the old copy leaves with its slide */
@keyframes hero-in { from { transform: translateX(var(--hero-from, 100%)); } to { transform: none; } }
@keyframes hero-out { from { transform: none; } to { transform: translateX(calc(var(--hero-from, 100%) * -1)); } }
/* slow image drift while a slide is showing (transform only) */
.hero-slide.is-active .hero-media img { animation: hero-drift 9s var(--ease-out) both; }
@keyframes hero-drift { from { transform: scale(1.07) translateX(-1%); } to { transform: none; } }
/* copy rises in sequence each time a slide becomes active */
.rv { opacity: 0; transform: translateY(14px); transition: opacity var(--dur-2) var(--ease-out); }
.hero:not(:has(.hero-slide)).is-in .rv,
.hero.is-in .hero-slide.is-active .rv { opacity: 1; transform: none; transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); transition-delay: calc(var(--i, 0) * 35ms + 60ms); }   /* quick: a slide shows for 4 s */
.hero.is-static .hero-slide, .hero.is-static .rv { transition: none; animation: none; }
.hero.is-static .hero-media img { animation: none; }

/* dots + pause */
.hero-ctrl { position: relative; z-index: 3; display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-4); }
.hero-dots { display: flex; align-items: center; }
.hero-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-round); }
.hero-dot i { width: 8px; height: 8px; border-radius: var(--r-round); background: var(--c-white-a35); transition: transform var(--dur-2) var(--ease), opacity var(--dur-2); }
.hero-dot:hover i { background: var(--c-text-2); }
.hero-dot[aria-current="true"] i { background: var(--c-primary); transform: scale(1.4); }
.hero-dot:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 1px; }

@media (min-width: 900px) {
  .hero { height: clamp(540px, 80vh, 780px); display: flex; align-items: flex-end; }
  .hero-track { position: absolute; inset: 0; }
  .hero-slide { height: 100%; display: flex; align-items: flex-end; }
  .hero-ctrl { position: absolute; bottom: var(--sp-5); inset-inline-end: 0; width: auto; margin: 0; }
  .hero-media { position: absolute; inset: 0; height: auto; }
  .hero-media img { object-position: var(--focus, 50% 30%); }
  /* strong shade behind the copy (inline-start side: right in RTL, left in LTR) + the bottom, so the text
     always reads cleanly, even over artwork that has its own lettering */
  .hero-scrim {
    inset: 0; height: auto;
    background:
      linear-gradient(to bottom, var(--c-bg) 0, var(--c-bg-a92) 64px, var(--c-bg-a0) 190px),
      linear-gradient(to top, var(--c-bg) 0%, var(--c-bg-a85) 14%, var(--c-bg-a40) 34%, var(--c-bg-a0) 52%),
      linear-gradient(to left, var(--c-bg-a96) 0%, var(--c-bg-a92) 40%, var(--c-bg-a75) 52%, var(--c-bg-a40) 64%, var(--c-bg-a0) 80%);
  }
  [dir="ltr"] .hero-scrim {
    background:
      linear-gradient(to bottom, var(--c-bg) 0, var(--c-bg-a92) 64px, var(--c-bg-a0) 190px),
      linear-gradient(to top, var(--c-bg) 0%, var(--c-bg-a85) 14%, var(--c-bg-a40) 34%, var(--c-bg-a0) 52%),
      linear-gradient(to right, var(--c-bg-a96) 0%, var(--c-bg-a92) 40%, var(--c-bg-a75) 52%, var(--c-bg-a40) 64%, var(--c-bg-a0) 80%);
  }
  .hero-body { margin-top: 0; padding-top: var(--header-h); padding-bottom: clamp(40px, 8vh, 88px); }
  .hero-ctas .btn-primary, .hero-ctas .skel-btn { flex: 0 0 auto; }
  /* opened description stays inside the hero: it scrolls if it is very long */
  .hero-desc.is-open { max-height: min(34vh, 12.6em); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-inline-end: var(--sp-2); }
}

/* ---------- Drag-to-scroll (mouse) for chips + rails; touch keeps native scrolling ---------- */
.drag-scroll { cursor: grab; }
.drag-scroll.is-dragging { cursor: grabbing; scroll-snap-type: none !important; scroll-behavior: auto; }
.drag-scroll.is-dragging a, .drag-scroll.is-dragging button { pointer-events: none; }
.drag-scroll img { -webkit-user-drag: none; user-select: none; }

/* ---------- Category chips (alkafeel.tv .nav-tabs .nav-link) ---------- */
.chips-row { margin-top: var(--sp-6); scroll-margin-top: calc(var(--header-h) + var(--sp-2)); }
.chips {
  display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  padding-inline: var(--pad); padding-block: var(--sp-1);
}
.chips::-webkit-scrollbar { display: none; }
.chips > li { flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding-inline: var(--sp-4);
  border-radius: var(--r-pill); background: var(--c-surface); border: 2px solid var(--c-line);
  font-size: var(--fs-13); font-weight: var(--fw-semi); color: var(--c-text-2); white-space: nowrap;
}
.chip:hover { border-color: var(--c-primary); color: var(--c-text); }
.chip[aria-pressed="true"] { border-color: var(--c-primary); color: var(--c-text); background: var(--c-primary-a20); }
.chip:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }

/* ---------- Season selector (alkafeel.tv tab style): series page + episode lists ---------- */
.season {
  position: relative; display: inline-flex; align-items: center; flex: none;
  min-height: 40px; border-radius: var(--r-pill); background: var(--c-surface); border: 2px solid var(--c-line);
}
.season:focus-within { border-color: var(--c-primary); }
.season select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; cursor: pointer;
  min-height: 36px; padding-inline: var(--sp-4) calc(var(--sp-4) + 22px);
  font: var(--fw-semi) var(--fs-13)/1 var(--font); color: var(--c-text-2); outline: none;
}
.season select option { background: var(--c-surface); color: var(--c-text); }
.season svg { position: absolute; inset-inline-end: var(--sp-3); width: 16px; height: 16px; color: var(--c-primary); pointer-events: none; }

/* ---------- Rows ---------- */
.row { margin-top: var(--sec-gap); }
.row-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4);
  padding-inline: var(--pad); margin-bottom: var(--sp-4);
}
.row-title { font-size: var(--fs-row); }
.row-kicker { font-size: var(--fs-13); font-weight: var(--fw-bold); color: var(--c-primary); line-height: 1.4; margin-bottom: 2px; }
.row-more {
  display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 44px; flex: none;
  font-size: var(--fs-14); font-weight: var(--fw-bold); color: var(--c-text-2);
}
.row-more svg { width: 18px; height: 18px; color: var(--c-primary); transition: transform var(--dur-2) var(--ease); }
.row-more:hover { color: var(--c-primary); }
.row-more:hover svg { transform: translateX(calc(3px * var(--dirx))); }

/* ---------- Rails (horizontal, snap). The scroll box sits INSIDE the content column,
   so cards are clipped at the column edge (never at the screen edge, never outside the page). ---------- */
.rail {
  --edge: 6px;                       /* room for hover lift / focus ring */
  position: relative; margin-inline: calc(var(--pad) - var(--edge));
  --cols: 1.75;
  --card-w: calc((100vw - 2 * var(--gutter) - (var(--cols) - 1) * var(--gap)) / var(--cols));
}
@supports (width: 1cqw) {
  .rail { --card-w: calc((100cqw - 2 * var(--gutter) - (var(--cols) - 1) * var(--gap)) / var(--cols)); }
}
.track {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--card-w); gap: var(--gap);
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: var(--edge); scroll-padding-inline: var(--edge);
  padding-block: var(--sp-2) var(--sp-3);
}
.track::-webkit-scrollbar { display: none; }
.track > li { scroll-snap-align: start; min-width: 0; }
/* cards per row scale with the screen (landscape 16:9 always): 1.75 on phones (a peek of the next card),
   4.5 at 1366, 5 at 1440, 6 at 1920 */
@media (min-width: 600px) { .rail { --cols: 2.5; } }
@media (min-width: 900px) { .rail { --cols: 3.5; } }
@media (min-width: 1200px) { .rail { --cols: 4.5; } }
@media (min-width: 1400px) { .rail { --cols: 5; } }
@media (min-width: 1800px) { .rail { --cols: 6; } }

.rail-btn {
  position: absolute; top: calc(var(--card-w, 260px) * 9 / 32 + var(--sp-2)); z-index: var(--z-raised);
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-top: -22px;
  border-radius: var(--r-round); background: var(--c-header-a92); border: 1px solid var(--c-line); color: var(--c-text);
  box-shadow: var(--sh-card); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease);
}
.rail-btn svg { width: 22px; height: 22px; }
/* half outside the card edge, but never past the page edge (no horizontal overflow) */
.rail-prev { inset-inline-start: max(calc(var(--edge) - 22px), calc(var(--edge) - var(--pad))); }
.rail-next { inset-inline-end: max(calc(var(--edge) - 22px), calc(var(--edge) - var(--pad))); }
.rail-btn.is-off { opacity: 0 !important; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .rail-btn { display: inline-flex; opacity: 0; }
  .rail:hover .rail-btn, .rail-btn:focus-visible { opacity: 1; }
  .rail-btn:hover { transform: scale(1.06); }
}

/* ---------- Category view (a chip shows one section as a grid) ---------- */
.cat-view { padding-top: var(--sp-2); }
.cat-view .row:first-of-type { margin-top: var(--sp-6); }
.grid {
  display: grid; gap: var(--sp-6) var(--gap); padding-inline: var(--pad);
  grid-template-columns: repeat(var(--gcols, 1), minmax(0, 1fr));
}
@media (min-width: 600px) { .grid { --gcols: 2; } }
@media (min-width: 900px) { .grid { --gcols: 3; } }
@media (min-width: 1200px) { .grid { --gcols: 4; } }
@media (min-width: 1340px) { .grid { --gcols: 5; } }
@media (min-width: 1800px) { .grid { --gcols: 6; } }
.grid.chs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--gap); }
.cat-swap-out { opacity: 0; transform: translateY(10px); transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); }
.cat-swap-in { animation: cat-in var(--dur-3) var(--ease) both; }
@keyframes cat-in { from { opacity: 0; transform: translateY(14px); } }
::view-transition-old(cat-view) { animation: vt-out var(--dur-1) var(--ease-out) both; }
::view-transition-new(cat-view) { animation: cat-in var(--dur-3) var(--ease) both; }

/* ---------- Video card 16:9 (alkafeel.tv .movie-item: img radius 5px, title 16px/600) ---------- */
.card { display: block; color: inherit; transition: transform var(--dur-2) var(--ease); }
.card-media {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-card); overflow: hidden;
  background: var(--c-surface); transform: translateZ(0);
}
.card-media picture, .card-media img { width: 100%; height: 100%; }
.card-media img { object-fit: cover; transition: transform var(--dur-3) var(--ease); }
.card-play {
  position: absolute; top: 50%; left: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  display: grid; place-items: center; border-radius: var(--r-round); background: var(--c-primary); color: var(--c-on-primary);
  box-shadow: var(--sh-card); opacity: 0; transform: scale(.85);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease);
}
.card-play svg { width: 20px; height: 20px; margin-inline-end: -2px; }
.card-soon { position: absolute; top: var(--sp-2); inset-inline-start: var(--sp-2); font-size: var(--fs-11); font-weight: var(--fw-bold); padding: 4px 8px; background: var(--c-bg-a75); color: var(--c-text); border-radius: var(--r-xs); }
.card-progress { position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--c-white-a16); }
.card-progress i { display: block; height: 100%; background: var(--c-primary); transform-origin: right center; transform: scaleX(var(--p, 0)); }
[dir="ltr"] .card-progress i { transform-origin: left center; }
.card-body { padding-top: var(--sp-3); }
.card-title {
  font-size: var(--fs-16); font-weight: var(--fw-semi); color: var(--c-text); line-height: var(--lh-title);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); margin-top: var(--sp-1); font-size: var(--fs-12); color: var(--c-text-body); }
.card-meta .q { border: 0; padding: 0; font-size: var(--fs-12); font-weight: var(--fw-semi); color: var(--c-text-2); }
.card-meta .dur { display: inline-flex; align-items: center; gap: var(--sp-1); }
.card-meta .dur svg { width: 12px; height: 12px; color: var(--c-primary); flex: none; }
.card:focus-visible { outline: none; }
.card:focus-visible .card-media { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.card:focus-visible .card-play { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-4px); }
  .card:hover .card-media img { transform: scale(1.05); }
  .card:hover .card-play { opacity: 1; transform: none; }
}
.card.is-soon .card-media img { opacity: .6; }

/* ---------- Live channels: official artwork card (clearly different from content cards) ---------- */
.rail.chs { --cols: 1.3; }
@media (min-width: 600px) { .rail.chs { --cols: 2.2; } }
@media (min-width: 900px) { .rail.chs { --cols: 3; } }
.ch {
  position: relative; isolation: isolate; overflow: hidden; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0;
  border-radius: var(--r-card); background: var(--c-surface); border: 1px solid var(--c-line); color: inherit;
  font: inherit; text-align: start; cursor: pointer; transition: transform var(--dur-2) var(--ease);
}
.ch-media, .ch-media picture, .ch-media img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ch-media img { object-fit: cover; transition: transform var(--dur-3) var(--ease); }
.ch-media { transform: scale(var(--ch-z, 1)); transform-origin: var(--ch-o, 50% 50%); }
.ch-shade { position: absolute; inset: 0; background: linear-gradient(to top, var(--c-ov-a92) 0%, var(--c-ov-a80) 26%, var(--c-ov-a45) 52%, var(--c-ov-a0) 74%); }   /* strong enough for light artwork (e.g. Safeer) */
.ch-text { text-shadow: 0 1px 8px var(--c-ov-a80); }
.badge-live {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: var(--r-pill); background: var(--c-primary-a20); color: var(--c-text);
  font-size: var(--fs-11); font-weight: var(--fw-bold); line-height: 1.2;
}
.ch .badge-live { position: absolute; z-index: 2; top: var(--sp-3); inset-inline-start: var(--sp-3); background: var(--c-ov-a80); border: 1px solid var(--c-primary-a55); }
.ch-logo { position: absolute; z-index: 2; top: var(--sp-2); inset-inline-end: var(--sp-2); display: grid; place-items: center; height: 40px; padding: 4px 8px; border-radius: var(--r-md); }
.ch-logo img { height: 30px; width: auto; max-width: 96px; object-fit: contain; }
.ch-logo-light { background: var(--c-text); box-shadow: var(--sh-card); }           /* black-on-transparent logos */
.ch-logo-dark { background: var(--c-ov-a60); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ch-text { position: absolute; z-index: 2; inset-inline: 0; bottom: 0; display: grid; gap: 2px; padding: var(--sp-3) var(--sp-4); padding-inline-end: 72px; }
.ch-now { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-11); font-weight: var(--fw-bold); color: var(--c-text-2); }
.ch-name { font-size: var(--fs-16); font-weight: var(--fw-bold); color: var(--c-text); line-height: var(--lh-title); }
.ch-owner { font-size: var(--fs-12); color: var(--c-text-2); }
.ch-play {
  position: absolute; z-index: 2; bottom: var(--sp-3); inset-inline-end: var(--sp-3);
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--r-round);
  background: var(--c-primary); color: var(--c-on-primary); box-shadow: var(--sh-card);
  transition: transform var(--dur-2) var(--ease);
}
.ch-play svg { width: 20px; height: 20px; margin-inline-end: -2px; }
[dir="ltr"] .ch-play svg { margin-inline-end: 0; margin-inline-start: 2px; }
/* "on air now": three bars (transform only) */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.eq i { width: 3px; height: 100%; border-radius: 1px; background: var(--c-primary); transform-origin: bottom; animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.45s; }
.eq i:nth-child(3) { animation-delay: -.8s; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.ch:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .ch:hover { transform: translateY(-3px); }
  .ch:hover .ch-media img { transform: scale(1.05); }
  .ch:hover .ch-play { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; transform: scaleY(.7); } .live-dot { animation: none; } }

/* ---------- Programs (series) feature cards ---------- */
.feats { display: grid; gap: var(--gap); padding-inline: var(--pad); }
@media (min-width: 900px) { .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feat {
  display: grid; overflow: hidden; border-radius: var(--r-card);
  background: var(--c-surface); border: 1px solid var(--c-line); color: inherit;
  transition: transform var(--dur-2) var(--ease);
}
.feat-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--c-bg-deep); }
.feat-media picture, .feat-media img { width: 100%; height: 100%; }
.feat-media img { object-fit: cover; transition: transform var(--dur-3) var(--ease); }
.feat-body { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5); min-width: 0; }
.feat-meta { font-size: var(--fs-12); font-weight: var(--fw-semi); color: var(--c-text-2); line-height: 1.5; }
.feat-title { font-size: clamp(20px, 1vw + 14px, 24px); line-height: 1.3; }
.feat-desc { font-size: var(--fs-14); line-height: var(--lh-text); color: var(--c-text-body); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.feat-cta { margin-top: auto; padding-top: var(--sp-2); display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-14); font-weight: var(--fw-bold); color: var(--c-text-2); }
.feat-cta svg { width: 18px; height: 18px; color: var(--c-primary); transition: transform var(--dur-2) var(--ease); }
.feat:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
@media (min-width: 1200px) {
  .feat { grid-template-columns: 1.15fr 1fr; }
  .feat-media { position: relative; height: 100%; }
  .feat-media picture { position: absolute; inset: 0; }
}
@media (hover: hover) and (pointer: fine) {
  .feat:hover { transform: translateY(-3px); }
  .feat:hover .feat-media img { transform: scale(1.04); }
  .feat:hover .feat-cta { color: var(--c-primary); }
  .feat:hover .feat-cta svg { transform: translateX(calc(3px * var(--dirx))); }
}

/* ---------- Sign-in sheet (UI only) ---------- */
.sheet {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: inherit; overflow: hidden;
}
.sheet::backdrop { background: transparent; }
.sheet-scrim { position: absolute; inset: 0; background: var(--c-black-a50); opacity: 0; transition: opacity var(--dur-2) var(--ease-out); }
.sheet-panel {
  position: absolute; inset-inline: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  padding: var(--sp-3) var(--sp-5) calc(var(--sp-6) + env(safe-area-inset-bottom));
  background: var(--c-header); border-top: 1px solid var(--c-line); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--sh-pop); transform: translateY(100%); transition: transform var(--dur-3) var(--ease);
}
.sheet.is-open .sheet-scrim { opacity: 1; }
.sheet.is-open .sheet-panel { transform: none; }
.sheet-grip { width: 40px; height: 4px; margin: 0 auto var(--sp-3); border-radius: var(--r-pill); background: var(--c-line); }
.sheet-close { position: absolute; top: var(--sp-3); inset-inline-end: var(--sp-3); }
.sheet-head { text-align: center; padding-top: var(--sp-4); }
.sheet-head .logo-slot { justify-content: center; }
.sheet-head h2 { margin-top: var(--sp-4); font-size: 22px; }
.sheet-opts { display: grid; gap: var(--sp-3); margin-top: var(--sp-6); }
.opt {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r-pill); background: var(--c-surface); border: 2px solid var(--c-line);
  font-size: var(--fs-15); font-weight: var(--fw-bold); color: var(--c-text-2); text-align: start;
}
.opt::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--c-white-a06); opacity: 0; transition: opacity var(--dur-2) var(--ease-out); }
.opt:hover::before { opacity: 1; }
.opt svg { width: 22px; height: 22px; flex: none; }
.opt > span { display: flex; flex-direction: column; gap: 2px; }
.opt-primary { background: var(--c-bg); border-color: var(--c-primary); color: var(--c-text-2); }
.opt-primary::before { background: var(--c-primary); }
.opt-primary:hover { color: var(--c-on-primary); }
@media (min-width: 768px) {
  .sheet-panel {
    inset: 0; margin: auto; width: min(440px, 92vw); height: fit-content; border: 1px solid var(--c-line); border-radius: var(--r-lg);
    padding: var(--sp-6); transform: translateY(16px); opacity: 0;
    transition: transform var(--dur-3) var(--ease), opacity var(--dur-2) var(--ease-out);
  }
  .sheet.is-open .sheet-panel { opacity: 1; }
  .sheet-grip { display: none; }
}

/* ---------- Toast ---------- */
.toast-region {
  position: fixed; inset-inline: 0; bottom: calc(var(--sp-5) + env(safe-area-inset-bottom)); z-index: var(--z-toast);
  display: flex; justify-content: center; pointer-events: none; padding-inline: var(--sp-4);
}
.toast {
  display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-pill); background: var(--c-surface-2); border: 1px solid var(--c-line-2); box-shadow: var(--sh-pop);
  font-size: var(--fs-14); font-weight: var(--fw-semi); color: var(--c-text-nav);
  opacity: 0; transform: translateY(8px); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }
.toast svg { width: 18px; height: 18px; color: var(--c-primary); flex: none; }

/* ---------- Error / empty state ---------- */
.state { display: grid; justify-items: center; gap: var(--sp-3); text-align: center; padding: var(--sp-10) var(--gutter); }
.state svg { width: 40px; height: 40px; color: var(--c-primary); }
.state h2 { font-size: 20px; }

/* ---------- PHONES (< 768px): touch targets ≥ 44px, meta text ≥ 12px. Desktop unchanged. ---------- */
@media (max-width: 767px) {
  .chip { min-height: 44px; }
  .hero-ctrl { gap: 0; }
  .hero-ctrl { display: none; }                 /* phones: no dots — swipe changes slides */
  .ak-more { display: inline-block; padding-block: 9px; margin-block: -9px; }
  .badge-live, .ch-now { font-size: var(--fs-12); }
  .un-dur, .un-soon { font-size: var(--fs-12); }
  .rail.chs { --cols: 1.7; }
  .ch .badge-live { top: var(--sp-2); inset-inline-start: var(--sp-2); padding: 3px 8px; }
  .ch-logo { height: 34px; padding: 3px 6px; }
  .ch-logo img { height: 26px; max-width: 72px; }
  .ch-text { padding: var(--sp-2) var(--sp-3); }
  .ch-name { font-size: var(--fs-14); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ch-owner, .ch-now, .ch-play { display: none; }      /* small phone cards: badge + logo + name only (the card is the button) */
  .crumbs a { min-height: 44px; }
  .season, .season select { min-height: 44px; }
  .sheet .icon-btn { width: 44px; height: 44px; }
  .sheet .logo-slot { min-height: 44px; }
}
