/* panel-music.css — the music view (panel-music.js).
 *
 * body.px-music swaps the panel over: the rail shows Return, the music nav and
 * the library; the reading column shows the music stage (top bar, a page, the
 * now-playing bar). Everything else is HIDDEN, not removed, so the
 * conversation is exactly where it was on Return. The hide is !important
 * because applySurface() and the renderers set display on these elements
 * themselves, and none of them knows the music view exists.
 *
 * FLINT tokens only (--ink / --bone / --rim and their derived text tints), so
 * the light theme follows without a second palette. */

#pxMusicBack, #pxMusicLib, #pxMusicStage { display: none; }

body.px-music .rail > :not(.collapse-btn):not(.rail-grip):not(.auth-who):not(.auth-cta):not(#pxMusicBack):not(#pxMusicLib),
body.px-music .main > :not(#pxMusicStage) { display: none !important; }

/* Shared resets for the many text-like buttons below. */
.pxm-link, .pxm-tname, .pxm-bar-title, .pxm-card, .pxm-nav-row, .pxm-lib-row, .pxm-navbtn,
.pxm-device-btn, .pxm-device, .pxm-tmore, .pxm-more, .pxm-lib-scope-btn {
  font: inherit; color: inherit; background: transparent; border: none; padding: 0; margin: 0;
  cursor: pointer; text-align: left;
}
:is(.pxm-link, .pxm-tname, .pxm-bar-title, .pxm-card, .pxm-nav-row, .pxm-lib-row, .pxm-navbtn,
    .pxm-device-btn, .pxm-device, .pxm-tmore, .pxm-more, .pxm-lib-scope-btn, .pxm-lib-tabs button):focus-visible {
  outline: 1px solid rgba(var(--rim-rgb),.6); outline-offset: 1px; border-radius: var(--r-ctl);
}
.pxm-link:hover { color: var(--t-primary); text-decoration: underline; text-underline-offset: 2px; }

/* ---- rail: Return, nav, library ------------------------------------ */

/* "New tab"'s slot: 18px on top centres the row on the fixed toggle's line
   (see .new-tab-btn in panel.html), which is where the mode switch would
   otherwise sit — it is hidden here. */
body.px-music #pxMusicBack { display: flex; margin-top: 18px; margin-bottom: 6px; }

body.px-music #pxMusicLib { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.pxm-nav { display: flex; flex-direction: column; padding: 0 8px 6px; }
.pxm-nav-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--r-ctl);
  font: 400 var(--fs-base)/1.2 var(--sans); color: var(--t-secondary);
}
.pxm-nav-row svg { width: 16px; height: 16px; flex-shrink: 0; }
.pxm-nav-row:hover { color: var(--t-primary); background: var(--s-quiet); }
.pxm-nav-row.on { color: var(--t-primary); background: var(--s-inter); }

.pxm-lib-head {
  margin: 10px 14px 8px; padding-top: 10px; border-top: 1px solid var(--hair);
  font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--t-meta);
}
.pxm-lib-scope {
  margin: 0 14px 10px; padding: 10px; border-radius: var(--r-md); background: var(--s-card);
  box-shadow: var(--lit-card); display: flex; flex-direction: column; gap: 8px;
  font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-secondary);
}
.pxm-lib-scope[hidden] { display: none; }
.pxm-lib-scope-btn {
  align-self: flex-start; padding: 6px 12px; border-radius: var(--r-ctl);
  background: var(--bone); color: var(--ink);
  font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
}
.pxm-lib-tabs {
  display: grid; grid-template-columns: 1fr 1fr; flex-shrink: 0;
  margin: 0 14px 10px; padding: 2px; height: 26px;
  border-radius: var(--r-ctl); background: var(--s-quiet);
}
.pxm-lib-tabs button {
  border: none; background: transparent; cursor: pointer; border-radius: var(--r-ctl-sm);
  color: var(--t-meta); font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
}
.pxm-lib-tabs button:hover { color: var(--t-strong); }
.pxm-lib-tabs button[aria-selected="true"] {
  color: var(--t-primary); background: var(--s-inter);
  box-shadow: var(--lit-pill), inset 0 0 0 1px rgba(var(--rim-rgb),.18);
}
/* Search in Your Library: under the Playlists/Artists switch, the list's top
   edge fades out beneath it (pxScrollEdges, as the chat list does). */
