/* The browsing look: a header that sits over the banner and firms up as you scroll, plain text
   navigation, posters as media apps draw them, hero rows, and one set of easings for every
   movement. Loaded last, so it settles what the component layers before it leave open. Colours,
   fonts and corners still come from the theme. */

:root {
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --top-h: 4.5rem;
  /* This device's card size (the slider on library pages), 0.8 to 1.4. */
  --card-scale: 1;
}

/* ---------- Type ---------- */
body { text-rendering: optimizeLegibility; font-kerning: normal; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; }
p { text-wrap: pretty; }
.section > h2 { font-size: calc(var(--heading-size, var(--type-section, 1.25rem)) * var(--type-scale, 1)); line-height: 1.3; margin-bottom: 0.85rem; }
.home-section-description { font-size: var(--type-note); margin: -0.45rem 0 1rem; }
.muted, .help { letter-spacing: 0; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 30; isolation: isolate;
  min-height: var(--top-h); padding-block: 0.55rem; gap: 1.75rem;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(18px); backdrop-filter: saturate(1.3) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 40%, transparent);
  transition: background-color 0.4s var(--ease-out), border-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.top.scrolled { box-shadow: 0 10px 30px -18px rgb(0 0 0 / 0.55); }
/* Over the homepage banner: clear until the page moves, with a soft shade so the links read. */
.top.over-art:not(.scrolled):not(.nav-open) { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.top::before { content: ""; position: absolute; inset: 0 0 -3rem; z-index: -1; pointer-events: none; opacity: 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 72%, transparent), transparent); transition: opacity 0.4s var(--ease-out); }
.top.over-art:not(.scrolled)::before { opacity: 1; }
.top .wordmark { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.035em; }

/* Links as words, with a line that slides in under the current one. */
.top:not(.compact-nav) .nav { gap: 1.6rem; }
.top:not(.compact-nav) .nav a { position: relative; padding: 0.55rem 0; border-radius: 0; background: none;
  color: color-mix(in srgb, var(--text) 70%, transparent); font: 500 var(--type-note)/1.4 var(--font-body); transition: color 0.2s ease; }
.top:not(.compact-nav) .nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.15rem; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform 0.35s var(--ease-out), opacity 0.2s; }
.top:not(.compact-nav) .nav a:hover { color: var(--text); background: none; }
.top:not(.compact-nav) .nav a:hover::after { transform: scaleX(1); opacity: 0.35; }
.top:not(.compact-nav) .nav a[aria-current="page"] { color: var(--text); background: none; }
.top:not(.compact-nav) .nav a[aria-current="page"]::after { transform: scaleX(1); opacity: 1; }
.top:not(.compact-nav) .nav a > svg { display: none; }
/* Skip to content (index.html): out of sight until a keyboard reaches it, then over the logo. Not on a TV (one clear focus).
   A page's heading takes focus when a new page comes (main.js pageFocus) without a ring:
   it isn't a control. */
.skip-link { position: absolute; left: var(--gutter); top: 50%; z-index: 2; transform: translateY(-50%); }
.skip-link:not(:focus) { width: 1px; height: 1px; min-width: 0; min-height: 0; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html.tv .skip-link { display: none; }
[data-page-focus]:focus { outline: none; }
.top.compact-nav .nav { animation: menu-in 0.2s var(--ease-out); }

.top .search-form { position: relative; flex: 0 1 17rem; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-launchers { display: none; }
.top .search { height: var(--control-h); min-height: 0; padding: 0 1rem 0 2.5rem; border: 1px solid transparent; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 9%, transparent); color: var(--text);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.top .search:hover { background: color-mix(in srgb, var(--text) 13%, transparent); }
.top .search:focus { outline: 2px solid transparent; outline-offset: 2px; background: color-mix(in srgb, var(--bg) 70%, transparent); border-color: color-mix(in srgb, var(--text) 35%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.search-icon { position: absolute; left: 0.9rem; top: 50%; width: 1rem; height: 1rem; margin-top: -0.5rem; color: var(--muted); pointer-events: none; }

.admin-shortcut { width: var(--control-h); height: var(--control-h); min-width: 0; min-height: 0; padding: 0; border-radius: var(--control-radius); color: color-mix(in srgb, var(--text) 75%, transparent); }
/* The header's icons, all one size. */
.admin-shortcut svg, .top-icon svg, .search-close svg { width: 1.375rem; height: 1.375rem; }
.admin-shortcut:hover, .admin-shortcut[aria-current="page"] { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); }

/* The account: a round initial, the name inside the menu. */
.account-menu summary { width: var(--control-h); height: var(--control-h); min-height: 0; max-width: none; padding: 0; justify-content: center; border-radius: 50%;
  background: hsl(var(--avatar-hue, 150) 32% 38%); color: #fff; font: 600 1rem/1 var(--font-body); box-shadow: 0 0 0 2px transparent;
  transition: box-shadow 0.2s ease, transform 0.2s var(--ease-out); }
.account-menu summary:hover, .account-menu[open] summary { box-shadow: 0 0 0 2px color-mix(in srgb, var(--text) 55%, transparent); }
.account-menu summary #me-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.account-who { margin: 0 0 0.35rem; padding: 0.35rem 0.7rem 0.6rem; border-bottom: 1px solid var(--line); display: grid; gap: 0.1rem; }
.account-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Their picture fills the round button, and sits beside their name in the menu (profiles.js). */
.account-menu summary #me-avatar { display: grid; width: 100%; height: 100%; }
.account-menu summary #me-avatar .avatar { width: 100%; height: 100%; font-size: 1rem; }
.account-who:has(.avatar) { display: flex; align-items: center; gap: 0.65rem; }
.account-menu[open] .account-links { animation: menu-in 0.2s var(--ease-out); transform-origin: top right; }
/* More menus open the same way. */
details.more[open] > .more-menu { animation: more-in 0.18s var(--ease-out); }
/* Up and in only: util.js measures the menu as it opens to keep it on the screen. */
@keyframes more-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Cards ---------- */
.art { background: color-mix(in srgb, var(--text) 6%, var(--surface)); }
.art img[data-fade] { opacity: 0; transition: opacity 0.5s var(--ease-out), filter 0.25s ease; }
.art img[data-fade].loaded { opacity: 1; }
.card .art { transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out); }
.card:hover .art, .card:focus-visible .art { transform: translateY(-4px); box-shadow: 0 12px 22px -12px rgb(0 0 0 / 0.7), 0 0 0 2px color-mix(in srgb, var(--text) 75%, transparent); }
.card:focus-visible .art { outline: 2px solid transparent; outline-offset: 2px; box-shadow: 0 12px 22px -12px rgb(0 0 0 / 0.7), 0 0 0 3px var(--accent); }
.card:hover .art img { filter: brightness(1.06); }
/* Pictures that aren't cards but open like them (Coming soon, a channel in On now) lift the same way. */
:is(.upcoming-open, .live-tune) .art { transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out); }
:is(.upcoming-open, .live-tune):hover .art { transform: translateY(-4px); box-shadow: 0 12px 22px -12px rgb(0 0 0 / 0.7), 0 0 0 2px color-mix(in srgb, var(--text) 75%, transparent); }
/* Titles take one line and the line under it is always there, so rows never change height. */
.card h3 { margin: 0.6rem 0 0.1rem; font: 500 var(--type-note)/1.45 var(--font-body); letter-spacing: -0.005em; }
.card p { min-height: 1.45em; font-size: var(--type-caption); line-height: 1.45; }
.card.poster p + p { margin-top: 0; }
.progress { height: 3px; background: rgb(0 0 0 / 0.45); }
.progress span { border-radius: 0 2px 2px 0; background: var(--accent); }
/* Continue watching: a play mark over the picture when pointed at. The picture plays; the words
   under it open the episode's or film's page (views.js playCard). */
.card.resume > a { display: block; color: inherit; text-decoration: none; }
.card.resume .art::after { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / 0.35); opacity: 0; transition: opacity 0.25s ease; }
.card.resume .play-mark { position: absolute; z-index: 1; left: 50%; top: 50%; width: 3rem; height: 3rem; margin: -1.5rem 0 0 -1.5rem; border-radius: 50%;
  background: rgb(255 255 255 / 0.92); opacity: 0; transform: scale(0.85); transition: opacity 0.25s ease, transform 0.3s var(--ease-out); }
