/* Aux. Record-shop world: marker-black shell, divider-card white sheet, day-glo sticker inks.
   One typeface (Archivo) at three sizes; rank comes from weight, width, case and reversed plates. */

/* ================= tokens ================= */

:root {
  color-scheme: light;

  /* shell (rail, transport) */
  --rail: #111110;
  --rail-2: #1f1f1d;
  --rail-3: #2d2d2a;
  --rail-ink: #f3f4ef;
  --rail-ink-2: #b9baae;
  --rail-track: #6a6b62; /* the unplayed part of a slider on the rail */

  /* sheet (the working surface) */
  --sheet: #f3f4ef;
  --sheet-2: #e8e9e1;
  --sheet-3: #dadbd2;
  --rule: #cdcec4;
  --ink: #141413;
  --ink-2: #4c4d45;
  --ink-3: #62635a;

  /* sticker inks: each has one job */
  --orange: #ff5a1f; /* playing, primary action */
  --orange-2: #e84a10;
  --green: #3fd97a; /* official audio */
  --blue: #4da3ff; /* his own file */
  --yellow: #f6e24a; /* preview, selection */
  --pink: #ff5ca8; /* liked */
  --red: #c8281c; /* unavailable, destructive */
  --card: #f8f8f4; /* a blank white sticker */
  --on-ink: #141413; /* text printed on any sticker ink */

  --focus: var(--ink);

  --rail-w: 248px;
  --side-w: 400px;
  --bar-h: 72px;
  --page-pad: 32px;
  --toast-gap: calc(var(--bar-h) + 16px);

  --fs-s: 0.8125rem;
  --fs-m: 0.9375rem;
  --fs-l: 2.75rem;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Shantell Sans", "Marker Felt", "Chalkboard SE", cursive;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* After hours: the sheet turns charcoal, the inks stay. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) {
    color-scheme: dark;
    --rail: #0a0a09;
    --rail-2: #191917;
    --rail-3: #272724;
    --sheet: #1b1b19;
    --sheet-2: #252522;
    --sheet-3: #32322e;
    --rule: #3a3a35;
    --ink: #f3f4ef;
    --ink-2: #bcbdb1;
    --ink-3: #96978c;
    --red: #ff6b5e;
  }
}

:root[data-theme="night"] {
  color-scheme: dark;
  --rail: #0a0a09;
  --rail-2: #191917;
  --rail-3: #272724;
  --sheet: #1b1b19;
  --sheet-2: #252522;
  --sheet-3: #32322e;
  --rule: #3a3a35;
  --ink: #f3f4ef;
  --ink-2: #bcbdb1;
  --ink-3: #96978c;
  --red: #ff6b5e;
}

/* ================= base ================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--rail);
  color: var(--ink);
  font: 400 var(--fs-m) / 1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a,
.link-btn {
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--yellow);
  color: var(--on-ink);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  left: 8px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--yellow);
  color: var(--on-ink);
  font-weight: 800;
  border-radius: 2px;
  --focus: var(--on-ink);
}

.skip:focus {
  top: 8px;
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--sheet);
  font-weight: 700;
}

/* condensed caps: the voice of stickers, section signs and buttons */
.sec h2,
.btn,
.rail-head h2,
.qhead,
.facts dt,
.receipt-h,
.menu-title,
.menu-head,
.empty-title,
.toast-act,
.now-finding,
.stage-msg {
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ================= shell grid ================= */

.app {
  display: grid;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--side-w);
  grid-template-rows: auto minmax(0, 1fr) var(--bar-h);
  grid-template-areas:
    "rail sheet stage"
    "rail sheet side"
    "bar bar bar";
}

/* ----- rail ----- */

.rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  padding: 22px 12px 12px;
  background: var(--rail);
  color: var(--rail-ink);
  --focus: var(--rail-ink);
}

.brand {
  align-self: flex-start;
  margin: 0 10px 20px;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: block;
  padding: 5px 12px 3px;
  background: var(--orange);
  color: var(--on-ink);
  font-size: var(--fs-l);
  font-weight: 900;
  font-stretch: 62%;
  line-height: 1;
  text-transform: uppercase;
  border-radius: 2px;
  transform: rotate(-4deg);
  transition: transform 0.2s var(--ease);
}

.brand:hover .brand-mark,
.brand:focus-visible .brand-mark {
  transform: rotate(-1deg);
}

.rail-search {
  position: relative;
  margin: 0 4px 12px;
}

.rail-search .ic {
  position: absolute;
  left: 11px;
  top: 50%;
  translate: 0 -50%;
  color: var(--rail-ink-2);
  pointer-events: none;
}

.rail-input {
  width: 100%;
  height: 40px;
  padding: 0 10px 0 38px;
  background: var(--rail-2);
  border: 1.5px solid var(--rail-3);
  border-radius: 2px;
  color: var(--rail-ink);
  caret-color: var(--orange);
}

.rail-input::placeholder {
  color: var(--rail-ink-2);
  opacity: 1;
}

.rail-input:focus-visible {
  outline-offset: 0;
  border-color: var(--rail-ink);
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 2px;
  color: var(--rail-ink-2);
  font-weight: 600;
}

.rail-link:hover {
  background: var(--rail-2);
  color: var(--rail-ink);
  text-decoration: none;
}

.rail-link.is-active {
  background: var(--rail-ink);
  color: var(--rail);
  --focus: var(--orange);
}

