/* ─────────────────────────── SeeMusic ─────────────────────────── */

:root {
  --accent: #fa2d48;
  --accent-2: #ff5e3a;
  --accent-soft: rgba(250, 45, 72, 0.12);

  --bg: #ffffff;
  --bg-2: #f2f2f7;
  --bg-3: #e5e5ea;
  --card: #ffffff;
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.6);
  --label-3: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.18);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --glass: rgba(249, 249, 249, 0.78);
  --glass-border: rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-art: 0 10px 30px rgba(0, 0, 0, 0.18);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 20px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: calc(56px + var(--safe-bottom));
  --mini-h: 64px;
  --nav-h: calc(44px + var(--safe-top));
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-2: #1c1c1e;
    --bg-3: #2c2c2e;
    --card: #1c1c1e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, 0.6);
    --label-3: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.55);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.36);
    --glass: rgba(22, 22, 24, 0.78);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-art: 0 10px 30px rgba(0, 0, 0, 0.55);
    --accent: #ff375f;
    --accent-soft: rgba(255, 55, 95, 0.16);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
input { font: inherit; }
[hidden] { display: none !important; }

svg.i { width: 1em; height: 1em; display: block; fill: currentColor; flex: none; }
i[data-icon] { display: inline-flex; font-style: normal; }

/* ─────────────── Навбар ─────────────── */

.navbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: var(--nav-h); padding: var(--safe-top) 8px 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: transparent; border-bottom: 0.5px solid transparent;
  transition: background .25s, border-color .25s, -webkit-backdrop-filter .25s, backdrop-filter .25s;
  pointer-events: none;
}
.navbar > * { pointer-events: auto; }
.navbar.solid {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--sep);
}
.nav-title { font-size: 17px; font-weight: 600; opacity: 0; transition: opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.navbar.solid .nav-title { opacity: 1; }
.nav-back { display: none; align-items: center; gap: 2px; color: var(--accent); font-size: 17px; padding: 8px 6px; justify-self: start; }
.nav-back svg { font-size: 22px; }
.navbar.can-back .nav-back { display: inline-flex; }
.nav-actions { justify-self: end; display: flex; gap: 6px; padding-right: 8px; }
.nav-actions .icon-btn { color: var(--accent); font-size: 22px; }

/* ─────────────── Контент ─────────────── */

.view {
  min-height: 100vh;
  padding: calc(var(--nav-h) + 4px) 0 calc(var(--tabbar-h) + var(--mini-h) + 40px);
  outline: none;
}
.view.enter { animation: viewIn .35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.view.enter-tab { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.page-head { padding: 4px var(--gutter) 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.large-title { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.page-date { font-size: 13px; font-weight: 600; text-transform: uppercase; color: var(--label-2); letter-spacing: 0; margin-bottom: 2px; }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; display: grid; place-items: center; font-size: 15px; flex: none; }

.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--gutter); margin-bottom: 10px; gap: 12px; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; margin: 0; display: flex; align-items: center; gap: 4px; }
.section-title .chev { color: var(--label-3); font-size: 18px; }
.section-sub { font-size: 15px; color: var(--label-2); padding: 0 var(--gutter); margin: -6px 0 10px; }
.see-all { color: var(--accent); font-size: 17px; white-space: nowrap; }

.hscroll {
  display: grid; grid-auto-flow: column; gap: 12px;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  padding: 0 var(--gutter) 4px; scroll-padding: 0 var(--gutter);
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }

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

.card { width: 152px; display: block; text-align: left; }
.card.big { width: 220px; }
.card-art { position: relative; width: 100%; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--fill); box-shadow: 0 0 0 0.5px var(--glass-border) inset; }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-title { margin-top: 7px; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.card-play {
  position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; color: #fff;
  background: rgba(30, 30, 30, 0.55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; transform: scale(.9); transition: opacity .2s, transform .2s;
}
@media (hover: hover) { .card:hover .card-play { opacity: 1; transform: none; } }
.card.playing .card-play { opacity: 1; transform: none; }
.card:active .card-art { transform: scale(0.97); transition: transform .15s; }

.art-ph { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255,255,255,.85); font-size: 34%; }
.art-ph svg { width: 36%; height: 36%; }

.artist-card { width: 112px; text-align: center; }
.artist-card .card-art { border-radius: 50%; }
.artist-card .card-title { font-size: 13px; }

/* Цветные плитки (жанры, настроения, занятия) */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 var(--gutter); }
.tile {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 1.6; padding: 12px 14px; color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset;
}
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.18)); pointer-events: none; }
.tile span { position: relative; z-index: 1; }
.tile .tile-emoji { position: absolute; right: 10px; top: 8px; font-size: 30px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); z-index: 1; }
.tile:active { transform: scale(0.97); transition: transform .15s; }
.hscroll .tile { width: 160px; aspect-ratio: 1.25; }

