/* === artist-wordmarks.css === */
/* This layer affects only the title, never the portrait or action row. */
#artistHeaderName .artist-wordmark-image:not([hidden]) {
  display: block;
  inline-size: min(84vw, 340px);
  max-inline-size: 100%;
  block-size: auto;
  max-block-size: 80px;
  min-block-size: 54px;
  object-fit: contain;
  margin-inline: auto;
}

@media not (forced-colors: active) {
  #artistHeaderName .artist-wordmark-text.is-visually-hidden {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (forced-colors: active) {
  #artistHeaderName .artist-wordmark-image:not([hidden]) { display: none; }
}

/* === screens.css === */
/* ==========================================================================
   Экраны по макету: «Распознанные», «Совпадение вкусов», «Синхронизация»,
   «Импорт плейлиста».

   Стили лежат отдельным файлом и привязаны к .nm-screen: остальные подэкраны
   медиатеки остаются с крупными заголовками и прежними строками. Внутри одного
   экрана правило одно на всех — отступы, скругления и типографика берутся
   здесь, а не из общих блоков style.css.

   Движение — только токенами motion (tests/native/guards.test.cjs): длительности
   и кривые не пишем числами, раскладку не анимируем, шкалы растут через
   transform: scaleX.
   ========================================================================== */

.nm-screen {
  /* Подложки считаются от цвета текста темы: на тёмной тот же светлый вайл,
    на светлой — видимая тёмная заливка, а не невидимое белое пятно. */
  --nm-fill: color-mix(in srgb, var(--text) 6%, transparent);
  --nm-card: color-mix(in srgb, var(--text) 5%, transparent);
  --nm-line: color-mix(in srgb, var(--text) 10%, transparent);
  --nm-circle: color-mix(in srgb, var(--text) 10%, transparent);
  --nm-dot: color-mix(in srgb, var(--text) 22%, transparent);
}

/* ─── Шапка: шеврон слева, название по центру ─────────────────────────── */
.nm-screen .nm-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  margin: 0 calc(var(--page-gutter) * -1);
  padding: calc(var(--tg-header-clearance) + var(--s1)) var(--page-gutter) var(--s1);
}

.nm-screen .nm-back {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: scale var(--dur-press) var(--ease);
}
.nm-screen .nm-back svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.nm-screen .nm-back.is-pressed {
  scale: 0.9;
}

.nm-screen .nm-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Пустой слот справа: держит название ровно по центру экрана. */
.nm-screen .nm-head-slot {
  flex: 0 0 40px;
  width: 40px;
}

/* ─── Вступительный текст экрана ──────────────────────────────────────── */
.nm-screen .nm-lead {
  margin: var(--s2) 0 var(--s5);
  font-size: 15px;
  line-height: 1.42;
  color: var(--text);
}

/* ─── Поле ввода с иконкой и крестиком ────────────────────────────────── */
.nm-screen .nm-field {
  display: flex;
  align-items: center;
  gap: var(--s2);
  height: 52px;
  padding: 0 var(--s4);
  border-radius: 16px;
  background: var(--nm-fill);
  transition: box-shadow var(--dur-fast) var(--ease);
}
.nm-screen .nm-field:focus-within {
  /* Та же «ring»-обводка, что у поля поиска в фокусе. */
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.nm-screen .nm-field-icon,
.nm-screen .nm-field-at {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 17px;
  font-weight: 500;
}
.nm-screen .nm-field-icon {
  stroke-width: 1.9;
}
.nm-screen .nm-field-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}
.nm-screen .nm-field-input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}
.nm-screen .nm-field-clear {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
}
.nm-screen .nm-field-clear svg {
  width: 18px;
  height: 18px;
}
.nm-screen .nm-field-clear.hidden {
  display: none;
}

/* ─── Главная кнопка экрана ───────────────────────────────────────────── */
.nm-screen .nm-primary {
  display: block;
  width: 100%;
  height: 56px;
  margin-top: var(--s3);
  border: 0;
  border-radius: 18px;
  background: radial-gradient(circle at 35% 26%, color-mix(in srgb, var(--accent) 82%, white), var(--accent) 58%, color-mix(in srgb, var(--accent) 75%, black));
  color: var(--accent-on);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: scale var(--dur-press) var(--ease), opacity var(--dur-fast) var(--ease);
}
.nm-screen .nm-primary:disabled {
  opacity: 0.55;
  cursor: default;
}
.nm-screen .nm-primary.is-pressed {
  scale: 0.985;
}

/* ─── Заголовки разделов внутри экрана ────────────────────────────────── */
.nm-screen .nm-section-title {
  margin: var(--s5) 0 var(--s2);
  font-size: var(--title-size-section);
  font-weight: 700;
  letter-spacing: var(--title-track-section);
  line-height: var(--title-line-section);
  color: var(--text);
}
.nm-screen .nm-section-title-sm {
  margin: var(--s4) 0 var(--s2);
  font-size: 17px;
}

/* ─── Распознавание: круг с волной, подпись, ссылка ───────────────────── */
.nm-screen .nm-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  padding: var(--s6) 0 var(--s5);
  text-align: center;
}
.nm-screen .nm-mic {
  position: relative;
  width: 148px;
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  /* Тонированная поверхность, а не сплошная заливка: «первичность» дают размер,
    акцентная волна и дыхание — как у карточки инструмента в медиатеке. */
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-surface-raised));
  color: var(--accent);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line-soft), 0 16px 36px -20px rgba(0, 0, 0, 0.45);
  transition: scale var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.nm-screen .nm-mic.is-pressed {
  scale: 0.96;
}
.nm-screen .nm-mic:disabled {
  opacity: 0.72;
  cursor: default;
}
.nm-screen .nm-wave {
  width: 46px;
  height: 46px;
  fill: currentColor;
}
.nm-screen .nm-wave rect { transform-origin: center; transform-box: fill-box; }
/* В покое волна дышит едва заметно — общий язык полосок scaleY, как у карточки
   «Распознать» и волн nowplaying-bars. При записи оживает быстрее и амплитуднее. */
.nm-screen .nm-mic .nm-wave rect { animation: nmWaveIdle calc(var(--dur-pulse) * 3) var(--ease) infinite alternate; }
.nm-screen .nm-mic .nm-wave rect:nth-child(2),
.nm-screen .nm-mic .nm-wave rect:nth-child(4) { animation-delay: calc(var(--dur-pulse) / -3); }
.nm-screen .nm-mic .nm-wave rect:nth-child(3) { animation-delay: calc(var(--dur-pulse) / -1.5); }
@keyframes nmWaveIdle { from { transform: scaleY(.82); } to { transform: scaleY(1); } }
/* Во время записи волна оживает, а мягкие круги расходятся от кнопки. */
.nm-screen .nm-mic.is-listening::before,
.nm-screen .nm-mic.is-listening::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  pointer-events: none;
  animation: nmMicPulse var(--dur-pulse) var(--ease) infinite;
}
.nm-screen .nm-mic.is-listening::before { animation-delay: calc(var(--dur-pulse) / -2); }
.nm-screen .nm-mic.is-listening .nm-wave rect { animation: nmWave var(--dur-pulse) var(--ease) infinite alternate; }
.nm-screen .nm-mic.is-listening .nm-wave rect:nth-child(2),
.nm-screen .nm-mic.is-listening .nm-wave rect:nth-child(4) { animation-delay: calc(var(--dur-pulse) / -4); }
.nm-screen .nm-mic.is-listening .nm-wave rect:nth-child(3) { animation-delay: calc(var(--dur-pulse) / -2); }
@keyframes nmMicPulse {
  from { transform: scale(1); opacity: 0.5; }
  to { transform: scale(1.28); opacity: 0; }
}
@keyframes nmWave { from { transform: scaleY(.55); } to { transform: scaleY(1.12); } }
@media (prefers-reduced-motion: reduce) {
  .nm-screen .nm-mic .nm-wave rect,
  .nm-screen .nm-mic.is-listening::before, .nm-screen .nm-mic.is-listening::after,
  .nm-screen .nm-mic.is-listening .nm-wave rect { animation: none; }
  .nm-screen .nm-mic.is-listening { outline: 2px solid var(--accent); outline-offset: 6px; }
}
html[data-motion="instant"] .nm-screen .nm-mic .nm-wave rect,
html[data-motion="instant"] .nm-screen .nm-mic.is-listening::before,
html[data-motion="instant"] .nm-screen .nm-mic.is-listening::after,
html[data-motion="instant"] .nm-screen .nm-mic.is-listening .nm-wave rect { animation: none; }
html[data-motion="instant"] .nm-screen .nm-mic.is-listening { outline: 2px solid var(--accent); outline-offset: 6px; }

/* Распознавание: спокойная кнопка, состояние поиска и найденный трек. */
.nm-screen .nm-hero { position: relative; min-height: 340px; }
.nm-screen .nm-mic {
  /* Лёгкий верхний блик поверх той же тонировки — непрерывно с состоянием
    прослушивания: круг не перекрашивается, а «активируется». */
  background: linear-gradient(145deg, rgb(255 255 255 / .09), transparent 55%), color-mix(in srgb, var(--accent) 14%, var(--bg-surface-raised));
  animation: recognizeIdle calc(var(--dur-pulse) * 3) var(--ease) infinite;
  transition: transform var(--dur-move) var(--ease-settle), scale var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.nm-screen .nm-mic:disabled { animation: none; }
.nm-screen .nm-mic:disabled .nm-wave rect { animation: none; }
.nm-screen .nm-mic.is-listening {
  animation: none;
  opacity: 1;
  background: linear-gradient(145deg, rgb(255 255 255 / .16), transparent 55%), color-mix(in srgb, var(--accent) 22%, var(--bg-surface-raised));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent), 0 12px 28px rgb(0 0 0 / .25);
}
.nm-screen .nm-mic.is-listening::before { inset: -12px; opacity: .45; animation: none; }
.nm-screen .nm-mic.is-listening::after {
  inset: -12px;
  border: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent) 0 3px, transparent 4px);
  animation: recognizeOrbit calc(var(--dur-pulse) * 2.5) var(--ease-linear) infinite;
}
.nm-screen .nm-hero.recognize-found .nm-mic { animation: none; opacity: 0; transform: scale(.55); pointer-events: none; }
.nm-screen .nm-hero.recognize-found > .nm-hero-title,
.nm-screen .nm-hero.recognize-found > .nm-hero-sub,
.nm-screen .nm-hero.recognize-found > .recognize-progress { opacity: 0; pointer-events: none; }
.nm-screen .recognize-result[hidden] { display: none; }
.nm-screen .recognize-result {
  position: absolute; inset: var(--s6) 0 auto; display: flex; flex-direction: column; align-items: center;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity var(--dur-move) var(--ease), transform var(--dur-move) var(--ease-settle);
}
.nm-screen .recognize-found .recognize-result { opacity: 1; transform: none; pointer-events: auto; }
.nm-screen .recognize-result-art {
  width: 148px; height: 148px; object-fit: cover; border-radius: 24px;
  transform: scale(.55); clip-path: inset(0 round 50%);
  transition: transform var(--dur-move) var(--ease-settle), clip-path var(--dur-move) var(--ease);
}
.nm-screen .recognize-found .recognize-result-art { transform: scale(1); clip-path: inset(0 round 24px); }
.nm-screen .recognize-result-label { color: var(--accent); font-size: 12px; font-weight: 700; margin-top: 14px; }
.nm-screen .recognize-result-title { font-size: 21px; margin-top: 6px; }
.nm-screen .recognize-result-artist { color: var(--text-secondary); margin-top: 4px; }
.nm-screen .recognize-result-actions { display: flex; gap: 8px; margin-top: 14px; }
.nm-screen .recognize-result-actions button { border: 0; border-radius: var(--r-pill); padding: 10px 15px; font: inherit; font-weight: 600; cursor: pointer; transition: scale var(--dur-press) var(--ease); }
.nm-screen .recognize-result-actions button.is-pressed { scale: 0.96; }
.nm-screen .recognize-result-play { background: var(--accent); color: var(--accent-on); }
.nm-screen .recognize-result-retry { background: var(--nm-fill); color: var(--text); }
@keyframes recognizeIdle { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes recognizeOrbit { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .nm-screen .nm-mic, .nm-screen .recognize-result, .nm-screen .recognize-result-art { animation: none; transition: none; }
}
html[data-motion="instant"] .nm-screen .nm-mic,
html[data-motion="instant"] .nm-screen .recognize-result,
html[data-motion="instant"] .nm-screen .recognize-result-art { animation: none; transition: none; }
.nm-screen .nm-hero-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.nm-screen .nm-hero-sub {
  max-width: 280px;
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-secondary);
}
.nm-screen .recognize-progress {
  width: 132px;
  height: 3px;
  border-radius: 2px;
  background: var(--nm-circle);
}
.nm-screen .recognize-progress.hidden {
  display: none;
}
/* Вторичное действие под полем — спокойная пилюля на общей подложке, а не
   подчёркнутая ссылка: подчёркиваний в словаре нет. */
.nm-screen .nm-file-line {
  display: block;
  width: fit-content;
  margin: var(--s3) auto 0;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  background: var(--nm-fill);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  transition: scale var(--dur-press) var(--ease);
}
.nm-screen .nm-file-line.is-pressed {
  scale: 0.96;
}
.nm-screen .nm-file-line.hidden {
  display: none;
}

/* ─── Строки треков ───────────────────────────────────────────────────── */
.nm-screen .nm-track-list {
  display: flex;
  flex-direction: column;
}
.nm-screen .nm-track {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  min-height: var(--media-row-height);
  padding: var(--s1) 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nm-screen .nm-track-cover {
  flex: 0 0 auto;
  width: var(--media-row-art);
  height: var(--media-row-art);
  border-radius: var(--r-detail);
  object-fit: cover;
  background: var(--inset);
}
.nm-screen .nm-track-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.nm-screen .nm-track-title {
  font-size: var(--media-row-title);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nm-screen .nm-track-sub {
  margin-top: 2px;
  font-size: var(--media-row-meta);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* Имена артистов растворяются, даже если экранные правила списка объявлены
   после базовой таблицы стилей. */
.nm-screen .nm-track-sub.artist-name-fade {
  text-overflow: clip;
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - min(28px, 35%)), transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - min(28px, 35%)), transparent 100%);
}
.nm-screen .nm-track-play {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  /* Значок play — акцентный тон, как сквиклы иконок и значок play на обложках. */
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  transition: scale var(--dur-press) var(--ease);
}
.nm-screen .nm-track-play.is-pressed {
  scale: 0.9;
}
.nm-screen .nm-track-play svg {
  width: 15px;
  height: 15px;
  margin-left: 1px;
  fill: currentColor;
}
.nm-screen .nm-track-more {
  flex: 0 0 auto;
  width: 28px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.nm-screen .nm-track.is-new .nm-track-title {
  color: var(--accent);
}
.nm-screen .nm-empty {
  margin: var(--s4) 0;
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
}

/* ─── Совпадение вкусов: карточка результата ──────────────────────────── */
.nm-screen .nm-card {
  margin-top: var(--s5);
  padding: var(--s4);
  border-radius: 20px;
  background: var(--nm-card);
}
.nm-screen .nm-match-top {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.nm-screen .nm-match-covers {
  position: relative;
  flex: 0 0 auto;
  width: 104px;
  height: 78px;
}
.nm-screen .nm-match-cover {
  position: absolute;
  top: 2px;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--inset);
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, 0.9);
}
.nm-screen .nm-match-cover:nth-child(1) {
  left: 0;
  transform: rotate(-5deg);
}
.nm-screen .nm-match-cover:nth-child(2) {
  left: 28px;
  top: 0;
  transform: rotate(3deg);
}
.nm-screen .nm-match-scorewrap {
  flex: 1 1 auto;
  min-width: 0;
}
.nm-screen .nm-match-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
}
.nm-screen .nm-match-score {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.nm-screen .nm-match-pct {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-secondary);
}
.nm-screen .nm-bar {
  height: 7px;
  border-radius: 4px;
  background: var(--nm-circle);
  overflow: hidden;
}
.nm-screen .nm-match-bar {
  margin-top: var(--s3);
}
.nm-screen .match-score-fill {
  height: 100%;
  width: 100%;
  border-radius: 4px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur-player) var(--ease);
}
.nm-screen .nm-match-note {
  margin: var(--s3) 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.nm-screen .nm-divider {
  height: 1px;
  margin: var(--s4) 0 var(--s3);
  background: var(--nm-line);
}
.nm-screen .nm-mix-row {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nm-screen .nm-mix-cover {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--inset);
}
.nm-screen .nm-mix-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.nm-screen .nm-mix-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.nm-screen .nm-mix-sub {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nm-screen .nm-chev {
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
  color: var(--text-secondary);
}
.nm-screen .match-approx {
  margin: var(--s3) 0 0;
  padding: 0;
  border-radius: 0;
  background: none;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}
.nm-screen .match-partner {
  margin-top: var(--s3);
  font-size: 13px;
  color: var(--text-secondary);
}

/* ─── Синхронизация: карточки сервисов ────────────────────────────────── */
.nm-screen .nm-provider-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nm-screen .nm-provider {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-radius: 18px;
  background: var(--nm-card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: scale var(--dur-fast) var(--ease);
}
.nm-screen .nm-provider:disabled {
  opacity: 0.5;
  cursor: default;
}
.nm-screen .nm-provider.is-pressed {
  scale: 0.99;
}
.nm-screen .nm-provider-mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mark-radius, 14px);
  background: var(--brand, rgba(255, 255, 255, 0.12));
  color: var(--ink, #fff);
}
.nm-screen .nm-provider-mark .sync-service-logo {
  display: block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  -webkit-mask: var(--service-logo) center / contain no-repeat;
  mask: var(--service-logo) center / contain no-repeat;
}
.nm-screen .nm-provider-mark .sync-service-logo-fallback {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.nm-screen .nm-provider-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.nm-screen .nm-provider-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.nm-screen .nm-provider-sub {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.nm-screen .nm-provider.warn .nm-provider-sub {
  color: #d98a1f;
}
.nm-screen .nm-provider-cta {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: 1.5px solid var(--accent);
  border-radius: var(--r-pill);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.nm-screen .sync-loading {
  padding: var(--s5) 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.nm-screen .sync-empty {
  padding: var(--s6) 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}
.nm-screen .nm-retry {
  display: block;
  margin: var(--s3) auto 0;
  padding: 8px 18px;
  border: 1.5px solid var(--accent);
  border-radius: var(--r-pill);
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ─── Импорт плейлиста: прогресс, выбор треков, кнопка внизу ──────────── */
.nm-screen .nm-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s3);
  padding: 13px 14px;
  border-radius: 18px;
  background: var(--nm-card);
}
.nm-screen .nm-progress.hidden {
  display: none;
}
.nm-screen .nm-progress-spin {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--nm-dot);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: nmSpin var(--dur-spin) var(--ease-linear) infinite;
}
.nm-screen .nm-progress.is-done .nm-progress-spin,
.nm-screen .nm-progress.is-error .nm-progress-spin {
  /* Кольцо остаётся на месте, но перестаёт крутиться: чтение закончилось. */
  animation: none;
  border-color: var(--accent);
}
.nm-screen .nm-progress.is-error .nm-progress-spin {
  border-color: #e5453a;
}
@keyframes nmSpin {
  to { transform: rotate(360deg); }
}
.nm-screen .nm-progress-main {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  min-width: 0;
}
.nm-screen .nm-progress-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nm-screen .nm-progress-pct {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.nm-screen .nm-progress-fill {
  height: 100%;
  width: 100%;
  border-radius: 4px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur-release) var(--ease);
}
.nm-screen .nm-progress.is-running .nm-progress-fill {
  animation: nmBarPulse var(--dur-breathe) var(--ease-linear) infinite;
}
@keyframes nmBarPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.nm-screen .nm-notes {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-top: var(--s3);
}
.nm-screen .nm-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #d98a1f;
}
.nm-screen .nm-error {
  min-height: 0;
  margin: var(--s2) 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #e5453a;
}
.nm-screen .nm-error:empty {
  margin: 0;
}

/* Перенос закончен: список остаётся историей выбора и больше не отвечает. */
.nm-screen .nm-track-list.is-locked {
  opacity: 0.6;
  pointer-events: none;
}

/* Строка выбора трека: галочка, обложка, названия, длительность. */
.nm-screen .nm-pick {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  padding: 7px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.nm-screen .nm-check {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--nm-dot);
  border-radius: 9px;
  color: transparent;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nm-screen .nm-check svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nm-screen .nm-pick.is-on .nm-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on);
}
.nm-screen .nm-pick-cover {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 11px;
  object-fit: cover;
  background: var(--inset);
}
.nm-screen .nm-pick-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nm-screen .nm-pick-sub {
  margin-top: 1px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nm-screen .nm-pick-dur {
  flex: 0 0 auto;
  font-size: 14px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Кнопка «Продолжить» идёт сразу под списком: на коротком списке она на виду,
   а на длинном человек доходит до неё, когда закончил выбирать. */
.nm-screen .nm-cta {
  margin-top: var(--s4);
}
.nm-screen .nm-cta .nm-primary {
  margin-top: 0;
}
.nm-screen .nm-cta.hidden {
  display: none;
}

/* === karaoke.css === */
/* ИИ-караоке: экран «текста нет» и ожидание расшифровки.
   Цвета только из переменных темы, поэтому светлая и тёмная тема работают без правок. */

.ai-karaoke {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px 28px 48px;
  text-align: center;
  gap: 10px;
  color: var(--text-secondary);
  animation: ai-appear var(--dur-page) var(--ease) both;
}

/* У контейнера текста снизу большой отступ под прокрутку строк: для этих экранов он лишний. */
#lyricsContent:has(> .ai-karaoke) {
  padding-bottom: 32px;
}

.ai-badge,
.ai-orb,
.ai-btn {
  flex-shrink: 0;
}

.ai-karaoke .ai-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  transition: opacity var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}

.ai-karaoke .ai-title.is-swapping {
  opacity: 0;
  transform: translateY(5px);
}

.ai-sub {
  max-width: 292px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.ai-note {
  max-width: 300px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--accent);
  background: var(--accent-soft);
}

.ai-fine {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.75;
}

/* ---- «текста нет»: значок и кнопка ---- */

.ai-badge {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 6px;
  border-radius: 50%;
  color: var(--accent);
  background: radial-gradient(circle at 50% 32%, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-rgb), 0.08) 72%);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.22) inset, 0 10px 30px rgba(var(--accent-rgb), 0.18);
  animation: ai-float var(--dur-ambient) var(--ease-breathe) infinite;
}

