/* Shared audio UI: square/whole cover cards and the floating/full music and audiobook
   players. Loaded with the app so restored queues and cross-page listening never depend
   on visiting either library. Page-specific Books and Music styles remain lazy. */

/* ---------- Covers and cards ---------- */
/* An audiobook's card is square, as its covers usually are (and music's, which shares it); a
   book to read's is tall, as a book's cover is (.shape-portrait). Whatever shape the cover
   itself is, all of it shows: drawn inside the card, over a soft blur of itself (.whole-cover,
   views.js wholeCover), so a tall cover on a square card is never cut off, nor a square one on
   a tall card. A cover the card's own shape fills it, as any poster does. */
.book-card.poster .art, .book-tile .art { aspect-ratio: 1 / 1; }
.book-card.poster.shape-portrait .art { aspect-ratio: 2 / 3; }
.whole-cover { isolation: isolate; }
.whole-cover::before { content: ""; position: absolute; inset: -10%; z-index: -1; background: var(--cover) center / cover no-repeat;
  filter: blur(16px) saturate(1.15) brightness(0.78); opacity: 0; transition: opacity 0.5s var(--ease-out, ease); }
.whole-cover.cover-loaded::before { opacity: 1; }
.art.whole-cover img { object-fit: contain; }
.grid.book-grid, .grid.book-tiles { grid-template-columns: repeat(auto-fill, minmax(calc(10.5rem * var(--card-scale, 1)), 1fr)); }
/* A Books library's grid is of tall covers: a poster's width, as films have. */
.grid.book-grid:where(.shape-portrait) { grid-template-columns: repeat(auto-fill, minmax(calc(9.5rem * var(--card-scale, 1)), 1fr)); }
.row.posters:has(> .book-card:where(:not(.shape-portrait))) { grid-auto-columns: calc(clamp(9rem, 15vw, 11.5rem) * var(--card-scale, 1)); }
/* Two covers across a phone, not one filling it. */
@media (max-width: 640px) {
  .grid.book-grid, .grid.book-tiles { grid-template-columns: repeat(auto-fill, minmax(calc(8.5rem * var(--card-scale, 1)), 1fr)); }
}
/* ---------- The mini-player ---------- */
:root { --listen-h: 4.25rem; }
.listen-bar:not([hidden]) { position: fixed; left: 0.75rem; right: 0.75rem; bottom: calc(var(--tabs, 0px) + 0.75rem); z-index: 28;
  display: flex; align-items: center; gap: 0.75rem; height: var(--listen-h); padding: 0 0.5rem 0 0.5rem; box-sizing: border-box;
  border-radius: var(--radius-lg); background: color-mix(in srgb, var(--container) 94%, transparent); color: var(--on-container);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 50%, transparent), 0 12px 32px rgb(0 0 0 / 0.35);
  backdrop-filter: blur(14px); overflow: hidden; }