.pxm-lib-search {
  flex-shrink: 0; margin: 0 14px 8px; height: 30px; padding: 0 10px;
  display: flex; align-items: center; gap: 8px;
  border-radius: var(--r-ctl); background: var(--s-quiet); color: var(--t-meta); cursor: text;
}
.pxm-lib-search:focus-within { box-shadow: inset 0 0 0 1px rgba(var(--rim-rgb),.4); color: var(--t-secondary); }
.pxm-lib-search svg { width: 13px; height: 13px; flex-shrink: 0; }
.pxm-lib-search input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  color: var(--t-primary); font: 400 var(--fs-md)/1 var(--sans);
}
.pxm-lib-search input::placeholder { color: var(--t-meta); }
.pxm-lib-search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: .5; }

.pxm-lib-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 12px; }
/* The rows are .session-head too, so the PLAYING one wears the open tab's
   glass (.active-session — glass-surface.js/.css do the rest). The tab row's
   serif and spacing are put back to this list's here. */
.pxm-lib-row.session-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-md);
  font: inherit; white-space: normal; overflow: visible; margin-bottom: 2px;
}
.pxm-lib-row:hover { background: var(--s-quiet); }
/* The page you are looking at, when it is not the one playing: the quiet
   wash, as a hovered tab. The ID outranks glass-surface.css's strip rule. */
#pxMusicLib .pxm-lib-row.on:not(.active-session) { background: var(--s-quiet); }
.pxm-lib-art {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--r-ctl-sm); overflow: hidden;
  background: var(--s-card); box-shadow: var(--lit-card);
}
.pxm-lib-art.round { border-radius: 50%; }
.pxm-lib-art img, .pxm-track-art img, .pxm-card-art img, .pxm-hero-art img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.pxm-lib-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pxm-lib-name, .pxm-lib-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pxm-lib-name { font: 400 var(--fs-base)/1.2 var(--sans); color: var(--t-strong); }
.pxm-lib-sub { font: 400 var(--fs-sm)/1.2 var(--sans); color: var(--t-meta); }
.pxm-lib-empty { padding: 10px 6px; font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-meta); }

/* ---- the stage ------------------------------------------------------ */

body.px-music #pxMusicStage {
  /* The container the now-playing bar's narrow layout asks about: a container
     query cannot restyle the container itself, so it is the stage, not the bar. */
  container: pxm-stage / inline-size;
  position: relative; display: flex; flex-direction: column;
  flex: 1; min-height: 0; background: var(--ink); color: var(--t-primary);
}

.pxm-top {
  flex-shrink: 0; height: 66px; padding: 0 18px 0 22px;
  display: flex; align-items: center; gap: 6px;
}
/* The rail's toggle hangs over this row when the rail is closed. */
.rail.collapsed ~ .main .pxm-top { padding-left: 54px; }
.pxm-top.is-blocked > * { visibility: hidden; }
.pxm-navbtn {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--r-ctl);
  display: flex; align-items: center; justify-content: center; color: var(--t-secondary);
}
.pxm-navbtn svg { width: 18px; height: 18px; }
.pxm-navbtn:hover:not(:disabled) { color: var(--t-primary); background: var(--s-quiet); }
.pxm-navbtn:disabled { opacity: .3; cursor: default; }
.pxm-search {
  flex: 1; min-width: 0; max-width: 380px; height: 34px; margin-left: 4px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border-radius: var(--r-ctl); background: var(--s-inter); box-shadow: var(--lit-pill);
  color: var(--t-meta); cursor: text;
}
.pxm-search:focus-within { box-shadow: var(--lit-pill), 0 0 0 1px rgba(var(--rim-rgb),.5); color: var(--t-secondary); }
.pxm-search svg { width: 15px; height: 15px; flex-shrink: 0; }
.pxm-search input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  color: var(--t-primary); font: 400 var(--fs-base)/1 var(--sans);
}
.pxm-search input::placeholder { color: var(--t-meta); }
.pxm-search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: .5; }
.pxm-device-btn {
  margin-left: auto; height: 30px; max-width: 180px; padding: 0 10px; border-radius: var(--r-ctl);
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  font: 400 var(--fs-sm)/1 var(--mono); color: var(--t-meta);
}
.pxm-device-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.pxm-device-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pxm-device-btn span:empty { display: none; }
.pxm-device-btn:hover, .pxm-device-btn[aria-expanded="true"] { color: var(--rim); background: var(--s-quiet); }
@media (max-width: 520px) { .pxm-device-btn span { display: none; } }