.ai-badge svg {
  width: 32px;
  height: 32px;
}

.ai-badge.is-quiet {
  color: var(--text-muted);
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--line) inset;
  animation: none;
}

.ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-on);
  background: var(--accent-gradient);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-micro) var(--ease), opacity var(--dur-micro) var(--ease);
}

.ai-btn svg {
  width: 18px;
  height: 18px;
}

.ai-btn.is-pressed {
  scale: 0.96;
}

.ai-btn:disabled {
  opacity: 0.5;
  box-shadow: none;
  cursor: default;
}

/* ---- ожидание: орб с кольцами и эквалайзером ---- */

.ai-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 156px;
  height: 156px;
  margin-bottom: 14px;
}

/* вращающееся свечение за диском */
.ai-orb::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(var(--accent-rgb), 0), rgba(var(--accent-rgb), 0.6), rgba(255, 205, 175, 0.35), rgba(var(--accent-rgb), 0));
  filter: blur(11px);
  animation: ai-spin var(--dur-ambient-slow) var(--ease-linear) infinite;
}

/* диск */
.ai-orb::after {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 60%), var(--bg-surface-raised);
  box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(0, 0, 0, 0.3);
}

.ai-ring {
  position: absolute;
  inset: 30px;
  border: 1.5px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 50%;
  opacity: 0;
  animation: ai-ring var(--dur-ambient-fast) var(--ease) infinite;
}

.ai-ring:nth-child(2) { animation-delay: 0.9s; }
.ai-ring:nth-child(3) { animation-delay: 1.8s; }

.ai-bars {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
}

.ai-bars i {
  display: block;
  width: 4px;
  height: 100%;
  border-radius: 3px;
  background: var(--accent-gradient);
  transform: scaleY(0.22);
  animation: ai-bar var(--dur-pulse) var(--ease-breathe) infinite;
}

.ai-bars i:nth-child(1) { animation-delay: -0.9s; }
.ai-bars i:nth-child(2) { animation-delay: -0.6s; }
.ai-bars i:nth-child(3) { animation-delay: -0.3s; }
.ai-bars i:nth-child(4) { animation-delay: -0.75s; }
.ai-bars i:nth-child(5) { animation-delay: -0.15s; }
.ai-bars i:nth-child(6) { animation-delay: -0.5s; }
.ai-bars i:nth-child(7) { animation-delay: -0.05s; }

@keyframes ai-bar {
  0%, 100% { transform: scaleY(0.22); }
  50% { transform: scaleY(1); }
}

@keyframes ai-ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.1); opacity: 0; }
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

@keyframes ai-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes ai-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Движение отключено в системе: тот же экран, но спокойный. */
@media (prefers-reduced-motion: reduce) {
  .ai-karaoke,
  .ai-karaoke *,
  .ai-orb::before {
    animation: none !important;
    transition: none !important;
  }
  .ai-bars i { transform: scaleY(0.6); }
  .ai-ring { display: none; }
}

/* Full-screen sing view. Album art supplies the backdrop; player nodes stay live. */
/* Текст и кнопки поверх размытой обложки — всегда белые, в любой теме. */
:root { --lyrics-ink: rgb(255,255,255); --lyrics-alert: rgb(255, 129, 125); }
.ios-lyrics-sheet { background: rgb(var(--tint)); }
.ios-lyrics-sheet .lyrics-backdrop { inset: -18%; filter: blur(64px) saturate(.85); opacity: .8; transform: scale(1.15); }
.ios-lyrics-sheet .lyrics-backdrop::after { background: linear-gradient(180deg,rgba(var(--tint),.12),rgba(20,18,22,.62)); }
.ios-lyrics-sheet .lyrics-top { padding: calc(var(--tg-header-clearance) + 54px) 32px 18px; }
.ios-lyrics-sheet .lyrics-head { gap: 16px; }
.ios-lyrics-sheet .lyrics-head-art { width: 76px; height: 76px; border-radius: 12px; box-shadow: none; }
.ios-lyrics-sheet .lyrics-head-title { font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.ios-lyrics-sheet .lyrics-head-artist { font-size: 18px; color: rgba(255,255,255,.75); }
.ios-lyrics-sheet #lyricsStarBtn { display: none; }
.ios-lyrics-sheet .lyrics-head-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.15); }
.ios-lyrics-sheet .sheet-lyrics-body { padding: 80px 28px 45vh; gap: 30px; --scroll-mask-top: 50px; --scroll-mask-bottom: 90px; scrollbar-width: none; }
.ios-lyrics-sheet .sheet-lyrics-body::-webkit-scrollbar { display: none; }
.ios-lyrics-sheet .sheet-lyrics-body.scroll-fade-mask--edges {
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.2) 20px,
    rgba(0, 0, 0, 0.8) 40px,
    rgb(0, 0, 0) var(--scroll-mask-top),
    rgb(0, 0, 0) calc(100% - var(--scroll-mask-bottom)),
    rgba(0, 0, 0, 0.8) calc(100% - var(--scroll-mask-bottom) + 35px),
    rgba(0, 0, 0, 0.2) calc(100% - 20px),
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.2) 20px,
    rgba(0, 0, 0, 0.8) 40px,
    rgb(0, 0, 0) var(--scroll-mask-top),
    rgb(0, 0, 0) calc(100% - var(--scroll-mask-bottom)),
    rgba(0, 0, 0, 0.8) calc(100% - var(--scroll-mask-bottom) + 35px),
    rgba(0, 0, 0, 0.2) calc(100% - 20px),
    transparent 100%
  );
}
.ios-lyrics-sheet .lyrics-line {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: clamp(30px,8.5vw,42px);
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -.025em;
  color: rgba(255,255,255,.28);
  filter: blur(3px);
  border-radius: 20px;
  padding: 8px 14px;
  margin: 2px 0;
  transition: color var(--dur-short) var(--ease),
              filter var(--dur-short) var(--ease),
              opacity var(--dur-short) var(--ease),
              transform var(--dur-short) var(--ease);
  transform-origin: left center;
}
.ios-lyrics-sheet .lyrics-line::before {
  content: "";
  position: absolute;
  inset: -6px -10px;
  border-radius: 24px;
  background: radial-gradient(ellipse 90% 85% at 50% 50%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.06) 60%, transparent 85%);
  filter: blur(16px);
  /* Без своего стекла: под строкой — уже размытый фон плеера, второе размытие
     его не меняет, а считалось бы на каждом кадре прокрутки текста. */
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity var(--dur-short) var(--ease);
}
.ios-lyrics-sheet .lyrics-line.lyrics-near { filter: blur(1.5px); color: rgba(255,255,255,.45); }
.ios-lyrics-sheet .lyrics-line.lyrics-past { opacity: .65; }
.ios-lyrics-sheet .lyrics-line.active {
  filter: none;
  color: var(--lyrics-ink);
  opacity: 1;
  transform: scale(1.02);
  text-shadow: 0 2px 20px rgba(255, 255, 255, 0.28);
}
.ios-lyrics-sheet .lyrics-line.active::before {
  opacity: 1;
}
.ios-lyrics-sheet .lyrics-line.is-pressed::before {
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.16);
}
.ios-lyrics-sheet .sheet-lyrics-body.is-plain .lyrics-line { filter: none; font-size: 30px; font-weight: 650; color: rgba(255,255,255,.9); transform: none; text-shadow: none; }
.ios-lyrics-sheet .sheet-lyrics-body.is-plain .lyrics-line::before { display: none; }
.lyrics-player-controls { position: relative; z-index: 2; display: grid; grid-template-rows: auto 88px 28px 48px; gap: 20px; flex: 0 0 auto; width: 100%; max-width: 620px; margin-inline: auto; padding: 16px 32px max(20px,var(--sab)); color: var(--lyrics-ink); }
.lyrics-player-controls .ios-scrubber-section { margin: 0; }
.lyrics-player-controls .ios-controls-cluster { display: flex; justify-content: space-around; align-items: center; margin: 0; }
.lyrics-player-controls :is(.ctrl-shuffle,.ctrl-repeat) { display: none; }
.lyrics-player-controls .ios-play-hero { width: 80px; height: 80px; background: transparent; }
.lyrics-player-controls .ios-play-hero svg { width: 56px; height: 56px; }
.lyrics-player-controls :is(.ctrl-prev,.ctrl-next) { width: 64px; height: 64px; }
.lyrics-player-controls :is(.ctrl-prev,.ctrl-next) svg { width: 40px; height: 40px; }
.lyrics-player-controls .ios-modal-volume-row { margin: 0; }
.lyrics-player-controls .ios-player-bottom-dock { display: grid; grid-template-columns: repeat(3,1fr); justify-items: center; align-items: center; margin: 0; padding: 0; }
.lyrics-player-controls #playerShareBtn { display: none; }
.lyrics-player-controls #lyricsToggleBtn { order: 1; width: 46px; height: 46px; border-radius: 50%; color: rgb(var(--tint)); background: rgba(255,255,255,.85); }
.lyrics-player-controls #openEqBtn { order: 2; }
.lyrics-player-controls #queueToggleBtn { order: 3; background: transparent; color: var(--lyrics-ink); }
.lyrics-vocal-control { position: absolute; z-index: 2; right: 32px; bottom: calc(320px + var(--sab)); width: 72px; height: 156px; overflow: hidden; border-radius: 36px; background: rgba(255,255,255,.28); color: rgba(var(--tint),.85); pointer-events: none; }
.lyrics-vocal-fill { position: absolute; inset: 42px 0 0; background: rgba(255,255,255,.82); }
.lyrics-vocal-control svg { position: absolute; left: 17px; bottom: 18px; width: 38px; height: 38px; }
.ios-lyrics-sheet .ai-karaoke { color: rgba(255,255,255,.8); padding: 24px 0; }
.ios-lyrics-sheet :is(.ai-title,.ai-sub,.ai-fine) { color: rgba(255,255,255,.9); }
.ios-lyrics-sheet .ai-btn { background: rgba(255,255,255,.9); color: rgb(var(--tint)); }
.ios-lyrics-sheet:has(.lyrics-empty-state,.ai-karaoke,.is-plain) .lyrics-vocal-control { display: none; }
.ios-lyrics-sheet .lyrics-empty-state .empty-title { color: rgba(255,255,255,.9); }
@media (max-height: 740px) {
  .ios-lyrics-sheet .lyrics-top { padding-top: calc(var(--tg-header-clearance) + 40px); padding-inline: 24px; }
  .ios-lyrics-sheet .lyrics-head-art { width: 64px; height: 64px; }
  .ios-lyrics-sheet .sheet-lyrics-body { padding-inline: 24px; padding-top: 40px; gap: 24px; }
  .ios-lyrics-sheet .lyrics-line { font-size: 32px; }
  .lyrics-player-controls { grid-template-rows: auto 64px 24px 44px; gap: 12px; padding: 12px 24px max(12px,var(--sab)); }
  .lyrics-player-controls .ios-play-hero { width: 64px; height: 64px; }
  .lyrics-vocal-control { bottom: calc(244px + var(--sab)); right: 24px; width: 60px; height: 132px; }
  .lyrics-vocal-control svg { left: 12px; width: 36px; height: 36px; }
}
@media (min-width: 800px) { .ios-lyrics-sheet .lyrics-head,.ios-lyrics-sheet .sheet-lyrics-body { width: min(100%,620px); margin-inline: auto; } .lyrics-vocal-control { right: max(32px,calc((100% - 620px)/2 + 32px)); } }
@media (prefers-reduced-motion: reduce) { .ios-lyrics-sheet .lyrics-line { transition: none; } }
/* The vocal slider is shown only when both real stems are decoded. */
.lyrics-sing-action { position: absolute; z-index: 3; left: 32px; bottom: calc(314px + var(--sab)); padding: 9px 14px; border-radius: 999px; background: rgba(255,255,255,.16); color: var(--lyrics-ink); font-size: 14px; font-weight: 600; }
.lyrics-sing-action:disabled { opacity: .6; cursor: wait; }
.lyrics-vocal-control { pointer-events: auto; }
.lyrics-vocal-fill { inset: auto 0 0; height: 0; }
#karaokeVocalLevel { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; background: transparent; writing-mode: vertical-lr; direction: rtl; opacity: 0; cursor: ns-resize; }
.lyrics-vocal-control:focus-within { outline: 2px solid var(--lyrics-ink); outline-offset: 4px; }
.lyrics-vocal-control svg { pointer-events: none; color: var(--lyrics-ink); mix-blend-mode: difference; }
.ios-lyrics-sheet:has(.lyrics-empty-state,.ai-karaoke,.is-plain) .lyrics-vocal-control:not(.hidden) { display: block; }
@media (max-height:740px) { .lyrics-sing-action { left: 24px; bottom: calc(236px + var(--sab)); } }

/* ---- текст есть, таймкодов нет: карточка «Расставить» над обычным текстом ---- */

.ai-sync {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 18px;
  text-align: left;
  color: var(--text-secondary);
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--line) inset;
  animation: ai-appear var(--dur-page) var(--ease) both;
}

.ai-sync-badge {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.14);
}

.ai-sync-badge svg {
  width: 18px;
  height: 18px;
}

.ai-sync-text {
  flex: 1 1 auto;
  min-width: 0;
}

.ai-sync-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.ai-sync-sub {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.35;
}

.ai-sync.is-quiet {
  padding: 10px 14px;
  background: transparent;
}

.ai-sync-btn {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-on);
  background: var(--accent-gradient);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-micro) var(--ease);
}

.ai-sync-btn.is-pressed {
  scale: 0.95;
}

.ai-sync-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.ai-sync-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: ai-sync-pulse var(--dur-pulse) var(--ease-breathe) infinite;
}

@keyframes ai-sync-pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
}

