/* Authoring and derived tokens: /themes/base.css */

* { box-sizing: border-box; }
html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}
body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.5;
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-size: var(--bg-size, auto);
  background-attachment: fixed;
}
button, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
::selection { color: var(--on-accent); background: var(--selection); }

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1.5rem calc(7rem + env(safe-area-inset-bottom));
}

.top {
  position: sticky;
  top: max(.65rem, env(safe-area-inset-top));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding: .7rem .8rem .7rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--topbar);
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(18px) saturate(1.2);
  animation: rise .55s ease both;
}
.brand-block { min-width: 0; }
.brand {
  font-family: var(--brand-font);
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  line-height: .95;
}
.tagline {
  max-width: 24rem;
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tabs {
  display: flex;
  gap: .25rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: .5rem .9rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: .15s ease;
}
.tab.active, .tab:hover:not(.logout-tab) {
  color: var(--fg);
  border-color: var(--line);
  background: var(--tint);
}
.logout-tab {
  margin-left: .25rem;
  border-color: var(--line);
  color: var(--muted);
}
.logout-tab:hover { color: var(--fg); border-color: var(--accent-line); }

.view { display: none; }
.view.active { display: block; animation: rise .4s ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.home-intro {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.5rem;
  min-height: 210px;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    radial-gradient(520px 230px at 92% 10%, var(--accent2-soft), transparent 65%),
    radial-gradient(480px 260px at 8% 120%, var(--accent-soft), transparent 68%),
    var(--surface);
  box-shadow: var(--shadow);
}
.home-intro::after {
  content: "";
  position: absolute;
  right: -5rem;
  top: -8rem;
  width: 20rem;
  aspect-ratio: 1;
  border: 1px solid var(--tint);
  border-radius: 50%;
  pointer-events: none;
}
.home-copy { position: relative; z-index: 1; min-width: 0; }
.eyebrow {
  display: block;
  margin-bottom: .55rem;
  color: var(--eyebrow);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.home-copy h1 {
  max-width: 700px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -.05em;
}
.home-copy p {
  max-width: 610px;
  margin: .8rem 0 0;
  color: var(--muted);
  font-size: clamp(.88rem, 2vw, 1rem);
}
.home-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
}
.home-status { display: contents; }
.status-line {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  margin: .2rem 0 0;
  width: 100%;
  color: var(--accent2);
  font-size: .85rem;
  animation: pulse 1.4s ease infinite;
}

.btn {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--tint);
  color: var(--fg);
  border-radius: var(--radius-pill);
  padding: .58rem 1.05rem;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary:hover { background: linear-gradient(135deg, var(--accent-bright), var(--accent-strong)); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-strong));
  border-color: transparent;
  color: var(--on-accent);
  box-shadow: 0 10px 32px var(--glow);
}
.btn.hero-play { padding-inline: 1.15rem 1.25rem; }
.btn.hero-play .glyph {
  width: .72em;
  height: .95em;
  display: inline-block;
  vertical-align: -0.12em;
  margin-right: .48em;
}
@supports (-moz-appearance: none) {
  .btn.hero-play .glyph { vertical-align: -0.16em; }
}
.btn.quiet { color: var(--muted); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.loading { animation: pulse 1s ease infinite; }

.shelf { margin: clamp(2rem, 5vw, 3.2rem) 0; }
.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .45rem;
  padding-inline: .15rem;
}
.shelf-head h2 {
  font-family: var(--display);
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  margin: 0;
  letter-spacing: -0.02em;
}
.shelf-hint { color: var(--muted); font-size: .8rem; }
.text-link {
  border: 0;
  background: none;
  color: var(--accent2);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.text-link:hover { color: var(--accent); }

/* Horizontal shelves: flex + JS smooth scroll, no scrollbar */
.shelf-rail {
  position: relative;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.shelf-nav {
  flex: 0 0 auto;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--fg);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: border-color .15s, background .15s, opacity .15s;
  backdrop-filter: blur(8px);
}
.shelf-nav:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.shelf-nav:disabled {
  opacity: .28;
  cursor: default;
  pointer-events: none;
}
.shelf-row {
  display: flex;
  flex-wrap: nowrap;
  gap: .85rem;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1 1 auto;
  min-width: 0;
  padding: 1rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
  scroll-snap-type: none;
}
.shelf-row > * {
  flex: 0 0 180px;
  width: 180px;
  max-width: 180px;
  scroll-snap-align: none;
}
.shelf-row::-webkit-scrollbar { display: none; height: 0; }
@media (max-width: 640px) {
  .shelf-nav { display: none; }
  .shelf-row {
    margin-inline: -1rem;
    padding-inline: 1rem;
    scroll-padding-inline: 1rem;
    scroll-snap-type: x proximity;
  }
  .shelf-row > * {
    flex-basis: min(72vw, 220px);
    width: min(72vw, 220px);
    max-width: min(72vw, 220px);
    scroll-snap-align: start;
  }
}

.mix-card {
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 202px;
  cursor: pointer;
  color: var(--fg);
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  background: var(--bg2);
  isolation: isolate;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  transition: transform .18s ease, border-color .18s, box-shadow .18s, filter .18s;
}
.mix-card::after {
  content: "▶";
  position: absolute;
  right: .85rem;
  bottom: .85rem;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  font-size: .75rem;
  background: rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity .18s ease;
  z-index: 2;
}
.mix-card:hover {
  border-color: var(--accent-line);
  box-shadow: 0 10px 20px rgba(0,0,0,.32);
  filter: brightness(1.06);
  transform: translateY(-3px);
}
.mix-card:hover::after { opacity: 1; }

.entity-card {
  min-height: 200px;
}
.entity-card.track-card {
  min-height: 168px;
}
.entity-card .entity-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  filter: saturate(1.05) brightness(.62);
}
.entity-card .entity-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.entity-card .entity-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 15%, color-mix(in srgb, var(--bg) 93%, transparent) 88%);
}
.entity-card.artist-card .entity-art {
  border-radius: inherit;
  clip-path: circle(42% at 50% 38%);
  filter: saturate(1.1) brightness(.75);
}
.entity-card.artist-card .entity-art::after {
  background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--bg) 93%, transparent) 90%);
  clip-path: none;
}
.entity-card .letter {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 3.2rem;
  font-weight: 800;
  opacity: .22;
  z-index: 0;
  pointer-events: none;
}
.seg {
  display: inline-flex;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--tint);
  margin: 0 0 1rem;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: .88rem;
  padding: .45rem .95rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.seg-btn.active {
  background: var(--accent-soft);
  color: var(--fg);
}
.lib-tools {
  display: flex;
  gap: .55rem;
  align-items: center;
  margin: 0 0 1rem;
}
.lib-tools input {
  -webkit-appearance: none;
  appearance: none;
  color-scheme: inherit;
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: .62rem .9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--fg);
  font: inherit;
  line-height: 1.5;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.lib-tools input::placeholder { color: var(--muted); }