.pxm-devices {
  position: absolute; top: 56px; right: 14px; z-index: 5; min-width: 230px; max-width: calc(100% - 28px);
  padding: 6px; border-radius: var(--r-card);
  background: rgb(var(--panel-hi-rgb)); box-shadow: var(--lit-card), 0 18px 40px rgba(0,0,0,calc(.5 * var(--shadow-k)));
}
.pxm-devices[hidden] { display: none; }
.pxm-devices-head { padding: 8px 10px 6px; font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--t-meta); }
.pxm-devices-empty { padding: 8px 10px 10px; font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-secondary); }
.pxm-device { width: 100%; display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: var(--r-ctl); }
.pxm-device:hover:not(:disabled) { background: var(--s-quiet); }
.pxm-device:disabled { opacity: .45; cursor: default; }
.pxm-device-name { font: 400 var(--fs-base)/1.2 var(--sans); color: var(--t-strong); }
.pxm-device.on .pxm-device-name { color: var(--rim); }
.pxm-device-type { font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .08em; color: var(--t-meta); }

.pxm-view {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; padding: 0 22px 22px;
  container-type: inline-size;
}

/* ---- messages ------------------------------------------------------- */

.pxm-msg, .pxm-player {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: 380px; margin: 0 auto; text-align: center;
}
.pxm-msg[hidden], .pxm-player[hidden], .pxm-page[hidden], .pxm-bar[hidden],
.pxm-note[hidden] { display: none; }

.pxm-msg { gap: 10px; }
.pxm-msg-glyph svg { width: 34px; height: 34px; color: var(--rim); opacity: .8; }
.pxm-msg-title { font: 300 var(--fs-3xl)/1.25 var(--serif); color: var(--t-primary); }
.pxm-msg-text { font: 400 var(--fs-base)/1.5 var(--sans); color: var(--t-secondary); max-width: 300px; }
.pxm-msg-btn {
  margin-top: 8px; padding: 10px 18px; border: none; border-radius: var(--r-ctl); cursor: pointer;
  background: var(--bone); color: var(--ink);
  font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
}
.pxm-msg-btn:hover { background: var(--t-primary); }
.pxm-msg-btn[hidden] { display: none; }

/* ---- the full player ----------------------------------------------- */