.ios-lyrics-sheet .ai-sync {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.ios-lyrics-sheet .ai-sync-title { color: rgba(255, 255, 255, 0.95); }
.ios-lyrics-sheet .ai-sync-badge { color: rgb(255, 255, 255); background: rgba(255, 255, 255, 0.2); }
.ios-lyrics-sheet .ai-sync-pulse { background: rgb(255, 255, 255); }
.ios-lyrics-sheet .ai-sync-btn { background: rgba(255, 255, 255, 0.9); color: rgb(var(--tint)); }

@media (prefers-reduced-motion: reduce) {
  .ai-sync, .ai-sync-pulse { animation: none; }
}

/* Empty lyrics belong to the current theme and center within the lyrics area. */
.ios-lyrics-sheet #lyricsContent:has(> .ai-karaoke) {
  padding: 16px;
  gap: 0;
  mask-image: none;
  -webkit-mask-image: none;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) {
  width: 100%;
  min-height: 100%;
  margin-block: auto;
  padding: 0;
  gap: 12px;
  color: color-mix(in srgb, var(--lyrics-ink) 72%, transparent);
  animation: none;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-badge {
  width: 36px;
  height: 36px;
  margin: 0 0 4px;
  color: color-mix(in srgb, var(--lyrics-ink) 62%, transparent);
  background: transparent;
  box-shadow: none;
  animation: none;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-badge svg { width: 28px; height: 28px; }
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-title {
  color: var(--lyrics-ink);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 600;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-sub {
  max-width: 292px;
  color: color-mix(in srgb, var(--lyrics-ink) 72%, transparent);
  font-size: 13px;
  line-height: 1.4;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-btn {
  justify-content: center;
  min-height: 44px;
  margin: 4px 0 0;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--accent-fill);
  color: var(--tg-on-accent);
  box-shadow: none;
  font-size: 15px;
  font-weight: 600;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-fine {
  max-width: 292px;
  margin: 0;
  color: color-mix(in srgb, var(--lyrics-ink) 72%, transparent);
  font-size: 11px;
  line-height: 1.3;
  opacity: 1;
}

/* Активная строка выделяется текстом, без фонового свечения. */
.ios-lyrics-sheet .lyrics-line::before { display: none; }
.ios-lyrics-sheet .lyrics-line.active { text-shadow: none; }

/* ---- Загрузка текста и «текста нет» в стиле Liquid Glass (2026-11-13) ----
   Экран текста всегда на тёмном фоне из цвета обложки, поэтому здесь — белое
   стекло: полупрозрачная заливка, светлый блик по верхней кромке и тонкий
   край, без акцентного свечения. */

/* Загрузка: заготовки строк мерцают волной сверху вниз, как в Apple Music. */
.lyrics-skeleton {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding-top: 8px;
}
.lyrics-skeleton i {
  display: block;
  width: var(--w, 70%);
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.16);
  opacity: 0.45;
  animation: lyrics-skel var(--dur-pulse) var(--ease-breathe) infinite alternate;
  animation-delay: calc(var(--i, 0) * 140ms);
}
@keyframes lyrics-skel {
  from { opacity: 0.35; }
  to { opacity: 1; }
}
.ios-lyrics-sheet:has(.lyrics-skeleton) .lyrics-vocal-control,
.ios-lyrics-sheet:has(.lyrics-skeleton, .ai-karaoke, .lyrics-empty-state) .lyrics-sing-action { display: none; }

/* «Текста нет», ожидание, ошибка. */
.ios-lyrics-sheet #lyricsContent .ai-karaoke { gap: 12px; padding: 24px 8px; }
.ios-lyrics-sheet #lyricsContent .ai-karaoke .ai-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--lyrics-ink); }
.ios-lyrics-sheet #lyricsContent .ai-sub { max-width: 300px; font-size: 15px; color: rgba(255, 255, 255, 0.68); }
.ios-lyrics-sheet #lyricsContent .ai-fine { color: rgba(255, 255, 255, 0.5); opacity: 1; }
.ios-lyrics-sheet #lyricsContent .ai-note { color: var(--lyrics-ink); background: rgba(255, 255, 255, 0.12); }

.ios-lyrics-sheet #lyricsContent .ai-badge,
.ios-lyrics-sheet #lyricsContent .ai-badge.is-quiet {
  width: 68px;
  height: 68px;
  margin-bottom: 8px;
  color: var(--lyrics-ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), inset 0 0 0 0.5px rgba(255, 255, 255, 0.2), 0 10px 28px rgba(0, 0, 0, 0.22);
}
.ios-lyrics-sheet #lyricsContent .ai-badge.is-quiet { color: rgba(255, 255, 255, 0.7); }
.ios-lyrics-sheet #lyricsContent .ai-badge svg { width: 30px; height: 30px; }

.ios-lyrics-sheet #lyricsContent .ai-btn {
  min-height: 50px;
  margin-top: 18px;
  padding: 0 28px;
  color: var(--lyrics-ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 0 0 0.5px rgba(255, 255, 255, 0.25), 0 10px 28px rgba(0, 0, 0, 0.24);
}
.ios-lyrics-sheet #lyricsContent .ai-btn:disabled { box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2); }

/* Пустой текст продолжает ритм строк, а не становится отдельной карточкой. */
.ios-lyrics-sheet #lyricsContent .ai-idle {
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  gap: var(--s3);
  padding: var(--s4) var(--s2);
  animation: ai-appear var(--dur-page) var(--ease) both;
}
.ios-lyrics-sheet #lyricsContent .ai-idle .ai-title {
  max-width: 12em;
  font-size: var(--t-large, 28px);
  line-height: 1.15;
  color: var(--lyrics-ink);
}
.ios-lyrics-sheet #lyricsContent .ai-idle .ai-sub,
.ios-lyrics-sheet #lyricsContent .ai-idle .ai-fine {
  color: color-mix(in srgb, var(--lyrics-ink) 78%, transparent);
  line-height: 1.4;
}
.ios-lyrics-sheet #lyricsContent .ai-idle .ai-btn {
  min-height: 44px;
  margin-top: var(--s2);
  padding: 0 var(--s4);
  border-radius: var(--r-pill);
  color: var(--lyrics-ink);
  background: color-mix(in srgb, var(--lyrics-ink) 16%, transparent);
  box-shadow: none;
}
.ios-lyrics-sheet #lyricsContent .ai-idle .ai-btn:focus-visible {
  outline: 2px solid var(--lyrics-ink);
  outline-offset: 3px;
}
/* Все действия ИИ-караоке используют тот же компактный язык, что и запуск. */
.ios-lyrics-sheet #lyricsContent .ai-karaoke .ai-btn,
.ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn {
  min-height: 44px;
  padding: 0 var(--s4);
  border-radius: var(--r-pill);
  color: var(--lyrics-ink);
  background: color-mix(in srgb, var(--lyrics-ink) 16%, transparent);
  box-shadow: none;
}
.ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn { max-width: 100%; }
.ios-lyrics-sheet #lyricsContent .ai-karaoke .ai-btn:disabled,
.ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn:disabled { box-shadow: none; }
.ios-lyrics-sheet #lyricsContent .ai-karaoke .ai-btn:focus-visible,
.ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn:focus-visible {
  outline: 2px solid var(--lyrics-ink);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn { transition: none; }
}
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn { transition: none; }
/* Ожидание занимает то же место, что и заглушка; движется только индикатор статуса. */
.ios-lyrics-sheet #lyricsContent :is(.ai-idle, .ai-running, .ai-failed) {
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  gap: var(--s3);
  padding: var(--s4) var(--s2);
}
.ios-lyrics-sheet #lyricsContent :is(.ai-running, .ai-failed) .ai-title {
  color: var(--lyrics-ink);
  font-size: var(--t-large, 28px);
  line-height: 1.15;
}
.ios-lyrics-sheet #lyricsContent .ai-dots { white-space: nowrap; }
.ios-lyrics-sheet #lyricsContent .ai-dots span {
  display: inline-block;
  animation: ai-dot-wave var(--dur-pulse) var(--ease-breathe) infinite;
}
.ios-lyrics-sheet #lyricsContent .ai-dots span:nth-child(2) { animation-delay: calc(var(--dur-pulse) / 6); }
.ios-lyrics-sheet #lyricsContent .ai-dots span:nth-child(3) { animation-delay: calc(var(--dur-pulse) / 3); }
@keyframes ai-dot-wave {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-0.13em); }
}
.ios-lyrics-sheet #lyricsContent :is(.ai-running, .ai-failed) .ai-sub {
  color: color-mix(in srgb, var(--lyrics-ink) 78%, transparent);
  line-height: 1.4;
}
@media (prefers-reduced-motion: reduce) {
  .ios-lyrics-sheet #lyricsContent :is(.ai-idle, .ai-running),
  .ios-lyrics-sheet #lyricsContent .ai-dots span { animation: none; }
}
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-idle { animation: none; }
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-running,
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-dots span { animation: none; }

/* Ожидание расшифровки: тот же орб, но белым светом, а не акцентным. */
.ios-lyrics-sheet #lyricsContent .ai-orb::before { background: conic-gradient(from 0deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)); }
.ios-lyrics-sheet #lyricsContent .ai-orb::after { background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 0 0 0.5px rgba(255, 255, 255, 0.2); }
.ios-lyrics-sheet #lyricsContent .ai-ring { border-color: rgba(255, 255, 255, 0.4); }
.ios-lyrics-sheet #lyricsContent .ai-bars i { background: var(--lyrics-ink); }

/* Короткие состояния («Инструментальная композиция», «Не удалось получить текст»). */
.ios-lyrics-sheet #lyricsContent .lyrics-empty-state .empty-icon { color: rgba(255, 255, 255, 0.7); opacity: 1; }
.ios-lyrics-sheet #lyricsContent .lyrics-empty-state .empty-title { font-size: 17px; }

@media (prefers-reduced-motion: reduce) { .lyrics-skeleton i { animation: none; opacity: 0.6; } }

/* Recognition states share the player's typography and a quiet, legible error cue. */
.ios-lyrics-sheet #lyricsContent .ai-running .ai-title {
  transition: opacity var(--dur-ai-swap) var(--ease-ai), transform var(--dur-ai-swap) var(--ease-ai);
}
.ios-lyrics-sheet #lyricsContent .ai-running .ai-title.is-swapping {
  opacity: 0;
  transform: translateY(-5px);
  transition-duration: var(--dur-ai-swap-fast);
}
.ios-lyrics-sheet #lyricsContent .ai-failed {
  position: relative;
  min-height: max-content;
  flex-shrink: 0;
  animation: none;
}
.ios-lyrics-sheet #lyricsContent .ai-error-morph {
  position: absolute;
  top: var(--s4);
  left: var(--s2);
  height: 32px;
  pointer-events: none;
  z-index: 1;
}
.ai-error-origin {
  position: absolute;
  left: 0;
  top: 0;
  width: min(80vw, 340px);
  color: var(--lyrics-ink);
  font-size: var(--t-large, 28px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  transform-origin: 14px 50%;
  animation: ai-error-gather var(--dur-ai-gather) var(--ease-ai-gather) both;
}
.ai-error-mark {
  display: block;
  width: 30px;
  height: 30px;
  color: var(--lyrics-alert);
  transform-origin: center;
  animation: ai-error-symbol var(--dur-ai-symbol) var(--ease-ai) both;
}
.ai-error-mark svg { display: block; width: 100%; height: 100%; }
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-title,
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-sub,
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-btn {
  animation: ai-error-unfold var(--dur-ai-unfold) var(--ease-ai) both;
}
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-title { animation-delay: 850ms; }
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-sub { animation-delay: 1000ms; }
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-btn { animation-delay: 1120ms; }
@keyframes ai-error-gather {
  0% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(.08); }
}
@keyframes ai-error-symbol {
  0%, 20% { opacity: 0; transform: scale(.35); }
  40%, 62% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.25); }
}
@keyframes ai-error-unfold {
  from { opacity: 0; transform: translateX(-8px) scaleX(.9); transform-origin: left center; }
  to { opacity: 1; transform: translateX(0) scaleX(1); transform-origin: left center; }
}
@media (prefers-reduced-motion: reduce) {
  .ios-lyrics-sheet #lyricsContent .ai-running .ai-title { transition: none; }
  .ios-lyrics-sheet #lyricsContent .ai-error-morph { display: none; }
  .ios-lyrics-sheet #lyricsContent .ai-failed :is(.ai-title, .ai-sub, .ai-btn) { animation: none; }
}
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-running .ai-title { transition: none; }
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-error-morph { display: none; }
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-failed :is(.ai-title, .ai-sub, .ai-btn) { animation: none; }
/* === dockgl.css === */
/* One material owner: native glass remains until a valid texture is ready. */
#floatingIslandDock .island-main-row.has-dockgl {
  --glass-blur: none;
  background: transparent;
}
.nm-dockgl {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}
.has-dockgl > .nm-dockgl { visibility: visible; }
.nm-dockgl canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter: var(--piece-tone);
}
.nm-dockgl-tint {
  position: absolute;
  inset: 0;
  background: var(--piece-tint);
}

/* === liquid.css === */
/* Adaptive app surfaces and the shared artist-style list rhythm. */
:root {
  --theme-ground: #101114;
  --theme-paper: #1b1c20;
  --theme-raised: #26272c;
  --bg: color-mix(in srgb, var(--accent) 7%, var(--theme-ground));
  --bg-surface: color-mix(in srgb, var(--accent) 8%, var(--theme-paper));
  --bg-surface-raised: color-mix(in srgb, var(--accent) 9%, var(--theme-raised));
  --glass-dock: color-mix(in srgb, var(--bg-surface) 80%, transparent);
  --glass-blur: blur(18px) saturate(1.25);
}
:root[data-scheme="light"] {
  --theme-ground: #f7f8fa;
  --theme-paper: #ffffff;
  --theme-raised: #e9ebef;
  --bg: color-mix(in srgb, var(--accent) 4%, var(--theme-ground));
  --bg-surface: color-mix(in srgb, var(--accent) 3%, var(--theme-paper));
  --bg-surface-raised: color-mix(in srgb, var(--accent) 4%, var(--theme-raised));
  --glass-dock: color-mix(in srgb, var(--bg-surface) 82%, transparent);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* #nowPlayingModal.player-fill-layer — капсула плеера на время закрытия (ниже, у её заливки):
   то же стекло мини-плеера, отдельной стеклянной поверхности не заводит. */
.island-main-row,
.island-mini-player,
#nowPlayingModal.player-fill-layer {
  background: var(--glass-dock);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-color: color-mix(in srgb, var(--text) 16%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 12%, transparent), 0 8px 24px rgba(0,0,0,.22);
}
/* The expanded navigation appears solid immediately, including during FLIP. */
.island-main-row { transition: border-radius var(--morph-d) var(--morph-e); }
.ios-player-modal { background: #15161a; }
.ios-player-modal .player-album-backdrop {
  inset: 0;
  opacity: 1;
  background: rgb(var(--tint, 65, 45, 75)) !important;
  filter: none;
  transform: none;
}
.ios-player-modal::after,
.ios-player-modal:not(.queue-mode)::after {
  background: linear-gradient(180deg, rgba(0,0,0,.20), rgba(0,0,0,.56));
}
/* Equalizer shares the quiet translucent controls of the lyrics view. */
.ios-player-modal #studioEqSheet .sheet-header {
  justify-content: flex-end;
  min-height: 44px;
  padding: 0 0 8px;
  border: 0;
}
#studioEqSheet .eq-master-toggle-wrap {
  min-height: 44px;
  padding: 0 10px;
  border-radius: 24px;
  background: rgba(255,255,255,.12);
}
#studioEqSheet .eq-master-toggle-wrap .ios-switch {
  width: 51px;
  height: 31px;
}
#studioEqSheet .eq-master-toggle-wrap .ios-switch-slider::before {
  width: 27px;
  height: 27px;
}
#studioEqSheet .ios-switch input:checked + .ios-switch-slider,
#studioEqSheet .ios-switch-sm input:checked + .ios-switch-slider { background: rgba(255,255,255,.48); }
.ios-player-modal #studioEqSheet .studio-sheet-body { padding-top: 4px; gap: 16px; }
#studioEqSheet :is(.eq-glass-card,.simple-band-card,.eq-sliders-board) {
  background: rgba(255,255,255,.10);
  border: 0;
  border-radius: 16px;
  box-shadow: none;
}
#studioEqSheet .eq-knob-card { padding: 16px; }
#studioEqSheet .card-tag { color: rgba(255,255,255,.82); font-size: 13px; }
#studioEqSheet .knob-readout { font-size: 25px; font-weight: 600; letter-spacing: -.02em; }
#studioEqSheet .eq-mode-segments { border-radius: 12px; background: rgba(255,255,255,.10); }
#studioEqSheet .eq-seg-btn { border-radius: 9px; }
#studioEqSheet .eq-seg-btn.active { background: rgba(255,255,255,.24); color: #fff; }
#studioEqSheet .eq-range-slider { min-height: 44px; }
/* Legacy utility rows keep their own layout, separate from music rows. */
body :is(.offline-row,.playlist-catalog-item,.sync-service,.sync-run) {
  min-height: 74px;
  gap: 14px;
  margin: 0;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body :is(.offline-row-thumb,.playlist-catalog-art) {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 8px;
}
body :is(.offline-row-title,.playlist-catalog-title,.sync-pl-title) {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.015em;
}
body :is(.offline-row-artist,.playlist-catalog-sub,.sync-pl-meta) {
  font-size: 15px;
  line-height: 1.35;
  color: var(--text-secondary);
}
body .sync-pl { border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0; background: transparent; padding: 16px 0; }
.sync-service { font-size: 17px; }
.sync-run { font-size: 15px; }
@supports not (backdrop-filter: blur(1px)) {
  .island-main-row,.island-mini-player { background: var(--bg-surface); }
}

.island-circle-nav-btn.active { background: var(--accent-soft); }
.match-input { min-height: 44px; box-sizing: border-box; font-size: 15px; border-radius: 12px; }
.match-artists { flex-direction: column; align-items: stretch; gap: 0; }
.match-chip { padding: 14px 0; border-radius: 0; border-bottom: 1px solid var(--border-subtle); background: transparent; font-size: 17px; }
.ios-library-nav-menu .ios-menu-item {
  min-height: 64px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
}
.ios-library-nav-menu .menu-item-left { gap: 14px; }
.ios-library-nav-menu .menu-label { font-size: 17px; font-weight: 600; }

/* One control language: pill actions, 6px rails and 22px round handles. */
:root {
  --control-radius: 999px;
  --control-surface-radius: 28px;
  --slider-rail-size: 6px;
  --slider-handle-size: 22px;
  --slider-rail: color-mix(in srgb, var(--text) 24%, transparent);
  --slider-ink: var(--text);
}
:is(.ios-player-modal,.ios-lyrics-sheet,.ios-studio-sheet) {
  --slider-rail: rgba(255,255,255,.28);
  --slider-ink: #fff;
}
.ios-player-modal.equalizer-mode .player-modal-scroll-body { row-gap: 12px; }
.ios-player-modal #studioEqSheet .sheet-header {
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}
#studioEqSheet .sheet-header .eq-mode-segments { flex: 1; min-width: 0; margin: 0; }
#studioEqSheet .eq-master-toggle-wrap { padding: 0 8px; }
#studioEqSheet :is(.eq-mode-segments,.eq-seg-btn,.eq-glass-select,.eq-glass-select-sm,.tempo-pill) { border-radius: var(--control-radius); }
#studioEqSheet :is(.eq-glass-card,.simple-band-card,.eq-sliders-board,.eq-collapsible-fx) { border-radius: var(--control-surface-radius); }
#studioEqSheet .studio-sheet-body { --scroll-mask-top: 0px; }
#studioEqSheet .eq-nav-bar { margin: 0; }
#studioEqSheet .simple-band-card { padding-top: 18px; padding-bottom: 18px; }
#studioEqSheet .band-tag { font-size: 12px; color: rgba(255,255,255,.8); }
#studioEqSheet .band-freq-sub { color: rgba(255,255,255,.72); }

