/* Шрифты из заготовок Decidio (SIL OFL): Unbounded — заголовки, Manrope — текст */
@font-face {
  font-family: "Unbounded";
  src: url("/static/fonts/unbounded-var.woff2") format("woff2-variations");
  font-weight: 200 900; font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/static/fonts/manrope-var.woff2") format("woff2-variations");
  font-weight: 200 800; font-display: swap;
}

:root {
  --bg: var(--tg-theme-bg-color, #111214);
  --bg2: var(--tg-theme-secondary-bg-color, #1c1d21);
  --text: var(--tg-theme-text-color, #f2f2f5);
  --hint: var(--tg-theme-hint-color, #8b8d96);
  --accent: var(--tg-theme-button-color, #3e8cf0);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --sep: color-mix(in srgb, var(--hint) 22%, transparent);
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Наши темы. Без data-theme — цвета из Telegram (переменные выше) */
:root[data-theme="dark"] {
  --bg: #0f1012;
  --bg2: #1c1d21;
  --text: #f3f3f5;
  --hint: #8d8f98;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg2: #f1f2f5;
  --text: #121316;
  --hint: #6b6e78;
  color-scheme: light;
}
/* Фирменный акцент; «как в Telegram» — переменные из клиента выше */
:root[data-accent="brand"] {
  --accent: #8B5CF6;
  --accent-text: #ffffff;
}
:root[data-tone="light"] .toast { background: rgba(20, 20, 24, .92); }
:root[data-tone="light"] .mini { box-shadow: 0 8px 30px rgba(0, 0, 0, .12); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.35 "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
/* Иконки Lucide — контурные; кнопки плеера и «нравится» залиты (класс fill) */
svg { width: 24px; height: 24px; display: block; flex: none; }
svg.fill { fill: currentColor; }
[hidden] { display: none !important; }

/* ---------- Шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--sep);
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2); border-radius: 12px; padding: 0 12px; height: 40px;
  color: var(--hint);
}
.search svg { width: 20px; height: 20px; flex: none; }
.search input {
  flex: 1; min-width: 0; height: 100%;
  background: none; border: 0; outline: none; color: var(--text); font: inherit;
  -webkit-user-select: text; user-select: text;
}
.search input::-webkit-search-cancel-button { display: none; }
.tabs { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tab {
  height: 32px; padding: 0 12px; border-radius: 16px; white-space: nowrap;
  background: var(--bg2); color: var(--hint); font-weight: 500; font-size: 14px;
}
.tab span { opacity: .7; font-weight: 400; }
.tab.active { background: var(--accent); color: var(--accent-text); }
.tab-action {
  margin-left: auto; width: 36px; height: 32px; border-radius: 16px;
  display: grid; place-items: center; background: var(--bg2); color: var(--text); cursor: pointer;
}
.tab-action + .tab-action { margin-left: 0; }
.tab-action svg { width: 20px; height: 20px; }

/* ---------- Список ---------- */
main { padding: 4px 0 calc(90px + var(--safe-bottom)); }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; cursor: pointer;
}
.row:active { background: var(--bg2); }
.row.playing .title { color: var(--accent); }
.row .meta { flex: 1; min-width: 0; }
.row .dur { color: var(--hint); font-size: 13px; font-variant-numeric: tabular-nums; }
.row .more { color: var(--hint); width: 32px; height: 32px; display: grid; place-items: center; margin-right: -8px; }
.row .more svg { width: 20px; height: 20px; }
.title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist { color: var(--hint); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-mark { color: #ff4d6d; margin-left: 4px; font-size: 12px; }
.nothing { text-align: center; color: var(--hint); padding: 40px 16px; }

/* ---------- Обложки ---------- */
.cover {
  flex: none; position: relative; overflow: hidden;
  width: 48px; height: 48px; border-radius: 10px;
  display: grid; place-items: center;
  color: rgba(255,255,255,.9); font-weight: 600;
  background: linear-gradient(135deg, var(--c1, #5b6cff), var(--c2, #b14cff));
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s ease; }
.cover img.ok { opacity: 1; }
.cover.small { width: 42px; height: 42px; border-radius: 8px; font-size: 14px; }
.cover.big {
  width: min(78vw, 340px); height: min(78vw, 340px); border-radius: 18px;
  margin: 8px auto 24px; font-size: 64px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}

/* ---------- Пустое состояние ---------- */
.empty { text-align: center; padding: 48px 32px; color: var(--hint); }
.empty h2 { color: var(--text); margin: 8px 0 12px; font-size: 20px; }
.empty-icon { font-size: 56px; }

/* ---------- Мини-плеер ---------- */
.mini {
  position: fixed; left: 8px; right: 8px; bottom: calc(8px + var(--safe-bottom)); z-index: 10;
  background: var(--bg2); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
}
.mini-progress { height: 2px; background: var(--sep); }
#mini-bar { height: 100%; width: 0; background: var(--accent); }
.mini-body { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; }
.mini .meta { flex: 1; min-width: 0; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn:active { background: var(--sep); }
.icon-btn.on { color: var(--accent); }
.icon-btn { position: relative; }
.icon-btn.loading::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: currentColor;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Полный плеер ---------- */
.player {
  position: fixed; inset: 0; z-index: 20; background: var(--bg);
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.player-inner {
  height: 100%; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: 16px 24px calc(24px + var(--safe-bottom));
}
.grabber { width: 44px; height: 5px; border-radius: 3px; background: var(--sep); margin: 0 auto 16px; }
.p-head { display: flex; align-items: center; gap: 12px; }
.p-head .meta { flex: 1; min-width: 0; }
.p-head .title { font-size: 20px; font-weight: 600; }
.p-head .artist { font-size: 16px; }
.fav.on { color: #ff4d6d; }
#p-seek {
  width: 100%; margin: 20px 0 6px; accent-color: var(--accent);
  -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--pct, 0%), var(--sep) var(--pct, 0%));
}
#p-seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text);
}
.times { display: flex; justify-content: space-between; color: var(--hint); font-size: 12px; font-variant-numeric: tabular-nums; }
.controls { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.controls svg { width: 30px; height: 30px; }
.controls #p-shuffle svg, .controls #p-repeat svg { width: 24px; height: 24px; }
.icon-btn.play { width: 72px; height: 72px; background: var(--accent); color: var(--accent-text); }
.icon-btn.play svg { width: 36px; height: 36px; }
.repeat-one { position: relative; }
.repeat-one::after {
  content: "1"; position: absolute; top: 6px; right: 6px;
  font-size: 9px; font-weight: 700; background: var(--accent); color: var(--accent-text);
  border-radius: 6px; padding: 0 3px;
}

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(96px + var(--safe-bottom)); z-index: 30;
  background: rgba(30,30,34,.95); color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 14px; max-width: calc(100% - 32px); text-align: center;
}

/* ---------- Плейлисты и папки ---------- */
.create-row { display: flex; gap: 8px; padding: 10px 16px 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px 0 10px; border-radius: 18px;
  background: var(--bg2); font-weight: 500; font-size: 14px;
}
.pill svg { width: 20px; height: 20px; color: var(--accent); }
.empty-cover { background: var(--bg2); color: var(--hint); }
.empty-cover svg { width: 45%; height: 45%; }
.folder-row .folder-icon {
  width: 48px; height: 48px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--bg2); color: var(--accent);
}
.folder-row .chev { color: var(--hint); transition: transform .15s; }
.folder-row .chev svg { width: 20px; height: 20px; }
.folder-row.open .chev { transform: rotate(90deg); }
.row.nested { padding-left: 32px; }
.nested-hint { padding: 6px 16px 10px 32px; color: var(--hint); font-size: 13px; }

/* ---------- Экраны поверх библиотеки ---------- */
.page { padding-bottom: calc(96px + var(--safe-bottom)); }
.page-bar { padding: 8px 8px 0; }
.page-bar .icon-btn { color: var(--accent); }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 24px 16px; }
.cover.hero-cover { width: 180px; height: 180px; border-radius: 16px; font-size: 64px; box-shadow: 0 14px 40px rgba(0,0,0,.3); }
.hero h1 { font-size: 22px; margin: 16px 0 4px; word-break: break-word; }
.hero-label { margin-top: 14px; color: var(--hint); font-size: 13px; }
.hero-label + h1 { margin-top: 2px; }
.hero-meta { color: var(--hint); font-size: 14px; display: flex; align-items: center; gap: 4px; }
.hero-meta svg { width: 16px; height: 16px; }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 20px; border-radius: 22px;
  background: var(--bg2); font-weight: 600;
}
.btn svg { width: 22px; height: 22px; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.round { width: 44px; padding: 0; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; }
.btn:active:not(:disabled) { filter: brightness(.9); }

.add-row { width: 100%; text-align: left; }
.add-cover { background: var(--bg2); color: var(--accent); }
.add-row .title { color: var(--accent); }

.row.disabled { opacity: .5; }
.check {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  border: 2px solid var(--hint); display: grid; place-items: center; color: transparent;
}
.check svg { width: 18px; height: 18px; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.picker-head { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 16px 10px; border-bottom: 1px solid var(--sep); }
.picker-title { font-weight: 600; margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: var(--bg); border-top: 1px solid var(--sep);
}

/* ---------- Шторка ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 80vh; overflow-y: auto;
  background: var(--bg); border-radius: 18px 18px 0 0;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  animation: up .2s ease-out;
}
.sheet-title { text-align: center; font-weight: 600; padding: 10px 16px 12px; }
.sheet-title small { display: block; color: var(--hint); font-weight: 400; font-size: 13px; margin-top: 2px; }
.sheet-items { background: var(--bg2); border-radius: 14px; overflow: hidden; }
.sheet-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; text-align: left; font-size: 16px;
}
.sheet-items .sheet-item + .sheet-item { border-top: 1px solid var(--sep); }
.sheet-item svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.sheet-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-item small { color: var(--hint); font-size: 13px; }
.sheet-item.danger, .sheet-item.danger svg { color: #ff4d4f; }
.sheet-item:active { background: var(--sep); }
.sheet-item.cancel { justify-content: center; margin-top: 8px; background: var(--bg2); border-radius: 14px; font-weight: 600; color: var(--accent); }
.sheet-form { display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.sheet-form input {
  height: 48px; border-radius: 12px; border: 0; outline: none; padding: 0 14px;
  background: var(--bg2); color: var(--text); font: inherit; font-size: 16px;
  -webkit-user-select: text; user-select: text;
}
.p-head #p-add { color: var(--hint); }

/* ---------- Коллекция ---------- */
.home-head {
  position: sticky; top: 0; z-index: 5; background: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 8px 6px 16px;
}
.home-title { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.home-head .icon-btn svg { width: 26px; height: 26px; }

.like-card {
  display: flex; align-items: center; gap: 16px; width: 100%;
  padding: 12px 16px 8px; text-align: left;
}
.like-heart {
  width: 72px; height: 72px; flex: none; display: grid; place-items: center;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 25%, #ff9a7a, #ff4d4f 55%, #c9183a);
  box-shadow: 0 10px 26px rgba(255, 77, 79, .35);
  color: #fff;
}
.like-heart svg { width: 40px; height: 40px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.like-heart.big { width: 150px; height: 150px; border-radius: 28px; }
.like-heart.big svg { width: 80px; height: 80px; }
.like-title { display: flex; align-items: center; gap: 2px; font-size: 22px; font-weight: 800; }
.like-title svg { width: 22px; height: 22px; }
.like-sub { color: var(--hint); font-size: 15px; margin-top: 2px; }
.hint { color: var(--hint); font-size: 14px; padding: 4px 16px 8px; }

.sec-title {
  display: flex; align-items: center; gap: 2px; width: 100%;
  font-size: 21px; font-weight: 800; padding: 22px 16px 10px; text-align: left;
}
.sec-title svg { width: 22px; height: 22px; }
.sec-title.static { cursor: default; }
#pg-list .sec-title { font-size: 17px; padding-top: 16px; }

.artists-scroll {
  display: flex; gap: 14px; overflow-x: auto; padding: 0 16px 4px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.artists-scroll::-webkit-scrollbar { display: none; }
.artist-card { flex: none; width: 116px; text-align: center; scroll-snap-align: start; }
.cover.artist-ava { width: 116px; height: 116px; border-radius: 50%; font-size: 40px; }
.artist-rank { margin-top: 8px; font-weight: 700; font-size: 16px; }
.crown { font-size: 13px; }
.artist-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-sub { color: var(--hint); font-size: 13px; }
.cover.circle { border-radius: 50%; }
.cover.circle.hero-cover { width: 150px; height: 150px; font-size: 56px; }
.row .chev { color: var(--hint); }
.row .chev svg { width: 20px; height: 20px; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; padding: 0 16px 16px; }
.tile { display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; cursor: pointer; }
.stack { position: relative; flex: none; width: 60px; height: 60px; }
.stack::before {
  content: ""; position: absolute; left: 8px; right: -6px; top: -6px; bottom: 8px;
  border-radius: 10px; background: var(--bg2);
}
.cover.tile-cover { position: relative; width: 60px; height: 60px; border-radius: 10px; font-size: 22px; }
.accent-cover { background: var(--bg2); color: var(--accent); }
.accent-cover svg { width: 28px; height: 28px; }
.tile-text { min-width: 0; }
.tile-title { font-weight: 700; font-size: 16px; }
.tile-sub {
  color: var(--hint); font-size: 13px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- Страницы-списки ---------- */
.page-bar { display: flex; align-items: center; gap: 4px; padding: 8px 8px 0; }
.page-bar-title { font-weight: 600; }
.list-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 24px 12px; }
.list-hero h1 { font-size: 26px; font-weight: 800; margin: 14px 0 4px; }
.list-hero.left { align-items: flex-start; text-align: left; padding: 0 16px 8px; }
.list-hero.left h1 { margin-top: 4px; }
.page-search { padding: 4px 16px 8px; }
.search-head { display: flex; align-items: center; gap: 4px; padding-left: 4px; }
.search-head .search { flex: 1; }
label.btn { cursor: pointer; }

/* ---------- Альбомы ---------- */
.album-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; padding: 4px 16px 16px; }
.album-card { text-align: left; min-width: 0; }
.cover.album-cover { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; font-size: 44px; margin-bottom: 8px; }
.hero-artist { color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.hero-note { color: var(--hint); font-size: 13px; max-width: 300px; margin: 6px 0 2px; }

/* ---------- Исправление данных ---------- */
.fix-current {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 16px 12px; padding: 10px 12px; border-radius: 14px; background: var(--bg2);
}
.fix-current .meta { flex: 1; min-width: 0; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; gap: 4px; }
.btn.small svg { width: 16px; height: 16px; }
.badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent);
  font-size: 11px; font-weight: 600; vertical-align: 2px;
}

.home-actions { display: flex; }

/* ---------- Плеер: фон из цвета обложки ---------- */
.player { transition: background-color .5s ease; }
.player.tinted { background: linear-gradient(180deg, var(--tint) 0%, var(--tint) 30%, var(--bg) 100%); }

/* ---------- Настройки ---------- */
.group-title {
  padding: 18px 20px 6px; color: var(--hint);
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
.settings-group { margin: 0 16px; background: var(--bg2); border-radius: 14px; overflow: hidden; }
.settings-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 52px; padding: 8px 14px; text-align: left;
}
.settings-row + .settings-row { border-top: 1px solid var(--sep); }
.settings-row:active { background: var(--sep); }
.settings-row > span { flex: 1; font-size: 16px; }
.settings-row > small { color: var(--hint); font-size: 15px; }
.settings-row > svg { width: 18px; height: 18px; color: var(--hint); }
.settings-icon {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-text);
}
.settings-icon svg { width: 18px; height: 18px; }
.option-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.option-text span { font-size: 16px; }
.option-text small { color: var(--hint); font-size: 13px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.settings-footer { text-align: center; color: var(--hint); font-size: 13px; padding: 28px 16px; }

/* Живой пример */
.preview {
  margin: 0 16px; padding: 14px 18px 18px; border-radius: 18px;
  background: var(--bg); border: 1px solid var(--sep);
  display: flex; flex-direction: column; align-items: center;
  transition: background .4s ease;
}
.preview.tinted { background: linear-gradient(180deg, var(--tint, var(--bg2)) 0%, var(--bg) 100%); }
.preview-chips { align-self: flex-start; display: flex; gap: 6px; margin-bottom: 14px; }
.chip { height: 26px; padding: 0 12px; border-radius: 13px; background: var(--bg2); color: var(--hint); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.chip.on { background: var(--accent); color: var(--accent-text); }
.cover.preview-cover { width: 140px; height: 140px; border-radius: 14px; font-size: 44px; box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.preview-logo { width: 140px; height: 140px; border-radius: 30px; display: block; box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.preview-title { margin-top: 12px; font-weight: 700; }
.preview-artist { color: var(--hint); font-size: 13px; }
.preview-bar { width: 100%; height: 4px; border-radius: 2px; background: var(--sep); margin: 12px 0; overflow: hidden; }
.preview-bar div { width: 38%; height: 100%; background: var(--accent); }
.preview-controls { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.preview-controls > svg { width: 20px; height: 20px; }
.preview-play { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.preview-play svg { width: 22px; height: 22px; }

/* ---------- Переключатели и справка ---------- */
.switch {
  position: relative; flex: none; width: 51px; height: 31px; border-radius: 16px;
  background: color-mix(in srgb, var(--hint) 35%, transparent); transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s;
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }
.settings-row.disabled { opacity: .55; cursor: default; }
.settings-row > .soon { flex: none; }
.soon { font-size: 12px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); padding: 3px 8px; border-radius: 8px; }

.help { padding: 4px 16px; display: flex; flex-direction: column; gap: 14px; }
.help-step { display: flex; gap: 12px; background: var(--bg2); border-radius: 14px; padding: 14px; }
.help-step .artist { white-space: normal; line-height: 1.4; margin-top: 2px; }
.help-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 14px;
}
.about { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 32px; }
.about-logo { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
.about h1 { margin: 18px 0 2px; font-size: 26px; }
.about .hint { padding: 0; }
.about p { color: var(--hint); line-height: 1.45; margin-top: 16px; }

/* ---------- Плеер в стиле Яндекс Музыки ---------- */
.player { overflow: hidden; will-change: transform; }
.player-scroll { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.player-main {
  min-height: 100%; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: 6px 24px calc(18px + var(--safe-bottom));
}
.player-top { display: flex; align-items: center; gap: 8px; margin: 0 -12px 14px; }
.player-top svg { width: 26px; height: 26px; }
.player-context {
  flex: 1; min-width: 0; text-align: center; font-weight: 600; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cover.big { margin: 0 auto 26px; }
.p-head { gap: 4px; }
.p-head .icon-btn { color: var(--text); opacity: .85; }
.p-artist { display: block; max-width: 100%; text-align: left; font-size: 16px; color: var(--hint); }
.controls { margin-top: 14px; }
.controls .side { color: var(--text); opacity: .85; }
.controls .side svg { width: 27px; height: 27px; }
.controls .side.fav.on { color: #ff4d6d; opacity: 1; }
.player-pills { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }
.pill-btn {
  position: relative; flex: 1; max-width: 108px; height: 46px; border-radius: 23px;
  display: grid; place-items: center; color: var(--text);
  background: color-mix(in srgb, var(--text) 9%, transparent);
}
.pill-btn svg { width: 22px; height: 22px; }
.pill-btn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.pill-btn:active { filter: brightness(.9); }
.p-more-section { max-width: 480px; margin: 0 auto; padding-bottom: calc(28px + var(--safe-bottom)); }

/* ---------- Шторка трека ---------- */
.ts-head { display: flex; align-items: center; gap: 14px; padding: 10px 8px 12px; }
.ts-head .meta { flex: 1; min-width: 0; }
.ts-head .title { font-size: 18px; font-weight: 700; white-space: normal; }
.cover.ts-cover { width: 76px; height: 76px; border-radius: 12px; font-size: 28px; }
.ts-artist { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px 10px; text-align: left; }
.ts-artist span { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-artist > svg { width: 18px; height: 18px; color: var(--hint); }
.cover.ts-ava { width: 40px; height: 40px; font-size: 15px; }
.ts-actions { display: flex; justify-content: space-around; padding: 6px 0 16px; }
.ts-actions button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--text); width: 92px; }
.ts-round { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); }
.ts-round svg { width: 26px; height: 26px; }
.ts-actions button.on .ts-round { color: #ff4d6d; }

/* ---------- Очередь и «О треке» ---------- */
.queue-label { color: var(--hint); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; padding: 10px 8px 2px; }
.sheet-panel .row { padding-left: 8px; padding-right: 8px; }
.queue-row .more svg { width: 20px; height: 20px; }
.info-list { background: var(--bg2); border-radius: 14px; overflow: hidden; }
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; font-size: 15px; }
.info-row + .info-row { border-top: 1px solid var(--sep); }
.info-row span { color: var(--hint); flex: none; }
.info-row b { font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Нижние вкладки ---------- */
:root { --tabbar-h: 58px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-top: 1px solid var(--sep);
}
.tabbar-btn {
  flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--hint); font-size: 11px; font-weight: 600;
}
.tabbar-icon svg { width: 25px; height: 25px; }
.tabbar-btn.active { color: var(--accent); }
.player.tinted ~ .tabbar { background: color-mix(in srgb, var(--bg) 70%, transparent); }

/* Всё, что прижато к низу, теперь стоит над вкладками */
.mini { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px); }
.page { padding-bottom: calc(var(--tabbar-h) + 104px + var(--safe-bottom)); }
.player-main { padding-bottom: calc(var(--tabbar-h) + 18px + var(--safe-bottom)); }
.p-more-section { padding-bottom: calc(var(--tabbar-h) + 28px + var(--safe-bottom)); }
.bottom-bar { bottom: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: 10px; }
.toast { bottom: calc(var(--tabbar-h) + 96px + var(--safe-bottom)); }
.player { animation: none; }

/* ---------- Вкладка «Плеер», когда ничего не играет ---------- */
.player-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px 32px calc(var(--tabbar-h) + 24px + var(--safe-bottom)); text-align: center;
}
.player-empty[hidden] { display: none; }
.player-empty-art {
  width: 180px; height: 180px; border-radius: 28px; margin-bottom: 10px;
  display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent) 60%, color-mix(in srgb, var(--accent) 60%, #000));
  box-shadow: 0 18px 50px color-mix(in srgb, var(--accent) 40%, transparent);
}
.player-empty h2 { margin: 8px 0 0; font-size: 22px; }
.player-empty p { margin: 0 0 8px; color: var(--hint); }
.player-empty .btn { width: 100%; max-width: 300px; }
.player-empty-art svg { width: 84px; height: 84px; stroke-width: 1.5; }

/* ---------- Типографика ---------- */
.home-title, .list-hero h1, .hero h1, .like-title, .sec-title, .player-empty h2, .about h1, .empty h2 {
  font-family: "Unbounded", "Manrope", sans-serif;
  letter-spacing: -0.02em;
}
.home-title { font-size: 26px; font-weight: 700; }
.home-greeting { color: var(--hint); font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.like-title { font-size: 19px; font-weight: 700; }
.sec-title { font-size: 18px; font-weight: 700; }
#pg-list .sec-title { font-size: 15px; }
.list-hero h1, .hero h1 { font-size: 22px; font-weight: 700; }
.title { font-weight: 600; }
.p-head .title { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.tile-title { font-weight: 700; }

/* ---------- Эквалайзер ---------- */
.eq {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: center; gap: 3px;
  padding-bottom: 28%; background: rgba(0, 0, 0, .45); border-radius: inherit;
}
.eq i { width: 3px; border-radius: 2px; background: #fff; animation: eq .9s ease-in-out infinite; height: 40%; }
.eq i:nth-child(2) { animation-delay: -.3s; height: 70%; }
.eq i:nth-child(3) { animation-delay: -.6s; height: 50%; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.eq i { transform-origin: bottom; }
.cover.small .eq { padding-bottom: 26%; }
.cover.small .eq i { width: 2.5px; }
body.is-paused .eq i { animation-play-state: paused; }

/* ---------- Обложка в плеере: на паузе чуть уменьшается ---------- */
.cover-stage > .cover { transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s ease; }
body.is-paused .cover-stage > .cover { transform: scale(.86); box-shadow: 0 8px 22px rgba(0, 0, 0, .25); }

/* ---------- Отклик на нажатия ---------- */
.row, .tile, .btn, .icon-btn, .pill-btn, .artist-card, .album-card, .like-card, .settings-row, .pill, .tabbar-btn, .ts-actions button {
  transition: transform .12s ease, background-color .15s ease;
}
.row:active, .tile:active, .artist-card:active, .album-card:active, .like-card:active, .settings-row:active { transform: scale(.98); }
.btn:active, .icon-btn:active, .pill-btn:active, .pill:active, .tabbar-btn:active, .ts-actions button:active { transform: scale(.92); }

/* ---------- Переходы между страницами ---------- */
@keyframes page-forward { from { opacity: 0; transform: translateX(28px); } }
@keyframes page-back { from { opacity: 0; transform: translateX(-28px); } }
.page.enter-forward { animation: page-forward .26s cubic-bezier(.2, .8, .2, 1); }
.page.enter-back { animation: page-back .22s cubic-bezier(.2, .8, .2, 1); }

/* ---------- Скелетон загрузки ---------- */
.skeleton { padding: 18px 16px; }
.sk {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--bg2) 0%, color-mix(in srgb, var(--bg2) 60%, var(--hint) 18%) 50%, var(--bg2) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-title { width: 55%; height: 30px; margin-bottom: 22px; }
.sk-like, .sk-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.sk-like > div:last-child, .sk-row > div:last-child { flex: 1; }
.sk-heart { width: 72px; height: 72px; border-radius: 18px; }
.sk-cover { width: 48px; height: 48px; flex: none; }
.sk-line { height: 12px; margin: 6px 0; }
.w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; }
.sk-circles { display: flex; gap: 14px; margin-top: 26px; }
.sk-circle { width: 104px; height: 104px; border-radius: 50%; }

/* Свайп по мини-плееру */
.mini { touch-action: pan-y; }

/* ---------- Плейлисты: большие карточки с коллажем ---------- */
.pl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; padding: 6px 16px 16px; }
.pl-card { min-width: 0; text-align: left; cursor: pointer; }
.cover.pl-cover { width: 100%; height: auto; aspect-ratio: 1; border-radius: 16px; font-size: 52px; box-shadow: 0 10px 26px rgba(0, 0, 0, .22); }
.pl-card-meta { display: flex; align-items: flex-start; gap: 4px; margin-top: 8px; }
.pl-card-meta .meta { flex: 1; min-width: 0; }
.pl-card-meta .more { color: var(--hint); width: 30px; height: 30px; margin: -4px -6px 0 0; display: grid; place-items: center; }
.pl-card-meta .more svg { width: 20px; height: 20px; }
.pl-new .pl-cover {
  background: none; box-shadow: none; color: var(--accent);
  border: 2px dashed color-mix(in srgb, var(--hint) 45%, transparent);
}
.pl-new .pl-cover svg { width: 40%; height: 40%; }
.pl-new .title { color: var(--accent); }

/* Коллаж без сетки: каждая картинка жёстко стоит в своей четверти.
   Safari на iPhone считает высоту картинок в grid по-своему — с абсолютным позиционированием разъехаться нечему */
.cover.collage { background: var(--bg2); }
.cover.collage img { position: absolute; inset: auto; width: 50%; height: 50%; object-fit: cover; }
.cover.collage img:nth-child(1) { top: 0; left: 0; }
.cover.collage img:nth-child(2) { top: 0; left: 50%; }
.cover.collage img:nth-child(3) { top: 50%; left: 0; }
.cover.collage img:nth-child(4) { top: 50%; left: 50%; }
.cover.hero-cover { width: 220px; height: 220px; }
.cover.circle.hero-cover { width: 150px; height: 150px; }

/* ---------- Плавная смена трека ---------- */
/* Обе обложки лежат в одной ячейке: старая уезжает, новая одновременно въезжает */
.cover-stage { display: grid; place-items: center; margin: 0 auto 26px; }
.cover-stage > .cover.big { grid-area: 1 / 1; margin: 0; }
@keyframes cover-enter-next { from { translate: 80% 0; scale: .88; opacity: 0; } }
@keyframes cover-leave-next { to { translate: -80% 0; scale: .88; opacity: 0; } }
@keyframes cover-enter-prev { from { translate: -80% 0; scale: .88; opacity: 0; } }
@keyframes cover-leave-prev { to { translate: 80% 0; scale: .88; opacity: 0; } }
.cover-stage > .enter-next { animation: cover-enter-next .5s cubic-bezier(.45, 0, .2, 1) both; }
.cover-stage > .leave-next { animation: cover-leave-next .5s cubic-bezier(.45, 0, .2, 1) both; pointer-events: none; }
.cover-stage > .enter-prev { animation: cover-enter-prev .5s cubic-bezier(.45, 0, .2, 1) both; }
.cover-stage > .leave-prev { animation: cover-leave-prev .5s cubic-bezier(.45, 0, .2, 1) both; pointer-events: none; }
@keyframes fade-swap { 0% { opacity: 0; } 40% { opacity: 0; translate: 0 6px; } }
.fade-swap { animation: fade-swap .5s ease; }

/* ---------- Большой экран исполнителя ---------- */
.page-bar { position: relative; z-index: 2; }
.artist-hero, .blur-hero {
  position: relative; isolation: isolate; overflow: hidden; margin-top: -52px; padding: 64px 24px 18px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.artist-bg {
  position: absolute; inset: -40px; z-index: -1;
  background: var(--bg2) center / cover no-repeat;
  filter: blur(36px) saturate(1.4); opacity: .75; transform: scale(1.15);
}
.artist-hero::after, .blur-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--bg) 40%, transparent) 55%, var(--bg) 100%);
}
.cover.artist-big { width: 168px; height: 168px; font-size: 60px; box-shadow: 0 16px 44px rgba(0, 0, 0, .4); }
.artist-hero h1 { font-family: "Unbounded", "Manrope", sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 16px 0 4px; }
.artist-listened {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 5px 12px; border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); font-size: 13px; font-weight: 700;
}
.artist-listened svg { width: 15px; height: 15px; }
.albums-scroll { display: flex; gap: 14px; overflow-x: auto; padding: 0 16px 6px; scrollbar-width: none; }
.albums-scroll::-webkit-scrollbar { display: none; }
.albums-scroll .album-card { flex: none; width: 140px; }

/* ---------- Размытые шапки ---------- */
.blur-hero { padding-bottom: 16px; }
.fav-hero .artist-bg { background: radial-gradient(circle at 50% 30%, #ff6b6b, #c9183a 60%, transparent 100%); opacity: .55; }

/* ---------- Пустые состояния ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 40px 32px 32px;
}
.empty-icon-ring {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.empty-icon-ring svg { width: 34px; height: 34px; }
.empty-title { font-family: "Unbounded", "Manrope", sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.empty-text { color: var(--hint); font-size: 14px; line-height: 1.45; max-width: 290px; }
.empty-state .btn { margin-top: 10px; }
.empty-state .btn svg { width: 20px; height: 20px; }

/* ---------- Широкий экран: коллекция слева, плеер справа ---------- */
@media (min-width: 900px) {
  :root { --player-w: min(440px, 40vw); }
  body.wide .tabbar, body.wide .mini, body.wide #p-close { display: none !important; }
  body.wide .page { margin-right: var(--player-w); padding-bottom: 40px; }
  body.wide .player {
    left: auto; width: var(--player-w); border-left: 1px solid var(--sep);
    animation: none; transform: none !important;
  }
  body.wide .player-main { padding-bottom: 24px; }
  body.wide .p-more-section { padding-bottom: 24px; }
  body.wide .player-empty { padding-bottom: 24px; }
  body.wide .cover.big { width: min(300px, 30vw); height: min(300px, 30vw); }
  body.wide .bottom-bar { right: var(--player-w); bottom: 0; padding-bottom: calc(10px + var(--safe-bottom)); }
  body.wide .toast { bottom: 24px; }
  body.wide .home-head, body.wide .picker-head { padding-right: 16px; }
  body.wide .tiles { grid-template-columns: repeat(3, 1fr); }
  body.wide .pl-grid, body.wide .album-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  body.wide .sheet-panel { width: 440px; margin: 0 auto; border-radius: 18px; bottom: 24px; }
}

/* ---------- Светлая тема: мягкие тени, иначе обложки «грязнят» белый фон ---------- */
:root[data-tone="light"] .cover.pl-cover,
:root[data-tone="light"] .cover.hero-cover,
:root[data-tone="light"] .cover.album-cover { box-shadow: 0 6px 18px rgba(20, 20, 40, .12); }
:root[data-tone="light"] .cover.big { box-shadow: 0 14px 34px rgba(20, 20, 40, .18); }
:root[data-tone="light"] .cover.artist-big { box-shadow: 0 12px 30px rgba(20, 20, 40, .2); }
:root[data-tone="light"] .empty-cover { box-shadow: none; }
:root[data-tone="light"] .artist-bg { opacity: .5; }
:root[data-tone="light"] .sheet-backdrop { background: rgba(0, 0, 0, .3); }

/* ---------- Онбординг ---------- */
.onboarding {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%),
    var(--bg);
  padding-bottom: calc(18px + var(--safe-bottom));
  animation: fade .3s ease;
}
.onboarding.leaving { opacity: 0; transition: opacity .25s ease; }
.ob-skip { align-self: flex-end; margin: 12px 16px 0; color: var(--hint); font-weight: 600; font-size: 14px; padding: 8px; }
.ob-slides {
  flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ob-slides::-webkit-scrollbar { display: none; }
.ob-slide {
  flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 32px; text-align: center;
}
.ob-slide h2 { font-family: "Unbounded", "Manrope", sans-serif; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 32px 0 10px; }
.ob-slide p { color: var(--hint); font-size: 15px; line-height: 1.5; max-width: 330px; margin: 0; }
.ob-art { width: 260px; height: 260px; display: grid; place-items: center; position: relative; }
.ob-dots { display: flex; justify-content: center; gap: 8px; margin: 10px 0 18px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--hint) 40%, transparent); transition: width .25s, background .25s; }
.ob-dots i.on { width: 24px; background: var(--accent); }
.ob-actions { display: flex; flex-direction: column; gap: 10px; padding: 0 24px; max-width: 480px; width: 100%; margin: 0 auto; }

/* Экран 1: пузыри чата с отмеченными треками */
.ob-chat { width: 250px; display: flex; flex-direction: column; gap: 10px; }
.ob-bubble {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px 16px 16px 4px;
  background: var(--bg2); text-align: left; animation: ob-pop .5s both;
}
.ob-bubble:nth-child(2) { animation-delay: .12s; } .ob-bubble:nth-child(3) { animation-delay: .24s; }
.ob-bubble > svg { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--accent); color: var(--accent-text); flex: none; }
.ob-bubble div { flex: 1; display: flex; flex-direction: column; font-size: 14px; }
.ob-bubble span { color: var(--hint); font-size: 12px; }
.ob-check { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.ob-check svg { width: 14px; height: 14px; }
.ob-forward {
  align-self: center; display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 9px 14px; border-radius: 18px;
  background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 13px; animation: ob-pop .5s .45s both;
}
.ob-forward svg { width: 16px; height: 16px; }
@keyframes ob-pop { from { opacity: 0; transform: translateY(12px) scale(.96); } }

/* Экран 2: обложки «проявляются» */
.ob-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 220px; position: relative; }
.ob-tile {
  aspect-ratio: 1; border-radius: 16px;
  background: linear-gradient(135deg, hsl(var(--h) 70% 58%), hsl(calc(var(--h) + 40) 70% 38%));
  box-shadow: 0 12px 28px rgba(0, 0, 0, .25); animation: ob-pop .6s var(--d) both;
}
.ob-spark {
  position: absolute; right: -14px; top: -14px; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-text);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 50%, transparent); animation: ob-pop .5s .6s both;
}
.ob-spark svg { width: 26px; height: 26px; }

/* Экран 3: плейлист-коллаж, сердце и «поделиться» */
.ob-playlist { position: relative; width: 200px; height: 200px; }
.ob-collage { width: 200px; height: 200px; border-radius: 22px; overflow: hidden; position: relative; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); animation: ob-pop .5s both; }
.ob-collage i { position: absolute; top: 0; left: 0; width: 50%; height: 50%; background: linear-gradient(135deg, hsl(var(--h) 70% 58%), hsl(calc(var(--h) + 40) 70% 36%)); }
.ob-collage i:nth-child(2) { left: 50%; } .ob-collage i:nth-child(3) { top: 50%; } .ob-collage i:nth-child(4) { top: 50%; left: 50%; }
.ob-share, .ob-heart {
  position: absolute; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .3); animation: ob-pop .5s .3s both;
}
.ob-share { right: -18px; bottom: 26px; background: var(--accent); color: var(--accent-text); }
.ob-heart { left: -18px; top: 22px; background: #ff4d6d; color: #fff; animation-delay: .45s; }
.ob-share svg, .ob-heart svg { width: 26px; height: 26px; }

/* ---------- Микс дня ---------- */
.mix-card {
  position: relative; display: flex; align-items: center; gap: 14px; margin: 8px 16px 6px; padding: 16px;
  border-radius: 22px; overflow: hidden; cursor: pointer; isolation: isolate;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 85%, #fff 0%), transparent 60%),
    radial-gradient(120% 140% at 100% 100%, #ff5f8a, transparent 60%),
    linear-gradient(135deg, var(--accent), #3b1d8f);
  color: #fff; box-shadow: 0 14px 34px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .12s ease;
}
.mix-card:active { transform: scale(.98); }
.mix-covers { position: relative; width: 86px; height: 86px; flex: none; }
.mix-cover {
  position: absolute; top: calc(var(--i) * 6px); left: calc(var(--i) * 12px);
  transform: rotate(calc((var(--i) - 1) * 7deg)); z-index: calc(3 - var(--i));
}
.mix-cover .cover { width: 62px; height: 62px; border-radius: 12px; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.mix-text { flex: 1; min-width: 0; }
.mix-label { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
.mix-label svg { width: 13px; height: 13px; }
.mix-title { font-family: "Unbounded", "Manrope", sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0; }
.mix-sub { font-size: 13px; opacity: .85; }
.mix-play {
  width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: #fff; color: var(--accent); box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}
.mix-play svg { width: 24px; height: 24px; margin-left: 3px; }
.like-heart.mix-heart { background: linear-gradient(135deg, var(--accent), #ff5f8a); box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 40%, transparent); }

/* ---------- Таймер сна ---------- */
#p-sleep.on { color: var(--accent); }
.player-context { display: flex; flex-direction: column; align-items: center; }
.player-context small { color: var(--accent); font-size: 12px; font-weight: 700; }

/* ---------- Перенос плейлистов ---------- */
.import-hint { color: var(--hint); font-size: 14px; line-height: 1.45; margin-top: 6px; }
.import-sources { display: flex; gap: 6px; margin-top: 10px; }
.import-sources span { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 10px; background: var(--bg2); color: var(--hint); }
.import-form { display: flex; gap: 8px; padding: 6px 16px 10px; }
.import-form input {
  flex: 1; min-width: 0; height: 46px; border-radius: 14px; border: 0; outline: none; padding: 0 14px;
  background: var(--bg2); color: var(--text); font: inherit; font-size: 15px; -webkit-user-select: text; user-select: text;
}
.import-card { margin: 8px 16px 4px; padding: 18px; border-radius: 18px; background: var(--bg2); }
.import-source { color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.import-name { font-family: "Unbounded", "Manrope", sans-serif; font-size: 20px; font-weight: 800; margin: 4px 0 12px; }
.import-bar { height: 8px; border-radius: 4px; background: var(--sep); overflow: hidden; }
.import-bar div { height: 100%; background: var(--accent); border-radius: 4px; transition: width .6s ease; }
.import-count { margin: 10px 0 14px; color: var(--hint); font-size: 14px; }
.import-count b { color: var(--text); }
.import-missing-hint { color: var(--hint); font-size: 13px; padding: 0 16px 6px; line-height: 1.4; }
.missing-row { cursor: pointer; }
.missing-row .cover, .missing-row .meta { opacity: .45; }
.missing-row .more svg { width: 18px; height: 18px; }
.import-note { color: var(--hint); font-size: 13px; line-height: 1.4; margin-top: 10px; }
.wanted-note { margin: 4px 16px 10px; padding: 12px 14px; border-radius: 14px; background: var(--bg2); display: flex; flex-direction: column; gap: 10px; }
.wanted-note-text { color: var(--hint); font-size: 13px; line-height: 1.4; }
.wanted-note-text b { display: block; color: var(--text); font-size: 15px; margin-bottom: 2px; }
.wanted-note .btn { align-self: flex-start; }
.missing-row .cover svg { width: 22px; height: 22px; }

/* ---------- Баннер «Твой год в музыке» ---------- */
.wrapped-banner {
  display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 20px 16px 0; padding: 16px 18px;
  border-radius: 20px; text-align: left; color: #fff; overflow: hidden;
  background: linear-gradient(120deg, #ff5f8a, var(--accent) 55%, #2d6bff);
}
.wb-text { flex: 1; min-width: 0; }
.wb-label { font-size: 12px; font-weight: 800; opacity: .8; letter-spacing: .5px; }
.wb-title { font-family: "Unbounded", "Manrope", sans-serif; font-size: 19px; font-weight: 800; margin: 2px 0; }
.wb-sub { font-size: 13px; opacity: .85; }
.wb-art { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); flex: none; }
.wb-art svg { width: 28px; height: 28px; }

/* ---------- Сторис «Твой год в музыке» ---------- */
.wrapped { position: fixed; inset: 0; z-index: 70; background: #0f1012; color: #fff; animation: fade .25s ease; }
.wr-slide {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 28px calc(40px + var(--safe-bottom)); text-align: center;
  background:
    radial-gradient(90% 60% at 20% 10%, hsl(var(--hue) 85% 60% / .9), transparent 70%),
    radial-gradient(90% 60% at 90% 90%, hsl(calc(var(--hue) + 60) 85% 55% / .8), transparent 70%),
    #0f1012;
  animation: wr-in .45s cubic-bezier(.2, .8, .2, 1);
}
.wr-slide[hidden] { display: none; }
@keyframes wr-in { from { opacity: 0; transform: scale(.96); } }
.wr-slide h2 { font-family: "Unbounded", "Manrope", sans-serif; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0; line-height: 1.15; }
.wr-slide p { opacity: .85; font-size: 16px; line-height: 1.45; max-width: 320px; margin: 6px 0 0; }
.wr-big { font-family: "Unbounded", "Manrope", sans-serif; font-size: 96px; font-weight: 900; letter-spacing: -0.04em; opacity: .9; }
.wr-num { font-family: "Unbounded", "Manrope", sans-serif; font-size: 84px; font-weight: 900; letter-spacing: -0.04em; line-height: 1; }
.wr-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; opacity: .8; margin-bottom: 14px; }
.cover.wr-ava { width: 190px; height: 190px; font-size: 64px; box-shadow: 0 20px 50px rgba(0,0,0,.45); margin-bottom: 10px; }
.wr-tracks { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.wr-track { display: flex; align-items: center; gap: 12px; }
.wr-track > b { font-family: "Unbounded", sans-serif; font-size: 20px; width: 22px; text-align: center; }
.wr-track .meta { min-width: 0; }
.wr-track .artist { color: rgba(255,255,255,.7); }
.wr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 340px; }
.wr-grid div { padding: 16px 10px; border-radius: 18px; background: rgba(255,255,255,.12); display: flex; flex-direction: column; }
.wr-grid b { font-family: "Unbounded", sans-serif; font-size: 34px; }
.wr-grid span { font-size: 13px; opacity: .8; }
.wr-share { margin-top: 26px; max-width: 320px; position: relative; z-index: 3; }
.wr-progress { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; z-index: 4; display: flex; gap: 4px; }
.wr-progress i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); overflow: hidden; }
.wr-progress i b { display: block; height: 100%; width: 0; background: #fff; transition: width .3s ease; }
.wr-progress i.done b { width: 100%; }
.wr-close { position: absolute; top: calc(22px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.15); color: #fff; }
.wr-tap { position: absolute; top: 70px; bottom: 0; z-index: 2; }
.wr-prev { left: 0; width: 30%; }
.wr-next { right: 0; width: 70%; }
/* Слайды пропускают касания к зонам «назад/вперёд», кроме кнопок на них */
.wr-slide { z-index: 2; pointer-events: none; }
.wr-slide button { pointer-events: auto; }
.wr-tap { z-index: 1; }

/* Играющий трек в «Главных треках»: подсветка и полоска на 15 секунд */
.wr-track { position: relative; padding: 6px 8px; border-radius: 14px; transition: background .3s ease, transform .3s ease; }
.wr-track.on { background: rgba(255, 255, 255, .16); transform: scale(1.03); }
.wr-track::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 1px;
  background: #fff; transform-origin: left; transform: scaleX(0); opacity: 0;
}
.wr-track.on::after { opacity: .8; animation: wr-preview 15s linear forwards; }
@keyframes wr-preview { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Логотип ---------- */
/* Нота из логотипа как маска: цвет берётся из currentColor — белая в тёмной теме, тёмная в светлой */
.logo-mark {
  display: inline-block; width: 1em; height: 1em; flex: none;
  background: currentColor;
  -webkit-mask: url("/static/img/logo-mask.png") center / contain no-repeat;
  mask: url("/static/img/logo-mask.png") center / contain no-repeat;
}
.home-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.home-brand .logo-mark { font-size: 46px; color: var(--text); margin-left: -6px; }
.player-empty-art .logo-mark { font-size: 120px; color: #fff; }
.ob-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 0 20px; }
.ob-top .ob-skip { margin: 0; }
.ob-brand { display: flex; align-items: center; gap: 6px; font-family: "Unbounded", "Manrope", sans-serif; font-weight: 800; font-size: 16px; }
.ob-brand .logo-mark { font-size: 30px; }

/* Пустой плеер: плашка-приветствие, заголовок ровными строками, спокойный подзаголовок */
.player-empty { gap: 0; }
.player-empty-art { margin-bottom: 28px; }
.pe-greeting {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px 7px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent);
  font-size: 13px; font-weight: 800; letter-spacing: .2px;
}
.pe-greeting svg { width: 16px; height: 16px; }
.player-empty h2 {
  margin: 16px 0 8px; max-width: 300px; font-size: 24px; line-height: 1.22;
  text-wrap: balance;
}
.pe-text { max-width: 270px; margin: 0; font-size: 14px; line-height: 1.45; text-wrap: balance; }
.pe-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; margin-top: 26px; }
.pe-actions .btn { width: 100%; }

/* Значки вместо эмодзи */
.fav-mark { display: inline-flex; vertical-align: -1px; margin-left: 5px; color: #ff4d6d; }
.fav-mark svg { width: 12px; height: 12px; }
.shared-mark { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--hint); }
.shared-mark svg { width: 13px; height: 13px; }
.crown { display: inline-flex; vertical-align: -2px; color: #f5b301; }
.crown svg { width: 15px; height: 15px; }
.player-context small { display: inline-flex; align-items: center; gap: 4px; }
.player-context small svg { width: 12px; height: 12px; }
.cover > svg { width: 45%; height: 45%; opacity: .9; }

/* «Любимые исполнители» пока пусто */
.fav-artists-empty {
  display: flex; align-items: center; gap: 12px; margin: 0 16px; padding: 14px 16px; border-radius: 16px;
  background: var(--bg2); color: var(--hint); font-size: 14px; line-height: 1.4;
}
.fav-artists-empty svg { width: 26px; height: 26px; flex: none; color: var(--accent); }

/* Документы внутри приложения */
.legal { padding: 4px 16px 40px; line-height: 1.55; font-size: 15px; }
.legal h1 { font-family: var(--font-display, inherit); font-size: 24px; line-height: 1.2; margin: 4px 0 6px; overflow-wrap: break-word; hyphens: auto; }
.legal h2 { font-size: 17px; margin: 24px 0 6px; }
.legal p { margin: 0 0 10px; }
.legal ul { margin: 0 0 10px; padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--accent); }
.legal code { background: var(--bg2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.legal-date { color: var(--hint); font-size: 13px; }
.settings-row.danger { color: #e5484d; }
.settings-row.danger .settings-icon { background: #e5484d; color: #fff; }
.sheet-form textarea { width: 100%; box-sizing: border-box; resize: none; font: inherit; color: var(--text); background: var(--bg2); border: 0; border-radius: 12px; padding: 12px; margin-bottom: 10px; outline: none; }

/* ---------- Premium ---------- */
.premium-card { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 0 16px 8px; padding: 14px 16px;
  border-radius: 16px; text-align: left; color: #fff; background: linear-gradient(135deg, #6b3fd4, #b14be0); }
.premium-card.off { background: linear-gradient(135deg, #3a3550, #59466f); }
.premium-card .logo-mark { font-size: 34px; color: #fff; flex: none; }
.premium-card .option-text { flex: 1; }
.premium-card .option-text span { font-weight: 700; font-size: 16px; }
.premium-card .option-text small { color: rgba(255,255,255,.8); }
.premium-card > svg { width: 18px; height: 18px; color: rgba(255,255,255,.8); }
.premium-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 16px 18px; }
.premium-hero .logo-mark { font-size: 72px; color: var(--accent); }
.premium-hero h1 { font-family: var(--font-display, inherit); font-size: 26px; margin: 6px 0 6px; }
.premium-status { font-size: 14px; padding: 4px 12px; border-radius: 999px; background: var(--bg2); color: var(--hint); }
.premium-status.on { color: var(--accent); }
.premium-plans { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 6px; }
.plan-btn { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; width: 100%; padding: 14px 16px;
  border-radius: 16px; background: var(--bg2); color: var(--text); text-align: left; border: 0; font: inherit; }
.plan-btn.primary { background: var(--accent); color: var(--accent-text); }
.plan-btn span { font-weight: 700; font-size: 17px; }
.plan-btn span em { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(127,127,127,.2); margin-left: 4px; }
.plan-btn b { display: flex; align-items: center; gap: 4px; font-size: 18px; }
.plan-btn b svg { width: 16px; height: 16px; }
.plan-btn small { grid-column: 1 / -1; opacity: .75; font-size: 13px; }
.link-row { margin: 4px 16px 0; width: calc(100% - 32px); background: none; justify-content: center; }
.link-row span { color: var(--accent); text-align: center; flex: none !important; }
.premium-perks { margin: 0 16px; background: var(--bg2); border-radius: 14px; padding: 4px 0; }
.perk { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; }
.perk .title { font-weight: 600; }
.perk > div:last-child { flex: 1; min-width: 0; }
.perk .title, .perk .artist { white-space: normal; overflow: visible; text-overflow: clip; }
.perk .artist { color: var(--hint); font-size: 13px; line-height: 1.35; }
.premium-free-note { color: var(--hint); font-size: 13px; line-height: 1.4; padding: 10px 20px 4px; }
.paywall { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 6px 4px 0; }
.paywall .logo-mark { font-size: 56px; color: var(--accent); }
.paywall p { color: var(--hint); margin: 0 0 6px; line-height: 1.4; }
.paywall .sheet-title { margin: 0; }