.lib-tools input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.lib-tools input[type="search"]::-webkit-search-decoration,
.lib-tools input[type="search"]::-webkit-search-cancel-button,
.lib-tools input[type="search"]::-webkit-search-results-button {
  -webkit-appearance: none;
}
.lib-tools select {
  -webkit-appearance: none;
  appearance: none;
  color-scheme: inherit;
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  background-color: var(--bg2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23f7f0e8' d='M1 1.2h10L6 6.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  background-size: .7rem;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: .62rem 1.85rem .62rem .9rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}
.lib-tools select:focus {
  outline: none;
  border-color: var(--accent-line);
  color: var(--fg);
}
.lib-tools select option {
  background: var(--bg2);
  color: var(--fg);
  font-size: .88rem;
}
.pl-browser {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}
.pl-browser h3 {
  margin: 0 0 .75rem;
  font-size: 1.05rem;
}
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: .85rem;
  margin-top: .35rem;
}
.lib-grid[hidden] { display: none; }
.lib-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 170px;
  padding: .9rem;
  background: var(--bg2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .25rem;
  transition: border-color .15s, box-shadow .15s, filter .15s;
}
.lib-tile:hover {
  border-color: var(--accent-line);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  filter: brightness(1.05);
}
.lib-tile .tile-art {
  position: absolute;
  inset: 0;
  opacity: .5;
  filter: brightness(.65);
}
.lib-tile .tile-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lib-tile .tile-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 25%, var(--bg2) 92%);
}
.lib-tile.artist .tile-art {
  clip-path: circle(40% at 50% 36%);
  opacity: .7;
}
.lib-tile strong, .lib-tile span, .lib-tile .mix-meta {
  position: relative;
  z-index: 1;
}
.lib-tile span { color: var(--muted); font-size: .78rem; }
.lib-tile .tile-pl {
  display: inline-block;
  margin-left: .35rem;
  border: 1px solid var(--tint-strong);
  border-radius: var(--radius-pill);
  padding: .05rem .45rem;
  font-size: .7rem;
  color: var(--fg);
}
.lib-tile .letter {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 2.8rem;
  font-weight: 800;
  opacity: .2;
  z-index: 0;
  pointer-events: none;
}
.mix-card.highlight {
  border-color: var(--accent-line);
  box-shadow:
    0 0 0 1px var(--accent-soft),
    inset 0 0 42px var(--accent-soft),
    0 10px 18px rgba(0,0,0,.22);
}
.mix-card.today-card {
  outline: 1px solid var(--accent2-line);
}
.mix-card.dim { opacity: .5; }
.mix-card.busy { animation: pulse 1s ease infinite; pointer-events: none; }
.mix-card strong {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  overflow: hidden;
  font-size: 1.05rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.mix-card > span {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.mix-meta {
  position: relative;
  z-index: 1;
  margin-top: auto;
  font-size: .75rem;
  color: var(--accent2);
  font-weight: 700;
}
.cover-photo, .cover-blob {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .55;
  pointer-events: none;
}
.cover-photo {
  filter: saturate(1.05) brightness(.7);
}
.cover-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 20%, var(--bg2) 92%);
}
.cover-blob { filter: blur(0); }
.blob-a { background: linear-gradient(145deg, var(--accent2), var(--bg2) 70%); }
.blob-b { background: linear-gradient(145deg, var(--accent), var(--bg2) 70%); }
.blob-c { background: linear-gradient(145deg, color-mix(in srgb, var(--accent2) 45%, var(--fg)), var(--bg2) 70%); }
.blob-d { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 35%, var(--accent2)), var(--bg2) 70%); }
.tone-b .cover-blob { background: linear-gradient(145deg, var(--accent2), var(--bg2) 72%); }
.tone-c .cover-blob { background: linear-gradient(145deg, var(--accent), var(--bg2) 72%); }
.tone-fav {
  border-color: var(--accent-line) !important;
}
.tone-fav .cover-blob,
.mix-card.tone-fav {
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 55%, var(--bg)), var(--bg2) 72%);
}
.fav-extra {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
  margin-top: .75rem;
}
.chip {
  border: 1px solid var(--line);
  background: var(--tint);
  color: var(--muted);
  font: inherit;
  font-size: .75rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: .35rem .75rem;
  cursor: pointer;
  transition: .15s ease;
}
.chip:hover, .chip.on {
  color: var(--fg);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.card-heart {
  position: absolute;
  top: .65rem;
  right: .65rem;
  z-index: 3;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--tint-strong);
  background: rgba(0,0,0,.4);
  color: var(--muted);
  font-size: .85rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.card-heart.on, .card-heart:hover {
  color: var(--on-accent);
  background: var(--accent-line);
  border-color: transparent;
}
.mix-card .why-line {
  position: relative;
  z-index: 1;
  font-size: .72rem;
  color: var(--accent2);
  margin-top: .15rem;
}

.tips-panel { margin-top: 1rem; display: grid; gap: .7rem; }
.tips-panel.hidden { display: none; }
.tip {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .95rem 1rem;
  background: var(--surface-strong);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  animation: rise .3s ease both;
}
.tip h4 { margin: 0 0 .25rem; font-size: 1rem; }
.tip p { margin: 0; color: var(--muted); font-size: .84rem; }

.now-stage {
  display: grid;
  grid-template-columns: minmax(230px, 340px) minmax(0, 1fr);
  align-items: start;
  gap: 1.35rem;
  margin-bottom: 1.2rem;
}
.now-art {
  position: relative;
  align-self: start;
  width: 100%;
  min-height: 0;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 42%, var(--bg)), var(--bg) 72%);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  overflow: hidden;
}
.now-art > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.now-art.has-art > img { display: block; }
.art-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 4rem;
  opacity: .35;
  font-family: var(--display);
}
.now-art.has-art .art-fallback { display: none; }
.now-meta {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  background: var(--surface-strong);
  backdrop-filter: blur(10px);
}
.now-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin-bottom: .4rem;
}
.label {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .68rem;
  color: var(--muted);
  margin: 0;
}
#title, .page-title {
  font-family: var(--display);
  margin: 0 0 .3rem;
  letter-spacing: -0.02em;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  overflow-wrap: anywhere;
}
#artist, .sub {
  margin: 0 0 1rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.page-title { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .4rem;
  margin: 0 0 1rem;
  padding: 1.6rem 1.35rem 1.7rem;
  min-height: 10.5rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(420px 180px at 92% 10%, var(--accent2-soft), transparent 70%),
    var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--accent);
  outline: none;
}
.dropzone.is-drag {
  border-color: var(--accent);
  background:
    radial-gradient(420px 180px at 92% 10%, var(--accent-soft), transparent 70%),
    var(--surface);
  transform: translateY(-1px);
}
.dropzone.is-busy {
  opacity: .55;
  pointer-events: none;
}
.dropzone strong {
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: -0.03em;
}
.dropzone > span:last-child {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.45;
  max-width: 36rem;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 0 0 1.1rem;
}
.upload-card {
  text-align: left;
  font: inherit;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem 1.15rem;
  background: var(--surface);
  cursor: pointer;
  min-height: 8.4rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: transform .15s ease, border-color .15s, background .15s;
}
.upload-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.upload-card:disabled {
  opacity: .5;
  cursor: default;
  transform: none;
}
.upload-card.loading { animation: pulse 1s ease infinite; }
.upload-card-kicker {
  color: var(--eyebrow);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.upload-card strong {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.upload-card span:last-child {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
  margin-top: auto;
}

.op-bar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.05rem;
  background: var(--surface);
}
.op-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .55rem;
}
.op-bar-head strong { font-size: 1rem; }
#op-pct {
  font-variant-numeric: tabular-nums;
  color: var(--accent2);
  font-weight: 700;
}
.op-track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--line);
  overflow: hidden;
}
.op-fill {
  height: 100%;
  width: var(--op-pct, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent2));
  transition: width .25s ease;
}
.op-bar[data-state="run"] .op-fill { animation: pulse 1.4s ease infinite; }
.op-bar[data-state="done"] .op-fill {
  background: linear-gradient(90deg, var(--accent2), color-mix(in srgb, var(--accent2) 55%, white));
  animation: none;
}
.op-bar[data-state="error"] .op-fill {
  background: var(--danger);
  animation: none;
}
.op-detail {
  margin: .7rem 0 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.45;
}

