/* ============================================================
   Music Box — Dark Premium design system
   Tokens → primitives → components → layouts → responsive
   ============================================================ */

:root {
  /* Нависающая сверху часть Telegram (шапка с кнопками, статус-бар в
     fullscreen) — телеграм-клиент отдаёт её высоту в своей переменной,
     env() остаётся фолбэком для нативных вьюпортов. */
  --app-safe-top: max(
    var(--tg-content-safe-area-inset-top, 0px),
    env(safe-area-inset-top, 0px)
  );

  /* Core palette */
  --bg: #080809;
  --bg-elevated: #101012;
  --card: #171719;
  --surface: #202023;
  --surface-pressed: #29292d;
  --text: #f5f5f7;
  --muted: #a0a0a7;
  --muted-2: #73737b;
  --line: #303034;
  --line-soft: rgba(255, 255, 255, 0.06);

  /* Accent (single source of truth) */
  --accent: #a855f7;
  --accent-strong: #c084fc;
  --accent-soft: rgba(168, 85, 247, 0.14);
  --accent-border: rgba(168, 85, 247, 0.32);

  /* Semantic */
  --success: #35c98b;
  --success-soft: rgba(53, 201, 139, 0.13);
  --danger: #ff5d64;
  --danger-soft: rgba(255, 93, 100, 0.13);
  --warning: #f5b84d;

  /* Geometry */
  --radius-xl: 32px;
  --radius-lg: 26px;
  --radius-md: 20px;
  --radius-sm: 16px;
  --radius-xs: 12px;
  --tap: 44px;

  /* Elevation */
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.36);
  --shadow-float: 0 18px 46px rgba(0, 0, 0, 0.48);
  --shadow-modal: 0 32px 90px rgba(0, 0, 0, 0.62);

  /* Typography */
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Unbounded", var(--font-body);
  --app-height: 100dvh;

  /* Backwards-compatible aliases used by older components */
  --bg-soft: var(--bg-elevated);
  --card-strong: var(--surface);
  --green: var(--success);
  --accent-2: var(--accent-strong);
  --accent-3: var(--accent);
  --radius: var(--radius-lg);
  --shadow: var(--shadow-card);

  color-scheme: dark;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}
button:disabled { cursor: not-allowed; opacity: 0.55; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: rgba(168, 85, 247, 0.35); }
:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 10px;
}
input[type="search"]::-webkit-search-cancel-button { display: none; }
html { scrollbar-color: var(--line) transparent; scrollbar-width: thin; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.dock-play .icon-play, .play-main .icon-play { display: block; }
.dock-play .icon-pause, .play-main .icon-pause { display: none; }
body.is-playing .dock-play .icon-play, body.is-playing .play-main .icon-play { display: none; }
body.is-playing .dock-play .icon-pause, body.is-playing .play-main .icon-pause { display: block; }
.rail-art > .playlist-mini { width: 100%; height: 100%; }

/* ---------- atmosphere ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(70% 42% at 50% -8%, rgba(168, 85, 247, 0.13), transparent 70%),
    radial-gradient(50% 34% at 92% 12%, rgba(53, 201, 139, 0.035), transparent 70%),
    var(--bg);
}
.aurora-blob {
  position: absolute;
  width: 42vw;
  height: 42vw;
  min-width: 280px;
  min-height: 280px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.18;
  animation: drift 28s ease-in-out infinite alternate;
}
.aurora-blob.a1 { top: -24vw; left: -16vw; background: var(--accent); }
.aurora-blob.a2 { top: 26vh; right: -32vw; background: #2479a8; opacity: 0.1; animation-delay: -9s; }
.aurora-blob.a3 { bottom: -36vw; left: 24vw; background: #7f2f63; opacity: 0.08; animation-delay: -17s; }
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(5vw, 3vh, 0) scale(1.1); }
}

/* ---------- splash ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: radial-gradient(70% 55% at 50% 40%, #17121f 0%, var(--bg) 72%);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.splash.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  box-shadow: var(--shadow-card);
  animation: breathe 2.6s ease-in-out infinite;
}
.splash-mark .icon { width: 36px; height: 36px; stroke-width: 2; }
.splash-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.splash-name span { color: var(--accent-strong); }
.splash-eq { display: flex; align-items: flex-end; gap: 4px; height: 24px; margin-top: 4px; }
.splash-eq i { width: 4px; border-radius: 4px; background: var(--accent); animation: eq 1s ease-in-out infinite alternate; }
.splash-eq i:nth-child(1) { height: 40%; animation-delay: -0.2s; }
.splash-eq i:nth-child(2) { height: 90%; animation-delay: -0.5s; }
.splash-eq i:nth-child(3) { height: 60%; animation-delay: -0.1s; }
.splash-eq i:nth-child(4) { height: 100%; animation-delay: -0.7s; }
.splash-eq i:nth-child(5) { height: 45%; animation-delay: -0.35s; }
@keyframes breathe { 50% { transform: translateY(-4px); } }
@keyframes eq { to { transform: scaleY(0.35); opacity: 0.55; } }

/* ---------- shell & top bar ---------- */
.shell {
  width: min(100%, 1060px);
  margin: 0 auto;
  padding: calc(32px + 2 * var(--app-safe-top)) clamp(16px, 4vw, 34px)
    calc(196px + env(safe-area-inset-bottom));
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--accent-strong);
  flex: none;
}
.brand-mark .icon { width: 22px; height: 22px; }
.brand-copy { min-width: 0; }
.kicker {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.brand-copy h1 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}
.user-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex: none;
  transition: transform 0.18s ease, background 0.18s ease;
}
.user-chip:active { transform: scale(0.95); background: var(--accent-strong); }
.online-dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg);
}