.pxm-player { gap: 18px; }
.pxm-progress { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.pxm-controls { display: flex; align-items: center; justify-content: center; gap: 14px; }
.pxm-volume { width: min(100%, 220px); display: flex; align-items: center; gap: 10px; color: var(--t-meta); }
.pxm-volume svg { width: 16px; height: 16px; flex-shrink: 0; }
.pxm-volume.is-off { display: none; }
.pxm-art-wrap {
  width: min(100%, 320px, 46vh); aspect-ratio: 1; border-radius: var(--r-card); overflow: hidden;
  background: var(--s-card); box-shadow: var(--lit-card), 0 18px 48px rgba(0,0,0,calc(.45 * var(--shadow-k)));
}
.pxm-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.pxm-art:not([src]), .pxm-bar-art img:not([src]) { visibility: hidden; }
.pxm-meta { width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pxm-title { font: 400 var(--fs-3xl)/1.2 var(--serif); color: var(--t-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pxm-sub { font: 400 var(--fs-base)/1.3 var(--sans); color: var(--t-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pxm-sub span:empty + .pxm-dot, .pxm-dot:has(+ span:empty) { display: none; }

.pxm-time { font: 400 var(--fs-sm)/1 var(--mono); color: var(--t-meta); font-variant-numeric: tabular-nums; min-width: 34px; }
.pxm-time:first-child { text-align: right; }
.pxm-time:last-child { text-align: left; }

/* Ranges: a 4px track filled to --pct with the accent, a thumb that only
   grows on hover/drag. Native inputs, so keyboard seek and screen readers
   come for free. */
.pxm-range {
  --pct: 0%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 16px; margin: 0;
  background: transparent; cursor: pointer;
}
.pxm-range:disabled { cursor: default; opacity: .45; }
.pxm-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--rim) var(--pct), rgba(var(--bone-rgb),.14) var(--pct));
}
.pxm-range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(var(--bone-rgb),.14); }
.pxm-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--rim); }
.pxm-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 12px; height: 12px; margin-top: -4px;
  border-radius: 50%; background: var(--bone); border: none;
  transform: scale(.6); transition: transform var(--dur-2) ease;
}
.pxm-range::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%; background: var(--bone); border: none;
  transform: scale(.6); transition: transform var(--dur-2) ease;
}
.pxm-range:hover::-webkit-slider-thumb, .pxm-range:active::-webkit-slider-thumb, .pxm-range:focus-visible::-webkit-slider-thumb { transform: scale(1); }
.pxm-range:hover::-moz-range-thumb, .pxm-range:active::-moz-range-thumb, .pxm-range:focus-visible::-moz-range-thumb { transform: scale(1); }
.pxm-range:focus-visible { outline: 1px solid rgba(var(--rim-rgb),.6); outline-offset: 2px; border-radius: var(--r-xs); }

.pxm-btn {
  position: relative; width: 38px; height: 38px; border: none; border-radius: var(--r-ctl); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--t-secondary); cursor: pointer;
  transition: color var(--dur-2) ease, background-color var(--dur-2) ease, transform var(--dur-1) ease;
}
.pxm-btn svg { width: 20px; height: 20px; }
.pxm-btn:hover:not(:disabled) { color: var(--t-primary); background: var(--s-quiet); }
.pxm-btn:active:not(:disabled) { transform: scale(.94); }
.pxm-btn:disabled { opacity: .35; cursor: default; }
.pxm-btn:focus-visible { outline: 1px solid rgba(var(--rim-rgb),.6); outline-offset: 2px; }
.pxm-play { width: 54px; height: 54px; background: var(--bone); color: var(--ink); }
.pxm-play svg { width: 24px; height: 24px; }
.pxm-play:hover:not(:disabled) { background: var(--t-primary); color: var(--ink); }
.pxm-toggle[aria-pressed="true"] { color: var(--rim); }
/* An accent dot under an active toggle, as Spotify does, so "on" is not
   carried by colour alone. */
.pxm-toggle[aria-pressed="true"]::after {
  content: ""; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: currentColor;
}
.pxm-repeat-one {
  position: absolute; top: 6px; right: 5px; display: none;
  font: 500 var(--fs-3xs)/1 var(--mono); color: var(--rim);
}
.pxm-repeat[data-repeat="track"] .pxm-repeat-one { display: block; }


/* ---- pages ---------------------------------------------------------- */

.pxm-page { width: 100%; max-width: 920px; margin: 0 auto; }
.pxm-page-inner { display: flex; flex-direction: column; gap: 22px; padding-top: 4px; }
.pxm-page-title { margin: 0; font: 400 var(--fs-3xl)/1.15 var(--serif); color: var(--t-primary); }
.pxm-empty { padding: 28px 4px; font: 400 var(--fs-base)/1.5 var(--sans); color: var(--t-secondary); }