/* Not over the video player, nor the sign-in screen. */
body:has(> #player:not([hidden])) > .listen-bar, body:has(> #auth:not([hidden])) > .listen-bar { display: none; }
body.listening > #page { padding-bottom: calc(3rem + var(--listen-h) + 1rem); }
body.listening > .toasts { bottom: calc(var(--tabs, 0px) + var(--listen-h) + 1.75rem); }
/* On a computer Your settings and the admin console leave the page's room above unused (admin.css: their
   #page has no padding): the end of each page and of its list on the left, where focus lands (the page's
   scroll padding, html's, which works the tabs' height out again as admin.css does), and the bar that offers
   Save changes keep above the bar that is playing. `html:root` here and in the computer's bar below keeps
   each rule's weight over the rules it must win against (look.css's Save bar over the tabs, the compact music
   bar, admin.css's scroll padding): keep it. */
@media (min-width: 961px) {
  html:root:has(> body.listening > #page > :is(.console, .settings)) { scroll-padding-bottom: calc(var(--listen-h) + 2.9rem); }
  html:root:not(.tv):has(> body.listening > .tab-bar:not([hidden])):has(> body > #page > :is(.console, .settings)) {
    scroll-padding-bottom: calc(var(--tabs-h, 0px) + env(safe-area-inset-bottom, 0px) + var(--listen-h) + 2.9rem); }
}
html:root body.listening :is(.settings-main, .console-main)::after { min-height: calc(var(--tabs, 0px) + var(--listen-h) + 2.9rem); }
html:root body.listening:has(> .listen-bar:not([hidden])) .save-bar { bottom: calc(var(--tabs, 0px) + var(--listen-h) + 2.65rem); }
@media (min-width: 961px) {
  html:root body.listening :is(.console-nav, .settings-nav) .shell-nav-list { padding-bottom: calc(var(--listen-h) + 2.9rem); scroll-padding-block-end: calc(var(--listen-h) + 2.9rem); }
}
.lb-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--text) 12%, transparent); }
.lb-progress span { display: block; height: 100%; background: var(--accent); }
.listen-bar.music-bar { padding-bottom: 1.15rem; height: calc(var(--listen-h) + 1.15rem); }
.lb-seek-wrap { position: absolute; bottom: .25rem; left: .85rem; right: .85rem; display: flex; align-items: center; gap: .7rem; height: 1.2rem; }
.lb-book-seek-wrap { display: none; }
.lb-seek { flex: 1; min-width: 0; height: 1.2rem; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.lb-seek:disabled { cursor: default; opacity: .4; }
.lb-seek-time { flex: none; min-width: 5.7rem; font-size: var(--type-overline); font-variant-numeric: tabular-nums; text-align: right; color: var(--muted); }
.listen-bar.music-bar.music-compact:not([hidden]) { left: auto; right: .75rem; width: min(25rem, calc(100vw - 1.5rem)); height: var(--listen-h); padding-bottom: 0; gap: .25rem; transform: none; }
html body:has(> .listen-bar.music-bar:not([hidden])) > .toasts { bottom: calc(var(--tabs, 0px) + var(--listen-h) + 2.9rem); }
html body:has(> .listen-bar.music-bar.music-compact:not([hidden])) > .toasts { bottom: calc(var(--tabs, 0px) + var(--listen-h) + 1.75rem); }
.music-compact .lb-seek-wrap, .music-compact .lb-controls > :not(.lb-play):not(.lb-next):not(.lb-minimize) { display: none; }
.music-compact .lb-cover { width: 2.5rem; height: 2.5rem; }
.music-compact .lb-open { gap: .45rem; }
.music-bar:not(.music-compact) .lb-progress { display: none; }
.lb-open { display: flex; align-items: center; gap: 0.75rem; flex: 1 1 auto; min-width: 0; height: 100%; padding: 0 0.25rem; border: 0; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer; border-radius: var(--radius); }
.lb-open:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.lb-cover { flex: none; width: 3.1rem; height: 3.1rem; border-radius: 0.45rem; object-fit: cover; background: var(--raised); }
.lb-text { display: grid; min-width: 0; }
.lb-title, .lb-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-title { font-weight: 600; }
.lb-sub { color: var(--muted); font-size: var(--type-caption); font-variant-numeric: tabular-nums; }
.lb-controls { display: flex; align-items: center; gap: 0.25rem; flex: none; }
.audio-volume { display: none; }
.audio-volume-range { width: 7rem; min-height: 0; padding: 0; accent-color: var(--accent); }
@media (min-width: 900px) and (pointer: fine) {
  html:root:not(.tv) .audio-volume { display: flex; align-items: center; gap: .25rem; }
  html:root:not(.tv) .listen-bar:not([hidden]) {
    border-radius: 999px; height: calc(var(--listen-h) + .35rem); padding: 0 .8rem .3rem;
  }
  html:root:not(.tv) .listen-bar .lb-play {
    border-radius: 50%; background: var(--accent); color: var(--on-accent, #10261d);
  }
  html:root:not(.tv) .listen-bar .lb-seek-wrap {
    display: flex; inset: auto 0 0; height: .85rem;
  }
  /* Keep both ends of the audiobook slider inside the rounded bar's hit area. */
  html:root:not(.tv) .listen-bar .lb-book-seek-wrap { inset-inline: 1.5rem; }
  html:root:not(.tv) .listen-bar :is(.lb-progress, .lb-seek-time) { display: none; }
  html:root:not(.tv) .listen-bar .lb-seek {
    appearance: none; height: 100%; border: 0; border-radius: 0; background:
      linear-gradient(to right, var(--accent) var(--lb-seek-percent, 0%), var(--line) var(--lb-seek-percent, 0%)) bottom / 100% 4px no-repeat;
  }
  html:root:not(.tv) .listen-bar .lb-seek::-webkit-slider-thumb {
    appearance: none; width: 1px; height: 1px; background: transparent;
  }
  html:root:not(.tv) .listen-bar .lb-seek::-moz-range-thumb {
    width: 1px; height: 1px; border: 0; background: transparent;
  }
  html:root:not(.tv) .listen-bar .lb-seek:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
}
.lb-btn, .lf-btn { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.lb-btn svg, .lf-btn svg { width: 1.5rem; height: 1.5rem; fill: currentColor; }
.lb-btn:hover, .lf-btn:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.lb-btn:focus-visible, .lf-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
/* On (liked, disliked, shuffling): the accent colour, as in the full player. */
.lb-btn.on { color: var(--accent); }
/* Smart shuffle: the same Shuffle icon, lit, with a small dot under it (music-player.js). */
.lb-btn.smart { position: relative; }
.lb-btn.smart::after { content: ""; position: absolute; left: 50%; bottom: 0.2rem; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
/* Like, Dislike and Shuffle on the bar: a TV, and a computer's wider bar. A phone has them in the full player. */
.lb-extra { display: none; }
html.tv .lb-extra { display: grid; }
.lb-play { background: var(--accent); color: var(--on-accent); }
.lb-play:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.lb-stop svg { width: 1.25rem; height: 1.25rem; }
@media (min-width: 900px) {
  .listen-bar:not([hidden]) { left: 50%; right: auto; width: min(44rem, calc(100vw - 2rem)); transform: translateX(-50%); }
  html:root .music-bar:not(.music-compact) .lb-extra { display: grid; }
  html:root:not(.tv) .listen-bar.music-bar:not(.music-compact):not([hidden]) { width: min(52rem, calc(100vw - 2rem)); }
}
@media (max-width: 480px) {
  .lb-skip:first-child { display: none; }
  .listen-bar:not([hidden]) { left: 0.5rem; right: 0.5rem; bottom: calc(var(--tabs, 0px) + 0.5rem); gap: 0.4rem; }
}

/* ---------- The full player ---------- */
dialog.modal.listen-full { width: min(58rem, calc(100vw - 2rem)); padding: 1rem 1.5rem 1.75rem; }
.lf-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.lf-head svg { width: 1.2rem; height: 1.2rem; }
.lf-main { display: grid; grid-template-columns: minmax(10rem, 20rem) minmax(0, 1fr); gap: 2rem; align-items: center; }
.lf-main[hidden], .lf-panel[hidden] { display: none; }
.lf-art { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--raised); box-shadow: 0 12px 34px rgb(0 0 0 / 0.35); }
.lf-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.lf-art.whole-cover .lf-cover { object-fit: contain; }
.lf-info { display: grid; gap: 0.6rem; min-width: 0; }
.lf-title { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.15; }
.lf-people, .lf-chapter, .lf-book-left { margin: 0; }
.lf-chapter { font-weight: 600; min-height: 1.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-timeline { display: grid; gap: 0.2rem; }
.lf-range { width: 100%; accent-color: var(--accent); margin: 0; }
.lf-times { display: flex; justify-content: space-between; color: var(--muted); font-size: var(--type-caption); font-variant-numeric: tabular-nums; }
.lf-book-left { font-size: var(--type-small); }
.lf-controls { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin: 0.4rem 0; }
.lf-btn { width: 3.25rem; height: 3.25rem; }
.lf-btn svg { width: 1.75rem; height: 1.75rem; }
.lf-play { width: 4.25rem; height: 4.25rem; background: var(--accent); color: var(--on-accent); }
.lf-play svg { width: 2.1rem; height: 2.1rem; }
.lf-play:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.lf-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.lf-pill { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.5rem; padding: 0 1rem; border: 0; border-radius: var(--control-radius, 1.25rem);
  background: var(--tonal); color: var(--on-tonal); font: 600 var(--type-small)/1 var(--font-body); cursor: pointer; font-variant-numeric: tabular-nums; }
.lf-pill svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.lf-pill.on { background: var(--accent); color: var(--on-accent); }
.lf-pill:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.lf-panel { display: grid; gap: 0.75rem; min-height: 18rem; align-content: start; }
.lf-panel-head { display: flex; align-items: center; gap: 1rem; }
.lf-panel-head h3 { margin: 0; font-size: 1.2rem; }
.lf-panel-head svg { width: 1.2rem; height: 1.2rem; transform: rotate(90deg); }
.lf-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: 0.5rem; }
.lf-choice { min-height: 2.75rem; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: var(--radius); background: transparent; color: inherit;
  font: 600 var(--type-note)/1 var(--font-body); cursor: pointer; font-variant-numeric: tabular-nums; }
.lf-choice:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.lf-choice.on { background: var(--tonal); color: var(--on-tonal); border-color: var(--tonal); }
.lf-choice:focus-visible, .lf-row:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.lf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; max-height: min(60vh, 32rem); overflow-y: auto; }
.lf-row { display: flex; justify-content: space-between; gap: 1rem; width: 100%; padding: 0.6rem 0.75rem; border: 0; border-radius: var(--radius); background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; }
.lf-row:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.lf-row.on { background: var(--tonal); color: var(--on-tonal); }
.lf-row.on .muted { color: inherit; opacity: 0.8; }
.lf-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-marks { display: grid; gap: 0.75rem; justify-items: start; align-content: start; }
.lf-marks .lf-list { width: 100%; }
.lf-mark { display: flex; align-items: center; gap: 0.35rem; }
.lf-mark .lf-row { flex: 1; min-width: 0; }

/* One Now playing presentation for the song and book engines. */
.np-head { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 3rem; gap: .75rem; margin-bottom: 1.5rem; }
.np-source { min-width: 0; display: grid; gap: .15rem; text-align: center; }
.np-source > span { color: var(--muted); font-size: var(--type-caption); letter-spacing: .13em; text-transform: uppercase; }
.np-source-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--type-sub); }
.now-playing .lf-info { grid-template-columns: minmax(0, 1fr); gap: 1rem; container-type: inline-size; }
.now-playing .lf-play { width: 4.5rem; height: 4.5rem; }
.np-title-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .25rem .65rem; }
.np-title-text { min-width: 0; display: grid; gap: .4rem; }
.np-title-text :is(.lf-title, .lf-people) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.np-title-text .lf-people { color: var(--muted); }
.np-title-row > .bf-feedback-note { grid-column: 1 / -1; }
dialog.now-playing .np-feedback { flex-wrap: nowrap; gap: .2rem; margin: 0; }
dialog.now-playing .np-feedback .lf-pill { min-width: 2.75rem; width: 2.75rem; min-height: 2.75rem; padding: .5rem; justify-content: center; background: transparent; color: var(--text); }
dialog.now-playing .np-feedback .lf-pill.on { color: var(--accent); }
dialog.now-playing .np-feedback .lf-pill > span { display: none; }
dialog.now-playing .np-feedback .lf-pill > svg { width: 1.55rem; height: 1.55rem; }
dialog.now-playing .np-feedback .lf-pill:disabled { opacity: .55; cursor: default; }
/* The column beside the cover and the tools at its end are boxes of their own only in a computer's two columns (below). */
.np-block, .np-tools-end { display: contents; }
.np-secondary { display: flex; align-items: center; gap: .35rem; min-height: 3rem; }
.np-secondary .lf-pill { flex: none; padding-inline: .4rem; min-height: 3rem; background: transparent; color: var(--muted); }
.np-secondary .lf-pill.on { background: transparent; color: var(--accent); }
.np-output { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; min-height: 3rem; border: 0; padding: .25rem; background: transparent; color: var(--muted); font: inherit; text-align: left; cursor: pointer; }
.np-output:disabled { opacity: 1; cursor: default; }
.np-output > svg { flex: none; width: 1.4rem; height: 1.4rem; }
.np-output > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-output:focus-visible, .np-next:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.np-secondary .np-secondary-icon { width: 3rem; height: 3rem; padding: .6rem; justify-content: center; }
.np-secondary-icon > span { display: none; }
/* Speed says its rate alone on a phone and a TV, as in 0.84.0; only a computer's two columns (below) give it its icon. */
html.tv .np-secondary .np-speed > svg { display: none; }
@media (max-width: 640px) { .np-secondary .np-speed > svg { display: none; } }
.np-next { width: 100%; min-height: 4rem; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) 1.25rem; align-items: center; gap: .75rem; padding: .65rem .8rem; border: 0; border-radius: var(--radius-lg); background: var(--raised); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.np-next[hidden] { display: none; }
.np-next-cover { width: 2.75rem; height: 2.75rem; object-fit: contain; border-radius: var(--radius); background: var(--raised); }
.np-next-text { min-width: 0; }
.np-next-cover[hidden] + .np-next-text { grid-column: 1 / 3; }
.np-next-label { display: block; color: var(--muted); font-size: var(--type-overline); letter-spacing: .13em; text-transform: uppercase; margin-bottom: .2rem; }
.np-next-line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-next-detail::before { content: " · "; }
.np-next > svg { width: 1.25rem; height: 1.25rem; color: var(--muted); transform: rotate(180deg); }

