/* Claude Music — тёплая тёмная тема: уголь, крем, терракота */
:root {
  --bg: #12100E;
  --bg-2: #1A1715;
  --card: #221E1B;
  --card-2: #2D2824;
  --line: rgba(255, 236, 214, .08);
  --text: #F6F0E7;
  --muted: #A99F93;
  --faint: #6E665D;
  --accent: #E8855F;
  --accent-2: #F3B36A;
  --rose: #D96A8C;
  --tint: 232, 133, 95;                 /* цвет обложки текущего трека */
  --ease: cubic-bezier(.22, .9, .26, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --tabs-h: 58px;
  --mini-h: 0px;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.has-track { --mini-h: 66px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%; margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.35 var(--sans); overflow: hidden; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; -webkit-user-drag: none; }
[hidden] { display: none !important; }
svg { display: block; }

#app { position: fixed; inset: 0; overflow: hidden; overflow: clip; }
#views { position: absolute; inset: 0; }

/* ---------- экраны ---------- */
.view {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding-bottom: calc(var(--tabs-h) + var(--mini-h) + var(--bottom) + 36px);
  scrollbar-width: none;
}
.view::-webkit-scrollbar { display: none; }
.view.tab { opacity: 0; visibility: hidden; transform: translateY(8px) scale(.992); transition: opacity .28s var(--ease), transform .32s var(--ease), visibility 0s .3s; }
.view.tab.active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.view.page {
  z-index: 5; background: var(--bg); transform: translateX(104%);
  transition: transform .42s var(--ease); box-shadow: -30px 0 60px rgba(0, 0, 0, .5);
  will-change: transform;
}
.view.page.in { transform: none; }

.pad { padding: 0 18px; }
.h1 { font: 700 30px/1.1 var(--sans); letter-spacing: -.03em; margin: 0; }
.h2 { font: 700 20px/1.2 var(--sans); letter-spacing: -.02em; margin: 0; }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -.01em; }

/* появление блоков по мере прокрутки */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.press { transition: transform .18s var(--ease), opacity .18s; }
.press:active { transform: scale(.955); opacity: .86; }

/* ---------- заставка ---------- */
#splash {
  position: absolute; inset: 0; z-index: 90; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity .5s var(--ease), visibility 0s .5s;
}
#splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-mark { width: 76px; height: 76px; color: var(--accent); animation: spin 9s linear infinite; }
.splash-mark svg { width: 100%; height: 100%; }
.splash-mark .ray { animation: ray 1.5s ease-in-out infinite; transform-origin: 50% 50%; }
.splash-name { font: 600 26px/1 var(--sans); letter-spacing: -.03em; }
.splash-name em, .brand em { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--accent); }
.splash-note { min-height: 20px; color: var(--muted); font-size: 14px; text-align: center; padding: 0 30px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ray { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* ---------- главная: волна ---------- */
.wave {
  position: relative; height: min(52vh, 450px); min-height: 340px; overflow: hidden;
  display: flex; flex-direction: column;
}
.wave canvas {
  position: absolute; left: 50%; top: 52%; width: 150%; height: 125%; max-width: none;
  transform: translate(-50%, -50%); filter: blur(22px) saturate(1.25); opacity: .95; pointer-events: none;
}
.wave::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(18, 16, 14, .55) 0%, transparent 22%, transparent 58%, var(--bg) 96%);
}
.wave-top {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--top) + 14px) 18px 0;
}
.brand { display: flex; align-items: center; gap: 8px; font: 600 17px/1 var(--sans); letter-spacing: -.02em; }
.brand svg { width: 22px; height: 22px; color: var(--accent); }
.avatar {
  margin-left: auto; width: 34px; height: 34px; border-radius: 50%; overflow: hidden;
  background: var(--card-2); display: grid; place-items: center; font-weight: 700; font-size: 14px;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.wave-mid {
  position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding-bottom: 6px;
}
.wave-play {
  display: flex; align-items: center; gap: 12px; padding: 6px 8px;
  font: 700 clamp(34px, 10.5vw, 46px)/1 var(--sans); letter-spacing: -.045em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .35);
}
.wave-play .ico { width: .82em; height: .82em; flex: none; transition: transform .3s var(--spring); }
.wave-play:active .ico { transform: scale(.8); }
.wave-sub { min-height: 20px; font-size: 14px; color: rgba(246, 240, 231, .78); text-align: center; padding: 0 30px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 15px; border-radius: 999px;
  background: rgba(255, 255, 255, .13); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.pill svg { width: 17px; height: 17px; }
.pill.on { background: var(--text); color: var(--bg); }
.pill.accent { background: var(--accent); color: #1b0f09; }
.pill.ghost { background: var(--card); backdrop-filter: none; }
.pill.ghost.on { background: var(--text); color: var(--bg); }

/* ---------- секции ---------- */
.section { margin-top: 24px; }
.wave + div > .section:first-child { margin-top: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 18px 12px; }
.hscroll {
  display: flex; gap: 12px; overflow-x: auto; padding: 0 18px 4px; scroll-snap-type: x proximity;
  scroll-padding-left: 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }

.mix {
  position: relative; width: 136px; height: 136px; border-radius: 22px; overflow: hidden; text-align: left;
  padding: 14px; display: flex; align-items: flex-end;
  font: 700 16px/1.12 var(--sans); letter-spacing: -.02em;
}
.mix::before {
  content: ""; position: absolute; right: -34px; top: -34px; width: 120px; height: 120px; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(255, 255, 255, .16) 0 1.5px, transparent 1.5px 11px);
  animation: spin 40s linear infinite;
}
.mix::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .34), transparent 60%); }
.mix span { position: relative; z-index: 1; }
.mix .mix-play {
  position: absolute; z-index: 1; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0, 0, 0, .28); display: grid; place-items: center; backdrop-filter: blur(8px);
}
.mix .mix-play svg { width: 14px; height: 14px; }

