/* =====================================================================
   live.css: TV en vivo, tvOS style. On the page's ambient tint (ambient.js,
   from the tuned channel's logo): glass category pills (the selected one
   white) and a glass jump list; a big rounded stage with a glass "now
   playing" card under it; the channel list in a frosted panel whose tuned
   row is a white pill (as the sidebar's current item). Glass number box
   and OSD over the stage.
   Mobile-first: one column; ≤860 portrait pins the stage (and a compact
   now bar) under the header; ≥1024 stage and panel side by side in one
   viewport; short landscape side by side without sticking. TV mode: the
   same look at 10 feet, no backdrop blur, the focused row a white pill.
   ===================================================================== */

.live {
  --live-glass: rgba(38, 38, 46, .3);
  --live-glass-ring: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 1px var(--glass-line);
  --live-pill: rgba(255, 255, 255, .1);
  --live-pill-hover: rgba(255, 255, 255, .18);
  --live-row-h: 60px;
  display: flex; flex-direction: column; gap: 16px;
  padding: calc(var(--header-h) + 16px) var(--gutter) 24px;
}

/* ---------------------------------------------------------- categories */
.live__cats { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* A horizontal scroller of glass pills. The fade sits in the gutter and in the track's own padding, so the first
   and last pill are fully opaque at the ends; the right end fades over 56px, so a pill cut before the jump list
   melts away instead of touching it. 6px of block padding keeps the focus ring unclipped. */
.live__cat-track {
  --fade: min(24px, var(--gutter));
  --fade-end: 56px;
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 6px var(--fade-end) 6px var(--fade); margin: -6px 0 -6px calc(-1 * var(--fade));
  /* Focus and keyboard scrolling keep the focused pill clear of both fades. */
  scroll-padding-inline: var(--fade) var(--fade-end);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade), #000 calc(100% - var(--fade-end)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade), #000 calc(100% - var(--fade-end)), transparent 100%);
}
.live__cat-track::-webkit-scrollbar { display: none; }
/* TV: the focused pill scales 1.06, so its ring reaches about 9px out. */
html.is-tv .live__cat-track { padding-top: 10px; padding-bottom: 10px; margin-top: -10px; margin-bottom: -10px; }
/* Glass pills: a light translucent fill and a hairline ring on the ambient tint (the track's fade mask would keep
   a backdrop blur from seeing anything, so none). */
.live__cat-track .chip {
  flex: none; height: 38px; padding: 0 18px; background: var(--live-pill); color: rgba(255, 255, 255, .86);
  font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}