.rail-link.is-drop {
  background: var(--rail-3);
  color: var(--rail-ink);
  outline: 2px dashed var(--rail-ink);
  outline-offset: -2px;
}

.rail-link .ic {
  flex: none;
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 2px 12px;
}

.rail-head h2 {
  font-size: var(--fs-s);
  color: var(--rail-ink-2);
}

.rail .icon-btn,
.transport .icon-btn {
  color: var(--rail-ink-2);
}

.rail .icon-btn:hover,
.transport .icon-btn:hover {
  background: var(--rail-2);
  color: var(--rail-ink);
}

.rail-lists {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rail-3) transparent;
}

.rail-pl .rail-card {
  width: 12px;
  height: 12px;
  padding: 0;
  margin: 0 4px;
}

.rail-card .card-name {
  display: none;
}

.rail-pl-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-empty {
  padding: 8px 12px;
  color: var(--rail-ink-2);
  font-size: var(--fs-s);
}

.rail-foot {
  margin-top: 8px;
}

/* ----- sheet ----- */

.sheet {
  grid-area: sheet;
  min-height: 0;
  overflow-y: auto;
  background: var(--sheet);
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
  overscroll-behavior: contain;
}

.view {
  container-type: inline-size;
  container-name: view;
}

.page {
  max-width: 1120px;
  padding: 30px var(--page-pad) 72px;
}

.page--settings {
  max-width: 760px;
}

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

.stage {
  grid-area: stage;
  position: relative;
  z-index: 90; /* above menus, toasts and the drop hint: nothing is ever drawn over the player */
  aspect-ratio: 16 / 9;
  background: #000;
  color: #f3f4ef;
  overflow: hidden;
}

.app[data-stage="off"] .stage {
  display: none;
}

.stage-yt,
.stage-yt iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.stage-art {
  position: absolute;
  inset: 0;
  display: none;
  align-items: stretch;
  gap: 18px;
  background: var(--rail);
}

.app[data-stage="art"] .stage-art {
  display: flex;
}

.app[data-stage="art"] .stage-yt {
  visibility: hidden;
}

.stage-cover {
  height: 100%;
  width: auto;
  aspect-ratio: 1;
  background: var(--rail-3);
  color: var(--rail-ink-2);
}

.stage-lines {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-right: 16px;
}

.stage-big {
  font-size: var(--fs-l);
  font-weight: 900;
  font-stretch: 62%;
  line-height: 0.94;
  text-transform: uppercase;
}

.stage-small {
  margin-top: 8px;
  color: var(--rail-ink-2);
  font-size: var(--fs-s);
}

.stage-side {
  display: none;
}

.stage-side-title {
  max-width: 100%;
  margin-top: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--rail-ink);
  font-weight: 800;
}

.stage-side-by {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--rail-ink-2);
  font-size: var(--fs-s);
}

.stage-side-note {
  margin-top: 6px;
  color: var(--rail-ink);
  font-size: var(--fs-s);
  font-weight: 700;
}

.stage-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(0 0 0 / 0.78);
  font-size: var(--fs-s);
  text-align: center;
}

/* ----- side panel ----- */

.side {
  grid-area: side;
  min-height: 0;
  overflow-y: auto;
  background: var(--sheet-2);
  border-left: 1px solid var(--rule);
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.now {
  padding: 0 20px 40px;
}

.now-head {
  padding: 18px 0 14px;
}

.now-head .empty {
  padding: 24px 0;
}

.now-sticker {
  margin: 6px 0 16px -6px;
}

.now-finding {
  display: inline-block;
  padding: 9px 4px;
  color: var(--ink-2);
  font-size: var(--fs-s);
}

.now-title {
  font-size: var(--fs-m);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.now-by {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: var(--fs-s);
  overflow-wrap: anywhere;
}

.now-status {
  margin-top: 10px;
  font-size: var(--fs-s);
  font-weight: 700;
}

.now-status.is-bad,
.field-status.is-bad,
.field-error {
  color: var(--red);
}

/* ================= the sticker ================= */

/* Three layers: .sticker tilts and takes focus, .sticker-edge is the ink outline of a white
   sticker, .sticker-face is the ink and the lettering. --n sizes every cut and corner, and
   each kind has its own outline so it reads without colour. */
.sticker {
  --n: 22px;
  display: inline-block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-ink);
  font-stretch: 62%;
  font-weight: 900;
  line-height: 0.92;
  text-align: left;
  text-transform: uppercase;
  transform: rotate(-3deg);
  transform-origin: 18% 50%;
  --focus: var(--ink);
  animation: slap 0.26s var(--ease) both;
}

button.sticker,
a.sticker {
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}

button.sticker:hover,
a.sticker:hover,
button.sticker[aria-expanded="true"] {
  transform: rotate(-1deg) scale(1.03);
  text-decoration: none;
}

.sticker-edge {
  display: block;
  clip-path: var(--shape, none);
}

.sticker-face {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 10px 18px 6px;
  border-radius: 2px;
  background: var(--st, var(--card));
  clip-path: var(--shape, none);
}

.sticker-top {
  font-size: var(--fs-l);
  white-space: nowrap;
}

.sticker-sub {
  font-size: var(--fs-s);
  font-stretch: 75%;
  font-weight: 800;
  letter-spacing: 0.05em;
}

/* inks: one job each */
.sticker--green {
  --st: var(--green);
}

.sticker--yellow {
  --st: var(--yellow);
}

.sticker--blue {
  --st: var(--blue);
}

.sticker--red {
  --st: var(--red);
}

.sticker--red .sticker-face {
  color: #fff;
}

:root[data-theme="night"] .sticker--red .sticker-face {
  color: var(--on-ink);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) .sticker--red .sticker-face {
    color: var(--on-ink);
  }
}