.card { width: 140px; text-align: left; }
.card-art { position: relative; width: 140px; height: 140px; border-radius: 16px; overflow: hidden; background: var(--card); }
.card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:active .card-art img { transform: scale(1.06); }
.card-title { margin-top: 9px; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.playing .card-title { color: var(--accent); }

.artist { width: 92px; text-align: center; }
.artist-pic { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; background: var(--card); }
.artist-pic img { width: 100%; height: 100%; object-fit: cover; }
.artist-name { margin-top: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* картинка проявляется после загрузки */
img.lazy { opacity: 0; transition: opacity .45s ease; }
img.lazy.ok { opacity: 1; }

/* ---------- строка трека ---------- */
.rows { padding: 0 8px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 14px; width: 100%; text-align: left;
  transition: background .2s;
}
.row:active { background: var(--card); }
.row-art { position: relative; width: 50px; height: 50px; border-radius: 10px; overflow: hidden; background: var(--card); flex: none; }
.row-art img { width: 100%; height: 100%; object-fit: cover; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-dur { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.row-more { width: 34px; height: 40px; display: grid; place-items: center; color: var(--faint); margin-right: -8px; flex: none; }
.row-more svg { width: 20px; height: 20px; }
.row.playing .row-title { color: var(--accent); }
.eq {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .55); display: none; align-items: flex-end; justify-content: center;
  gap: 3px; padding-bottom: 16px;
}
.playing .eq { display: flex; }
.eq i { width: 3px; height: 14px; border-radius: 2px; background: var(--accent); transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.35s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
body:not(.is-playing) .eq i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* ---------- скелеты ---------- */
.sk { background: linear-gradient(100deg, var(--card) 30%, var(--card-2) 50%, var(--card) 70%); background-size: 300% 100%; animation: sk 1.4s linear infinite; border-radius: 12px; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-row { display: flex; gap: 12px; align-items: center; padding: 7px 18px; }
.sk-row .sk:first-child { width: 50px; height: 50px; flex: none; }
.sk-lines { flex: 1; display: grid; gap: 8px; }
.sk-lines .sk { height: 12px; }
.sk-lines .sk:last-child { width: 55%; }

/* ---------- док: мини-плеер и вкладки ---------- */
#dock {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; padding: 26px 10px calc(var(--bottom) + 6px);
  background: linear-gradient(to top, var(--bg) 0, var(--bg) 58%, transparent); pointer-events: none;
}
#dock > * { pointer-events: auto; }
#mini {
  position: relative; display: flex; align-items: center; gap: 11px; height: 58px; padding: 0 8px 0 8px; margin-bottom: 8px;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(100deg, rgba(var(--tint), .34), rgba(var(--tint), .14)), rgba(40, 35, 31, .86);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .07);
  animation: rise .5s var(--ease); transition: background .8s;
}
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.mini-art { width: 42px; height: 42px; border-radius: 11px; overflow: hidden; flex: none; background: var(--card-2); }
.mini-art img { width: 100%; height: 100%; object-fit: cover; }
.mini-main { flex: 1; min-width: 0; text-align: left; }
.mini-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 12.5px; color: rgba(246, 240, 231, .66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-btn { width: 40px; height: 44px; display: grid; place-items: center; flex: none; }
.mini-btn svg { width: 24px; height: 24px; }
.mini-bar { position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: rgba(255, 255, 255, .12); border-radius: 2px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; width: 100%; background: var(--text); transform-origin: left; transform: scaleX(0); }

#tabs { position: relative; display: flex; height: var(--tabs-h); }
.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--faint); transition: color .25s;
}
.tab-btn svg { width: 25px; height: 25px; transition: transform .35s var(--spring); }
.tab-btn.active { color: var(--text); }
.tab-btn.active svg { transform: translateY(-1px) scale(1.08); color: var(--accent); }

/* ---------- кнопка лайка ---------- */
.like svg { transition: transform .3s var(--spring); }
.like.on { color: var(--accent); }
.like.pop svg { animation: pop .5s var(--spring); }
@keyframes pop { 0% { transform: scale(.6); } 55% { transform: scale(1.3); } 100% { transform: scale(1); } }
.burst { position: fixed; z-index: 99; pointer-events: none; width: 0; height: 0; }
.burst i { position: absolute; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--accent); animation: burst .6s var(--ease) forwards; }
@keyframes burst { to { transform: translate(var(--x), var(--y)) scale(0); opacity: 0; } }