.jobs-panel {
  margin-top: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: var(--surface);
}
.jobs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.jobs-head h2 {
  margin: .2rem 0 0;
  font-family: var(--display);
  font-size: 1.3rem;
}
.jobs-badge {
  min-width: 2rem;
  padding: .3rem .55rem;
  border-radius: var(--radius-pill);
  color: var(--accent2);
  background: var(--accent2-soft);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
}
.jobs-hint,
.jobs-empty {
  margin: .65rem 0 0;
  color: var(--muted);
  font-size: .84rem;
}
.jobs-list {
  display: grid;
  gap: .65rem;
  margin-top: .9rem;
}
.job-row {
  padding: .8rem .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--tint);
}
.job-row-head,
.job-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}
.job-row-head strong { font-size: .9rem; }
.job-state {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}
.job-row[data-status="running"] .job-state { color: var(--accent2); }
.job-row[data-status="failed"] .job-state { color: var(--danger); }
.job-progress {
  height: 6px;
  margin: .55rem 0;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--line);
}
.job-progress > span {
  display: block;
  width: var(--job-pct, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent2));
  transition: width .25s ease;
}
.job-row-meta {
  color: var(--muted);
  font-size: .76rem;
}
.job-message {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-wrap { margin: .55rem 0 1.1rem; }
#seek {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--seek-pct, 0%),
    var(--line) var(--seek-pct, 0%),
    var(--line) 100%
  );
  outline: none;
  cursor: pointer;
  touch-action: none;
}
#seek::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: transparent;
}
#seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--fg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  cursor: grab;
}
#seek::-moz-range-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--line);
  border: none;
}
#seek::-moz-range-progress {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  border: none;
}
#seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  cursor: grab;
}
.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: .45rem;
  color: var(--muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}

