/* ==========================================================================
   RH—MUSIC · Dark Liquid Glass
   Mobile-first: базовая вёрстка — для iPhone, десктоп — расширение ≥1024px.
   ========================================================================== */

:root {
  --bg: #0A0B10;
  --bg-2: #101426;
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.085);
  --panel: rgba(21, 26, 44, 0.72);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #F2F5FF;
  --muted: #929BB7;
  --muted-2: #6F7796;
  --blue: #6C8CFF;
  --violet: #A855F7;
  --grad: linear-gradient(135deg, #5B7CFF, #A855F7);
  --danger: #FF7A88;
  --ok: #4ADE80;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 26px;

  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.32);
  --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.45);
  --glow: 0 10px 28px rgba(91, 124, 255, 0.3);

  --ambient-1: rgba(91, 124, 255, 0.26);
  --ambient-2: rgba(168, 85, 247, 0.22);

  /* мобильные метрики */
  --topbar-h: 54px;
  --tabbar-h: 58px;
  --player-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
input, textarea { font: inherit; }

::selection { background: rgba(108, 140, 255, 0.35); }

* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.16) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ───────────────────────────── фон ───────────────────────────── */

.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: var(--bg); }
.ambient-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; transition: background 0.9s ease; }
.ambient-a { width: 70vw; height: 70vw; min-width: 300px; min-height: 300px; top: -22vw; left: -18vw; background: var(--ambient-1); }
.ambient-b { width: 60vw; height: 60vw; min-width: 260px; min-height: 260px; top: -14vw; right: -20vw; background: var(--ambient-2); }

/* ───────────────────────────── каркас ───────────────────────────── */

.app { position: relative; z-index: 1; display: block; }
.app-main { min-width: 0; }

/* на телефоне боковой панели нет */
.sidebar { display: none; }

/* ───────────────────────────── Топбар ───────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) 14px 0;
  background: rgba(10, 11, 16, 0.78);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.brand-mobile { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mobile-text { font-weight: 800; font-size: 15px; letter-spacing: 0.11em; white-space: nowrap; }

.logo {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px;
  background: var(--grad);
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px; color: #fff;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255,255,255,0.35);
}

.logo.small { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }

/* строка поиска в топбаре — только на десктопе */
.searchbar { display: none; }

.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .15s ease;
}

.icon-btn svg { width: 19px; height: 19px; fill: currentColor; }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.round { border-radius: 50%; }

.account-btn { margin-left: auto; }

.avatar {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad);
  color: #fff;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
}

/* ───────────────────────────── Страница ───────────────────────────── */