/* ---------- большой плеер ---------- */
#player {
  position: absolute; inset: 0; z-index: 40; background: var(--bg); overflow: hidden;
  transform: translateY(102%); visibility: hidden; will-change: transform;
  transition: transform .5s var(--ease), visibility 0s .5s;
  display: flex; flex-direction: column; padding: calc(var(--top) + 10px) 24px calc(var(--bottom) + 18px);
}
#player.open { transform: none; visibility: visible; transition-delay: 0s; }
#player.drag { transition: none; }
.fp-bg { position: absolute; inset: -12%; z-index: 0; pointer-events: none; }
.fp-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(60px) saturate(1.5); opacity: .5; transform: scale(1.2); transition: opacity 1s; }
.fp-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 70% at 50% 0%, rgba(var(--tint), .5), transparent 70%), linear-gradient(to bottom, rgba(18, 16, 14, .25), rgba(18, 16, 14, .9) 78%);
  transition: background 1s;
}
#player > *:not(.fp-bg) { position: relative; z-index: 1; }
.fp-head { display: flex; align-items: center; height: 44px; flex: none; }
.fp-head button { width: 40px; height: 44px; display: grid; place-items: center; }
.fp-head svg { width: 26px; height: 26px; }
.fp-ctx { flex: 1; text-align: center; min-width: 0; }
.fp-ctx small { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(246, 240, 231, .6); font-weight: 600; }
.fp-ctx b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-art-wrap { flex: 1; min-height: 0; display: grid; place-items: center; padding: 10px 0; }
.fp-art {
  width: min(100%, 44vh); aspect-ratio: 1; border-radius: 26px; overflow: hidden; background: var(--card);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06);
  transform: scale(.86); transition: transform .6s var(--spring); will-change: transform;
}
body.is-playing .fp-art { transform: scale(1); }
.fp-art img { width: 100%; height: 100%; object-fit: cover; }
.fp-art.swap { animation: swap .5s var(--ease); }
@keyframes swap { from { opacity: 0; filter: blur(12px); } }
.fp-reason { height: 30px; display: flex; justify-content: center; flex: none; }
.fp-reason span {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); font-size: 12.5px; color: rgba(246, 240, 231, .82);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: rise .5s var(--ease);
}
.fp-reason svg { width: 14px; height: 14px; flex: none; color: var(--accent-2); }
.fp-meta { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex: none; }
.fp-names { flex: 1; min-width: 0; text-align: left; }
.fp-title { font: 700 23px/1.2 var(--sans); letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-artist { font-size: 16px; color: rgba(246, 240, 231, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.fp-meta .round { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .1); display: grid; place-items: center; flex: none; }
.fp-meta .round svg { width: 22px; height: 22px; }

.seek { margin-top: 18px; flex: none; touch-action: none; padding: 10px 0 0; }
.seek-track { position: relative; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .16); transition: height .2s var(--ease); }
.seek.active .seek-track { height: 9px; }
.seek-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--text); width: 0; }
.seek-buf { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: rgba(255, 255, 255, .16); width: 0; }
.seek-times { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: rgba(246, 240, 231, .6); font-variant-numeric: tabular-nums; }