/* ---------- views & common layout ---------- */
.view { display: none; }
.view.is-active { display: block; animation: fadeUp 0.36s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section { margin-top: 32px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-head h3, .page-head h2 {
  font-family: var(--font-display);
  font-size: clamp(19px, 3.5vw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: var(--tap);
  padding: 6px 0 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.link .icon { width: 15px; height: 15px; }
.link:hover { color: var(--text); }
.page-head { margin: 6px 0 20px; }
.page-head h2 { font-size: clamp(27px, 5.5vw, 38px); }
.page-head > p, .page-head > div > p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 8px;
  max-width: 54ch;
}
.page-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.divider { height: 1px; margin: 20px 0; background: var(--line); border: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 800;
  font-size: 13.5px;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { transform: none; }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-pressed); }
.btn-outline { color: var(--text); background: transparent; border-color: var(--line); }
.btn-outline:hover { background: var(--surface); border-color: var(--muted-2); }
.btn-ghost { color: var(--text); background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 93, 100, 0.28); }
.btn-danger:hover { background: rgba(255, 93, 100, 0.2); }
.btn-sm { min-height: 44px; padding: 0 15px; font-size: 12.5px; border-radius: 14px; }
.btn.full { width: 100%; }
.btn.danger { color: var(--danger); }

/* ---------- cards & primitives ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-compact { padding: 16px; border-radius: var(--radius-md); }
.interactive-card {
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.interactive-card:active { transform: scale(0.99); background: var(--surface-pressed); }
.interactive-card:hover { border-color: var(--muted-2); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-size: 12px; font-weight: 700; color: var(--muted); }
.input, .textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  outline: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); font-weight: 500; }
.input:focus, .textarea:focus { border-color: var(--accent); background: var(--surface-pressed); }
.input:disabled, .textarea:disabled { opacity: 0.6; cursor: not-allowed; }
.field-error { color: var(--danger); font-size: 11.5px; }
.field.is-invalid .input, .field.is-invalid .textarea { border-color: var(--danger); }

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }
.avatar-group { display: flex; align-items: center; }
.avatar-group .avatar { margin-left: -9px; border: 2px solid var(--bg); }
.avatar-group .avatar:first-child { margin-left: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-accent { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent-border); }
.badge-success { color: #8ff0c4; background: var(--success-soft); border-color: rgba(53, 201, 139, 0.28); }
.badge-danger { color: #ffb3b7; background: var(--danger-soft); border-color: rgba(255, 93, 100, 0.28); }
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.status-indicator::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
}
.status-indicator.is-online::before { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.status-indicator.is-busy::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  overflow: hidden;
  padding: clamp(22px, 4.5vw, 38px);
  border-radius: var(--radius-xl);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -40%;
  right: -12%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.18), transparent 68%);
  pointer-events: none;
}
.hero-copy { min-width: 0; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}
.hero-kicker .icon { width: 14px; height: 14px; }
.hero h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5.6vw, 44px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 18px 0 14px;
  max-width: 15em;
}
.grad-text { color: var(--accent-strong); }
.hero > .hero-copy > p { color: var(--muted); max-width: 46ch; font-size: 14px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-art {
  position: relative;
  align-self: center;
  width: clamp(126px, 16vw, 176px);
  aspect-ratio: 1;
  flex: none;
  margin-right: 8px;
}
.hero-vinyl {
  position: absolute;
  inset: 12% -20% 12% 22%;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, #242426 0 2px, #151517 2px 4px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  transform: rotate(8deg);
}
.hero-vinyl::after {
  content: "";
  position: absolute;
  inset: 42%;
  border-radius: 50%;
  background: var(--accent);
}
.hero-cover {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(145deg, #2a2140, #17121f);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-float);
  transform: rotate(-5deg);
}
.hero-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-cover .art-fallback .icon { width: 46px; height: 46px; }
.hero-stats {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: clamp(18px, 5vw, 38px);
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.stat span {
  font-size: 10.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.hero-wave { display: flex; align-items: flex-end; gap: 3px; height: 30px; margin-left: auto; opacity: 0.7; }
.hero-wave i {
  width: 3px;
  height: 35%;
  border-radius: 4px;
  background: var(--accent);
  animation: wave 1.4s ease-in-out infinite alternate;
}
.hero-wave i:nth-child(2) { height: 75%; animation-delay: -0.2s; }
.hero-wave i:nth-child(3) { height: 45%; animation-delay: -0.5s; }
.hero-wave i:nth-child(4) { height: 100%; animation-delay: -0.1s; }
.hero-wave i:nth-child(5) { height: 60%; animation-delay: -0.65s; }
.hero-wave i:nth-child(6) { height: 85%; animation-delay: -0.35s; }
.hero-wave i:nth-child(7) { height: 30%; animation-delay: -0.8s; }
@keyframes wave { to { transform: scaleY(0.35); opacity: 0.5; } }

/* ---------- segmented control & chips ---------- */
.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}
.segmented-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease;
}
.segmented-btn.is-active { color: #fff; background: var(--accent); }
.source-switch { margin: 13px 0 2px; }
.artist-source-switch { margin: 2px 0 16px; }
.source-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease;
}
.source-btn.is-active { color: #fff; background: var(--accent); }
.source-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.source-dot.itunes { background: var(--accent-strong); }
.source-btn.is-active .source-dot { background: #fff; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.16s ease;
}
.chip .icon { width: 16px; height: 16px; color: var(--accent-strong); }
.chip:hover, .chip:active { background: var(--surface); border-color: var(--muted-2); }
.chip:active { transform: scale(0.97); }
.chips.compact { margin: 12px 0 22px; }
.chips.compact .chip { min-height: 44px; padding: 0 12px; font-size: 11.5px; color: var(--muted); background: transparent; }
.chips.compact .chip:hover { color: var(--text); background: var(--card); }

.tip-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
}
.tip-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  flex: none;
}
.tip-card div:last-child { display: flex; flex-direction: column; gap: 2px; }
.tip-card strong { font-size: 13px; }
.tip-card span { color: var(--muted); font-size: 11.5px; }