.sticker--white .sticker-edge {
  padding: 2px;
  border-radius: 3px;
  background: var(--on-ink);
}

/* outlines: one per kind */
.sticker--tag {
  --shape: polygon(var(--n) 0, 100% 0, 100% 100%, var(--n) 100%, 0 50%);
}

.sticker--tag .sticker-face {
  padding-left: calc(var(--n) * 1.5);
}

.sticker--slant {
  --shape: polygon(calc(var(--n) * 0.8) 0, 100% 0, calc(100% - var(--n) * 0.8) 100%, 0 100%);
}

.sticker--slant .sticker-face {
  padding-inline: calc(var(--n) * 1.25);
}

.sticker--flag {
  --shape: polygon(0 0, 100% 0, calc(100% - var(--n) * 0.9) 50%, 100% 100%, 0 100%);
}

.sticker--flag .sticker-face {
  padding-right: calc(var(--n) * 1.7);
}

.sticker--chamfer {
  --c: calc(var(--n) * 0.55);
  --shape: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
}

.sticker--cut {
  --shape: polygon(0 0, calc(100% - var(--n)) 0, 100% var(--n), 100% 100%, 0 100%);
}

.sticker--cut .sticker-face {
  padding-right: calc(var(--n) * 1.35);
}

.sticker--pill .sticker-edge,
.sticker--pill .sticker-face {
  border-radius: 999px;
}

.sticker--pill .sticker-face {
  padding-inline: calc(var(--n) * 1.2);
}

.sticker--dashed .sticker-edge {
  padding: 0;
  background: none;
}

.sticker--dashed .sticker-face {
  border: 2px dashed var(--on-ink);
}

.sticker--round {
  transform-origin: 50% 50%;
}

.sticker--round .sticker-face {
  width: calc(var(--n) * 9.2);
  height: calc(var(--n) * 9.2);
  padding: 6px;
  align-items: center;
  text-align: center;
  border-radius: 50%;
}

.sticker--oval .sticker-face {
  padding: var(--n) calc(var(--n) * 1.6) calc(var(--n) * 0.8);
  align-items: center;
  text-align: center;
  border-radius: 50%;
}

/* the middle size, beside the docked video */
.sticker--m {
  --n: 12px;
}

.sticker--m .sticker-face {
  gap: 1px;
  padding-block: 8px 5px;
  padding-inline: 12px;
}

.sticker--m .sticker-top {
  font-size: var(--fs-m);
  font-stretch: 66%;
  letter-spacing: 0.04em;
}

.sticker--m.sticker--round .sticker-face {
  padding: 6px;
}

/* the list-size copy */
.sticker--s {
  --n: 8px;
  transform: rotate(-2deg);
  animation: none;
}

.sticker--s .sticker-face {
  gap: 0;
  padding-block: 5px 3px;
  padding-inline: 9px;
}

.sticker--s .sticker-top {
  font-size: var(--fs-s);
  font-stretch: 70%;
  letter-spacing: 0.05em;
}

.sticker--s.sticker--white .sticker-edge {
  padding: 1.5px;
}

.sticker--s.sticker--round .sticker-face,
.sticker--s.sticker--oval .sticker-face {
  width: auto;
  height: auto;
  padding: 5px 11px 3px;
  border-radius: 999px;
}

@keyframes slap {
  from {
    opacity: 0;
    transform: rotate(5deg) scale(1.3);
  }
}

/* the key shown when nothing is playing */
.key-title {
  margin-top: 6px;
  font-size: var(--fs-m);
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.key-lead {
  max-width: 40ch;
  margin-top: 6px;
  color: var(--ink-2);
}

.key-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 28px;
}

.key-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.key-list .sticker {
  animation: none;
}

.key-text {
  max-width: 40ch;
  color: var(--ink-2);
  font-size: var(--fs-s);
}

/* small sticker marks on songs whose source is already known */
.mark {
  flex: none;
  display: inline-block;
}

.mark--own {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--blue);
}

.mark--audio {
  position: relative;
  width: 18px;
  height: 12px;
  background: var(--ink);
  clip-path: polygon(5px 0, 100% 0, 100% 100%, 5px 100%, 0 50%);
}

.mark--audio::after {
  content: "";
  position: absolute;
  inset: 1.5px 1.5px 1.5px 3px;
  background: var(--green);
  clip-path: polygon(4px 0, 100% 0, 100% 100%, 4px 100%, 0 50%);
}

.trk.is-current .mark--own {
  border-color: var(--on-ink);
}

.trk.is-current .mark--audio {
  background: var(--on-ink);
}

.trk-tag {
  flex: none;
  padding: 1px 6px 0;
  border: 1.5px solid var(--red);
  border-radius: 2px;
  color: var(--red);
  font-size: var(--fs-s);
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ----- the receipt ----- */

.now-receipt {
  margin: 0 0 10px;
  padding: 14px 14px 16px;
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 14px;
  font-size: var(--fs-s);
}

.facts dt {
  color: var(--ink-3);
}

.facts dd {
  overflow-wrap: anywhere;
}

.receipt-why {
  max-width: 46ch;
  font-size: var(--fs-s);
}

.receipt-h {
  margin: 16px 0 8px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--ink-3);
  font-size: var(--fs-s);
}

