/* =====================================================================
   shell.css: skip link, top bar, desktop sidebar, subnav, tab bar, page
   frame, footer, install dialog.
   Navigation by layout: phones (≤860) a bottom tab bar under a small top
   bar; tablets (861–1023) and TV mode the top bar with section pills;
   desktops the sidebar (an icon rail at 1024–1279, full from 1280).
   ===================================================================== */

/* ---------------------------------------------------------- skip link */
.skip {
  position: fixed; top: calc(var(--safe-t) + 8px); left: var(--gutter); z-index: var(--z-skip);
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: var(--radius-pill);
  background: var(--inverse); color: var(--on-inverse); font: 600 15px/1 var(--font);
  transform: translateY(calc(-100% - 24px - var(--safe-t)));
}
.skip:focus { transform: none; }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-header); isolation: isolate;
  padding: var(--safe-t) var(--gutter) 0;
  transition: transform var(--dur-3) var(--ease-std);
}
.topbar::before {
  content: ""; position: absolute; inset: 0 0 -48px 0; z-index: -1; pointer-events: none;
  background: var(--scrim-top); transition: opacity var(--dur-3) var(--ease-std);
}
/* Solid state (scrolled, or a page without artwork): frosted glass in the page's own dark tone (ambient.js
   --amb-2), dense enough that the section chips stay legible over the rows scrolling under them. */
.topbar::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(var(--amb-2), .74); box-shadow: 0 1px 0 var(--glass-line);
  opacity: 0; transition: opacity var(--dur-3) var(--ease-std);
}
.topbar.is-solid::before { opacity: 0; }
.topbar.is-solid::after { opacity: 1; }
.topbar__bar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 40px;
  transition: opacity var(--dur-2);
}
/* Sections + search + account: a plain stretch of the bar here, the centred capsule in TV mode (below). */
.topbar__pill { flex: 1; min-width: 0; display: flex; align-items: center; gap: inherit; }

/* Scrolling down on phones tucks the brand row away; the section chips stay. */
@media (max-width: 860px) {
  html.has-subnav .topbar.is-tucked { transform: translateY(calc(-1 * var(--topbar-h))); }
  html.has-subnav .topbar.is-tucked .topbar__bar { opacity: 0; visibility: hidden; }
}

/* ‹ Volver (main.js): tablets and phones, on a title, a person, a saga or a collection (html.has-back). */
.topbar__back { display: none; }
@media (max-width: 1023px) {
  html.has-back:not(.is-tv) .topbar__back {
    display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin-right: -4px; border-radius: 50%;
    background: rgba(40, 40, 46, .5); color: #fff; box-shadow: inset 0 0 0 1px var(--glass-line), 0 4px 14px rgba(0, 0, 0, .25);
    -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
    transition: background-color var(--dur-2), transform var(--dur-1) var(--ease-std);
  }
  html.has-back:not(.is-tv) .topbar__back .icon { width: 20px; height: 20px; margin-left: -2px; stroke-width: 2.4; }
  html.has-back:not(.is-tv) .topbar__back:active { transform: scale(.94); }
}
@media (max-width: 1023px) and (pointer: coarse) { html.has-back:not(.is-tv) .topbar__back { width: 44px; height: 44px; } }
@media (max-width: 1023px) and (hover: hover) and (pointer: fine) { html.has-back:not(.is-tv) .topbar__back:hover { background: rgba(70, 70, 78, .62); } }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { html.has-back:not(.is-tv) .topbar__back { background: var(--glass-solid); } }