/* ---------- rails ---------- */
.rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.rail::-webkit-scrollbar { display: none; }
.rail-card { flex: 0 0 clamp(142px, 32vw, 172px); scroll-snap-align: start; text-align: left; }
.rail-art {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-soft);
}
.rail-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.rail-overlay { position: absolute; inset: auto 0 0; height: 55%; background: linear-gradient(to top, rgba(8, 8, 9, 0.72), transparent); }
.rail-play {
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  transition: transform 0.16s ease, background 0.16s ease;
}
.rail-play .icon { width: 17px; height: 17px; margin-left: 2px; }
.rail-card:hover .rail-play { transform: scale(1.06); background: var(--accent-strong); }
.rail-card:hover .rail-art img { transform: scale(1.04); }
.rail-meta { padding: 9px 3px 0; }
.rail-meta strong {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-meta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.rail-placeholder {
  flex: 0 0 clamp(240px, 60vw, 320px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-height: 148px;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
}
.rail-placeholder strong { color: var(--text); font-size: 14px; }
.rail-placeholder .btn { margin-top: 8px; }
.rail-placeholder .icon { color: var(--accent-strong); margin-bottom: 4px; }
.playlist-mini {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  background: var(--surface);
}
.playlist-mini img { width: 100%; height: 100%; object-fit: cover; }
.playlist-mini .mini-empty {
  display: grid;
  place-items: center;
  grid-column: span 2;
  grid-row: span 2;
  background: var(--card);
  color: var(--muted-2);
}
.playlist-mini .mini-empty .icon { width: 34px; height: 34px; }
.playlist-mini[data-count="1"] { position: relative; display: block; }
.playlist-mini[data-count="1"] img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.playlist-mini[data-count="2"] img { grid-row: span 2; }
.playlist-mini[data-count="3"] img:first-child { grid-row: span 2; }

/* ---------- track list ---------- */
.track-list { display: flex; flex-direction: column; gap: 7px; }
.track-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 9px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--card);
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.track-row:hover { background: var(--surface); }
.track-row.is-current { border-color: var(--accent-border); background: var(--accent-soft); }
.row-art {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 15px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  flex: none;
}
.row-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.row-art .row-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 8, 9, 0.52);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.row-art .row-play .icon { width: 19px; height: 19px; color: #fff; margin-left: 2px; }
.track-row:hover .row-play, .track-row.is-current .row-play { opacity: 1; }
.row-meta { min-width: 0; padding: 3px 0; }
.row-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}
.row-meta .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--muted-2); flex: none; }
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: none;
}
.badge-soft.green { background: var(--success-soft); color: #8ff0c4; }
.badge-soft.youtube { background: var(--danger-soft); color: #ffb3b7; }
.row-actions { display: flex; align-items: center; gap: 0; }
.row-actions .icon-btn { color: var(--muted); }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: var(--muted);
  transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.icon-btn:hover { color: var(--text); background: var(--surface); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn.is-active { color: var(--accent-strong); }
.icon-btn.is-liked .icon { fill: var(--accent-strong); stroke: var(--accent-strong); }
.row-dur { display: none; font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.art-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(145deg, #292132, #171719);
}
.art-fallback .icon { width: 30%; height: 30%; min-width: 18px; min-height: 18px; }
.row-art img + .row-play, .rail-art img + .rail-overlay { z-index: 1; }

/* ---------- search ---------- */
.searchbox {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.searchbox:focus-within { border-color: var(--accent); background: var(--surface-pressed); box-shadow: 0 0 0 4px var(--accent-soft); }
.searchbox.slim { height: 48px; margin-bottom: 14px; }
.searchbox input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 14px; font-weight: 600; }
.searchbox input::placeholder { color: var(--muted-2); font-weight: 500; }
.search-icon { color: var(--muted-2); width: 21px; height: 21px; }
.clear-btn { width: 44px; height: 44px; margin-right: -9px; }
.clear-btn .icon { width: 16px; height: 16px; }
#searchResults { margin-top: 4px; }
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 44px 18px;
  gap: 10px;
}
.empty h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-top: 6px; }
.empty p { color: var(--muted); font-size: 12.5px; max-width: 34ch; }
.empty .btn { margin-top: 10px; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.empty-actions .btn { margin-top: 10px; }
.empty.error-state { padding: 20px 18px 30px; scroll-margin-bottom: 190px; }
.empty.error-state .empty-art { width: 64px; height: 64px; margin-bottom: 0; }
.empty.error-state .empty-art .icon { color: var(--danger); }
.empty.error-state .empty-art span { border-color: rgba(255, 93, 100, 0.3); }
.empty.error-state .empty-art span:nth-child(2) { background: var(--danger-soft); }
.empty-art { position: relative; width: 92px; height: 92px; display: grid; place-items: center; margin-bottom: 4px; }
.empty-art .icon { width: 30px; height: 30px; color: var(--accent-strong); position: relative; z-index: 2; }
.empty-art span { position: absolute; inset: 6px; border-radius: 50%; border: 1px solid var(--accent-border); }
.empty-art span:nth-child(2) { inset: 19px; background: var(--accent-soft); border-color: var(--line); }
.empty-art.vinyl span:first-child { inset: 4px; border: 1px dashed var(--line); animation: spin 14s linear infinite; }
.empty-art.vinyl::before {
  content: "";
  position: absolute;
  inset: 19px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, #242426 0 2px, #151517 2px 4px);
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.spinner.small { width: 18px; height: 18px; }

/* skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-pressed) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 10px;
}
.skeleton-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 9px;
  border-radius: var(--radius-md);
  background: var(--card);
}
.skeleton-art { width: 56px; height: 56px; border-radius: 15px; }
.skeleton-lines { display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 11px; width: 64%; }
.skeleton-line.short { width: 38%; height: 9px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- playlists ---------- */
.playlist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.playlist-card {
  text-align: left;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.playlist-card:hover { background: var(--surface); border-color: var(--muted-2); transform: translateY(-2px); }
.playlist-card:active { transform: scale(0.99); background: var(--surface-pressed); }
.playlist-card .playlist-mini { aspect-ratio: 1; border-radius: 16px; overflow: hidden; }
.playlist-card-meta { padding: 10px 5px 5px; }
.playlist-card-meta strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist-card-meta span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.playlist-hero { display: flex; align-items: flex-end; gap: clamp(16px, 4vw, 26px); margin: 12px 0 24px; }
.playlist-big-cover {
  flex: 0 0 clamp(120px, 34vw, 176px);
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.playlist-big-cover .playlist-mini { width: 100%; height: 100%; }
.playlist-hero-meta { min-width: 0; padding-bottom: 4px; }
.playlist-hero-meta h2 {
  font-family: var(--font-display);
  font-size: clamp(23px, 5vw, 34px);
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
  margin: 5px 0 6px;
}
.playlist-hero-meta p { color: var(--muted); font-size: 12.5px; }
.playlist-hero-meta .hero-actions { margin-top: 14px; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--tap);
  padding: 7px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.back-btn .icon { width: 17px; height: 17px; }
.back-btn:hover { color: var(--text); }

/* ---------- artist ---------- */
.artist-hero { display: flex; align-items: flex-end; gap: clamp(16px, 4vw, 28px); margin: 12px 0 24px; }
.artist-avatar {
  position: relative;
  flex: 0 0 clamp(112px, 32vw, 168px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-card), 0 0 0 6px rgba(168, 85, 247, 0.06);
}
.artist-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.artist-avatar .art-fallback { background: radial-gradient(circle at 32% 22%, #3a2848, #171719 72%); }
.artist-avatar .art-fallback .icon { width: 34%; height: 34%; }
.artist-hero-meta { min-width: 0; padding-bottom: 4px; }
.artist-hero-meta h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 5.6vw, 38px);
  font-weight: 600;
  line-height: 1.12;
  overflow-wrap: anywhere;
  margin: 5px 0 6px;
}
.artist-hero-meta p { color: var(--muted); font-size: 12.5px; }
.artist-hero-meta .hero-actions { margin-top: 14px; }
.artist-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  margin: -6px 0;
  padding: 6px 0;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline dotted rgba(160, 160, 167, 0.7);
  text-underline-offset: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artist-link:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
.full-artist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 92%;
  min-height: 38px;
  margin: 0 auto;
  padding: 0 12px;
  border-radius: 100px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
  transition: color 0.16s ease, background 0.16s ease;
}
.full-artist:hover { color: var(--text); background: var(--surface); }

/* ---------- player dock ---------- */
.player-dock {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  width: min(calc(100% - 24px), 720px);
  padding: 9px 12px 9px 9px;
  border-radius: var(--radius-md);
  background: rgba(23, 23, 25, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  animation: dockIn 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes dockIn { from { opacity: 0; transform: translate(-50%, 14px); } }
.dock-progress {
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--line);
}
.dock-progress i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--accent); transition: width 0.25s linear; }
.dock-cover { position: relative; width: 46px; height: 46px; border-radius: 12px; overflow: hidden; background: var(--surface); cursor: pointer; }
.dock-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dock-meta { min-width: 0; cursor: pointer; }
.dock-meta strong { display: block; font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-meta span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.dock-play { width: 44px; height: 44px; border-radius: 50%; color: #fff; background: var(--accent); }
.dock-play:hover { color: #fff; background: var(--accent-strong); }
.dock-play .icon { width: 18px; height: 18px; }
.dock-next { width: 44px; height: 44px; }
.eq-mini { display: flex; align-items: flex-end; gap: 2px; height: 17px; margin: 0 2px; opacity: 0; transition: opacity 0.2s ease; }
.eq-mini i { width: 2px; height: 60%; border-radius: 2px; background: var(--accent); animation: eq 0.9s ease-in-out infinite alternate; }
.eq-mini i:nth-child(2) { height: 100%; animation-delay: -0.3s; }
.eq-mini i:nth-child(3) { height: 45%; animation-delay: -0.6s; }
.eq-mini i:nth-child(4) { height: 80%; animation-delay: -0.15s; }
.is-playing .eq-mini { opacity: 1; }

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: min(calc(100% - 24px), 500px);
  padding: 7px;
  border-radius: var(--radius-lg);
  background: rgba(23, 23, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(26px) saturate(1.4);
  -webkit-backdrop-filter: blur(26px) saturate(1.4);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  padding: 6px 2px 5px;
  border-radius: 18px;
  color: var(--muted-2);
  transition: color 0.18s ease, background 0.18s ease;
}
.tab .icon { width: 21px; height: 21px; }
.tab span { font-size: 9px; font-weight: 800; letter-spacing: 0.01em; }
.tab.is-active { color: var(--accent-strong); background: var(--accent-soft); }
.tab.is-active .icon { stroke: var(--accent-strong); }
.tab:hover { color: var(--muted); }
body.is-keyboard-open .tabbar,
body.is-keyboard-open .player-dock {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.tabbar, .player-dock { transition: opacity 0.18s ease, visibility 0.18s ease; }

/* ---------- overlay, sheets & modals ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 3, 4, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.25s ease;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 0;
  width: min(100%, 560px);
  max-height: min(90dvh, calc(var(--app-height, 100dvh) - 12px));
  transform: translate(-50%, 103%);
  transition: transform 0.4s cubic-bezier(0.22, 0.9, 0.28, 1);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -20px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet-handle { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 10px auto 4px; }
.sheet.small { padding: 0 16px calc(14px + env(safe-area-inset-bottom)); overflow-y: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 10px; }
.sheet-head h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.sheet-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 15px;
  background: var(--card);
  border: 1px solid var(--line);
}
.sheet-track .row-art { width: 42px; height: 42px; border-radius: 11px; }
.sheet-track div:last-child { min-width: 0; }
.sheet-track strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-track span { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; max-height: 36dvh; overflow-y: auto; }
.sheet-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border-radius: 13px;
  text-align: left;
}
.sheet-list-item:hover { background: var(--card); }
.sheet-list-item .playlist-mini { width: 38px; height: 38px; border-radius: 10px; flex: none; }
.sheet-list-item .mini-empty .icon { width: 17px; height: 17px; }
.sheet-list-item div:last-child { min-width: 0; }
.sheet-list-item strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-list-item span { display: block; color: var(--muted); font-size: 10px; }
.sheet-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 10px;
  border-radius: 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.sheet-action:hover { background: var(--card); }
.sheet-action .icon { width: 19px; height: 19px; color: var(--muted); }
.sheet-action.danger { color: var(--danger); }
.sheet-action.danger .icon { color: var(--danger); }
.sheet-action .sub { margin-left: auto; color: var(--muted-2); font-size: 10px; font-weight: 600; }

/* context menu / dropdown primitives */
.menu, .context-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: 12px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
}
.menu-item:hover { background: var(--surface-pressed); }
.menu-item .icon { width: 17px; height: 17px; color: var(--muted); }
.menu-item.danger { color: var(--danger); }

/* ---------- full player ---------- */
.player-sheet { height: min(96dvh, 860px); background: var(--bg-elevated); }
.sheet-bg {
  position: absolute;
  inset: -20%;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(80px) saturate(1.35);
  opacity: 0.14;
  transition: background-image 0.4s ease;
  pointer-events: none;
}
.player-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(to bottom, rgba(16, 16, 18, 0.25), var(--bg-elevated) 46%);
  pointer-events: none;
}
.player-topline { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: calc(6px + var(--app-safe-top)) 16px 5px; }
.player-topline .kicker { font-size: 8.5px; }
.player-scroll {
  position: relative;
  z-index: 2;
  height: calc(100% - 56px - var(--app-safe-top));
  overflow-y: auto;
  padding: 4px clamp(18px, 5vw, 34px) calc(26px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.player-scroll::-webkit-scrollbar { display: none; }
.full-cover-wrap { position: relative; width: min(68vw, 280px); margin: 6px auto 22px; }
.full-cover {
  position: relative;
  aspect-ratio: 1;
  border-radius: 30px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  isolation: isolate;
}
.full-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.full-cover .art-fallback .icon { width: 64px; height: 64px; }
.cover-glow { position: absolute; inset: 14% -4% -10%; z-index: -1; border-radius: 50%; background: var(--accent-soft); filter: blur(45px); opacity: 0.8; transition: background 0.4s ease; }
.full-meta { text-align: center; }
.full-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.full-badge.preview { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent-border); }
.full-meta h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 5.5vw, 28px);
  font-weight: 600;
  line-height: 1.2;
  margin: 10px auto 4px;
  max-width: 90%;
  overflow-wrap: anywhere;
}
.full-meta p { color: var(--muted); font-size: 13px; }
.seek { margin: 24px 0 10px; }
.seek input, .volume input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--progress, 0%), var(--line) var(--progress, 0%));
  outline: none;
  cursor: pointer;
}
.seek input::-webkit-slider-thumb, .volume input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
  transition: transform 0.15s ease;
}
.seek input:active::-webkit-slider-thumb { transform: scale(1.18); }
.seek input:disabled { cursor: default; opacity: 0.4; }
.seek input:disabled::-webkit-slider-thumb { box-shadow: none; }
.seek input::-moz-range-thumb, .volume input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.times { display: flex; justify-content: space-between; margin-top: 8px; font-size: 10px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 15px 4px 20px; }
.ctrl { width: 46px; height: 46px; color: var(--text); }
.ctrl.small { width: 44px; height: 44px; color: var(--muted); }
.ctrl .icon { width: 23px; height: 23px; }
.ctrl.is-active { color: var(--accent-strong); }
.play-main {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 14px 36px rgba(168, 85, 247, 0.3);
  transition: transform 0.16s ease, background 0.16s ease;
}
.play-main:active { transform: scale(0.94); }
.play-main:hover { background: var(--accent-strong); }
.play-main .icon { width: 27px; height: 27px; margin-left: 2px; }
.play-main .icon-pause { margin-left: 0; }
.repeat-one { position: absolute; font-size: 6px; font-weight: 900; color: currentColor; margin-top: 12px; display: none; }
#repeatBtn { position: relative; }
#repeatBtn.mode-one .repeat-one { display: block; }
.player-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 100px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.action-pill .icon { width: 15px; height: 15px; }
.action-pill:hover { color: var(--text); background: var(--surface); }
.action-pill.is-liked { color: var(--accent-strong); border-color: var(--accent-border); background: var(--accent-soft); }
.action-pill.is-liked .icon { fill: var(--accent-strong); }
.action-pill.accent { color: var(--accent-strong); border-color: var(--accent-border); background: var(--accent-soft); }
.volume { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 0 4px; }
.volume .icon { width: 19px; height: 19px; color: var(--muted-2); }
html[data-device="phone"] .volume { display: none; }
.player-note { text-align: center; color: var(--muted-2); font-size: 9.5px; margin-top: 18px; padding: 0 12px; line-height: 1.5; }

/* ---------- modal, loading & toasts ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 3, 4, 0.72);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: fade 0.2s ease;
}
.modal-card {
  width: min(100%, 400px);
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-modal);
  animation: modalIn 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.modal-card h3 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 6px 0 6px; }
.modal-card p { color: var(--muted); font-size: 12px; }
.modal-card input {
  width: 100%;
  height: 50px;
  margin: 16px 0 18px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  outline: 0;
  font-size: 13.5px;
  font-weight: 600;
}
.modal-card input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.loading-card {
  position: fixed;
  z-index: 150;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(calc(100% - 48px), 300px);
  padding: 28px 22px;
  border-radius: var(--radius-lg);
  background: rgba(23, 23, 25, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-modal);
  text-align: center;
  animation: modalIn 0.25s ease;
}
.loading-card strong { font-size: 13px; margin-top: 4px; }
.loading-card > span { color: var(--muted-2); font-size: 10.5px; }
.vinyl-spinner {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, #242426 0 2px, #151517 2px 4px);
  animation: spin 1.8s linear infinite;
}
.vinyl-spinner::after { content: ""; position: absolute; inset: 43%; border-radius: 50%; background: var(--accent); }
.vinyl-spinner span { position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }
.toasts {
  position: fixed;
  z-index: 400;
  top: calc(12px + var(--app-safe-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(calc(100% - 28px), 420px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: 14px;
  background: rgba(32, 32, 35, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  font-size: 12px;
  font-weight: 600;
  animation: toastIn 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.toast .icon { width: 17px; height: 17px; color: var(--success); }
.toast.error .icon { color: var(--danger); }
.toast.is-out { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.dev-badge {
  position: fixed;
  z-index: 80;
  left: 12px;
  bottom: calc(148px + env(safe-area-inset-bottom));
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-strong);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.fatal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(70% 55% at 50% 40%, #17121f, var(--bg) 75%);
  text-align: center;
}
.fatal-card { max-width: 380px; }
.fatal-card .brand-mark { margin: 0 auto 16px; }
.fatal-card h2 { font-family: var(--font-display); font-size: 22px; margin-bottom: 8px; }
.fatal-card p { color: var(--muted); font-size: 13px; }

/* ---------- hover-capable devices ---------- */
@media (hover: hover) {
  .btn-primary:hover { box-shadow: 0 10px 26px rgba(168, 85, 247, 0.22); }
}

/* ---------- responsive ---------- */
@media (min-width: 760px) {
  .shell { padding-bottom: 214px; }
  .hero { padding: 40px 44px; }
  .hero h2 { max-width: 13em; }
  .tabbar { width: 500px; }
  .track-row { grid-template-columns: 58px minmax(0, 1fr) auto auto; }
  .row-art { width: 58px; height: 58px; }
  .row-dur { display: block; margin-right: 4px; }
  .playlist-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .player-dock { grid-template-columns: 50px minmax(0, 1fr) auto auto auto; }
  .dock-cover { width: 50px; height: 50px; }
}
@media (max-width: 680px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .hero-stats { margin-top: 4px; }
}
@media (max-width: 430px) {
  .shell { padding-left: 14px; padding-right: 14px; }
  .hero { border-radius: 26px; }
  .hero h2 { margin-top: 15px; }
  .hero-actions .btn { flex: 1; }
  .hero-stats { gap: 18px; }
  .hero-wave { display: none; }
  .topbar { margin-bottom: 18px; }
  .brand-copy h1 { font-size: 15px; }
  .section { margin-top: 26px; }
  .page-head.row { align-items: flex-start; }
  .page-head.row .btn-sm { margin-top: 4px; }
  .playlist-grid { gap: 10px; }
  .playlist-card { padding: 7px; border-radius: var(--radius-md); }
  .playlist-card .playlist-mini { border-radius: 14px; }
  .playlist-hero { align-items: flex-start; }
  .playlist-big-cover { flex-basis: 116px; border-radius: var(--radius-md); }
  .playlist-hero .hero-actions .btn-sm { min-height: 44px; }
  .artist-hero { align-items: center; gap: 14px; }
  .artist-avatar { flex-basis: 96px; }
  .artist-hero-meta h2 { font-size: 22px; }
  .artist-hero .hero-actions .btn-sm { min-height: 44px; }
  .action-pill { font-size: 10px; padding: 0 10px; }
  .track-row { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 9px; padding: 8px; }
  .row-art { width: 52px; height: 52px; border-radius: 14px; }
  .row-actions .icon-btn { width: 44px; height: 44px; }
  .player-dock { grid-template-columns: 44px minmax(0, 1fr) auto auto; }
  .dock-next { display: none; }
  .eq-mini { display: none; }
  .full-cover-wrap { width: min(72vw, 280px); }
  .source-switch { width: 100%; }
  .source-btn { flex: 1; }
}
@media (max-height: 700px) {
  .full-cover-wrap { width: min(58vw, 220px); margin: 2px auto 16px; }
  .full-meta h2 { font-size: 20px; }
  .seek { margin-top: 16px; }
  .controls { margin-top: 8px; margin-bottom: 14px; }
  .volume { margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- SoundCloud, recommendations & import ---------- */
.source-dot.soundcloud { background: #ff7700; }
.section-hint {
  color: var(--muted-2);
  font-size: 11px;
  margin-top: 4px;
}
.section-head .link .icon { width: 14px; height: 14px; }
.page-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge-soft.soundcloud { color: #ff9a4d; border-color: rgba(255, 119, 0, 0.3); background: rgba(255, 119, 0, 0.1); }
.rail-card .rail-reason {
  display: block;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.3;
  margin-top: 3px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.import-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background:
    radial-gradient(90% 140% at 0% 0%, rgba(168, 85, 247, 0.12), transparent 60%),
    var(--card);
}
.import-card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 15px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-strong);
}
.import-card-copy { min-width: 0; flex: 1; }
.import-card-copy strong { display: block; font-size: 14px; margin-top: 2px; }
.import-card-copy > span:last-child { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.import-intro p { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.import-file-btn { margin-bottom: 10px; justify-content: center; cursor: pointer; }
.import-textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
  outline: none;
}
.import-textarea:focus { border-color: var(--accent); }
.import-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 10px 0 4px; }
.import-progress { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.import-stats { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); }
.import-stats strong { color: var(--text); }
.import-stats #importStatus { font-weight: 700; color: var(--accent-strong); }
.import-bar { height: 6px; border-radius: 6px; background: var(--surface); overflow: hidden; margin: 8px 0 10px; }
.import-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); transition: width 0.3s ease; }
.import-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.import-counts span { padding: 4px 8px; border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 10px; }
.import-counts span strong { color: var(--text); }
.import-items { display: flex; flex-direction: column; gap: 4px; max-height: 32dvh; overflow-y: auto; margin-bottom: 10px; }
.import-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 10px; background: var(--card); border: 1px solid var(--line-soft); font-size: 10.5px; }
.import-item span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-item small { color: var(--muted-2); flex: none; }
.import-item[data-status="downloaded"] small { color: var(--success); }
.import-item[data-status="failed"] small { color: var(--danger); }
.import-item[data-status="not_found"] small { color: var(--warning); }
.import-item[data-status="queued"] small { color: var(--accent-strong); }
@media (max-width: 430px) {
  .import-card { align-items: flex-start; flex-wrap: wrap; }
  .import-card-copy { flex-basis: calc(100% - 64px); }
  .import-card .btn { width: 100%; }
  .page-actions { flex: none; }
  .page-actions .btn { padding: 0 10px; }
}