.transport {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}
.transport-btns {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
}
.volume-row {
  grid-column: 3;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: .4rem;
  width: min(8.5rem, 100%);
  margin-left: .7rem;
}
.volume-row .slider { flex: 1; min-width: 0; }
.mini-volume {
  flex: 0 1 6.2rem;
  min-width: 4.2rem;
  display: flex;
  align-items: center;
}
.mini-volume .slider { width: 100%; }
.icon-btn {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--tint);
  color: var(--fg);
  cursor: pointer;
  font-size: 1rem;
  display: grid;
  place-items: center;
  transition: .15s ease;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.play-btn:hover { background: linear-gradient(135deg, var(--accent-bright), var(--accent-strong)); }
.icon-btn.play-btn {
  width: 3.4rem;
  height: 3.4rem;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent-strong));
  border: 0;
  color: var(--on-accent);
  box-shadow: 0 10px 28px var(--glow);
  font-size: 1.15rem;
}
.icon-btn.primary-icon { border-color: var(--accent-line); }
.icon-btn.active-rate {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.icon-btn:disabled { opacity: .35; cursor: default; transform: none; }
.icon-btn.sm { width: 2.35rem; height: 2.35rem; font-size: .9rem; }
.icon-btn .glyph {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  pointer-events: none;
}
.icon-btn.play-btn .glyph { width: 1.22rem; height: 1.22rem; }
.icon-btn.sm .glyph { width: .9rem; height: .9rem; }
.hint-keys {
  margin: .9rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: .72rem;
}

.lyrics-box {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: .75rem;
  text-align: left;
}
.lyrics-box summary {
  cursor: pointer;
  font-size: .85rem;
  color: var(--muted);
  user-select: none;
}
.lyrics-text {
  margin: .65rem 0 0;
  max-height: 14rem;
  overflow: auto;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: .88rem;
  line-height: 1.45;
  color: var(--fg);
  opacity: .9;
}

.queue-panel, .panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: var(--surface);
  margin-bottom: .75rem;
}
.panel + .panel { margin-top: .8rem; }
.share-description { margin: .35rem 0 .75rem; }
.profile-lead { margin: .15rem 0 .7rem; color: var(--fg); }
.profile-detail { margin-top: .45rem; color: var(--muted); }
.taste-meter {
  height: 7px;
  margin: .2rem 0 .9rem;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--line-soft);
}
.taste-meter i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.explore-bounds { margin-top: 1.1rem; display: grid; gap: .55rem; }
.explore-bounds .bound-row {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr) 2.8rem;
  align-items: center;
  gap: .7rem;
  color: var(--muted);
  font-size: .88rem;
}
.explore-bounds .bound-val {
  text-align: right;
  color: var(--fg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Custom range. WebKit and Firefox drop a rule if it contains
   a pseudo-element they do not know, so the two engines stay split. */
.slider {
  --track: color-mix(in srgb, var(--fg) 14%, transparent);
  --fill: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.slider:focus { outline: none; }
.slider:focus-visible { outline: none; }
.slider::-moz-focus-outer { border: 0; }
.slider::-webkit-slider-runnable-track {
  height: 6px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    var(--accent-bright) 0%,
    var(--accent) var(--fill),
    var(--track) var(--fill),
    var(--track) 100%
  );
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border: 2px solid var(--accent-strong);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff 0%, var(--fg) 46%, var(--muted) 100%);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 2px 8px rgba(0, 0, 0, .4);
  cursor: grab;
}
.slider:active::-webkit-slider-thumb {
  cursor: grabbing;
  box-shadow: 0 0 0 7px var(--accent-soft), 0 2px 8px rgba(0, 0, 0, .4);
}
.slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--accent-line), 0 2px 8px rgba(0, 0, 0, .4);
}
.slider::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--track);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
}
.slider::-moz-range-progress {
  height: 6px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-bright), var(--accent));
}
.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent-strong);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff 0%, var(--fg) 46%, var(--muted) 100%);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 2px 8px rgba(0, 0, 0, .4);
  cursor: grab;
}
.slider:active::-moz-range-thumb {
  cursor: grabbing;
  box-shadow: 0 0 0 7px var(--accent-soft), 0 2px 8px rgba(0, 0, 0, .4);
}
.slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px var(--accent-line), 0 2px 8px rgba(0, 0, 0, .4);
}
.profile-artists { margin-top: 1.1rem; }
.artist-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.artist-chip {
  font-size: .78rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: .18rem .6rem;
  color: var(--muted);
}
.bar-legend { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.dot {
  display: inline-block;
  width: .55rem;
  height: .55rem;
  border-radius: var(--radius-pill);
  margin-right: .15rem;
}
.dot.finish { background: var(--accent2); }
.dot.skip { background: var(--accent); }
.collection-item small { color: var(--muted); }
.monitor-panel {
  background:
    radial-gradient(520px 180px at 100% 0%, var(--accent2-soft), transparent 70%),
    var(--surface);
}
.panel-kicker {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
}
.monitor-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-bottom: .7rem;
}
.chip {
  font-size: .72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: .12rem .55rem;
  color: var(--muted);
}
.chip.on { color: var(--accent2); border-color: var(--accent2-line); }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.2rem, 1fr));
  gap: .65rem;
  margin: .7rem 0 1rem;
}
.stat {
  padding: .7rem .75rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
}
.stat b { display: block; font-size: 1.25rem; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: .74rem; }
.monitor-block { margin-top: 1rem; }
.monitor-split {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 1rem;
  margin-top: 1rem;
}
.source-row { margin: .55rem 0; }
.source-head {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  font-size: .78rem;
  color: var(--muted);
}
.bars {
  display: flex;
  height: 6px;
  margin-top: .28rem;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--line-soft);
}
.bars i { display: block; height: 100%; }
.bars .finish { background: var(--accent2); }
.bars .skip { background: var(--accent); }
.arm-list { margin: .35rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.tag.source-exploit { color: var(--accent2); }
.tag.source-transition { color: var(--source-transition); }
.tag.source-explore_adjacent, .tag.source-explore { color: var(--accent); }
.tag.source-wildcard { color: var(--source-wildcard); }
.tag.source-resurface { color: var(--source-resurface); }
.tag.source-new_in_library { color: var(--source-new); }
@media (max-width: 720px) {
  .monitor-split { grid-template-columns: 1fr; }
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .7rem 0;
}
.form-row input, .form-row select, .panel textarea, .panel input[type="text"] {
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: .45rem .7rem;
  font: inherit;
}
.panel textarea { width: 100%; min-height: 5rem; }
.collection-item {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.context-chip { margin: .2rem .25rem 0 0; }
.queue-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .55rem;
}
#queue-hint {
  margin: .25rem 0 0;
  max-width: 28rem;
  font-size: .78rem;
}
#queue {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(52vh, 420px);
  overflow: auto;
}
#queue li { margin: 0; padding: 0; border: 0; }
.playlist {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(52vh, 420px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--line);
}
.playlist::-webkit-scrollbar { width: 8px; }
.playlist::-webkit-scrollbar-track {
  background: var(--line);
  border-radius: var(--radius-pill);
}
.playlist::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: var(--radius-pill);
}
.playlist li { margin: 0; padding: 0; border: 0; }
.playlist-item {
  width: 100%;
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto 1.6rem;
  gap: .7rem;
  align-items: center;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: inherit;
  font: inherit;
  padding: .5rem .35rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  min-width: 0;
}
.playlist-item:hover { background: var(--tint); }
.playlist-item.current {
  background: var(--accent-soft);
  color: var(--fg);
}
.playlist-item .q-art {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 700;
  font-size: .95rem;
  color: var(--tint-strong);
}
.playlist-item .q-art::before { content: attr(data-letter); }
.playlist-item .q-art:has(img)::before { display: none; }
.playlist-item .q-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.playlist-item .q-body { min-width: 0; }
.playlist-item .pos {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
  text-align: right;
}
.playlist-item.current .pos { color: var(--accent); }
.playlist-item strong {
  display: block;
  overflow: hidden;
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.playlist-item .meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  overflow: hidden;
  color: var(--muted);
  font-size: .78rem;
  margin-top: .12rem;
  white-space: nowrap;
}
.playlist-item .q-why {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: normal;
  font-size: .68rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: .05rem .45rem;
  color: var(--accent2);
}
.playlist-item .dur {
  color: var(--muted);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}