.brand { display: flex; align-items: center; gap: 10px; flex: none; font-weight: 700; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.brand__mark { width: 28px; height: 28px; color: var(--text); flex: none; }
html.is-tv .brand__mark { width: calc(36px * var(--tvu)); height: calc(36px * var(--tvu)); }
/* mipalco.tv lockup (ui.js brandLockup, 865.9 × 152): the top bar shows it, or only the mark where the nav needs the room. */
.brand__lockup { display: block; flex: none; width: 160px; height: 28px; }
html.is-tv .brand__lockup { width: calc(205px * var(--tvu)); height: calc(36px * var(--tvu)); }
.brand > .brand__mark { display: none; }

.nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
/* Section pills: 36px, the current one filled. */
.nav a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 18px;
  color: var(--text-light); font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: color var(--dur-2), background-color var(--dur-2), transform var(--dur-2) var(--ease-calm);
}
@media (pointer: coarse) { .nav a { height: 44px; border-radius: 22px; } }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--text); background: var(--fill-1); } }
.nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, .16); }
/* "TV en vivo": a live dot after the label (main.js). */
.nav__live { flex: none; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--live); }
html.is-tv .nav a { height: var(--control); padding: 0 calc(22px * var(--tvu)); border-radius: calc(var(--control) / 2); color: rgba(255, 255, 255, .86); font-size: var(--fs-callout); }
html.is-tv .nav a[aria-current="page"] { background: rgba(255, 255, 255, .2); color: #fff; }
html.is-tv .nav__live { width: calc(8px * var(--tvu)); height: calc(8px * var(--tvu)); margin-left: calc(8px * var(--tvu)); }
html.is-tv .nav a:focus-visible { outline: none; background: #fff; color: #111114; transform: scale(1.06); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }

.topbar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.topbar__install { height: 40px; padding: 0 14px; }
.topbar__install .icon { width: 18px; height: 18px; }
@media (pointer: coarse) { .topbar__install { height: 44px; } }
@media (max-width: 1279px) {
  .topbar__install { width: 40px; padding: 0; }
  .topbar__install .install-label { display: none; }
}
@media (max-width: 1279px) and (pointer: coarse) { .topbar__install { width: 44px; } }
/* The search icon opens #/search, whose own field takes the typing (TV mode: arrows cannot leave a text
   field). Desktops type in the sidebar's field instead (ui.js topbarSearch). */
.topbar__search-btn[aria-current="page"] { color: var(--text); background: var(--fill-1); }

/* 861–1119 (tablets; TV mode at that width): nav tightens, wordmark hides. */
@media (max-width: 1119px) {
  .topbar__bar { gap: 24px; }
  .nav a { padding: 0 10px; font-size: 14px; }
}
@media (min-width: 861px) and (max-width: 1119px) {
  .brand > .brand__lockup { display: none; }
  .brand > .brand__mark { display: block; }
}
/* ≤860: tab bar navigation; the top bar only keeps the brand, install and the account. */
@media (max-width: 860px) {
  .topbar__bar { gap: 12px; }
  .nav, .topbar__search-btn { display: none; }
}
/* Tablets and phones: a glass bar once the page moves (over the home hero it stays clear, on its scrim). */
.topbar::after { -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%); }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar::after { background: var(--chrome); }
}

/* TV mode: the floating pill tab bar of tvOS, centred at the top; the brand stays at the left. No blur on
   TV browsers: the capsule is a solid translucent grey, and once the page moves a soft fade in the page's
   own colour (ambient.js --amb-2) keeps a row scrolled under it from showing through. The focused item is a
   white pill with dark text; the current section keeps a light fill. focus.js reaches it with Up. */
html.is-tv .topbar::after {
  inset: 0 0 calc(-32px * var(--tvu)) 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  /* Solid down to just under the capsule, then a short fade: nothing scrolled under the bar shows through. */
  background: linear-gradient(180deg, rgb(var(--amb-2)) 0, rgb(var(--amb-2)) calc(100% - 32px * var(--tvu)), rgba(var(--amb-2), 0) 100%);
}
html.is-tv .topbar__bar { position: relative; justify-content: center; gap: 0; }
html.is-tv .topbar__bar > .brand { position: absolute; left: 0; top: calc(50% + 8px * var(--tvu)); transform: translateY(-50%); }
html.is-tv .topbar__pill {
  flex: none; margin-top: calc(16px * var(--tvu)); gap: calc(4px * var(--tvu)); padding: calc(6px * var(--tvu)); border-radius: var(--radius-pill);
  background: rgba(44, 44, 50, .8); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 12px 32px rgba(0, 0, 0, .35);
}
html.is-tv .topbar__pill .nav { gap: calc(2px * var(--tvu)); }
html.is-tv .topbar__end { margin-left: 0; gap: calc(4px * var(--tvu)); }
html.is-tv .topbar__end .btn--icon, html.is-tv .topbar__end .account__button { width: var(--control); height: var(--control); }