@media (pointer: coarse) { .live__cat-track .chip { height: 44px; } }
@media (hover: hover) and (pointer: fine) { .live__cat-track .chip:hover { background: var(--live-pill-hover); color: #fff; } }
.live__cat-track .chip[aria-pressed="true"] { background: #fff; color: #111114; box-shadow: 0 4px 14px rgba(0, 0, 0, .22); }
.live__cat-track .chip .icon { width: 14px; height: 14px; }
.live__cat-star { color: var(--star); margin-left: -2px; }
.live__cat-track .chip[aria-pressed="true"] .live__cat-star { color: #c58f00; }
.live__cat-count { color: rgba(235, 235, 245, .55); font-weight: 500; font-variant-numeric: tabular-nums; }
.live__cat-track .chip[aria-pressed="true"] .live__cat-count { color: inherit; opacity: .5; }
/* TV: the focused pill turns white like the focused row; the selected one steps back while another has the focus. */
html.is-tv .live__cat-track .chip:focus { background: #fff; color: #111114; outline: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
html.is-tv .live__cat-track .chip:focus .live__cat-star { color: #c58f00; }
html.is-tv .live__cat-track:focus-within .chip[aria-pressed="true"]:not(:focus) { background: rgba(255, 255, 255, .28); color: #fff; box-shadow: none; }
html.is-tv .live__cat-track:focus-within .chip[aria-pressed="true"]:not(:focus) .live__cat-star { color: var(--star); }

/* The jump list ("Perú ▾"): a glass dropdown beside the track (a flex sibling: it never covers a pill). It repeats
   the selected pill, so it stays glass instead of a second white one. */
.live__picker { flex: none; }
.live__picker .picker, .live__picker .picker[data-set] {
  height: 38px; padding: 0 12px 0 16px; background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 1px rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
}
.live__picker .picker .icon, .live__picker .picker[data-set] .icon { color: rgba(255, 255, 255, .7); stroke-width: 2.4; }
@media (pointer: coarse) { .live__picker .picker, .live__picker .picker[data-set] { height: 44px; } }
@media (hover: hover) and (pointer: fine) { .live__picker .picker[data-set]:hover { background: rgba(255, 255, 255, .22); } }
@media (max-width: 599px) { .live__picker .picker__text { max-width: 11ch; } }

/* ---------------------------------------------------------- the stage */
.live__main { min-width: 0; max-width: 960px; }
/* The stage's corners and shadow (and their TV and full-screen forms) are player.css's .stage--inline. */

/* ------------------------------------------------------- now playing */
/* A glass card under the stage: logo tile, "● EN VIVO", the name, "Canal 5 · Perú", round glass ★ and the glass
   "Canal anterior" pill. Phones: a compact bar without the card (below). */
.live__now {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  margin-top: 12px;
}
.live__now[hidden] { display: none; }
.live__now-logo {
  display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; overflow: hidden;
  border-radius: 12px; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .7); font-size: 14px; font-weight: 700;
}
/* Contained and never upscaled: small logos keep their own size. */
.live__now-logo img { max-width: 40px; max-height: 32px; object-fit: contain; }
.live__now-text { min-width: 0; }
.live__now-over {
  display: none; align-items: center; gap: 7px; margin-bottom: 6px;
  color: rgba(255, 255, 255, .86); font-size: 12px; font-weight: 700; line-height: 1; letter-spacing: .08em; text-transform: uppercase;
}
.live__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(255, 69, 58, .22); }
.live__now-name { font-size: 17px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live__now-sub {
  margin-top: 3px; color: rgba(235, 235, 245, .62); font-size: 13px; line-height: 1.35; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.live__now-num:empty, .live__now-cat:empty { display: none; }
/* "Canal 5 · Perú": a CSS dot, so screen readers skip it. */
.live__now-num:not(:empty) + .live__now-cat:not(:empty)::before {
  content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 8px; border-radius: 50%;
  background: currentColor; opacity: .7; vertical-align: middle;
}
.live__now-actions { display: flex; align-items: center; gap: 10px; }
.live__now .live__now-btn { width: 40px; height: 40px; padding: 0; }
.live__now-btn .icon { width: 19px; height: 19px; }
.live__now-prev .icon { stroke-width: 2; }
.live__now-label { display: none; }
.live__now-fav[aria-pressed="true"] .icon { color: var(--star); }
.live__now-btn:disabled { opacity: .38; }
@media (pointer: coarse) { .live__now .live__now-btn { width: 44px; height: 44px; } }

/* Keyboard hint: only where there is a keyboard and room for it. */
.live__hint { display: none; margin: 14px 4px 0; color: rgba(235, 235, 245, .5); font-size: 13px; line-height: 1.4; }

/* Number typed with the keyboard or remote, over the stage ("12_"): a glass box. */
.live-digits {
  position: absolute; top: 16px; right: 16px; z-index: var(--z-stage-osd);
  min-width: 2.4em; padding: 10px 18px; border-radius: 18px; text-align: center;
  background: rgba(30, 30, 36, .55); color: #fff; font: 700 40px/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 1px rgba(255, 255, 255, .1), 0 18px 40px -12px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  pointer-events: none; animation: fade-in var(--dur-2) var(--ease-calm);
}
.live-digits[hidden] { display: none; }
@media (max-width: 599px) { .live-digits { top: 12px; right: 12px; padding: 8px 14px; border-radius: 14px; font-size: 32px; } }
/* Separate rules: an engine that does not know one of the selectors would drop a combined list. */
.stage:fullscreen .live-digits { top: 32px; right: 32px; transform: scale(1.5); transform-origin: top right; }
.stage:-webkit-full-screen .live-digits { top: 32px; right: 32px; transform: scale(1.5); transform-origin: top right; }
html.is-tv .live-digits { top: 32px; right: 32px; transform: scale(1.5); transform-origin: top right; }

/* The channel OSD is player.css's own glass card (no override here). */

/* ------------------------------------------------------------- panel */
/* The channel list: a frosted panel (the sidebar's glass) with its heading, count and search on top. */
.live__list {
  display: flex; flex-direction: column; min-width: 0; max-width: 960px;
  padding: 14px 8px 8px; border-radius: 18px; background: var(--live-glass);
  box-shadow: var(--live-glass-ring), var(--glass-shadow);
}
.live__list-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; padding: 0 6px; }
.live__list-head h2 { display: flex; align-items: baseline; gap: 8px; font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
.live__count { color: rgba(235, 235, 245, .5); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* The iOS grey field, as the sidebar's search. */
.live__search.field {
  flex: none; gap: 8px; height: 40px; padding: 0 12px; border: 0; border-radius: 12px;
  background: rgba(118, 118, 128, .24); color: rgba(235, 235, 245, .6);
}
.live__search .icon { width: 17px; height: 17px; stroke-width: 2.1; }
.live__search input::placeholder { color: rgba(235, 235, 245, .6); }
.live__search input:focus-visible { outline: none; box-shadow: none; }
.live__search .field__clear { width: 40px; height: 40px; margin-right: -10px; }
@media (hover: hover) and (pointer: fine) { .live__search.field:hover { background: rgba(118, 118, 128, .3); } }
.live__search.field:focus-within { background: rgba(118, 118, 128, .34); color: var(--text); outline: none; box-shadow: 0 0 0 2px var(--focus); }
@media (pointer: coarse) { .live__search.field, .live__search .field__clear { height: 44px; } .live__search .field__clear { width: 44px; } }

/* Loading, empty and error states, inside the panel. */
.live__status:empty { display: none; }
.live__status .empty { padding: 44px 16px 40px; color: rgba(235, 235, 245, .62); }
.live__status .empty__icon { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.live__status .empty h2 { font-size: 19px; font-weight: 700; }
.live__status .empty p { font-size: 14px; }
.live__loading { display: flex; justify-content: center; padding: 48px 0; }

/* --------------------------------------------------------------- rows */
/* Each row: the tune button (number, logo tile, name, "● Ahora" when tuned) as a pill, and the star beside it as a
   small round glass button. Hover is a light fill; the tuned row a white pill with dark text. */
.live__channels { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.channel {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px;
  content-visibility: auto; contain-intrinsic-size: auto var(--live-row-h);
}
/* content-visibility clips paint at the row's box, so the pills carry no outer shadow (it would be cut off). */
.channel__tune {
  display: grid; grid-template-columns: 34px 56px minmax(0, 1fr); gap: 12px; align-items: center; min-width: 0;
  min-height: var(--live-row-h); padding: 0 12px 0 6px; border-radius: 14px; color: rgba(255, 255, 255, .94); text-align: left;
  transition: background-color var(--dur-2), color var(--dur-2), box-shadow var(--dur-2);
}
/* No channel in the category has a number: the column goes away. */
.live__channels--nonum .channel__tune { grid-template-columns: 56px minmax(0, 1fr); padding-left: 10px; }
.live__channels--nonum .channel__num { display: none; }
/* The name, and "● Ahora" under it on the tuned row. */
.channel__text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.channel__num { color: rgba(235, 235, 245, .5); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
/* The logo on a dark rounded tile: these logos are drawn for dark screens. Their colours cannot be read (the CDN
   has no CORS), so a logo on its own white plate fills the tile with rounded corners and reads as a white tile. */
.channel__logo {
  display: flex; align-items: center; justify-content: center; width: 56px; height: 40px; padding: 4px; overflow: hidden;
  border-radius: 10px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .7); font-size: 12px; font-weight: 700;
}
.channel__logo img { max-width: 100%; max-height: 100%; border-radius: 6px; object-fit: contain; }
.channel__name { max-width: 100%; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel__now {
  display: none; align-items: center; gap: 6px; margin-top: 4px; color: rgba(17, 17, 20, .6); font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.channel__now::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); }
/* Always visible: touch screens have no hover to reveal it. */
.channel__fav {
  position: relative; display: grid; place-items: center; width: 34px; height: 34px; margin-right: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, .06); color: rgba(235, 235, 245, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  transition: color var(--dur-2), background-color var(--dur-2);
}
.channel__fav .icon { width: 16px; height: 16px; }
.channel__fav[aria-pressed="true"] { color: var(--star); }
@media (pointer: coarse) {
  /* 44px to tap, the same 34px disc drawn inside. */
  .channel__fav { width: 44px; height: 44px; margin-right: 0; background: none; box-shadow: none; }
  .channel__fav::before { content: ""; position: absolute; top: 5px; right: 5px; bottom: 5px; left: 5px; border-radius: 50%; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
  .channel__fav .icon { position: relative; }
}
@media (hover: hover) and (pointer: fine) {
  .channel__tune:hover { background: rgba(255, 255, 255, .08); }
  .channel__fav:hover { background: rgba(255, 255, 255, .16); color: #fff; }
  .channel__fav[aria-pressed="true"]:hover { color: var(--star); }
}
/* Tuned: the white pill of the sidebar's current item, with the red dot and "Ahora". */
.channel.is-tuned .channel__tune, .channel.is-tuned .channel__tune:hover { background: #fff; color: #111114; box-shadow: none; }
.channel.is-tuned .channel__num { color: rgba(17, 17, 20, .5); }
.channel.is-tuned .channel__logo { background: #1c1c1e; box-shadow: none; }
.channel.is-tuned .channel__now { display: inline-flex; }
/* Rows sit in a scroller and paint-contain themselves: the ring goes inside (dark on the white pill). */
.channel__tune:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; box-shadow: none; }
.channel.is-tuned .channel__tune:focus-visible { outline-color: #111114; outline-offset: -4px; }
.channel__fav:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; box-shadow: none; }
/* D-pad (keyboard arrows on the web, every TV): the focused row is the white pill and the tuned one, while the
   list has the focus, steps back to a light fill; a focused star is a white disc. */
body.is-dpad .channel__tune:focus, html.is-tv .channel__tune:focus {
  background: #fff; color: #111114; outline: none; box-shadow: none;
}
body.is-dpad .channel__tune:focus .channel__num, html.is-tv .channel__tune:focus .channel__num { color: rgba(17, 17, 20, .5); }
body.is-dpad .channel__tune:focus .channel__logo, html.is-tv .channel__tune:focus .channel__logo { background: #1c1c1e; box-shadow: none; }
/* Separate rules: old TV engines without :focus-within would drop a list that mixed the two. */
html.is-tv .channel.is-tuned .channel__tune:not(:focus) { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
html.is-tv .channel.is-tuned .channel__tune:not(:focus) .channel__num { color: rgba(235, 235, 245, .6); }
html.is-tv .channel.is-tuned .channel__tune:not(:focus) .channel__now { color: rgba(255, 255, 255, .75); }
body.is-dpad .live__channels:focus-within .channel.is-tuned .channel__tune:not(:focus) { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
body.is-dpad .live__channels:focus-within .channel.is-tuned .channel__tune:not(:focus) .channel__num { color: rgba(235, 235, 245, .6); }
body.is-dpad .live__channels:focus-within .channel.is-tuned .channel__tune:not(:focus) .channel__now { color: rgba(255, 255, 255, .75); }
body.is-dpad .channel__fav:focus, html.is-tv .channel__fav:focus { background: #fff; color: #111114; outline: none; box-shadow: none; }
body.is-dpad .channel__fav[aria-pressed="true"]:focus, html.is-tv .channel__fav[aria-pressed="true"]:focus { color: #c58f00; }

/* ------------------------------------------------------------- tiers */
/* One column from 600px (also portrait screens of 1024 and up, an iPad Pro upright): heading and search share a line. */
@media (min-width: 600px) and (max-width: 1023px), (min-width: 1024px) and (orientation: portrait) {
  .live__list { padding: 16px 10px 10px; }
  .live__list-head { flex-direction: row; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .live__search.field { flex: 0 1 340px; }
}

/* P/TP portrait: the stage is pinned under the header with the compact now bar, on a glass band of the page's own
   dark tone (so rows scrolled under it do not show through); pills and the list scroll below it. */
@media (max-width: 860px) and (orientation: portrait) {
  .live { padding-top: var(--header-h); }
  .live__main {
    order: -1; position: sticky; top: var(--header-h); z-index: var(--z-sticky); max-width: none;
    margin: 0 calc(-1 * var(--gutter)); padding-bottom: 12px;
    background: rgba(var(--amb-2), .82); box-shadow: 0 1px 0 var(--glass-line), 0 18px 30px -18px rgba(0, 0, 0, .6);
    -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  }
  .live__main .stage { border-radius: 0; box-shadow: none; }
  .live__now { margin-top: 10px; padding: 0 var(--gutter); }
  /* Whatever is brought into view must clear the pinned stage (16:9 of the width plus the now bar):
     a row, and every focus target, since focus scrolling reads the focused element's own margin. */
  .channel, .channel > button, .live__cat-track .chip, .live__picker select, .live__search input, .live__search .field__clear {
    scroll-margin-top: calc(var(--header-h) + 56.25vw + 76px);
    scroll-margin-bottom: calc(var(--tabbar-total) + 8px);
  }
  /* The list scrolls with the page: a calm fill instead of a blur over a tall moving panel. */
  .live__list { max-width: none; background: rgba(255, 255, 255, .045); box-shadow: inset 0 0 0 1px var(--glass-line); }
}
/* Portrait tablets: the stage inset with its rounded corners. */
@media (min-width: 600px) and (max-width: 860px) and (orientation: portrait) {
  .live__main { padding: 12px var(--gutter) 14px; }
  .live__main .stage { border-radius: 16px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .07); }
  .live__now { padding: 0 4px; }
}

/* ≥861: the full now-playing card (glass), the big name, EN VIVO, the labelled pill where there is room. */
@media (min-width: 861px) {
  .live { gap: 24px; padding-top: calc(var(--header-h) + 24px); }
  .live__now {
    grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; margin-top: 16px; padding: 14px 16px 14px 14px;
    border-radius: 18px; background: var(--live-glass); box-shadow: var(--live-glass-ring), var(--glass-shadow);
    -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  }
  .live__now-logo { width: 64px; height: 64px; border-radius: 14px; font-size: 16px; }
  .live__now-logo img { max-width: 50px; max-height: 40px; }
  .live__now-over { display: flex; }
  .live__now-name { font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
  .live__now-sub { margin-top: 4px; font-size: 15px; line-height: 1.4; }
  .live__now .live__now-btn { width: 48px; height: 48px; }
  .live__now-btn .icon { width: 21px; height: 21px; }
  .live__list { backdrop-filter: var(--glass-filter); -webkit-backdrop-filter: var(--glass-filter); }
  .channel, .channel > button { scroll-margin: calc(var(--header-h) + 8px) 0 8px; }
  .live__cat-track .chip, .live__picker select, .live__search input, .live__search .field__clear { scroll-margin-top: calc(var(--header-h) + 8px); }
}
/* 861–1023 landscape, one column: the stage gives way so the list's heading and first rows stay on screen. */
@media (min-width: 861px) and (max-width: 1023px) and (orientation: landscape) {
  .live__main {
    width: 100%; margin: 0 auto; max-width: 960px;
    max-width: min(960px, calc((100vh - var(--header-h) - 370px) * 16 / 9));
    max-width: min(960px, max(560px, calc((100svh - var(--header-h) - 370px) * 16 / 9)));
  }
}

/* ≥1024 landscape: stage and panel side by side in one screen; the list scrolls inside the panel. The page is one
   viewport tall, so the panel ends on screen whatever the pills measure. Portrait screens this wide keep the one
   column above (a side-by-side stage would be tiny there). */
@media (min-width: 1024px) and (orientation: landscape) {
  .live {
    display: grid; grid-template-areas: "cats cats" "main list";
    grid-template-columns: minmax(0, 1fr) clamp(340px, 29vw, 420px); grid-template-rows: auto minmax(0, 1fr);
    gap: 24px 28px; align-items: start;
    height: calc(100vh - var(--tabbar-total));
    height: calc(100svh - var(--tabbar-total));
    padding: calc(var(--header-h) + 24px) var(--gutter) 24px;
  }
  .live__cats { grid-area: cats; }
  /* Wide but short windows: the stage shrinks so it and the now card stay on screen. */
  .live__main {
    grid-area: main; position: sticky; top: calc(var(--header-h) + 16px);
    max-width: calc((100vh - var(--header-h) - 250px) * 16 / 9);
    max-width: max(480px, calc((100vh - var(--header-h) - 250px) * 16 / 9));
    max-width: max(480px, calc((100svh - var(--header-h) - 250px) * 16 / 9));
  }
  .live__list { grid-area: list; align-self: stretch; min-height: 0; max-width: none; padding: 16px 6px 6px; }
  .live__list-head { padding: 0 8px; margin-bottom: 12px; }
  .live__status, .live__list-head { flex: none; }
  .live__channels {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    margin: 0 -2px; padding: 0 2px 20px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent;
    -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(180deg, #000 calc(100% - 28px), transparent);
  }
  .channel, .channel > button { scroll-margin: 8px 0 28px; }
  /* The footer would add a page scroll that pushes the pills and the search off the top. Engines without :has()
     keep it. */
  #view:has(> .live) + .footer { display: none; }
  #main:has(> #view > .live) { padding-bottom: 0; }
}

@media (min-width: 1120px) and (orientation: landscape) and (hover: hover) and (pointer: fine) { .live__hint { display: block; } }

/* Room for "Canal anterior" beside the star; a slimmer panel gives the stage more width. */
@media (min-width: 1240px) {
  .live__now .live__now-prev { width: auto; padding: 0 20px 0 16px; }
  .live__now-label { display: inline; }
}
@media (min-width: 1240px) and (orientation: landscape) {
  .live { grid-template-columns: minmax(0, 1fr) clamp(320px, 25vw, 380px); column-gap: 24px; }
}

/* ------------------------------------------------------- no blur here */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .live__picker .picker, .live__picker .picker[data-set] { background: rgba(60, 60, 68, .92); }
  .live-digits { background: rgba(28, 28, 34, .94); }
}
/* Only where the panel and the now card are frosted: below 861 the now bar has no card and the list a calm fill. */
@media (min-width: 861px) {
  @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .live__list, .live__now { background: var(--glass-solid); }
  }
}
@media (max-width: 860px) and (orientation: portrait) {
  @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .live__main { background: rgb(var(--amb-2)); } }
}

/* ---------------------------------------------------------------- TV */
/* 10 feet: the same look, scaled by --tvu; solid translucent glass (no blur on TV browsers). */
html.is-tv .live { --live-row-h: calc(76px * var(--tvu)); padding-top: calc(var(--header-h) + 24px * var(--tvu)); }
html.is-tv .live__hint { display: none; }
html.is-tv .live__cat-track .chip { height: var(--control); padding: 0 calc(24px * var(--tvu)); font-size: var(--fs-callout); }
html.is-tv .live__cat-track .chip .icon { width: calc(20px * var(--tvu)); height: calc(20px * var(--tvu)); }
html.is-tv .live__picker .picker, html.is-tv .live__picker .picker[data-set] {
  height: var(--control); padding: 0 calc(18px * var(--tvu)) 0 calc(24px * var(--tvu)); font-size: var(--fs-callout);
  background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: none; backdrop-filter: none;
}
html.is-tv .live__picker .picker:focus-within { background: #fff; color: #111114; }
html.is-tv .live__picker .picker:focus-within .icon { color: #111114; }
html.is-tv .live__list, html.is-tv .live__now {
  background: rgba(40, 40, 48, .5); -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: var(--live-glass-ring), 0 24px 60px -16px rgba(0, 0, 0, .5);
}
html.is-tv .live__list { padding: calc(18px * var(--tvu)) calc(8px * var(--tvu)) calc(8px * var(--tvu)); border-radius: calc(22px * var(--tvu)); }
html.is-tv .live__list-head { padding: 0 calc(10px * var(--tvu)); gap: calc(14px * var(--tvu)); margin-bottom: calc(14px * var(--tvu)); }
html.is-tv .live__list-head h2 { font-size: var(--fs-title-3); }
html.is-tv .live__count { font-size: var(--fs-callout); }
html.is-tv .live__search.field { height: var(--control); padding: 0 calc(16px * var(--tvu)); border-radius: calc(14px * var(--tvu)); }
html.is-tv .live__search .icon { width: calc(22px * var(--tvu)); height: calc(22px * var(--tvu)); }
html.is-tv .live__search .field__clear { width: var(--control); height: var(--control); }
html.is-tv .live__search.field:focus-within { box-shadow: 0 0 0 3px var(--focus); }
html.is-tv .live__now {
  grid-template-columns: calc(84px * var(--tvu)) minmax(0, 1fr) auto; gap: calc(20px * var(--tvu));
  margin-top: calc(20px * var(--tvu)); padding: calc(16px * var(--tvu)) calc(20px * var(--tvu)) calc(16px * var(--tvu)) calc(16px * var(--tvu));
  border-radius: calc(22px * var(--tvu));
}
html.is-tv .live__now-logo { width: calc(84px * var(--tvu)); height: calc(84px * var(--tvu)); border-radius: calc(18px * var(--tvu)); }
html.is-tv .live__now-logo img { max-width: calc(66px * var(--tvu)); max-height: calc(50px * var(--tvu)); }
html.is-tv .live__now-over { display: flex; font-size: calc(16px * var(--tvu)); gap: calc(9px * var(--tvu)); margin-bottom: calc(8px * var(--tvu)); }
html.is-tv .live__dot { width: calc(10px * var(--tvu)); height: calc(10px * var(--tvu)); }
html.is-tv .live__now-name { font-size: var(--fs-title-2); }
html.is-tv .live__now-sub { font-size: var(--fs-callout); }
html.is-tv .live__now .live__now-btn { width: var(--control); height: var(--control); }
html.is-tv .live__now .live__now-prev { width: auto; padding: 0 calc(24px * var(--tvu)) 0 calc(20px * var(--tvu)); font-size: var(--fs-callout); }
html.is-tv .live__now-label { display: inline; }
html.is-tv .live__now-btn .icon { width: calc(24px * var(--tvu)); height: calc(24px * var(--tvu)); }
html.is-tv .channel { gap: calc(8px * var(--tvu)); }
html.is-tv .channel__tune {
  grid-template-columns: calc(52px * var(--tvu)) calc(64px * var(--tvu)) minmax(0, 1fr); gap: calc(14px * var(--tvu));
  padding: 0 calc(16px * var(--tvu)) 0 calc(8px * var(--tvu)); border-radius: calc(18px * var(--tvu));
}
html.is-tv .live__channels--nonum .channel__tune { grid-template-columns: calc(64px * var(--tvu)) minmax(0, 1fr); padding-left: calc(14px * var(--tvu)); }
html.is-tv .channel__num { font-size: var(--fs-caption); }
html.is-tv .channel__logo { width: calc(64px * var(--tvu)); height: calc(48px * var(--tvu)); padding: calc(5px * var(--tvu)); border-radius: calc(12px * var(--tvu)); font-size: var(--fs-caption); }
html.is-tv .channel__logo img { border-radius: calc(7px * var(--tvu)); }
html.is-tv .channel__name { font-size: var(--fs-callout); }
html.is-tv .channel__now { margin-top: calc(6px * var(--tvu)); font-size: calc(16px * var(--tvu)); gap: calc(8px * var(--tvu)); }
html.is-tv .channel__now::before { width: calc(9px * var(--tvu)); height: calc(9px * var(--tvu)); }
html.is-tv .channel__fav { width: calc(48px * var(--tvu)); height: calc(48px * var(--tvu)); margin-right: calc(6px * var(--tvu)); }
html.is-tv .channel__fav .icon { width: calc(22px * var(--tvu)); height: calc(22px * var(--tvu)); }
html.is-tv .live-digits { background: rgba(28, 28, 34, .9); -webkit-backdrop-filter: none; backdrop-filter: none; }
html.is-tv .live__status .empty__icon { width: calc(72px * var(--tvu)); height: calc(72px * var(--tvu)); }
@media (min-width: 1024px) and (orientation: landscape) {
  /* A wide panel: channel names are read from 10 feet. */
  html.is-tv .live {
    grid-template-columns: minmax(0, 1fr) calc(520px * var(--tvu)); gap: calc(24px * var(--tvu)) calc(32px * var(--tvu));
    padding-bottom: calc(28px * var(--tvu));
  }
  /* The stage leaves room for the pills (56), the now card (116) and the gaps, so nothing scrolls the page.
     The first line is for engines without max() (Chromium < 79). */
  html.is-tv .live__main {
    max-width: calc((100vh - var(--header-h) - 276px * var(--tvu)) * 16 / 9);
    max-width: max(480px, calc((100vh - var(--header-h) - 276px * var(--tvu)) * 16 / 9));
    max-width: max(480px, calc((100svh - var(--header-h) - 276px * var(--tvu)) * 16 / 9));
  }
  html.is-tv .live__channels { padding-bottom: calc(24px * var(--tvu)); }
  html.is-tv .channel, html.is-tv .channel > button { scroll-margin: calc(8px * var(--tvu)) 0 calc(24px * var(--tvu)); }
}

/* ---------------------------------------------------- short landscape */
/* Phones on their side: stage left, the jump list and the list right, all inside the viewport. Nothing sticks;
   pills, now card and hint give way. Last, so it beats every tier above. */
@media (orientation: landscape) and (max-height: 500px) {
  .live {
    display: grid; grid-template-areas: "main cats" "main list";
    grid-template-columns: minmax(0, 60%) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    gap: 8px 16px; align-items: start;
    height: calc(100vh - var(--tabbar-total));
    height: calc(100svh - var(--tabbar-total));
    padding: calc(var(--header-h) + 8px) var(--gutter) 8px;
  }
  .live__cats { grid-area: cats; }
  .live__cat-track, .live__now, .live__hint { display: none; }
  .live__picker .picker__text { max-width: 22ch; }
  .live__main {
    grid-area: main; order: 0; position: static; margin: 0; padding: 0; background: none; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    width: min(100%, calc((100vh - var(--header-h) - var(--tabbar-total) - 16px) * 16 / 9));
    width: min(100%, calc((100svh - var(--header-h) - var(--tabbar-total) - 16px) * 16 / 9));
    max-width: none;
  }
  .live__main .stage { border-radius: 14px; }
  .live__list { grid-area: list; align-self: stretch; position: static; height: auto; min-height: 0; max-width: none; padding: 8px 4px 4px; border-radius: 14px; }
  .live__list-head { flex: none; flex-direction: row; align-items: center; gap: 8px; margin-bottom: 6px; padding: 0 4px; }
  .live__list-head h2 { flex: none; font-size: 15px; }
  .live__count { font-size: 13px; }
  /* Keeps the 44px field: its 44px clear button would stick out of a shorter one, and touch needs 44. */
  .live__search.field { flex: 1 1 auto; min-width: 0; }
  .live__status { flex: none; }
  .live__status .empty { padding: 16px 8px; }
  .live__channels {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: 16px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent;
    -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(180deg, #000 calc(100% - 16px), transparent);
  }
  .channel, .channel > button { scroll-margin: 4px 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .live-digits { animation: none; }
  .channel__tune, .channel__fav { transition: none; }
}

/* Engines without aspect-ratio (Chromium < 88: older Tizen and webOS TVs) would give the stage no
   height, since everything in it is absolute: an in-flow spacer 56.25% of its width holds it open.
   ::after is free (::before is the "preparing" shade); in full screen the UA size wins and it is clipped. */
@supports not (aspect-ratio: 16 / 9) {
  .stage--inline::after { content: ""; display: block; padding-top: 56.25%; }
}