.pxm-hero { display: flex; align-items: flex-end; gap: 20px; }
.pxm-hero-art {
  width: 160px; height: 160px; flex-shrink: 0; border-radius: var(--r-lg); overflow: hidden;
  background: var(--s-card); box-shadow: var(--lit-card), 0 14px 36px rgba(0,0,0,calc(.45 * var(--shadow-k)));
}
.pxm-hero-art.round { border-radius: 50%; }
.pxm-liked-art {
  display: flex; align-items: center; justify-content: center; color: var(--ink);
  background: linear-gradient(135deg, var(--rim), rgba(var(--bone-rgb),.85));
}
.pxm-liked-art svg { width: 56px; height: 56px; fill: currentColor; }
.pxm-hero-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pxm-eyebrow { font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--t-meta); }
.pxm-hero-title {
  margin: 0; font: 400 clamp(22px, 5cqi, 34px)/1.1 var(--serif); color: var(--t-primary);
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pxm-hero-meta { font: 400 var(--fs-md)/1.5 var(--sans); color: var(--t-secondary); }
.pxm-hero-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--t-meta); margin-bottom: 2px;
}
.pxm-hero-play { width: 46px; height: 46px; margin-top: 6px; }
.pxm-hero-play svg { width: 20px; height: 20px; }
@container (max-width: 480px) {
  .pxm-hero { flex-direction: column; align-items: flex-start; gap: 14px; }
  .pxm-hero-art { width: 132px; height: 132px; }
}

.pxm-section { display: flex; flex-direction: column; gap: 8px; }
.pxm-section-title { margin: 0; font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--t-meta); }

/* Track rows, Spotify's: # | cover, title, artists | album | duration | ⋯.
   The row itself plays on click; links inside it navigate instead. */
.pxm-tracks { display: flex; flex-direction: column; }
.pxm-track {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, .65fr) 44px 32px;
  align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-ctl); cursor: pointer;
}
/* No album column: the cell leaves the grid entirely, gap and all. */
.pxm-tracks.no-album .pxm-track { grid-template-columns: 34px minmax(0, 1fr) 44px 32px; }
.pxm-tracks.no-album .pxm-talbum { display: none; }
@container (max-width: 560px) {
  .pxm-track, .pxm-tracks.no-album .pxm-track { grid-template-columns: 26px minmax(0, 1fr) 38px 28px; gap: 8px; padding: 6px 4px; }
  .pxm-talbum { display: none; }
}
.pxm-track:hover { background: var(--s-quiet); }
.pxm-track.off { opacity: .4; cursor: default; }
.pxm-tn {
  display: flex; align-items: center; justify-content: center; height: 20px;
  font: 400 var(--fs-md)/1 var(--mono); color: var(--t-meta); font-variant-numeric: tabular-nums;
}
.pxm-tmain { min-width: 0; display: flex; align-items: center; gap: 10px; }
.pxm-ttext { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pxm-track-art { width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--r-ctl-sm); overflow: hidden; background: var(--s-card); }
.pxm-tname, .pxm-tartists, .pxm-talbum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 100%; }
.pxm-tname { font: 400 var(--fs-lg)/1.25 var(--sans); color: var(--t-primary); }
/* THE PLAYING TRACK, lit: the accent, with a soft light of its own, and the
   number swapped for the thinking orb (see pxMusicMarkPlaying). */
/* A filter, not text-shadow: the name clips its overflow (for the ellipsis),
   and a shadow would be cut at that box and show as a lit rectangle. A
   drop-shadow is drawn after the clip, around the letters. */
