﻿/* ---------- Rows ---------- */

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 16px;
  border-radius: 10px;
  position: relative;
}
.row .cover {
  width: 48px; height: 48px;
  border-radius: 6px;
  flex-shrink: 0;
  object-fit: cover;
  background-color: var(--elevated);
}
/* Cover loading state: a soft shimmer sweeps the tile until pixels paint.
   The inline onload/onerror in coverHtml/collageHtml adds .ok to STOP the
   infinite animation (onerror also swaps in a static genre gradient) - loaded
   covers must not keep animating underneath. */
@keyframes covershimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
img.cover, .collage img, img.mini-cover, .qitem img {
  background-image: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.06) 50%, transparent 65%);
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: covershimmer 1.6s linear infinite;
}
img.cover.ok, .collage img.ok, img.mini-cover.ok, .qitem img.ok {
  animation: none;
  background-image: none;
}
@media (prefers-reduced-motion: reduce) {
  img.cover, .collage img, img.mini-cover, .qitem img { animation: none; }
}
.row .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row .title { font-size: 13.5px; font-weight: 500; letter-spacing: 0.2px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.row .sub .subeq { width: 12px; height: 12px; flex-shrink: 0; color: var(--text-2); }
.row .actions .iconbtn { width: 34px; height: 34px; }
.row .actions .iconbtn svg { width: 17px; height: 17px; }
.row .actions { display: flex; align-items: center; gap: 0; flex-shrink: 0; transition: opacity 0.18s ease; }
/* Springy press feedback on row action buttons (menu/grip); the heart keeps
   its own svg-level press + pop animations. */
.row .actions .iconbtn { transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1); }
.row .actions .iconbtn:not(.heartbtn):active { transform: scale(0.82); }
/* Run cards share the row anatomy (runcards.js mirrors it on purpose, so a
 * track finishing is a small visual step instead of a layout swap). */
.runcard .meta, .failcard .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.runcard .title, .failcard .title { font-size: 13.5px; font-weight: 500; letter-spacing: 0.2px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runcard .sub, .failcard .sub { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Now playing: a white edge bar on the left (mock) instead of a cover ring */
.row.playing::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 58%;
  border-radius: 0 2px 2px 0;
  background: #fff;
  animation: playbar 0.34s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
/* The bar grows out from the row's vertical center when a track starts */
@keyframes playbar {
  from { transform: translateY(-50%) scaleY(0.05); opacity: 0; }
  to { transform: translateY(-50%) scaleY(1); opacity: 1; }
}

/* Song done, art still generating (persisted cover watch): pure black disc
   with a mini equalizer + slow sheen sweep until the real art lands via
   song-updated. */
.cover.artpending {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  background: #000;
  overflow: hidden;
}
.cover.artpending::before {
  content: "";
  position: absolute;
  top: -30%; bottom: -30%;
  left: -70%;
  width: 50%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  transform: skewX(-14deg);
  animation: coversheen 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes coversheen {
  0% { left: -70%; }
  60%, 100% { left: 140%; }
}
.cover.artpending .arteq {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 13px;
}
.cover.artpending .arteq i {
  width: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.85);
  height: 35%;
  animation: arteq 1.3s ease-in-out infinite;
}
.cover.artpending .arteq i:nth-child(2) { animation-delay: -0.35s; }
.cover.artpending .arteq i:nth-child(3) { animation-delay: -0.7s; }
@keyframes arteq {
  0%, 100% { height: 35%; opacity: 0.6; }
  50% { height: 100%; opacity: 1; }
}
.cover.artpending .artcap {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-2);
}

/* Playlist reorder (playlist page only): drag grip + dragged row elevation. */
.rowhandle { color: var(--text-2); opacity: 0.75; }
.rowhandle svg { width: 18px; height: 18px; }
.row.dragging { z-index: 5; background: var(--surface); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }

.iconbtn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
}
.iconbtn svg { width: 19px; height: 19px; }
.iconbtn.hearted { color: var(--heart); }
.iconbtn.heartbtn, .iconbtn.fp-like { transition: color 0.18s ease; }
.iconbtn.pop, .iconbtn.unpop { position: relative; }
.heartbtn svg { transition: transform 0.15s ease; }
.heartbtn:active svg { transform: scale(0.8); }