/* Эквалайзер встроен в плеер и использует его полупрозрачные поверхности. */
.ios-player-modal #studioEqSheet .sheet-header { align-items: center; padding: 0 0 10px; }
#studioEqSheet .eq-heading { min-width: 0; }
#studioEqSheet .eq-heading h3 { margin: 0; color: #fff; font-size: 22px; line-height: 1.15; letter-spacing: -.025em; }
#studioEqSheet .eq-heading > span { display: block; margin-top: 4px; color: rgba(255,255,255,.7); font-size: 12px; }
#studioEqSheet .eq-master-toggle-wrap { background: transparent; padding: 0; }
.ios-player-modal #studioEqSheet .studio-sheet-body {
  gap: 12px;
  padding-top: 4px;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 30px), transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 30px), transparent 100%);
}
#studioEqSheet .studio-sheet-body > .eq-mode-segments { order: 0; flex: 0 0 auto; }
#studioEqSheet .studio-sheet-body > .eq-nav-bar { order: 1; }
#studioEqSheet .studio-sheet-body > .eq-mode-view { order: 2; }
#studioEqSheet .studio-sheet-body > .eq-volume-label { order: 3; margin: 2px 0 -10px; color: rgba(255,255,255,.82); }
#studioEqSheet .studio-sheet-body > .ios-modal-volume-row { order: 4; margin: 0; }
#studioEqSheet .studio-sheet-body > .eq-card-cluster { order: 5; }
#studioEqSheet .studio-sheet-body > .eq-spatial-card { order: 6; }
#studioEqSheet .studio-sheet-body > .eq-curve-card { order: 7; }
#studioEqSheet .studio-sheet-body > .eq-collapsible-fx { order: 8; }
#studioEqSheet .eq-summary-row { -webkit-tap-highlight-color: transparent; }
#studioEqSheet .eq-summary-row:focus-visible { outline: none; }
#studioEqSheet .eq-summary-row:focus-visible > span:first-child { text-decoration: underline; text-underline-offset: 4px; }
#studioEqSheet .simple-eq-grid {
  gap: 0;
  padding: 16px 8px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--control-surface-radius);
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
#studioEqSheet .simple-eq-grid .simple-band-card { padding: 0 4px; gap: 5px; background: transparent; border: 0; }
#studioEqSheet .simple-eq-grid .band-tag { color: rgba(255,255,255,.8); font-size: 11px; letter-spacing: .02em; }
#studioEqSheet .simple-eq-grid .knob-container { height: 105px; }
#studioEqSheet .simple-eq-grid .band-knob-slider { width: 105px; }
#studioEqSheet .simple-eq-grid .band-db-badge { font-size: 14px; }
#studioEqSheet .simple-eq-grid .band-freq-sub { font-size: 10px; color: rgba(255,255,255,.65); white-space: nowrap; }
#studioEqSheet :is(.eq-glass-card,.eq-sliders-board,.eq-glass-select,.eq-reset-btn,.eq-collapsible-fx) {
  border: 1px solid rgba(255,255,255,.1);
  background-color: rgba(255,255,255,.08);
}
body :is(.sync-btn,.dialog-btn,.tempo-pill,.match-share-btn,.recognize-link-btn,.ai-btn) { border-radius: var(--control-radius); }
:is(#studioEqSheet,#nowPlayingModal,#lyricsPanel,body) input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  height: 44px;
  background: transparent;
  cursor: pointer;
}
:is(#studioEqSheet,#nowPlayingModal,#lyricsPanel,body) input[type="range"]::-webkit-slider-runnable-track {
  height: var(--slider-rail-size);
  border-radius: var(--control-radius);
  background: var(--slider-rail);
}
:is(#studioEqSheet,#nowPlayingModal,#lyricsPanel,body) input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: var(--slider-handle-size);
  height: var(--slider-handle-size);
  margin-top: -8px;
  border: 0;
  border-radius: 50%;
  background: var(--slider-ink);
  box-shadow: 0 2px 6px rgba(0,0,0,.22);
}
:is(#studioEqSheet,#nowPlayingModal,#lyricsPanel,body) input[type="range"]::-moz-range-track {
  height: var(--slider-rail-size);
  border-radius: var(--control-radius);
  background: var(--slider-rail);
}
:is(#studioEqSheet,#nowPlayingModal,#lyricsPanel,body) input[type="range"]::-moz-range-thumb {
  width: var(--slider-handle-size);
  height: var(--slider-handle-size);
  border: 0;
  border-radius: 50%;
  background: var(--slider-ink);
  box-shadow: 0 2px 6px rgba(0,0,0,.22);
}
.ios-player-modal .player-fixed-controls .ios-slider-track,
.ios-player-modal:not(.queue-mode) .ios-slider-track { height: var(--slider-rail-size); border-radius: var(--control-radius); }
.ios-player-modal .player-inline-panel .lyrics-vocal-control {
  width: 44px;
  background: transparent;
  box-shadow: none;
  border-radius: var(--control-radius);
}
.lyrics-vocal-control .lyrics-vocal-fill { display: none; }
#karaokeVocalLevel {
  opacity: 1;
  writing-mode: horizontal-tb;
  direction: ltr;
  inset: auto;
  left: 50%;
  top: 44%;
  width: 92px;
  transform: translate(-50%,-50%) rotate(-90deg);
}
.ios-player-modal .player-inline-panel .lyrics-vocal-control svg {
  left: 14px;
  top: auto;
  bottom: 4px;
  width: 16px;
  height: 16px;
  mix-blend-mode: normal;
}
.slider-thumb-track {
  position: absolute;
  left: 11px;
  right: 11px;
  top: -8px;
  height: var(--slider-handle-size);
  pointer-events: none;
  transform: translateX(0%);
  will-change: transform;
}
.slider-thumb-track::before {
  content: "";
  position: absolute;
  left: -11px;
  width: var(--slider-handle-size);
  height: var(--slider-handle-size);
  border-radius: 50%;
  background: var(--slider-ink);
  box-shadow: 0 2px 6px rgba(0,0,0,.22);
}

/* Shared transparent glass for filters, search and compact actions. */
:root {
  --glass-control: color-mix(in srgb, var(--bg-surface-raised) 38%, transparent);
  --glass-control-edge: color-mix(in srgb, var(--text) 16%, transparent);
  --glass-control-highlight: rgba(255,255,255,.12);
  --glass-control-selected: color-mix(in srgb, var(--accent) 18%, transparent);
  --glass-dock: color-mix(in srgb, var(--bg-surface) 58%, transparent);
}
:root[data-scheme="light"] {
  --glass-control: rgba(255,255,255,.30);
  --glass-control-edge: color-mix(in srgb, var(--accent) 12%, transparent);
  --glass-control-highlight: rgba(255,255,255,.62);
  --glass-control-selected: color-mix(in srgb, var(--accent) 12%, transparent);
  --glass-dock: color-mix(in srgb, var(--bg-surface) 54%, transparent);
}
body :is(.genre-bubble-card,.mood-chip,.chart-chip,.playlist-chip,.search-bottom-dock .ios-search-input-pill,.charts-page-search-btn,.charts-page-search-clear,.search-browse-home,.search-dismiss-btn,.search-retry-btn,.charts-page-search) {
  background: var(--glass-control);
  color: var(--text);
  border: 1px solid var(--glass-control-edge);
  border-radius: var(--control-radius);
  box-shadow: inset 0 1px 0 var(--glass-control-highlight), 0 3px 10px rgba(0,0,0,.05);
}
/* Бюджет стекла: размытие держат только плавающие поля и кнопки (поиск в доке,
   шапка чартов). Чипы и кнопки, которые прокручиваются вместе со страницей,
   его не держат: под ними ровный фон, размытие его не меняет, а пересчитывалось
   бы на каждом кадре прокрутки. Кнопка внутри стеклянного поля — тоже без
   своего: стекло в стекле ничего не добавляет. */
body :is(.search-bottom-dock .ios-search-input-pill,.charts-page-search-btn,.charts-page-search-clear,.search-browse-home,.charts-page-search) {
  backdrop-filter: var(--glass-blur-control);
  -webkit-backdrop-filter: var(--glass-blur-control);
}
body #homeTab .genre-bubble-card.is-active,
body .chart-chip.is-active,
body .playlist-chip.active {
  background: var(--glass-control-selected);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-control-highlight);
}
body .chart-chip { min-height: 36px; }
body .search-bottom-dock .ios-search-input-pill,
body .search-bottom-dock .search-browse-home { background: var(--glass-control); }
@supports not (backdrop-filter: blur(1px)) {
  body :is(.genre-bubble-card,.mood-chip,.chart-chip,.playlist-chip,.search-bottom-dock .ios-search-input-pill,.charts-page-search-btn,.charts-page-search-clear,.search-browse-home,.search-dismiss-btn,.search-retry-btn,.charts-page-search) { background: var(--bg-surface); }
}
#homeGenresGrid .genre-bubble-card {
  background: var(--glass-control);
  border-color: var(--glass-control-edge);
}
body #homeGenresGrid .genre-bubble-card.is-active .genre-title { color: var(--accent); }
:root { --glass-blur: blur(28px) saturate(1.35) brightness(.65); }
:root[data-scheme="light"] { --glass-blur: blur(28px) saturate(1.35); }

/* Playlist detail: proportions and controls per the card reference. */
#playlistsDetailView .playlist-stage-header { padding: 4px 0 20px; }
#playlistsDetailView .playlist-art-stage {
  width: min(46vw, 190px);
  height: min(46vw, 190px);
  margin: 0 auto 18px;
  isolation: isolate;
}
#playlistsDetailView .playlist-art-wrap {
  border-radius: 20px;
  background: var(--bg-surface);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}
#playlistsDetailView .playlist-art-glow { opacity: 0; }
#playlistsDetailView .playlist-hero-title { margin: 0 0 6px; font-size: 28px; font-weight: 700; }
#playlistsDetailView .playlist-hero-sub { margin: 0 0 18px; line-height: 1.4; }
#playlistsDetailView .playlist-action-dual-buttons { width: 100%; gap: 12px; }
#playlistsDetailView :is(.playlist-btn-primary,.playlist-btn-secondary) {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  padding: 13px 10px;
  border-radius: 999px;
  border: 0;
  box-shadow: none;
  font-size: 16px;
  font-weight: 600;
}
#playlistsDetailView .playlist-btn-primary { background: var(--accent-fill); color: var(--accent-on); }
#playlistsDetailView .playlist-btn-secondary { background: var(--bg-surface-raised); color: var(--text); }
#playlistsDetailView #playlistViewNav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: auto;
  min-height: 52px;
  margin: 0 calc(var(--page-gutter) * -1);
  padding: calc(var(--tg-header-clearance) + 6px) var(--page-gutter) 8px;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  box-shadow: none;
}
#playlistViewNav .subview-nav-right-slot { margin-left: auto; gap: 8px; }
#playlistViewNav :is(#playlistMoreBtn,#saveOrderBtn) {
  width: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: var(--bg-surface-raised);
  border: 0;
  color: var(--text);
}
@media (max-width: 360px) {
  #playlistsDetailView .playlist-action-dual-buttons { gap: 10px; }
  #playlistsDetailView :is(.playlist-btn-primary,.playlist-btn-secondary) { font-size: 15px; }
}
#playlistsDetailView .playlist-stage-header { padding-top: 4px; }

/* Панель выбора: два стеклянных острова — кружок-счётчик и капсула действий,
   одинаковой высоты (64, как ряд дока). Кнопки в капсуле — плоские колонки
   «значок + подпись» без своего стекла (стекла в стекле нет); острова
   перетекают в док и обратно — selectionParts в island.js. */
#selectBar {
  bottom: calc(var(--sab) + 8px);
  height: 64px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}
#selectBar .select-bar-count,
#selectBar .select-bar-actions {
  box-sizing: border-box;
  background: var(--glass-dock);
  border: 1px solid var(--glass-control-edge);
  box-shadow: inset 0 1px 0 var(--glass-control-highlight), 0 10px 28px rgba(0,0,0,.12);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  pointer-events: auto;
}
#selectBar .select-bar-count {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}
#selectBar .select-bar-actions {
  flex: 1;
  min-width: 0;
  height: 64px;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 8px;
  border-radius: 32px;
  overflow: hidden;
}
#selectBar .select-bar-btn {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 6px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: opacity var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}
#selectBar .select-bar-btn svg { width: 21px; height: 21px; }
.select-action-label {
  position: static;
  transform: none;
  font-size: 10.5px;
  line-height: 12px;
  white-space: nowrap;
}
#selectBar .select-bar-danger { color: #ff766b; }
:root[data-scheme="light"] #selectBar .select-bar-danger { color: #bd2d25; }
#selectBar #selectDoneBtn { color: var(--accent); }
#selectAllBtn[aria-pressed="true"] { color: var(--accent); }
#selectBar .select-bar-btn:disabled { opacity: .4; }
/* Real pieces carry content only while the shared outline owns the glass. */
body.is-selecting #floatingIslandDock { visibility: hidden; pointer-events: none; }
body.is-selecting #floatingIslandDock * { pointer-events: none; }
#selectBar.sel-morphing { z-index: 1501; }
#floatingIslandDock .sel-flight-content,
#selectBar .sel-flight-content { visibility: visible; transition: none; }
body :is(#floatingIslandDock, #selectBar) .sel-skeleton {
  overflow: visible;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.sel-skeleton > :is(.nm-backlens, .mini-progress-fill) { visibility: hidden; }
.selection-liquid {
  position: fixed;
  inset: 0;
  z-index: 1499;
  pointer-events: none;
}
.selection-liquid > :is(.pop-liquid, .pop-liquid-rim) { position: absolute; }
.selection-liquid .lq-rim { stroke: var(--dock-rim); }
:root[data-glass="solid"] .selection-liquid .pop-liquid { background: var(--bg-surface); }
body:has(#floatingIslandDock.dock-compact) #selectBar { height: 58px; }
body:has(#floatingIslandDock.dock-compact) #selectBar .select-bar-count {
  flex-basis: 58px; width: 58px; height: 58px; border-radius: 29px;
}
body:has(#floatingIslandDock.dock-compact) #selectBar .select-bar-actions {
  height: 58px; border-radius: 29px;
}
body:has(#floatingIslandDock.dock-compact) #selectBar .select-action-label { display: none; }
@media (max-width: 380px) {
  #selectBar .select-bar-count { flex-basis: 54px; width: 54px; }
  #selectBar .select-bar-actions { padding: 0 6px; }
  #selectBar .select-action-label { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #selectBar .select-bar-btn, #selectBar .select-action-label { transition: none; }
}

#playlistsDetailView #playlistViewNav .subview-nav-right-slot {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
#playlistViewNav :is(#detailSelectBtn,#playlistMoreBtn,#saveOrderBtn) {
  background: var(--bg-surface-raised);
  border: 0;
  box-shadow: none;
}

/* The player grows from its dock capsule; no independent slide or fade. */
#nowPlayingModal { animation: none; }
#floatingIslandDock.dock-hidden { transform: none; opacity: 1; visibility: hidden; }

/* Native Music-style presentation: the actual surface grows, not a reveal mask. */
#nowPlayingModal { clip-path: none; border-radius: min(32px, 8.333vw); }
#nowPlayingModal.player-morphing { will-change: transform; }
/* Закрытие: тёмный фон капсулы редеет ещё в полёте, и под стеклом мини-плеера заранее
   проступает то, что будет там в конце (владелец 16.11, ночь: «последний кадр … оттенок
   резко пропадает»). На время перехода заливка плеера переезжает в #playerMorphFill (цвет
   кладёт app.js в --player-fill), чтобы гасить её одной прозрачностью, без перерисовки.
   Отдельный элемент, а не ::before: только что созданный псевдоэлемент Chrome на ходу
   анимации не рисовал вовсе. !important — заливку полноэкранного вида задаёт
   player-reference.css более узким правилом. */
#nowPlayingModal .player-morph-fill { display: none; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: var(--player-fill, transparent); }
#nowPlayingModal.player-fill-layer .player-morph-fill { display: block; }
#nowPlayingModal.player-fill-layer {
  /* Под гаснущей заливкой — то же стекло, что у мини-плеера (фильтр и тон копирует app.js,
     фильтр не анимируется): к передаче острову капсула выглядит как он, смена незаметна. */
  background: var(--player-glass-bg, transparent) !important;
  --glass-blur: var(--player-glass-filter, none);
  /* Капля: покадровое скругление едет на плоском .player-morph-fill (см. app.js
     playerLiquidSkinAnimation), а не на клипе всей модалки — собственный радиус
     модалки на время полёта квадратный, иначе он срезал бы силуэт fill'а. */
  border-radius: 0;
}
/* Слои, рисующие всю рамку модалки, на время полёта гаснут: иначе их квадратный
   край накрыл бы скруглённый силуэт капсулы-fill'а. У бэкдропа и ::after при
   закрытии свои WAAPI-анимации (они сильнее этого правила), при открытии слой
   просто прячется, а после посадки проявляется переходом. */
#nowPlayingModal .player-album-backdrop { transition: opacity var(--dur-fast) var(--ease); }
#nowPlayingModal.player-morphing .player-album-backdrop,
#nowPlayingModal.player-morphing::after { opacity: 0; transition: none; }
#nowPlayingModal.player-morphing .player-modal-scroll-body { mask-image: none; -webkit-mask-image: none; overflow: visible; }
/* Кнопки полосы Telegram (.tg-band, «Поделиться») прибиты к экрану через position: fixed,
   но пока предки плеера под transform, «экран» для них — едущая нижняя панель, и кнопка
   ехала внизу, а на последнем кадре прыгала наверх (владелец 16.11). На время перехода
   прячем; после посадки она проступает своим переходом opacity (.tg-band, style.css). */
#nowPlayingModal.player-morphing .tg-band { opacity: 0; transition: none; }

/* Persistent compositing for glass surfaces across WebView suspension. */
.island-main-row, .island-mini-player,
.search-bottom-dock .ios-search-input-pill, .search-browse-home {
  transform: translateZ(0);
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* One WAAPI clock owns scroll morphs; CSS must not race its measurements. */
.island-main-row, .island-mini-player { transition: none; }
.ios-floating-island-dock.dock-morphing :is(.island-circle-nav-btn, .dock-tab-label, .mini-ctrl-btn) { transition: none; }
/* При сжатии мини-плеер опускается поверх сужающейся капсулы, иконки — над обоими. */
.island-mini-player { z-index: 1; }
.island-circle-nav-btn { z-index: 2; }

/* ==========================================================================
   Этап 4: бюджет стекла и его уровни. html[data-glass] ставит core/quality.js.
   Стекло есть только у двух видов поверхностей, у каждого свой токен:
     --glass-blur          закреплённые поверхности: док, мини-плеер, шторки,
                           меню, тост, диалоги;
     --glass-blur-control  плавающие поля и кнопки поверх содержимого (поиск
                           в доке, шапка чартов).
   Всё, что прокручивается вместе со страницей (чипы, значки на обложках,
   кнопки в шапках), и затемнение под шторкой стекла не держат: под ними либо
   ровный фон, либо тёмная подложка — размытие не видно, а платится каждый
   кадр. Шторка поверх стеклянного затемнения была бы стеклом в стекле.
   Уровень меняет токены, а не правила:
     full  — Liquid Glass как задуман;
     lite  — короткое размытие только у закреплённых поверхностей, они
             плотнее: без размытия содержимое под ними не должно читаться;
     solid — без размытия, непрозрачные поверхности (энергосбережение).
   ========================================================================== */
:root {
  --glass-blur-control: blur(16px) saturate(1.2);
}
:root[data-glass="lite"] {
  --glass-blur: blur(14px);
  --glass-blur-control: none;
  --glass-dock: color-mix(in srgb, var(--bg-surface) 90%, transparent);
  --glass-control: color-mix(in srgb, var(--bg-surface-raised) 86%, transparent);
}
:root[data-glass="solid"] {
  --glass-blur: none;
  --glass-blur-control: none;
  --glass-dock: var(--bg-surface);
  --glass-bg: var(--bg-surface);
  --glass-control: var(--bg-surface-raised);
}
/* Размытая обложка за плеером, текстом и эквалайзером — тот же расход, что у
   стекла (большой слой с фильтром). Размытая обложка на глаз — её средний
   цвет, а он уже посчитан (--tint), поэтому в облегчённом и энергосбережении
   вместо неё ровная заливка этим цветом: вид тот же, фильтра нет. !important — картинку
   ставит app.js в style элемента. */
:root:is([data-glass="lite"], [data-glass="solid"]) :is(.player-album-backdrop, .lyrics-backdrop, .eq-backdrop) {
  background: rgb(var(--tint, 65, 45, 75)) !important;
  filter: none;
}
:root[data-glass="solid"] .playlist-art-glow { display: none; }
:root[data-glass="solid"] .ai-orb::before { filter: none; }
/* Размытие строк текста — свой слой с фильтром у каждой строки и переход
   фильтра при смене строки. На слабом телефоне строки различаются цветом. */
:root:is([data-glass="lite"], [data-glass="solid"]) .ios-lyrics-sheet .lyrics-line { filter: none; }

/* ==========================================================================
   Этап 5: альбомная раскладка плеера (раздел 11 плана). Поворот разрешён,
   только пока плеер открыт (core/platform.js), остальной интерфейс портретный.
   Две колонки вместо столбца: в виде «обложка» слева обложка с названием,
   справа управление; в очереди, тексте и эквалайзере слева управление, справа
   содержимое. Вырез камеры — сбоку, поэтому поля по бокам из safe-area.
   ========================================================================== */
@media (orientation: landscape) and (max-height: 540px) {
  .ios-player-modal:is(.queue-mode,:not(.queue-mode)) {
    --land-l: max(var(--sal), 24px);
    --land-r: max(var(--sar), 24px);
    --land-top: calc(var(--tg-header-clearance) + 4px);
    --land-bottom: max(var(--sab), 12px);
    --land-gap: 28px;
  }
  .ios-player-modal .player-modal-grabber { display: none; }
  .ios-player-modal:is(.queue-mode,:not(.queue-mode)) .player-modal-nav { height: 0; flex-basis: 0; }

  /* Общие колонки: тело и управление стоят рядом, а не друг над другом. */
  .ios-player-modal:is(.queue-mode,:not(.queue-mode)) .player-modal-scroll-body,
  .ios-player-modal .player-fixed-controls {
    top: var(--land-top);
    bottom: var(--land-bottom);
    height: auto;
    max-width: none;
    translate: none;
  }
  .ios-player-modal .player-fixed-controls {
    grid-template-rows: 38px minmax(64px, 1fr) 26px 44px;
    gap: 10px;
    align-content: center;
  }
  .ios-player-modal:is(.queue-mode,:not(.queue-mode)) .player-fixed-controls .player-dock-cell { height: 44px; min-height: 44px; }

  /* Обложка: слева обложка и название, справа управление. */
  .ios-player-modal:not(.queue-mode) .player-modal-scroll-body {
    left: var(--land-l);
    right: auto;
    width: calc(46% - var(--land-l));
    padding: 0;
    gap: 10px;
  }
  .ios-player-modal:not(.queue-mode) .player-fixed-controls {
    left: auto;
    right: var(--land-r);
    width: calc(54% - var(--land-r) - var(--land-gap));
  }
  .ios-player-modal:not(.queue-mode) .ios-track-meta { margin: 0; }
  .ios-player-modal:not(.queue-mode) .ios-track-title { font-size: 20px; }

  /* Очередь, текст, эквалайзер: слева управление, справа содержимое. */
  .ios-player-modal.queue-mode .player-fixed-controls {
    left: var(--land-l);
    right: auto;
    width: calc(40% - var(--land-l));
  }
  .ios-player-modal.queue-mode .player-modal-scroll-body {
    left: auto;
    right: var(--land-r);
    width: calc(60% - var(--land-r) - var(--land-gap));
    padding: 0;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: 56px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 12px;
  }
  .ios-player-modal.queue-mode .ios-art-card { width: 56px; height: 56px; }
  .ios-player-modal.queue-mode .ios-track-title { font-size: 17px; }
  .ios-player-modal.queue-mode .ios-track-artist { font-size: 14px; }
  .ios-player-modal.lyrics-mode .ios-lyrics-sheet .lyrics-line { font-size: 28px; }

  /* В альбомной ориентации видео и управление остаются соседними областями. */
  #nowPlayingModal.clip-mode .player-modal-nav {
    position: absolute; top: 0; left: 0; right: 0; z-index: 3;
    height: 44px; margin: 0; padding: 0 var(--land-l);
  }
  #nowPlayingModal.clip-mode .clip-close-btn { left: var(--land-l); bottom: 2px; }
  #nowPlayingModal.clip-mode .clip-nav-label { display: none; }
  #nowPlayingModal.clip-mode .player-modal-scroll-body {
    position: absolute; inset: 0 42% 0 0; width: auto; max-width: none; height: auto;
    padding: 48px 8px 12px var(--land-l); display: flex; justify-content: center; gap: 0;
  }
  #nowPlayingModal.clip-mode .ios-art-stage { position: relative !important; inset: auto; width: 100%; }
  #nowPlayingModal.clip-mode .clip-media-host { position: relative; inset: auto; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-card); }
  #nowPlayingModal.clip-mode .ios-track-meta {
    position: fixed; top: 50px; left: 60%; right: var(--land-r); margin: 0;
    align-items: flex-start;
  }
  #nowPlayingModal.clip-mode .player-fixed-controls {
    position: absolute; top: auto; bottom: var(--land-bottom); left: 60%; right: var(--land-r);
    translate: none; width: auto; height: auto; margin: 0; padding: 0;
    grid-template-columns: 1fr; grid-template-rows: auto 64px 44px; gap: var(--s3); background: none;
  }
  #nowPlayingModal.clip-mode .player-fixed-controls .ios-controls-cluster { grid-area: auto; gap: var(--s3); }
  #nowPlayingModal.clip-mode .player-fixed-controls .ios-scrubber-section { grid-area: auto; }
  #nowPlayingModal.clip-mode .ios-modal-volume-row { display: none; }
  #nowPlayingModal.clip-mode.clip-chrome-hidden :is(.ios-track-meta, .player-fixed-controls) { opacity: 1; pointer-events: auto; }
  #nowPlayingModal.clip-mode.clip-chrome-hidden .clip-media-host::after { content: none; }
  #nowPlayingModal.clip-mode::after { content: none; }

}