.track-row .row-actions {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.why { display: block; color: var(--muted); font-size: .78rem; margin-top: .15rem; }
.tag {
  display: inline-block;
  margin-left: .3rem;
  font-size: .65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: .05rem .45rem;
  color: var(--accent);
  vertical-align: middle;
}
.now-kicker .tag { margin-left: 0; }

.track-list { list-style: none; padding: 0; margin: 0; }
.track-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .55rem;
  align-items: center;
  padding: .65rem .15rem;
  border-bottom: 1px solid color-mix(in srgb, var(--bg) 75%, transparent);
}
@media (max-width: 720px) {
  .track-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .track-row .dur { display: none; }
  .track-row .row-actions { grid-column: 1 / -1; }
}
.track-row button.linkish {
  min-width: 0;
  overflow: hidden;
  background: none;
  border: 0;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.track-row button.linkish:hover { color: var(--accent); }
.track-row .dur { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.track-row .tiny {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: .25rem .55rem;
  font-size: .72rem;
  cursor: pointer;
}
.track-row .tiny:hover { color: var(--accent); border-color: var(--accent); }

.mini-player {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(740px, calc(100% - 1.4rem));
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .65rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  z-index: 30;
  animation: rise .3s ease both;
}
.mini-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .7rem;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
  padding: 0;
}
.mini-art {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 42%, var(--bg)), var(--bg));
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.mini-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.mini-art.has-art img { display: block; }
.mini-text { min-width: 0; display: flex; flex-direction: column; }
.mini-text strong, .mini-text span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-text span { color: var(--muted); font-size: .8rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(5.75rem + env(safe-area-inset-bottom));
  max-width: calc(100% - 2rem);
  transform: translateX(-50%) translateY(8px);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--fg);
  padding: .7rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: .88rem;
  font-weight: 600;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.skeleton {
  background: linear-gradient(90deg, var(--bg2), var(--line), var(--bg2));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: var(--radius);
  min-height: 188px;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

.share-list {
  list-style: none;
  margin: .9rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.share-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .45rem .6rem;
  padding: .65rem 0;
  border-top: 1px solid var(--line);
}
.share-item.revoked { opacity: .55; }
.share-main {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.share-main a {
  color: var(--accent);
  word-break: break-all;
  font-size: .88rem;
}
.share-empty { color: var(--muted); font-size: .9rem; }
#share-url-line a {
  color: var(--accent);
  word-break: break-all;
  font-size: .85rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-size: var(--bg-size, auto);
}
.login-gate[hidden] { display: none; }
.login-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: .85rem;
  animation: rise .5s ease both;
  padding: clamp(1.2rem, 5vw, 2rem);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--topbar);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.login-card .brand { font-size: clamp(2.8rem, 10vw, 3.8rem); }