.card.resume .play-mark::after { content: ""; position: absolute; left: 1.15rem; top: 0.85rem; border-style: solid; border-width: 0.65rem 0 0.65rem 1rem; border-color: transparent transparent transparent #111; }
.card.resume .card-play:hover .art::after, .card.resume .card-play:focus-visible .art::after { opacity: 1; }
.card.resume .card-play:hover .play-mark, .card.resume .card-play:focus-visible .play-mark { opacity: 1; transform: none; }
/* Its ring is a shadow (below); the transparent outline is the one a Windows contrast theme paints. */
.card.resume .card-play:focus-visible { outline: 2px solid transparent; outline-offset: 2px; }
.card.resume .card-play:focus-visible .art { transform: translateY(-4px); box-shadow: 0 12px 22px -12px rgb(0 0 0 / 0.7), 0 0 0 3px var(--accent); }
.card.resume .card-about:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.card.resume .card-about:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
/* Without a pointer to hover with, the play mark is always there, smaller. */
@media (hover: none) { .card.resume .play-mark { opacity: 0.9; transform: scale(0.75); } }

/* This device's card size. */
.grid { grid-template-columns: repeat(auto-fill, minmax(calc(9.5rem * var(--card-scale)), 1fr)); gap: calc(2.2rem * var(--card-scale)) calc(1.5rem * var(--card-scale)); }
.home-section .row.posters { grid-auto-columns: calc(var(--card-size, clamp(8.5rem, 15cqw, 10.5rem)) * var(--card-scale)); }
.home-section .row.wide { --wide-track: calc(var(--card-size-wide, clamp(14rem, 24cqw, 18.5rem)) * var(--card-scale)); grid-auto-columns: var(--wide-track); }
.card-size { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: var(--type-caption); }
.toolbar .card-size { margin-left: auto; margin-right: 0.75rem; }
.toolbar .card-size + .sort { margin-left: 0; }
.card-size input { width: 7rem; }
.card-size .cs-small, .card-size .cs-large { flex: none; border: 1.6px solid currentColor; border-radius: 2px; }
.card-size .cs-small { width: 0.55rem; height: 0.8rem; }
.card-size .cs-large { width: 0.8rem; height: 1.15rem; }
@media (max-width: 640px) { .card-size { display: none; } }

/* ---------- Rows ---------- */
/* Room for a card to lift and ring without the row's edge clipping it. */
.home-section .row { padding: 0.55rem 0.35rem 1rem; margin: -0.55rem -0.35rem 0; scroll-padding-inline: 0.35rem; }
.home-section { padding-bottom: var(--section-space, 1.4rem); }
.home-section > h2 a { display: inline-flex; align-items: baseline; gap: 0.35rem; text-decoration: none; }
.home-section > h2 a::after { content: "›"; color: var(--muted); font-weight: 400; transition: transform 0.25s var(--ease-out), color 0.2s; }
.home-section > h2 a:hover { text-decoration: none; }
.home-section > h2 a:hover::after { transform: translateX(4px); color: var(--text); }
.rail-btn { width: var(--control-h); height: var(--control-h); border-radius: var(--control-radius); border: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
  background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--text);
  box-shadow: 0 8px 20px -8px rgb(0 0 0 / 0.6); transform: scale(0.88); transition: opacity 0.25s ease, transform 0.3s var(--ease-out), background-color 0.2s ease, color 0.2s ease; }
.rail:hover .rail-btn, .rail-btn:focus-visible { opacity: 1; transform: none; }
.rail-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.rail-btn:active { transform: scale(0.94); }

/* ---------- Banner ---------- */
/* Only the artwork runs under the header. Content determines the minimum space it
   needs on short windows and with large text. */
.home-page > .banner:first-child { margin: calc(-1 * var(--top-h)) 0 0; min-height: var(--banner-height, clamp(23rem, 56vh, 36rem)); border-radius: 0; }
.home-page > .banner:first-child .banner-text { padding-top: calc(var(--top-h) + env(safe-area-inset-top, 0px) + 1rem); padding-bottom: 4.5rem; max-width: 40rem; }
.home-page > .banner:first-child + .visually-hidden + .home-section { position: relative; z-index: 2; margin-top: 0; }
.home-page > .banner:first-child .banner-nav { bottom: 1.5rem; }
.banner { overflow: hidden; }
/* The new title fades in over the last, which stays put underneath until it's covered. */
.banner-slide { opacity: 0; visibility: hidden; z-index: 0; transition: opacity 1.1s var(--ease-in-out), visibility 0s linear 1.1s; }
.banner-slide.leaving { opacity: 1; visibility: visible; z-index: 1; transition: none; }
.banner-slide.leaving .banner-text { visibility: hidden; }
.banner-slide.shown { opacity: 1; visibility: visible; z-index: 2; transition: opacity 1.1s var(--ease-in-out), visibility 0s; }
.banner-nav { z-index: 4; }
.banner-art { transform-origin: 50% 0%; will-change: transform; }
.banner-slide.shown .banner-art, .banner-slide.leaving .banner-art { animation: ken-burns 14s linear both; }
@keyframes ken-burns { from { transform: scale(1); } to { transform: scale(1.025); } }
.banner-slide::after { background:
  linear-gradient(to right, color-mix(in srgb, var(--bg) 92%, transparent), color-mix(in srgb, var(--bg) 60%, transparent) 28%, transparent 62%),
  linear-gradient(to top, var(--bg) 2%, color-mix(in srgb, var(--bg) 55%, transparent) 22%, transparent 48%); }