.fp-ctrl { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; flex: none; }
.fp-ctrl button { width: 52px; height: 56px; display: grid; place-items: center; }
.fp-ctrl svg { width: 30px; height: 30px; }
.fp-ctrl .side svg { width: 25px; height: 25px; }
.fp-ctrl .side { color: rgba(246, 240, 231, .78); }
.fp-ctrl .side.on { color: var(--accent); }
.fp-play {
  width: 74px !important; height: 74px !important; border-radius: 50%; background: var(--text); color: var(--bg);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .4); transition: transform .25s var(--spring);
}
.fp-play:active { transform: scale(.9); }
.fp-play svg { width: 34px !important; height: 34px !important; }
.fp-play.loading { animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .6; } }
.fp-foot { display: flex; justify-content: space-between; margin-top: 12px; flex: none; }
.fp-foot button { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 62px; padding: 6px 2px; font-size: 11px; color: rgba(246, 240, 231, .7); font-weight: 500; }
.fp-foot svg { width: 22px; height: 22px; }

/* ---------- шторки ---------- */
.sheet-wrap { position: absolute; inset: 0; z-index: 60; }
.sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, .58); opacity: 0; transition: opacity .35s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86%; display: flex; flex-direction: column;
  background: var(--bg-2); border-radius: 26px 26px 0 0; padding: 8px 0 calc(var(--bottom) + 14px);
  transform: translateY(105%); transition: transform .45s var(--ease); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
}
.sheet-wrap.in .sheet { transform: none; }
.sheet-wrap.in .sheet-back { opacity: 1; }
.sheet.drag { transition: none; }
.sheet-grab { width: 38px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .2); margin: 2px auto 10px; flex: none; }
.sheet-title { font: 700 19px/1.2 var(--sans); letter-spacing: -.02em; padding: 4px 20px 12px; flex: none; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-head { display: flex; gap: 12px; align-items: center; padding: 6px 20px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet-head img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; background: var(--card); }
.action { display: flex; align-items: center; gap: 15px; width: 100%; padding: 13px 20px; font-size: 16px; text-align: left; }
.action:active { background: var(--card); }
.action svg { width: 23px; height: 23px; color: var(--muted); flex: none; }
.action.on svg { color: var(--accent); }
.group { padding: 4px 20px 14px; }
.group-title { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 10px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 40px; padding: 0 16px; border-radius: 999px; background: var(--card); font-weight: 600; font-size: 14.5px;
  box-shadow: inset 0 0 0 1px var(--line); transition: background .25s, color .25s, transform .3s var(--spring);
}
.chip:active { transform: scale(.94); }
.chip.on { background: var(--text); color: var(--bg); }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px; height: 52px; border-radius: 16px; width: 100%;
  background: var(--accent); color: #1b0f09; font-weight: 700; font-size: 16px;
  transition: transform .2s var(--ease), opacity .2s, background .3s;
}
.btn svg { width: 20px; height: 20px; }
.btn:active { transform: scale(.97); }
.btn:disabled { background: var(--card-2); color: var(--faint); }
.btn.soft { background: var(--card); color: var(--text); }
.field {
  width: 100%; height: 50px; border-radius: 14px; border: 0; outline: 0; background: var(--card); padding: 0 16px;
  font-size: 16px; user-select: text; -webkit-user-select: text; box-shadow: inset 0 0 0 1px var(--line);
}
.field:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.field::-webkit-search-cancel-button, .field::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.field::placeholder { color: var(--faint); }