/* ------------------------------------------------------------ sidebar */
/* Desktops, not TV mode (main.js): a floating frosted-glass panel (tvOS 18), inset 12px from the window's
   top, left and bottom. The artwork and the ambient colours (.ambient, below) run under it from x = 0;
   the page's content starts beside it (#main pads by --shell-x, tokens.css). The player, dialogs and
   toasts sit above it (z-index tokens). The section list scrolls on its own on short windows; the foot
   stays, so the account panel that opens above it is never clipped. Hidden (html.is-nav-hidden, main.js)
   it slides out to the left and the chip (.nav-chip) takes its place. */
.sidebar { display: none; }
@media (min-width: 1024px) {
  html:not(.is-tv) .topbar { display: none; }
  html:not(.is-tv) .sidebar {
    position: fixed; top: calc(var(--safe-t) + 12px); bottom: 12px; left: max(12px, var(--safe-l)); z-index: var(--z-header);
    width: var(--sidebar-w); display: flex; flex-direction: column; padding: 14px 10px 10px;
    border-radius: 22px; background: var(--glass-panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 1px var(--glass-line), var(--glass-shadow);
    -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
  }
  html.is-nav-hidden:not(.is-tv) .sidebar { visibility: hidden; opacity: 0; transform: translateX(calc(-100% - 24px)); }
  html.nav-anim:not(.is-tv) .sidebar {
    transition: transform 240ms var(--ease-std), opacity 200ms var(--ease-std), visibility 0s linear 0s;
  }
  html.nav-anim.is-nav-hidden:not(.is-tv) .sidebar {
    transition: transform 220ms var(--ease-in), opacity 200ms var(--ease-in), visibility 0s linear 220ms;
  }
  /* The app shell's main only: the sign-in and boot-error screens have no sidebar. */
  html:not(.is-tv) #main { padding-left: var(--shell-x); }
}
/* Old browsers without backdrop-filter: the same panel, solid. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  html:not(.is-tv) .sidebar, html.is-nav-hidden:not(.is-tv) .nav-chip, html.is-nav-hidden:not(.is-tv) .nav-chip:hover { background: var(--glass-solid); }
}

/* Head: the mipalco.tv lockup (24px tall; the mark alone on the rail) and the hide button. */
.sidebar__head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; padding-left: 6px; }
.sidebar__brand { flex: none; display: flex; align-items: center; height: 32px; padding: 0 2px; border-radius: 8px; }
.sidebar__brand .brand__lockup { width: 137px; height: 24px; }
.sidebar__brand .brand__mark { display: none; width: 28px; height: 28px; }
.sidebar__toggle {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  color: rgba(255, 255, 255, .72); transition: background-color var(--dur-2), color var(--dur-2);
}
.sidebar__toggle .icon { width: 20px; height: 20px; }
@media (hover: hover) and (pointer: fine) { .sidebar__toggle:hover { background: rgba(255, 255, 255, .1); color: #fff; } }
.sidebar__toggle:active { background: rgba(255, 255, 255, .14); }
@media (pointer: coarse) { .sidebar__toggle { width: 44px; height: 44px; } }

/* Search field: drives #/search as the top bar field did (main.js runSearch). The iOS grey field. */
.sidebar__search {
  flex: none; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; margin-bottom: 14px;
  border-radius: 11px; background: rgba(118, 118, 128, .24); color: rgba(235, 235, 245, .6); cursor: text;
  transition: background-color var(--dur-2), box-shadow var(--dur-2);
}
.sidebar__search .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.sidebar__search input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: none;
  color: var(--text); font-size: 15px;
}
.sidebar__search input::placeholder { color: rgba(235, 235, 245, .6); }
.sidebar__search input::-webkit-search-cancel-button { display: none; }
.sidebar__search input:focus-visible { outline: none; box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .sidebar__search:hover { background: rgba(118, 118, 128, .3); } }
.sidebar__search:focus-within { background: rgba(118, 118, 128, .34); color: var(--text); box-shadow: 0 0 0 2px var(--focus); }
@media (pointer: coarse) { .sidebar__search { height: 44px; } }

/* Sections: icon + label, 40px rows, radius 12; the current one a solid white pill with near-black text
   (tvOS 18). Side padding keeps focus rings inside the scroller. */
.sidebar__nav {
  flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px;
  margin: -4px -4px 0; padding: 4px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
}
.sidebar__nav::-webkit-scrollbar { display: none; }
.sidebar__item {
  position: relative; flex: none; display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 12px;
  border-radius: 12px; color: rgba(255, 255, 255, .92); font-size: 15px; font-weight: 500; line-height: 1; text-align: left; white-space: nowrap;
  transition: background-color var(--dur-2), color var(--dur-2);
}
.sidebar__item .icon { flex: none; width: 20px; height: 20px; opacity: .85; }
.sidebar__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sidebar__item .nav__live { margin-left: -4px; }
.sidebar__item--search { display: none; }
@media (hover: hover) and (pointer: fine) { .sidebar__item:hover { background: rgba(255, 255, 255, .1); color: #fff; } }
.sidebar__item:active { background: rgba(255, 255, 255, .14); }
.sidebar__item[aria-current="page"] { background: #fff; color: #111114; font-weight: 600; box-shadow: 0 4px 14px rgba(0, 0, 0, .22); }
.sidebar__item[aria-current="page"] .icon { opacity: 1; stroke-width: 2; }
/* The section a title page or Mi cuenta was opened from (main.js), as the chip names it: a quiet fill. */
.sidebar__item.is-origin { background: rgba(255, 255, 255, .12); color: #fff; }
.sidebar__item:focus-visible { outline-offset: 1px; box-shadow: none; }
@media (pointer: coarse) { .sidebar__item { height: 44px; } }
/* "Tu biblioteca": a quiet group label (sentence case, as tvOS). */
.sidebar__label { margin: 18px 12px 6px; color: rgba(235, 235, 245, .5); font-size: 13px; font-weight: 600; line-height: 1.2; }

/* Foot: install, Conectar una TV, then the account row. */
.sidebar__foot { flex: none; display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding-top: 10px; box-shadow: 0 -1px 0 var(--glass-line); }
.sidebar__install .install-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Account row (accountmenu.js, row): 32px avatar, name, chevron; its panel opens above. Selectors carry
   .sidebar to win over the round top bar button in auth.css (loaded later). */
.sidebar .account__button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 8px;
  border-radius: 12px; text-align: left; transition: background-color var(--dur-2);
}
.sidebar .account__button:active { transform: none; background: rgba(255, 255, 255, .14); }
.sidebar .account__button .avatar { width: 32px; height: 32px; font-size: 12px; }
.sidebar .account__button:focus-visible { outline-offset: 1px; box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .sidebar .account__button:hover { background: rgba(255, 255, 255, .1); } }
.sidebar .account__button[aria-expanded="true"], .sidebar .account__button.is-current { background: rgba(255, 255, 255, .14); }
.account__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 15px; font-weight: 500; }
.account__chevron { flex: none; width: 16px; height: 16px; color: var(--text-3); }
.sidebar .account-menu {
  top: auto; bottom: calc(100% + 8px); left: 0; right: auto; width: 264px; transform-origin: bottom left;
  background: rgba(40, 40, 46, .985); box-shadow: inset 0 0 0 1px var(--glass-line), var(--glass-shadow);
}

/* 1024–1279: a 68px icon rail, the same glass. Labels give way to tooltips (main.js railTitles) and the links'
   aria-labels; the search field to a search icon; the library label to a hairline; the hide button sits
   under the mark. */
@media (min-width: 1024px) and (max-width: 1279px) {
  html:not(.is-tv) .sidebar { padding: 12px 10px 10px; }
  .sidebar__head { flex-direction: column; gap: 8px; margin-bottom: 12px; padding: 0; }
  .sidebar__brand { justify-content: center; padding: 0; }
  .sidebar__toggle { width: 48px; height: 36px; border-radius: 12px; }
  .sidebar__brand .brand__lockup, .sidebar__search, .sidebar__text, .sidebar__install .install-label, .account__chevron { display: none; }
  .sidebar__brand .brand__mark { display: block; }
  .sidebar__item--search { display: flex; }
  .sidebar__item { justify-content: center; padding: 0; }
  .sidebar__item .nav__live { position: absolute; top: 9px; right: 9px; margin: 0; }
  .sidebar__label { height: 1px; margin: 10px 8px; overflow: hidden; color: transparent; background: var(--glass-line); }
  .sidebar .account__button { justify-content: center; padding: 0; }
  /* The name stays for screen readers (it names the button). */
  .account__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* --------------------------------------------------------- sidebar chip */
/* The hidden sidebar's handle (tvOS): "‹ [icon] Inicio", a small glass capsule at the top left. */
.nav-chip { display: none; }
@media (min-width: 1024px) {
  /* On the content's gutter (its ‹ over the copy's left edge, 1.webp), not in the window's corner. */
  html.is-nav-hidden:not(.is-tv) .nav-chip {
    position: fixed; top: calc(var(--safe-t) + 18px); left: max(16px, var(--safe-l), calc(var(--content-x) - 14px)); z-index: var(--z-header);
    display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px 0 6px; border-radius: var(--radius-pill);
    background: var(--glass-bar); color: #fff; font-size: 15px; font-weight: 600; line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 0 0 1px var(--glass-line), var(--glass-shadow);
    -webkit-backdrop-filter: var(--glass-filter); backdrop-filter: var(--glass-filter);
    transition: background-color var(--dur-2), transform var(--dur-1) var(--ease-std);
  }
  html.nav-anim.is-nav-hidden:not(.is-tv) .nav-chip { animation: chip-in 260ms var(--ease-calm) 80ms both; }
}
.nav-chip__chevron { width: 16px; height: 16px; margin-left: 2px; stroke-width: 2.4; opacity: .7; transition: transform var(--dur-2) var(--ease-calm); }
.nav-chip__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.nav-chip__icon .icon { width: 16px; height: 16px; stroke-width: 2; }
@media (hover: hover) and (pointer: fine) {
  .nav-chip:hover { background: rgba(60, 60, 68, .62); }
  .nav-chip:hover .nav-chip__chevron { transform: translateX(-2px); opacity: 1; }
}
.nav-chip:active { transform: scale(.97); }
@keyframes chip-in { from { opacity: 0; transform: translateX(-12px); } }
@media (prefers-reduced-motion: reduce) {
  html.nav-anim:not(.is-tv) .sidebar, html.nav-anim.is-nav-hidden:not(.is-tv) .sidebar { transition: none; }
  html.nav-anim.is-nav-hidden:not(.is-tv) .nav-chip { animation: none; }
}

/* ------------------------------------------------------------- ambient */
/* The page's colours (ambient.js): fixed behind everything, two layers that crossfade. Each is the dark tone,
   the artwork itself blurred (web only), then soft glows of the main colour (top left) and the accent (top
   right) fading to near-black lower down, so rows and the sidebar's glass are tinted like the art. */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: #060608; transform: translateZ(0); }
.ambient__layer {
  --a1: var(--amb-1); --a2: var(--amb-2); --a3: var(--amb-3);
  position: absolute; inset: 0; opacity: 0; background: rgb(var(--a2));
  transition: opacity 900ms var(--ease-std);
}
.ambient__layer.is-on { opacity: 1; }
.ambient__layer::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(75% 65% at 0% 0%, rgba(var(--a1), .9) 0, rgba(var(--a1), .4) 45%, rgba(var(--a1), 0) 100%),
    radial-gradient(70% 60% at 100% 0%, rgba(var(--a3), .8) 0, rgba(var(--a3), .3) 45%, rgba(var(--a3), 0) 100%),
    linear-gradient(180deg, rgba(6, 6, 8, 0) 0, rgba(6, 6, 8, .25) 45%, rgba(6, 6, 8, .78) 100%);
}
.ambient__art {
  position: absolute; top: -10%; left: -10%; width: 120%; height: 120%; max-width: none; object-fit: cover;
  filter: blur(60px) saturate(1.4) brightness(.5); opacity: .5;
}
html.is-tv .ambient__art { display: none; }
@media (prefers-reduced-motion: reduce) { .ambient__layer { transition: none; } }

@media (max-width: 379px) {
  .brand > .brand__lockup { display: none; }
  .brand > .brand__mark { display: block; }
}

/* ------------------------------------------------------------- subnav */
.subnav {
  display: none; height: var(--subnav-h); align-items: center; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav .chip { position: relative; height: 40px; }
.subnav .chip::before { content: ""; position: absolute; inset: -2px 0; }
@media (max-width: 860px) { html.has-subnav .subnav { display: flex; } }
/* Over the home hero the chips need their own backing to stay legible. */
.topbar:not(.is-solid) .subnav .chip:not([aria-current="page"]) {
  background: rgba(0, 0, 0, .38); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), var(--shadow-1); color: #fff;
}

/* ------------------------------------------------------------ tab bar */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar {
    position: fixed; inset: auto 0 0 0; z-index: var(--z-tabbar);
    height: var(--tabbar-total); padding: 0 max(8px, var(--safe-r)) var(--safe-b) max(8px, var(--safe-l));
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: rgba(var(--amb-2), .7); box-shadow: 0 -1px 0 var(--glass-line);
    -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
  }
  html.is-tv .tabbar { display: none; }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tabbar { background: rgba(0, 0, 0, .9); }
}
/* Grey icons and labels; the current tab in white with a bolder stroke (no pill). */
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--tabbar-h); color: var(--text-3); font-size: 11px; font-weight: 500; line-height: 1;
  -webkit-tap-highlight-color: transparent; transition: color var(--dur-2);
}
.tabbar__pill {
  display: flex; align-items: center; justify-content: center; width: 56px; height: 30px;
  transition: transform var(--dur-1) var(--ease-std);
}
.tabbar__pill .icon { width: 26px; height: 26px; }
.tabbar a[aria-current="page"] { color: var(--text); font-weight: 600; }
.tabbar a[aria-current="page"] .icon { stroke-width: 2.2; }
.tabbar a:active .tabbar__pill { transform: scale(.94); }
.tabbar a:focus-visible { outline-offset: -4px; box-shadow: none; }
@media (orientation: landscape) and (max-height: 500px) {
  .tabbar__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tabbar__pill { width: 48px; height: 28px; }
}