/* Мини-плеер и таб-бар по образцу Apple Music iOS 26 (скрин владельца 16.11, ночь:
   «вот так должен выглядеть плеер … за исключением новых кнопок»). Набор кнопок свой
   (⏮ ▶ ⏭, Главная/Медиатека/Поиск), меняется только вид: крупное чёрное название,
   артист обычным начертанием, обложка-квадрат со скруглением, крупные сплошные иконки,
   серая плашка выбранной вкладки. Высоты, зазор и позиции не трогаются — от них считают
   сжатие дока (island.js) и перетекание плеера (app.js). */
#floatingIslandDock .island-mini-player { gap: 12px; }
#floatingIslandDock .mini-art-wrap { width: 36px; height: 36px; border-radius: 7px; border: 0; }
#floatingIslandDock .mini-info { gap: 0; }
#floatingIslandDock .mini-title { font-size: 15px; line-height: 19px; font-weight: 600; letter-spacing: -.2px; color: var(--text); }
#floatingIslandDock .mini-artist { font-size: 14px; line-height: 18px; letter-spacing: -.15px; color: color-mix(in srgb, var(--text) 82%, transparent); }
#floatingIslandDock .mini-ctrl-btn { color: var(--text); }
#floatingIslandDock .mini-ctrl-btn svg { width: 26px; height: 26px; }
#floatingIslandDock .island-circle-nav-btn { gap: 2px; }
#floatingIslandDock .island-circle-nav-btn svg { width: 27px; height: 27px; }
#floatingIslandDock .island-circle-nav-btn svg[fill="none"] { stroke-width: 2.3; }
/* Плашка выбранной вкладки — нейтральная серая, как у Apple; цвет акцента — у иконки и
   подписи. В сжатом виде и под живой линзой своя заливка — их не перебиваем. */
#floatingIslandDock:not(.dock-compact, .lens-live, .lens-settling) .island-circle-nav-btn.active {
  background: color-mix(in srgb, var(--text) 9%, transparent);
}
/* === player-reference.css === */
@property --cover-feather {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}
@property --cover-stage-feather {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}
@property --cover-flight-progress {
  syntax: "<number>";
  inherits: false;
  initial-value: 1;
}
/* Full-bleed player composition from the owner's 16.11 reference.
   Other player views retain their existing layout and shared controls. */
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) {
  --player-art-h: 56.5dvh;
  background: rgb(var(--player-ambient-tint, 28, 28, 28));
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode)::after {
  background: linear-gradient(180deg, transparent 35%, rgb(25 22 21 / .08) 60%, rgb(25 22 21 / .28) 100%);
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .player-album-backdrop {
  display: block;
  opacity: 1;
  overflow: hidden;
  filter: none;
  background: rgb(var(--player-ambient-tint, 28, 28, 28)) !important;
}
/* --player-artwork — заранее размытая мини-копия обложки (applyPlayerTint): дрейф
   двигает готовую картинку transform-ом, размытие на кадре не считается. */
#nowPlayingModal:not(.clip-mode) .player-album-backdrop::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: var(--player-artwork, none) center / cover no-repeat;
  opacity: .88;
  filter: brightness(.62) saturate(1.38);
  animation: album-ambient-drift var(--dur-ambient-slow) var(--ease-breathe) infinite alternate;
}
:root[data-glass="lite"] #nowPlayingModal .player-album-backdrop::before { animation: none; }
#nowPlayingModal:not(.clip-mode) .player-album-backdrop::after {
  display: none;
}
#nowPlayingModal.hidden .player-album-backdrop::before,
#nowPlayingModal.hidden .player-album-backdrop::after { animation-play-state: paused; }
/* Скрытый плеер остаётся в раскладке (visibility вместо display:none): первый
   кадр открытия не монтирует поддерево из 200+ узлов — только снимает видимость.
   Замер 22.11: display:none→flex на полноэкранном плеере сжигал 180–260 мс на
   iPhone до первого кадра анимации. */
#nowPlayingModal.hidden {
  display: block !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
@media (prefers-reduced-motion: reduce) {
  #nowPlayingModal .player-album-backdrop::before,
  #nowPlayingModal .player-album-backdrop::after { animation: none; }
  #nowPlayingModal .player-album-backdrop::after { opacity: .5; }
}
html:is([data-motion="instant"], [data-player-backdrop-static]) #nowPlayingModal .player-album-backdrop::before,
html:is([data-motion="instant"], [data-player-backdrop-static]) #nowPlayingModal .player-album-backdrop::after { animation: none; }
html:is([data-motion="instant"], [data-player-backdrop-static]) #nowPlayingModal .player-album-backdrop::after { opacity: .5; }
:root[data-glass="lite"] #nowPlayingModal .player-album-backdrop::after { display: none; }
:root[data-glass="solid"] #nowPlayingModal .player-album-backdrop::before,
:root[data-glass="solid"] #nowPlayingModal .player-album-backdrop::after { display: none; }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .player-modal-nav {
  position: absolute;
  inset: 0 0 auto;
  margin: 0;
  height: 0;
  padding: 0;
  z-index: 4;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .player-modal-grabber {
  top: max(62px, calc(var(--sat) + 7px));
  left: 50%;
  width: 80px;
  height: 22px;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .player-modal-grabber::before {
  width: 60px;
  height: 4px;
  border-radius: 2px;
  background: rgb(255 255 255 / .55);
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .player-modal-scroll-body {
  position: absolute;
  top: 0;
  bottom: auto;
  left: 0;
  right: 0;
  translate: none;
  width: 100%;
  max-width: none;
  height: 63.5dvh;
  display: block;
  padding: 0;
  margin: 0;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-art-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--player-art-h);
  min-height: 0;
  padding: 0;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-art-card {
  width: 100%;
  max-width: none;
  height: 100%;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-art-card :is(img, video) {
  object-fit: cover;
  object-position: center;
  -webkit-mask-image: none;
  mask-image: none;
}
/* При паузе нижний край мягко растворяется в размытый цветной фон плеера статичной маской (0 перерисовок маски в движении). */
#nowPlayingModal:not(.queue-mode):not(.clip-mode) .ios-art-card {
  --cover-square: max(0px, min(calc(100vw - 64px), calc(var(--player-art-h) - 80px)));
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
body.is-playing #nowPlayingModal:not(.queue-mode):not(.clip-mode) .ios-art-card,
#nowPlayingModal:is(.player-morphing, .lyrics-artwork-morphing) .ios-art-card {
  -webkit-mask-image: none;
  mask-image: none;
}
#nowPlayingModal.player-cover-flight:not(.queue-mode):not(.clip-mode) .ios-art-card :is(img, video),
#nowPlayingModal:not(.queue-mode):not(.clip-mode):not(.player-morphing) .ios-art-card :is(img, video) {
  position: absolute;
  left: 50%;
  top: calc(50% + (var(--sat) + var(--tg-content-safe-top, 0px)) / 2);
  width: var(--cover-square);
  height: var(--cover-square);
  max-width: none;
  object-fit: contain;
  transform: translate(-50%, -50%) scale(1.8);
  border-radius: var(--r-card);
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
}
#nowPlayingModal:not(.queue-mode):not(.clip-mode):not(.player-morphing) .ios-art-card :is(img, video) {
  transition: transform var(--dur-move) var(--ease-audio-player);
}
body.is-playing #nowPlayingModal.player-cover-flight:not(.queue-mode):not(.clip-mode) .ios-art-card :is(img, video),
body.is-playing #nowPlayingModal:not(.queue-mode):not(.clip-mode):not(.player-morphing) .ios-art-card :is(img, video) {
  transform: translate(-50%, -50%) scale(1);
  -webkit-mask-image: none;
  mask-image: none;
}
#nowPlayingModal:is(.player-morphing, .lyrics-artwork-morphing) .ios-art-card :is(img, video) {
  -webkit-mask-image: none;
  mask-image: none;
}
@media (prefers-reduced-motion: reduce) {
  #nowPlayingModal:not(.queue-mode):not(.clip-mode):not(.player-morphing) .ios-art-card :is(img, video) { transition: none; }
}
html[data-motion="instant"] #nowPlayingModal:not(.queue-mode):not(.clip-mode):not(.player-morphing) .ios-art-card :is(img, video) { transition: none; }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-track-meta {
  position: absolute;
  top: var(--player-art-h);
  left: 32px;
  right: 32px;
  width: auto;
  min-height: 62px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-track-text { flex: 1; min-width: 0; }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-track-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -.025em;
  text-align: left;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-track-artist {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 25px;
  color: rgb(255 255 255 / .65);
  text-align: left;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-track-actions { padding: 0; gap: 0; }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) :is(#trackStarBtn, #trackMoreBtn) {
  display: flex;
  width: 44px;
  height: 44px;
  background: none;
  border: 0;
  box-shadow: none;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) #trackStarBtn { margin-right: 2px; }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) #trackMoreBtn { margin-right: -6px; }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) :is(#trackStarBtn, #trackMoreBtn) svg { width: 26px; height: 26px; }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .player-fixed-controls {
  top: 66dvh;
  bottom: calc(8px + var(--sab));
  left: 32px;
  right: 32px;
  translate: none;
  width: auto;
  max-width: none;
  height: auto;
  margin: 0;
  display: grid;
  grid-template-rows: 40px minmax(64px, 1fr) 40px 48px;
  row-gap: 12px;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .player-fixed-controls > * { margin: 0; padding: 0; }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-time-row {
  margin-top: 11px;
  font-size: 12px;
  font-weight: 500;
  color: rgb(255 255 255 / .42);
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-slider-track {
  height: 7px;
  border-radius: 5px;
  background: rgb(255 255 255 / .25);
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-slider-fill { background: rgb(255 255 255 / .65); }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-controls-cluster {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  min-height: 0;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) :is(.ctrl-shuffle, .ctrl-repeat) { display: none; }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) :is(.ctrl-prev, .ctrl-next, .ios-play-hero) {
  width: 64px;
  height: 64px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  color: #fff;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) :is(.ctrl-prev, .ctrl-next) svg { width: 44px; height: 44px; }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) #playBtn svg { width: 48px; height: 48px; }
#nowPlayingModal .player-fixed-controls > .ios-modal-volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) :is(.vol-icon, .vol-icon-btn) { color: rgb(255 255 255 / .65); }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .vol-icon-btn { min-width: 18px; }
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) #volumeSlider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(to right, rgb(255 255 255 / .65) var(--vol-fill, 100%), rgb(255 255 255 / .25) var(--vol-fill, 100%));
}
/* Volume remains available in the fixed player controls while EQ is open. */
#studioEqSheet .eq-volume-label { display: none; }
#nowPlayingModal.queue-mode { --player-controls-h: 270px; }
#nowPlayingModal.queue-mode .player-fixed-controls {
  height: 270px;
  grid-template-rows: 38px 90px 26px 44px;
  gap: 16px;
}
@media (max-height: 740px) {
  #nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) { --player-art-h: 50dvh; }
  #nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .player-modal-scroll-body { height: 61dvh; }
  #nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .player-fixed-controls {
    top: 63dvh;
    grid-template-rows: 32px minmax(48px, 1fr) 28px 40px;
    row-gap: 6px;
  }
  #nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .ios-track-meta { left: 24px; right: 24px; }
  #nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) .player-fixed-controls { left: 24px; right: 24px; }
}

#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) #volumeSlider::-webkit-slider-thumb {
  width: 1px;
  height: 6px;
  margin-top: 0;
  box-shadow: none;
  background: transparent;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) #volumeSlider::-moz-range-thumb {
  width: 1px;
  height: 6px;
  border: 0;
  background: transparent;
}

/* Resize isolated painted layers so the end caps stay circular, without scaling. */
:root { --ease-audio-player: cubic-bezier(.32, .08, .24, 1); }
#nowPlayingModal:not(.clip-mode) { --ease-player-controls: var(--ease-audio-player); }
#nowPlayingModal { --slider-shape-ease: var(--ease-player-controls, var(--clip-slider-shape-ease, cubic-bezier(.3, 1.3, .5, 1))); }
#nowPlayingModal #progressBarContainer { background: transparent; }
#nowPlayingModal #progressBarContainer .ios-slider-clip {
  background: rgb(255 255 255 / .25);
  border-radius: 999px;
  transition: inset var(--dur-move) var(--slider-shape-ease);
}
#nowPlayingModal #progressBarContainer.is-scrubbing .ios-slider-clip {
  inset: -5px -2.5%;
}
#nowPlayingModal #progressBarContainer.is-scrubbing .ios-slider-fill { background: #fff; }
#nowPlayingModal .vol-slider-wrap { position: relative; }
#nowPlayingModal .vol-slider-wrap::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 6px;
  margin-top: -3px;
  border-radius: 999px;
  background: linear-gradient(to right, rgb(255 255 255 / .65) var(--vol-fill, 100%), rgb(255 255 255 / .25) var(--vol-fill, 100%));
  pointer-events: none;
  transition: height var(--dur-move) var(--slider-shape-ease), margin-top var(--dur-move) var(--slider-shape-ease), left var(--dur-move) var(--slider-shape-ease), right var(--dur-move) var(--slider-shape-ease);
}
#nowPlayingModal .vol-slider-wrap.is-adjusting::before {
  height: 17px;
  margin-top: -8.5px;
  left: -2.5%;
  right: -2.5%;
}
#nowPlayingModal:is(:not(.queue-mode), .queue-mode):not(.clip-mode) #volumeSlider::-webkit-slider-runnable-track { background: transparent; }
#nowPlayingModal #volumeSlider::-moz-range-track { background: transparent; }
@media (prefers-reduced-motion: reduce) {
  #nowPlayingModal #progressBarContainer .ios-slider-clip,
  #nowPlayingModal .vol-slider-wrap::before { transition: none; }
}

#nowPlayingModal .volume-wave,
#nowPlayingModal .volume-mute-mark {
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-player-controls, var(--ease-out));
}
#nowPlayingModal [data-volume-level="0"] .volume-mute-mark,
#nowPlayingModal [data-volume-level="1"] .volume-wave-1,
#nowPlayingModal [data-volume-level="2"] :is(.volume-wave-1, .volume-wave-2),
#nowPlayingModal [data-volume-level="3"] .volume-wave { opacity: 1; }
#nowPlayingModal #volMuteBtn svg {
  transform: scale(var(--volume-low-scale, 1));
  transition: transform var(--dur-move) var(--ease-player-controls, var(--ease));
}
#nowPlayingModal #volMaxBtn {
  transform: scale(var(--volume-high-scale, 1));
  transition: transform var(--dur-move) var(--ease-player-controls, var(--ease));
}
@media (prefers-reduced-motion: reduce) {
  #nowPlayingModal :is(.volume-wave, .volume-mute-mark, #volMaxBtn),
  #nowPlayingModal #volMuteBtn svg { transition: none; }
}

#nowPlayingModal #progressBarFill {
  transition: transform var(--dur-fast) var(--ease-player-controls, var(--ease));
}
@media (prefers-reduced-motion: reduce) {
  #nowPlayingModal #progressBarFill { transition: none; }
}

/* Clicks travel smoothly; direct dragging always removes this opt-in state. */
@property --vol-fill {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 100%;
}
#nowPlayingModal .vol-slider-wrap.is-volume-command {
  transition: --vol-fill var(--dur-move) var(--ease-player-controls, var(--ease-breathe));
}
@media (prefers-reduced-motion: reduce) {
  #nowPlayingModal .vol-slider-wrap.is-volume-command { transition: none; }
}