/* A computer's Now playing, wider than a phone (a TV keeps its own, tv-premiere.css): two balanced columns. The cover
   is as tall as the column beside it, title to tools, sharing its top and bottom (--np-art, which audio-player-ui.js's
   audioPlayerColumn keeps up to date); the column holds the title with the thumbs on its line, the people, the
   progress, the transport centred under it and one tools row; Up next runs the whole width under both. One spacing
   step (--np-step) between every block, and the same margin on all four sides. */
@media (min-width: 641px) {
  html:not(.tv) dialog.modal.listen-full.now-playing { --np-step: 2rem; --np-gap: 1rem; --np-quiet: color-mix(in srgb, var(--text) 7%, transparent);
    padding: var(--np-step); }
  /* The head: Close and More with their glyphs on the content's edges, the source centred on the panel. */
  html:not(.tv) .now-playing .np-head { grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem; align-items: center; gap: var(--np-gap);
    margin: 0 calc((1.2rem - 3.25rem) / 2) var(--np-step); }
  html:not(.tv) .now-playing .np-head > .lf-btn { margin-block: -1.25rem; }
  html:not(.tv) .now-playing .np-head > .lf-close { translate: -.11rem 0; }
  html:not(.tv) .now-playing .np-source { gap: .7rem; }
  /* The cover is the column's height wide; the column always keeps 27rem (room for every tool on one row), so only a
     window too narrow for both gives a cover shorter than the column, sitting on its centre line. */
  html:not(.tv) .now-playing .lf-main { --np-col-gap: 2rem;
    grid-template-columns: max(9rem, min(var(--np-art, 16rem), 22rem, 100% - var(--np-col-gap) - 27rem)) minmax(0, 1fr);
    grid-template-areas: "art block" "next next"; gap: var(--np-step) var(--np-col-gap); align-items: start; }
  html:not(.tv) .now-playing .lf-art { grid-area: art; width: 100%; align-self: center; }
  html:not(.tv) .now-playing .lf-info { display: contents; }
  html:not(.tv) .now-playing .np-block { grid-area: block; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--np-step); min-width: 0;
    container-type: inline-size; }
  html:not(.tv) .now-playing .np-next { grid-area: next; }
  /* The title with the thumbs on its line, centred on it; the artist (or the chapter and author) under both. */
  html:not(.tv) .now-playing .np-title-row { grid-template-areas: "title feedback" "people people"; gap: .85rem var(--np-gap); }
  html:not(.tv) .now-playing .np-title-text { display: contents; }
  html:not(.tv) .now-playing .lf-title { grid-area: title; }
  html:not(.tv) .now-playing .lf-people { grid-area: people; }
  html:not(.tv) dialog.now-playing .np-feedback { grid-area: feedback; gap: var(--np-gap); margin-block: -1rem; margin-inline-end: calc(-.75rem + .5px); }
  html:not(.tv) .now-playing .lf-timeline { gap: .55rem; }
  html:not(.tv) .now-playing .lf-controls { gap: var(--np-gap); margin: 0; }
  /* One quiet tools row: where it plays at the left; the player's own tools at the right, one height on one faint
     tint, round for an icon and a pill where a value shows (speed, the sleep timer), each with a 44 px hit area. */
  html:not(.tv) .now-playing .np-tools { flex-wrap: nowrap; justify-content: space-between; gap: var(--np-gap); min-height: 0; color: var(--muted); }
  html:not(.tv) .now-playing .np-tools > .np-output { flex: 0 1 auto; min-width: 0; min-height: 2.25rem; gap: .5rem; padding: 0 1rem 0 .8rem;
    border-radius: 999px; background: var(--np-quiet); font: 500 var(--type-small)/1 var(--font-body); }
  html:not(.tv) .now-playing .np-tools > .np-output > svg { width: 1.2rem; height: 1.2rem; }
  html:not(.tv) .now-playing .np-tools-end { display: flex; align-items: center; gap: var(--np-gap); margin-left: auto; }
  html:not(.tv) .now-playing :is(.np-tool, .np-tool-pill, .np-output) { position: relative; }
  html:not(.tv) .now-playing :is(.np-tool, .np-tool-pill, .np-output)::before { content: ""; position: absolute; inset: -.25rem; border-radius: inherit; }
  html:not(.tv) .now-playing .np-tool { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; min-height: 0; padding: 0; border: 0;
    border-radius: 50%; background: var(--np-quiet); color: var(--muted); text-decoration: none; cursor: pointer; }
  html:not(.tv) .now-playing .np-tool > svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
  html:not(.tv) .now-playing .np-tool > span { display: none; }
  html:not(.tv) .now-playing .np-tool-pill { flex: none; gap: .4rem; min-height: 2.25rem; padding: 0 .9rem 0 .75rem; border-radius: 999px;
    background: var(--np-quiet); color: var(--muted); font: 500 var(--type-small)/1 var(--font-body); }
  html:not(.tv) .now-playing .np-tool-pill > svg { width: 1.1rem; height: 1.1rem; }
  html:not(.tv) .now-playing :is(.np-tool, .np-tool-pill)[hidden] { display: none; }
  html:not(.tv) .now-playing :is(.np-tool, .np-tool-pill, .np-output):not(:disabled):hover,
  html:not(.tv) .now-playing .np-tool[aria-expanded="true"] { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); }
  html:not(.tv) .now-playing :is(.np-tool, .np-tool-pill).on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
  html:not(.tv) .now-playing .np-tool:disabled { opacity: .5; cursor: default; }
  html:not(.tv) .now-playing :is(.np-tool, .np-tool-pill):focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
  /* The volume (audio-volume.js): one round button. It opens a small upright slider with its level over it and Mute in
     the button's place under it, until a press or focus goes elsewhere, or Escape. Not on a touch screen, which has its own. */
  html:not(.tv) .now-playing .audio-volume.np-volume { position: relative; }
  html:not(.tv) .now-playing .np-volume-pop { position: absolute; bottom: -.375rem; left: 50%; translate: -50% 0; z-index: 2; display: grid;
    justify-items: center; gap: .45rem; width: 3rem; padding: .75rem 0 .375rem; box-sizing: border-box; border-radius: 999px; background: var(--raised);
    outline: 0; box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 60%, transparent), 0 12px 28px rgb(0 0 0 / .45); }
  html:not(.tv) .now-playing .np-volume-pop[hidden] { display: none; }
  html:not(.tv) .now-playing .np-volume-pop .audio-volume-range { writing-mode: vertical-lr; direction: rtl; width: 1.25rem; height: 5rem; margin: 0; }
  html:not(.tv) .now-playing .np-volume-value { color: var(--muted); font: 600 var(--type-caption)/1 var(--font-body); font-variant-numeric: tabular-nums; }
  @media (pointer: fine) { html:root:not(.tv) .now-playing .audio-volume.np-volume { display: flex; } }
  /* A narrower window: a smaller step and column gap, so the column keeps room for every tool on one row. These two
     widths are in em (860 and 790 px at the usual 16 px text), so a larger text size in the browser reaches them in a
     wider window and the transport keeps its size and shape. */
  @media (max-width: 53.75em) {
    html:not(.tv) dialog.modal.listen-full.now-playing { --np-step: 1.5rem; }
    html:not(.tv) .now-playing .lf-main { --np-col-gap: 1.5rem; }
  }
  /* Too narrow for the cover to match the column (under about 790 px): a 9rem cover beside the title and the people,
     on the same centre line; the progress, the transport, the tools and Up next run the panel's width, so the
     transport sits on the panel's centre too. */
  @media (max-width: 49.375em) {
    html:not(.tv) .now-playing .lf-main { grid-template-columns: 9rem minmax(0, 1fr);
      grid-template-areas: "art title" "time time" "ctl ctl" "tools tools" "next next"; }
    html:not(.tv) .now-playing .np-block { display: contents; }
    html:not(.tv) .now-playing .lf-art { align-self: start; }
    html:not(.tv) .now-playing .np-title-row { grid-area: title; align-self: center; }
    html:not(.tv) .now-playing .lf-timeline { grid-area: time; }
    html:not(.tv) .now-playing .lf-controls { grid-area: ctl; }
    html:not(.tv) .now-playing .np-tools { grid-area: tools; }
  }
  /* A column under 30rem shows the speed as its value alone, so where it plays keeps clear of the tools. */
  @container (max-width: 30rem) {
    html:not(.tv) .now-playing .np-speed { padding-inline: .9rem; }
    html:not(.tv) .now-playing .np-speed > svg { display: none; }
  }
}
/* Where lines of text can be trimmed to their capitals and baseline, each step is measured from ink to ink and the
   cover's top meets the title's capitals. The title and the people keep their whole line box at the foot (a 2-line
   clamp then clips between lines, keeping descenders), and a margin as deep as the line box below the baseline puts
   the next step on it. The padding the source's name takes back keeps its descenders in its clipped box. */