/* ------------------------------------------------------ expiry notice */
/* "Tu cuenta vence el 20 de noviembre…" (accountmenu.js expiryNotice): under the top bar, scrolling with the
   page, which moves down to make room for it (#view, below). Under the top bar's account menu and the player. */
.expiry-notice {
  position: absolute; top: calc(var(--header-h) + 12px); left: var(--content-x); right: var(--gutter); z-index: calc(var(--z-header) - 1);
  max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px;
  border-radius: var(--radius); background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(245, 196, 81, .45), var(--shadow-2);
  animation: fade-in var(--dur-3) var(--ease-calm);
}
.expiry-notice[hidden] { display: none; }
.expiry-notice > .icon { flex: none; width: 20px; height: 20px; color: #f5c451; }
.expiry-notice__text { flex: 1; min-width: 0; padding: 6px 0; font-size: 14px; line-height: 1.45; }
.expiry-notice__close {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text-2);
}
.expiry-notice__close .icon { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .expiry-notice__close:hover { color: var(--text); background: var(--fill-1); } }
html.is-tv .expiry-notice { max-width: calc(900px * var(--tvu)); gap: calc(16px * var(--tvu)); padding: calc(10px * var(--tvu)) calc(10px * var(--tvu)) calc(10px * var(--tvu)) calc(22px * var(--tvu)); }
html.is-tv .expiry-notice > .icon { width: calc(28px * var(--tvu)); height: calc(28px * var(--tvu)); }
html.is-tv .expiry-notice__text { font-size: var(--fs-callout); }
html.is-tv .expiry-notice__close { width: var(--control); height: var(--control); }
html.is-tv .expiry-notice__close:focus-visible { background: var(--inverse); color: var(--on-inverse); }

