/* --- The queue drawer ------------------------------------------------------------------- */

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: calc(var(--bar-h) + var(--safe-b));
  z-index: 25;
  display: flex;
  flex-direction: column;
  width: min(var(--drawer-w), 100vw);
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--surface);
  border-left: 1px solid var(--hairline);
  box-shadow: -24px 0 48px rgba(0, 0, 0, .45);
}
.drawer-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3) var(--space-2) var(--space-5);
}
.drawer-head h2 { flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 var(--space-2) var(--space-4); }
.drawer-body .queue-panel > p { padding: 0 var(--space-3); }
.drawer .resume { margin: var(--space-3); }
/* In the drawer the empty state is a card at the drawer's width, not centred far down. */
.drawer .empty-state { max-width: none; margin: var(--space-3); padding: var(--space-5) var(--space-4); }

/* Wide enough for both: the drawer becomes a column and the page makes room. */
@media (min-width: 80rem) {
  .drawer { box-shadow: none; }
  #app[data-drawer="open"] main { margin-right: var(--drawer-w); }
}

/* --- The now-playing sheet --------------------------------------------------------------- */

/* Only the OPEN dialog gets a layout: setting display on .now-playing itself would
   override the UA's "dialog:not([open]) { display: none }" and show it shut. */
.now-playing {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: calc(var(--space-3) + env(safe-area-inset-top, 0px)) var(--page-x) calc(var(--space-5) + var(--safe-b));
  color: var(--fg);
  border: 0;
  background: var(--bg);
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--tint) 92%, var(--bg)) 0%,
    color-mix(in oklab, var(--tint) 48%, var(--bg)) 55%,
    var(--bg) 100%);
  transition: --tint .2s var(--ease);
}
.now-playing[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
  justify-items: center;
  align-content: start;
  gap: var(--space-4);
}
/* ::backdrop does not reliably inherit custom properties, hence the literal --bg. */
.now-playing::backdrop { background: #0c0c0e; }
.now-playing > * { width: min(100%, 30rem); }
.np-top { display: flex; justify-content: flex-start; }
.np-close { color: var(--fg); }
.np-close .icon { width: 1.75rem; height: 1.75rem; }
.np-art { display: grid; place-items: center; min-height: 0; }
.np-art .cover {
  width: min(100%, 46vh, 26rem);
  height: auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .5), 0 24px 64px rgba(0, 0, 0, .55);
}
.np-info { display: flex; align-items: flex-start; gap: var(--space-3); }
.np-text { flex: 1; display: grid; gap: .125rem; min-width: 0; }
.np-title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 118%;
  font-size: clamp(1.5rem, 2.5vw + 1rem, 2.25rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.np-artist { font-weight: 500; text-decoration: none; }
.np-album { color: var(--fg-muted); text-decoration: none; }
.np-artist:hover, .np-album:hover { text-decoration: underline; }
.np-star .icon-btn { color: var(--fg); }
.now-playing .progress { font-size: var(--text-sm); }
.np-transport { display: flex; justify-content: center; align-items: center; gap: var(--space-5); }
.np-transport .icon-btn { width: 3.5rem; height: 3.5rem; color: var(--fg); }
.np-transport .icon { width: 1.75rem; height: 1.75rem; }
.np-transport .toggle { width: 4.5rem; height: 4.5rem; }
.np-transport .toggle .icon { width: 2rem; height: 2rem; }
.np-upnext { justify-self: center; width: auto; }

/* --- The shortcut list (the `?` dialog, a components/dialog.css .dialog, and Settings) ---- */

.shortcuts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-3) var(--space-5);
  margin: 0 0 var(--space-4);
  align-items: center;
}
.shortcuts dt { display: flex; gap: var(--space-1); }
.shortcuts dd { margin: 0; color: var(--fg-muted); }