/* Like: springy pop + expanding ring + particle burst (transform/opacity only). */
.iconbtn.pop svg { animation: heartpop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes heartpop {
  0% { transform: scale(0) rotate(-12deg); }
  38% { transform: scale(1.32) rotate(3deg); }
  62% { transform: scale(0.88) rotate(-2deg); }
  82% { transform: scale(1.08); }
  100% { transform: scale(1) rotate(0deg); }
}
.iconbtn.pop::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 2px solid var(--heart);
  pointer-events: none;
  opacity: 0;
  animation: heartring 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes heartring {
  0% { transform: scale(0.25); opacity: 0.85; }
  100% { transform: scale(1.1); opacity: 0; }
}
.iconbtn.pop::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  pointer-events: none;
  animation: heartburst 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes heartburst {
  0% {
    box-shadow:
      0 0 0 0 var(--heart),
      0 0 0 0 rgba(255, 255, 255, 0.7),
      0 0 0 0 var(--heart),
      0 0 0 0 rgba(255, 255, 255, 0.7),
      0 0 0 0 var(--heart),
      0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  100% {
    box-shadow:
      27px -19px 0 -2px transparent,
      -27px -19px 0 -2px transparent,
      23px 17px 0 -2px transparent,
      -23px 17px 0 -2px transparent,
      0 -31px 0 -1px transparent,
      0 29px 0 -1px transparent;
  }
}
/* Unlike: soft shrink back. */
.iconbtn.unpop svg { animation: heartunpop 0.3s ease-out; }
@keyframes heartunpop {
  0% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
.iconbtn.small svg { width: 17px; height: 17px; }

/* first-seen marker: a white dot on the cover corner that persists until the
 * song is PLAYED (claim in player.js), so it survives re-renders and screens */
.row.fresh::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 55px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2.5px var(--bg);
  pointer-events: none;
  z-index: 1;
  animation: freshdot 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes freshdot {
  from { transform: scale(0); }
}

/* entrance for rows inserted live (song-saved) */
.row.entering { animation: rowenter 0.45s cubic-bezier(0.2, 0.8, 0.3, 1); }
@keyframes rowenter {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

/* ---------- Cards / carousels ---------- */

.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2px 20px 6px;
}
.card {
  scroll-snap-align: start;
  width: 160px;
  flex-shrink: 0;
  text-align: left;
}
.card .cover {
  width: 160px; height: 160px;
  border-radius: 20px;
  object-fit: cover;
  background-color: var(--elevated);
  display: block;
}
.card .title { margin-top: 10px; font-size: 14.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { font-size: 11.5px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Section header: big bold title, optional sub, optional "SEE ALL ›" action */
.sectiontitle {
  display: flex;
  align-items: center;
  padding: 10px 20px 6px;
}
.sectiontitle .shm { flex: 1; min-width: 0; }
.sectiontitle .t { font-size: 20px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--text); }
.sectiontitle .s { font-size: 12px; color: var(--text-2); margin-top: 2px; }
/* Compact variant: quiet list headers (Discover) - tight label + inline-ish
   count instead of the big display heading. */
.sectiontitle.compact { padding: 14px 20px 2px; }
.sectiontitle.compact .t { font-size: 12.5px; font-weight: 700; letter-spacing: 2px; color: var(--text-2); }
.sectiontitle.compact .s { font-size: 11px; color: var(--muted); margin-top: 1px; }
.sectiontitle .seeall {
  display: flex;
  align-items: center;
  gap: 1px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-2);
  flex-shrink: 0;
}
.sectiontitle .seeall svg { width: 14px; height: 14px; }
.sectiontitle .seeall:active { color: var(--text); }
/* Selection-mode header (profile): count crossfades over the title, close
   icon over the checkbox - both stay in the DOM, the .selecting class on the
   sectiontitle slides/fades one out and the other in. */
.sectiontitle .selhead { display: grid; align-items: center; }
.sectiontitle .selhead > * { grid-area: 1 / 1; min-width: 0; }
.sectiontitle .selhead .t { transition: opacity 0.2s ease, transform 0.2s ease; }
.sectiontitle .selhead .selcount {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.sectiontitle.selecting .selhead .t { opacity: 0; transform: translateX(8px); }
.sectiontitle.selecting .selhead .selcount { opacity: 1; transform: none; }
/* Selection-mode toggle: checkbox icon (Tabler outline). Muted like the
   settings gear while idle; white once selection mode is on (the X). Both
   glyphs are stacked and crossfade - the icon morphs instead of swapping. */
.sectiontitle .seliconbtn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: none;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.15s ease, color 0.2s ease;
}
.sectiontitle .seliconbtn svg { width: 20px; height: 20px; }
.sectiontitle .seliconbtn .ic {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.sectiontitle .seliconbtn .ic-close { opacity: 0; transform: scale(0.4) rotate(-45deg); }
.sectiontitle .seliconbtn.active { color: #fff; }
.sectiontitle .seliconbtn.active .ic-check { opacity: 0; transform: scale(0.4) rotate(45deg); }
.sectiontitle .seliconbtn.active .ic-close { opacity: 1; transform: none; }
.sectiontitle .seliconbtn:active { transform: scale(0.9); }

/* Multi-select (profile Songs/Liked pages): rows show a check mark instead of
   their actions, the checked ones light up, and a solid bottom bar (pinned
   above the nav) carries the bulk actions. */
.row.selecting { cursor: pointer; }
/* Actions melt away (staggered with the row's check circle via --i) instead of
   display:none - visibility flips after the fade so they slide back in on exit. */
.row.selecting .actions {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease calc(min(var(--i, 0), 12) * 24ms),
              visibility 0s linear calc(min(var(--i, 0), 12) * 24ms + 0.18s);
}
.row.selecting::after { display: none; } /* hide the fresh-song dot - it overlaps the cover next to the check */
.selmark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.selmark svg { width: 12px; height: 12px; }
.row.sel-on .selmark {
  border-color: #fff;
  background: #fff;
  color: #0b0b0f;
}
.selbar {
  position: sticky;
  /* Pane-relative: the pane already ends at --nav-h, so hugging its bottom
     edge puts the bar flush above the nav (mini-open rides above the card,
     same clearance body.mini-open .pane reserves for it). */
  bottom: var(--safe-bottom);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #101013;
  border-top: 1px solid var(--border);
}
.selbar .selcancel {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
}
.selbar .selcancel svg { width: 15px; height: 15px; }
.selbar .selacts { display: flex; align-items: stretch; flex: 1; gap: 6px; }
/* Transport-style, matching the mini player's control row right below it:
   even thirds, centered icon + label, quiet ghost buttons with press glow. */
.selbar .selacts button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  padding: 10px 0;
  border-radius: 12px;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.selbar .selacts button:active { background: rgba(255, 255, 255, 0.07); }
.selbar .selacts button:disabled { opacity: 0.4; }
.selbar .selacts button.danger { color: var(--danger); }
.selbar .selacts button svg { width: 18px; height: 18px; flex-shrink: 0; }
/* Chrome pins sticky to the pane's CONTENT edge, and body.mini-open .pane
   reserves 76px + safe of mini clearance via padding-bottom - which lifts
   that edge above the card. Drop by (76 - 62 mini height) so the bar's
   bottom border lands exactly on the mini player's top edge. */
body.mini-open .selbar { bottom: -14px; }
/* Selection-mode entrance/exit: the bar slides up from behind the nav and back
   down, check circles pop in with a per-row stagger (--i set by markPage,
   capped at 12 beats) and shrink back out on exit. Transform/opacity ONLY -
   animating width/margin here re-laid-out every row every frame on the phone
   (visible stutter) and squished the circle into a blob mid-animation. The
   mark's space is reserved in one reflow at insert; the pop rides the
   compositor. Header crossfades via transitions above. */
@keyframes selbar-in {
  from { transform: translateY(110%); opacity: 0; }
}
.selbar { animation: selbar-in 0.34s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
@keyframes selbar-out {
  to { transform: translateY(110%); opacity: 0; }
}
.selbar.leaving {
  animation: selbar-out 0.24s cubic-bezier(0.5, 0, 0.8, 0.4) both;
  pointer-events: none;
}
@keyframes selmark-in {
  from { transform: scale(0.4); opacity: 0; }
}
.row.selecting .selmark {
  animation: selmark-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(min(var(--i, 0), 12) * 24ms);
}
@keyframes selmark-out {
  to { transform: scale(0.4); opacity: 0; }
}
/* Declared AFTER the in-rule (same specificity) so it wins while the row is
   still .selecting during the exit window. */
.row .selmark.out { animation: selmark-out 0.18s ease both; }
@media (prefers-reduced-motion: reduce) {
  .selbar,
  .selbar.leaving,
  .row.selecting .selmark,
  .row .selmark.out { animation: none; }
  .row.selecting .actions,
  .sectiontitle .selhead .t,
  .sectiontitle .selhead .selcount,
  .sectiontitle .seliconbtn .ic { transition: none; }
}
/* ---------- Chips ---------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 20px 6px;
}
.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 50px;
  background: var(--elevated);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.chip.on {
  background: #fff;
  border-color: #fff;
  color: #000;
}

/* ---------- Headers ---------- */

.screenheader {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 12px 4px 20px;
}
.screenheader h1 { font-size: 20px; font-weight: 700; flex: 1; }
/* Structural pushed-page titles (Settings, Followers, Liked...) adopt the
   tracked-uppercase header language; profile/playlist NAMES stay sentence
   case (they are user content). */
.screenheader h1.up {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.screenheader .iconbtn { width: 40px; height: 40px; }
.screenheader .iconbtn svg { width: 21px; height: 21px; }

.backbtn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
}
.backbtn svg { width: 22px; height: 22px; }

/* ---------- Underline tab strip (Profile / Library / Create / Cover sheet) ---------- */

.tabbar {
  position: relative; /* hosts the sliding .tabind */
  display: flex;
  margin-top: 18px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tabbar button {
  flex: 1;
  padding: 15px 0 13px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}
.tabbar button.on { color: var(--text); }
/* ONE sliding underline for the whole strip (replaces the old per-button
   ::after that popped in/out): a cell-wide ghost that translates between
   equal-width cells; the visible white bar rides centered inside it and
   RUBBER-BANDS - --stretch (registered so it can transition) widens the bar
   while it travels and eases back with a slight wobble on arrival. */
@property --stretch {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
.tabbar .tabind {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  pointer-events: none;
  transition:
    transform 0.32s cubic-bezier(0.3, 1.25, 0.4, 1),
    --stretch 0.34s cubic-bezier(0.3, 1.35, 0.45, 1);
  will-change: transform;
}
.tabbar .tabind::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(27% - var(--stretch, 0) * 19%);
  right: calc(27% - var(--stretch, 0) * 19%);
  border-radius: 1px 1px 0 0;
  background: #fff;
}
.tabbar .tabind.notrans { transition: none; }
/* Tap-slide pulse: the bar widens mid-travel and wobbles back (drag settles
   instead contract live via --stretch, no keyframes). */
.tabbar .tabind.pulse::before { animation: tabpulse 0.36s cubic-bezier(0.3, 0.9, 0.35, 1); }
@keyframes tabpulse {
  0% { left: 27%; right: 27%; }
  38% { left: 8%; right: 8%; }
  70% { left: 31%; right: 31%; }
  100% { left: 27%; right: 27%; }
}

/* ---------- Inline stat line (profile hero) ---------- */

.statline {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
}
.statline button {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}
.statline button b { color: var(--text-2); font-weight: 600; }
.statline button:active { color: var(--text); }

/* ---------- Buttons ---------- */

.solidbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: #000;
  font-weight: 700;
  font-size: 14px;
  border-radius: 50px;
  padding: 13px 26px;
}
/* svg() emits a bare viewBox with no intrinsic size - inside a flexed/full
   width solid button an unsized SVG balloons to fill it (giant-icon bug). */
.solidbtn svg { width: 16px; height: 16px; flex-shrink: 0; }
.solidbtn.full { width: 100%; }
.solidbtn:disabled { opacity: 0.55; }

.ghostbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  border-radius: 50px;
  padding: 12px 22px;
  background: var(--surface);
}

/* Follow CTA: solid white pill when following is offered, quiet outlined pill
   with a drawn-in checkmark once followed. One-shot animations only. */
.followbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  color: #000;
  background: #fff;
  box-shadow: none;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease,
    color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.followbtn:active { transform: scale(0.93); }
.followbtn.on {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text);
  box-shadow: none;
}
.followbtn.busy { opacity: 0.55; pointer-events: none; }
.followbtn.pop { animation: followpop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes followpop {
  0% { transform: scale(0.88); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.followbtn .fchecksvg { width: 14px; height: 14px; flex-shrink: 0; }
.followbtn .fcheck { stroke-dasharray: 22; animation: checkdraw 0.28s ease 0.06s both; }
@keyframes checkdraw {
  from { stroke-dashoffset: 22; }
  to { stroke-dashoffset: 0; }
}

.dangerbtn {
  color: var(--danger);
  font-weight: 700;
  padding: 12px;
  width: 100%;
  text-align: center;
  font-size: 14px;
}

/* ---------- Sheets / dialogs / toasts ---------- */

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 55;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.scrim.open { opacity: 1; }

.bubblesheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  /* Same sheet tone family as the prompt/draft builders (#101013 + hairline
     top edge) - one bottom-sheet language across the whole app. */
  background: #101013;
  border-top: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  padding: 8px 10px calc(18px + var(--safe-bottom));
  z-index: 56;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.16, 0.84, 0.3, 1);
  max-height: 76vh;
  overflow-y: auto;
  overscroll-behavior-y: none; /* clamp hard at edges: no pull-to-refresh, no scroll chaining */
}
.bubblesheet.open { transform: translateY(0); }
/* Items rise in with a slight stagger and a barely-there settle - alive but
   calm (the previous spring was far too bouncy). */
@media (prefers-reduced-motion: no-preference) {
  .bubblesheet .bsitem {
    animation: bsitem-in 0.3s cubic-bezier(0.25, 1.08, 0.4, 1) both;
    animation-delay: calc(var(--i, 0) * 24ms);
  }
}
@keyframes bsitem-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.bubblesheet .grab { width: 36px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); margin: 4px auto 10px; }
.bubblesheet .bstitle {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 4px 14px 8px;
}
.bubblesheet .bsitem {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.bubblesheet .bsitem svg { width: 19px; height: 19px; color: var(--text-2); flex-shrink: 0; }
.bubblesheet .bsitem.danger, .bubblesheet .bsitem.danger svg { color: var(--danger); }
.bubblesheet .bsitem:active { background: rgba(255, 255, 255, 0.06); }

/* ---------- First-run onboarding (3 full-bleed photo slides, once/device) ---------- */

.obhost {
  position: absolute;
  inset: 0;
  z-index: 58;
  background: #000;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: 0 0 calc(24px + var(--safe-bottom));
}
.obhost.open { opacity: 1; }
.obskip {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  right: 18px;
  z-index: 3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 10px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.obskip:active { color: #fff; }
.obviewport { flex: 1; overflow: hidden; touch-action: pan-y; position: relative; }
.obtrack { display: flex; height: 100%; will-change: transform; }
.obpage {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 22px 26px;
}
.obimg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.obhost.open .obimg { opacity: 1; }
.obshade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.06) 34%, rgba(0, 0, 0, 0.85) 84%);
}
.obcopy {
  position: relative;
  z-index: 1;
  padding: 0 2px;
}
/* Quiz option cards: flat black grid, white border on the picked answer. */
.oboptions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}
.obopt {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 13px;
  padding: 15px 10px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #fff;
  text-align: center;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.obopt.on { border-color: #fff; background: rgba(255, 255, 255, 0.16); }
.obopt:active { background: rgba(255, 255, 255, 0.2); }
/* The composed first prompt, previewed on the final quiz screen. */
.obprompt {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  padding: 12px 14px;
  margin-top: 4px;
}
.obpromptq {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.obpromptq svg { width: 15px; height: 15px; }
.obpromptt { font-size: 13.5px; font-weight: 600; color: #fff; line-height: 1.35; }
.obkicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
}
.obtitle {
  font-size: 31px;
  font-weight: 800;
  line-height: 1.08;
  color: #fff;
  margin: 9px 0 10px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
.obtext {
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
  max-width: 330px;
}
.obdots {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 18px 0 16px;
}
.obdots i {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.2s ease, width 0.2s ease;
}
.obdots i.on { background: #fff; width: 22px; }
.obnext {
  margin: 0 28px;
  height: 54px;
  border-radius: 27px;
  background: #fff;
  color: #000;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.obnext:active { opacity: 0.75; }

/* ---------- Song menu: context header + grouped 2-col grid ---------- */
.bubblesheet.songmenu { padding-left: 0; padding-right: 0; }
/* No per-item stagger here: items animating while the sheet itself slides
   up read as content falling behind the rising edge (and cost frames on
   low-end WebViews) - the menu slides as ONE panel. */
.songmenu .smhead { display: flex; align-items: center; gap: 14px; padding: 6px 20px 16px; }
.songmenu .smcover { width: 78px; height: 78px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.songmenu .smcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.songmenu .smmeta { flex: 1; min-width: 0; }
.songmenu .smt { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.songmenu .smartist { font-size: 13px; color: var(--text-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.songmenu .smmeta2 { font-size: 12px; color: var(--muted); margin-top: 3px; }
.songmenu .smheart {
  border: 0; background: none; color: var(--text-2);
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.songmenu .smheart svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: color 0.15s ease, fill 0.15s ease; }
.songmenu .smheart.on { color: var(--heart); }
.songmenu .smheart.on svg { fill: currentColor; stroke: none; }
.songmenu .smgrid { display: grid; grid-template-columns: 1fr 1fr; padding: 4px 10px; }
.songmenu .smitem {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 10px;
  border: 0; background: none; color: var(--text);
  font-size: 14.5px; font-weight: 500; text-align: left;
  min-width: 0;
}
.songmenu .smitem .smic { flex-shrink: 0; display: flex; color: var(--text); }
.songmenu .smitem svg { width: 22px; height: 22px; }
.songmenu .smitem:active { opacity: 0.6; }
.songmenu .smdiv { height: 1px; background: rgba(255, 255, 255, 0.07); margin: 8px 20px; }
.songmenu .smsrow {
  display: flex; align-items: center; gap: 13px;
  width: 100%; padding: 14px 30px;
  border: 0; background: none; color: var(--text);
  font-size: 14.5px; font-weight: 500; text-align: left;
}
.songmenu .smsrow .smic { flex-shrink: 0; display: flex; }
.songmenu .smsrow svg { width: 22px; height: 22px; }
.songmenu .smsrow:active { opacity: 0.6; }
.songmenu .smsrow.danger { color: var(--danger); }

/* ---------- Edit profile sheet ---------- */
.editsheet .edhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 14px 6px;
}
.editsheet .edhead .bstitle { padding: 0; }
.editsheet .eddone {
  background: #fff;
  color: #000;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 20px;
}
.editsheet .eddone:disabled { opacity: 0.55; }
.editsheet .edavatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 14px 10px;
}
.editsheet .edpick { position: relative; border-radius: 50%; padding: 0; line-height: 0; }
.editsheet .edpick.busy .avatar { opacity: 0.45; }
.editsheet .edspin {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.editsheet .edspin::after {
  content: "";
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: edspin 0.7s linear infinite;
}
@keyframes edspin { to { transform: rotate(360deg); } }
.editsheet .edavatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.editsheet .edremove { font-size: 12.5px; color: var(--danger); font-weight: 600; padding: 6px 0; }
.editsheet .edremove.hidden { display: none; }
.editsheet .edfield { padding: 6px 14px; }
/* The bio textarea is a fixed 3-row field: the UA resize handle would let it
   be dragged out of proportion and wreck the sheet. Content scrolls instead. */
.editsheet textarea { resize: none; }
.editsheet .edfield label { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1.6px; margin-bottom: 6px; }
.editsheet .ferr { color: var(--danger); font-size: 12px; min-height: 15px; padding: 2px 2px 0; }
.editsheet .fcount { text-align: right; font-size: 11px; color: var(--muted); padding-top: 4px; }
.editsheet .switchrow { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 4px; }
.editsheet .switchrow span { font-size: 13px; }

.dialogscrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 58;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.dialogscrim.open { opacity: 1; }
.dialog {
  width: 100%;
  max-width: 320px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 18px 0;
  overflow: hidden; /* the hairline footer runs flush to the card edges */
  transform: scale(0.82) translateY(22px);
  opacity: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  /* exit - quick ease-in (fits the 190ms scrim teardown) */
  transition: transform 0.18s cubic-bezier(0.4, 0, 1, 1), opacity 0.15s ease, box-shadow 0.18s ease;
}
.dialogscrim.open .dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  /* entry - rises into place with a springy overshoot */
  transition: transform 0.34s cubic-bezier(0.3, 1.4, 0.5, 1), opacity 0.18s ease-out, box-shadow 0.34s ease;
}
.dialog h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; margin-bottom: 4px; }

/* Minimal alert: compact card, small muted glyph (no badge), hairline
   footer with text-only buttons (Cancel | Confirm) split by a divider -
   iOS-alert anatomy. Danger recolors the glyph + confirm text red. */
.dialog.alert { text-align: center; }
.dialog .dicon {
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px;
  color: var(--text-2);
  animation: diconpop 0.32s cubic-bezier(0.34, 1.2, 0.64, 1) 0.05s both;
}
.dialog .dicon svg { width: 24px; height: 24px; }
.dialog.isdanger .dicon { color: var(--danger); }
@keyframes diconpop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
/* Decorative star row (rating ask): monochrome, staggered pop-in. */
.dialog .dstars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 4px 0 2px;
}
.dialog .dstars svg {
  width: 16px; height: 16px;
  color: #fff;
  animation: dstarin 0.4s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.dialog .dstars svg:nth-child(2) { animation-delay: 0.06s; }
.dialog .dstars svg:nth-child(3) { animation-delay: 0.12s; }
.dialog .dstars svg:nth-child(4) { animation-delay: 0.18s; }
.dialog .dstars svg:nth-child(5) { animation-delay: 0.24s; }
@keyframes dstarin { from { transform: scale(0.4) rotate(-18deg); opacity: 0; } }

/* Read-only info dialog (prompt text) with copy - simple, flat */
.textdlg .dinfo {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 2px 0 10px;
}
.textdlg .dscroll {
  max-height: 48vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre-wrap;
  text-align: left;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  padding: 4px 0 8px;
}
.textdlg .drow svg { width: 16px; height: 16px; }

/* Edit-cover full-screen sheet (Generate with AI / Upload photo) */
.covhead {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 14px 4px 14px;
}
.covhead h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  flex: 1;
}
.covhead .credits {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.covhead .credits {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 6px 12px;
  white-space: nowrap;
}
.covbody { padding: 4px 20px calc(24px + var(--safe-bottom)); }
.covgallery { margin-top: 12px; }
.covgallery .gt { font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1.6px; padding: 8px 2px 4px; }
.covgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 42vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; /* don't chain into the sheet's scroll/swipe */
  padding: 2px;
}
.covgrid .hint { grid-column: 1 / -1; padding: 10px 2px; }
.covgrid button {
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 2px solid transparent;
  padding: 0;
  position: relative;
}
/* Square via padding-top spacer, NOT aspect-ratio - aspect-ratio sizing inside
   this scrolled grid collapsed to overlapping rows in the Android WebView
   (only while the pending tile/anims were present). The spacer cannot break. */
.covgrid button::before { content: ""; display: block; padding-top: 100%; }
.covgrid button img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.covgrid button.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); }
.covgrid button.sel::after {
  content: "";
  position: absolute;
  right: 5px; bottom: 5px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black"><path d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"/></svg>') center/12px no-repeat;
}
.csupload {
  margin-top: 8px;
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  padding: 34px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 13px;
  width: 100%;
}
.csupload svg { width: 28px; height: 28px; color: #fff; }
.csprev { margin-top: 12px; display: flex; justify-content: center; }
.csprev img {
  width: 200px; height: 200px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}
/* Pending 1:1 shimmer tile in the gallery while an image generates.
   Shimmer = compositor transform (translateX), never background-position -
   an animating background inside this scroll container repainted the whole
   scroller every frame and the WebView stacked the grid rows mid-generation. */
.covgrid .covpending {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.covgrid .covpending::before { content: ""; display: block; padding-top: 100%; }
.covgrid .covpending::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, var(--elevated) 50%, transparent 70%);
  animation: covshimmer 1.4s linear infinite;
}
@keyframes covshimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.covpending .cpspin {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: covspin 0.9s linear infinite;
}
@keyframes covspin { to { transform: rotate(360deg); } }
.covgrid button.fresh img { animation: covfade 0.45s ease-out; }
@keyframes covfade { from { opacity: 0; transform: scale(0.9); } }

/* Add-to-playlist CHECKLIST sheet */
.addsheet .addhead { display: flex; align-items: center; gap: 10px; padding: 4px 10px 10px; }
.addsheet .addhead .bstitle { flex: 1; padding: 0; }
.addsheet .adddone {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}
.addsheet .addsong {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.addsheet .addsong .cover { width: 36px; height: 36px; border-radius: 6px; }
.addsheet .addsong .qt { font-size: 12.5px; font-weight: 500; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addsheet .addsong .qs { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.addsheet .addsong .qm { flex: 1; min-width: 0; }
.addsheet .addcreate {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-align: left;
}
.addsheet .addcreate .plus {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.addsheet .addcreate .plus svg { width: 20px; height: 20px; }
.addsheet .addrow { position: relative; width: 100%; text-align: left; }
.addsheet .playlistitem .collage { width: 44px; height: 44px; border-radius: 10px; }
.addsheet .pname { font-size: 14px; font-weight: 700; }
.addsheet .psub { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.addsheet .addbox {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.addsheet .addbox svg { width: 14px; height: 14px; }
.addsheet .addrow.checked .addbox {
  background: #fff;
  border-color: #fff;
  color: #000;
}
/* Bulk pick: SOME of the selected songs are in this playlist - translucent
   white disc (tri-state between empty and the solid checked fill). */
.addsheet .addrow.partial .addbox {
  background: rgba(255, 255, 255, 0.35);
  border-color: #fff;
  color: transparent;
}

/* Report-reason sheet (UGC / AI-content reporting) */
.rptsheet { max-height: 86%; overflow-y: auto; }
.rptsheet .rpthead { display: flex; align-items: center; gap: 10px; padding: 4px 10px 10px; }
.rptsheet .rpthead .bstitle { flex: 1; padding: 0; }
.rptsheet .rptcontext {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.rptsheet .rptcontext .cover { width: 36px; height: 36px; border-radius: 6px; }
.rptsheet .rptcontext .rptav { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.rptsheet .rptcontext .qt { font-size: 12.5px; font-weight: 500; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rptsheet .rptcontext .qs { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.rptsheet .rptcontext .qm { flex: 1; min-width: 0; }
.rptsheet .rpthint { font-size: 11.5px; color: var(--text-2); padding: 2px 8px 8px; line-height: 1.45; }
.rptsheet .rptitem {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 11px 8px;
  border-radius: 12px;
}
.rptsheet .rptitem:active { background: rgba(255, 255, 255, 0.05); }
.rptsheet .rptmeta { flex: 1; min-width: 0; }
.rptsheet .rptlabel { font-size: 14px; font-weight: 600; }
.rptsheet .rptsub { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.rptsheet .rptradio {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-2);
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.rptsheet .rptitem.checked .rptradio {
  border-color: #fff;
  background: #fff;
  box-shadow: inset 0 0 0 4px var(--bg);
}
.rptsheet .rptdetails {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: none;
}
.rptsheet .rptsubmit { margin-top: 10px; }

/* Full-screen lyrics: blurred cover backdrop, centered scrolling lines */
.lyricsview {
  position: absolute;
  inset: 0;
  z-index: 53; /* above .fullplayer (52), same layer as .sheet */
  background: var(--bg);
  padding-top: var(--safe-top);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
  overflow: hidden;
  will-change: transform;
}
.lyricsview.open { transform: translateY(0); }
.lyricsview.closing { transform: translateY(100%); }
.lv-bg {
  position: absolute;
  left: -70px; top: calc(-70px - var(--safe-top));
  width: calc(100% + 140px);
  height: calc(100% + 140px);
  object-fit: cover;
  filter: blur(46px) brightness(0.5) saturate(1.25);
  transform: translateZ(0); /* own composited layer - the blur must not re-rasterize on drag */
  pointer-events: none;
}
.lv-bgph { background: linear-gradient(160deg, #2a2340, #14121c 60%, #1d1830); }
.lv-fg { position: relative; height: 100%; display: flex; flex-direction: column; }
.lv-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 6px; }
.lv-head .iconbtn { color: rgba(255, 255, 255, 0.85); }
.lv-t {
  flex: 1;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.lv-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 26px 30px calc(48px + var(--safe-bottom));
  text-align: center;
}
.lv-line {
  font-size: 17px;
  font-weight: 600;
  line-height: 2.1;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.dialog .dmsg { font-size: 13px; line-height: 1.5; color: var(--text-2); margin-bottom: 10px; }
.dialog .dfield { margin-bottom: 10px; }
.dialog .dfield label { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1.6px; margin-bottom: 5px; }
/* Dialog footer: hairline-split text buttons, full-bleed to the card edges. */
.dialog .drow {
  display: flex;
  margin: 16px -18px 0;
  border-top: 1px solid var(--border);
}
.dialog .drow button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  transition: background 0.12s ease;
}
.dialog .drow button + button { border-left: 1px solid var(--border); }
.dialog .drow button:active { background: rgba(255, 255, 255, 0.05); }
.dialog .drow button.primary { color: #fff; font-weight: 700; }
.dialog.isdanger .drow button.primary { color: var(--danger); }
.dialog .switchrow { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.dialog .switchrow span { font-size: 13px; }

.switch {
  position: relative;
  width: 44px; height: 26px;
  border-radius: 13px;
  background: var(--border);
  transition: background 0.18s ease;
  flex-shrink: 0;
}
.switch.on { background: #fff; }
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}
.switch.on::after { transform: translateX(18px); background: #000; }

#toasts {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + 16px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 70;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: #111;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px 9px 9px;
  border-radius: 50px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  /* fill-mode backwards (NOT both): a finished animation would otherwise keep
     pinning opacity/transform and silently kill the .out exit animation. */
  animation: toastIn 0.32s cubic-bezier(0.34, 1.2, 0.64, 1) backwards;
  max-width: 86vw;
}
.toast:not(.hasicon) { padding: 11px 18px; }
.toast .tmsg { min-width: 0; }
.toast .ticon {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast .ticon svg { width: 14px; height: 14px; }
.toast.good .ticon { background: #0b9e6e; }
.toast.danger .ticon { background: #dc2626; }
.toast.out { animation: toastOut 0.26s ease-in both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(0.95); } }

/* ---------- Skeletons / empty ---------- */

@keyframes shimmer { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }
.skel {
  background: var(--elevated);
  border-radius: 12px;
  animation: shimmer 1.3s ease-in-out infinite;
}
.skelrow { display: flex; gap: 10px; padding: 9px 16px; align-items: center; }
.skelrow .c { width: 48px; height: 48px; border-radius: 6px; flex-shrink: 0; }
.skelrow .l1 { height: 13px; width: 55%; }
.skelrow .l2 { height: 11px; width: 35%; margin-top: 6px; }

.empty {
  padding: 46px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty .eicon {
  width: 64px; height: 64px;
  border-radius: 20px;
  background: var(--elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  margin-bottom: 6px;
}
.empty .eicon svg { width: 30px; height: 30px; }
.empty .et { font-size: 15px; font-weight: 600; }
.empty .es { font-size: 12px; color: var(--text-2); }

.errorbox {
  margin: 40px 24px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