.page {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 14px 14px calc(var(--player-h) + var(--tabbar-h) + var(--safe-bottom) + 20px);
  outline: none;
  min-height: 60vh;
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-title { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.page-sub { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.section { margin-bottom: 24px; animation: fade-up .4s ease both; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -0.01em; }
.section-sub { margin: 3px 0 0; color: var(--muted-2); font-size: 12px; }
.section-count { color: var(--muted-2); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ───────────────────────────── Поиск ───────────────────────────── */

.search-screen { display: flex; flex-direction: column; gap: 12px; }

.search-field {
  position: sticky;
  top: calc(var(--topbar-h) + var(--safe-top));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 38px;
  border-radius: 14px;
  background: rgba(21, 26, 44, 0.92);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.search-field .search-ico { position: absolute; left: 13px; width: 17px; height: 17px; fill: var(--muted); }
.search-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); padding: 10px 0; font-size: 16px; appearance: none; -webkit-appearance: none;
}
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-field input::placeholder { color: var(--muted-2); }

.search-clear { width: 30px; height: 30px; border-radius: 50%; color: var(--muted); display: none; font-size: 13px; }
.search-field.has-value .search-clear { display: grid; place-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips-scroll { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: #C9CFE4;
  font-size: 13px; font-weight: 600;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .15s ease;
}

.chip:active { transform: scale(0.97); }
.chip.is-active { color: #fff; background: linear-gradient(135deg, rgba(108,140,255,0.3), rgba(168,85,247,0.26)); border-color: rgba(139,92,246,0.45); }
.chip svg { width: 15px; height: 15px; fill: currentColor; }

.search-tabs { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.search-tabs::-webkit-scrollbar { display: none; }

/* ───────────────────────────── Карточки ───────────────────────────── */

.grid-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.card {
  display: flex; flex-direction: column; gap: 9px;
  padding: 9px;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--border);
  text-align: left;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
  animation: fade-up .35s ease both;
}

.card:active { transform: scale(0.985); }

.card-art {
  position: relative; width: 100%; aspect-ratio: 1;
  border-radius: 14px; overflow: hidden;
  background: linear-gradient(140deg, #232B45, #171D30);
}

.card-art.round { border-radius: 50%; }
.card-art img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.card-art .cover-fallback { z-index: 0; }

.card-play {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  box-shadow: var(--glow);
}

.card-play svg { width: 15px; height: 15px; fill: currentColor; margin-left: 1px; }
.card-title { font-size: 13.5px; font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───────────────────────────── Трек-строки ───────────────────────────── */

.track-list { display: flex; flex-direction: column; gap: 4px; }

.track {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 6px 7px 7px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.028);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
  animation: fade-up .3s ease both;
  -webkit-user-select: none; user-select: none;
}

.track:active { background: var(--glass-strong); }
.track.is-current { background: linear-gradient(90deg, rgba(108,140,255,0.18), rgba(168,85,247,0.09) 62%, rgba(255,255,255,0.03)); border-color: rgba(108,140,255,0.38); }

.track-index { display: none; }
.track-dur { display: none; }

.track .cover {
  position: relative; width: 48px; height: 48px; border-radius: 11px; overflow: hidden; flex: none;
  background: linear-gradient(140deg, #232B45, #171D30);
}

.track .cover img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: rgba(255,255,255,0.32); letter-spacing: .06em; }
.cover-fallback.big { font-size: 22px; }

.track-meta { display: block; min-width: 0; overflow: hidden; }
.track-title { display: block; font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-sub { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.track-sub a:hover { color: #C9D2FF; }

.track-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }

.row-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--muted);
  transition: background .16s ease, color .16s ease, transform .14s ease;
}

.row-btn svg { width: 19px; height: 19px; fill: currentColor; }
.row-btn:active { transform: scale(.9); background: var(--glass); }
.row-btn.is-on { color: #C9B8FF; }

.track-play {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.track-play svg { width: 14px; height: 14px; fill: currentColor; }
.track.is-current .track-play { background: var(--grad); border-color: transparent; color: #fff; }

.eq { display: flex; align-items: flex-end; gap: 2.5px; height: 14px; }
.eq i { width: 3px; border-radius: 2px; background: currentColor; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .16s; }
.eq i:nth-child(3) { animation-delay: .32s; }
.eq i:nth-child(4) { animation-delay: .48s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 14px; } }

/* ───────────────────────────── Детали ───────────────────────────── */

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px 8px 10px; margin-bottom: 12px;
  border-radius: 999px; background: var(--glass); border: 1px solid var(--border);
  color: var(--muted); font-size: 13px; font-weight: 600;
}

.back-link svg { width: 15px; height: 15px; fill: currentColor; }

.detail {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: var(--r-xl);
  margin-bottom: 18px;
  overflow: hidden;
  background:
    radial-gradient(90% 130% at 12% 0%, rgba(108,140,255,0.22), transparent 62%),
    radial-gradient(70% 120% at 88% 0%, rgba(168,85,247,0.2), transparent 64%),
    var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.detail-art { position: relative; width: 104px; height: 104px; border-radius: 16px; overflow: hidden; background: linear-gradient(140deg, #232B45, #171D30); }
.detail-art.round { border-radius: 50%; }
.detail-art img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.detail-art .cover-fallback { z-index: 0; }

.detail-body { position: relative; min-width: 0; }
.detail-kicker { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: #C3B6FF; font-weight: 700; }
.detail-title { margin: 6px 0 4px; font-size: 20px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.detail-sub { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.detail-desc { display: none; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 13px;
  font-weight: 650; font-size: 14px;
  transition: transform .15s ease, filter .15s ease, background .18s ease, border-color .18s ease;
}

.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.btn-ghost { background: var(--glass); border: 1px solid var(--border); color: #E3E8FA; }
.btn-danger { background: rgba(255, 90, 105, 0.14); border: 1px solid rgba(255, 120, 130, 0.4); color: #FFC7CD; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; }

/* ───────────────────────────── Состояния ───────────────────────────── */

.skeleton-row { display: grid; grid-template-columns: 48px 1fr 36px; gap: 11px; align-items: center; padding: 7px; }
.sk { border-radius: 10px; background: linear-gradient(90deg, rgba(255,255,255,.045) 25%, rgba(255,255,255,.085) 37%, rgba(255,255,255,.045) 63%); background-size: 400% 100%; animation: shimmer 1.5s ease infinite; }
.sk-art { width: 48px; height: 48px; border-radius: 11px; }
.sk-card { aspect-ratio: 1; border-radius: 14px; }
.sk-line { height: 11px; }
.sk-line.short { width: 46%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.empty { padding: 34px 12px; text-align: center; color: var(--muted); animation: fade-up .35s ease both; }
.empty-ico { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--border); }
.empty-ico svg { width: 24px; height: 24px; fill: var(--muted); }
.empty h3 { margin: 0 0 8px; color: var(--text); font-size: 17px; }
.empty p { margin: 0 auto; max-width: 46ch; font-size: 13.5px; }
.empty .hint { margin-top: 10px; font-size: 12.5px; color: var(--muted-2); }
.empty-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(108,140,255,0.09);
  border: 1px solid rgba(108,140,255,0.25);
  color: #C8D3FF; font-size: 13px;
}

.more-btn { width: 100%; margin-top: 12px; padding: 13px; border-radius: 14px; background: var(--glass); border: 1px solid var(--border); color: #C9CFE4; font-weight: 650; font-size: 13.5px; }
.more-btn[disabled] { opacity: .6; }

/* ───────────────────────────── Плеер ───────────────────────────── */

.player {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  z-index: 60;
  padding: 0 10px 8px;
  background: rgba(12, 14, 22, 0.92);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  transform: translateY(0);
  transition: transform .25s ease;
}

.player.is-hidden { transform: translateY(120%); }

.player-progress { margin: 0 -10px 2px; }
.player-progress .seek { margin: -7px 0 0; height: 14px; }

.player-row { display: flex; align-items: center; gap: 10px; }

button.np-open { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; padding: 2px; text-align: left; }

.np-cover { position: relative; width: 44px; height: 44px; flex: none; border-radius: 11px; overflow: hidden; background: linear-gradient(140deg, #232B45, #171D30); }
.np-cover img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.np-cover img.is-loaded { opacity: 1; }
.np-cover .cover-fallback { z-index: 0; }

.np-text { display: block; min-width: 0; overflow: hidden; }
.np-title { display: block; font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.np-artist a { color: inherit; }

.player-desktop-controls { display: none; }
.player-time { display: none; }

.play-mobile {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  box-shadow: var(--glow);
}

.play-mobile svg { width: 19px; height: 19px; fill: currentColor; }
.play-mobile .i-pause { display: none; }
.player.is-playing .play-mobile .i-play { display: none; }
.player.is-playing .play-mobile .i-pause { display: block; }
.play-mobile .spinner { display: none; }
.player.is-loading .play-mobile svg { display: none; }
.player.is-loading .play-mobile .spinner { display: block; }

.ctrl {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  color: #D7DCF0;
  transition: background .18s ease, color .18s ease, transform .15s ease;
}

.ctrl svg { width: 21px; height: 21px; fill: currentColor; }
.ctrl:active:not(:disabled) { transform: scale(.92); }
.ctrl:disabled { opacity: .35; }
.ctrl.ghost { color: var(--muted); }
.ctrl.ghost.is-on { color: #C9B8FF; background: rgba(168,85,247,0.16); }
.ctrl.is-on { color: #C9B8FF; background: rgba(168,85,247,0.2); box-shadow: inset 0 0 0 1px rgba(168,85,247,.45); }
.ctrl.is-one .np-repeat-one { display: block; }
.ctrl.play { width: 50px; height: 50px; background: var(--grad); color: #fff; box-shadow: var(--glow); }
.ctrl.play.xl { width: 64px; height: 64px; }
.ctrl.play.xl svg { width: 28px; height: 28px; }
.ctrl.play .i-pause { display: none; }
.player.is-playing .ctrl.play .i-pause, .now-playing.is-playing .ctrl.play .i-pause { display: block; }
.player.is-playing .ctrl.play .i-play, .now-playing.is-playing .ctrl.play .i-play { display: none; }
.ctrl.play .spinner { display: none; }
.player.is-loading .ctrl.play svg, .now-playing.is-loading .ctrl.play svg { display: none; }
.player.is-loading .ctrl.play .spinner, .now-playing.is-loading .ctrl.play .spinner { display: block; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.repeat-one { position: absolute; right: 3px; bottom: 3px; font-size: 9px; font-weight: 800; padding: 1px 3px; border-radius: 4px; background: var(--grad); color: #fff; display: none; }
.ctrl.is-one .repeat-one { display: block; }

/* ───────────────────────────── Нижняя навигация ───────────────────────────── */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(11, 13, 20, 0.94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted-2);
  font-size: 10px; font-weight: 600;
  transition: color .18s ease;
}

.tab svg { width: 22px; height: 22px; fill: currentColor; }
.tab.is-active { color: var(--blue); }
.tab.is-active svg { fill: currentColor; }
.tab.is-active span { color: var(--blue); }
.tab:active { transform: scale(.96); }

/* ───────────────────────────── Seek ───────────────────────────── */

.seek { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; margin: 0; background: transparent; touch-action: none; display: block; }
.seek::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--blue), var(--violet)) 0 / var(--fill, 0%) 100% no-repeat, rgba(255,255,255,0.14); }
.seek::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(255,255,255,0.14); }
.seek::-moz-range-progress { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--blue), var(--violet)); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; margin-top: -5.5px; box-shadow: 0 0 0 4px rgba(108,140,255,.2); }
.seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.seek:disabled { opacity: .5; }

/* ───────────────────────────── Now Playing ───────────────────────────── */

.now-playing {
  position: fixed; inset: 0; z-index: 90;
  display: flex; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(2.5%);
  transition: opacity .3s ease, transform .34s cubic-bezier(.2,.8,.3,1), visibility .3s;
  background: rgba(8, 9, 14, 0.82);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  overscroll-behavior: contain;
}

.now-playing.is-open { opacity: 1; visibility: visible; transform: none; }

/* Полноэкранный плеер перекрывает мини-плеер и таббар: в WebKit слои с
   backdrop-filter иначе могут отрисоваться поверх него. */
body.np-open .player,
body.np-open .tabbar { visibility: hidden; pointer-events: none; }

.np-bg {
  position: absolute; inset: -15%;
  background:
    radial-gradient(60% 45% at 30% 8%, var(--ambient-1), transparent 62%),
    radial-gradient(55% 42% at 76% 14%, var(--ambient-2), transparent 64%);
  filter: blur(50px);
  pointer-events: none;
  transition: background .9s ease;
}

.np-inner {
  position: relative;
  width: min(520px, 100%);
  height: 100dvh;
  display: flex; flex-direction: column;
  gap: 12px;
  padding: calc(var(--safe-top) + 8px) 20px calc(var(--safe-bottom) + 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.np-inner > * { flex: none; }

.np-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.np-kicker { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

.np-art {
  position: relative;
  align-self: center;
  width: min(74vw, 46dvh);
  max-width: 380px;
  aspect-ratio: 1;
  border-radius: 22px;
  overflow: hidden;
  margin: 2px 0 4px;
  background: linear-gradient(140deg, #232B45, #171D30);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
}

.np-art img.np-cover-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity .38s ease, transform .48s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.np-art img.np-cover-layer.is-active { opacity: 1; transform: scale(1); z-index: 2; }
.np-art img.np-cover-layer.is-leaving { opacity: 0; transform: scale(1.02); z-index: 1; }
.np-art .cover-fallback { z-index: 0; }

.np-info { text-align: center; min-width: 0; transition: opacity .34s ease, transform .42s ease; }
.np-info.is-changing { opacity: 0; transform: translateY(4px); }
.np-song { display: block; font-size: 20px; font-weight: 780; letter-spacing: -0.02em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.np-singer { display: block; margin-top: 5px; color: var(--muted); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.np-progress { margin-top: 2px; }
.np-times { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.np-controls { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 4px; }

.np-extras { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.np-extras .chip.is-on { color: #fff; background: linear-gradient(135deg, rgba(108,140,255,.3), rgba(168,85,247,.26)); border-color: rgba(139,92,246,.45); }

.np-queue { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.np-queue:empty { display: none; }
.np-queue .track { grid-template-columns: 44px minmax(0,1fr) 36px; background: transparent; }
.np-queue .track .cover { width: 44px; height: 44px; }

/* ───────────────────────────── Drawer / Sheet ───────────────────────────── */

.drawer {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 95;
  /* Скрытое состояние — структурное: visibility не зависит от transform,
     высоты содержимого и состояния анимации. Показывает только .is-open. */
  visibility: hidden;
  pointer-events: none;
  max-height: 78dvh;
  display: flex; flex-direction: column;
  padding: 16px 14px calc(var(--safe-bottom) + 14px);
  background: linear-gradient(180deg, rgba(21,26,44,.96), rgba(12,14,22,.98));
  border-top: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  transform: translateY(102%);
  transition: transform .32s cubic-bezier(.2,.8,.3,1);
  box-shadow: 0 -20px 50px rgba(0,0,0,.5);
}

.drawer.is-open { transform: none; visibility: visible; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-head h2 { margin: 0; font-size: 17px; font-weight: 750; }
.drawer-sub { color: var(--muted-2); font-size: 12.5px; margin: 5px 0 12px; }
.drawer-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }

.sheet {
  position: fixed; inset: 0; z-index: 96;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden;
  pointer-events: none;
  transition: opacity .24s ease, visibility .24s;
}
.sheet.is-open { pointer-events: none; }

.sheet.is-open { opacity: 1; visibility: visible; }

.sheet-panel {
  position: relative;
  pointer-events: auto;
  width: 100%;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 16px 14px calc(var(--safe-bottom) + 14px);
  background: linear-gradient(180deg, rgba(23,29,48,.98), rgba(12,14,22,.99));
  border-top: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  transform: translateY(6%);
  transition: transform .28s cubic-bezier(.2,.8,.3,1);
  overscroll-behavior: contain;
}

.sheet.is-open .sheet-panel { transform: none; }

.sheet-title { margin: 0 0 4px; padding-right: 44px; font-size: 17px; font-weight: 750; }
.sheet-sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.sheet-actions { display: flex; flex-direction: column; gap: 2px; }

.sheet-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 12px; border-radius: 13px;
  color: var(--text); font-size: 15px; font-weight: 600;
  text-align: left;
  transition: background .16s ease;
}

.sheet-item svg { width: 19px; height: 19px; fill: var(--muted); flex: none; }
.sheet-item:active { background: var(--glass); }
.sheet-item.is-danger { color: var(--danger); }
.sheet-item.is-danger svg { fill: var(--danger); }
.sheet-item[disabled] { opacity: .5; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field input, .field textarea {
  width: 100%; padding: 13px 14px; border-radius: 13px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text); font-size: 16px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.field input:focus, .field textarea:focus { border-color: rgba(108,140,255,.55); box-shadow: 0 0 0 4px rgba(108,140,255,.12); }
.field .hint { font-size: 11.5px; color: var(--muted-2); }

.scrim {
  position: fixed; inset: 0; z-index: 85;
  background: rgba(5,6,10,.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .26s ease;
}

.scrim.is-open { opacity: 1; }

/* ───────────────────────────── Toast ───────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--player-h) + var(--tabbar-h) + var(--safe-bottom) + 14px);
  transform: translate(-50%, 12px);
  max-width: min(92vw, 440px);
  padding: 12px 16px; border-radius: 14px;
  background: rgba(30,20,24,.97);
  border: 1px solid rgba(255,120,130,.35);
  color: #FFD9DD; font-size: 13px; line-height: 1.4; text-align: center;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity .24s ease, transform .24s ease;
  z-index: 110;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-info { background: rgba(18,24,40,.97); border-color: rgba(108,140,255,.4); color: #DCE3FF; }
.toast.is-ok { display: none !important; }

/* ───────────────────────────── Аккаунт ───────────────────────────── */

.auth-card {
  max-width: 420px;
  margin: 8px auto 0;
  padding: 20px 16px;
  border-radius: var(--r-xl);
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fade-up .4s ease both;
}

.auth-head { text-align: center; margin-bottom: 18px; }
.auth-head h1 { margin: 12px 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.auth-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.auth-switch a { color: #C9D2FF; font-weight: 650; }

.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-avatar { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 24px; font-weight: 800; text-transform: uppercase; box-shadow: var(--glow); }
.profile-name { font-size: 20px; font-weight: 800; }
.profile-mail { color: var(--muted); font-size: 13px; margin-top: 3px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 18px; }
.stat { padding: 13px 10px; border-radius: 15px; background: var(--glass); border: 1px solid var(--border); text-align: center; }
.stat b { display: block; font-size: 19px; font-weight: 800; }
.stat span { display: block; font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }

.list-block { border-radius: 18px; background: var(--glass); border: 1px solid var(--border); overflow: hidden; margin-bottom: 14px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .label { font-size: 14px; font-weight: 600; }
.list-row .value { color: var(--muted); font-size: 13px; }

/* плейлисты */
.playlist-row {
  display: grid;
  grid-template-columns: 56px minmax(0,1fr) auto;
  align-items: center; gap: 12px;
  padding: 6px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.playlist-row .pl-art { width: 56px; height: 56px; border-radius: 13px; overflow: hidden; background: linear-gradient(140deg, #232B45, #171D30); position: relative; }
.playlist-row .pl-art img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.playlist-row .pl-title { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-row .pl-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.reorder-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 8px; }
.reorder-controls { display: flex; flex-direction: column; gap: 2px; }
.reorder-controls button { width: 30px; height: 24px; border-radius: 8px; background: var(--glass); border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); }
.reorder-controls button svg { width: 14px; height: 14px; fill: currentColor; }
.reorder-controls button[disabled] { opacity: .35; }

/* ───────────────────────────── Анимации ───────────────────────────── */

@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cover-in { animation: fade-up .45s cubic-bezier(.2,.8,.3,1) both; }

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

/* ══════════════════════════ Планшет (≥700px) ══════════════════════════ */

@media (min-width: 700px) {
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
  .track { grid-template-columns: 40px 52px minmax(0,1fr) auto auto; gap: 12px; padding: 8px 10px 8px 8px; }
  .track-index { display: block; font-size: 12.5px; color: var(--muted); text-align: center; }
  .track-dur { display: block; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .track .cover { width: 52px; height: 52px; border-radius: 12px; }
  .page { padding: 18px 20px calc(var(--player-h) + var(--tabbar-h) + var(--safe-bottom) + 26px); }
  .detail { grid-template-columns: 160px minmax(0,1fr); gap: 20px; padding: 20px; align-items: end; }
  .detail-art { width: 160px; height: 160px; }
  .detail-title { font-size: 28px; }
  .detail-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 10px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
  .sheet { align-items: center; }
  .sheet-panel { width: min(460px, 92vw); border-radius: 22px; border: 1px solid var(--border); transform: scale(.97); padding: 20px; }
  .sheet.is-open .sheet-panel { transform: none; }
  .drawer { left: auto; right: 18px; bottom: 18px; width: min(400px, 92vw); border-radius: 22px; border: 1px solid var(--border); max-height: 70dvh; }
  .toast { bottom: calc(var(--player-h) + var(--tabbar-h) + 24px); }
}

/* ══════════════════════════ Десктоп (≥1024px) ══════════════════════════ */

@media (min-width: 1024px) {
  :root { --player-h: 84px; --tabbar-h: 0px; }

  .app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100dvh; }

  .sidebar {
    display: flex; flex-direction: column; gap: 16px;
    position: sticky; top: 0; height: 100dvh;
    padding: 20px 14px 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.028) 40%, rgba(16,20,38,.72));
    border-right: 1px solid var(--border);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    z-index: 30;
  }

  .side-brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 4px; }
  .side-brand-text { display: flex; flex-direction: column; min-width: 0; }
  .side-brand-title { font-weight: 800; font-size: 16px; letter-spacing: .13em; white-space: nowrap; }
  .side-brand-title .dash { color: var(--violet); }
  .side-brand-sub { font-size: 10.5px; letter-spacing: .08em; color: var(--muted-2); margin-top: 2px; }

  .side-nav { display: flex; flex-direction: column; gap: 3px; }
  .side-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 13px; color: var(--muted); font-weight: 600; font-size: 14px; border: 1px solid transparent; transition: all .18s ease; }
  .side-item svg { width: 18px; height: 18px; fill: currentColor; }
  .side-item:hover { color: var(--text); background: var(--glass); border-color: var(--border); }
  .side-item.is-active { color: #fff; background: linear-gradient(135deg, rgba(108,140,255,.24), rgba(168,85,247,.2)); border-color: rgba(139,92,246,.42); }

  .side-block { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .side-block-title { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted-2); margin: 6px 6px 8px; font-weight: 700; }
  .side-playlists { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
  .side-playlist { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 11px; font-size: 13px; color: var(--muted); }
  .side-playlist:hover { background: var(--glass); color: var(--text); }
  .side-playlist span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .side-account { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 15px; background: var(--glass); border: 1px solid var(--border); }
  .side-account-text { display: flex; flex-direction: column; min-width: 0; }
  .side-account-name { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-account-sub { font-size: 11.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .topbar { height: auto; padding: 14px clamp(18px, 3vw, 32px); gap: 14px; background: rgba(10,11,16,.82); }
  .brand-mobile { display: none; }

  .searchbar {
    position: relative; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
    padding: 6px 6px 6px 40px; border-radius: 15px; background: var(--glass); border: 1px solid var(--border);
    transition: border-color .2s ease, box-shadow .2s ease;
  }
  .searchbar:focus-within { border-color: rgba(108,140,255,.55); box-shadow: 0 0 0 4px rgba(108,140,255,.13); }
  .searchbar .search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; fill: var(--muted); }
  .searchbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); padding: 9px 0; font-size: 15px; }
  .searchbar .search-clear { display: none; }
  .searchbar.has-value .search-clear { display: grid; place-items: center; }

  .page { padding: 20px clamp(18px, 3vw, 32px) calc(var(--player-h) + 34px); }
  .page-title { font-size: 28px; }

  .tabbar { display: none; }

  .player { bottom: 0; padding: 0 clamp(14px, 2vw, 22px) calc(10px + var(--safe-bottom)); background: linear-gradient(180deg, rgba(10,11,16,.35), rgba(12,14,22,.92) 45%, #0B0D16); }
  .player-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; gap: 20px; padding: 8px 0 10px; align-items: center; }
  .player-progress { margin: 0; }
  .player-progress .seek { margin: -6px 0 0; }
  .np-cover { width: 52px; height: 52px; border-radius: 12px; }
  .np-title { font-size: 14.5px; }
  .player-desktop-controls { display: flex; align-items: center; gap: 10px; justify-self: center; }
  .player-time { display: block; font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
  .play-mobile { display: none; }

  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
  .drawer { bottom: calc(var(--player-h) + 24px); }

  .np-art { width: min(52vw, 40dvh); max-width: 340px; }
  .now-playing { align-items: center; }
}

/* ══════════════════════════════════════════════════════════════════
   2.1 — витрина, рекомендации, внешние способы входа
   ══════════════════════════════════════════════════════════════════ */

/* ── Витрина: hero ── */
.hero {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 18px;
  margin-bottom: 22px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(108, 140, 255, 0.22), transparent 60%),
    radial-gradient(120% 120% at 100% 100%, rgba(168, 85, 247, 0.18), transparent 60%),
    var(--panel);
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 11, 16, 0.55));
  pointer-events: none;
}
.hero-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 320px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(91, 124, 255, .35), rgba(168, 85, 247, .3));
  box-shadow: var(--shadow-md);
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-info { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; }
.hero-kicker { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.hero-title { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.hero-sub { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 10px; margin-top: 6px; }
.hero-skeleton { margin-bottom: 22px; }
.sk-hero { width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r-xl); }

/* ── Главная / Рекомендации: компактный обзор ── */
.home-head, .rec-head { align-items: center; margin-bottom: 12px; }
.home-head .page-title, .rec-head .page-title { font-size: 22px; }
.home-head .page-sub, .rec-head .page-sub { font-size: 12px; max-width: 520px; }
.home-search { flex: 0 0 auto; padding: 8px 12px; font-size: 12px; }
.home-hero {
  grid-template-columns: minmax(0, 180px) 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px;
  margin-bottom: 18px;
}
.home-hero .hero-art { aspect-ratio: 1; max-height: 180px; border-radius: 14px; }
.home-hero .hero-title {
  font-size: 22px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-hero .hero-sub { font-size: 12px; -webkit-line-clamp: 2; }
.home-hero .hero-actions { margin-top: 2px; }
.home-hero .btn { padding: 8px 12px; font-size: 12px; }
.home-head + .section, .home-head + .hero { margin-top: 0; }
#page .section { margin-bottom: 18px; }
.track-card { cursor: pointer; padding: 8px; gap: 7px; }
.track-card .card-art { border-radius: 12px; }
.track-card .card-title { font-size: 12.5px; }
.track-card .card-sub { font-size: 11px; }
.track-card .card-play {
  width: 32px; height: 32px; right: 7px; bottom: 7px;
  opacity: 0; transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}
.track-card:hover .card-play, .track-card:focus-visible .card-play { opacity: 1; transform: none; }
@media (hover: none) { .track-card .card-play { opacity: 1; transform: none; } }
.rec-stats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rec-stat {
  padding: 4px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--glass);
  color: var(--muted); font-size: 11px; white-space: nowrap;
}
@media (max-width: 700px) {
  .home-head, .rec-head { align-items: flex-start; }
  .home-search { display: none; }
  .home-hero { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .home-hero .hero-art { max-height: 150px; }
  .home-hero .hero-title { font-size: 20px; }
  .rec-stats { justify-content: flex-start; }
}

/* ── Горизонтальные карусели ── */
.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 10px;
  margin: 0 -2px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel .card {
  flex: 0 0 152px;
  width: 152px;
  scroll-snap-align: start;
}
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip-row .chip { flex: 0 0 auto; }

/* ── Плейлист каталога ── */
.playlist-head { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.playlist-cover {
  position: relative;
  width: 128px; height: 128px;
  flex: 0 0 128px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(91,124,255,.35), rgba(168,85,247,.3));
  box-shadow: var(--shadow-sm);
}
.playlist-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.playlist-head-text { flex: 1 1 220px; min-width: 0; }
.playlist-head-text .kicker { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.playlist-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ── Способы входа ── */
.provider-list { display: flex; flex-direction: column; gap: 10px; }
.google-slot { display: flex; justify-content: center; min-height: 44px; align-items: center; }
.google-slot > div { width: 100% !important; }
.google-slot iframe { max-width: 100%; }
.provider-status {
  margin: 0; text-align: center;
  font-size: 12.5px; line-height: 1.4; color: var(--muted);
}
.provider-status.is-loading { color: var(--muted); }
.provider-status.is-ok { color: var(--ok); }
.provider-status.is-error { color: var(--danger); }
.auth-sep {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0;
  color: var(--muted-2); font-size: 12px;
}
.auth-sep::before, .auth-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.login-list {
  display: flex; flex-direction: column;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--glass);
  overflow: hidden;
}
.login-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.login-row:last-child { border-bottom: 0; }
.login-glyph {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}
.login-glyph svg { width: 18px; height: 18px; }
.login-glyph svg path { fill: currentColor; }
.login-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.login-text b { font-size: 14px; font-weight: 650; }
.login-text small { font-size: 12px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  font-size: 11px; font-weight: 650;
  padding: 4px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  white-space: nowrap;
}
.badge.ok { background: rgba(74, 222, 128, 0.14); color: var(--ok); }
.btn-mini {
  font-size: 12px; font-weight: 650;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  white-space: nowrap;
}
.btn-mini.primary { background: var(--grad); border-color: transparent; }

.danger-zone {
  margin-top: 22px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 122, 136, 0.28);
  background: rgba(255, 122, 136, 0.06);
}
.danger-zone .section-title { color: var(--danger); }
.danger-list { margin: 0 0 12px; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.danger-list li { margin-bottom: 2px; }

@media (min-width: 700px) {
  .hero { grid-template-columns: 260px 1fr; align-items: center; padding: 22px; }
  .hero-art { aspect-ratio: 1 / 1; max-height: none; }
  .hero-title { font-size: 32px; }
  .carousel .card { flex-basis: 176px; width: 176px; }
  .playlist-cover { width: 168px; height: 168px; flex-basis: 168px; }
}

@media (min-width: 1024px) {
  .hero { grid-template-columns: 300px 1fr; }
  .carousel .card { flex-basis: 190px; width: 190px; }
  .provider-list { max-width: 420px; }
}

body.auth-route .tabbar { display: none; }
body.auth-route .page { padding-bottom: calc(28px + var(--safe-bottom)); }


/* ══════════════════════════════════════════════════════════════════
   2.1.2 — жесты, закрытие панелей, скрытие мини-плеера
   ══════════════════════════════════════════════════════════════════ */

/* Атрибут hidden всегда побеждает любые display-правила компонентов. */
[hidden] { display: none !important; }

/* ── Ручка и кнопка закрытия bottom sheet ── */
.sheet-grab {
  display: flex; align-items: center; justify-content: center;
  height: 22px;
  margin: -10px 0 4px;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.sheet-grab span {
  display: block;
  width: 40px; height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
}
.sheet-grab:active { cursor: grabbing; }
.sheet-close {
  position: absolute;
  top: 6px; right: 8px;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  z-index: 2;
}
.sheet-close svg { width: 15px; height: 15px; fill: currentColor; }
.sheet-close:active { background: rgba(255, 255, 255, 0.14); }
.sheet-panel.is-dragging { transition: none; }

/* ── Мини-плеер: скрытие и возврат ── */
.player-hide {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 50%;
  color: var(--muted);
}
.player-hide svg { width: 20px; height: 20px; fill: currentColor; }
.player-hide:active { background: rgba(255, 255, 255, 0.09); }
.player.is-dragging { transition: none; }

/* ── Компактный плеер в шапке (когда нижний скрыт) ── */
.mini-now {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 240px;
  margin-left: auto;
  padding: 4px 4px 4px 5px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--glass);
}
body.has-mini-now .account-btn { margin-left: 0; }
body.has-mini-now .brand-mobile-text { display: none; }
.mini-now-open {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; flex: 1 1 auto; text-align: left;
}
.mini-now-cover {
  position: relative;
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(91,124,255,.35), rgba(168,85,247,.3));
}
.mini-now-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-now-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.mini-now-title {
  display: block; overflow: hidden; white-space: nowrap;
  font-size: 12.5px; font-weight: 650; line-height: 1.3; color: var(--text);
}
.mini-now-run { display: inline-flex; max-width: none; }
.mini-now-line { display: inline-block; padding-right: 26px; }
.mini-now.is-scrolling .mini-now-run { animation: mini-marquee 12s linear infinite; will-change: transform; }
@keyframes mini-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.mini-now-artist {
  display: block;
  font-size: 11px; line-height: 1.2; color: var(--muted-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini-now-play {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91,124,255,.28);
}
.mini-now-play svg { width: 16px; height: 16px; fill: currentColor; }
.mini-now-play .i-pause { display: none; }
.mini-now.is-playing .mini-now-play .i-play { display: none; }
.mini-now.is-playing .mini-now-play .i-pause { display: block; }
.mini-now-play .spinner { display: none; }
.mini-now.is-loading .mini-now-play svg { display: none; }
.mini-now.is-loading .mini-now-play .spinner { display: block; }
.mini-now-play:disabled { opacity: .45; }

@media (prefers-reduced-motion: reduce) {
  .mini-now.is-scrolling .mini-now-run { animation: none; }
  .mini-now-title { text-overflow: ellipsis; }
}

@media (min-width: 700px) {
  .mini-now { max-width: 260px; flex: 0 0 240px; }
}

/* Плеер не прокручивается — вертикальный жест целиком наш. */
.player { touch-action: none; }

/* ══════════════════════════════════════════════════════════════════
   2.3 — Desktop-first: боковая панель, правая панель очереди,
   полноценный нижний плеер
   ══════════════════════════════════════════════════════════════════ */

:root {
  --sidebar-w: 252px;
  --queue-w: 336px;
}

/* ── Элементы, существующие только на десктопе ── */
.topbar-nav,
.topbar-title,
.player-like,
.player-right,
.sidebar-toggle,
.queue-toggle { display: none; }

/* ── Правая панель: на планшете и телефоне открывается поверх ── */
.queue-panel {
  /* Панель существует, но по умолчанию полностью скрыта: показывается только
     классом body.queue-open. Атрибут hidden дублирует состояние для a11y. */
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: calc(var(--player-h) + var(--tabbar-h) + var(--safe-bottom));
  width: min(90vw, 340px);
  z-index: 88;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px calc(18px + var(--safe-bottom));
  background: rgba(14, 17, 30, 0.97);
  border-left: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--shadow-md);
  overflow-y: auto;
}
.queue-panel[hidden] { display: none !important; }
body.queue-open .queue-panel { display: flex; }
.queue-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.queue-panel-kicker { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); font-weight: 700; }
.queue-panel-title { font-size: 16px; font-weight: 750; margin-top: 4px; line-height: 1.25; }
.queue-panel-sub { font-size: 12.5px; color: var(--muted-2); margin-top: 2px; }
.queue-panel-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(91,124,255,.35), rgba(168,85,247,.3));
  box-shadow: var(--shadow-sm);
}
.queue-panel-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.queue-panel-actions { display: flex; gap: 8px; }
.queue-panel-list-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-2); font-weight: 700;
  padding-top: 4px; border-top: 1px solid var(--border);
}
.queue-panel-count { color: var(--muted); }
.queue-panel-list { display: flex; flex-direction: column; gap: 2px; }
.queue-panel-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 12px; text-align: left; width: 100%;
  color: var(--text);
}
.queue-panel-row:hover { background: var(--glass); }
.queue-panel-row.is-current { background: linear-gradient(135deg, rgba(108,140,255,.2), rgba(168,85,247,.16)); }
.queue-panel-row .qp-cover { width: 34px; height: 34px; border-radius: 9px; overflow: hidden; flex: none; position: relative; background: rgba(255,255,255,.06); }
.queue-panel-row .qp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.queue-panel-row .qp-meta { min-width: 0; flex: 1; }
.queue-panel-row .qp-name { display: block; font-size: 13px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-panel-row .qp-artist { display: block; font-size: 11.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-panel-row .qp-index { font-size: 11px; color: var(--muted-2); width: 18px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }

/* ── Кнопки в нижней части сайдбара ── */
.side-foot { display: flex; flex-direction: column; gap: 8px; }
.side-foot-actions { display: none; gap: 6px; }
.side-mini {
  flex: 1;
  display: grid; place-items: center;
  height: 36px; border-radius: 11px;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--border);
  transition: color .18s ease, background .18s ease;
}
.side-mini svg { width: 17px; height: 17px; fill: currentColor; }
.side-mini:hover { color: var(--text); background: var(--glass-strong); }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 12px; }

/* ── Плеер: мобильные элементы правой группы не показываем ── */
.volume { display: none; }

/* ══════════════════ Планшет и десктоп ══════════════════ */
@media (min-width: 1024px) {
  :root { --sidebar-w: 264px; --queue-w: 336px; --player-h: 92px; }

  body.sidebar-collapsed { --sidebar-w: 78px; }

  .app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100dvh;
    align-items: start;
  }
  body.queue-open .app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--queue-w); }

  /* Сайдбар */
  .sidebar { gap: 14px; padding: 18px 12px 14px; }
  .side-nav { flex: 1; min-height: 0; overflow-y: auto; gap: 14px; padding-right: 2px; }
  .side-group { display: flex; flex-direction: column; gap: 2px; }
  .side-group-title {
    font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
    color: var(--muted-2); font-weight: 700; margin: 4px 10px 6px;
  }
  .side-item { padding: 9px 11px; font-size: 13.5px; }
  .side-block { flex: 0 1 auto; max-height: 34vh; }
  .side-foot { margin-top: auto; }
  .side-foot-actions { display: flex; }

  /* Свёрнутый сайдбар: только иконки */
  body.sidebar-collapsed .side-brand-text,
  body.sidebar-collapsed .side-group-title,
  body.sidebar-collapsed .side-item span,
  body.sidebar-collapsed .side-block,
  body.sidebar-collapsed .side-account-text { display: none; }
  body.sidebar-collapsed .side-brand { justify-content: center; padding: 2px 0 4px; }
  body.sidebar-collapsed .side-item { justify-content: center; padding: 10px 0; }
  body.sidebar-collapsed .side-item svg { width: 20px; height: 20px; }
  body.sidebar-collapsed .side-account { justify-content: center; padding: 8px 0; }
  body.sidebar-collapsed .side-foot-actions { flex-direction: column; }

  /* Топбар */
  .topbar { position: sticky; top: 0; }
  .topbar-nav { display: flex; gap: 4px; }
  .icon-btn.subtle { background: transparent; border-color: transparent; }
  .icon-btn.subtle:hover { background: var(--glass); border-color: var(--border); color: var(--text); }
  .topbar-title {
    display: block;
    font-size: 17px; font-weight: 750; letter-spacing: -0.01em;
    margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 22vw;
  }
  .sidebar-toggle { display: grid; }
  .queue-toggle { display: grid; }
  .mini-now { max-width: 260px; flex: 0 1 260px; }

  /* Правая панель встаёт третьей колонкой (видимость — только body.queue-open) */
  .queue-panel {
    position: sticky;
    top: 0;
    bottom: auto;
    height: calc(100dvh - var(--player-h));
    width: auto;
    box-shadow: none;
  }

  /* Контент */
  .page { padding: 22px clamp(18px, 2.4vw, 34px) calc(var(--player-h) + 30px); max-width: 1720px; }
  .page-title { font-size: 30px; }

  /* Плеер: три зоны */
  .player { padding: 0 clamp(16px, 1.6vw, 26px) 10px; }
  .player-progress { margin: 0 -4px 2px; }
  .player-progress .seek { margin: -4px 0 0; height: 12px; }
  .player-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 1.1fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 2px 18px;
    padding: 2px 0 4px;
  }
  button.np-open { grid-column: 1; grid-row: 1 / span 2; padding-right: 56px; }
  .player-like { display: grid; grid-column: 1; grid-row: 1 / span 2; justify-self: end; }
  .player-like .i-heart-filled { display: none; }
  .player-like.is-on .i-heart { display: none; }
  .player-like.is-on .i-heart-filled { display: block; color: var(--danger); }
  .player-desktop-controls { display: flex; grid-column: 2; grid-row: 1; justify-self: center; align-items: center; }
  .player-desktop-controls .ctrl { width: 40px; height: 40px; }
  .player-desktop-controls .ctrl.play { width: 46px; height: 46px; }
  .player-time { display: block; grid-column: 2; grid-row: 2; justify-self: center; font-size: 11.5px; }
  .player-hide { display: grid; grid-column: 2; grid-row: 2; justify-self: end; align-self: center; width: 28px; height: 28px; }
  .player-right {
    display: flex; align-items: center; gap: 10px;
    grid-column: 3; grid-row: 1 / span 2; justify-self: end;
  }
  .player-hide { display: grid; }
  .player-volume-btn { display: grid; }
  .volume {
    display: block;
    width: 96px;
    -webkit-appearance: none; appearance: none;
    height: 18px; background: transparent; cursor: pointer;
  }
  .volume::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--blue), var(--violet)) 0 / var(--vol-fill, 100%) 100% no-repeat, rgba(255,255,255,.16); }
  .volume::-moz-range-track { height: 3px; border-radius: 3px; background: rgba(255,255,255,.16); }
  .volume::-moz-range-progress { height: 3px; border-radius: 3px; background: var(--grad); }
  .volume::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #fff; margin-top: -4px; }
  .volume::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: #fff; }
  .volume.is-muted::-webkit-slider-runnable-track { background: rgba(255,255,255,.16); }
  .volume-btn .i-vol-off { display: none; }
  .volume-btn.is-muted .i-vol-on { display: none; }
  .volume-btn.is-muted .i-vol-off { display: block; }
  #volumeBtn .i-vol-off { display: none; }
  #volumeBtn.is-muted .i-vol-on { display: none; }
  #volumeBtn.is-muted .i-vol-off { display: block; }

  /* Сетка карточек */
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 18px; }
  .carousel { gap: 16px; }
  .carousel .card { flex-basis: 190px; width: 190px; }
}

@media (min-width: 1280px) {
  :root { --sidebar-w: 276px; --queue-w: 348px; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

@media (min-width: 1600px) {
  :root { --sidebar-w: 288px; --queue-w: 360px; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(206px, 1fr)); }
  .carousel .card { flex-basis: 206px; width: 206px; }
}

@media (min-width: 1920px) {
  .page { padding-left: 40px; padding-right: 40px; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); }
}

/* Планшет: сайдбар сворачивается, правая панель — оверлеем */
@media (min-width: 700px) and (max-width: 1023px) {
  .side-foot-actions { display: flex; }
}

/* Строка трека: пять ячеек (номер, обложка, текст, длительность, действия) —
   иначе на широких экранах ячейки переносились во вторую строку и список «пух». */
@media (min-width: 700px) {
  .track { grid-template-columns: 32px 46px minmax(0, 1fr) auto auto; gap: 12px; }
}
@media (min-width: 1024px) {
  .track { padding: 6px 10px; border-radius: 12px; }
  .track-title { font-size: 14px; }
  .track-sub { font-size: 12.5px; }
  .track-dur { font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════════════
   2.4 — Две самостоятельные presentation-среды: Desktop UI и Mobile UI
   Единственный переключатель — html[data-ui], его выставляет web/device.js
   по совокупности признаков устройства. Ширина окна больше не определяет
   среду: телефон в ландшафте и планшет остаются в Mobile UI.
   ══════════════════════════════════════════════════════════════════ */

/* ── Изоляция: элементы чужой среды полностью убраны из вёрстки ──
   display:none исключает их из hit testing и не даёт перехватывать события. */
html[data-ui="desktop"] [data-ui-only="mobile"],
html[data-ui="mobile"] [data-ui-only="desktop"] { display: none !important; }

/* ───────────────────────── Mobile UI ───────────────────────── */
html[data-ui="mobile"] { --tabbar-h: 58px; }

html[data-ui="mobile"] .app { display: block; min-height: 0; }
html[data-ui="mobile"] .sidebar { display: none; }
html[data-ui="mobile"] .tabbar { display: grid; }
html[data-ui="mobile"] .brand-mobile { display: flex; }
html[data-ui="mobile"] .searchbar { display: none; }
html[data-ui="mobile"] .topbar { height: calc(var(--topbar-h) + var(--safe-top)); padding: var(--safe-top) 14px 0; gap: 10px; }
html[data-ui="mobile"] .page { max-width: none; padding: 14px 14px calc(var(--player-h) + var(--tabbar-h) + var(--safe-bottom) + 20px); }
html[data-ui="mobile"] .page-title { font-size: 24px; }
html[data-ui="mobile"] .grid-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
html[data-ui="mobile"] .carousel .card { flex: 0 0 152px; width: 152px; }
html[data-ui="mobile"] .hero { grid-template-columns: 1fr; padding: 18px; }
html[data-ui="mobile"] .hero-art { max-height: 320px; }
html[data-ui="mobile"] .playlist-cover { width: 128px; height: 128px; flex: 0 0 128px; }
html[data-ui="mobile"] .track { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; padding: 7px 6px 7px 7px; }
html[data-ui="mobile"] .track-index,
html[data-ui="mobile"] .track-dur { display: none; }
html[data-ui="mobile"] .player { bottom: calc(var(--tabbar-h) + var(--safe-bottom)); padding: 0 10px 8px; }
html[data-ui="mobile"] .player-row { display: flex; align-items: center; gap: 10px; padding: 0; }
html[data-ui="mobile"] .player-progress { margin: 0 -10px 2px; }
html[data-ui="mobile"] .player-desktop-controls,
html[data-ui="mobile"] .player-time { display: none; }
html[data-ui="mobile"] .play-mobile { display: grid; }
html[data-ui="mobile"] .queue-panel {
  position: fixed; top: 0; right: 0;
  bottom: calc(var(--player-h) + var(--tabbar-h) + var(--safe-bottom));
  left: auto; width: min(90vw, 340px); height: auto;
  box-shadow: var(--shadow-md);
}

/* Ниже 1024 px прежняя адаптивная раскладка остаётся: десктопная среда
   показывает навигацию таббаром (сайдбар в этой ширине скрыт), как и раньше. */
@media (max-width: 1023px) {
  html[data-ui="desktop"] .tabbar { display: grid; }
}

/* ══════════════════════════════════════════════════════════════════
   Текст песни (Lyrics Sync)

   Всё новое оформление изолировано по средам: правила для десктопной
   панели начинаются с html[data-ui="desktop"], для мобильного слоя —
   с html[data-ui="mobile"] и не могут изменить чужие компоненты.
   ══════════════════════════════════════════════════════════════════ */

/* ── Общие элементы (существуют только внутри lyrics-контейнеров) ── */
.lyrics-scroll {
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.lyrics-scroll::-webkit-scrollbar { width: 6px; }
.lyrics-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 6px; }
.lyrics-scroll:focus-visible { outline: 2px solid rgba(108, 140, 255, 0.55); outline-offset: 2px; }

.lyrics-line {
  margin: 0;
  border-radius: 10px;
  color: var(--muted-2);
  font-weight: 600;
  line-height: 1.38;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}
.lyrics-line:hover { color: var(--text); }
.lyrics-line.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(108, 140, 255, 0.22), rgba(168, 85, 247, 0.16));
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.22);
}
.lyrics-line:focus-visible { outline: 2px solid rgba(108, 140, 255, 0.6); outline-offset: 1px; }

.lyrics-plain {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--text);
}
.lyrics-empty { padding: 22px 6px; text-align: center; }
.lyrics-empty-title { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.lyrics-empty-note { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.lyrics-badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(199, 210, 255, 0.92);
  background: rgba(108, 140, 255, 0.14);
  border: 1px solid rgba(108, 140, 255, 0.26);
  white-space: nowrap;
}
.lyrics-return {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(135deg, rgba(108, 140, 255, 0.4), rgba(168, 85, 247, 0.34));
  border: 1px solid rgba(139, 92, 246, 0.5);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}
.lyrics-return[hidden],
.lyrics-badge[hidden] { display: none !important; }

.lyrics-skeleton { display: flex; flex-direction: column; gap: 10px; padding: 12px 6px; }
.lyrics-skeleton-row {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.06));
  background-size: 200% 100%;
  animation: lyricsShimmer 1.5s linear infinite;
}
@keyframes lyricsShimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .lyrics-skeleton-row { animation: none; }
  .lyrics-line { transition: none; }
}

/* ══════════════ Desktop: вкладка «Текст» в правой панели ══════════════ */
html[data-ui="desktop"] .queue-panel-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--border);
}
html[data-ui="desktop"] .qp-tab {
  flex: 1;
  height: 31px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
  transition: color 0.18s ease, background 0.18s ease;
}
html[data-ui="desktop"] .qp-tab:hover { color: var(--text); }
html[data-ui="desktop"] .qp-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(108, 140, 255, 0.28), rgba(168, 85, 247, 0.24));
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.35);
}

html[data-ui="desktop"] .queue-panel.is-lyrics { overflow: hidden; }
html[data-ui="desktop"] .queue-panel.is-lyrics .queue-panel-art,
html[data-ui="desktop"] .queue-panel.is-lyrics .queue-panel-actions,
html[data-ui="desktop"] .queue-panel.is-lyrics .queue-panel-list-head,
html[data-ui="desktop"] .queue-panel.is-lyrics .queue-panel-list { display: none; }

html[data-ui="desktop"] .lyrics-pane {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
}
html[data-ui="desktop"] .lyrics-pane[hidden] { display: none !important; }
html[data-ui="desktop"] .lyrics-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
html[data-ui="desktop"] .lyrics-pane-title {
  min-width: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-ui="desktop"] .lyrics-scroll { flex: 1; min-height: 0; padding: 2px 2px 42px; }
html[data-ui="desktop"] .lyrics-line { padding: 7px 9px; font-size: 14.5px; }
html[data-ui="desktop"] .lyrics-plain { padding: 2px 4px 28px; font-size: 14px; line-height: 1.6; }
html[data-ui="desktop"] .lyrics-pane-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 30px;
}
html[data-ui="desktop"] .lyrics-btn { color: var(--muted); }
html[data-ui="desktop"] .lyrics-btn.is-on { color: #fff; background: rgba(108, 140, 255, 0.18); border-color: rgba(139, 92, 246, 0.4); }

/* ══════════════ Mobile: полноэкранный слой текста ══════════════ */
html[data-ui="mobile"] .lyrics-sheet {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: flex;
  justify-content: center;
  background: rgba(8, 9, 14, 0.94);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(3%);
  transition: opacity 0.26s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1), visibility 0.3s;
  overscroll-behavior: contain;
}
html[data-ui="mobile"] .lyrics-sheet.is-open { opacity: 1; visibility: visible; transform: none; }
html[data-ui="mobile"] .lyrics-sheet.is-dragging { transition: none; }
html[data-ui="mobile"] .lyrics-sheet-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  height: 100dvh;
  padding-top: calc(var(--safe-top) + 4px);
}
html[data-ui="mobile"] .lyrics-sheet-head { display: flex; align-items: center; gap: 10px; padding: 6px 16px 10px; touch-action: none; }
html[data-ui="mobile"] .lyrics-sheet-meta { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
html[data-ui="mobile"] .lyrics-sheet-title {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-ui="mobile"] .lyrics-sheet-grip { width: 34px; height: 4px; flex: none; border-radius: 2px; background: rgba(255, 255, 255, 0.18); }
html[data-ui="mobile"] .lyrics-scroll { flex: 1; min-height: 0; padding: 6px 18px calc(var(--safe-bottom) + 92px); }
html[data-ui="mobile"] .lyrics-line { padding: 9px 10px; font-size: 17.5px; line-height: 1.36; }
html[data-ui="mobile"] .lyrics-plain { padding: 4px 4px calc(var(--safe-bottom) + 80px); font-size: 16px; line-height: 1.62; }
html[data-ui="mobile"] .lyrics-empty { padding: 40px 10px; }
html[data-ui="mobile"] .lyrics-empty-title { font-size: 16px; }
html[data-ui="mobile"] .lyrics-empty-note { font-size: 13.5px; }
html[data-ui="mobile"] .lyrics-sheet-foot {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px calc(var(--safe-bottom) + 12px);
  background: linear-gradient(180deg, rgba(8, 9, 14, 0), rgba(8, 9, 14, 0.92) 42%);
}
html[data-ui="mobile"] .lyrics-badge { align-self: flex-start; }

/* ── Word-level karaoke: подсвечивается только текущее слово ── */
.lyrics-line.has-words {
  /* Внутренние отступы компенсируются отрицательными полями, поэтому
     появление фона у слова не меняет ширину и высоту строки. */
  padding: 9px 10px;
}
.lyrics-line.has-words.is-active {
  color: var(--muted-2);
  background: none;
  box-shadow: none;
}
.lyrics-word {
  display: inline;
  padding: 1px 4px;
  margin: -1px -4px;
  border-radius: 6px;
  transition: color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.lyrics-line.has-words .lyrics-word:hover { color: var(--text); }
.lyrics-word.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(108, 140, 255, 0.46), rgba(168, 85, 247, 0.38));
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.55);
}
html[data-ui="desktop"] .lyrics-line.has-words { padding: 7px 9px; }
html[data-ui="mobile"] .lyrics-line.has-words { padding: 9px 10px; }
html[data-ui="mobile"] .lyrics-word { padding: 1px 5px; margin: -1px -5px; }
@media (prefers-reduced-motion: reduce) {
  .lyrics-word { transition: none; }
}

/* ── RH Smart Mix: карточка настройки и кнопки плеера ── */
.smartmix-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--glass);
}
.smartmix-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.smartmix-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.smartmix-text b { font-size: 14px; font-weight: 700; }
.smartmix-text small { font-size: 12px; color: var(--muted); }
.smartmix-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.smartmix-presets .chip { padding: 6px 12px; font-size: 12px; }
.smartmix-btn.is-on { color: #fff; background: rgba(108, 140, 255, 0.18); border-color: rgba(139, 92, 246, 0.4); }
html[data-ui="mobile"] .smartmix-card { padding: 12px; }
.smartmix-subrow { display: flex; gap: 6px; flex-wrap: wrap; }
.smartmix-subrow .chip { padding: 6px 12px; font-size: 12px; }

/* ── AI AutoMix ───────────────────────────────────────────────── */
.automix-btn { position: relative; gap: 6px; }
.automix-btn .automix-label { font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.automix-btn.is-on { color: #fff; background: rgba(108, 140, 255, 0.2); border-color: rgba(139, 92, 246, 0.45); box-shadow: 0 0 18px rgba(108, 140, 255, .22); }
.automix-btn[data-phase="LOADING"] { animation: automixPulse 1.1s ease-in-out infinite; }
.automix-btn[data-phase="MIXING"] { color: #fff; background: rgba(139, 92, 246, 0.32); }

/* Красный крестик поверх недоступной кнопки (Текст / AutoMix). */
.automix-btn.is-unavailable::after,
.np-extra.is-unavailable::after {
  content: '✕';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  color: #ff4658;
  background: rgba(8, 10, 18, .38);
  font: 900 20px/1 system-ui, -apple-system, sans-serif;
  text-shadow: 0 0 7px rgba(0, 0, 0, .95), 0 0 12px rgba(255, 70, 88, .65);
  pointer-events: none;
}
.automix-btn.is-unavailable svg,
.automix-btn.is-unavailable .automix-label,
.np-extra.is-unavailable svg { opacity: .22; }
@keyframes automixPulse { 0%,100% { opacity: .65; } 50% { opacity: 1; } }


/* ── AI AutoMix transition band on seek bars ─────────────────── */
.player-progress, .np-progress { position: relative; }
.player-progress::after, .np-progress::after {
  content: '';
  position: absolute;
  left: var(--mix-start, 0%);
  width: var(--mix-width, 0%);
  top: 10px;
  height: 5px;
  transform: translateY(-50%);
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(108,140,255,.85) 0 var(--mix-progress,0%), rgba(139,92,246,.34) var(--mix-progress,0%) 100%);
  box-shadow: 0 0 10px rgba(108,140,255,.45);
  border-left: 2px solid rgba(160,190,255,.95);
  border-right: 2px solid rgba(160,190,255,.95);
  opacity: var(--mix-opacity, 0);
  pointer-events: none;
  transition: opacity .2s ease, left .2s ease, width .2s ease;
  z-index: 0;
}
.player-progress .seek, .np-progress .seek { position: relative; z-index: 1; }
.ai-mix-status { display: block; margin-top: 2px; font-size: 10px; font-weight: 700; letter-spacing: .02em; color: #cfd8ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-mix-status[hidden] { display: none; }


/* ── AI Mix Beta ─────────────────────────────────────────────── */
.betamix-btn { font-size: 10px; font-weight: 800; letter-spacing: .06em; color: #d8c7ff; border: 1px solid rgba(180,140,255,.35); border-radius: 8px; padding: 4px 7px; }
.betamix-btn.is-on { color: #fff; background: rgba(139,92,246,.3); box-shadow: 0 0 15px rgba(139,92,246,.3); }


/* ── AI Mix Beta transition band ─────────────────────────────── */
.player-progress::before, .np-progress::before {
  content: '';
  position: absolute;
  left: var(--beta-mix-start, 0%);
  width: var(--beta-mix-width, 0%);
  top: 10px;
  height: 5px;
  transform: translateY(-50%);
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,107,53,.9) 0 var(--beta-mix-progress,0%), rgba(255,107,53,.28) var(--beta-mix-progress,0%) 100%);
  box-shadow: 0 0 10px rgba(255,107,53,.35);
  border-left: 2px solid rgba(255,170,120,.95);
  border-right: 2px solid rgba(255,170,120,.95);
  opacity: var(--beta-mix-opacity, 0);
  pointer-events: none;
  z-index: 0;
}
.ai-mix-status.beta { color: #ffd3bd; }


/* ── AI Mix Beta dual waveform ───────────────────────────────── */
.beta-viz { display: grid; gap: 4px; margin: 8px 0 2px; }
.beta-viz canvas { width: 100%; height: 34px; display: block; border-radius: 6px; background: rgba(255,255,255,.025); }
.beta-viz[hidden] { display: none; }


.betamix2-btn { font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #cfd8ff; border: 1px solid rgba(108,140,255,.45); border-radius: 8px; padding: 4px 6px; }
.betamix2-btn.is-on { color: #fff; background: rgba(108,140,255,.3); box-shadow: 0 0 15px rgba(108,140,255,.3); }


/* ── Neural AI DJ ring around the play button ─────────────────── */
.ctrl.play { position: relative; }
.ctrl.play::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(var(--ai-ring-color, #7CFFCB) calc(var(--ai-ring-progress, 0) * 1turn), rgba(255,255,255,.08) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, background .35s ease;
  z-index: 3;
}
body[data-ai-phase="ACTIVE"] .ctrl.play::before,
body[data-ai-phase="READY"] .ctrl.play::before { opacity: .45; }
body[data-ai-phase="ANALYZING"] .ctrl.play::before,
body[data-ai-phase="PREPARING"] .ctrl.play::before {
  opacity: 1;
  background: conic-gradient(var(--ai-ring-color, #6C8CFF) 0 25%, rgba(255,255,255,.12) 25% 100%);
  animation: ai-ring-spin 1.4s linear infinite;
}
body[data-ai-phase="MIXING"] .ctrl.play::before { opacity: 1; }
body[data-ai-phase="DEGRADED"] .ctrl.play::before { opacity: .7; }
body[data-ai-phase="ERROR"] .ctrl.play::before { opacity: .55; }
@keyframes ai-ring-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  body[data-ai-phase="ANALYZING"] .ctrl.play::before,
  body[data-ai-phase="PREPARING"] .ctrl.play::before { animation: none; }
}


/* explicit Neural AI ring element (button pseudo-elements are unreliable in WebKit) */
.ctrl.play::before { content: none !important; }
.ai-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(var(--ai-ring-color, #7CFFCB) calc(var(--ai-ring-progress, 0) * 1turn), rgba(255,255,255,.08) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease, background .35s ease;
  z-index: 3;
}
body[data-ai-phase="ACTIVE"] .ai-ring,
body[data-ai-phase="READY"] .ai-ring { opacity: .45; }
body[data-ai-phase="ANALYZING"] .ai-ring,
body[data-ai-phase="PREPARING"] .ai-ring {
  opacity: 1;
  background: conic-gradient(var(--ai-ring-color, #6C8CFF) 0 25%, rgba(255,255,255,.12) 25% 100%);
  animation: ai-ring-spin 1.4s linear infinite;
}
body[data-ai-phase="MIXING"] .ai-ring { opacity: 1; }
body[data-ai-phase="DEGRADED"] .ai-ring { opacity: .7; }
body[data-ai-phase="ERROR"] .ai-ring { opacity: .55; }
@media (prefers-reduced-motion: reduce) {
  body[data-ai-phase="ANALYZING"] .ai-ring,
  body[data-ai-phase="PREPARING"] .ai-ring { animation: none; }
}

/* Neural AutoMix circular progress: real MIXING only */
.ai-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(var(--ai-ring-color, #9B6BFF) calc(var(--ai-ring-progress, 0) * 1turn), rgba(120,160,255,.10) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  z-index: 3;
  filter: drop-shadow(0 0 6px rgba(108,140,255,.35));
}
.ai-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(140,170,255,.16);
}
.ai-ring-orbit {
  position: absolute;
  inset: 0;
  transform: rotate(calc(var(--ai-ring-progress, 0) * 1turn));
  transition: transform .18s linear;
}
.ai-ring-dot {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #e8f1ff;
  box-shadow: 0 0 7px 2px rgba(108,140,255,.8);
  opacity: 0;
  transition: opacity .2s ease;
}
body[data-ai-phase="MIXING"] .ai-ring { opacity: 1; }
body[data-ai-phase="MIXING"] .ai-ring-dot { opacity: 1; }
body[data-ai-phase="PREPARING"] .ai-ring,
body[data-ai-phase="ANALYZING"] .ai-ring { opacity: .22; }
body[data-ai-phase="ACTIVE"] .ai-ring,
body[data-ai-phase="READY"] .ai-ring { opacity: 0; }
body[data-ai-ring-done="1"] .ai-ring {
  opacity: 1;
  animation: ai-ring-finish .65s ease-out forwards;
}
body[data-ai-ring-done="1"] .ai-ring-dot { opacity: 0; }
@keyframes ai-ring-finish {
  0% { opacity: 1; transform: scale(1); }
  55% { opacity: .9; transform: scale(1.06); }
  100% { opacity: 0; transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-ring, .ai-ring-orbit, .ai-ring-dot { transition: none; }
  body[data-ai-ring-done="1"] .ai-ring { animation: none; opacity: .6; }
}

/* ── AutoMix RH AI progress around the three-button Now Playing control ── */
.np-controls { position: relative; isolation: isolate; }
.np-mix-ring {
  position: absolute;
  left: -12px;
  top: -8px;
  width: calc(100% + 24px);
  height: calc(100% + 16px);
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transition: opacity .28s ease;
  z-index: 0;
  filter: drop-shadow(0 0 6px rgba(108,140,255,.35));
}
.np-controls > button { position: relative; z-index: 1; }
.np-mix-base {
  fill: none;
  stroke: rgba(140,170,255,.18);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}
.np-mix-fill {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100px - var(--np-mix-progress, 0) * 100px);
  vector-effect: non-scaling-stroke;
}
.np-mix-tip {
  fill: none;
  stroke: #e8f1ff;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 1.1 98.9;
  stroke-dashoffset: calc(var(--np-mix-progress, 0) * -100px);
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgba(150,190,255,.9));
}
body[data-ai-phase="MIXING"] .np-mix-ring { opacity: 1; }
body[data-ai-ring-done="1"] .np-mix-ring {
  opacity: 1;
  animation: np-ring-finish .65s ease-out forwards;
}
@keyframes np-ring-finish {
  0% { opacity: 1; transform: scale(1); }
  55% { opacity: .9; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.01); }
}
@media (prefers-reduced-motion: reduce) {
  .np-mix-fill, .np-mix-ring { transition: none; }
  body[data-ai-ring-done="1"] .np-mix-ring { animation: none; opacity: .6; }
}

/* AutoMix RH AI progress: circle around the central #npPlay only */
#npPlay { overflow: visible; }
.np-play-wrap > .np-play-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 82px !important;
  height: 82px !important;
  transform: translate(-50%, -50%);
  pointer-events: none;
  overflow: visible;
  opacity: 0;
  transition: opacity .28s ease;
  z-index: 3;
  filter: drop-shadow(0 0 6px rgba(108,140,255,.4));
}
.np-play-wrap > .np-play-ring path { fill: none !important; }
.np-play-base {
  stroke: rgba(140,170,255,.18);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}
.np-play-fill {
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100px - var(--np-mix-progress, 0) * 100px);
  vector-effect: non-scaling-stroke;
}
.np-play-tip {
  stroke: #e8f1ff;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 1.1 98.9;
  stroke-dashoffset: calc(var(--np-mix-progress, 0) * -100px);
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 4px rgba(150,190,255,.9));
}
body[data-ai-phase="MIXING"] .np-play-wrap > .np-play-ring { opacity: 1; }
body[data-ai-ring-done="1"] .np-play-wrap > .np-play-ring {
  opacity: 1;
  animation: np-play-ring-finish .65s ease-out forwards;
}
@keyframes np-play-ring-finish {
  0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
  55% { opacity: .9; transform: translate(-50%,-50%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .np-play-fill, .np-play-wrap > .np-play-ring { transition: none; }
  body[data-ai-ring-done="1"] .np-play-wrap > .np-play-ring { animation: none; opacity: .6; }
}


.np-play-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  place-items: center;
}


@media (prefers-reduced-motion: reduce) {
  .np-art img.np-cover-layer, .np-info { transition: none !important; }
  .np-art img.np-cover-layer.is-active { transform: none; }
  .np-info.is-changing { opacity: 1; transform: none; }
}

/* ── Cinematic track transition in Now Playing ───────────────── */
.np-art {
  --np-glow-rgb: 108, 140, 255;
  --np-glow2-rgb: 168, 85, 247;
  transition: box-shadow 1.6s ease;
}
.np-art.is-cinema {
  box-shadow:
    0 24px 70px rgba(0,0,0,.55),
    0 0 28px rgba(var(--np-glow-rgb), .38),
    0 0 60px rgba(var(--np-glow2-rgb), .20);
}
.np-cinema-glow,
.np-cinema-burst,
.np-cinema-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
}
.np-cinema-glow {
  z-index: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(var(--np-glow-rgb), .55), transparent 58%),
    radial-gradient(circle at 75% 70%, rgba(var(--np-glow2-rgb), .45), transparent 62%);
  transition: opacity 1.4s ease;
}
.np-art.is-cinema .np-cinema-glow { opacity: .75; }
.np-cinema-burst {
  z-index: 4;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.95), rgba(var(--np-glow-rgb),.65) 18%, rgba(var(--np-glow2-rgb),.28) 38%, transparent 64%);
  mix-blend-mode: screen;
}
.np-art.is-burst .np-cinema-burst { animation: np-light-burst 1.45s cubic-bezier(.15,.7,.2,1) forwards; }
.np-cinema-particles { z-index: 5; overflow: hidden; }
.np-cinema-particles i {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgb(var(--np-glow-rgb));
  box-shadow: 0 0 8px 2px rgba(var(--np-glow-rgb), .75);
  opacity: 0;
  transform: translate3d(0,0,0) scale(.6);
}
.np-art.is-burst .np-cinema-particles i { animation: np-particle-drift 1.8s ease-out forwards; }
.np-cinema-particles i:nth-child(1) { left: 18%; top: 72%; animation-delay: .02s; }
.np-cinema-particles i:nth-child(2) { left: 34%; top: 82%; animation-delay: .08s; background: rgb(var(--np-glow2-rgb)); }
.np-cinema-particles i:nth-child(3) { left: 52%; top: 76%; animation-delay: .04s; }
.np-cinema-particles i:nth-child(4) { left: 68%; top: 80%; animation-delay: .12s; background: rgb(var(--np-glow2-rgb)); }
.np-cinema-particles i:nth-child(5) { left: 78%; top: 64%; animation-delay: .06s; }
.np-cinema-particles i:nth-child(6) { left: 44%; top: 88%; animation-delay: .15s; }
.np-art.is-cinema .np-cover-layer.is-cinema-in {
  animation: np-cover-arrive 1.6s cubic-bezier(.16,.75,.2,1) .24s both;
}
.np-art.is-cinema .np-cover-layer.is-leaving {
  animation: np-cover-depart 1.05s cubic-bezier(.4,0,.6,1) both;
}
.np-info.is-cinema-text .np-song { animation: np-title-reveal 1.1s cubic-bezier(.16,.75,.2,1) both; }
.np-info.is-cinema-text .np-singer { animation: np-artist-reveal .95s cubic-bezier(.16,.75,.2,1) .28s both; }

@keyframes np-cover-arrive {
  0% { opacity: 0; transform: scale(1.10); filter: blur(12px) saturate(1.12); }
  55% { opacity: 1; filter: blur(1.5px) saturate(1.04); }
  100% { opacity: 1; transform: scale(1); filter: blur(0) saturate(1); }
}
@keyframes np-cover-depart {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  100% { opacity: 0; transform: scale(1.14) translate3d(-1.2%, -1%, 0); filter: blur(10px); }
}
@keyframes np-light-burst {
  0% { opacity: 0; transform: scale(.72); }
  28% { opacity: .95; }
  100% { opacity: 0; transform: scale(1.20); }
}
@keyframes np-particle-drift {
  0% { opacity: 0; transform: translate3d(0, 12px, 0) scale(.5); }
  25% { opacity: .9; }
  100% { opacity: 0; transform: translate3d(0, -28px, 0) scale(1.1); }
}
@keyframes np-title-reveal {
  0% { opacity: 0; transform: translateY(8px); filter: blur(6px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes np-artist-reveal {
  0% { opacity: 0; transform: translateY(6px); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (prefers-reduced-motion: reduce) {
  .np-art.is-cinema { box-shadow: 0 24px 60px rgba(0,0,0,.55); }
  .np-art.is-cinema .np-cover-layer.is-active,
  .np-art.is-cinema .np-cover-layer.is-leaving,
  .np-info.is-cinema-text .np-song,
  .np-info.is-cinema-text .np-singer { animation: none !important; }
  .np-art.is-burst .np-cinema-burst,
  .np-art.is-burst .np-cinema-particles i { animation: none !important; opacity: 0 !important; }
}

/* ══════════════════════════════════════════════════════════════════
   RH-MUSIC Motion System 1.0
   Central tokens + unified interaction presets. Visual layer only.
   ══════════════════════════════════════════════════════════════════ */
:root {
  --motion-instant: 90ms;
  --motion-micro: 130ms;
  --motion-ui: 180ms;
  --motion-popover: 220ms;
  --motion-modal: 280ms;
  --motion-panel: 320ms;
  --motion-page: 220ms;
  --ease-standard: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  --ease-soft: cubic-bezier(.22, .61, .36, 1);
}

/* Unified interaction feedback */
:where(button, .btn, .chip, .tab, .side-item, .ctrl, .icon-btn, .row-btn, .card, .track, .sheet-item, .queue-panel, .search-field) {
  transition-property: background-color, color, border-color, opacity, transform, box-shadow, filter;
  transition-duration: var(--motion-ui), var(--motion-ui), var(--motion-ui), var(--motion-ui), var(--motion-micro), var(--motion-ui), var(--motion-ui);
  transition-timing-function: var(--ease-standard), var(--ease-standard), var(--ease-standard), var(--ease-standard), var(--ease-out), var(--ease-standard), var(--ease-standard);
}
:where(button, .btn, .chip, .ctrl, .icon-btn, .row-btn, .tab, .side-item, .sheet-item):active {
  transform: scale(.975);
}
:where(.card, .track):active { transform: scale(.992); }

/* Page/content reveal */
#page > :where(.page-head, .hero, .detail, .notice, .empty, .chip-row, .search-intro) {
  animation: rh-page-in var(--motion-page) var(--ease-out) both;
}
@keyframes rh-page-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

/* Lists: keep entrance subtle and capped */
.track-list .track,
.carousel .card,
.grid-cards .card {
  animation-duration: var(--motion-page);
  animation-timing-function: var(--ease-out);
}
.track-list .track,
.carousel .card,
.grid-cards .card {
  animation-fill-mode: backwards;
}
.track-list .track:nth-child(1), .carousel .card:nth-child(1) { animation-delay: 0ms; }
.track-list .track:nth-child(2), .carousel .card:nth-child(2) { animation-delay: 18ms; }
.track-list .track:nth-child(3), .carousel .card:nth-child(3) { animation-delay: 36ms; }
.track-list .track:nth-child(4), .carousel .card:nth-child(4) { animation-delay: 54ms; }
.track-list .track:nth-child(5), .carousel .card:nth-child(5) { animation-delay: 72ms; }
.track-list .track:nth-child(6), .carousel .card:nth-child(6) { animation-delay: 90ms; }
.track-list .track:nth-child(n+11), .carousel .card:nth-child(n+11), .grid-cards .card:nth-child(n+11) { animation-delay: 0ms; }

/* Cards, covers and images */
.card-art img,
.track .cover img,
.playlist-cover img,
.detail-art img,
.hero-art img {
  transition: opacity var(--motion-panel) var(--ease-out), transform var(--motion-panel) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .card { transition: transform var(--motion-ui) var(--ease-out), background var(--motion-ui) var(--ease-standard), border-color var(--motion-ui) var(--ease-standard), box-shadow var(--motion-ui) var(--ease-standard); }
  .card:hover { transform: translateY(-2px); border-color: rgba(108,140,255,.34); box-shadow: 0 12px 30px rgba(0,0,0,.28); }
  .card:hover .card-art img, .card:hover .playlist-cover img { transform: scale(1.035); }
  .track:hover { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.06); }
  .btn-primary:hover { filter: brightness(1.06); }
  .btn-ghost:hover, .chip:hover { background: var(--glass-strong); border-color: rgba(139,92,246,.34); }
  .icon-btn:hover, .ctrl.ghost:hover, .row-btn:hover { color: var(--text); background: rgba(255,255,255,.07); }
  .side-item:hover { color: var(--text); background: var(--glass); }
  .sheet-item:hover { background: var(--glass); }
  .tab:hover { color: var(--muted); }
}

/* Player motion */
.player:is(.player) { transition: transform var(--motion-panel) var(--ease-soft), opacity var(--motion-panel) var(--ease-soft); }
.mini-now { transition: opacity var(--motion-ui) var(--ease-out), transform var(--motion-ui) var(--ease-out); }
@starting-style {
  .mini-now { opacity: 0; transform: translateY(6px); }
  .player:not(.is-hidden) { opacity: 0; transform: translateY(10px); }
}
.now-playing {
  transition: opacity var(--motion-panel) var(--ease-soft), transform var(--motion-panel) var(--ease-soft), visibility var(--motion-panel);
}
.now-playing.is-open { transform: none; }
.ctrl.play .i-play, .ctrl.play .i-pause { transition: opacity var(--motion-micro) var(--ease-out), transform var(--motion-micro) var(--ease-out); }
.ctrl.play:active .i-play, .ctrl.play:active .i-pause { transform: scale(.92); }

/* Sliders and progress */
.volume::-webkit-slider-thumb { transition: box-shadow var(--motion-ui) var(--ease-out); }
.volume:active::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(108,140,255,.22); }

/* Panels, sheets and popovers */
.drawer.is-open, .sheet.is-open .sheet-panel { will-change: transform; }
.drawer { transition: transform var(--motion-panel) var(--ease-soft), visibility var(--motion-panel); }
.sheet { transition: opacity var(--motion-popover) var(--ease-standard), visibility var(--motion-popover); }
.sheet-panel { transition: transform var(--motion-panel) var(--ease-soft), border-radius var(--motion-panel) var(--ease-soft); }
.toast { transition: opacity var(--motion-popover) var(--ease-out), transform var(--motion-popover) var(--ease-out); }
.scrim { transition: opacity var(--motion-panel) var(--ease-soft); }

/* Search and dropdowns */
.search-field { transition: background var(--motion-ui) var(--ease-standard), border-color var(--motion-ui) var(--ease-standard), box-shadow var(--motion-ui) var(--ease-standard), transform var(--motion-ui) var(--ease-out); }
.search-field:focus-within { box-shadow: 0 0 0 3px rgba(108,140,255,.16); }
.suggest, .search-suggest, .dropdown, .ctx-menu, .popover { transition: opacity var(--motion-popover) var(--ease-out), transform var(--motion-popover) var(--ease-out); }

/* Skeletons: one calm shimmer, never on hidden content */
.sk { animation-duration: 1.8s; }
@media (prefers-reduced-motion: reduce) {
  .sk { animation: none !important; background: rgba(255,255,255,.05); }
}

/* Focus */
:where(button, a, input, [tabindex]):focus-visible { outline: 2px solid rgba(108,140,255,.7); outline-offset: 2px; transition: outline-color var(--motion-micro) var(--ease-out); }

/* Reduced motion: keep functionality, remove decoration */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  #page > :where(.page-head, .hero, .detail, .notice, .empty, .chip-row, .search-intro) { animation: none !important; }
  .np-play-ring, .np-mix-ring, .ai-ring { animation: none !important; }
}

/* ══════════════════════════════════════════════════════════════════
   Lyrics Visualizer — кинематографический режим вкладки «Текст»
   ══════════════════════════════════════════════════════════════════ */
.lyrics-pane.is-cinematic,
.lyrics-sheet-inner.is-cinematic { position: relative; overflow: hidden; }
.lyrics-atmosphere {
  position: absolute;
  inset: -18%;
  z-index: 0;
  pointer-events: none;
  background-position: center;
  background-size: cover;
  filter: blur(64px) saturate(150%);
  opacity: 0;
  transform: scale(1.2);
  transition: opacity 1.2s var(--ease-soft, ease), background-image .6s ease;
}
.lyrics-atmosphere.has-art { opacity: .5; }
.lyrics-atmosphere.is-active { opacity: .62; }
.lyrics-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 40%, rgba(108, 140, 255, .2), transparent 70%),
    linear-gradient(180deg, rgba(7, 8, 15, .35), rgba(7, 8, 15, .88));
}
.lyrics-pane.is-cinematic .lyrics-scroll,
.lyrics-sheet-inner.is-cinematic .lyrics-scroll {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding-top: 18px;
  padding-bottom: 34%;
}
.lyrics-pane.is-cinematic .lyrics-line,
.lyrics-sheet-inner.is-cinematic .lyrics-line {
  background: none;
  box-shadow: none;
  transform-origin: left center;
  transition: opacity .5s var(--ease-soft, ease), transform .5s var(--ease-soft, ease), filter .5s var(--ease-soft, ease), color .4s ease;
  will-change: opacity, transform, filter;
}
.lyrics-pane.is-cinematic .lyrics-line.is-prev,
.lyrics-sheet-inner.is-cinematic .lyrics-line.is-prev {
  opacity: .28;
  transform: translateY(-14px) scale(.9);
  filter: blur(2px);
}
.lyrics-pane.is-cinematic .lyrics-line.is-next,
.lyrics-sheet-inner.is-cinematic .lyrics-line.is-next {
  opacity: .34;
  transform: translateY(12px) scale(.94);
  filter: blur(1.2px);
}
.lyrics-pane.is-cinematic .lyrics-line.is-active,
.lyrics-sheet-inner.is-cinematic .lyrics-line.is-active {
  opacity: 1;
  transform: translateY(0) scale(1.04);
  filter: none;
  color: #fff;
  text-shadow: 0 0 34px rgba(108, 140, 255, .35);
}
.lyrics-pane.is-cinematic .lyrics-word,
.lyrics-sheet-inner.is-cinematic .lyrics-word {
  background-image: linear-gradient(
    90deg,
    #fff 0 calc(var(--p, 0) * 100%),
    rgba(255, 255, 255, .34) calc(var(--p, 0) * 100%) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform .35s var(--ease-out, ease), filter .35s ease;
}
.lyrics-pane.is-cinematic .lyrics-word.is-active,
.lyrics-sheet-inner.is-cinematic .lyrics-word.is-active {
  background: none;
  color: #fff;
  transform: translateY(-2px) scale(1.08);
  filter: drop-shadow(0 0 18px rgba(108, 140, 255, .55));
  box-shadow: none;
}
.lyrics-pane.is-cinematic .lyrics-word.is-done,
.lyrics-sheet-inner.is-cinematic .lyrics-word.is-done {
  color: rgba(255, 255, 255, .82);
  filter: none;
}
.lyrics-pane.is-instrumental .lyrics-scroll,
.lyrics-sheet-inner.is-instrumental .lyrics-scroll { opacity: .55; }
.lyrics-pane.is-instrumental .lyrics-scroll::after,
.lyrics-sheet-inner.is-instrumental .lyrics-scroll::after {
  content: "♪";
  display: block;
  margin-top: 18px;
  font-size: 34px;
  color: var(--muted-2);
  animation: lyricsPulse 2.4s ease-in-out infinite;
}
@keyframes lyricsPulse { 0%, 100% { opacity: .35; } 50% { opacity: .9; } }
@media (max-width: 720px) {
  .lyrics-sheet-inner.is-cinematic .lyrics-scroll { gap: 10px; padding-top: 10px; padding-bottom: 40%; }
  .lyrics-sheet-inner.is-cinematic .lyrics-line.is-active { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .lyrics-pane.is-cinematic .lyrics-line,
  .lyrics-sheet-inner.is-cinematic .lyrics-line,
  .lyrics-pane.is-cinematic .lyrics-word,
  .lyrics-sheet-inner.is-cinematic .lyrics-word { transition: none !important; }
  .lyrics-pane.is-instrumental .lyrics-scroll::after,
  .lyrics-sheet-inner.is-instrumental .lyrics-scroll::after { animation: none; }
}

/* ── Beat Reactive Cover ───────────────────────────────────────── */
[data-beat-cover] {
  transform-origin: center center;
  transition: none !important;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
@media (prefers-reduced-motion: reduce) {
  [data-beat-cover] { transform: none !important; }
}

/* Lyrics: комфортная ширина и крупный текст на десктопе */
html[data-ui="desktop"] .queue-panel.is-lyrics { width: min(88vw, 430px); }
html[data-ui="desktop"] .lyrics-pane.is-cinematic .lyrics-line { font-size: 16.5px; }
html[data-ui="desktop"] .lyrics-pane.is-cinematic .lyrics-line.is-active { font-size: 18.5px; }

/* ── «Текст»: три строки вместо обложки ───────────────────────── */
.np-art.is-lyrics-beta { transform: none !important; }
.np-art.is-lyrics-beta .np-cover-layer,
.np-art.is-lyrics-beta .np-cinema-glow,
.np-art.is-lyrics-beta .np-cinema-burst,
.np-art.is-lyrics-beta .np-cinema-particles,
.np-art.is-lyrics-beta > .cover-fallback {
  display: none !important;
}
.np-lyrics-beta-text {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  overflow: hidden;
  padding: 7% 6%;
  text-align: center;
  background:
    radial-gradient(90% 70% at 50% 20%, rgba(108, 140, 255, .18), transparent 70%),
    linear-gradient(160deg, rgba(18, 22, 38, .96), rgba(10, 12, 20, .98));
}
.np-art.is-lyrics-beta .np-lyrics-beta-text {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.np-lb-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: visible;
}
.np-lb-slot-prev { align-items: flex-end; z-index: 1; }
.np-lb-slot-next { align-items: flex-start; z-index: 1; }
.np-lb-slot-current { z-index: 2; }
.np-lb-line {
  display: block;
  max-width: 100%;
  font-size: clamp(19px, 4.1vw, 31px);
  font-weight: 700;
  line-height: 1.22;
  transform-origin: center center;
  will-change: transform, opacity, filter;
}
.np-lb-slot-prev .np-lb-line,
.np-lb-slot-next .np-lb-line {
  color: rgba(255, 255, 255, .45);
  filter: blur(1px);
  transform: scale(.78);
}
.np-lb-slot-current .np-lb-line {
  color: #fff;
  filter: none;
  transform: none;
}
.np-lb-word {
  display: inline-block;
  background-image: linear-gradient(
    90deg,
    #fff 0 calc(var(--p, 0) * 100%),
    rgba(255, 255, 255, .34) calc(var(--p, 0) * 100%) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform .18s ease, filter .18s ease;
}
.np-lb-word.is-current {
  transform: translateY(-1px) scale(1.03);
  filter: drop-shadow(0 0 9px rgba(108, 140, 255, .45));
}
.np-lb-word.is-done { filter: none; }
.np-art.is-lyrics-beta .np-lyrics-beta-text {
  animation: npLbGlow 4.8s ease-in-out infinite;
}
@keyframes npLbGlow {
  0%, 100% { box-shadow: inset 0 0 80px rgba(108, 140, 255, .035); }
  50% { box-shadow: inset 0 0 100px rgba(139, 92, 246, .07); }
}
@media (prefers-reduced-motion: reduce) {
  .np-art.is-lyrics-beta .np-lyrics-beta-text { animation: none !important; }
  .np-lb-word { transition: none !important; }
}

/* ── Now Playing: без списка очереди, кнопки-иконки без текстовых подписей ── */
.np-inner { overflow: hidden; }
.np-art { width: min(74vw, 40dvh, 380px); }
.np-extras {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  margin-top: auto;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}
.np-extra {
  width: 42px;
  height: 42px;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--border);
  transition: color var(--motion-ui) var(--ease-standard), background var(--motion-ui) var(--ease-standard), border-color var(--motion-ui) var(--ease-standard), transform var(--motion-micro) var(--ease-out);
}
.np-extra { position: relative; }
.np-extra svg { width: 21px; height: 21px; fill: currentColor; }
.np-repeat-one {
  display: none;
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  color: currentColor;
}
.np-repeat.is-one .np-repeat-one { display: block; }
.np-extra:hover { color: var(--text); background: var(--glass-strong); }
.np-extra:active { transform: scale(.94); }
.np-extra.is-on {
  color: #fff;
  background: linear-gradient(135deg, rgba(108, 140, 255, .3), rgba(168, 85, 247, .26));
  border-color: rgba(139, 92, 246, .5);
}
@media (max-width: 720px) {
  .np-extras { gap: 10px; }
  .np-extra { width: 40px; height: 40px; }
}

/* ── Эквалайзер ────────────────────────────────────────────────── */
.equalizer-card {
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--panel);
  border: 1px solid var(--border);
  display: grid;
  gap: 12px;
}
.equalizer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.equalizer-text { display: flex; flex-direction: column; gap: 2px; }
.equalizer-text b { font-size: 14px; }
.equalizer-text small { color: var(--muted-2); font-size: 12px; }
.equalizer-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.equalizer-bands {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 2px 2px;
}
.eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 34px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
}
.eq-band input[type="range"] {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 22px;
  height: 128px;
  accent-color: var(--blue);
}
@media (max-width: 520px) {
  .eq-band input[type="range"] { height: 104px; }
}

/* ── Слайдер закрытия вместо крестиков ─────────────────────────── */
.drag-handle {
  display: grid;
  place-items: center;
  width: 150px;
  height: 34px;
  margin: 0 auto;
  background: transparent;
  touch-action: none;
  cursor: grab;
  z-index: 5;
}
.drag-handle::before {
  content: "";
  width: 58px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .28);
}
.drag-handle:active { cursor: grabbing; }
.np-top, .queue-panel-head, .drawer-head { position: relative; }
.np-top .drag-handle,
.queue-panel-head .drag-handle {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%);
}
.drawer-head .drag-handle {
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
}
.is-dragging { transition: none !important; }

/* ── «Текст»: предупреждение об отсутствии синхронизации ───────── */
.np-lyrics-notice {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(20, 24, 40, .97);
  border: 1px solid rgba(139, 92, 246, .45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .32s var(--ease-out, ease), transform .32s var(--ease-out, ease);
}
.np-lyrics-notice.is-visible { opacity: 1; transform: none; }
.np-ln-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(108, 140, 255, .4), rgba(168, 85, 247, .35));
  font-size: 14px;
}
.np-ln-text { min-width: 0; }
@media (prefers-reduced-motion: reduce) {
  .np-lyrics-notice { transition: none; }
}

/* Активные shuffle/repeat в Now Playing — заметная подсветка */
#npShuffle.is-on,
#npRepeat.is-on {
  color: #C9B8FF !important;
  background: rgba(168, 85, 247, .24) !important;
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, .5) !important;
}
#npRepeat.is-one .np-repeat-one { display: block !important; }

/* Заметное состояние shuffle/repeat: используем гарантированно
   отрисовываемые свойства (обводка, тень, яркость и цвет иконки). */
#npShuffle.is-on,
#npRepeat.is-on {
  opacity: 1 !important;
  filter: brightness(1.7) !important;
  outline: 2px solid #C9B8FF !important;
  outline-offset: -2px;
  box-shadow: 0 0 18px rgba(168, 85, 247, .55), inset 0 0 0 1px rgba(201, 184, 255, .8) !important;
  background: rgba(168, 85, 247, .22) !important;
}
#npShuffle.is-on svg,
#npRepeat.is-on svg { fill: #C9B8FF !important; }

/* Кнопка «Текст» заблокирована, если синхронизированного текста нет */
.np-extra.is-disabled,
.np-extra:disabled {
  opacity: .35;
  cursor: not-allowed;
  filter: grayscale(.5);
}
.np-extra.is-disabled:hover,
.np-extra:disabled:hover { background: var(--glass); color: var(--muted); }