.pxm-track.on .pxm-tname {
  color: var(--rim);
  filter: drop-shadow(0 0 4px rgba(var(--rim-rgb),.45));
}
.pxm-track.on .pxm-tn { color: var(--rim); }
.pxm-tartists { font: 400 var(--fs-md)/1.25 var(--sans); color: var(--t-meta); }
.pxm-explicit {
  display: inline-block; margin-right: 5px; padding: 1px 4px; border-radius: 2px; vertical-align: 1px;
  font: 500 var(--fs-3xs)/1.2 var(--mono); color: var(--ink); background: var(--t-meta);
}
.pxm-talbum { font: 400 var(--fs-md)/1.25 var(--sans); color: var(--t-meta); }
.pxm-tdur { text-align: right; font: 400 var(--fs-sm)/1 var(--mono); color: var(--t-meta); font-variant-numeric: tabular-nums; }
.pxm-tmore {
  width: 28px; height: 28px; border-radius: var(--r-ctl); display: flex; align-items: center; justify-content: center;
  color: var(--t-meta); opacity: 0; justify-self: center;
}
.pxm-tmore svg { width: 16px; height: 16px; }
.pxm-track:hover .pxm-tmore, .pxm-tmore:focus-visible, .pxm-tmore[aria-expanded="true"] { opacity: 1; }
.pxm-tmore:hover, .pxm-tmore[aria-expanded="true"] { color: var(--t-primary); background: var(--s-inter); }
@media (hover: none) { .pxm-tmore { opacity: .7; } }

/* The ⋯ menu: .pxsm's material and rows (panel-settings-menu.css), placed by
   pxMusicMenuPlace. Long playlist lists scroll inside it. */
.pxm-menu { max-height: min(360px, calc(100vh - 16px)); overflow-y: auto; overscroll-behavior: contain; }
.pxm-menu .pxsm-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pxm-menu .pxsm-item:disabled { opacity: .45; cursor: default; background: none; }
.pxm-menu .pxm-menu-back { color: var(--t-meta); font-size: var(--fs-md); }

.pxm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 6px; }
@container (max-width: 480px) {
  .pxm-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  .pxm-card { padding: 6px; }
}
.pxm-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--r-lg); min-width: 0; }
.pxm-card:hover { background: var(--s-quiet); }
.pxm-card-art {
  width: 100%; aspect-ratio: 1; border-radius: var(--r-ctl); overflow: hidden; margin-bottom: 4px;
  background: var(--s-card); box-shadow: var(--lit-card);
}
.pxm-card-art.round { border-radius: 50%; }
.pxm-card-name, .pxm-card-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pxm-card-name { font: 400 var(--fs-base)/1.25 var(--sans); color: var(--t-strong); }
.pxm-card-sub { font: 400 var(--fs-sm)/1.25 var(--sans); color: var(--t-meta); }

.pxm-more {
  align-self: center; padding: 9px 16px; border-radius: var(--r-ctl); background: var(--s-inter);
  font: 400 var(--fs-xs)/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--t-strong);
}
.pxm-more:hover:not(:disabled) { background: var(--s-rim); }
.pxm-more:disabled { opacity: .5; cursor: default; }