/* Lyrics use the same fixed transport, with a compact identity row above the text. */
#nowPlayingModal.queue-mode:not(.clip-mode) .player-modal-scroll-body {
  top: max(92px, var(--player-top));
  bottom: calc(34dvh + 16px);
  height: auto;
  left: 0;
  right: 0;
  width: 100%;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-rows: 72px minmax(0, 1fr);
  gap: 14px 12px;
  overflow: hidden;
}
#nowPlayingModal.queue-mode:not(.clip-mode) .ios-art-stage {
  position: relative;
  inset: auto;
  grid-area: 1 / 1;
  width: 72px;
  height: 72px;
  margin: 0;
}
#nowPlayingModal.queue-mode:not(.clip-mode) .ios-art-card {
  width: 72px;
  min-width: 0;
  height: 72px;
  border-radius: 9px;
}
#nowPlayingModal.queue-mode:not(.clip-mode) .ios-art-card :is(img, video) {
  mask-image: none;
  -webkit-mask-image: none;
}
/* Keep the viewport clip, not the new grid's bounds, during the artwork flight. */
#nowPlayingModal.lyrics-artwork-morphing:not(.clip-mode) .player-modal-scroll-body {
  overflow: visible;
}
#nowPlayingModal.lyrics-artwork-morphing:not(.clip-mode) .ios-art-card,
#nowPlayingModal.lyrics-artwork-morphing:not(.clip-mode) .ios-art-card :is(img, video) {
  -webkit-mask-image: none;
  mask-image: none;
}
#nowPlayingModal.lyrics-artwork-morphing:not(.clip-mode):not(.player-morphing) :is(.ios-art-card, .ios-art-card :is(img, video)) {
  transition: none;
}
#nowPlayingModal.queue-mode:not(.clip-mode) .ios-track-meta {
  position: relative;
  inset: auto;
  grid-area: 1 / 2;
  width: 100%;
  min-height: 0;
  height: 72px;
  gap: 4px;
}
#nowPlayingModal.queue-mode:not(.clip-mode) .ios-track-title { font-size: 17px; line-height: 22px; }
#nowPlayingModal.queue-mode:not(.clip-mode) .ios-track-artist { font-size: 15px; line-height: 20px; margin-top: 1px; }
#nowPlayingModal.queue-mode:not(.clip-mode) #trackMoreBtn { width: 36px; min-width: 36px; }
#nowPlayingModal.queue-mode:not(.clip-mode) #lyricsPanel {
  grid-area: 2 / 1 / 3 / -1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#nowPlayingModal.queue-mode:not(.clip-mode) #lyricsContent {
  padding: 22px 0 60%;
  gap: 28px;
  --player-edge-fade: 32px;
  text-align: left;
}
#nowPlayingModal.queue-mode:not(.clip-mode) .lyrics-line {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.025em;
  text-align: left;
  color: rgb(255 255 255 / .36);
  opacity: .65;
  filter: blur(3px);
  transform: none;
  scale: none;
  transition: color var(--dur-move) var(--ease-audio-player), opacity var(--dur-move) var(--ease-audio-player),
              filter var(--dur-move) var(--ease-audio-player);
}
#nowPlayingModal.queue-mode:not(.clip-mode) .lyrics-line.lyrics-near { filter: blur(2px); opacity: .8; }
#nowPlayingModal.queue-mode:not(.clip-mode) .lyrics-line.active {
  color: #fff;
  opacity: 1;
  filter: none;
  transform: none;
  scale: none;
}
#nowPlayingModal.queue-mode:not(.clip-mode) .lyrics-line::before { display: none; }
#nowPlayingModal.queue-mode:not(.clip-mode) .is-plain .lyrics-line {
  font-size: 28px;
  color: rgb(255 255 255 / .85);
  opacity: 1;
  filter: none;
}
#nowPlayingModal.queue-mode:not(.clip-mode) #lyricsToggleBtn {
  border-radius: 50%;
  background: transparent;
}
@media (max-height: 740px) {
  #nowPlayingModal.queue-mode:not(.clip-mode) .player-modal-scroll-body {
    padding: 0 24px;
    bottom: calc(37dvh + 12px);
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: 56px minmax(0, 1fr);
    row-gap: 8px;
  }
  #nowPlayingModal.queue-mode:not(.clip-mode) :is(.ios-art-stage, .ios-art-card) { width: 56px; height: 56px; }
  #nowPlayingModal.queue-mode:not(.clip-mode) .ios-track-meta { height: 56px; }
  #nowPlayingModal.queue-mode:not(.clip-mode) .lyrics-line { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  #nowPlayingModal.queue-mode:not(.clip-mode) .lyrics-line { transition: none; }
}

#nowPlayingModal :is(.lyrics-mode .lyrics-line, .lyrics-panel-leaving .lyrics-line) { padding: 0; margin: 0; }
#nowPlayingModal :is(#lyricsToggleBtn.active, #queueToggleBtn.active, #openEqBtn.view-active) {
  width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; justify-self: center; border-radius: 50%;
  background: rgb(255 255 255 / .65);
  color: #3a3837;
}
#nowPlayingModal.queue-mode:not(.lyrics-mode):not(.equalizer-mode) .player-modal-scroll-body {
  grid-template-rows: 72px 38px minmax(0,1fr);
}
#nowPlayingModal.queue-mode:not(.lyrics-mode):not(.equalizer-mode) #playerQueueModes {
  grid-area: 2 / 1 / 3 / -1;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
}
#nowPlayingModal #playerQueueModes .ios-icon-btn {
  display: grid; place-items: center; width: 100%; height: 38px;
  border-radius: 24px; background: rgb(255 255 255 / .14); color: #fff;
}
#nowPlayingModal #playerQueueModes .ios-icon-btn.active { background: rgb(255 255 255 / .7); color: #4b4746; }
#nowPlayingModal.queue-mode:not(.lyrics-mode):not(.equalizer-mode) #playerQueueContainer {
  grid-area: 3 / 1 / 4 / -1; margin: 0; min-height: 0;
}
#nowPlayingModal .player-queue-header { display: block; flex: none; padding: 3px 0 14px; }
#nowPlayingModal .player-queue-title { font-size: 17px; font-weight: 650; color: #fff; }
#nowPlayingModal .player-queue-subtitle { font-size: 13px; margin-top: 3px; color: rgb(255 255 255 / .6); }
#nowPlayingModal.queue-mode #playerQueueList { margin: 0; padding: 0 0 24px; --player-edge-fade: 16px; }
#nowPlayingModal.queue-mode #playerQueueList .ios-track-item { min-height: 56px; padding: 4px 0; border-radius: 0; }
#nowPlayingModal.queue-mode #playerQueueList .track-cover-sm { width: 48px; height: 48px; border-radius: 4px; }
#nowPlayingModal.queue-mode #playerQueueList .queue-track-select { gap: 12px; }
#nowPlayingModal.queue-mode #playerQueueList .track-name-main { font-size: 16px; font-weight: 400; }
#nowPlayingModal.queue-mode #playerQueueList .track-artist-sub { font-size: 12px; color: rgb(255 255 255 / .6); }
#nowPlayingModal.queue-mode .player-fixed-controls {
  transition: transform var(--dur-move) var(--ease-player-controls, var(--ease-page)),
              opacity var(--dur-move) var(--ease-player-controls, var(--ease));
}
#nowPlayingModal.queue-reordering .player-fixed-controls { transform: translateY(40dvh); opacity: 0; pointer-events: none; }
#nowPlayingModal.queue-reordering .player-modal-scroll-body { bottom: calc(8px + var(--sab)); }
@media (max-height:740px) {
 #nowPlayingModal.queue-mode:not(.lyrics-mode):not(.equalizer-mode) .player-modal-scroll-body { grid-template-rows: 56px 38px minmax(0,1fr); }
}
@media (prefers-reduced-motion:reduce) {
 #nowPlayingModal.queue-mode .player-fixed-controls { transition: none; }
}

#nowPlayingModal.queue-mode:not(.clip-mode) .player-fixed-controls #lyricsToggleBtn {
  background: transparent;
  width: 44px; min-width: 44px; height: 44px;
  padding: 0; justify-self: center;
}
#nowPlayingModal.queue-mode:not(.clip-mode) .player-fixed-controls :is(#lyricsToggleBtn.active, #queueToggleBtn.active, #openEqBtn.view-active) {
  background: rgb(255 255 255 / .65);
  color: #3a3837;
  width: 44px; min-width: 44px; height: 44px; min-height: 44px;
  padding: 0; justify-self: center; border-radius: 50%;
}
#nowPlayingModal.queue-mode .player-fixed-controls :is(#lyricsToggleBtn, #queueToggleBtn)::after { display: none; }

/* One header-to-row gap; the first cover must not fade under the heading. */
#nowPlayingModal.queue-mode .player-queue-header { margin: 0; }
#nowPlayingModal.queue-mode #playerQueueList {
  --queue-fade: min(64px, 25%);
  --queue-bottom-mask: linear-gradient(to bottom,
    #000 0, #000 calc(100% - var(--queue-cut, 0px) - var(--queue-fade)),
    rgb(0 0 0 / .96) calc(100% - var(--queue-cut, 0px) - var(--queue-fade) * .8),
    rgb(0 0 0 / .8) calc(100% - var(--queue-cut, 0px) - var(--queue-fade) * .6),
    rgb(0 0 0 / .5) calc(100% - var(--queue-cut, 0px) - var(--queue-fade) * .4),
    rgb(0 0 0 / .18) calc(100% - var(--queue-cut, 0px) - var(--queue-fade) * .2),
    rgb(0 0 0 / .04) calc(100% - var(--queue-cut, 0px) - var(--queue-fade) * .08),
    transparent calc(100% - var(--queue-cut, 0px)));
  -webkit-mask-image: var(--queue-bottom-mask);
  mask-image: var(--queue-bottom-mask);
}

/* Browsing the queue folds its identity row away, leaving transport anchored. */
#nowPlayingModal.queue-mode:not(.lyrics-mode):not(.equalizer-mode) .player-modal-scroll-body {
  transition: grid-template-rows var(--dur-move) var(--ease-player-controls, var(--ease-page));
}
#nowPlayingModal.queue-mode:not(.lyrics-mode):not(.equalizer-mode) .ios-art-stage,
#nowPlayingModal.queue-mode:not(.lyrics-mode):not(.equalizer-mode):not(.clip-mode) .ios-track-meta {
  transition: opacity var(--dur-short) var(--ease-player-controls, var(--ease)),
              translate var(--dur-move) var(--ease-player-controls, var(--ease-page));
}
#nowPlayingModal.queue-mode.queue-header-collapsed:not(.lyrics-mode):not(.equalizer-mode) .player-modal-scroll-body {
  grid-template-rows: 0px 38px minmax(0,1fr);
}
#nowPlayingModal.queue-mode.queue-header-collapsed:not(.lyrics-mode):not(.equalizer-mode) :is(.ios-art-stage, .ios-track-meta) {
  opacity: 0;
  translate: 0 -16px;
  pointer-events: none;
}
@media (prefers-reduced-motion:reduce) {
  #nowPlayingModal.queue-mode:not(.lyrics-mode):not(.equalizer-mode) :is(.player-modal-scroll-body, .ios-art-stage, .ios-track-meta) { transition: none; }
}
/* Перестановка: список сразу длинный (раскладку не анимируем), а его низ,
   где ещё уезжает панель, закрыт мягким краем маски. --queue-hide — сколько
   низа закрыто: открывается при захвате и закрывается при отпускании тем же
   ходом, что и панель; queue-reorder-leaving держит список длинным до конца хода.
   --queue-gain — на сколько список длиннее (разница двух bottom ниже). */
@property --queue-hide { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --queue-gain { syntax: "<length>"; inherits: true; initial-value: 0px; }
#nowPlayingModal.queue-mode #playerQueueList {
  --queue-gain: calc(34dvh + 16px - 8px - var(--sab));
  --queue-hide: var(--queue-gain);
}
@media (max-height: 740px) {
  #nowPlayingModal.queue-mode #playerQueueList { --queue-gain: calc(37dvh + 12px - 8px - var(--sab)); }
}
#nowPlayingModal.queue-mode:is(.queue-reordering, .queue-reorder-leaving) #playerQueueList {
  --queue-cut: var(--queue-hide);
  /* Хвост того же размера, что и прибавка: предел прокрутки не меняется, и
     прокрученный до конца список не прыгает ни при захвате, ни после. */
  padding-bottom: calc(24px + var(--queue-gain));
  transition: --queue-hide var(--dur-move) var(--ease-player-controls, var(--ease-page));
}
#nowPlayingModal.queue-mode.queue-reordering #playerQueueList { --queue-hide: 0px; }
@media (prefers-reduced-motion:reduce) {
  #nowPlayingModal.queue-mode:is(.queue-reordering, .queue-reorder-leaving) #playerQueueList { transition: none; }
}
/* Match the specificity of the compact view so drag really uses the freed area. */
#nowPlayingModal.queue-mode:is(.queue-reordering, .queue-reorder-leaving):not(.equalizer-mode) .player-modal-scroll-body {
  bottom: calc(8px + var(--sab));
}

/* The owner explicitly wants icon feedback, with motionless queue pills. */
#nowPlayingModal #playerQueueModes > button {
  transform: none;
  scale: none;
  translate: none;
  animation: none;
  transition: none;
}
#nowPlayingModal:not(.clip-mode) #playerQueueModes > button {
  transition: background-color var(--dur-short) var(--ease-audio-player), color var(--dur-short) var(--ease-audio-player);
}
@media (prefers-reduced-motion: reduce) {
  #nowPlayingModal:not(.clip-mode) #playerQueueModes > button { transition: none; }
}

/* Активная кнопка дока — как в Apple Music (референс 16.11): светлый круг
   того же тона, что неактивные иконки, а иконка внутри — тёмная, под тон фона.
   Белая точка под кнопкой больше не нужна: круг сам показывает состояние.
   Замер референса: фон #393736, круг #ADABA9 (≈ белый 60–65 %), иконка = фон. */
#nowPlayingModal .player-fixed-controls :is(#lyricsToggleBtn.active, #queueToggleBtn.active, #openEqBtn.view-active) {
  width: 44px; min-width: 44px; height: 44px; min-height: 44px;
  padding: 0; justify-self: center; border-radius: 50%;
  background: rgb(255 255 255 / .65);
  color: #3a3837;
  transition: background-color var(--dur-short) var(--ease), color var(--dur-short) var(--ease);
}
#nowPlayingModal .player-fixed-controls :is(#lyricsToggleBtn.active, #queueToggleBtn.active, #openEqBtn.view-active)::before { display: none; }
/* Неактивная кнопка всегда прозрачная: ни тёмного, ни светлого круга.
   eq-active (эквалайзер включён, но панель закрыта) сохраняет белую иконку (без точки). */
#nowPlayingModal .player-fixed-controls .player-dock-cell:not(.active):not(.view-active):not(.eq-active) {
  background: transparent;
  color: rgb(255 255 255 / .65);
}
@media (prefers-reduced-motion: reduce) {
  #nowPlayingModal .player-fixed-controls :is(#lyricsToggleBtn.active, #queueToggleBtn.active, #openEqBtn.view-active) { transition: none; }
}

/* ---- Караоке: плашка нажатой строки и режим «листаю» (16.11, вечер) ----
   Плашка: строка шире текста на 14px с каждой стороны (отрицательные поля
   гасят прибавку, текст не сдвигается). Чтобы края плашки не обрезались,
   панель текста расширена на те же 14px, кнопки справа возвращены на место.
   Размытие строк снимается и возвращается классом — радиус blur никогда не
   анимируется (LIQUID-GLASS §5.8, §7): при возврате каждая строка включает
   его мгновенно, но с задержкой по удалённости от активной — волна. */
#nowPlayingModal.lyrics-mode:not(.equalizer-mode) #lyricsPanel { width: calc(100% + 28px); margin-inline: -14px; }
#nowPlayingModal.lyrics-mode:not(.equalizer-mode) #lyricsContent,
#nowPlayingModal #lyricsPanel.lyrics-panel-leaving #lyricsContent { padding-inline: 14px; }
#nowPlayingModal.lyrics-mode:not(.equalizer-mode) #lyricsPanel :is(.lyrics-sing-action, .lyrics-vocal-control) { right: 18px; }
#nowPlayingModal.queue-mode:not(.clip-mode) #lyricsPanel.lyrics-panel-leaving {
  position: absolute;
  grid-area: auto;
  inset: var(--lyrics-exit-top) auto auto var(--lyrics-exit-left);
  width: var(--lyrics-exit-width);
  height: var(--lyrics-exit-height);
  z-index: 1;
  pointer-events: none;
}
#nowPlayingModal #lyricsPanel.lyrics-panel-leaving #lyricsContent {
  padding-bottom: var(--lyrics-exit-padding-bottom);
  -webkit-mask-image: var(--lyrics-exit-mask);
  mask-image: var(--lyrics-exit-mask);
}
#nowPlayingModal #lyricsPanel.lyrics-panel-leaving :is(.lyrics-sing-action, .lyrics-vocal-control) {
  right: 18px;
  translate: var(--lyrics-exit-action-shift);
}
#nowPlayingModal #lyricsPanel.lyrics-panel-leaving .lyrics-sing-action { opacity: var(--lyrics-exit-sing-opacity); }
#nowPlayingModal #lyricsPanel.lyrics-panel-leaving .lyrics-vocal-control { opacity: var(--lyrics-exit-vocal-opacity); }
#nowPlayingModal :is(.lyrics-mode #lyricsContent, .lyrics-panel-leaving #lyricsContent) .lyrics-line[data-time] {
  width: auto;
  margin: -8px -14px;
  padding: 8px 14px;
  border-radius: 20px;
}
#nowPlayingModal #lyricsContent .lyrics-line[data-time].is-pressed {
  background-color: rgb(255 255 255 / .16);
  color: color-mix(in srgb, rgb(var(--tint)) 45%, #fff);
  opacity: 1;
}
#nowPlayingModal #lyricsContent.lyrics-browsing .lyrics-line {
  filter: none;
  transition: color var(--dur-move) var(--ease-audio-player), opacity var(--dur-move) var(--ease-audio-player);
}
#nowPlayingModal #lyricsContent.lyrics-settling .lyrics-line {
  transition: color var(--dur-move) var(--ease-audio-player), opacity var(--dur-move) var(--ease-audio-player),
    filter var(--dur-instant) var(--ease-linear) calc(var(--lyrics-wave, 0) * var(--dur-press) / 2);
}
/* Пока ни одна строка не активна (трек не начат), размывать нечего — текст
   читается целиком, а не сплошным пятном. */
#nowPlayingModal #lyricsContent:not(:has(.lyrics-line.active)) .lyrics-line { filter: none; }

/* 16.11 вечер — пока листают текст, нижняя панель уезжает, как при
   перестановке очереди, и текст занимает экран до низа. Раскладку не
   анимируем: текст сразу длинный, а открывшийся низ закрыт краем маски
   --lyrics-hide, который открывается тем же ходом, что уезжает панель.
   lyrics-browse-leaving держит текст длинным, пока край закрывается. */