.login-card input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 72%, black);
  color: var(--fg);
  font: inherit;
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
}
.login-card input:focus {
  outline: 2px solid var(--accent-line);
  outline-offset: 2px;
}
.login-error {
  margin: 0;
  color: var(--danger);
  font-size: .9rem;
}
body.locked .shell,
body.locked .mini-player { visibility: hidden; pointer-events: none; }

@media (max-width: 760px) {
  body { background-attachment: scroll; }
  .shell {
    padding-inline: 1rem;
    padding-top: max(.6rem, env(safe-area-inset-top));
  }
  .top {
    top: max(.35rem, env(safe-area-inset-top));
    gap: .55rem;
    padding: .55rem;
    border-radius: var(--radius);
  }
  .brand-block { padding-left: .35rem; }
  .brand { font-size: 1.45rem; }
  .tagline { display: none; }
  .tabs { margin-left: auto; }
  .tab {
    min-height: 40px;
    padding: .45rem .72rem;
    font-size: .82rem;
  }
  .logout-tab { display: none; }
  .home-intro {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1.25rem;
    min-height: 0;
    padding: 1.35rem 1.15rem;
    border-radius: var(--radius);
  }
  .home-actions { justify-content: flex-start; }
  .home-actions .btn { min-height: 42px; }
  .home-actions .primary { flex: 1 1 100%; }
  .upload-grid { grid-template-columns: 1fr; }
  .shelf-head { align-items: center; }
  .shelf-hint {
    max-width: 48%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: right;
  }
  .now-stage { grid-template-columns: 1fr; }
  .now-art {
    min-height: 0;
    aspect-ratio: 1;
  }
  .hint-keys { display: none; }
  .tip { flex-direction: column; align-items: stretch; }
  .seg {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .seg-btn { flex: 1 0 auto; }
  .track-row .row-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: .2rem;
    scrollbar-width: none;
  }
  .track-row .tiny { flex: 0 0 auto; min-height: 34px; }
  .mini-player { width: calc(100% - 1rem); }
  .toast { border-radius: var(--radius-sm); }
}