.alts li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: var(--fs-s);
}

.alt-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.receipt-link {
  display: flex;
  gap: 8px;
}

.receipt-link .input {
  flex: 1;
  height: 32px;
  font-size: var(--fs-s);
}

.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.field-error {
  margin-top: 6px;
  font-size: var(--fs-s);
}

/* ----- up next ----- */

.upnext .sec {
  margin-top: 14px;
}

.qhead {
  margin: 14px 0 4px;
  color: var(--ink-3);
  font-size: var(--fs-s);
}

.qrow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 2px;
}

.qrow:hover {
  background: var(--sheet-3);
}

.qrow-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 5px 4px;
  border: 0;
  border-radius: 2px;
  background: none;
  text-align: left;
  cursor: pointer;
}

.qrow .cover {
  width: 36px;
}

.qrow-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.qrow-title,
.qrow-artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qrow-title {
  font-weight: 600;
}

.qrow-artist {
  color: var(--ink-2);
  font-size: var(--fs-s);
}

.qrow-x {
  opacity: 0;
}

.qrow:hover .qrow-x,
.qrow-x:focus-visible {
  opacity: 1;
}

.upnext-empty,
.upnext-more {
  padding: 8px 0;
  color: var(--ink-2);
  font-size: var(--fs-s);
}

/* ================= transport ================= */

.transport {
  grid-area: bar;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 4px 16px 0;
  background: var(--rail);
  color: var(--rail-ink);
  --focus: var(--rail-ink);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --track: var(--rail-track);
  --fill: var(--orange);
  --p: 0%;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(to right, var(--fill) var(--p), var(--track) var(--p));
}

input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--track);
}

input[type="range"]::-moz-range-progress {
  height: 4px;
  background: var(--fill);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 2px;
  background: var(--rail-ink);
  opacity: 0;
  transition: opacity 0.12s;
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 2px;
  background: var(--rail-ink);
  opacity: 0;
}

input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:focus-visible::-webkit-slider-thumb,
input[type="range"]:active::-webkit-slider-thumb {
  opacity: 1;
}

input[type="range"]:hover::-moz-range-thumb,
input[type="range"]:focus-visible::-moz-range-thumb {
  opacity: 1;
}

input[type="range"]:disabled {
  cursor: default;
}

input[type="range"]:disabled::-webkit-slider-thumb {
  opacity: 0;
}

.seek {
  position: absolute;
  left: 0;
  right: 0;
  top: -6px;
  width: 100%;
  height: 16px;
}