@property --lyrics-hide { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --lyrics-gain { syntax: "<length>"; inherits: true; initial-value: 0px; }
#nowPlayingModal.lyrics-mode #lyricsPanel {
  --lyrics-gain: calc(34dvh + 16px - 8px - var(--sab));
  --lyrics-hide: var(--lyrics-gain);
}
@media (max-height: 740px) {
  #nowPlayingModal.lyrics-mode #lyricsPanel { --lyrics-gain: calc(37dvh + 12px - 8px - var(--sab)); }
}
#nowPlayingModal.lyrics-mode.lyrics-browsing .player-fixed-controls { transform: translateY(40dvh); opacity: 0; pointer-events: none; }
#nowPlayingModal.lyrics-mode:is(.lyrics-browsing, .lyrics-browse-leaving):not(.equalizer-mode) .player-modal-scroll-body {
  bottom: calc(8px + var(--sab));
}
#nowPlayingModal.lyrics-mode:is(.lyrics-browsing, .lyrics-browse-leaving) #lyricsPanel {
  transition: --lyrics-hide var(--dur-move) var(--ease-audio-player);
}
#nowPlayingModal.lyrics-mode.lyrics-browsing #lyricsPanel { --lyrics-hide: 0px; }
#nowPlayingModal.lyrics-mode:is(.lyrics-browsing, .lyrics-browse-leaving):not(.equalizer-mode) #lyricsContent {
  /* Хвост равен прибавке: предел прокрутки не меняется, текст не прыгает. */
  padding-bottom: calc(60% + var(--lyrics-gain));
  --lyrics-browse-mask: linear-gradient(180deg,
    transparent 0, rgb(0 0 0 / .2) 20px, rgb(0 0 0 / .8) 40px, #000 var(--scroll-mask-top),
    #000 calc(100% - var(--lyrics-hide) - var(--scroll-mask-bottom)),
    rgb(0 0 0 / .8) calc(100% - var(--lyrics-hide) - var(--scroll-mask-bottom) + 35px),
    rgb(0 0 0 / .2) calc(100% - var(--lyrics-hide) - 20px),
    transparent calc(100% - var(--lyrics-hide)));
  -webkit-mask-image: var(--lyrics-browse-mask);
  mask-image: var(--lyrics-browse-mask);
}
/* Кнопки караоке привязаны к низу текста: держим их на месте, пока текст
   длинный, и гасим, пока листают. */
#nowPlayingModal.lyrics-mode #lyricsPanel :is(.lyrics-sing-action, .lyrics-vocal-control) {
  transition: opacity var(--dur-short) var(--ease);
}
#nowPlayingModal.lyrics-mode:is(.lyrics-browsing, .lyrics-browse-leaving) #lyricsPanel :is(.lyrics-sing-action, .lyrics-vocal-control) {
  translate: 0 calc(-1 * var(--lyrics-gain));
}
#nowPlayingModal.lyrics-mode.lyrics-browsing #lyricsPanel :is(.lyrics-sing-action, .lyrics-vocal-control) { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  #nowPlayingModal.lyrics-mode #lyricsPanel,
  #nowPlayingModal.lyrics-mode #lyricsPanel :is(.lyrics-sing-action, .lyrics-vocal-control) { transition: none; }
}

/* Заливка текущей строки слева направо. Строчный span без
   box-decoration-break склеивает переносы в одну полосу, поэтому градиент
   идёт по строкам по очереди, как у Apple. --lyrics-fill (0..1) ставит JS.
   Градиент стоит на КАЖДОЙ строке, а меняются только два зарегистрированных
   цвета: «залито» у текущей строки белое, у остальных такое же серое, как
   «не залито». Поэтому при смене строки заливка прежней плавно гаснет, а новой
   плавно разгорается тем же ходом, что и цвет строки, а не щёлкает. */
@property --lyrics-done { syntax: "<color>"; inherits: false; initial-value: rgb(255 255 255 / .36); }
@property --lyrics-todo { syntax: "<color>"; inherits: false; initial-value: rgb(255 255 255 / .36); }
#nowPlayingModal.queue-mode:not(.equalizer-mode) .lyrics-line .lyrics-fill {
  --lyrics-fill-edge: 12px;
  --lyrics-done: rgb(255 255 255 / .36);
  --lyrics-todo: rgb(255 255 255 / .36);
  background-image: linear-gradient(90deg,
    var(--lyrics-done) calc(var(--lyrics-fill, 0) * (100% + 2 * var(--lyrics-fill-edge)) - 2 * var(--lyrics-fill-edge)),
    var(--lyrics-todo) calc(var(--lyrics-fill, 0) * (100% + 2 * var(--lyrics-fill-edge))));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: --lyrics-done var(--dur-move) var(--ease-audio-player), --lyrics-todo var(--dur-move) var(--ease-audio-player);
}
#nowPlayingModal.queue-mode:not(.equalizer-mode) .lyrics-line.active .lyrics-fill { --lyrics-done: #fff; }
#nowPlayingModal.queue-mode:not(.equalizer-mode) .lyrics-line.is-pressed .lyrics-fill {
  --lyrics-done: color-mix(in srgb, rgb(var(--tint)) 45%, #fff);
  --lyrics-todo: color-mix(in srgb, rgb(var(--tint)) 45%, #fff);
}
@media (prefers-reduced-motion: reduce) {
  #nowPlayingModal.queue-mode:not(.equalizer-mode) .lyrics-line .lyrics-fill { transition: none; }
}

/* Эквалайзер — тот же компактный режим, что и текст/очередь: маленькая обложка,
   прозрачные плашки rgb(255 255 255 / .14–.16), светлые активные кнопки. Свой
   тёмно-бирюзовый вид убран; цвет фона даёт --tint, как везде. */
#nowPlayingModal.equalizer-mode #studioEqSheet {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: transparent;
  color: #fff;
}
#nowPlayingModal.equalizer-mode #studioEqSheet .sheet-header {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 0 10px;
  border: 0;
  gap: 12px;
}
#nowPlayingModal.equalizer-mode #studioEqSheet .eq-heading > span { display: none; }
#nowPlayingModal.equalizer-mode #studioEqSheet .eq-heading h3 {
  font-size: 17px;
  line-height: 22px;
  font-weight: 650;
  letter-spacing: 0;
}
#nowPlayingModal.equalizer-mode #studioEqSheet .eq-toggle-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: rgb(255 255 255 / .6);
}
#nowPlayingModal.equalizer-mode #studioEqSheet .eq-toggle-label.active { color: #fff; }
#nowPlayingModal.equalizer-mode #studioEqSheet .studio-sheet-body {
  gap: 10px;
  padding: 0 0 24px;
  --player-edge-fade: 16px;
}

/* Режимы и пресет — плашки высотой 38px, как «Очередь / Радио / …». */
#nowPlayingModal.equalizer-mode #studioEqSheet .eq-mode-segments {
  height: 38px;
  padding: 0;
  gap: 0;
  border: 0;
  border-radius: 24px;
  background: rgb(255 255 255 / .14);
  box-shadow: none;
}
#nowPlayingModal.equalizer-mode #studioEqSheet .eq-seg-btn {
  height: 38px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: transparent;
  box-shadow: none;
}
#nowPlayingModal.equalizer-mode #studioEqSheet .eq-seg-btn.active {
  background: rgb(255 255 255 / .7);
  color: #4b4746;
}
#nowPlayingModal.equalizer-mode #studioEqSheet .eq-preset-wrap { gap: 10px; }
#nowPlayingModal.equalizer-mode #studioEqSheet :is(.eq-glass-select, .eq-reset-btn) {
  height: 38px;
  border: 0;
  border-radius: 24px;
  background-color: rgb(255 255 255 / .14);
  box-shadow: none;
  color: #fff;
  font-size: 15px;
}
#nowPlayingModal.equalizer-mode #studioEqSheet .eq-reset-btn { width: 38px; min-width: 38px; padding: 0; }

/* Плашки с ползунками — одной заливкой, без рамок и бликов. */
#nowPlayingModal.equalizer-mode #studioEqSheet :is(.simple-eq-grid, .eq-glass-card, .eq-sliders-board, .eq-collapsible-fx) {
  border: 0;
  border-radius: 18px;
  background-color: rgb(255 255 255 / .12);
  box-shadow: none;
}
#nowPlayingModal.equalizer-mode #studioEqSheet .simple-eq-grid { padding: 14px 8px 12px; }
#nowPlayingModal.equalizer-mode #studioEqSheet .band-tag {
  font-size: 11px;
  font-weight: 650;
  color: rgb(255 255 255 / .7);
}
#nowPlayingModal.equalizer-mode #studioEqSheet .band-db-badge { color: #fff; }
#nowPlayingModal.equalizer-mode #studioEqSheet :is(.band-freq-sub, .card-tag, .preamp-label, .eq-scale-labels, .channel-freq) {
  color: rgb(255 255 255 / .6);
}
@media (max-height: 740px) {
  #nowPlayingModal.equalizer-mode #studioEqSheet .eq-mode-segments,
  #nowPlayingModal.equalizer-mode #studioEqSheet .eq-seg-btn,
  #nowPlayingModal.equalizer-mode #studioEqSheet :is(.eq-glass-select, .eq-reset-btn) { height: 34px; }
  #nowPlayingModal.equalizer-mode #studioEqSheet .eq-reset-btn { width: 34px; min-width: 34px; }
  #nowPlayingModal.equalizer-mode #studioEqSheet .simple-eq-grid .knob-container { height: 90px; }
  #nowPlayingModal.equalizer-mode #studioEqSheet .simple-eq-grid .band-knob-slider { width: 90px; }
}

/* Очередь и комментарии клипа: видео остаётся видимым, пока список открыт. */
:root { --ease-clip-panel: cubic-bezier(.32, .08, .24, 1); }
#nowPlayingModal.clip-mode .ios-art-stage { z-index: 3; }
#nowPlayingModal.clip-mode .player-modal-nav { z-index: 4; }
#nowPlayingModal.clip-mode .player-fixed-controls .ios-player-bottom-dock { grid-template-columns: repeat(3, 1fr); }
#nowPlayingModal.clip-mode .player-fixed-controls #queueToggleBtn { order: 1; }
#nowPlayingModal.clip-mode .player-fixed-controls #clipCommentsBtn { order: 2; }
#nowPlayingModal.clip-mode .player-fixed-controls #playerShareBtn { order: 3; }
body.tg-top-band #nowPlayingModal.clip-mode .player-fixed-controls .ios-player-bottom-dock { grid-template-columns: repeat(2, 1fr); }
#nowPlayingModal.clip-mode.queue-mode #playerQueueContainer {
  display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0;
  width: 100%; margin: 0; padding: 0; border: 0;
}
#nowPlayingModal.clip-mode.queue-mode .player-queue-header { margin: 0; padding: 4px 0 8px; }
#nowPlayingModal.clip-mode.queue-mode #playerQueueList {
  flex: 1 1 auto; min-height: 0; margin: 0; padding: 0 0 20px;
  overflow-y: auto; mask-image: none; -webkit-mask-image: none;
}
#nowPlayingModal.clip-mode #clipCommentsList {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 0 20px; scrollbar-width: thin;
}
#nowPlayingModal.clip-mode .clip-comment { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
#nowPlayingModal.clip-mode .clip-comment-author { color: #fff; font-size: 14px; font-weight: 650; }
#nowPlayingModal.clip-mode .clip-comment-text { margin: 5px 0 0; color: rgba(255,255,255,.86); font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
#nowPlayingModal.clip-mode .clip-comment-meta { margin-top: 6px; color: rgba(255,255,255,.5); font-size: 12px; }
#nowPlayingModal.clip-mode .clip-comments-skeleton-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
#nowPlayingModal.clip-mode .clip-comments-reveal { position: relative; }
#nowPlayingModal.clip-mode .clip-comments-reveal > .clip-comments-skeleton {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
#nowPlayingModal.clip-mode .clip-comment-placeholder { display: grid; gap: var(--s2); }
#nowPlayingModal.clip-mode .clip-comment-placeholder span {
  display: block; height: 10px; border-radius: var(--r-detail); background: currentColor; opacity: .13;
}
#nowPlayingModal.clip-mode .clip-comment-placeholder span:first-child { width: 34%; opacity: .22; }
#nowPlayingModal.clip-mode .clip-comment-placeholder span:nth-child(2) { width: 86%; }
#nowPlayingModal.clip-mode .clip-comment-placeholder span:last-child { width: 57%; }
#nowPlayingModal.clip-mode .clip-comment-placeholder:nth-of-type(2) span:nth-child(2) { width: 71%; }
#nowPlayingModal.clip-mode .clip-comments-message { padding: 12px 0; color: rgba(255,255,255,.65); font-size: 14px; line-height: 1.4; }
#nowPlayingModal.clip-mode .clip-comments-more {
  min-height: 44px; margin-top: 8px; padding: 0 16px; border: 0; border-radius: var(--r-pill);
  background: rgba(255,255,255,.12); color: #fff; font: inherit; font-size: 14px; cursor: pointer;
}
@media (orientation: portrait) {
  #nowPlayingModal.clip-mode.queue-mode .player-modal-scroll-body {
    position: absolute; top: max(64px, calc(var(--sat) + 24px)); bottom: calc(34dvh + 16px);
    left: 0; right: 0; translate: none; width: 100%; height: auto; max-width: none;
    display: flex; flex-direction: column; justify-content: flex-start; gap: 8px;
    padding: 0 32px; overflow: visible;
  }
  #nowPlayingModal.clip-mode.queue-mode .ios-art-stage {
    position: relative !important; inset: auto; width: 100%; height: 200px !important;
    flex: 0 0 200px !important; display: flex; align-items: center; justify-content: center;
  }
  #nowPlayingModal.clip-mode.queue-mode .clip-media-host { width: min(100%, 340px); height: 200px; aspect-ratio: auto; }
  #nowPlayingModal.clip-mode.queue-mode .ios-track-meta { flex: 0 0 auto; min-height: 50px; }
  #nowPlayingModal.clip-mode.queue-mode .player-fixed-controls {
    position: absolute; top: auto; bottom: calc(8px + var(--sab)); left: 32px; right: 32px;
    width: auto; max-width: none; height: calc(34dvh - 8px - var(--sab)); margin: 0; padding: 0;
    grid-template-rows: 40px minmax(64px, 1fr) 40px 48px; gap: 12px;
  }
  @media (max-height: 740px) {
    #nowPlayingModal.clip-mode.queue-mode .player-modal-scroll-body {
      bottom: calc(38dvh + 8px);
      padding-bottom: 16px; /* Запас под translateY(16px) при входе списка (setPlayerView). */
    }
    #nowPlayingModal.clip-mode.queue-mode .player-fixed-controls { height: calc(38dvh - 8px - var(--sab)); gap: 8px; }
    #nowPlayingModal.clip-mode.queue-mode .ios-track-meta {
      position: absolute; inset: 208px 32px auto; width: auto;
      visibility: hidden; opacity: 0; pointer-events: none;
    }
  }
  @media (max-width: 350px) {
    #nowPlayingModal.clip-mode.queue-mode .player-modal-scroll-body { padding-inline: 24px; }
    #nowPlayingModal.clip-mode.queue-mode .player-fixed-controls { left: 24px; right: 24px; }
    #nowPlayingModal.clip-mode.queue-mode .ios-track-meta { inset-inline: 24px; }
  }
}
@media (orientation: landscape) and (max-height: 540px) {
  #nowPlayingModal.clip-mode.queue-mode .player-modal-scroll-body {
    position: absolute; top: 44px; bottom: 8px; left: 0; right: 42%; translate: none;
    width: auto; height: auto; display: flex; flex-direction: column; justify-content: flex-start;
    gap: 8px; padding: 0 8px 0 var(--land-l); overflow: visible;
  }
  #nowPlayingModal.clip-mode.queue-mode .ios-art-stage {
    position: relative !important; inset: auto; width: 100%; height: 200px !important;
    flex: 0 0 200px !important; display: flex; align-items: center; justify-content: center;
  }
  #nowPlayingModal.clip-mode.queue-mode .clip-media-host { width: min(100%, 340px); height: 200px; aspect-ratio: auto; }
  #nowPlayingModal.clip-mode.queue-mode .ios-track-meta { position: fixed; top: 50px; left: 60%; right: var(--land-r); }
}
/* === canvas.css === */
/* Spotify Canvas поверх обложки большого плеера (webapp/canvas.js). Стекла здесь нет: обычное видео. */
.ios-art-card .canvas-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-short) var(--ease);
  -webkit-mask-image: linear-gradient(#000 0 76%, transparent 100%);
  mask-image: linear-gradient(#000 0 76%, transparent 100%);
}
/* Только в основном виде обложки: в очереди, текстах, клипе и во время раскрытия плеера видео спрятано. */
#nowPlayingModal:not(.queue-mode, .lyrics-mode, .clip-mode, .equalizer-mode, .player-morphing) .ios-art-card.has-canvas .canvas-video {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .ios-art-card .canvas-video { display: none; }
}

/* === liquid-sheets.css === */
/*
 * neМузыка — единый материал закреплённых поверхностей.
 *
 * Этот файл намеренно загружается последним. Поведение и DOM старых экранов
 * сохраняются, но их исторические поверхности больше не являются источником
 * визуального языка: все шторки, меню, popover, текст и эквалайзер используют
 * один рецепт Liquid Glass из docs/LIQUID-GLASS.md §1.1.
 */

/* Один материал для затемнения и одна стеклянная поверхность. Затемнение не
   стекло: оно только отделяет активный слой от страницы. */
.add-playlist-screen {
  background: var(--scrim-tint);
}

:is(.ios-action-sheet-card, .custom-popover-card, .dialog-card,
    .ios-studio-sheet, .ios-lyrics-sheet, .add-playlist-sheet) {
  --glass-blur: var(--piece-refract, var(--piece-filter));
  background: var(--piece-tint);
  border: 1px solid transparent;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--piece-shadow);
}

:is(.dialog-card, .custom-popover-card) {
  border-radius: var(--control-surface-radius, var(--r-card));
  overflow: hidden;
}

.custom-popover-backdrop {
  align-items: flex-end;
  justify-content: center;
}

.custom-popover-header,
.custom-popover-footer {
  background: transparent;
  border-color: var(--line-soft);
}

.custom-popover-close-btn,
.custom-popover-new-btn,
.dialog-btn {
  background: color-mix(in srgb, var(--text) 10%, transparent);
  border-color: transparent;
}

/* Строки — содержимое стекла, не отдельные карточки внутри стекла. */
:is(.ios-action-sheet-card, .custom-popover-card, .dialog-card,
    .ios-studio-sheet, .ios-lyrics-sheet) :is(.glass-group, .action-sheet-actions),
:is(.ios-action-sheet-card, .custom-popover-card) :is(.sheet-action-row, .custom-popover-item),
.ios-action-sheet-card .sheet-action-row {
  background: transparent;
  border-color: var(--line-soft);
  box-shadow: none;
}

:is(.ios-action-sheet-card, .custom-popover-card) :is(.sheet-action-row:hover, .sheet-action-row.is-pressed, .custom-popover-item.is-pressed) {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

/* Единая ручка и геометрия листа. */
:is(.ios-action-sheet-card, .custom-popover-card, .ios-studio-sheet, .ios-lyrics-sheet) .sheet-grabber,
.ios-sheet-backdrop .sheet-grabber {
  background: color-mix(in srgb, var(--text) 58%, transparent);
  opacity: 1;
}
/* У плеера и листа текста ручка — прозрачная зона касания 80×22: цвет получает
   видимая полоска ::before, иначе вся зона заливается плашкой. */
.ios-player-modal .player-modal-grabber::before,
.ios-lyrics-sheet .lyrics-grabber::before {
  background: color-mix(in srgb, var(--text) 58%, transparent);
}

.ios-action-sheet-card {
  border-radius: var(--control-surface-radius, var(--r-card));
}

/* Позднее правило body #menuSheetCard в основном stylesheet больше не может
   вернуть непрозрачный материал универсального меню. */
body #menuSheetCard,
body #menuSheet:has(.artist-info-sheet) > #menuSheetCard {
  --glass-blur: var(--piece-refract, var(--piece-filter));
  background: var(--piece-tint);
  border: 1px solid transparent;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--piece-shadow);
}

.ios-action-sheet-card .sheet-action-row {
  min-height: 52px;
  border-radius: 0;
  color: var(--text);
}

.ios-action-sheet-card .sheet-action-row svg {
  color: var(--text);
}

/* Информация об артисте — не отдельная старая «страница», а большая
   Liquid Glass surface с фотографией внутри. */