/* -------------------------------------------------------- page frame */
main { min-height: 100vh; min-height: 100svh; padding-bottom: calc(var(--tabbar-total) + 48px); }
#view:focus { outline: none; box-shadow: none; }
.page { animation: page-in var(--dur-3) var(--ease-calm); }
.page.is-restored { animation: none; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
.page--padded { padding: calc(var(--header-h) + 32px) var(--gutter) 0; }
@media (min-width: 861px) { .page--padded { padding-top: calc(var(--header-h) + 40px); } }
html.is-tv .page--padded { padding-top: calc(var(--header-h) + 56px * var(--tvu)); }
/* The expiry notice is up (accountmenu.js sets its height): the page starts under it. Inicio and a title's
   page keep their art under the top bar, where the notice just sits over the picture. */
html.has-expiry-notice:not([data-section="home"]):not([data-section="title"]) #view { padding-top: calc(var(--expiry-notice-h, 0px) + 12px); }
/* TV en vivo is one screen tall in these layouts (live.css), its list scrolling inside: it gives up the room it moved down. */
@media (min-width: 1024px), (orientation: landscape) and (max-height: 500px) {
  html.has-expiry-notice .live {
    height: calc(100vh - var(--tabbar-total) - var(--expiry-notice-h, 0px) - 12px);
    height: calc(100svh - var(--tabbar-total) - var(--expiry-notice-h, 0px) - 12px);
  }
}

/* ------------------------------------------------------------- footer */
.footer {
  position: relative; margin-top: 72px; padding: 48px var(--gutter) 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
/* The hairline on the content's gutters, level with the pages' own section lines. */
.footer::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: rgba(255, 255, 255, .12); }
.footer__brand { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; font-weight: 600; }
.footer__lockup { display: block; width: auto; height: 20px; }
html.is-tv .footer__lockup { height: calc(24px * var(--tvu)); }
.footer__links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer__link { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.footer__link .icon { display: none; }
@media (hover: hover) and (pointer: fine) { .footer__link:hover { color: var(--text); } }

/* ------------------------------------------------------ install dialog */
.modal {
  border: 0; padding: 0; margin: auto; background: transparent; color: var(--text);
  max-width: none; max-height: none; overflow: visible;
}
.modal::backdrop { background: rgba(0, 0, 0, .6); }
.modal--fallback {
  position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; background: rgba(0, 0, 0, .6);
}
.modal[open], .modal--fallback { animation: fade-in var(--dur-3) var(--ease-calm); }
.modal__box {
  width: min(440px, calc(100vw - 32px)); padding: 28px; border-radius: var(--radius-xl);
  background: var(--surface-2); box-shadow: var(--shadow-3);
}
html.is-tv .modal__box { width: calc(600px * var(--tvu)); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal__head h2 { font-size: var(--fs-title-3); line-height: var(--lh-title-3); font-weight: 600; padding-top: 8px; }
.modal__head .btn { margin: 0 -10px 0 0; }
.modal__steps { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 16px; }
.modal__steps li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; align-items: start; }
.modal__step-num {
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-3); color: var(--text); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.modal__step-text { padding-top: 4px; color: var(--text-soft); font-size: 15px; line-height: 1.5; }
.modal__step-text .icon { width: 18px; height: 18px; vertical-align: -3px; margin: 0 2px; }
.modal__note { margin: 0 0 20px; color: var(--text-3); font-size: 13px; }