.tp-now {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tp-cover {
  flex: none;
  width: 48px;
  height: 48px;
  background: var(--rail-2);
}

.tp-cover .cover {
  width: 48px;
  background: var(--rail-3);
  color: var(--rail-ink-2);
}

.tp-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tp-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.is-empty .tp-title {
  color: var(--rail-ink-2);
  font-weight: 400;
}

.tp-sub {
  display: flex;
  gap: 8px;
  min-width: 0;
  color: var(--rail-ink-2);
  font-size: var(--fs-s);
}

.tp-artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tp-hint {
  flex: none;
  color: var(--rail-ink);
  font-weight: 700;
}

.tp-hint.is-preview {
  color: var(--yellow);
}

.tp-ctl {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tp-time {
  width: 46px;
  color: var(--rail-ink-2);
  font-size: var(--fs-s);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.tp-play {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 8px;
  border: 0;
  border-radius: 2px;
  background: var(--orange);
  color: var(--on-ink);
  cursor: pointer;
  transition: transform 0.16s var(--ease), background-color 0.12s;
}

.tp-play:hover {
  transform: scale(1.06);
}

.tp-play:active {
  transform: scale(0.95);
}

.tp-play:disabled {
  background: var(--rail-3);
  color: var(--rail-ink-2);
  transform: none;
  cursor: default;
}

.tp-play .ic-pause,
.is-playing .tp-play .ic-play {
  display: none;
}

.is-playing .tp-play .ic-pause {
  display: block;
}

.transport .tp-mode.is-on {
  background: var(--rail-ink);
  color: var(--rail);
}

.transport .tp-like.is-on,
.trk-like.is-on {
  background: var(--pink);
  color: var(--on-ink);
}

.tp-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.transport .tp-queue {
  display: none;
}

.is-empty .tp-like {
  display: none;
}

.tp-sticker {
  display: none;
  flex: none;
}

.transport .vol {
  width: 108px;
  height: 20px;
  --fill: var(--rail-ink);
}

/* the full transport on the phone's Now playing screen: an edge-to-edge band, no box */
.transport--full {
  grid-area: auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  margin: 20px calc(-1 * var(--page-pad)) 0;
  padding: 10px var(--page-pad) 14px;
}

.tp-seekrow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.transport--full .seek {
  position: static;
  height: 44px;
}

.transport--full .seek::-webkit-slider-thumb {
  opacity: 1;
  width: 20px;
  height: 20px;
  margin-top: -8px;
}

.transport--full .seek::-moz-range-thumb {
  opacity: 1;
  width: 20px;
  height: 20px;
}

.transport--full .tp-ctl {
  justify-content: space-between;
}

.page--now .now {
  padding: 0;
}

/* ================= buttons and fields ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-s);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s, transform 0.12s var(--ease);
}

.btn:hover {
  background: var(--ink);
  color: var(--sheet);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.42;
  pointer-events: none;
}

.btn--primary {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--on-ink);
}

.btn--primary:hover {
  background: var(--orange-2);
  border-color: var(--orange-2);
  color: var(--on-ink);
}

.btn--s {
  min-height: 32px;
  padding: 0 10px;
}

.btn--danger {
  border-color: var(--red);
  color: var(--red);
}

.btn--danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--sheet);
}

.btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--sheet);
}

.icon-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s;
}

.icon-btn:hover {
  background: var(--sheet-3);
  color: var(--ink);
  text-decoration: none;
}

.icon-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.link-btn {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: var(--fs-s);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--ink);
}

.input,
.select {
  height: 40px;
  min-width: 0;
  padding: 0 12px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--sheet);
  color: var(--ink);
  caret-color: var(--ink);
}

.input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  font-weight: 600;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--orange);
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

/* ================= headings ================= */

.sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  margin-top: 44px;
  padding-top: 2px;
  border-top: 2px solid var(--ink);
}

.sec h2 {
  font-size: var(--fs-m);
}

.sec-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec .select {
  height: 32px;
  padding-right: 30px;
  font-size: var(--fs-s);
  background-position: calc(100% - 15px) 13px, calc(100% - 10px) 13px;
}

.page > .sec:first-child,
.page > div:first-child > .sec:first-child,
.search-body > .sec:first-child,
.search-body > div:first-child > .sec:first-child {
  margin-top: 0;
}

.hero {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}

.hero-cover {
  flex: none;
  width: 232px;
}

.hero-text {
  min-width: 0;
}

.hero-title {
  font-size: var(--fs-l);
  font-weight: 900;
  font-stretch: 66%;
  line-height: 0.98;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.hero-by {
  margin-top: 10px;
  font-weight: 700;
}

.hero-meta {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: var(--fs-s);
  font-variant-numeric: tabular-nums;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.hero + .sec {
  margin-top: 28px;
}

.title-btn {
  all: unset;
  cursor: text;
  border-radius: 2px;
}

.title-btn:hover {
  background: var(--sheet-2);
}

.title-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.title-input {
  width: 100%;
  height: auto;
  padding: 2px 8px;
  font: inherit;
  font-stretch: inherit;
  text-transform: uppercase;
}

/* ================= track table ================= */

.tracks {
  --cols: 36px 40px minmax(0, 5fr) minmax(0, 3fr) 36px 52px 36px;
  border-top: 1px solid var(--rule);
}

.tracks--nocover {
  --cols: 36px minmax(0, 5fr) minmax(0, 3fr) 36px 52px 36px;
}

.tracks--nomid {
  --cols: 36px 40px minmax(0, 1fr) 36px 52px 36px;
}

.tracks--nocover.tracks--nomid {
  --cols: 36px minmax(0, 1fr) 36px 52px 36px;
}

.trk {
  position: relative;
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  column-gap: 12px;
  min-height: 56px;
  padding: 0 8px 0 4px;
  border-bottom: 1px solid var(--rule);
  cursor: default;
}

.tracks--tight .trk {
  min-height: 46px;
}

.trk:hover {
  background: var(--sheet-2);
}

/* only the playing row burns at full strength */
.trk.is-current,
.trk.is-current:hover {
  background: var(--orange);
  border-bottom-color: var(--orange);
  color: var(--on-ink);
  --focus: var(--on-ink);
}

.trk.is-current .trk-artist,
.trk.is-current .trk-mid,
.trk.is-current .trk-time,
.trk.is-current .trk-play,
.trk.is-current .icon-btn,
.trk.is-current .ic-explicit {
  color: var(--on-ink);
}

.trk.is-current .icon-btn:hover {
  background: rgb(20 20 19 / 0.14);
}

.trk-play {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  color: var(--ink-3);
  font-size: var(--fs-s);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.trk-play .ic {
  display: none;
}

.trk-play:focus-visible .trk-n,
.trk.is-current .trk-n {
  display: none;
}

.trk-play:focus-visible .ic-play,
.trk.is-current:not(.is-playing) .ic-play,
.trk.is-current.is-playing .ic-pause {
  display: block;
}

@media (hover: hover) {
  .trk:hover .trk-n {
    display: none;
  }

  .trk:hover:not(.is-current) .ic-play {
    display: block;
    color: var(--ink);
  }
}

.cover {
  position: relative;
  display: block;
  flex: none;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--sheet-3);
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover--blank {
  display: grid;
  place-items: center;
  color: var(--ink-2);
}

.trk-cover {
  width: 40px;
}

.trk-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.trk-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 600;
}

.trk-name,
.trk-artist,
.trk-mid {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trk-title .ic-explicit {
  flex: none;
  color: var(--ink-3);
}

.trk-artist {
  align-self: flex-start;
  max-width: 100%;
  color: var(--ink-2);
  font-size: var(--fs-s);
}

.trk-mid {
  color: var(--ink-2);
  font-size: var(--fs-s);
}

.trk-time {
  color: var(--ink-2);
  font-size: var(--fs-s);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.trk-like {
  color: var(--ink-3);
}

@media (hover: hover) {
  .trk-like:not(.is-on),
  .trk-more {
    opacity: 0;
  }

  .trk:hover .trk-like,
  .trk:hover .trk-more,
  .trk-like:focus-visible,
  .trk-more:focus-visible {
    opacity: 1;
  }
}

.trk.is-dragging {
  opacity: 0.45;
}

.drop-before::before,
.drop-after::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 3px;
  background: var(--ink);
  pointer-events: none;
}

.drop-before::before {
  top: -2px;
}

.drop-after::after {
  bottom: -2px;
}

.more-btn {
  margin-top: 10px;
}

@container view (max-width: 640px) {
  .tracks,
  .tracks--nomid {
    --cols: 44px 40px minmax(0, 1fr) auto 40px 44px;
  }

  .tracks--nocover,
  .tracks--nocover.tracks--nomid {
    --cols: 44px minmax(0, 1fr) auto 40px 44px;
  }

  /* un-liked rows keep "like" in their menu; a liked row shows its pink plate */
  .trk-like:not(.is-on) {
    display: none;
  }

  .trk-like {
    grid-column: 4;
  }

  .trk-time {
    grid-column: 5;
  }

  .trk-more {
    grid-column: 6;
  }

  .tracks--nocover .trk-like {
    grid-column: 3;
  }

  .tracks--nocover .trk-time {
    grid-column: 4;
  }

  .tracks--nocover .trk-more {
    grid-column: 5;
  }

  .trk-play {
    width: 44px;
    height: 44px;
  }

  .trk {
    column-gap: 6px;
    padding: 0;
  }

  .trk-mid {
    display: none;
  }
}

/* ================= covers ================= */

/* sleeves in a bin: no gutters, no card chrome */
.covers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  column-gap: 2px;
}

.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 148px;
  column-gap: 2px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.strip::-webkit-scrollbar {
  display: none;
}

.cv {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 0 20px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
}

.cv .cover {
  width: 100%;
}

.cv:hover {
  text-decoration: none;
}

.cv:hover .cv-title {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
}

.cv:focus-visible {
  outline-offset: -2px;
}

.cv-title,
.cv-sub {
  margin-right: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cv-title {
  margin-top: 8px;
  font-weight: 600;
}

.cv-sub {
  color: var(--ink-2);
  font-size: var(--fs-s);
}

/* a playlist's cover: its name by hand on a divider card */
.cover--card {
  container-type: inline-size;
  display: grid;
  place-items: var(--ay, center) var(--ax, center);
  padding: 9%;
  background: var(--tone, var(--card));
  color: var(--on-ink);
}

.card--pink {
  --tone: var(--pink);
}

.card--blue {
  --tone: var(--blue);
}

.card--white {
  box-shadow: inset 0 0 0 1.5px var(--on-ink);
}

.card-name {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  font-family: var(--hand);
  font-weight: 700;
  line-height: 1;
  text-align: var(--ax, center);
  text-transform: uppercase;
  overflow-wrap: anywhere;
  transform: rotate(var(--tilt, -4deg));
}

/* too small to letter: the card is just its ink */
@container (max-width: 72px) {
  .card-name {
    display: none;
  }
}

.card--xl .card-name {
  font-size: 30cqw;
}

.card--l .card-name {
  font-size: 23cqw;
}

.card--m .card-name {
  font-size: 18cqw;
}

.card--s .card-name {
  font-size: 13cqw;
}

/* ================= states ================= */

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 48ch;
  padding: 28px 0;
  color: var(--ink-2);
}

.empty > .ic {
  color: var(--ink-3);
}

.empty-title {
  color: var(--ink);
}

.empty .btn {
  margin-top: 8px;
}

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 28px;
  padding: 14px 16px;
  border-radius: 2px;
  background: var(--yellow);
  color: var(--on-ink);
  --focus: var(--on-ink);
}

.notice p {
  flex: 1 1 240px;
  max-width: 64ch;
}

.notice .btn {
  border-color: var(--on-ink);
  color: var(--on-ink);
}

.notice .btn:hover {
  background: var(--on-ink);
  color: var(--yellow);
}

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}

.callout p {
  flex: 1 1 240px;
  max-width: 64ch;
}

/* At the top of a page, where the yellow notice would otherwise sit. */
.callout--top {
  margin: 0 0 28px;
}

.hint {
  max-width: 64ch;
  color: var(--ink-2);
  font-size: var(--fs-s);
}

.hint a,
.prose a,
.steps a {
  text-decoration: underline;
}

.skel,
.skel-grid {
  animation: breathe 1.3s ease-in-out infinite;
}

.skel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 8px;
  border-bottom: 1px solid var(--rule);
}

.skel-n {
  width: 24px;
}

.skel-cover,
.skel-block {
  background: var(--sheet-3);
}

.skel-cover {
  width: 40px;
  height: 40px;
}

.skel-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.skel-text i {
  display: block;
  height: 10px;
  background: var(--sheet-3);
}

@keyframes breathe {
  50% {
    opacity: 0.5;
  }
}

/* ================= simple lists ================= */

.plain-list li {
  border-bottom: 1px solid var(--rule);
}

.plain-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 4px;
  font-weight: 600;
}