/* ─────────────── Поток ───────────────
   Небо: голубо-серое с примесью фиолетового, лёгкие акценты персика, розы и мяты.
   Днём — светлое небо, в тёмной теме — вечерние сумерки. */

:root {
  --sky-1: #e3eaf3;
  --sky-2: #bccadb;
  --sky-3: #a9aed8;
  --sky-4: #9d8fcc;
  --sky-ink: #1f2546;
  --sky-ink-2: rgba(31, 37, 70, 0.68);
  --sky-cloud: rgba(255, 255, 255, 0.85);
  --sky-peach: #ffd2c2;
  --sky-rose: #f4bfd9;
  --sky-mint: #c2e8de;
  --sky-violet: #7d6cc4;
  --sky-glint: #fff6cf;
  --sky-btn: rgba(255, 255, 255, 0.72);
  --sky-btn-ink: #6b5bb8;
  --sky-shadow: 0 14px 40px rgba(110, 100, 170, 0.28);
}
@media (prefers-color-scheme: dark) {
  :root {
    --sky-1: #1c2236;
    --sky-2: #2b3453;
    --sky-3: #3d3f6e;
    --sky-4: #574886;
    --sky-ink: #f4f3ff;
    --sky-ink-2: rgba(244, 243, 255, 0.72);
    --sky-cloud: rgba(170, 185, 225, 0.35);
    --sky-peach: rgba(255, 170, 150, 0.55);
    --sky-rose: rgba(240, 150, 200, 0.5);
    --sky-mint: rgba(140, 215, 200, 0.45);
    --sky-violet: #b3a2f5;
    --sky-glint: #fff1b8;
    --sky-btn: rgba(255, 255, 255, 0.9);
    --sky-btn-ink: #4e3f9e;
    --sky-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  }
}