.banner-text { gap: 0.7rem; min-width: 0; width: 100%; }
/* The eyebrow (docs/ui-consistency.md, "The eyebrow"): Home's banner label, a page's kind over its title (.eyebrow) and
   the party card's line are one look. A kicker that is a link (an episode's show, a book's series) stays a link. */
.banner-label, .eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--type-tiny); font-weight: 600; }
/* One big title: the name in large type, with a soft halo of the page's own colour so it reads
   over any picture; or the title's logo in its place, once the
   logo has shown it reads (views.js bigTitle). The name stays for screen readers. */
.banner-title { max-width: 16em; font-size: calc(clamp(2.5rem, 5.2vw, 4.4rem) * var(--type-scale, 1)); line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; margin: 0;
  overflow-wrap: anywhere; }
.banner-name { display: block; text-shadow: 0 2px 16px color-mix(in srgb, var(--bg) 60%, transparent), 0 1px 3px color-mix(in srgb, var(--bg) 45%, transparent); }
/* A long name a size down (views.js bigTitle), so it keeps to a few lines. */
.banner-title.long-title { font-size: calc(clamp(2rem, 3.6vw, 3rem) * var(--type-scale, 1)); line-height: 1.08; }
.banner-title.has-logo .banner-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.banner-title:not(.has-logo) .banner-logo { display: none; }
.banner-logo { display: block; max-width: min(28rem, 100%); max-height: clamp(4.5rem, 15vh, 9.5rem); width: auto; height: auto; object-fit: contain; object-position: left bottom;
  filter: drop-shadow(0 4px 18px rgb(0 0 0 / 0.55)); }
/* One line of facts: what doesn't fit goes, rather than wrapping. */
.banner-meta { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.35rem 0.65rem; max-width: 100%; overflow: hidden; white-space: nowrap;
  font-size: var(--type-note); color: color-mix(in srgb, var(--text) 86%, transparent); }
.banner-meta > * { flex: none; }
.banner-meta > .genre { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.banner-meta > span + span::before { content: "·"; margin-right: 0.65rem; color: var(--muted); }
/* .age-badge is drawn with .rating-box (style.css). */
.banner-meta > .age-badge + span::before, .banner-meta > span + .age-badge::before { content: none; }
.banner-meta .meta-star { display: inline-block; width: 0.85em; height: 0.85em; margin-right: 0.3em; vertical-align: -0.06em; background: var(--accent);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.banner-overview { font-size: 1rem; max-width: 34rem; color: color-mix(in srgb, var(--text) 86%, transparent); }
.banner .actions { gap: 0.6rem; margin-top: 0.35rem; }
.banner .actions > :is(a, button) { max-width: 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: center; }
.banner .actions .primary { padding-inline: 1.6rem; }
.banner .actions .primary::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 0.4rem 0 0.4rem 0.62rem; border-color: transparent transparent transparent currentColor; margin-right: 0.15rem; }
.banner .actions .ghost { background-color: color-mix(in srgb, var(--text) 18%, transparent); color: var(--text); }
.banner .actions .ghost:hover { background-color: color-mix(in srgb, var(--text) 26%, transparent); }
/* The owner's own slides (bannerView's ownSlide): their button goes somewhere rather than
   playing, so no play mark; without a picture, a wash of the accent behind the words. */
.banner-own .actions .primary::before, .banner .actions .primary.with-icon::before { content: none; }
.banner-own.no-art { background: radial-gradient(120% 90% at 85% 15%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%); }
.banner-own .banner-title { overflow-wrap: anywhere; }
/* The slide dashes: thin, quiet marks that fill while a title is up; the next one comes when the
   up dash is full. Small to look at, big to touch: each has an invisible 44 px tall target, its
   neighbours' meeting halfway. The native app's (HomeScreen.kt, BannerDashes) is the same size,
   spacing and colours: 3 high, 20 wide (32 for the one up), 6 apart, the text colour at 28 % and
   whole. */
.banner-nav { position: absolute; right: var(--gutter); bottom: 1.1rem; display: flex; align-items: center; gap: 0.7rem; }
.banner-nav .banner-dots { position: static; display: flex; gap: 6px; align-items: center; }
.banner-dot { position: relative; flex: none; width: 20px; height: 3px; border-radius: 99px; border: 0; background: color-mix(in srgb, var(--text) 28%, transparent);
  transition: width 0.4s var(--ease-out), background-color 0.2s; }
.banner-dot::before { content: ""; position: absolute; inset: -20.5px -3px; }
.banner-dot:hover { background: color-mix(in srgb, var(--text) 50%, transparent); }
.banner-dot[aria-current="true"] { width: 32px; }
.banner-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--text); transform: scaleX(0); transform-origin: left center; }
.banner-dot[aria-current="true"]::after { transform: scaleX(1); }
.banner.playing .banner-dot[aria-current="true"]::after { animation: banner-fill var(--banner-interval, 8s) linear both; }
.banner.paused .banner-dot[aria-current="true"]::after { animation-play-state: paused; }
@keyframes banner-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.banner-arrow { flex: none; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; padding: 0; border-radius: var(--control-radius);
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent); background: color-mix(in srgb, var(--bg) 62%, transparent); color: var(--text); cursor: pointer;
  opacity: 0.75; transition: opacity 0.25s ease, background-color 0.2s ease, color 0.2s ease; }
.banner:hover .banner-arrow, .banner-arrow:focus-visible { opacity: 1; }
.banner-arrow:hover { background: var(--text); color: var(--bg); }
.banner-arrow .chev { width: 0.5rem; height: 0.5rem; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: rotate(-45deg); margin-right: 0.2rem; }
.banner-arrow.prev .chev { transform: rotate(135deg); margin: 0 0 0 0.2rem; }
/* A phone swipes instead of arrows. A tablet has them too, always showing and big enough for a
   fingertip. */