.plain-link:hover {
  background: var(--sheet-2);
  text-decoration: none;
}

.plain-link .ic {
  flex: none;
  color: var(--ink-3);
}

.plain-note {
  margin-left: auto;
  color: var(--ink-2);
  font-size: var(--fs-s);
  font-weight: 400;
}

.lib-list {
  border-top: 1px solid var(--rule);
}

.lib-list--foot {
  margin-top: 32px;
}

.lib-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--rule);
}

.lib-row:hover {
  background: var(--sheet-2);
  text-decoration: none;
}

.lib-row .cover {
  width: 48px;
}

.lib-row > .ic {
  flex: none;
  color: var(--ink-3);
}

.lib-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lib-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.lib-note {
  color: var(--ink-2);
  font-size: var(--fs-s);
}

.card--icon {
  place-items: center;
  padding: 0;
}

/* ================= search ================= */

.search-box {
  display: none;
  position: relative;
  margin-bottom: 20px;
}

.search-box .ic {
  position: absolute;
  left: 13px;
  top: 50%;
  translate: 0 -50%;
  color: var(--ink-3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 48px;
  padding-left: 44px;
}

.yt-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.yt-box .tracks,
.yt-box .skel,
.yt-box .empty {
  align-self: stretch;
}

/* ================= settings ================= */

.set-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 64ch;
  padding: 2px 0 4px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 1.5em;
  list-style: decimal;
}