.flow {
  position: relative; margin: 6px var(--gutter) 0; border-radius: 24px; overflow: hidden;
  height: 250px; color: var(--sky-ink); isolation: isolate;
  background: linear-gradient(165deg, var(--sky-1) 0%, var(--sky-2) 38%, var(--sky-3) 72%, var(--sky-4) 100%);
  box-shadow: var(--sky-shadow);
}
.flow-sky { position: absolute; inset: -25%; z-index: -1; filter: blur(34px); }
.flow-sky span { position: absolute; border-radius: 50%; animation: drift 18s ease-in-out infinite alternate; }
/* облака */
.flow-sky .c1 { width: 60%; height: 34%; left: 2%; top: 18%; background: var(--sky-cloud); }
.flow-sky .c2 { width: 48%; height: 28%; left: 48%; top: 8%; background: var(--sky-cloud); opacity: .8; animation-duration: 23s; animation-delay: -6s; }
/* лёгкие цветные акценты (персиковый заменяется цветом выбранного настроения) */
.flow-sky .c3 { width: 34%; height: 34%; left: 60%; top: 50%; background: var(--flow-accent, var(--sky-peach)); opacity: .7; animation-duration: 15s; animation-delay: -3s; }
.flow-sky .c4 { width: 30%; height: 30%; left: 22%; top: 58%; background: var(--sky-rose); opacity: .6; animation-duration: 20s; animation-delay: -11s; }
.flow-sky .c5 { width: 26%; height: 26%; left: 8%; top: 42%; background: var(--sky-mint); opacity: .55; animation-duration: 17s; animation-delay: -8s; }
.flow.playing .flow-sky span { animation-duration: 6s; }
.flow.playing .flow-sky .c2 { animation-duration: 7.5s; }
.flow.playing .flow-sky .c3 { animation-duration: 5s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10%, -8%) scale(1.12); }
  100% { transform: translate(-8%, 6%) scale(0.94); }
}
/* искорки */
.flow-glints { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.flow-glints i {
  position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--sky-glint);
  box-shadow: 0 0 10px 2px var(--sky-glint); opacity: 0; animation: glint 5s ease-in-out infinite;
}
.flow-glints i:nth-child(1) { left: 72%; top: 18%; }
.flow-glints i:nth-child(2) { left: 86%; top: 36%; animation-delay: -1.2s; width: 3px; height: 3px; }
.flow-glints i:nth-child(3) { left: 58%; top: 12%; animation-delay: -2.6s; }
.flow-glints i:nth-child(4) { left: 40%; top: 30%; animation-delay: -3.4s; width: 3px; height: 3px; }
.flow-glints i:nth-child(5) { left: 92%; top: 12%; animation-delay: -4.1s; }
.flow-glints i:nth-child(6) { left: 66%; top: 44%; animation-delay: -0.6s; width: 2px; height: 2px; }
@keyframes glint { 0%, 100% { opacity: 0; transform: scale(.4); } 45% { opacity: .95; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .flow-sky span, .flow-glints i { animation: none; }
  .flow-glints i { opacity: .6; }
}

.flow-content { position: absolute; inset: 0; padding: 20px; display: flex; flex-direction: column; }
.flow-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sky-ink-2); }
.flow-title {
  font-size: 40px; font-weight: 800; letter-spacing: -0.035em; margin-top: 2px; line-height: 1.1; width: fit-content;
  background: linear-gradient(100deg, var(--sky-ink) 35%, var(--sky-violet)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.flow-sub { font-size: 15px; color: var(--sky-ink-2); margin-top: 4px; max-width: 70%; }
.flow-now { margin-top: auto; display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; padding-right: 84px; }
.flow-now .now-text { min-width: 0; }
.flow-now .now-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-now .now-artist { color: var(--sky-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-now .now-why { color: var(--sky-violet); font-weight: 600; }
.flow-play {
  position: absolute; right: 18px; bottom: 18px; width: 64px; height: 64px; border-radius: 50%;
  background: var(--sky-btn); color: var(--sky-btn-ink); display: grid; place-items: center; font-size: 26px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(90, 80, 160, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transition: transform .2s var(--ease), opacity .2s;
}
.flow-play:active { transform: scale(.92); }
.flow-play svg { margin-left: 2px; }
.flow.playing .flow-play svg { margin-left: 0; }
.flow.loading .flow-play { opacity: .6; animation: breathe 1.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.94); } }

.flow-chips .chip.on { background: linear-gradient(135deg, #8ea5c6, #9887d0); color: #fff; }
.chip-toggle svg { font-size: 13px; color: #a58cd6; }
.chip-toggle.on svg { color: #fff6cf; }

/* объяснение «почему этот трек» в плеере */
.player-why {
  margin: 6px auto 0; max-width: 88%; width: fit-content; font-size: 12px; font-weight: 600; padding: 4px 11px;
  border-radius: 12px; background: rgba(255, 255, 255, 0.16); color: rgba(255, 255, 255, 0.92);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.player-why.explore::before { content: "✦ "; color: #d9c8ff; }
/* небесная дымка поверх размытой обложки, когда играет Поток */
.player-sky {
  position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .8s; pointer-events: none;
  background:
    radial-gradient(60% 40% at 20% 15%, rgba(200, 215, 240, 0.45), transparent 70%),
    radial-gradient(50% 35% at 85% 80%, rgba(255, 200, 185, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(150, 170, 205, 0.35), rgba(120, 100, 195, 0.4));
}
.player.is-flow .player-sky { opacity: 1; }
.mini.is-flow .mini-progress span { background: linear-gradient(90deg, #8ea5c6, #9887d0); opacity: 1; }

/* «30 с» у превью реальных хитов */
.badge-pv {
  flex: none; display: inline-block; font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .02em;
  padding: 3px 5px; border-radius: 5px; margin: 0 6px; vertical-align: 1px;
  background: var(--fill-2); color: var(--label-2);
}
.card-sub .badge-pv { margin: 0 5px 0 0; }

/* карточка «Как Поток видит вас» в медиатеке */
.flow-card {
  margin-top: 16px; padding: 14px 16px; border-radius: 16px; display: grid; gap: 8px; font-size: 14px;
  background: linear-gradient(160deg, rgba(160, 180, 210, 0.22), rgba(150, 130, 210, 0.2));
}
.flow-card .fc-row { display: flex; justify-content: space-between; gap: 12px; }
.flow-card .fc-row span { color: var(--label-2); }
.flow-card .fc-row b { font-weight: 600; text-align: right; }

.upload-status { font-size: 13px; color: var(--label-2); margin-top: 8px; min-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px var(--gutter) 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--fill);
  font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .2s, color .2s;
}
.chip.on { background: var(--label); color: var(--bg); }
.chips-label { font-size: 13px; color: var(--label-2); padding: 12px var(--gutter) 0; font-weight: 500; }

/* Быстрые плитки под Потоком */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px var(--gutter) 0; }
.quick a {
  display: flex; align-items: center; gap: 10px; background: var(--bg-2); border-radius: var(--radius);
  padding: 10px; font-weight: 600; font-size: 15px; min-height: 60px;
}
.quick .q-ico { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 20px; flex: none; }
.quick .q-sub { font-size: 12px; color: var(--label-2); font-weight: 400; }

/* ─────────────── Список треков ─────────────── */

.tracks { padding: 0 0 0 var(--gutter); }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px var(--gutter) 6px 0;
  position: relative; width: 100%; text-align: left; user-select: none; -webkit-user-select: none; isolation: isolate;
}
.row::after { content: ""; position: absolute; left: 60px; right: 0; bottom: 0; border-bottom: 0.5px solid var(--sep); }
.row:last-child::after { display: none; }
.row.numbered::after { left: 92px; }
/* подсветка нажатия — псевдоэлементом, чтобы строка не сдвигалась под пальцем */
.row::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(-1 * var(--gutter)); right: 0; background: var(--fill); opacity: 0; z-index: -1; transition: opacity .25s; pointer-events: none; }
.row:active::before { opacity: 1; transition: none; }
.row-more:active { background: var(--fill-2); }
.row-num { width: 20px; text-align: center; color: var(--label-2); font-size: 15px; font-weight: 600; flex: none; font-variant-numeric: tabular-nums; }
.row-art { width: 48px; height: 48px; border-radius: 6px; overflow: hidden; flex: none; background: var(--fill); position: relative; box-shadow: 0 0 0 0.5px var(--glass-border) inset; }
.row-art img { width: 100%; height: 100%; object-fit: cover; }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.row-sub { font-size: 14px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row-like { color: var(--accent); font-size: 12px; flex: none; }
.row-more { width: 34px; height: 34px; display: grid; place-items: center; color: var(--label); font-size: 18px; flex: none; border-radius: 50%; }
.row.current .row-title { color: var(--accent); }
.row-eq { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; gap: 2px; }
.row.current .row-eq { display: flex; }
.row-eq span { width: 3px; height: 14px; background: #fff; border-radius: 2px; transform-origin: bottom; transform: scaleY(.35); }
body.is-playing .row.current .row-eq span { animation: eq 0.9s ease-in-out infinite; }
.row-eq span:nth-child(2) { animation-delay: -.3s !important; }
.row-eq span:nth-child(3) { animation-delay: -.6s !important; }
.row-eq span:nth-child(4) { animation-delay: -.15s !important; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.badge-src { font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 1px 4px; border-radius: 3px; background: var(--fill); color: var(--label-2); text-transform: uppercase; flex: none; }

/* Чарт-сетка: 4 ряда, листается по горизонтали (как «Лучшие песни» в Apple Music) */
.chart { grid-auto-flow: column; grid-template-rows: repeat(4, auto); grid-auto-columns: calc(100% - 40px); gap: 0 16px; }
.chart .row { padding-right: 0; }
.chart .row::after { left: 92px; }
.chart .row:nth-child(4n)::after { display: none; }

/* ─────────────── Шапка списка / артиста ─────────────── */

.hero { padding: 8px var(--gutter) 0; text-align: center; }
.hero-cover {
  width: min(62vw, 260px); aspect-ratio: 1; margin: 0 auto; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-art); background: var(--fill); display: grid; grid-template-columns: 1fr 1fr;
}
.hero-cover.single { grid-template-columns: 1fr; }
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.hero-cover.grad { display: flex; align-items: flex-end; padding: 16px; color: #fff; font-weight: 800; font-size: 26px; text-align: left; letter-spacing: -0.02em; line-height: 1.05; position: relative; }
.hero-cover.grad .hero-emoji { position: absolute; top: 14px; right: 14px; font-size: 44px; }
.hero-title { font-size: 22px; font-weight: 700; margin: 16px 0 2px; letter-spacing: -0.015em; }
.hero-sub { font-size: 17px; color: var(--accent); }
.hero-meta { font-size: 13px; color: var(--label-2); margin-top: 4px; }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 8px; }
.pill-btn {
  height: 48px; border-radius: 12px; background: var(--fill); color: var(--accent);
  font-weight: 600; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .15s, opacity .15s;
}
.pill-btn:active { transform: scale(.97); opacity: .8; }
.pill-btn.fill { background: var(--accent); color: #fff; }
.pill-btn.small { height: 32px; font-size: 14px; padding: 0 14px; border-radius: 16px; }
.pill-btn.ghost { background: rgba(255,255,255,.14); color: #fff; }
.pill-btn svg { font-size: 16px; }
.list-footer { color: var(--label-2); font-size: 13px; padding: 14px var(--gutter); }

.artist-hero { position: relative; height: 340px; margin-top: calc(-1 * var(--nav-h) - 4px); overflow: hidden; color: #fff; display: flex; align-items: flex-end; }
.artist-hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.artist-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1) 40%, rgba(0,0,0,.65)); }
.artist-hero .artist-info { position: relative; z-index: 1; padding: 0 var(--gutter) 18px; display: flex; align-items: flex-end; justify-content: space-between; width: 100%; gap: 12px; }
.artist-name { font-size: 34px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; margin: 0; text-shadow: 0 2px 16px rgba(0,0,0,.3); }
.artist-stat { font-size: 14px; opacity: .85; margin-top: 4px; }
.fab { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 22px; flex: none; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.fab svg { margin-left: 2px; }
.artist-actions { display: flex; gap: 10px; padding: 16px var(--gutter) 0; }
.artist-bio { padding: 0 var(--gutter); color: var(--label-2); font-size: 15px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ─────────────── Медиатека ─────────────── */

.menu { padding-left: var(--gutter); }
.menu a, .menu button, .menu .switch-row {
  display: flex; align-items: center; gap: 14px; min-height: 48px; width: 100%; padding-right: var(--gutter);
  font-size: 19px; color: var(--label); position: relative; text-align: left;
}
.menu a::after, .menu button::after, .menu .switch-row::after { content: ""; position: absolute; left: 42px; right: 0; bottom: 0; border-bottom: 0.5px solid var(--sep); }
.menu .m-ico { color: var(--accent); font-size: 22px; width: 28px; display: grid; place-items: center; }
.menu .m-label { flex: 1; }
.menu .m-count { color: var(--label-2); font-size: 17px; }
.menu .m-chev { color: var(--label-3); font-size: 15px; }
.menu.danger button { color: var(--accent); }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; padding: 0 var(--gutter); }
.grid2 .card { width: auto; min-width: 0; }

.taste { padding: 0 var(--gutter); }
.taste-bars { display: grid; gap: 8px; }
.taste-bar { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 14px; }
.taste-bar .tb-track { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.taste-bar .tb-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.empty { text-align: center; color: var(--label-2); padding: 50px 32px; font-size: 15px; }
.empty .empty-ico { font-size: 48px; color: var(--label-3); display: grid; place-items: center; margin-bottom: 12px; }
.empty h3 { color: var(--label); font-size: 20px; margin: 0 0 6px; }

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

.searchbar { display: flex; align-items: center; gap: 10px; padding: 0 var(--gutter) 8px; position: sticky; top: var(--nav-h); z-index: 5; background: var(--bg); }
.search-field { flex: 1; display: flex; align-items: center; gap: 6px; height: 38px; background: var(--fill); border-radius: 10px; padding: 0 8px; color: var(--label-2); }
.search-field svg { font-size: 16px; }
.search-field input { flex: 1; border: 0; background: none; outline: none; color: var(--label); font-size: 17px; min-width: 0; }
.search-field input::placeholder { color: var(--label-2); }
.search-clear { color: var(--label-3); font-size: 17px; }
.recent-q { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 var(--gutter); }

/* ─────────────── Таббар ─────────────── */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: var(--tabbar-h); padding: 6px 8px var(--safe-bottom);
  display: flex; justify-content: space-around; align-items: flex-start;
  background: var(--glass); border-top: 0.5px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; font-weight: 500; color: var(--label-2); padding-top: 2px; }
.tab svg { font-size: 25px; }
.tab.active { color: var(--accent); }
.sidebar-brand { display: none; }

/* ─────────────── Мини-плеер ─────────────── */

.mini {
  position: fixed; z-index: 41; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + 8px);
  height: var(--mini-h); border-radius: 16px; padding: 0 8px 0 8px;
  display: flex; align-items: center; gap: 4px; overflow: hidden;
  background: var(--glass); border: 0.5px solid var(--glass-border);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
  animation: miniIn .4s var(--ease);
}
@keyframes miniIn { from { transform: translateY(30px); opacity: 0; } }
.mini-body { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; height: 100%; text-align: left; }
.mini-art { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--fill); box-shadow: 0 2px 8px rgba(0,0,0,.15); flex: none; }
.mini-text { min-width: 0; }
.mini-title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-artist { font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px; border-radius: 50%; flex: none; }
.icon-btn:active { background: var(--fill); }
.mini-progress { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 1px; overflow: hidden; }
.mini-progress span { display: block; height: 100%; width: 0; background: var(--accent); opacity: .8; }

/* ─────────────── Полноэкранный плеер ─────────────── */

.player {
  position: fixed; inset: 0; z-index: 60; color: #fff; overflow: hidden;
  transform: translateY(100%); transition: transform .5s var(--ease); background: #1a1a1a;
  will-change: transform;
}
.player.open { transform: none; }
.player.dragging { transition: none; }
.player-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: #222; }
.player-bg img { position: absolute; inset: -25%; width: 150%; height: 150%; object-fit: cover; filter: blur(60px) saturate(1.7) brightness(0.72); transform: scale(1.2); transition: opacity .6s; }
.player-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.35)); }
.player-inner {
  position: relative; height: 100%; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 6px) 28px calc(var(--safe-bottom) + 18px);
}
.grabber { align-self: center; width: 80px; height: 28px; display: grid; place-items: center; flex: none; }
.grabber span { width: 38px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.4); }
.player-context { text-align: center; font-size: 13px; font-weight: 600; letter-spacing: .02em; opacity: .7; min-height: 18px; text-transform: uppercase; }
.player-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: 14px 0; }
.player-art-wrap { width: 100%; max-width: 420px; aspect-ratio: 1; max-height: 100%; display: grid; place-items: center; }
.player-art {
  width: 100%; height: 100%; object-fit: cover; border-radius: 12px; background: rgba(255,255,255,.1);
  box-shadow: 0 24px 60px rgba(0,0,0,.45); transform: scale(0.8); transition: transform .6s var(--ease), box-shadow .6s;
}
.player.playing .player-art { transform: none; box-shadow: 0 28px 70px rgba(0,0,0,.5); }
.player-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.player-text { flex: 1; min-width: 0; }
.player-title { font-size: 21px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.player-artist { font-size: 19px; color: rgba(255,255,255,.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-align: left; display: block; }
.round-btn { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 16px; flex: none; transition: transform .2s; }
.round-btn:active { transform: scale(.88); }
.round-btn.on { color: #fff; background: rgba(255,255,255,.28); }
#pLike.on { color: #ff375f; background: #fff; }
#pLike.pop { animation: pop .4s var(--ease); }
@keyframes pop { 40% { transform: scale(1.3); } }

.scrubber { margin-top: 22px; padding: 8px 0 0; touch-action: none; cursor: pointer; }
.scrub-track { position: relative; height: 7px; border-radius: 4px; background: rgba(255,255,255,.2); overflow: hidden; transition: height .2s, margin .2s; }
.scrubber.active .scrub-track { height: 12px; margin: -2.5px 0; }
.scrub-buffer, .scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.scrub-buffer { background: rgba(255,255,255,.18); }
.scrub-fill { background: rgba(255,255,255,.75); }
.scrubber.active .scrub-fill { background: #fff; }
.scrub-times { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.55); margin-top: 8px; font-variant-numeric: tabular-nums; }
.scrub-quality { font-size: 10px; letter-spacing: .05em; text-transform: uppercase; opacity: .8; }

.player-controls { display: flex; align-items: center; justify-content: space-evenly; margin: 16px 0 12px; }
.ctrl { width: 76px; height: 76px; display: grid; place-items: center; font-size: 40px; border-radius: 50%; transition: transform .15s, background .2s; }
.ctrl:active { transform: scale(.86); background: rgba(255,255,255,.1); }
.ctrl-main { font-size: 54px; }

.player-volume { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.6); font-size: 14px; margin-bottom: 14px; }
.player-volume input { flex: 1; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 7px; border-radius: 4px; background: rgba(255,255,255,.25); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 0; height: 0; }
input[type=range]::-moz-range-thumb { width: 0; height: 0; border: 0; }

.player-bottom { display: flex; justify-content: space-around; align-items: center; }
.tool { width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px; color: rgba(255,255,255,.65); border-radius: 10px; transition: background .2s, color .2s; }
.tool.on { color: #fff; background: rgba(255,255,255,.18); }
.tool:active { transform: scale(.9); }

.queue { position: absolute; inset: 8px 0; display: flex; flex-direction: column; }
.queue-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.queue-title { font-size: 17px; font-weight: 700; }
.queue-sub { font-size: 13px; color: rgba(255,255,255,.6); }
.queue-list { overflow-y: auto; flex: 1; margin: 0 -8px; padding: 0 8px; -webkit-mask-image: linear-gradient(180deg, #000 90%, transparent); mask-image: linear-gradient(180deg, #000 90%, transparent); }
.queue .row { color: #fff; min-height: 54px; }
.queue .row::after { border-color: rgba(255,255,255,.12); left: 56px; }
.queue .row-sub { color: rgba(255,255,255,.6); }
.queue .row-art { width: 44px; height: 44px; }
.queue .row-more { color: rgba(255,255,255,.6); }
.player.queue-open .player-art-wrap { display: none; }

/* ─────────────── Action sheet ─────────────── */

.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.35); animation: fadeIn .2s; }
.sheet {
  position: fixed; z-index: 81; left: 8px; right: 8px; bottom: calc(8px + var(--safe-bottom));
  max-width: 480px; margin: 0 auto; animation: sheetIn .35s var(--ease);
  max-height: 80vh; display: flex; flex-direction: column; gap: 8px;
}
@keyframes sheetIn { from { transform: translateY(110%); } }
.sheet-group { background: var(--glass); border-radius: 14px; overflow: hidden; -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); overflow-y: auto; }
@media (prefers-color-scheme: dark) { .sheet-group { background: rgba(40,40,42,.88); } }
.sheet-head { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 0.5px solid var(--sep); }
.sheet-head img, .sheet-head .row-art { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; flex: none; }
.sheet-head .sh-title { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .sh-sub { font-size: 14px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-item { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; padding: 0 18px; font-size: 17px; border-bottom: 0.5px solid var(--sep); text-align: left; gap: 12px; }
.sheet-item:last-child { border-bottom: 0; }
.sheet-item:active { background: var(--fill); }
.sheet-item svg { font-size: 20px; color: var(--label); }
.sheet-item.danger { color: #ff3b30; }
.sheet-item.danger svg { color: #ff3b30; }
.sheet-cancel { justify-content: center; font-weight: 600; color: var(--accent); }
.sheet-input { width: 100%; height: 44px; border-radius: 10px; border: 0; background: var(--fill); color: var(--label); padding: 0 12px; outline: none; font-size: 17px; }
.sheet-form { padding: 16px; display: grid; gap: 12px; }
.sheet-form h3 { margin: 0; font-size: 17px; text-align: center; }

/* ─────────────── Тост ─────────────── */

.toast {
  position: fixed; z-index: 90; left: 50%; top: calc(var(--safe-top) + 12px); transform: translate(-50%, calc(-100% - 60px)); opacity: 0;
  background: var(--glass); color: var(--label); border: 0.5px solid var(--glass-border);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  padding: 10px 18px; border-radius: 22px; font-size: 15px; font-weight: 500; box-shadow: var(--shadow);
  transition: transform .45s var(--ease), opacity .3s; pointer-events: none; max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 8px;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast svg { color: var(--accent); }

/* ─────────────── Скелетоны / загрузка ─────────────── */

.skeleton { background: linear-gradient(90deg, var(--fill) 0%, var(--fill-2) 50%, var(--fill) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-card { width: 152px; }
.sk-card .skeleton:first-child { aspect-ratio: 1; }
.sk-card .skeleton + .skeleton { height: 12px; margin-top: 8px; width: 80%; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--fill-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { margin: 10px var(--gutter); padding: 14px; border-radius: var(--radius); background: var(--bg-2); color: var(--label-2); font-size: 14px; }

/* ─────────────── Вход ─────────────── */

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.login-box { width: 100%; max-width: 340px; }
.login-logo { width: 96px; height: 96px; margin: 0 auto 20px; border-radius: 22px; box-shadow: var(--shadow); }
.login h1 { font-size: 28px; margin: 0 0 6px; }
.login p { color: var(--label-2); margin: 0 0 22px; font-size: 15px; }
.login form { display: grid; gap: 12px; }
.login .err { color: #ff3b30; font-size: 14px; min-height: 18px; }

/* ─────────────── Десктоп ─────────────── */

@media (min-width: 900px) {
  :root { --gutter: 32px; --tabbar-h: 0px; --nav-h: 52px; }
  .tabbar {
    top: 0; bottom: 0; right: auto; width: 240px; height: auto; flex-direction: column; justify-content: flex-start;
    padding: 20px 12px; border-top: 0; border-right: 0.5px solid var(--sep); gap: 2px; background: var(--bg-2);
  }
  .sidebar-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; padding: 6px 10px 18px; letter-spacing: -0.02em; }
  .brand-mark { width: 28px; height: 28px; border-radius: 7px; background: url(/icons/icon.svg) center/cover; }
  .tab { flex: none; flex-direction: row; gap: 12px; font-size: 15px; padding: 8px 10px; border-radius: 8px; color: var(--label); }
  .tab svg { font-size: 20px; color: var(--accent); }
  .tab.active { background: var(--fill); color: var(--label); }
  .navbar { left: 240px; }
  .view { margin-left: 240px; padding-bottom: calc(var(--mini-h) + 60px); }
  .view > * { max-width: 1280px; }
  .mini { left: 256px; right: 16px; bottom: 16px; max-width: 760px; margin: 0 auto; }
  .card { width: 184px; }
  .card.big { width: 260px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .grid2 { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .chart { grid-auto-columns: 400px; }
  .flow { height: 300px; }
  .hero { display: grid; grid-template-columns: 260px 1fr; gap: 28px; text-align: left; align-items: end; }
  .hero-title { font-size: 30px; margin-top: 0; }
  .hero-actions { grid-template-columns: 180px 180px; }
  .artist-hero { height: 400px; }
  @media (hover: hover) { .row:hover::before { opacity: .6; border-radius: 8px; } }
}

@media (max-width: 370px) {
  .card { width: 136px; }
  .ctrl { width: 64px; height: 64px; font-size: 34px; }
  .ctrl-main { font-size: 46px; }
  .player-inner { padding-left: 22px; padding-right: 22px; }
}

@media (max-height: 700px) {
  .scrubber { margin-top: 14px; }
  .player-controls { margin: 8px 0 6px; }
  .player-volume { display: none; }
}

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

/* iOS: без системного меню при долгом нажатии на треки */
.row, .card, .tile, img { -webkit-touch-callout: none; }
.row, .card { -webkit-user-select: none; user-select: none; }

/* Подсказка «Установить на экран Домой» */
.hint {
  margin: 14px var(--gutter) 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--bg-2); display: flex; gap: 12px; align-items: center; font-size: 14px; line-height: 1.35;
}
.hint img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.hint b { display: block; font-size: 15px; margin-bottom: 1px; }
.hint .hint-x { color: var(--label-3); font-size: 18px; margin-left: auto; align-self: flex-start; }
.share-ico { display: inline-block; vertical-align: -2px; width: 14px; height: 16px; }
input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* ─────────────── Загрузки на телефон ─────────────── */
.row-dl { flex: none; color: #8f7fd0; font-size: 13px; margin-left: 5px; display: inline-flex; }
.dl-progress { padding: 4px var(--gutter) 0; }
.dl-progress:empty { display: none; }
.dl-p-text { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--label-2); }
.dl-p-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-p-text b { color: var(--label); font-weight: 600; flex: none; }
.dl-p-sub { font-size: 13px; color: var(--label-2); margin-top: 6px; }
.dl-bar, .storage-bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin-top: 8px; }
.dl-bar span, .storage-bar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #8ea5c6, #9887d0); transition: width .3s; }
.storage { padding: 14px var(--gutter) 0; }
.storage-text { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--label-2); margin-top: 8px; }
.storage-text b { color: var(--label); font-weight: 600; }
/* переключатель как в iOS */
.switch {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0; width: 51px; height: 31px; border-radius: 16px;
  background: var(--fill-2); position: relative; transition: background .2s; cursor: pointer;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .25s var(--ease);
}
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(20px); }