@media (max-width: 420px) {
  .top { align-items: stretch; flex-direction: column; }
  .brand-block { display: none; }
  .tabs { width: 100%; margin: 0; }
  .tab { flex: 1 0 auto; text-align: center; }
  .home-copy h1 { font-size: 2.2rem; }
  .home-actions .btn:not(.primary) { flex: 1 1 calc(50% - .3rem); }
  .transport-btns { gap: .35rem; }
  .volume-row { margin-left: .4rem; }
  .icon-btn { width: 2.55rem; height: 2.55rem; }
  .icon-btn.play-btn { width: 3.2rem; height: 3.2rem; }
  .mini-art { width: 42px; height: 42px; }
  .mini-player .icon-btn.sm { width: 2.2rem; height: 2.2rem; }
  .mini-volume { flex-basis: 3.4rem; min-width: 2.8rem; }
}

@media (min-width: 2100px) {
  body {
    background:
      radial-gradient(1200px 900px at -10% 12%, rgba(112,52,25,.58) 0%, transparent 66%),
      radial-gradient(1100px 840px at 110% 8%, rgba(25,72,60,.52) 0%, transparent 64%),
      radial-gradient(980px 860px at -14% 82%, rgba(90,41,22,.22) 0%, transparent 70%),
      radial-gradient(940px 820px at 114% 84%, rgba(22,65,54,.2) 0%, transparent 70%),
      linear-gradient(168deg, var(--bg-elev) 0%, var(--bg) 58%);
    background-attachment: fixed;
  }
  .shell {
    max-width: 1680px;
    padding-inline: 2rem;
  }
  .top {
    padding: .85rem 1rem .85rem 1.2rem;
    margin-bottom: 1.7rem;
  }
  .brand { font-size: 2rem; }
  .tagline { font-size: .78rem; }
  .tab { padding: .6rem 1.05rem; }
  .home-intro {
    min-height: 250px;
    padding: 2.5rem 2.75rem;
  }
  .home-copy h1 { max-width: 900px; font-size: 4.4rem; }
  .home-copy p { max-width: 760px; font-size: 1.08rem; }
  .shelf { margin-block: 3.5rem; }
  .shelf-head h2 { font-size: 1.65rem; }
  .shelf-row > * {
    flex-basis: 210px;
    width: 210px;
    max-width: 210px;
  }
  .mix-card { min-height: 224px; padding: 1.15rem; }
  .entity-card { min-height: 228px; }
  .entity-card.track-card { min-height: 190px; }
  .now-stage { grid-template-columns: 390px minmax(0, 1fr); }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .mini-player { width: min(900px, calc(100% - 2rem)); }
}