@media (max-width: 640px) { .banner-arrow { display: none; } }
@media not (any-hover: hover) { .banner-arrow { opacity: 1; width: 2.75rem; height: 2.75rem; } }
/* A TV's banner is its first title alone, standing still, with no arrows or dashes
   (views.js bannerView): its Play, Details and Trailer are the remote's stops. */
html.tv .banner :is(a, button):focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.banner-slide.shown .banner-text > * { animation: rise-in 0.7s var(--ease-out) both; }
.banner-slide.shown .banner-text > :nth-child(2) { animation-delay: 0.08s; }
.banner-slide.shown .banner-text > :nth-child(3) { animation-delay: 0.14s; }
.banner-slide.shown .banner-text > :nth-child(n + 4) { animation-delay: 0.2s; }
/* A phone: the same big title, centred, with the facts and buttons under it and no story (the
   title's page has that). The picture's foot is shaded in the page's colour deep enough for the
   name to read over anything, it holds still (no slow zoom), and it scrolls away with the page. */
@media (max-width: 640px) {
  html:not(.tv) .home-page > .banner:first-child { min-height: var(--banner-height, clamp(24rem, 60svh, 31rem)); }
  html:not(.tv) .home-page > .banner:first-child .banner-text { padding-bottom: 3.5rem; }
  .home-page > .banner:first-child .banner-nav { left: var(--gutter); right: var(--gutter); justify-content: center; bottom: 1.5rem; }
  html:not(.tv) .banner-text { justify-items: center; max-width: none; text-align: center; gap: 0.6rem; }
  html:not(.tv) .banner-title { font-size: calc(clamp(2.1rem, 10vw, 2.9rem) * var(--type-scale, 1)); line-height: 1.05; }
  html:not(.tv) .banner-title.long-title { font-size: calc(clamp(1.7rem, 7.5vw, 2.2rem) * var(--type-scale, 1)); }
  html:not(.tv) .banner-logo { max-width: min(19rem, 100%); max-height: 6.5rem; object-position: center bottom; }
  /* The facts wrap when they don't fit (large text), not lose their ends. */
  html:not(.tv) .banner-meta { justify-content: center; font-size: var(--type-small); flex-wrap: wrap; white-space: normal; overflow: visible; }
  html:not(.tv) .banner-meta .genre { display: none; }
  html:not(.tv) .banner-overview { display: none; }
  html:not(.tv) .banner .actions { justify-content: center; }
  html:not(.tv) .banner-slide::after { background:
    linear-gradient(to top, var(--bg) 3%, color-mix(in srgb, var(--bg) 88%, transparent) 26%, color-mix(in srgb, var(--bg) 40%, transparent) 54%, transparent 74%),
    linear-gradient(to bottom, color-mix(in srgb, var(--bg) 50%, transparent), transparent 20%); }
  html:not(.tv) .banner-slide.shown .banner-art, html:not(.tv) .banner-slide.leaving .banner-art { animation: none; }
  html:not(.tv) .banner-art { will-change: auto; }
}

/* A title's page: its backdrop runs under the header as well. */
#page > .hero:first-child:not(.plain) { margin-top: calc(-1 * var(--top-h)); min-height: calc(clamp(18rem, 43vh, 28rem) + var(--top-h)); }
#page > .hero:first-child:not(.plain) .hero-inner { padding-top: calc(var(--top-h) + env(safe-area-inset-top, 0px) + 1rem); }

/* ---------- Collections: a tile each, as streaming apps have their brands ---------- */
.home-section .row.collections { grid-auto-columns: calc(clamp(15rem, 26cqw, 21rem) * var(--card-scale)); }
.rail:has(.row.collections) .rail-btn { top: calc(50% - 1.375rem); }
.collection-tile .art { aspect-ratio: 16 / 9; }
.collection-back { position: absolute; inset: 0; }
.collection-back img { position: absolute; object-fit: cover; }
.collection-back .cb-wide { inset: 0; width: 100%; height: 100%; filter: brightness(0.6) saturate(1.05); transform: scale(1.02);
  transition: opacity 0.5s var(--ease-out), transform 0.9s var(--ease-out), filter 0.4s ease; }
.collection-back .cb-tall { top: 13%; height: 74%; width: auto; aspect-ratio: 2 / 3; border-radius: 6px; box-shadow: 0 12px 22px -8px rgb(0 0 0 / 0.75);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }
.collection-back .cb-1 { right: 22%; transform: rotate(-5deg); }
.collection-back .cb-2 { right: 7%; transform: rotate(4deg); }
.collection-tile:hover .cb-wide, .collection-tile:focus-visible .cb-wide { transform: scale(1.08); filter: brightness(0.7) saturate(1.1); }
.collection-tile:hover .cb-1, .collection-tile:focus-visible .cb-1 { transform: rotate(-9deg) translate(-10px, -3px); }
.collection-tile:hover .cb-2, .collection-tile:focus-visible .cb-2 { transform: rotate(8deg) translate(6px, -3px); }
.collection-name { position: absolute; inset: auto 0 0 0; z-index: 1; display: grid; gap: 0.15rem; padding: 2.5rem 1rem 0.9rem; color: #fff;
  background: linear-gradient(to top, rgb(0 0 0 / 0.72), transparent); }