@supports (text-box: trim-both cap alphabetic) {
  @media (min-width: 641px) {
    html:not(.tv) .now-playing .np-source > * { text-box: trim-both cap alphabetic; }
    html:not(.tv) .now-playing .np-source-name { padding-bottom: .3em; margin-bottom: -.3em; }
    html:not(.tv) .now-playing .lf-title { margin: 0 0 -.4em; padding: 0; text-box: trim-start cap alphabetic; }
    html:not(.tv) .now-playing .lf-people { margin: 0 0 -.4375em; padding: 0; text-box: trim-start cap alphabetic; }
    html:not(.tv) .now-playing .lf-time { text-box: trim-both cap alphabetic; }
  }
}

@media (max-width: 640px) {
  dialog.modal.listen-full { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 0.75rem 1rem 1.25rem; }
  html:not(.tv) .listen-full { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  html:not(.tv) .lf-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    justify-items: stretch;
    max-width: 35rem;
    margin-inline: auto;
  }
  html:not(.tv) .lf-art {
    width: min(68vw, 15rem, max(5.5rem, 100dvh - 29rem));
    justify-self: center;
  }
  html:not(.tv) .lf-info { gap: 0.4rem; }
  html:not(.tv) .lf-btn { width: 2.75rem; height: 2.75rem; flex: none; }
  html:not(.tv) .lf-play { width: 4.25rem; height: 4.25rem; }
  html:not(.tv) .lf-controls { gap: clamp(0px, (100vw - 17rem) / 8, 0.5rem); margin: 0; }
  html:not(.tv) .lf-pills .lf-pill { min-height: 44px; padding-inline: 0.65rem; }
  html:not(.tv) dialog.now-playing[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .75rem; padding-top: max(.75rem, env(safe-area-inset-top)); }
  html:not(.tv) .now-playing .np-head { margin-bottom: 0; }
  html:not(.tv) .now-playing .lf-main { width: 100%; box-sizing: border-box; overflow-y: auto; align-content: start; gap: 1.5rem; padding: .25rem .2rem .5rem; }
  html:not(.tv) .now-playing .lf-art { width: min(100%, 25rem, max(5.5rem, 100dvh - 33rem)); }
  html:not(.tv) .now-playing .lf-info { gap: .8rem; }
  html:not(.tv) .now-playing .lf-controls { margin: .2rem 0; justify-content: space-between; gap: clamp(0px, (100vw - 20rem) / 8, .5rem); }
  html:not(.tv) .now-playing .lf-play { width: 4.5rem; height: 4.5rem; }
}
/* Large text or a very narrow player keeps every primary target, over two rows if necessary. */
@container (max-width: 16rem) {
  .now-playing .lf-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); justify-items: center; gap: .5rem; }
  .now-playing .lf-controls > :nth-child(1) { grid-area: 2 / 1; justify-self: end; }
  .now-playing .lf-controls > :nth-child(2) { grid-area: 1 / 1; }
  .now-playing .lf-controls > :nth-child(3) { grid-area: 1 / 2; }
  .now-playing .lf-controls > :nth-child(4) { grid-area: 1 / 3; }
  .now-playing .lf-controls > :nth-child(5) { grid-area: 2 / 3; justify-self: start; }
}
@media (max-width: 640px) and (max-height: 560px) {
  html:not(.tv) .lf-main > .lf-art { display: none; }
  /* Shorter still (look.css: a computer at 400% zoom is 320 by 256), the bar is in its compact form whatever was chosen: the
     song, Play and Next. Minimize goes too, as there is no bigger bar to go back to there. */
  @media (max-height: 30rem) {
    .listen-bar.music-bar:not([hidden]) { height: var(--listen-h); padding-bottom: 0; gap: .25rem; }
    .music-bar .lb-seek-wrap, .music-bar .lb-controls > :not(.lb-play):not(.lb-next) { display: none; }
    .music-bar .lb-cover { width: 2.5rem; height: 2.5rem; }
    .music-bar .lb-open { gap: .45rem; }
  }
}

/* ---------- On a TV ---------- */
html.tv .listen-bar:not([hidden]) { bottom: var(--safe-y, 1.5rem); left: 50%; right: auto; width: min(46rem, 80vw); transform: translateX(-50%); }
html.tv :is(.lb-btn, .lf-btn, .lb-open, .lf-pill, .lf-choice, .lf-row):focus { outline: var(--ring-w, 3px) solid var(--ring); outline-offset: 0.15rem; }
html.tv .lf-pill:focus, html.tv .lf-choice:focus, html.tv .lf-row:focus { background: var(--text); color: var(--bg); }
html.tv dialog.modal.listen-full { width: min(64rem, 88vw); }