.steps li::marker {
  font-weight: 800;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  align-self: stretch;
}

.field-label {
  flex-basis: 100%;
  font-weight: 700;
}

.field-row .input {
  flex: 1 1 220px;
}

.field-status {
  min-height: 1.4em;
  color: var(--ink-2);
  font-size: var(--fs-s);
}

/* The account form: two labelled fields and one button, no wider than a comfortable line.
   Both fields are the same width; the show-password button sits in a column of its own. */
.acct-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: stretch;
  max-width: 464px;
}

.acct-form .field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
}

.acct-form .field-label {
  grid-column: 1 / -1;
}

/* What happened sits beside the button that caused it. */
.acct-go {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 4px;
}

.acct-go .field-status {
  flex: 1 1 200px;
  min-height: 0;
}

.acct-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 24px;
}

.set-ok {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.set-ok .ic {
  flex: none;
  padding: 2px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--sheet);
}

.set-details {
  align-self: stretch;
}

.set-details summary {
  width: max-content;
  cursor: pointer;
  font-size: var(--fs-s);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.set-details[open] summary {
  margin-bottom: 12px;
}

.set-details .btn {
  margin-top: 8px;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.seg {
  display: inline-flex;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}

.seg-opt {
  position: relative;
}

.seg-opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.seg-opt label {
  display: block;
  padding: 9px 14px;
  font-size: var(--fs-s);
  font-weight: 700;
}

.seg-opt + .seg-opt label {
  border-left: 1.5px solid var(--ink);
}

.seg-opt input:checked + label {
  background: var(--ink);
  color: var(--sheet);
}

.seg-opt input:focus-visible + label {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.btn-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.set-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  align-self: stretch;
}

.set-row p {
  flex: 1 1 280px;
}

.keys {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 8px 20px;
  max-width: 440px;
}

kbd {
  display: inline-block;
  padding: 2px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  font: inherit;
  font-size: var(--fs-s);
  font-weight: 700;
  white-space: nowrap;
}

.set-about {
  margin-top: 44px;
}

/* ================= menus and toasts ================= */

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.menu-backdrop.is-sheet {
  background: rgb(0 0 0 / 0.5);
}

.menu {
  position: fixed;
  z-index: 61;
  min-width: 228px;
  max-width: min(320px, calc(100vw - 16px));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 4px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--sheet);
  color: var(--ink);
  outline: none;
}

.menu--sheet {
  left: 0;
  right: 0;
  bottom: 0;
  max-width: none;
  max-height: 72dvh;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-width: 1.5px 0 0;
  animation: rise 0.22s var(--ease);
}

@keyframes rise {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 2px;
  background: none;
  text-align: left;
  cursor: pointer;
}

.menu--sheet .menu-item {
  min-height: 48px;
}

.menu-item:hover {
  background: var(--sheet-2);
}

.menu-item:focus-visible {
  background: var(--ink);
  color: var(--sheet);
  outline: none;
}

.menu-item:focus-visible .menu-note {
  color: inherit;
}

.menu-item:disabled {
  opacity: 0.42;
  pointer-events: none;
}

.menu-item.is-danger:not(:focus-visible) {
  color: var(--red);
}

.menu-item .ic {
  flex: none;
}

.menu-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-note {
  color: var(--ink-3);
  font-size: var(--fs-s);
  font-variant-numeric: tabular-nums;
}

.menu-gap {
  width: 18px;
}

.menu-sep {
  height: 1px;
  margin: 4px 0;
  background: var(--rule);
}

.menu-title,
.menu-head {
  padding: 8px 10px 6px;
  color: var(--ink-3);
  font-size: var(--fs-s);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: var(--toast-gap);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 24px);
  translate: -50% 0;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--rail-ink);
  border-radius: 2px;
  background: var(--rail);
  color: var(--rail-ink);
  font-weight: 600;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.16s, transform 0.22s var(--ease);
  --focus: var(--rail-ink);
}

.toast.in {
  opacity: 1;
  transform: none;
}

.toast-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast-act {
  flex: none;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--rail-ink);
  font-size: var(--fs-s);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.toast-act:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* a window-wide hint while music files are dragged over it */