.collection-name strong { max-width: 62%; font: 700 1.2rem/1.2 var(--font-display); letter-spacing: -0.02em; text-shadow: 0 2px 10px rgb(0 0 0 / 0.5);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.collection-name span { font-size: var(--type-caption); opacity: 0.8; }

/* ---------- Loading ---------- */
.skeleton { pointer-events: none; }
.sk { border-radius: var(--media-radius); background: linear-gradient(100deg, color-mix(in srgb, var(--text) 6%, transparent) 30%, color-mix(in srgb, var(--text) 12%, transparent) 50%, color-mix(in srgb, var(--text) 6%, transparent) 70%);
  background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.sk-banner { height: clamp(24rem, 62vh, 40rem); margin: calc(-1 * var(--top-h)) 0 1.5rem; border-radius: 0; }
.sk-line { height: 1.1rem; width: 12rem; margin: 0 0 1rem; border-radius: 6px; }
.sk-line.short { width: 7rem; height: 0.8rem; margin: 0.6rem 0 0; }
.sk-row { display: flex; gap: 1.4rem; overflow: hidden; }
.sk-poster { flex: 0 0 calc(clamp(8.5rem, 15vw, 10.5rem) * var(--card-scale)); aspect-ratio: 2 / 3; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(9.5rem * var(--card-scale)), 1fr)); gap: calc(2.2rem * var(--card-scale)) calc(1.5rem * var(--card-scale)); }
.sk-hero { height: calc(clamp(18rem, 43vh, 28rem) + var(--top-h)); margin: calc(-1 * var(--top-h)) 0 2rem; border-radius: 0; }
.skeleton .sk-title { height: 2rem; width: min(22rem, 70%); margin: 0 0 1.5rem; border-radius: 8px; }
.sk-bar { height: 4.5rem; margin: 0 0 0.75rem; border-radius: var(--radius); }
.skeleton { animation: fade-in 0.4s ease both; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- Pages ---------- */
/* `backwards`, not `both`: a finished animation that holds its end state keeps an identity transform on the
   part, which makes it the containing block of anything fixed inside it (a title's More, a sheet on a phone). */
#page > * { animation: page-in 0.32s var(--ease-out) backwards; }
#page > *:nth-child(2) { animation-delay: 0.02s; }
#page > *:nth-child(3) { animation-delay: 0.04s; }
#page > *:nth-child(n + 4) { animation-delay: 0.06s; }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.home-page > .banner:first-child { animation: fade-in 0.7s ease both !important; }
html { scroll-padding-top: calc(var(--top-h) + 0.5rem); }
@media (prefers-reduced-motion: no-preference) { html:focus-within { scroll-behavior: smooth; } }

/* ---------- The page's scrollbar ---------- */
/* Thin and in the theme's colours on a computer with a mouse, so a laptop without a trackpad can
   still see and drag it, as the admin console has it (web #34). Touch screens and TVs scroll
   without one (admin.css hides it by default). Rows keep theirs hidden. */
@media (hover: hover) and (pointer: fine) {
  html:not(.tv) { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 50%, transparent) transparent; }
  html:not(.tv)::-webkit-scrollbar { display: block; width: 10px; }
  html:not(.tv)::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 50%, transparent); background-clip: content-box; border: 3px solid transparent; border-radius: 999px; }
  html:not(.tv)::-webkit-scrollbar-track { background: transparent; }
}

/* ---------- Everywhere ---------- */
a, button { -webkit-tap-highlight-color: transparent; }
.row { scroll-behavior: smooth; }
.hero-bg { transition: opacity 0.6s ease; }

@media (prefers-reduced-motion: reduce) {
  .top, .top::before, .top .nav a::after, .card .art, .art img[data-fade], .rail-btn, .banner-slide, .banner-dot, .banner-arrow, .home-expanded-card,
  .home-expand-pick .art img { transition: none !important; }
  .collection-back img { transition: none !important; }
  .banner-slide.shown .banner-art, .banner-slide.leaving .banner-art, .banner-slide.shown .banner-text > *, .home-expanded-copy, #page > *, .skeleton, .sk,
  .account-menu[open] .account-links, .top.compact-nav .nav, details.more[open] > .more-menu { animation: none !important; }
  .card:hover .art, .home-expand-pick:hover .art, :is(.upcoming-open, .live-tune):hover .art { transform: none; }
  :is(.upcoming-open, .live-tune) .art { transition: none; }
  .row { scroll-behavior: auto; }
}

@media (max-width: 900px) { .top.compact-nav { gap: 0.9rem; } }
@media (max-width: 640px) {
  .top, .top.compact-nav { gap: 0.55rem; }
  .top .wordmark { font-size: 1.4rem; }
  .top .search { padding-left: 2.2rem; padding-right: 0.6rem; }
  .search-icon { left: 0.75rem; }
}

/* ---------- Phones and touch tablets: a compact header, and tabs along the bottom (tabs.js) ---------- */
/* As streaming apps have it: the name, then search, casting, My list and the account,
   and Home and the site's links as tabs at the bottom, where a thumb reaches them, clear of the
   home indicator or gesture bar. Not on TVs (html.tv), which keep the header their remote moves
   around.
   A tablet is a touch screen from 641 to 1366 pixels wide (tabs.js TABLET): the same tabs in
   either orientation, so turning it round never moves anything. */