.pxm-skel { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.pxm-skel-head { width: 160px; height: 160px; border-radius: var(--r-lg); margin-bottom: 12px; }
.pxm-skel-row { height: 40px; border-radius: var(--r-ctl); }
/* The ground and the light are the shared skeleton rule's (panel.html). */

/* ---- now-playing bar ----------------------------------------------- */
/* Spotify's three columns: what is playing (left), the transport over the
   progress (centred), volume (right). The panel's own ink, no plate and no
   hairline: the page above dissolves into it through the same edge fade the
   conversation wears above the prompt bar (pxScrollEdges on .pxm-view). */
.pxm-bar {
  flex-shrink: 0; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-areas: "left center right";
  column-gap: 16px; padding: 10px 18px 14px;
  background: var(--ink);
}
.pxm-bar-left { grid-area: left; min-width: 0; display: flex; align-items: center; gap: 12px; }
.pxm-bar-art { flex-shrink: 0; width: 52px; height: 52px; padding: 0; border: none; border-radius: var(--r-ctl-sm); overflow: hidden; cursor: pointer; background: var(--s-card); box-shadow: var(--lit-card); }
.pxm-bar-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pxm-bar-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pxm-bar-sub { font: 400 var(--fs-sm)/1.2 var(--sans); color: var(--t-meta); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The title, and its drift when it does not fit (pxMusicMeasureMarquee sets
   .is-clipped and the distance). Faded at the edges while it travels, so the
   words leave the box rather than being cut by it. */
.pxm-marquee { overflow: hidden; white-space: nowrap; min-width: 0; }
.pxm-marquee.is-clipped {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 6px, #000 calc(100% - 14px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 6px, #000 calc(100% - 14px), transparent 100%);
}
.pxm-bar-title { display: inline-block; max-width: none; font: 400 var(--fs-base)/1.25 var(--sans); color: var(--t-primary); white-space: nowrap; }
.pxm-bar-title:hover { text-decoration: underline; text-underline-offset: 2px; }
.pxm-marquee-text { display: inline-block; }
.pxm-marquee.is-clipped .pxm-marquee-text {
  padding-left: 6px;
  animation: pxm-marquee var(--scroll-ms, 8000ms) ease-in-out infinite alternate;
}
@keyframes pxm-marquee {
  0%, 18%   { transform: translateX(0); }
  82%, 100% { transform: translateX(var(--scroll-dist, 0)); }
}

.pxm-bar-center { grid-area: center; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pxm-bar-ctl { display: flex; align-items: center; justify-content: center; gap: 8px; }
.pxm-bar-ctl .pxm-btn { width: 32px; height: 32px; }
.pxm-bar-ctl .pxm-btn svg { width: 17px; height: 17px; }
.pxm-bar-ctl .pxm-play { width: 36px; height: 36px; }
.pxm-bar-ctl .pxm-play svg { width: 18px; height: 18px; }
.pxm-bar-ctl .pxm-toggle[aria-pressed="true"]::after { bottom: 1px; }
.pxm-bar-progress { width: 100%; max-width: 560px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.pxm-bar-progress .pxm-time { font-size: var(--fs-xs); min-width: 32px; }

.pxm-bar-right { grid-area: right; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--t-meta); }
.pxm-bar-right svg { width: 16px; height: 16px; flex-shrink: 0; }
.pxm-bar-right .pxm-range { width: min(100%, 120px); }
.pxm-bar-right.is-off { visibility: hidden; }

/* A side panel is narrow: the song on one line, the transport and progress
   under it, and volume left to the device. */
@container pxm-stage (max-width: 600px) {
  .pxm-bar { grid-template-columns: minmax(0, 1fr); grid-template-areas: "left" "center"; row-gap: 8px; padding: 10px 14px 12px; }
  .pxm-bar-right { display: none; }
  .pxm-bar-art { width: 44px; height: 44px; }
}

.pxm-note {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 6;
  max-width: calc(100% - 32px); padding: 8px 14px;
  border-radius: var(--r-ctl); background: rgb(var(--panel-hi-rgb)); box-shadow: var(--lit-pill), 0 8px 24px rgba(0,0,0,calc(.4 * var(--shadow-k)));
  font: 400 var(--fs-md)/1.3 var(--sans); color: var(--t-strong); text-align: center;
}


/* Entering: a short fade-up of whatever the column is showing. */
body.px-music #pxMusicStage .pxm-player:not([hidden]),
body.px-music #pxMusicStage .pxm-msg:not([hidden]),
body.px-music #pxMusicStage .pxm-page-inner { animation: pxm-in var(--dur-3) ease both; }
@keyframes pxm-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  body.px-music #pxMusicStage .pxm-player:not([hidden]),
  body.px-music #pxMusicStage .pxm-msg:not([hidden]),
  body.px-music #pxMusicStage .pxm-page-inner { animation: none; }
  /* The title keeps its fade and stops travelling. */
  .pxm-marquee.is-clipped .pxm-marquee-text { animation: none; padding-left: 0; }
  .pxm-marquee.is-clipped {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
            mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent 100%);
  }
  .pxm-btn, .pxm-range::-webkit-slider-thumb, .pxm-range::-moz-range-thumb { transition: none; }
  .pxm-btn:active:not(:disabled) { transform: none; }
}