.pl-create-row {
  display: flex;
  gap: .55rem;
}
.pl-create-row input {
  flex: 1;
  min-width: 0;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font: inherit;
}
.pl-quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin-top: .85rem;
}
.pl-quick-card {
  text-align: left;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 40%, transparent);
  color: inherit;
  font: inherit;
  border-radius: var(--radius);
  padding: .75rem .85rem;
  cursor: pointer;
}
.pl-quick-card strong { display: block; }
.pl-quick-card span { color: var(--muted); font-size: .78rem; }
.pl-quick-card:hover { border-color: var(--accent); }
.pl-section-title {
  margin: 1.4rem 0 .35rem;
  font-size: 1.15rem;
}
.pl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}
.pl-card {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: inherit;
  font: inherit;
  border-radius: var(--radius);
  padding: 1rem 1rem 3.1rem;
  min-height: 118px;
  cursor: pointer;
}
.pl-card:hover { border-color: var(--accent-line); }
.pl-card strong { display: block; font-size: 1.05rem; }
.pl-card .pl-meta { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.pl-card-actions {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.pl-card-actions .tiny {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: .25rem .6rem;
  font: inherit;
  font-size: .75rem;
  cursor: pointer;
}
.pl-card-actions .tiny:hover {
  border-color: var(--danger);
  color: var(--fg);
}
.pl-card-play {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--radius-pill);
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  cursor: pointer;
}
.pl-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
}
.pl-add {
  position: relative;
  margin: .85rem 0 1rem;
}
.pl-add input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  font: inherit;
}
.pl-add-hits {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow: auto;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.pl-add-hits button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: inherit;
  font: inherit;
  padding: .55rem .8rem;
  cursor: pointer;
}
.pl-add-hits button:hover { background: var(--accent-soft); }
.pl-track {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto auto;
  gap: .55rem;
  align-items: center;
  padding: .45rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.pl-track button.linkish { border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pl-track button.linkish:hover { color: var(--accent); }
.pl-track .tiny {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-pill);
  padding: .2rem .55rem;
  font: inherit;
  font-size: .75rem;
  cursor: pointer;
}
.pl-track .tiny:hover {
  border-color: var(--danger);
  color: var(--fg);
}
.pl-picker {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: var(--overlay);
}
.pl-picker[hidden] { display: none; }
.pl-picker-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}
.pl-picker-list { display: grid; gap: .4rem; max-height: 40vh; overflow: auto; }
.pl-picker-list button {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: inherit;
  font: inherit;
  border-radius: var(--radius-sm);
  padding: .65rem .8rem;
  cursor: pointer;
}
.pl-picker-list button:hover { border-color: var(--accent); }
@media (max-width: 720px) {
  .pl-quick { grid-template-columns: 1fr; }
  .pl-create-row { flex-direction: column; }
  .lib-tools { flex-direction: column; }
  .lib-tools select { min-width: 0; width: 100%; }
}

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

.theme-panel .sub { margin: .35rem 0 .85rem; }
.theme-list {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
}
.theme-card-row {
  display: flex;
  align-items: stretch;
  gap: .35rem;
  flex: 1 1 11rem;
  max-width: 16rem;
}
.theme-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  padding: .75rem .8rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.theme-card.active {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-card strong { font-size: .95rem; }
.theme-card span { color: var(--muted); font-size: .75rem; }
.theme-swatches {
  display: flex;
  width: 100%;
  height: .55rem;
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.theme-swatches i { flex: 1; }
.theme-delete {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 0 .6rem;
  font: inherit;
  cursor: pointer;
}
.theme-delete:hover { color: var(--danger); border-color: var(--danger); }
.theme-form {
  display: grid;
  gap: .75rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line-soft);
}
.theme-form label {
  display: grid;
  gap: .3rem;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
}
.theme-colors { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.theme-colors label { justify-items: start; }
.theme-form input[type="text"],
.theme-form select {
  color-scheme: inherit;
  width: min(320px, 100%);
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--fg);
  border-radius: var(--radius-sm);
  padding: .55rem .75rem;
  font: inherit;
  font-weight: 500;
}
.theme-form input[type="color"] {
  width: 2.7rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}
.theme-form input[type="range"] {
  width: min(280px, 100%);
  accent-color: var(--accent);
}
.theme-form-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
html.theme-light .lib-tools select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23100c0a' d='M1 1.2h10L6 6.8z'/%3E%3C/svg%3E");
}
