/* ytm-fast TMA — DeepSeek Harness visual language (tokens read from deepseek.com/en/harness,
   2026-10-03) on YouTube Music's information architecture.
   Performance rules (Telegram's WebView on mid-range phones): no backdrop-filter, no filter: blur.
   Soft colour fields are tiny (8x8) cover thumbnails upscaled by the GPU's bilinear sampler or
   plain gradients; progress bars move with transform only; hidden screens are visibility:hidden. */
:root {
  --bg: #0a0a0a; --bg-solid: #151517; --surface-card: #19191c; --surface-raised: #232327;
  --surface-1: rgba(255,255,255,.06); --surface-2: rgba(255,255,255,.04);
  --border-subtle: rgba(255,255,255,.06); --border: rgba(255,255,255,.12);
  --text: #fff; --text-2: rgba(255,255,255,.8); --text-3: rgba(255,255,255,.52); --text-4: rgba(255,255,255,.32);
  --accent: #ffe14d; --accent-strong: #ffe14d;  /* the play buttons' warm yellow (was blue) */
  --hover: rgba(255,255,255,.06); --active: rgba(255,255,255,.08);
  --r-pill: 100px; --r-card: 20px; --r-panel: 16px; --r-row: 12px; --r-input: 10px; --r-sm: 8px;
  --gutter: 16px;
  --font: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;  /* YouTube Music's typeface, with Cyrillic */
  --font-display: var(--font);
  --font-mono: var(--font);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow-float: 0 0 0 .5px rgba(255,255,255,.1), 0 8px 24px rgba(0,0,0,.4);
  --tabbar-h: 58px;
  /* fullscreen Mini App (Bot API 8.0): content goes under the status bar and Telegram's floating
     Close / ⋯ buttons, so the top inset is the device's plus Telegram's own */
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; color: var(--text); font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { background: radial-gradient(120% 420px at 50% -140px, rgba(255,196,110,.10) 0%, rgba(255,196,110,0) 100%) no-repeat, var(--bg); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
::selection { background: var(--accent); color: #0a0a0a; }

#app { position: relative; min-height: 100%; }
.tab, .page { min-height: 100vh; padding: 0 var(--gutter) calc(var(--tabbar-h) + 96px + var(--safe-b)); }
.tab[hidden], .page[hidden] { display: none; }
/* overflow-x explicitly: with overflow-y auto alone it computes to auto too, and the hero art (116vw)
   let every section be dragged sideways */
.page { position: fixed; inset: 0; z-index: 5; overflow-x: hidden; overflow-y: auto; background: var(--bg);
  animation: page-in .24s var(--ease); -webkit-overflow-scrolling: touch; will-change: transform; }
.page.dragging { animation: none; transition: none; box-shadow: -12px 0 32px rgba(0,0,0,.5); }
.page.settle { transition: transform .2s var(--ease); }
@keyframes page-in { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ headings */
.eyebrow { display: inline-block; font: 500 13px/1.3 var(--font); color: var(--text-3); }
.home-top { height: calc(14px + var(--safe-t)); }
/* The home screen is sized to the phone (owner, 2026-10-10: «Слушать снова» peeking from under the player
   felt broken): the wave and both shelves end above the mini player down to ~850 pt screens; shorter phones
   stop at the floor sizes and scroll, the content fading out under the player (.tabbar::before). */
#tab-home { --room: calc(100svh - var(--safe-t) - var(--safe-b) - var(--home-fixed, 336px));
  --card: clamp(116px, calc((var(--room) - 156px) / 2), 146px); }
#tab-home .wave { min-height: clamp(156px, calc(var(--room) - 2 * var(--card)), 236px); }
/* A new listener's empty home: the mascot and two lines in the middle of the free space between the wave and the
   tab bar (it takes the mini player's empty room too); the art is cropped to the character, its black is pure black */
#tab-home:not([hidden]):has(> .home-empty) { display: flex; flex-direction: column; }
.home-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 16px var(--gutter); margin-bottom: -96px; }
.home-empty img { width: min(46vw, 176px); height: auto; mix-blend-mode: lighten; }
.home-empty .title { margin-top: 16px; font: 600 17px/1.3 var(--font); color: var(--text); }
.home-empty .sub { margin-top: 6px; max-width: 260px; font: 400 14px/1.4 var(--font); color: var(--text-3); text-wrap: balance; }
#tab-home:not(:has(.shelf)) .wave { min-height: 236px; }  /* a new listener: nothing else on the screen yet */
#tab-home .shelf { margin-top: 18px; }
#tab-home .shelf-head { margin-bottom: 8px; }
.head { padding: calc(20px + var(--safe-t)) 0 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head h1 { margin: 0; font: 700 28px/1.2 var(--font-display); letter-spacing: -.02em; }
.shelf { margin: 24px 0 4px; content-visibility: auto; contain-intrinsic-size: auto 240px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.shelf-head h2 { margin: 0; font: 700 20px/1.3 var(--font-display); letter-spacing: -.01em; }
.shelf-head .more { font: 500 13px/1 var(--font); color: var(--text-3); padding: 6px 0 6px 10px; }

/* ------------------------------------------------------------------ Моя волна: the listener's colours (canvas 64x36 drawn by
   app.js Aurora, upscaled by the GPU -- the upscale is the blur), white waves flowing over it (faster
   while playing), «▶ Моя волна» in the middle, the vibe chips under it */
.wave { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  min-height: 236px; margin-top: 6px; padding: 26px 16px 20px; border-radius: 24px; overflow: hidden; cursor: pointer; isolation: isolate;
  background: #1a1612; box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12), 0 18px 40px -18px rgba(0,0,0,.7); text-align: center; }
.wave .aurora { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; }
.wave::after { content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(70% 60% at 50% 45%, rgba(10,10,10,0), rgba(10,10,10,.28)); }
.wave-lines { position: absolute; z-index: -1; left: 0; top: 0; width: 200%; height: 100%; pointer-events: none;
  background: no-repeat 0 0 / 100% 100%; will-change: transform; animation: wave-flow 22s linear infinite; }
.wave-lines.back { animation-duration: 34s; animation-direction: reverse; }
.wave.is-on .wave-lines { animation-duration: 9s; }
.wave.is-on .wave-lines.back { animation-duration: 15s; }
.home-covered .wave-lines { animation-play-state: paused; }  /* nothing animates under a page or the player */
@keyframes wave-flow { to { transform: translateX(-50%); } }
.wave-c { display: flex; flex-direction: column; align-items: center; max-width: 100%; }
.wave-title { display: flex; align-items: center; gap: 10px; }
.wave .go { width: 30px; height: 30px; display: grid; place-items: center; color: #fff; }
.wave .go svg { width: 30px; height: 30px; }
.wave h2 { margin: 0; font: 800 32px/1.1 var(--font); letter-spacing: -.02em; text-shadow: 0 2px 16px rgba(0,0,0,.25); }
.wave p { margin: 8px 0 0; max-width: 100%; font: 500 15px/1.35 var(--font); color: rgba(255,255,255,.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wave:active .wave-title { transform: scale(.97); transition: transform .1s; }
.vibes { display: flex; justify-content: center; gap: 8px; }
.vibe { flex: none; white-space: nowrap; height: 32px; padding: 0 14px; border-radius: 16px; font: 500 14px/32px var(--font);
  color: #fff; background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.18); }
.vibe.is-active { background: #fff; color: #0a0a0a; box-shadow: none; }

/* ------------------------------------------------------------------ search */
.search-box { position: sticky; top: var(--safe-t); z-index: 3; padding: 8px var(--gutter) 10px; margin: 0 calc(-1 * var(--gutter)); }
.search-box.stuck { background: var(--bg); box-shadow: 0 .5px 0 var(--border-subtle); }
.search-field { position: relative; display: flex; align-items: center; height: 46px; border-radius: var(--r-row);
  background: var(--surface-1); border: 1px solid var(--border); }
.search-field:focus-within { border-color: rgba(255,255,255,.3); }
.search-field svg { width: 18px; height: 18px; margin: 0 10px 0 14px; color: var(--text-3); flex: none; }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text);
  font: 400 16px var(--font); }
.search-field input::placeholder { color: var(--text-4); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-field .clear { width: 40px; height: 40px; color: var(--text-3); display: grid; place-items: center; }
.search-field .clear[hidden] { display: none; }
.search-field .clear svg { margin: 0; width: 18px; height: 18px; }
.status:empty { display: none; }
.status { margin: 8px 2px 0; font: 400 13px/1.4 var(--font); color: var(--text-3); }

.suggest { margin: 4px 0 0; padding: 0; list-style: none; }
.suggest li { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 4px; border-radius: var(--r-input);
  color: var(--text-2); cursor: pointer; }
.suggest li:active { background: var(--hover); }
.suggest li svg { width: 16px; height: 16px; color: var(--text-4); flex: none; }
.suggest li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest li b { color: var(--text); font-weight: 500; }
.suggest li .fill { width: 32px; height: 32px; display: grid; place-items: center; color: var(--text-4); }
.suggest li .fill svg { transform: rotate(-45deg); }
.suggest li .fill.del svg { transform: none; width: 14px; height: 14px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 2px; margin: 0 calc(-1 * var(--gutter));
  padding-inline: var(--gutter); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--border-subtle);
  font: 500 13px/30px var(--font); color: var(--text-3); background: var(--surface-2); }
.chip.is-active { background: #fff; color: #0a0a0a; border-color: #fff; }

/* ------------------------------------------------------------------ rows */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 4px 6px 6px; margin: 0 -6px;
  border-radius: var(--r-row); cursor: pointer; user-select: none; -webkit-user-select: none; }
.row:active { background: var(--hover); }
.row.is-playing { background: var(--active); }
.row.is-playing .title { color: var(--accent); }
.row .cover { width: 48px; height: 48px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-1); flex: none; }
.row .cover.round { border-radius: 50%; }
.row .num { width: 28px; text-align: center; font: 400 13px var(--font-mono); color: var(--text-4); flex: none; }
.row .meta { flex: 1; min-width: 0; }
.row .title { display: flex; align-items: center; gap: 6px; min-width: 0; font: 500 15px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .title .tt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row .title .expl { flex: none; padding: 0 4px; border-radius: 4px; font: 700 10px/15px var(--font); color: #0a0a0a; background: rgba(255,255,255,.55); }
.row .sub { font: 400 13px/1.4 var(--font); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.unavail, .card.unavail { opacity: .45; }
.row.unavail .title { color: var(--text-2); }
.tag-unavail { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; font: 600 10px/16px var(--font);
  color: #0a0a0a; background: rgba(255,255,255,.55); vertical-align: 1px; }
.badge-e { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 5px; border-radius: 3px;
  background: rgba(255,255,255,.35); color: #0a0a0a; font: 700 9px/1 var(--font); vertical-align: 1px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); flex: none; }
.icon-btn:active { background: var(--hover); }
.icon-btn svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ cards / carousels */
.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter));
  padding: 2px var(--gutter) 6px; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.card { flex: none; width: var(--card, 146px); scroll-snap-align: start; cursor: pointer; }
.card .art { position: relative; width: var(--card, 146px); height: var(--card, 146px); border-radius: var(--r-row); overflow: hidden; background: var(--surface-1); }
.card .art img { width: 100%; height: 100%; object-fit: cover; }
.card.round .art { border-radius: 50%; }
.card .t { margin-top: 8px; font: 500 14px/1.35 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { font: 400 12px/1.4 var(--font); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.round .t, .card.round .s { text-align: center; }
/* personal mix: cover with a tinted label strip */
.card.mix .art::after { content: ""; position: absolute; inset: auto 0 0; height: 46%;
  background: linear-gradient(rgba(10,10,10,0), rgba(10,10,10,.82)); }
.card.mix .label { position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 1; font: 700 14px/1.2 var(--font-display);
  letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------------------------ top result */
.top-card { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: var(--r-card);
  background: var(--surface-card); box-shadow: inset 0 0 0 .5px var(--border); }
.top-card .cover { width: 84px; height: 84px; border-radius: var(--r-row); object-fit: cover; flex: none; background: var(--surface-1); }
.top-card .cover.round { border-radius: 50%; }
.top-card .info { flex: 1; min-width: 0; }
.top-card .name { font: 700 20px/1.25 var(--font-display); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-card .kind { margin-top: 3px; font: 400 13px var(--font); color: var(--text-3); }
.top-card .actions { display: flex; gap: 8px; margin-top: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px;
  padding: 0 16px; border-radius: var(--r-pill); font: 500 14px/1 var(--font); background: #fff; color: #0a0a0a;
  border: 1px solid transparent; white-space: nowrap; }
.btn:active { opacity: .8; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.ghost { background: var(--surface-1); color: #fff; border-color: var(--border); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }

/* ------------------------------------------------------------------ artist / album pages */
.page-top { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 4px;
  height: calc(52px + var(--safe-t)); padding: var(--safe-t) 8px 0; margin: 0 calc(-1 * var(--gutter)); }
.page-top.solid { background: var(--bg-solid); box-shadow: 0 .5px 0 var(--border-subtle); }
.page-top .ttl { flex: 1; min-width: 0; font: 500 15px var(--font); opacity: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-top.solid .ttl { opacity: 1; }
.page-top .icon-btn { color: var(--text); }
.artist-hero { position: relative; margin: calc(-52px - var(--safe-t)) calc(-1 * var(--gutter)) 0; height: 320px; overflow: hidden; }
.artist-hero img { width: 100%; height: 100%; object-fit: cover; }
.artist-hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(10,10,10,.1) 30%, rgba(10,10,10,.6) 70%, var(--bg)); }
.artist-head { position: relative; z-index: 1; margin-top: -72px; }
.artist-head h1 { margin: 0 0 4px; font: 700 34px/1.1 var(--font-display); letter-spacing: -.02em; }
.artist-head .stats { font: 400 13px var(--font); color: var(--text-3); }
.hero-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 16px 0 8px; }
.hero-actions .spacer { flex: 1; }
.circle-play { width: 56px; height: 56px; border-radius: 50%; background: #fff; color: #030303; display: grid; place-items: center; }
.circle-play svg { width: 28px; height: 28px; }
/* album / playlist: YouTube Music's layout */
.album-hero { position: relative; text-align: center; padding: 4px 0 4px; isolation: isolate; }
.album-hero .bg { position: absolute; inset: calc(-52px - var(--safe-t)) calc(-1 * var(--gutter)) auto; height: 420px; z-index: -1;
  overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(#000 25%, transparent); mask-image: linear-gradient(#000 25%, transparent); }
.album-hero .bg img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.album-hero .cover { width: min(62vw, 260px); aspect-ratio: 1; margin: 8px auto 0; border-radius: 8px; object-fit: cover;
  box-shadow: 0 8px 28px rgba(0,0,0,.45); background: var(--surface-1); }
.album-hero h1 { margin: 20px 0 6px; font: 700 24px/1.25 var(--font); letter-spacing: -.01em; overflow-wrap: anywhere; }
.album-hero .by { font: 500 15px var(--font); color: var(--text); }
.album-hero .by.link { cursor: pointer; }
.album-hero .kind { margin-top: 4px; font: 400 13px var(--font); color: var(--text-3); }
.album-hero .desc { margin: 10px 8px 0; -webkit-line-clamp: 2; text-align: center; font-size: 13px; line-height: 1.5; }
.album-hero .hero-actions { display: grid; grid-template-columns: repeat(5, 1fr); justify-items: center; gap: 0; margin: 18px 0 10px; }
.album-hero .hero-actions .icon-btn { width: 44px; height: 44px; color: var(--text); }
.album-hero .hero-actions .icon-btn svg { width: 24px; height: 24px; }
.desc { margin: 8px 0 0; font: 400 14px/1.6 var(--font); color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.desc.open { -webkit-line-clamp: unset; }
.foot-note { margin: 16px 0 0; font: 400 13px var(--font); color: var(--text-3); }

/* playlist covers: one image, or a 2x2 mosaic of the first four tracks (YouTube Music) */
.mosaic { width: 48px; height: 48px; border-radius: 4px; overflow: hidden; flex: none; background: var(--surface-1);
  display: grid; place-items: center; color: var(--text-3); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; }
.mosaic svg { width: 24px; height: 24px; }
.mosaic.grid { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic.new { background: rgba(255,255,255,.1); color: var(--text); }
.mosaic.sm { width: 40px; height: 40px; }
.mosaic.big { width: min(62vw, 260px); height: auto; aspect-ratio: 1; margin: 8px auto 0; border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.45); }
.mosaic.big svg { width: 64px; height: 64px; }
.sheet-title { padding: 2px 6px 10px; font: 700 17px/1.3 var(--font); }
.sheet .item.pl { gap: 14px; }
.sheet-sub { margin: -6px 6px 8px; color: var(--text-3); font-size: 13px; }
.name-input { width: 100%; height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); outline: 0;
  background: var(--surface-1); color: var(--text); font: 400 16px var(--font); }
.name-input:focus { border-color: rgba(255,255,255,.4); }
.name-input.area { height: auto; min-height: 150px; padding: 12px 14px; margin-top: 8px; resize: vertical; line-height: 1.5; }
.sheet .item.two { height: auto; min-height: 60px; padding: 8px 6px; }
.sheet .item.two .meta { display: flex; flex-direction: column; min-width: 0; }
.sheet .item.two .title { font: 500 15px/1.3 var(--font); }
.sheet .item.two .sub { font: 400 13px/1.35 var(--font); color: var(--text-3); }
.import-bar { height: 4px; margin: 10px 6px 0; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.import-bar i { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(0); transition: transform .3s; }
.import-sub { margin: 10px 6px 4px; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.import-link { display: flex; gap: 8px; }
.import-link .name-input { flex: 1; min-width: 0; }
.import-link .btn { height: 48px; flex: none; }
.import-hint { margin: 8px 6px 4px; color: var(--text-3); font: 400 13px/1.45 var(--font); }
.import-hint.warn { color: #ffcf6e; }
.import-sum { margin: 0 6px 6px; font: 400 15px/1.4 var(--font); color: var(--text-2); }
.import-sum b { color: var(--text); font-weight: 700; }
.import-miss { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); }
.import-miss .h { font: 500 13px var(--font); color: var(--text-2); margin-bottom: 6px; }
.import-miss ul { margin: 0; padding: 0; list-style: none; max-height: 34vh; overflow-y: auto; }
.import-miss li { padding: 5px 0; font: 400 14px/1.35 var(--font); color: var(--text-3); border-top: 1px solid rgba(255,255,255,.06); overflow-wrap: anywhere; }
.import-miss li:first-child { border-top: 0; }
.sheet-actions .spacer { flex: 1; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
/* library: section tiles (each opens its page), «Моя статистика» card */
.lib-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.lib-tile { position: relative; height: 104px; padding: 14px; border-radius: 18px; overflow: hidden; isolation: isolate; text-align: left;
  display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(135deg, var(--from), var(--to)); }
.lib-tile.wide { grid-column: span 2; height: 128px; }
.lib-tiles > .lib-tile:last-child:nth-child(even) { grid-column: span 2; }  /* an odd tile out fills its row */
.lib-tile .glyph-art { position: absolute; z-index: -1; right: -14px; top: -10px; width: 96px; height: 96px; opacity: .55; transform: rotate(-12deg);
  filter: brightness(1.35) saturate(.9); }
.lib-tile.wide .glyph-art { width: 140px; height: 140px; right: -6px; top: -18px; }
.lib-tile .t { font: 700 17px/1.2 var(--font); color: #fff; }
.lib-tile .s { margin-top: 2px; font: 400 13px var(--font); color: rgba(255,255,255,.75); }
.lib-tile:active { transform: scale(.98); transition: transform .1s; }
.stat-card { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: 18px; background: #1c1c1e; text-align: left; }
.stat-card .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stat-card .big { font: 800 28px/1.15 var(--font); letter-spacing: -.01em; }
.stat-card .sub { margin-top: 4px; font: 400 14px/1.35 var(--font); color: rgba(255,255,255,.55); }
.stat-card .faces { display: flex; flex: none; }
.stat-card .faces img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; margin-left: -12px; box-shadow: 0 0 0 2px #1c1c1e; background: #333; }
.stat-card > svg { width: 22px; height: 22px; color: rgba(255,255,255,.45); flex: none; }
.ym-rows .row > svg { width: 22px; height: 22px; color: rgba(255,255,255,.4); flex: none; }
.stat-hero { margin: 18px 0 4px; }
.stat-hero .big { font: 700 44px/1.1 var(--font); letter-spacing: -.01em; }
.stat-hero .sub { margin-top: 6px; font: 400 14px var(--font); color: var(--text-3); }
.empty { padding: 40px 12px; text-align: center; color: var(--text-3); font-size: 14px; }
.empty .big { display: block; margin-bottom: 8px; font: 700 18px var(--font-display); color: var(--text-2); }

/* ------------------------------------------------------------------ tab bar + mini player */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b); background: #161616; }
/* Yandex Music: icons only (each button keeps its name for screen readers) */
.tabbar button { flex: 1; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.42); }
.tabbar button > span:not(.ti) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tabbar .ti, .tabbar .ti svg { display: block; width: 28px; height: 28px; }
.tabbar button.is-active { color: #fff; }
/* the mini player / chat bar float on a solid strip of the tab bar: no page content in the gap around them */
.tabbar::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 92px;
  background: linear-gradient(to bottom, rgba(22,22,22,0), #161616 20px);
  display: none; pointer-events: none; }
body:not(.chat-mode):has(.mini.on) .tabbar::before, body.chat-mode:has(.chatbar.on) .tabbar::before { display: block; }

/* mini player (Yandex Music): cover, title, heart, play/pause; the played part is a lighter fill */
.mini { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 6px); z-index: 21;
  display: none; align-items: center; gap: 12px; height: 60px; padding: 0 6px 0 8px; border-radius: 16px;
  background: #333335; box-shadow: 0 8px 24px rgba(0,0,0,.35); cursor: pointer; overflow: hidden; isolation: isolate; }
.mini.on { display: flex; }
.mini .progress { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.mini .progress i { display: block; height: 100%; width: 100%; background: rgba(255,255,255,.1); transform-origin: 0 50%; transform: scaleX(0); }
.mini .cover { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-1); flex: none; }
.mini .meta { flex: 1; min-width: 0; }
.mini .title { font: 500 16px/21px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .sub { font: 400 14px/19px var(--font); color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .icon-btn { width: 44px; height: 44px; border-radius: 50%; color: #fff; }
.mini .icon-btn svg { width: 28px; height: 28px; }
.mini .icon-btn.is-on { color: #ff4e29; }
@media (min-width: 640px) { .mini { left: 50%; right: auto; width: 600px; transform: translateX(-50%); } }

/* ------------------------------------------------------------------ now playing (Yandex Music): a solid background in the
   cover's muted colour (--np-bg, set by app.js), big cover, artist photo + title, thin scrubber with a
   dot, yellow play, three pills, «Моя волна по треку» */
.np { position: fixed; inset: 0; z-index: 30; background: var(--np-bg, #48484c); transform: translateY(100%); visibility: hidden;
  transition: transform .3s var(--ease), visibility 0s linear .3s, background-color .5s; contain: strict; }
.np.on { transform: none; visibility: visible; transition: transform .3s var(--ease), background-color .5s; }
.np-bg { display: none; }
.np-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  height: calc(56px + var(--safe-t)); padding: var(--safe-t) 10px 0; }
.np-top.solid { background: var(--np-bg, #48484c); box-shadow: 0 .5px 0 rgba(255,255,255,.08); }
.np-top .icon-btn { width: 48px; height: 48px; color: rgba(255,255,255,.88); }
.np-top .icon-btn svg { width: 28px; height: 28px; }
.np-from { flex: 1; min-width: 0; text-align: center; font: 500 17px/1.3 var(--font); color: rgba(255,255,255,.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.np-scroll { position: absolute; inset: 0; z-index: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.np-main { display: flex; flex-direction: column; min-height: 100%; max-width: 520px; margin: 0 auto; padding: calc(60px + var(--safe-t)) 24px 12px; }
.art-wrap { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 18px 0 30px; touch-action: pan-y; }
.art-wrap .art-ghost { position: absolute; margin: 0; pointer-events: none; }
.art { width: min(76vw, 46vh, 400px); aspect-ratio: 1; border-radius: 12px; object-fit: cover; background: rgba(255,255,255,.08);
  box-shadow: 0 18px 40px rgba(0,0,0,.25); }
.np-title { display: flex; align-items: center; gap: 12px; }
.np-title .meta { flex: 1; min-width: 0; }
.np-title h2 { margin: 0; font: 700 23px/1.22 var(--font); letter-spacing: -.01em; overflow: hidden; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.np-title .artist { margin-top: 2px; font: 400 18px/1.3 var(--font); color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.np-title .icon-btn { width: 44px; height: 44px; color: rgba(255,255,255,.88); margin-left: -4px; }
.np-title .icon-btn svg { width: 27px; height: 27px; }
.np-title .like.is-on { color: #fff; }
.scrub { position: relative; height: 30px; margin-top: 22px; touch-action: none; cursor: pointer; }
.scrub .track { position: absolute; left: 0; right: 0; top: 14px; height: 2px; border-radius: 2px; background: rgba(255,255,255,.28); overflow: hidden; }
.scrub .fill { position: absolute; inset: 0; background: #fff; transform-origin: 0 50%; transform: scaleX(0); }
.scrub .knob { position: absolute; top: 9px; left: var(--knob-p, 0%); width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #fff;
  transition: transform .12s; pointer-events: none; }
.scrub.drag .knob { transform: scale(1.4); }
.times { display: flex; justify-content: space-between; margin-top: 2px; font: 400 14px var(--font); font-variant-numeric: tabular-nums; color: rgba(255,255,255,.55); }
.controls { display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: center; justify-items: center; margin: 18px -8px 26px; }
.controls .icon-btn { width: 56px; height: 56px; color: #fff; }
.controls .icon-btn svg { width: 38px; height: 38px; }
.controls .icon-btn.side { position: relative; color: rgba(255,255,255,.5); }
.controls .icon-btn.side svg { width: 26px; height: 26px; }
.controls .icon-btn.side.on { color: #fff; }
.controls .icon-btn.side.on::after { content: ""; position: absolute; left: 50%; bottom: 8px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #fff; }
.controls .icon-btn.side:first-child { justify-self: start; }
.controls .icon-btn.side:last-child { justify-self: end; }
.controls .big { width: 72px; height: 72px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center;
  transition: transform .12s var(--ease); }
.controls .big:active { transform: scale(.94); }
.controls .big svg { width: 34px; height: 34px; }
.np-actions { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 -8px calc(8px + var(--safe-b)); }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; border-radius: 14px; color: rgba(255,255,255,.75);
  font: 500 12px/1.2 var(--font); }
.act svg { width: 24px; height: 24px; }
.act:active { background: rgba(255,255,255,.1); }
.act:disabled { opacity: .35; }
.np-ttfs { display: none; text-align: center; font: 400 11px var(--font); color: rgba(255,255,255,.4); }
.debug .np-ttfs { display: block; }
.q-tools { display: flex; align-items: center; gap: 6px; }

.np-card { max-width: 492px; margin: 0 auto 14px; padding: 16px 16px 12px; border-radius: var(--r-card); background: rgba(0,0,0,.22);
  box-shadow: inset 0 0 0 .5px var(--border-subtle); }
@media (max-width: 520px) { .np-card { margin: 0 14px 14px; } }
.np-card:last-child { margin-bottom: calc(20px + var(--safe-b)); }
.np-card[hidden] { display: none; }
.np-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.np-card-head h3 { margin: 0; font: 700 17px/1.3 var(--font-display); letter-spacing: -.01em; }
.np-card-head .src { font: 400 12px var(--font); color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-card-sub { margin: -4px 0 6px; font: 400 13px var(--font); color: var(--text-3); }
.np-card-sub:empty { display: none; }
.autoplay { display: flex; align-items: center; gap: 10px; font: 400 13px var(--font); color: var(--text-3); }
.switch { width: 40px; height: 24px; border-radius: 24px; background: rgba(255,255,255,.18); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--accent-strong); }
.switch.on::after { transform: translateX(16px); }
.lyrics { position: relative; max-height: 46vh; overflow-y: auto; padding: 4px 0 8px; overscroll-behavior: contain; -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 88%, transparent); mask-image: linear-gradient(transparent, #000 10%, #000 88%, transparent); }
.lyrics p { margin: 0; padding: 6px 0; font: 700 20px/1.35 var(--font-display); letter-spacing: -.01em; color: var(--text-4); cursor: pointer; transition: color .25s; }
/* current line fills over its duration (--p, set per frame). The gradient sits on an inline span:
   with box-decoration-break: slice its background runs across wrapped rows as one strip, so a
   two-row line fills row 1, then row 2 (on the <p> both rows would fill at once). */
.lyrics p.now { color: #fff; }
.lyrics p.now span { color: transparent; -webkit-background-clip: text; background-clip: text;
  -webkit-box-decoration-break: slice; box-decoration-break: slice;
  background-image: linear-gradient(90deg, #fff calc(var(--p, 0) * 100%), rgba(255,255,255,.5) calc(var(--p, 0) * 100%)); }
.lyrics p.past { color: var(--text-3); }
.lyrics.plain { -webkit-mask-image: none; mask-image: none; }
.lyrics.plain p { font: 400 16px/1.7 var(--font); color: var(--text-2); white-space: pre-wrap; cursor: default; }
.lyrics .none { padding: 8px 0 12px; font: 400 14px var(--font); color: var(--text-3); }

/* ------------------------------------------------------------------ bottom sheet (⋮) */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; overflow-y: auto; max-width: 560px; margin: 0 auto;
  padding: 6px 16px calc(14px + var(--safe-b)); background: #191919; border-radius: 22px 22px 0 0;
  transform: translateY(105%); visibility: hidden; transition: transform .26s var(--ease), visibility 0s linear .26s; overscroll-behavior: contain; }
.sheet.on { transform: none; visibility: visible; transition: transform .26s var(--ease); }
.sheet .grab { width: 36px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.3); margin: 4px auto 14px; }
.sheet .sheet-head { display: flex; align-items: center; gap: 12px; padding: 4px 2px 14px; margin-bottom: 6px; }
.sheet .sheet-head img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--surface-1); flex: none; }
.sheet .sheet-head .round { border-radius: 50%; }
.sheet .sheet-head .t { font: 700 18px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .sheet-head .s { font: 400 14px/1.4 var(--font); color: rgba(255,255,255,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* track menu (YouTube Music / Spotify): cover, title, artist · duration over a hairline, then the list */
.ts-head { display: flex; align-items: center; gap: 12px; padding: 0 4px 14px; margin-bottom: 6px; border-bottom: .5px solid rgba(255,255,255,.12); }
.ts-head .cv { width: 52px; height: 52px; border-radius: 6px; object-fit: cover; background: var(--surface-1); flex: none; }
.ts-head .meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ts-head .t { font: 600 16px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-head .s { font: 400 14px/1.35 var(--font); color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ys-list .item, .sheet .item { display: flex; align-items: center; gap: 16px; width: 100%; height: 50px; padding: 0 4px; border-radius: 10px;
  font: 400 16px var(--font); color: #fff; text-align: left; }
.ys-list .item svg, .sheet .item svg { width: 24px; height: 24px; color: rgba(255,255,255,.9); flex: none; }
.sheet .item:active { background: rgba(255,255,255,.06); }
.sheet .item.muted, .sheet .item.muted svg { color: rgba(255,255,255,.45); }

/* ------------------------------------------------------------------ toast + misc */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 76px); z-index: 50;
  transform: translate(-50%, 12px); opacity: 0; padding: 10px 16px; border-radius: var(--r-pill); max-width: calc(100% - 40px);
  background: #2c2c30; box-shadow: var(--shadow-float); font: 500 13px/1.3 var(--font); transition: opacity .2s, transform .2s;
  pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.np.on ~ .toast { bottom: calc(24px + var(--safe-b)); }
.skeleton { background: var(--surface-2); border-radius: var(--r-sm); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.sk-row { height: 48px; margin: 12px 0; }
.sk-wave { height: 236px; margin-top: 6px; border-radius: var(--r-card); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; margin-right: 6px; }
.eq i { width: 3px; height: 12px; background: var(--accent); transform-origin: 50% 100%; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
.paused .eq i { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------------ chat mode: music plays in the Telegram chat */
.chatbar { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 6px); z-index: 21;
  display: none; align-items: center; gap: 12px; height: 60px; padding: 0 8px; border-radius: 12px; background: #1f2126;
  box-shadow: var(--shadow-float); cursor: pointer; }
.chat-mode .chatbar.on { display: flex; }
.chat-mode .mini { display: none !important; }
.chatbar .cover { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-1); flex: none; }
.chatbar .meta { flex: 1; min-width: 0; }
.chatbar .title { font: 500 15px/20px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatbar .sub { font: 400 13px/18px var(--font); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatbar.sending .sub { color: var(--accent); }
.chatbar .icon-btn { width: 40px; height: 40px; color: var(--text); }
@media (min-width: 640px) { .chatbar { left: 50%; right: auto; width: 600px; transform: translateX(-50%); } }
.row.is-sent .title { color: var(--accent); }
.lyr { position: fixed; inset: 0; z-index: 32; background: var(--bg); display: flex; flex-direction: column;
  transform: translateY(100%); visibility: hidden; transition: transform .3s var(--ease), visibility 0s linear .3s; }
.lyr.on { transform: none; visibility: visible; transition: transform .3s var(--ease); }
.lyr .np-top { position: relative; flex: none; }
.lyr .np-from b { color: var(--text); font-weight: 500; }
.lyr .lyrics { flex: 1; max-height: none; padding: 8px 22px; }
.lyr .lyrics p { font-size: 24px; }
.lyr-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 16px calc(14px + var(--safe-b)); }
.lyr-bar .btn:not(.sm) { min-width: 140px; }
.mode-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px;
  color: var(--text-2); font-size: 14px; }
.seg { display: flex; padding: 3px; border-radius: var(--r-pill); background: var(--surface-1); }
.seg-btn { height: 30px; padding: 0 12px; border-radius: var(--r-pill); font: 500 13px var(--font); color: var(--text-3); }
.seg-btn.is-active { background: #fff; color: #0a0a0a; }

/* ------------------------------------------------------------------ collection page («Мне нравится», playlists) as in Yandex Music */
.page.ym-page { background: linear-gradient(180deg, rgba(var(--wash, 70,70,74), 1) 0, rgba(var(--wash, 70,70,74), .55) 360px, #000 620px) no-repeat, #000; }
.ym-page .page-top { background: transparent; }
.ym-page .page-top.solid { background: rgb(var(--wash, 70,70,74)); box-shadow: none; }
.ym-page .page-top .icon-btn { width: 44px; height: 44px; color: #fff; }
.ym-page .page-top .icon-btn svg { width: 26px; height: 26px; }
.ym-hero { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 250px; margin-top: -52px; isolation: isolate; }
.ym-art { position: absolute; top: -10px; left: 50%; z-index: -1; transform: translateX(-50%); width: min(116vw, 560px); display: grid; place-items: center; pointer-events: none; }
.ym-art .glyph-art { width: min(100%, 420px); transform: rotate(-9deg) translate(6%, -4%); opacity: .95; filter: drop-shadow(0 30px 40px rgba(0,0,0,.35)); }
.ym-art .mosaic.big { width: min(60vw, 250px); margin-top: 24px; box-shadow: 0 18px 40px rgba(0,0,0,.4); border-radius: 10px; }
.ym-page .ym-hero:has(.mosaic) { padding-top: 330px; }
.ym-hero h1 { margin: 0; padding: 0 12px; font: 800 34px/1.15 var(--font); letter-spacing: -.02em; text-align: center; text-shadow: 0 2px 18px rgba(0,0,0,.25); overflow-wrap: anywhere; }
.ym-actions { display: flex; justify-content: center; gap: 36px; margin: 22px 0 6px; }
.ym-round { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ym-round .c { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.22); color: #fff; }
.ym-round .c svg { width: 28px; height: 28px; }
.ym-round.play .c { background: #ffe14d; color: #000; }
.ym-round.play .c svg { width: 32px; height: 32px; margin-left: 3px; }
.ym-round .l { font: 400 15px var(--font); color: rgba(255,255,255,.88); }
.ym-round:active .c { transform: scale(.94); transition: transform .1s; }
.ym-chips { margin-top: 26px; gap: 8px; }
.ym-chips .chip { height: 38px; padding: 0 18px; border: 0; border-radius: 19px; font: 400 16px/38px var(--font); color: #fff; background: rgba(255,255,255,.14); }
.ym-chips .chip.is-active { background: #fff; color: #0a0a0a; box-shadow: none; }
.ym-search { width: 100%; height: 42px; margin-top: 14px; padding: 0 14px; border: 0; border-radius: 12px; outline: 0; background: rgba(255,255,255,.1);
  color: #fff; font: 400 16px var(--font); }
.ym-search[hidden] { display: none; }
.ym-rows { margin-top: 14px; }
.ym-rows .row { min-height: 68px; gap: 14px; }
.ym-rows .row .cover { width: 52px; height: 52px; border-radius: 6px; }
.ym-rows .row .title { font: 400 17px/1.3 var(--font); }
.ym-rows .row .sub { font: 400 15px/1.35 var(--font); color: rgba(255,255,255,.5); }
.ym-rows .row .icon-btn { color: rgba(255,255,255,.55); }
.lib-link.liked .lib-ic.heart { background: linear-gradient(135deg, #e3242b, #7a0a10); color: #fff; }

/* search before the first query: a big magnifier in the middle of the free space */
.search-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: calc(100vh - var(--safe-t) - var(--safe-b) - var(--tabbar-h) - 260px); padding: 20px 24px; }
.search-empty .lupa { display: grid; place-items: center; width: 96px; height: 96px; margin-bottom: 14px; border-radius: 50%;
  background: rgba(255,255,255,.07); color: rgba(255,255,255,.92); }
.search-empty .lupa svg { width: 46px; height: 46px; }
.search-empty .big { font: 700 20px/1.3 var(--font); color: var(--text); }
.search-empty .sub { font: 400 15px/1.4 var(--font); color: var(--text-3); }
.stat-card.invite .big { font: 700 18px/1.3 var(--font); }
.stat-card.invite > svg { width: 24px; height: 24px; color: var(--text-2); }
.mode-hint { margin: 10px 2px 0; font: 400 13px/1.45 var(--font); color: var(--text-3); }