.top-icon, .search-close, .tab-bar { display: none; }
@media (max-width: 640px), (pointer: coarse) and (hover: none) and (max-width: 1366px) {
  html:not(.tv) { --tabs-h: 3.5rem; }
  html:not(.tv) #top > .wordmark { margin-right: auto; }
  html:not(.tv) #top .nav-toggle, html:not(.tv) #top .nav { display: none !important; }
  html:not(.tv) .top-icon:not([hidden]) { display: inline-grid; place-items: center; flex: none; width: var(--control-h); height: var(--control-h); padding: 0; border: 0; border-radius: var(--control-radius);
    background: none; color: var(--text); text-decoration: none; cursor: pointer; }
  html:not(.tv) .top-icon:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
  html:not(.tv) .top-icon[aria-current="page"] { color: var(--accent); }
  html:not(.tv) .top-icon.cast-slot google-cast-launcher { width: 1.5rem; height: 1.5rem; }


  html:not(.tv) .tab-bar:not([hidden]) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 0 max(0.25rem, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(0.25rem, env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: saturate(1.3) blur(18px); backdrop-filter: saturate(1.3) blur(18px);
    border-top: 1px solid color-mix(in srgb, var(--line) 45%, transparent); }
  /* Only the bar's: the Edit dialog's Details and Poster tabs are .tab too. */
  .tab-bar .tab { flex: 1 1 0; min-width: 0; box-sizing: border-box; min-height: var(--tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
    padding: 0.35rem 0.15rem; border: 0; border-radius: var(--radius); background: none; color: var(--muted); font: 500 var(--type-overline)/1.2 var(--font-body); text-decoration: none; cursor: pointer; }
  .tab-bar .tab svg { flex: none; width: 1.5rem; height: 1.5rem; fill: currentColor; }
  .tab-bar .tab span { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-bar .tab[aria-current="page"], .tab-bar .tab.is-current { color: var(--accent); }
  .tab-bar .tab:focus-visible { outline: 2px solid var(--ring); outline-offset: -3px; }
  /* A touch tablet's header: solid, without the blur (it redraws that on every frame the page moves).
     Over Home's banner or a title's picture it's see-through, and goes solid as the picture
     scrolls by (main.js --top-solid); its colour reaches up behind the status bar (the shadow).
     A phone's is glass (below). */
  html:not(.tv) .top { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  html:not(.tv) .top.over-art:not(.nav-open) { --tint: color-mix(in srgb, var(--bg) calc(var(--top-solid, 0) * 100%), transparent);
    background: var(--tint); border-bottom-color: color-mix(in srgb, var(--line) calc(var(--top-solid, 0) * 40%), transparent);
    box-shadow: 0 calc(-1 * env(safe-area-inset-top, 0px)) 0 0 var(--tint); }
  html:not(.tv) .top.over-art:not(.nav-open)::before { opacity: calc(1 - var(--top-solid, 0)); }
  html:not(.tv):has(> body > #top.top:not([hidden]))::before { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  html:not(.tv):has(> body > #top.over-art:not(.nav-open))::before { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  /* Room for the tabs at the end of every page, and above them for messages and save bars. */
  html:not(.tv) body:has(> .tab-bar:not([hidden])) { --tabs: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px)); }
  html:not(.tv) body:has(> .tab-bar:not([hidden])) > #page { padding-bottom: calc(3rem + var(--tabs-h)); }
  html:not(.tv) body:has(> .tab-bar:not([hidden])) > .toasts { bottom: calc(var(--tabs) + 1rem); }
  html:not(.tv) body:has(> .tab-bar:not([hidden])) .save-bar { bottom: calc(var(--tabs) + 0.75rem); }
}
/* A phone: search is an icon until it's wanted, and admin is in the account menu. */
@media (max-width: 640px) {
  /* A phone's header: the computer's glass (the page colour at 84% over the page blurred), with no line
     beneath, as the owner chose for phones (0.83.1). Over Home's banner or a title's picture it's
     see-through, and turns to that glass as the picture scrolls by (main.js --top-solid). The strip
     behind the status bar is the same glass, and clear over a picture. A touch tablet keeps its solid header. */
  html:not(.tv) .top { background: color-mix(in srgb, var(--bg) 84%, transparent); border-bottom-color: transparent;
    -webkit-backdrop-filter: saturate(1.3) blur(18px); backdrop-filter: saturate(1.3) blur(18px); }
  html:not(.tv) .top.over-art:not(.nav-open) { --tint: color-mix(in srgb, var(--bg) calc(var(--top-solid, 0) * 84%), transparent);
    border-bottom-color: transparent;
    -webkit-backdrop-filter: saturate(calc(1 + var(--top-solid, 0) * 0.3)) blur(calc(var(--top-solid, 0) * 18px));
    backdrop-filter: saturate(calc(1 + var(--top-solid, 0) * 0.3)) blur(calc(var(--top-solid, 0) * 18px)); }
  html:not(.tv):has(> body > #top.top:not([hidden]))::before { background: color-mix(in srgb, var(--bg) 84%, transparent);
    -webkit-backdrop-filter: saturate(1.3) blur(18px); backdrop-filter: saturate(1.3) blur(18px); }
  html:not(.tv):has(> body > #top.over-art:not(.nav-open))::before { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  /* A phone's posters (a library's and Requests' alike) are about Home's: three across from about 360 pixels,
     as the app's. On the narrowest, and at the largest card size, two still fit. */
  .grid, .sk-grid { grid-template-columns: repeat(auto-fill, minmax(min(calc(6rem * var(--card-scale)), calc((100% - 0.75rem * var(--card-scale)) / 2)), 1fr));
    gap: calc(1.6rem * var(--card-scale)) calc(0.75rem * var(--card-scale)); }
  /* Playlist browsing matches native phone rows; desktop and remote TV retain their tiles. */
  html:not(.tv) .pl-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  html:not(.tv) .pl-tile { display: grid; grid-template-columns: 5.25rem minmax(0, 1fr); column-gap: 1rem; row-gap: 0.25rem; padding-block: 0.625rem; }
  html:not(.tv) .pl-tile .collage { grid-row: 1 / span 2; width: 5.25rem; border-radius: var(--media-radius); }
  html:not(.tv) .pl-tile h3 { align-self: end; margin: 0; }
  html:not(.tv) .pl-tile p { align-self: start; }
  html:not(.tv) .pl-tile:hover .collage { transform: none; }
  html:not(.tv) #top { gap: 0.15rem; flex-wrap: nowrap; --control-h: 44px; }
  /* Let the server's mark fit the space left by the fixed-size actions. */
  html:not(.tv) #top > .wordmark { flex: 0 1 auto; min-width: 0; }
  html:not(.tv) #top .search-launchers { display: flex; align-items: center; flex: none; border-radius: 999px; background: color-mix(in srgb, var(--text) 9%, transparent); }
  html:not(.tv) #top .admin-shortcut { display: none !important; }
  html:not(.tv) #top:not(.search-open) .search-form { display: none; }
  /* Search opens over the header's row, with Close (a back arrow) at its left: the field's own clear cross stays at its
     right, so two crosses never sit side by side (panel 40). */
  html:not(.tv) #top.search-open > :not(.search-form) { visibility: hidden; }
  html:not(.tv) #top.search-open .search-form { position: absolute; inset: 0 var(--gutter); display: flex; align-items: center; gap: 0.35rem; }
  html:not(.tv) #top.search-open .search { flex: 1; min-width: 0; }
  html:not(.tv) #top.search-open .search-close { order: -1; display: inline-grid; place-items: center; flex: none; width: var(--control-h); height: var(--control-h); padding: 0; border: 0; border-radius: var(--control-radius);
    background: none; color: var(--text); cursor: pointer; }
  /* A short narrow window whatever the pointer (a computer at 400% zoom is 320 by 256; a phone on its side is wider and keeps
     it pinned): the header scrolls away with the page, the tabs are the 3rem bar (below) and the music bar is in its compact
     form (audio.css), so the page keeps most of the height. */
  @media (max-height: 30rem) {
    html:not(.tv) .top { position: relative; }
    html:not(.tv) { scroll-padding-top: 0.5rem; --under-top: 0px; }
  }
}

/* ---------- Tablets ---------- */
/* Designed for a hand, not a stretched phone or a squeezed desktop: the search box is always
   there in the header (there's room), and the tabs sit side by side with their names beside
   their icons, as iPad apps have them, in a bar the width of a comfortable reach. Cards, buttons
   and the player's controls are sized for a fingertip (44 px and up). */
@media (pointer: coarse) and (hover: none) and (min-width: 641px) and (max-width: 1366px) {
  html:not(.tv) { --tabs-h: 3.75rem; }
  html:not(.tv) #top { gap: 0.4rem; }
  html:not(.tv) #top .search-form { flex: 0 1 24rem; margin-left: 0; margin-right: 0.35rem; }
  html:not(.tv) #top .search { height: var(--control-h); }
  html:not(.tv) #top #search-open, html:not(.tv) #top .search-close { display: none !important; }
  html:not(.tv) .tab-bar:not([hidden]) { justify-content: center; gap: 0.25rem; padding-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px)); }
  .tab-bar .tab { flex: 0 1 10rem; flex-direction: row; gap: 0.55rem; padding: 0.35rem 0.75rem; font-size: var(--type-caption); }
  .tab-bar .tab svg { width: 1.45rem; height: 1.45rem; }
  /* Rows: a card is a comfortable tap, and a few more show on a tablet on its side. */
  .home-section .row.posters { grid-auto-columns: calc(var(--card-size, clamp(9.5rem, 17cqw, 11.5rem)) * var(--card-scale)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(calc(10rem * var(--card-scale)), 1fr)); }
  /* The pickers on a library's page, and a title's buttons, are big enough to tap. */
  .filter-bar select, .toolbar select { min-height: 2.75rem; }
  .pill-action, .detail-row summary { min-height: 2.75rem; }
  /* The player's buttons and timeline are sized for a finger in style.css, on a phone as well. */
}
/* Upright, a tablet has the width for seven tabs only with their names under their icons. */
@media (pointer: coarse) and (hover: none) and (min-width: 641px) and (max-width: 1366px) and (orientation: portrait) {
  .tab-bar .tab { flex: 1 1 0; max-width: 8.5rem; flex-direction: column; gap: 0.25rem; padding-inline: 0.25rem; font-size: var(--type-tiny); }
}
/* A tablet on its side, or a phone on its side, or a short narrow window whatever the pointer (a computer at 400% zoom
   is 320 by 256): the tabs take less of the height. */
@media (pointer: coarse) and (hover: none) and (max-height: 500px) and (max-width: 1366px), (max-width: 640px) and (max-height: 30rem) {
  html:not(.tv) { --tabs-h: 3rem; }
  .tab-bar .tab { flex-direction: row; gap: 0.45rem; }
}

/* More: the rest of the links, in a sheet from the bottom. */
dialog.modal.tab-sheet { width: 100%; max-width: none; margin: auto 0 0; padding: 0.6rem 0.6rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  border-width: 1px 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.tab-sheet-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.tab-sheet-list a { display: flex; align-items: center; gap: 0.9rem; min-height: 3rem; padding: 0.5rem 0.8rem; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.tab-sheet-list a:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.tab-sheet-list a[aria-current="page"] { color: var(--accent); }
.tab-sheet-list svg { flex: none; width: 1.5rem; height: 1.5rem; fill: currentColor; }

.ep-row.is-unavailable { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .8rem; background: var(--container); border: 1px dashed var(--line); }
.ep-row.is-unavailable .ep-body { flex: 1 1 14rem; color: var(--muted); cursor: default; padding: 0; }
.audio-navigation { display: grid; gap: .65rem; margin-bottom: .5rem; }
.audio-navigation .chips { margin: 0; }
.section.audio-shelf { padding-top: .25rem; }
.audio-shelf + .audio-shelf { padding-top: 0; }
.audio-shelf-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.audio-shelf-head h2 { margin-bottom: .6rem; }
.audio-shelf-head a { flex: none; }
.audio-shelf-reason { margin: 0 0 .75rem; }
.audio-shortcut .art { background: linear-gradient(135deg, var(--container), var(--accent)); display: grid; place-items: center; aspect-ratio: 1; }
.audio-shortcut-glyph { display: grid; place-items: center; color: var(--text); }
.audio-shortcut-glyph svg { width: 4rem; height: 4rem; fill: currentColor; }
@media (max-width: 600px) { .audio-shelf-head h2 { font-size: 1.2rem; } }

/* ---------- iPhone and iPad: safe areas, the Home Screen app, the keyboard (ios.js, pwa.js) ---------- */
/* The page itself (style.css :root) keeps below the status bar and above the home indicator.
   Here the rest keeps clear of them and of the notch: what's fixed or stuck to an edge, sheets,
   and the page's sides on a phone on its side (--gutter, and design.js's Page margins). In Safari
   the areas are mostly 0; in the Home Screen app the status bar lies over the page (index.html),
   so the top one is its height. */
:root { --gutter: max(clamp(1rem, 3vw, 2.5rem), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }
html { -webkit-tap-highlight-color: transparent; scroll-padding-top: calc(var(--top-h) + 0.5rem + env(safe-area-inset-top, 0px)); }
/* The header sticks under the status bar, and a strip of the header's own glass lies under the
   status bar itself, so the page never scrolls behind its writing. */
.top { top: env(safe-area-inset-top, 0px); }
/* Where whatever else sticks while the page scrolls stops: under the header (the admin console's and Your settings'
   menu, a page's On this page tabs, a table's head). 0 where the header scrolls away with the page (below). */
:root { --under-top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); }
html:not(.tv):has(> body > #top:not([hidden]))::before { content: ""; position: fixed; z-index: 31; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px);
  pointer-events: none; background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: saturate(1.3) blur(18px); backdrop-filter: saturate(1.3) blur(18px);
  transition: background-color 0.4s var(--ease-out); }
/* Over Home's banner and a title's picture, which run up under the status bar too: the strip is
   clear with the header, and the header's shade reaches up behind the status bar's writing. */
html:not(.tv):has(> body > #top.over-art:not(.scrolled):not(.nav-open))::before { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.top::before { top: calc(-1 * env(safe-area-inset-top, 0px)); }
.home-page > .banner:first-child, .sk-banner { margin-top: calc(-1 * (var(--top-h) + env(safe-area-inset-top, 0px))); }
#page > .hero:first-child:not(.plain), .sk-hero { margin-top: calc(-1 * (var(--top-h) + env(safe-area-inset-top, 0px))); }
/* A page that fills the screen and scrolls inside it (Pages and navigation): the screen less the status bar and home
   indicator. The admin console and Your settings scroll as every other page does (admin.css). */
html body:has(#page > .site-editor) { height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
/* Dialogs stop short of the status bar and home indicator; a sheet the height of the screen (the
   audiobook player on a phone) keeps its buttons clear of them. */
dialog.modal { max-height: calc(100dvh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
@media (max-width: 640px) {
  html:not(.tv) dialog.modal.listen-full { padding-top: max(0.75rem, env(safe-area-inset-top, 0px)); padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
    padding-left: max(1rem, env(safe-area-inset-left, 0px)); padding-right: max(1rem, env(safe-area-inset-right, 0px)); }
}
.profiles { padding-top: max(2.5rem, calc(env(safe-area-inset-top, 0px) + 1rem)); padding-bottom: max(2.5rem, calc(env(safe-area-inset-bottom, 0px) + 1rem)); }
/* The mini-player: clear of the notch on a phone on its side, and of the home indicator where
   there are no tabs under it. */
html:not(.tv) .listen-bar:not([hidden]) { margin-left: env(safe-area-inset-left, 0px); margin-right: env(safe-area-inset-right, 0px); }
html:not(.tv) body:not(:has(> .tab-bar:not([hidden]))) > .listen-bar:not([hidden]) { margin-bottom: env(safe-area-inset-bottom, 0px); }
/* The player's menus, clear of the notch on a phone on its side. */
html:not(.tv) .player-menu { right: max(clamp(0.75rem, 3vw, 2rem), env(safe-area-inset-right, 0px)); }
#ctl-airplay.on { color: var(--accent); }

/* No rubber band where nothing scrolls: under the player, behind a dialog, and on the pages that
   fill the screen (their own parts scroll). */
html:has(> body > #player:not([hidden])), html.ios:has(dialog.modal[open]) { overflow: hidden; overscroll-behavior: none; }
html:has(body > #page > :is(.console, .settings, .site-editor)) { overscroll-behavior: none; }
dialog.modal, .player-menu, .account-links { overscroll-behavior: contain; }

/* iOS zooms into a field whose writing is smaller than 16 pixels. -webkit-touch-callout is only on iOS. */
@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [type="button"], [type="submit"]), select, textarea { font-size: max(16px, 1em) !important; }
}
/* In the Home Screen app: no link previews or picture menus on a long press, and no selecting
   the words on buttons and bars, as in an app. */
html.ios.standalone :is(a, img) { -webkit-touch-callout: none; }
html.ios.standalone :is(button, .tab-bar, .ctl-row, .listen-bar, .player-bar, .card) { -webkit-user-select: none; user-select: none; }
/* The phone's own buttons set the volume: iOS doesn't let a page. */
html.ios .ctl-volume { display: none; }
/* While the keyboard is up, the tabs and the mini-player step aside (ios.js). */
html.keyboard .tab-bar, html.keyboard .listen-bar { display: none; }

/* Add to Home Screen, in Your settings on an iPhone or iPad (pwa.js). */
.home-screen-hint { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; flex-wrap: wrap; }
.home-screen-hint p { margin: 0.2rem 0 0; color: var(--muted); }

/* One title area and one details target on media banners. Carousel controls stay separate. */
.banner-slide:not(.banner-own) .banner-text { pointer-events: none; }
.banner-open { position: absolute; inset: 0; pointer-events: auto; z-index: 1; border-radius: 0; }
.banner-open:focus-visible { outline: 3px solid var(--accent); outline-offset: -5px; }
.banner-slide:not(.banner-own) .banner-title { min-height: clamp(6.5rem, 15vh, 9.5rem); display: flex; align-items: center; }
.banner-slide:not(.banner-own) .banner-title.has-logo { height: clamp(6.5rem, 15vh, 9.5rem); }
.banner-slide:not(.banner-own) .banner-logo { width: min(28rem, 100%); height: 100%; object-position: left center; }
@media (max-width: 600px) { html:not(.tv) .banner-logo { object-position: left center; } }

/* Shared Premiere catalogue filter controls across touch and desktop. */
.catalog-library-bar :is(select,button), .catalog-library-filters :is(select,button) { border-radius:999px; min-height:2.75rem; }
.catalog-library-bar { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; }
.catalog-library-filters { width:min(36rem, calc(100vw - 2rem)); max-height:calc(100dvh - 2rem); overflow:auto; }
.catalog-library-filters .stack { display:flex; flex-direction:column; gap:.75rem; margin:1.2rem 0; }
.catalog-library-filters .stack > :is(select,button,label) { width:100%; }

/* ---------- The bell (notify.js): in the header on every signed-in page, so styled here with the header and not in
   people.css, which only the pages about requests and history fetch ---------- */
.bell-menu { position: relative; flex: 0 0 auto; }
.bell-menu > summary { list-style: none; position: relative; display: inline-grid; place-items: center; width: var(--control-h); height: var(--control-h);
  border-radius: var(--control-radius); color: color-mix(in srgb, var(--text) 75%, transparent); cursor: pointer; }
.bell-menu > summary::-webkit-details-marker { display: none; }
.bell-menu > summary svg { width: 1.375rem; height: 1.375rem; }
.bell-menu > summary:hover, .bell-menu[open] > summary { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); }
/* At the bell's top right corner, inside the bell's own box: a count of ten or more never reaches the account beside
   it (a phone's header has them 2px apart). */
.bell-count { position: absolute; top: 0; right: 0; min-width: 1.62em; height: 1.62em; padding: 0 0.44em; box-sizing: border-box; border-radius: var(--control-radius);
  background: var(--accent); color: var(--on-accent); font: 700 min(0.68rem, 3.4vw)/1.62 var(--font-body); text-align: center; }
.bell-count[hidden] { display: none; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 40; width: min(24rem, calc(100vw - 2rem)); max-height: min(34rem, calc(100dvh - 6rem));
  display: flex; flex-direction: column; background: var(--raised); color: var(--text); border: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-menu); overflow: hidden; }
.bell-menu[open] .bell-panel { animation: menu-in 0.2s var(--ease-out, ease); transform-origin: top right; }
.bell-head, .bell-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.7rem 1rem; }
.bell-head { border-bottom: 1px solid var(--line); }
.bell-foot { border-top: 1px solid var(--line); justify-content: flex-end; font-size: var(--type-small); }
.bell-list { overflow-y: auto; padding: 0.3rem; flex: 1 1 auto; }
.bell-empty { margin: 1rem; }
.bell-row { position: relative; display: flex; align-items: stretch; border-radius: var(--radius); }
.bell-row:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.bell-item { flex: 1 1 auto; min-width: 0; display: flex; gap: 0.7rem; padding: 0.55rem 0.6rem; color: var(--text); text-decoration: none; border-radius: var(--radius); }
.bell-item[data-unread] strong::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.4rem; border-radius: 50%; background: var(--accent); vertical-align: 0.1em; }
.bell-text { display: grid; gap: 0.1rem; min-width: 0; }
.bell-text strong { font-weight: 600; overflow-wrap: anywhere; }
.bell-pic { flex: none; width: 2.5rem; height: 3.6rem; object-fit: cover; border-radius: 6px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.bell-remove { flex: none; align-self: center; width: 2rem; height: 2rem; min-height: 0; padding: 0; margin-right: 0.2rem; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: 0; }
.bell-row:hover .bell-remove, .bell-remove:focus-visible { opacity: 1; }
@media (hover: none) { .bell-remove { opacity: 0.7; } }
@media (max-width: 640px) {
  .bell-panel { position: fixed; left: 0.75rem; right: 0.75rem; top: calc(var(--top-h, 3.5rem) + 0.25rem); width: auto; }
}
@media (prefers-reduced-motion: reduce) { .bell-menu[open] .bell-panel { animation: none; } }