#menuSheet:has(.artist-info-sheet) > #menuSheetCard {
  /* Стекло карточки задаёт body #menuSheetCard выше (тот же селектор в списке). */
  border-radius: var(--control-surface-radius, var(--r-card)) var(--control-surface-radius, var(--r-card)) 0 0;
}

#menuSheet:has(.artist-info-sheet) .artist-info-photo {
  border-radius: var(--control-surface-radius, var(--r-card)) var(--control-surface-radius, var(--r-card)) 0 0;
  overflow: hidden;
}

#menuSheet:has(.artist-info-sheet) .artist-info-content {
  padding-inline: var(--s5);
  background: transparent;
}

#menuSheet:has(.artist-info-sheet) .artist-info-sheet {
  background: transparent;
}

#menuSheet:has(.artist-info-sheet) .artist-info-genre,
#menuSheet:has(.artist-info-sheet) .artist-info-close {
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* Плейлисты уже имеют правильную архитектуру; здесь только гарантируем, что
   переключение half/full не возвращает старый непрозрачный фон. */
.add-playlist-sheet {
  background: var(--piece-tint);
  border-color: transparent;
}

.add-playlist-circle {
  background: var(--piece-tint);
  border-color: transparent;
  box-shadow: var(--piece-shadow);
}

.add-playlist-search {
  background: color-mix(in srgb, var(--text) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}

.add-playlist-row {
  border-bottom-color: var(--line-soft);
}

.add-playlist-search,
.add-playlist-row,
.add-playlist-list {
  background: transparent;
}

/* Текст и эквалайзер в рабочем приложении могут быть inline-панелями плеера,
   но материал у них тот же — Liquid Glass, не отдельная тёмная тема. */
:is(.ios-lyrics-sheet, .ios-studio-sheet) {
  background: var(--piece-tint);
  color: var(--text);
}

.ios-lyrics-sheet .lyrics-backdrop,
.ios-studio-sheet .eq-backdrop {
  opacity: .42;
}

/* EQ controls are content of the sheet, not separate glass pieces. */
.ios-studio-sheet :is(.eq-sliders-board, .eq-glass-card, .simple-eq-grid,
  .simple-band-card, .eq-glass-select, .eq-glass-select-sm, .eq-mode-segments,
  .eq-curve-card, .eq-collapsible-fx, .eq-reset-btn) {
  background: transparent;
  border-color: var(--line-soft);
  box-shadow: none;
}

.ios-studio-sheet :is(.eq-glass-select, .eq-glass-select-sm, .eq-reset-btn) {
  border: 1px solid var(--line-soft);
}

.ios-studio-sheet .eq-seg-btn.active {
  background: color-mix(in srgb, var(--text) 12%, transparent);
  color: var(--text);
  box-shadow: none;
}

.ios-studio-sheet .vol-icon-btn {
  background: transparent;
  border: 0;
  color: var(--text);
}

/* Системный popover — та же поверхность, только без backdrop затемнения. */
.ios-sheet-backdrop.is-popover {
  background: transparent;
}

.ios-sheet-backdrop.is-popover > .ios-action-sheet-card {
  --glass-blur: var(--piece-refract, var(--piece-filter));
  background: var(--piece-tint);
  border-color: transparent;
  box-shadow: var(--piece-shadow);
}

/* На слабых устройствах токены качества сами заменяют blur на solid; здесь
   намеренно нет literal backdrop-filter, чтобы quality guards оставались
   единственным источником режима стекла. */
/* === onboarding.css === */
/* Use the current context-menu/player material. Never restore legacy glass-control/dock styling. */
.taste-screen {
  /* Scoped compatibility for this branch until the shared piece material is integrated.
     Current --piece-* tokens always win, including the user's frost setting. */
  --taste-piece-tone: var(--piece-tone, saturate(185%) brightness(.82));
  --taste-piece-filter: var(--piece-filter, blur(var(--glass-frost, 6px)) var(--taste-piece-tone));
  --taste-piece-tint: var(--piece-tint, color-mix(in srgb, var(--bg-surface) 46%, transparent));
  --taste-piece-light: var(--piece-light, .32);
  --taste-piece-dark: var(--piece-dark, 2);
  --taste-piece-shadow: var(--piece-shadow,
    inset 0 0 0 1px color-mix(in srgb, #fff calc(var(--taste-piece-light) * 10%), transparent),
    inset 1.8px 3px 0 -2px color-mix(in srgb, #fff calc(var(--taste-piece-light) * 90%), transparent),
    inset -2px -2px 0 -2px color-mix(in srgb, #fff calc(var(--taste-piece-light) * 80%), transparent),
    inset -3px -8px 1px -6px color-mix(in srgb, #fff calc(var(--taste-piece-light) * 60%), transparent),
    inset -.3px -1px 4px 0 color-mix(in srgb, #000 calc(var(--taste-piece-dark) * 12%), transparent),
    inset -1.5px 2.5px 0 -2px color-mix(in srgb, #000 calc(var(--taste-piece-dark) * 20%), transparent),
    inset 0 3px 4px -2px color-mix(in srgb, #000 calc(var(--taste-piece-dark) * 20%), transparent),
    inset 2px -6.5px 1px -4px color-mix(in srgb, #000 calc(var(--taste-piece-dark) * 10%), transparent),
    0 1px 5px color-mix(in srgb, #000 calc(var(--taste-piece-dark) * 10%), transparent),
    0 6px 16px color-mix(in srgb, #000 calc(var(--taste-piece-dark) * 8%), transparent));
  position: fixed; inset: 0; z-index: 1800;
  width: 100%; max-width: var(--app-max); margin-inline: auto;
  display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  isolation: isolate;
}
.taste-screen.hidden { display: none; }
:root[data-scheme="light"] .taste-screen {
  --taste-piece-tone: var(--piece-tone, saturate(185%) brightness(1.04));
  --taste-piece-tint: var(--piece-tint, color-mix(in srgb, var(--bg-surface) 52%, transparent));
  --taste-piece-light: var(--piece-light, 1);
  --taste-piece-dark: var(--piece-dark, 1);
}
:root[data-glass="lite"] .taste-screen {
  --taste-piece-filter: var(--piece-filter, blur(12px) saturate(90%));
  --taste-piece-tint: var(--piece-tint, color-mix(in srgb, var(--bg-surface) 86%, transparent));
}
:root[data-glass="solid"] .taste-screen {
  --taste-piece-filter: none;
  --taste-piece-tint: var(--bg-surface-raised);
}
.taste-search::before, .taste-count::before, .taste-count-liquid::before, .taste-cancel, .taste-continue {
  background: var(--taste-piece-tint);
  border: 0;
  box-shadow: var(--taste-piece-shadow);
}
/* Keep backdrop optics on the measured element; only tint and rim fade on
   ::before. The static backdrop resumes when the shared liquid sheet ends. */
.taste-search, .taste-count, .taste-count-liquid, .taste-cancel, .taste-continue {
  --glass-blur-piece: var(--piece-refract, var(--taste-piece-filter));   /* стекло кусочка: режимы качества правят --piece-filter */
  backdrop-filter: var(--glass-blur-piece);
  -webkit-backdrop-filter: var(--glass-blur-piece);
}
.taste-search::before, .taste-count::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  z-index: -1; pointer-events: none;
}
.taste-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  overflow-anchor: none; position: relative;
  padding: calc(var(--tg-header-clearance) + 20px) var(--page-gutter, 24px) calc(var(--sab) + 180px);
  scroll-padding-block: calc(var(--tg-header-clearance) + 76px) 180px;
  scrollbar-color: var(--text-secondary) transparent;
}
.taste-heading { position: relative; margin-bottom: 24px; }
.taste-heading h1 {
  margin: 0; max-width: 340px; font-size: 34px; font-weight: 750;
  line-height: 1.08; letter-spacing: -.035em; text-wrap: balance;
}
.taste-heading h1 > span { display: inline-block; }
.taste-lead { margin: 14px 0 0; max-width: 330px; font-size: 15px; line-height: 1.5; color: var(--text-secondary); }
.taste-cancel, .taste-retry {
  min-height: var(--tap-min); padding: 10px 18px; color: var(--text);
  border-radius: var(--control-radius, 999px);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.taste-retry { background: var(--bg-surface-raised); border: 0; }
.taste-search-rail {
  /* Sticky `top` resolves inside the scroller's padding box, which already
     carries clearance+20 — so 8-20=-12px lands the rail right under the
     Telegram chrome instead of a double-clearance drop mid-screen. */
  position: sticky; top: -12px; z-index: 3;
  min-height: 52px; margin-bottom: 20px;
}
/* Header cover: tiles scrolling under the top clearance just slide beneath a
   solid cap — no blur veil (owner call: keep it clean, not frosted). The cap
   reaches the screen top no matter the safe-area size; the scroller clips it. */
.taste-search-rail::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  top: -100vh; bottom: -6px;
  left: calc(-1 * var(--page-gutter, 24px)); right: calc(-1 * var(--page-gutter, 24px));
  background: var(--bg);
  -webkit-mask-image: linear-gradient(#000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 24px), transparent);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.taste-screen.is-pinned .taste-search-rail::before { opacity: 1; }
.taste-search-slot { width: 100%; transform-origin: left center; }
.taste-search-rail.has-count .taste-search-slot { width: calc(100% - 64px); }
.taste-search {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px; min-height: 52px;
  padding: 0 18px;
  border-radius: var(--control-radius, 999px);
}
.taste-search svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--text-secondary); }
.taste-search input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; padding: var(--s3) 0; caret-color: var(--accent); }
.taste-search input::placeholder { color: var(--text-secondary); opacity: 1; }
.taste-search:focus-within {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.taste-search input:focus-visible { outline: none; }
.taste-artists-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 14px; }
/* Swap layer: outgoing card clones dissolve over the already-rendered new
   cards — a true crossfade instead of a vanish-then-appear sequence. */
.taste-swap-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.taste-ghost {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 5px; box-sizing: border-box; pointer-events: none;
}
.taste-artist { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; padding: 5px; border: 0; border-radius: 16px; background: transparent; color: var(--text); cursor: pointer; font: inherit; -webkit-tap-highlight-color: transparent; isolation: isolate; }
.taste-portrait {
  position: relative; display: block; width: 100%; max-width: 108px; aspect-ratio: 1;
  border-radius: 50%; background: var(--bg-surface-raised);
  box-shadow: 0 4px 12px rgb(0 0 0 / .12);
}
/* Selected mark — liquid glass like paused artwork: a refracting rim around
   the portrait plus a frost annulus inside the photo edge, so the rim of the
   image melts into the ring. Same piece recipe as the search field. */
.taste-portrait::after {
  content: ""; position: absolute; inset: -5px; border-radius: inherit;
  background: color-mix(in srgb, var(--accent) 20%, var(--taste-piece-tint));
  --glass-blur-piece: var(--piece-refract, var(--taste-piece-filter));   /* стекло кусочка: режимы качества правят --piece-filter */
  backdrop-filter: var(--glass-blur-piece);
  -webkit-backdrop-filter: var(--glass-blur-piece);
  box-shadow: var(--taste-piece-shadow);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  opacity: 0; transform: scale(.96);
  transition: opacity var(--dur-short) var(--ease), transform var(--dur-move) var(--ease-out);
}
/* Иней по краю портрета — через токен бюджета стекла: «Без стекла» его снимает. */
:root { --glass-blur-portrait-rim: blur(4px); }
:root[data-glass="solid"] { --glass-blur-portrait-rim: none; }
/* Frost inside the photo edge: masked annulus of backdrop blur + accent tint.
   The masked edge fades inward so the photo rim dissolves, not crops. */
.taste-portrait::before {
  content: ""; position: absolute; z-index: 1; inset: 0; border-radius: inherit;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  backdrop-filter: var(--glass-blur-portrait-rim);
  -webkit-backdrop-filter: var(--glass-blur-portrait-rim);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 22px), #000 calc(100% - 9px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 22px), #000 calc(100% - 9px));
  opacity: 0; transform: scale(.94);
  transition: opacity var(--dur-short) var(--ease), transform var(--dur-short) var(--ease);
}
.taste-portrait img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.taste-artist-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; position: relative; height: 2.7em; font-size: 13px; font-weight: 600; line-height: 1.35; text-align: center; overflow-wrap: anywhere;
  transition: color var(--dur-move) var(--ease) var(--dur-name-lag),
    text-shadow var(--dur-move) var(--ease) var(--dur-name-lag),
    scale var(--dur-move) var(--ease-out) var(--dur-name-lag);
}
.taste-artist[aria-pressed="true"] .taste-portrait::after { opacity: 1; transform: scale(1); }
.taste-artist[aria-pressed="true"] .taste-portrait::before { animation: tasteFrostIn var(--dur-move) var(--ease) both; }
.taste-artist[aria-pressed="true"] .taste-portrait img { filter: saturate(1.08); }
/* Selected name — no plate: the letters warm to accent with a soft inner
   glow and a slight inhale, while a single sheen sweeps through the text. */
.taste-artist[aria-pressed="true"] .taste-artist-name {
  color: color-mix(in srgb, var(--accent) 62%, var(--text));
  text-shadow:
    0 0 3px color-mix(in srgb, var(--accent) 40%, transparent),
    0 0 18px color-mix(in srgb, var(--accent) 30%, transparent);
  scale: 1.03;
  background-image: linear-gradient(105deg,
    transparent 40%,
    color-mix(in srgb, var(--accent) 85%, #fff) 50%,
    transparent 60%);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  animation: tasteNameSheen var(--dur-move) var(--ease-out) var(--dur-sheen-lag) both;
}
@keyframes tasteFrostIn {
  0%   { opacity: 0; transform: scale(.94); }
  36%  { opacity: 0; transform: scale(.94); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes tasteNameSheen {
  0%   { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}
.taste-loading.hidden { display: none; }
.taste-loading-caption { display: flex; align-items: center; gap: 12px; margin: 4px 0 24px; color: var(--text-secondary); font-size: 13px; }
.taste-loading-wave { display: inline-flex; align-items: center; justify-content: center; gap: 3px; flex-shrink: 0; height: 24px; color: var(--accent); }
.taste-loading-wave i { display: block; width: 3px; height: 100%; border-radius: 999px; background: currentColor; transform-origin: center; }
.taste-loading-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 14px; }
.taste-loading-grid > span { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 5px; }
.taste-loading-grid i { width: 100%; max-width: 108px; aspect-ratio: 1; border-radius: 50%; background: var(--bg-surface-raised); }
.taste-loading-grid b { width: 60%; height: 10px; border-radius: 999px; background: var(--bg-surface-raised); }
.taste-screen:has(.taste-loading:not(.hidden)) .taste-message { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.taste-message { font-size: 15px; line-height: 1.4; color: var(--text-secondary); margin: 0 0 var(--s3); }
.taste-footer {
  position: absolute; z-index: 4; bottom: calc(var(--sab) + 12px);
  left: var(--page-gutter, 24px); right: var(--page-gutter, 24px);
  padding: 0;
}
.taste-count {
  position: absolute; z-index: 2; top: 0; right: 0; width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  font-variant-numeric: tabular-nums; color: var(--text); pointer-events: none;
  opacity: 0; transform: translateX(-48px) scale(.65, .86);
}
.taste-search-rail.has-count .taste-count { opacity: 1; transform: none; }
.taste-count-number, .taste-count-digit { display: inline-block; }
.taste-count-number { font-size: 21px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.taste-count.is-ready .taste-count-number { color: var(--accent); }
.taste-count-liquid, .taste-count-rim {
  display: none; position: absolute; z-index: 0; pointer-events: none;
}
/* The sheet covers the search field pixel for pixel (its refraction map is
   the field's); only the rim gets a 12px margin for its soft shadow. */
.taste-count-liquid { left: 0; top: 0; height: 52px; }
.taste-count-rim { left: -12px; top: -12px; height: 76px; }
.taste-count-liquid {
  /* Стекло — общее правило полей онбординга выше (тот же материал кусочка). */
  box-shadow: none;
}
.taste-count-liquid::before {
  content: ""; position: absolute; inset: 0; box-shadow: none;
}
.taste-count-rim { overflow: visible; z-index: 1; }
.taste-liquid-shadow { fill: color-mix(in srgb, #000 calc(var(--taste-piece-dark) * 16%), transparent); }
.taste-liquid-edge { fill: none; stroke-width: 2; stroke: color-mix(in srgb, #fff calc(var(--taste-piece-light) * 14%), transparent); }
.taste-liquid-top { fill: color-mix(in srgb, #fff calc(var(--taste-piece-light) * 90%), transparent); }
.taste-liquid-bottom { fill: color-mix(in srgb, #fff calc(var(--taste-piece-light) * 50%), transparent); }
.taste-search-rail.count-flowing :is(.taste-count-liquid, .taste-count-rim) { display: block; }
.taste-search-rail:is(.count-flowing, .count-joined) :is(.taste-search, .taste-count) {
  z-index: auto;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* One glass at a time: the field's tint and the sheet swap in the same frame.
   Never fade one backdrop into another — mid-fade neither blurs fully. */
.taste-search-rail:is(.count-flowing, .count-joined) :is(.taste-search, .taste-count)::before { opacity: 0; transition: none; }
.taste-search-rail.count-joined :is(.taste-count-liquid, .taste-count-rim) { display: block; }
.taste-search-rail:is(.count-flowing, .count-joined) .taste-count-liquid { z-index: 0; }
.taste-search-rail:is(.count-flowing, .count-joined) .taste-count-rim { z-index: 1; }
.taste-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.taste-actions > button { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 52px; padding: 12px 16px; border-radius: var(--control-radius, 999px); font: inherit; font-size: 15px; cursor: pointer; }
/* Активный CTA — залитый акцентом (как .chart-chip.is-active): на стекле акцентный текст
   не держал контраст 4.5. Отключённый остаётся стеклом с приглушённым текстом. */
.taste-continue:not(:disabled) { --taste-piece-tint: var(--accent-fill); color: var(--accent-on); font-weight: 650 !important; }
.taste-continue:disabled { color: var(--text-secondary); cursor: default; }
.taste-cancel:disabled { color: var(--text-secondary); cursor: default; }
.taste-save-error { margin: 0 0 var(--s3); font-size: 13px; line-height: 1.4; color: var(--text); text-align: center; }
.taste-screen button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.taste-screen button { transition: transform var(--dur-press) var(--ease), background-color var(--dur-fast) var(--ease); }
.taste-artist:active { transform: scale(.97); }
/* NMJelly owns the scale while glass swells; NMPress must not compress it too. */
.jelly-live { scale: none !important; }
.taste-screen :is(.taste-message, .taste-cancel, .taste-retry, .taste-save-error).hidden { display: none; }
/* visibility alone is insufficient: dock children explicitly set it to visible. */
html.taste-open #floatingIslandDock { display: none !important; }
html.taste-open .ios-main-content { visibility: hidden; }
.home-start-mixes .mix-card { width: 168px; flex: 0 0 168px; }
.home-start-mixes .mix-art-wrap { width: 100%; height: auto; }
.home-start-mixes .mix-card-name { white-space: normal; }
@media (max-width: 360px) {
  .taste-heading h1 { font-size: 30px; }
  .taste-artists-grid { gap: 22px 10px; }
  .taste-artist { padding: 4px; gap: 10px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .taste-search::before, .taste-count::before, .taste-count-liquid::before, .taste-cancel, .taste-continue { background: var(--bg-surface); }
}
@media (prefers-reduced-motion: reduce) {
  .taste-screen button, .taste-search, .taste-portrait::after, .taste-portrait::before, .taste-artist-name { transition: none; animation: none; }
  .taste-screen button:active { transform: none; }
}
html[data-motion="instant"] .taste-portrait::after,
html[data-motion="instant"] .taste-portrait::before,
html[data-motion="instant"] .taste-artist-name { transition: none; animation: none; }