.app.is-file-drop::after {
  content: "Drop to add to Your files";
  position: fixed;
  inset: 12px;
  z-index: 80;
  display: grid;
  place-items: center;
  border: 3px dashed var(--on-ink);
  border-radius: 2px;
  background: var(--blue);
  color: var(--on-ink);
  font-size: var(--fs-l);
  font-weight: 900;
  font-stretch: 62%;
  text-transform: uppercase;
  text-align: center;
  pointer-events: none;
}

/* ================= narrower windows: the stage docks above the sheet ================= */

@media (max-width: 1099px) {
  .app {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) var(--bar-h);
    grid-template-areas:
      "rail stage"
      "rail sheet"
      "bar bar";
  }

  .side {
    display: none;
  }

  /* A black band across the top of the sheet: the video at 16:9 on the left, the sticker
     and the song's name beside it. Nothing ever sits on top of a row. */
  .stage {
    aspect-ratio: auto;
    height: 208px;
    background: var(--rail);
  }

  .stage-yt,
  .stage-art,
  .stage-msg {
    inset: 0 auto 0 0;
    width: 370px;
  }

  .stage-side {
    position: absolute;
    inset: 0 0 0 370px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 0 16px 0 22px;
  }

  /* A file or a preview has no video: just its cover, with the sticker beside it saying the rest. */
  .stage-art {
    width: 208px;
  }

  .stage-lines {
    display: none;
  }

  .app[data-stage="art"] .stage-side {
    left: 208px;
  }

  .transport .tp-queue {
    display: inline-grid;
  }

  /* the song's name gets whatever the controls leave */
  .app > .transport {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .transport .vol {
    width: 84px;
  }
}

/* a narrow window with the rail still showing: times and the volume slider make room */
@media (min-width: 760px) and (max-width: 919px) {
  .app > .transport .tp-time,
  .app > .transport .vol {
    display: none;
  }
}

/* ================= phones ================= */

@media (max-width: 759px) {
  :root {
    --fs-l: 2.25rem;
    --bar-h: 60px;
    --page-pad: 16px;
    --toast-gap: calc(132px + env(safe-area-inset-bottom));
  }

  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "stage"
      "sheet"
      "bar"
      "tabs";
  }

  .rail {
    display: none;
  }

  /* back in the flow at the top of the screen; still the positioning box for the player inside */
  .stage {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
    min-height: 200px;
    max-height: max(200px, 44dvh);
    background: #000;
  }

  .stage-yt,
  .stage-art,
  .stage-msg {
    inset: 0;
    width: 100%;
  }

  .stage-side {
    display: none;
  }

  /* own files and previews need no video, so the phone gives that room back */
  .app[data-stage="art"] .stage {
    display: none;
  }

  .page {
    padding: 20px var(--page-pad) 40px;
  }

  .notice {
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
  }

  .sticker {
    --n: 18px;
  }

  .sticker--s {
    --n: 8px;
  }

  /* everything you press is at least 44 px */
  .btn,
  .btn--s {
    min-height: 44px;
  }

  .input,
  .select,
  .sec .select,
  .receipt-link .input {
    height: 44px;
  }

  .select,
  .sec .select {
    background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  }

  .link-btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .search-box {
    display: block;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
  }

  .hero-cover {
    width: 168px;
  }

  .sec {
    margin-top: 36px;
  }

  .covers {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  }

  .strip {
    grid-auto-columns: 128px;
    margin-right: -16px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .trk {
    min-height: 60px;
  }

  /* the mini player */
  .app > .transport {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: var(--bar-h);
    padding: 4px 6px 0 8px;
  }

  /* the mini player carries a small copy of the sticker after the artist */
  .app > .transport .tp-sticker {
    display: block;
  }

  .app > .transport .tp-sub {
    align-items: center;
  }

  .app > .transport .tp-side,
  .app > .transport .tp-time,
  .app > .transport .tp-mode,
  .app > .transport .tp-prev,
  .app > .transport .tp-like {
    display: none;
  }

  .app > .transport .tp-cover {
    width: 44px;
    height: 44px;
  }

  .app > .transport .tp-cover .cover {
    width: 44px;
  }

  .app > .transport .tp-play {
    width: 44px;
    height: 44px;
    margin: 0 2px;
  }

  .app > .transport .seek {
    pointer-events: none;
  }

  .app[data-route="now"] > .transport {
    display: none;
  }

  .tabs {
    grid-area: tabs;
    display: flex;
    gap: 4px;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    background: var(--rail);
    border-top: 1px solid var(--rail-3);
    --focus: var(--rail-ink);
  }

  .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 48px;
    padding: 6px 0 4px;
    border-radius: 2px;
    color: var(--rail-ink-2);
    font-size: var(--fs-s);
    font-weight: 700;
  }

  .tab:hover {
    text-decoration: none;
  }

  .tab.is-active {
    background: var(--rail-ink);
    color: var(--rail);
  }

  .now {
    padding: 0 0 24px;
  }

  .page--now {
    padding-top: 4px;
  }

  .qrow-x {
    opacity: 1;
  }

  .toasts {
    width: calc(100vw - 24px);
  }
}

.tabs {
  display: none;
}

@media (max-width: 759px) {
  .tabs {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* A phone zooms the whole page when a field's text is under 16px. One step up on touch
   screens only; the type scale is unchanged everywhere else. */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px;
  }
}