/* ---------- поиск ---------- */
.top { padding: calc(var(--top) + 18px) 18px 0; }
.search-box { position: sticky; top: 0; z-index: 3; padding: calc(var(--top) + 12px) 18px 10px; background: linear-gradient(to bottom, var(--bg) 78%, transparent); }
.search-in { position: relative; }
.search-in svg { position: absolute; left: 14px; top: 13px; width: 22px; height: 22px; color: var(--faint); pointer-events: none; }
.search-in .field { padding-left: 46px; padding-right: 44px; height: 48px; }
.search-x { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--faint); }
.search-x svg { position: static; width: 18px; height: 18px; }
.seg { display: flex; gap: 8px; padding: 2px 18px 12px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 18px; }
.tile {
  position: relative; height: 92px; border-radius: 18px; overflow: hidden; text-align: left; padding: 13px;
  font: 700 16px/1.15 var(--sans); letter-spacing: -.02em; display: flex; align-items: flex-end;
}
.tile::before {
  content: ""; position: absolute; right: -26px; bottom: -30px; width: 96px; height: 96px; border-radius: 26px;
  background: rgba(255, 255, 255, .14); transform: rotate(24deg);
}
.tile span { position: relative; }
.suggest { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 20px; font-size: 16px; text-align: left; }
.suggest svg { width: 19px; height: 19px; color: var(--faint); flex: none; }
.empty { text-align: center; color: var(--muted); padding: 50px 40px; font-size: 15px; }
.empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }

/* ---------- коллекция ---------- */
.lib-like {
  position: relative; display: flex; align-items: flex-end; height: 150px; margin: 18px 18px 0; padding: 18px; border-radius: 24px;
  overflow: hidden; text-align: left; width: calc(100% - 36px);
  background: linear-gradient(135deg, var(--accent), #B4486B 70%, #5B2E6B);
}
.lib-like .collage { position: absolute; right: -14px; top: -10px; display: grid; grid-template-columns: 64px 64px; gap: 6px; transform: rotate(12deg); opacity: .92; }
.lib-like .collage img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.lib-like b { display: block; font: 700 23px/1.1 var(--sans); letter-spacing: -.03em; }
.lib-like small { font-size: 14px; color: rgba(255, 255, 255, .8); }
.lib-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 18px; text-align: left; }
.lib-row:active { background: var(--card); }
.lib-ico { width: 54px; height: 54px; border-radius: 14px; background: var(--card); display: grid; place-items: center; flex: none; overflow: hidden; color: var(--muted); }
.lib-ico svg { width: 24px; height: 24px; }
.lib-ico img { width: 100%; height: 100%; object-fit: cover; }
.lib-row b { display: block; font-weight: 600; }
.lib-row small { color: var(--muted); font-size: 13px; }
.lib-row .chev { margin-left: auto; color: var(--faint); }
.lib-row .chev svg { width: 18px; height: 18px; }

/* ---------- страницы (жанр, артист, плейлист) ---------- */
.page-hero { position: relative; padding: calc(var(--top) + 64px) 18px 22px; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, var(--c1, #3a322c), var(--c2, #1a1715)); opacity: .9; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, var(--bg)); }
.page-hero > * { position: relative; z-index: 1; }
.page-hero .pic { width: 132px; height: 132px; border-radius: 22px; overflow: hidden; margin-bottom: 16px; box-shadow: 0 18px 44px rgba(0, 0, 0, .5); background: var(--card); }
.page-hero .pic.round { border-radius: 50%; }
.page-hero .pic img { width: 100%; height: 100%; object-fit: cover; }
.page-hero .h1 { font-size: 32px; }
.page-hero .muted { margin-top: 6px; color: rgba(246, 240, 231, .72); }
.page-actions { display: flex; gap: 10px; margin-top: 16px; }
.page-actions .btn { width: auto; flex: 1; height: 46px; border-radius: 999px; font-size: 15px; }
.back {
  position: absolute; z-index: 4; left: 12px; top: calc(var(--top) + 10px); width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0, 0, 0, .34); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: grid; place-items: center;
}
.back svg { width: 22px; height: 22px; }

/* ---------- первый запуск ---------- */
#onboard {
  position: absolute; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column;
  padding: calc(var(--top) + 26px) 20px calc(var(--bottom) + 18px); overflow: hidden; animation: fadein .5s var(--ease);
}
#onboard.gone { opacity: 0; transform: scale(1.04); transition: opacity .5s var(--ease), transform .5s var(--ease); pointer-events: none; }
@keyframes fadein { from { opacity: 0; } }
#onboard canvas { position: absolute; left: 50%; top: -6%; width: 150%; height: 62%; transform: translateX(-50%); filter: blur(30px) saturate(1.2); opacity: .7; pointer-events: none; }
#onboard > *:not(canvas) { position: relative; }
.ob-title { font: 700 34px/1.05 var(--sans); letter-spacing: -.04em; margin: 8vh 0 10px; }
.ob-sub { color: rgba(246, 240, 231, .75); font-size: 16px; margin-bottom: 22px; }
.ob-chips { flex: 1; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 9px; padding-bottom: 14px; scrollbar-width: none; }
.ob-chip {
  height: 46px; padding: 0 18px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-weight: 600; font-size: 15.5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); transition: transform .35s var(--spring), box-shadow .3s;
  animation: chipin .6s var(--spring) backwards;
}
.ob-chip.on { background: linear-gradient(120deg, var(--c1), var(--c2)); box-shadow: 0 8px 22px rgba(0, 0, 0, .35); transform: scale(1.05); }
@keyframes chipin { from { opacity: 0; transform: translateY(16px) scale(.8); } }
.ob-skip { margin-top: 10px; height: 40px; color: var(--muted); font-weight: 600; width: 100%; }

/* ---------- подсказка ---------- */
#toast {
  position: absolute; z-index: 80; left: 50%; bottom: calc(var(--tabs-h) + var(--mini-h) + var(--bottom) + 26px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: 86%;
  padding: 11px 16px; border-radius: 14px; background: rgba(246, 240, 231, .96); color: #1a1512; font-weight: 600; font-size: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5); transition: opacity .3s, transform .4s var(--spring); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 700px) {
  #app { max-width: 480px; margin: 0 auto; box-shadow: 0 0 0 1px var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- выбор артистов ---------- */
#onboard .ob-title { font-size: 30px; margin: 3vh 0 8px; }
#onboard .ob-sub { font-size: 15px; margin-bottom: 14px; }
.ob-search { position: relative; margin-bottom: 12px; flex: none; }
.ob-search svg { position: absolute; left: 14px; top: 13px; width: 22px; height: 22px; color: var(--faint); pointer-events: none; }
.ob-search .field { padding-left: 46px; height: 48px; background: rgba(255, 255, 255, .09); }
.ob-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -8px 12px; padding: 8px 8px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%); }
.ob-scroll::-webkit-scrollbar { display: none; }
.ar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 12px; }
.ar { text-align: center; min-width: 0; animation: chipin .5s var(--spring) backwards; }
.ar-pic { position: relative; aspect-ratio: 1; border-radius: 50%; background: var(--card-2); transition: transform .32s var(--spring), box-shadow .25s; }
.ar-pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ar:active .ar-pic { transform: scale(.93); }
.ar.on .ar-pic { transform: scale(.9); box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent); }
.ar-check { position: absolute; right: 0; bottom: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #1b0f09;
  display: grid; place-items: center; transform: scale(0); transition: transform .32s var(--spring); box-shadow: 0 0 0 3px var(--bg); }
.ar-check svg { width: 15px; height: 15px; stroke-width: 3.2; }
.ar.on .ar-check { transform: scale(1); }
.ar-name { margin-top: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar.on .ar-name { color: var(--accent); }

/* ---------- перенос плейлиста ---------- */
.field.area { height: auto; min-height: 104px; padding: 13px 16px; resize: none; line-height: 1.4; display: block; font-family: inherit; }
.hint { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.hint.bad { color: #F0907A; }
.bar { height: 6px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; transition: transform .6s var(--ease); }
