:root {
  --bg: #080a0d;
  --surface: rgba(19, 23, 28, .7);
  --surface-2: rgba(31, 37, 44, .72);
  --surface-3: rgba(47, 55, 64, .66);
  --text: #f6f7f9;
  --muted: #9298a3;
  --line: rgba(255, 255, 255, .12);
  --primary: #e5ff67;
  --cyan: #5ad7ff;
  --coral: #ff796d;
  --success: #57dfa7;
  --danger: #ff6e82;
  --warning: #f2bd5b;
  --radius: 8px;
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px));
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #080a0d;
}
#sceneCanvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: .72;
  pointer-events: none;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { border: 0; color: inherit; background: none; cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
button:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hidden, [hidden] { display: none !important; }

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  transition: opacity .25s, visibility .25s;
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash img { width: 58px; height: 58px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.splash strong, .splash small { display: block; }
.splash strong { font-size: 20px; }
.splash small { margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; }

.app { position: relative; width: min(100%, 820px); min-height: var(--app-height, 100dvh); margin: 0 auto; padding-bottom: calc(92px + var(--safe-bottom)); }
.app.player-active { padding-bottom: calc(126px + var(--safe-bottom)); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: calc(66px + var(--safe-top));
  padding: calc(10px + var(--safe-top)) 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 12, 15, .63);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .18);
  backdrop-filter: blur(28px) saturate(145%);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; text-align: left; }
.brand img { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.brand span, .brand strong, .brand small { display: block; min-width: 0; }
.brand strong { font-size: 16px; line-height: 1.2; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-control, .avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 1px rgba(255, 255, 255, .1), 0 9px 24px rgba(0, 0, 0, .16);
  backdrop-filter: blur(18px) saturate(150%);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.icon-control:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--cyan) 52%, var(--line)); }
.avatar { border-radius: 50%; background: var(--primary); color: #111308; font-weight: 850; }

main { padding: 18px 16px 24px; }
.page { display: none; animation: page-in .22s ease; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.banner {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--coral) 48%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--coral) 9%, var(--surface));
}
.banner b, .banner span { display: block; }
.banner span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.banner.warning { border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); background: color-mix(in srgb, var(--warning) 8%, var(--surface)); }
.banner.offline { position: sticky; top: calc(68px + var(--safe-top)); z-index: 25; color: var(--warning); }
.banner.offline:not(.hidden) ~ .page .sticky-search { top: calc(122px + var(--safe-top)); }

.now-card {
  position: relative;
  min-height: 268px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(130px, 42%) 1fr;
  grid-template-rows: 1fr auto;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 1px rgba(255, 255, 255, .11), 0 30px 80px rgba(0, 0, 0, .27);
  backdrop-filter: blur(28px) saturate(155%);
  transform: perspective(1100px) rotateX(.7deg);
  transform-style: preserve-3d;
}
.now-card > img {
  width: 100%;
  aspect-ratio: 1;
  align-self: center;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid #3a3e45;
  box-shadow: 0 20px 42px rgba(0, 0, 0, .32);
  transform: translateZ(26px) rotateY(2deg);
}
.now-copy { align-self: center; min-width: 0; transform: translateZ(34px); }
.eyebrow, .page-title > span, .section-heading span, .ref-card > span, .sheet > span {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.now-copy h1 { max-width: 390px; margin: 8px 0; font-size: clamp(26px, 6vw, 39px); line-height: 1.02; overflow-wrap: anywhere; }
.now-copy p { margin: 0; color: var(--muted); }
.play-cta {
  min-height: 44px;
  margin-top: 18px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #111308;
  box-shadow: 0 12px 34px rgba(205, 239, 77, .2), inset 0 1px rgba(255, 255, 255, .45);
  transition: transform .18s ease, box-shadow .18s ease;
}
.play-cta:hover { transform: translateY(-2px) translateZ(5px); box-shadow: 0 16px 40px rgba(205, 239, 77, .28), inset 0 1px rgba(255, 255, 255, .5); }
.play-cta svg { width: 18px; height: 18px; }
.status-line {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.status-line span { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.status-line i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.status-line em { padding: 4px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--primary); font-size: 10px; font-style: normal; font-weight: 800; }

.quick-search, .channel-card {
  width: 100%;
  min-height: 66px;
  margin-top: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 14px 34px rgba(0,0,0,.16);
  backdrop-filter: blur(22px) saturate(145%);
  transition: transform .18s ease, border-color .18s ease;
}
.quick-search:hover, .channel-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--cyan) 40%, var(--line)); }
.quick-search > span:nth-child(2), .channel-card > span { flex: 1; min-width: 0; }
.quick-search b, .quick-search small, .channel-card b, .channel-card small { display: block; }
.quick-search small, .channel-card small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.quick-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius); background: var(--cyan); color: #081116; }
.quick-search > i, .channel-card > i { display: grid; color: var(--muted); }
.channel-card img { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; object-fit: cover; }

.compact-stats { display: grid; grid-template-columns: 1fr 1fr; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 1px rgba(255,255,255,.07); backdrop-filter: blur(20px); }
.compact-stats div { min-width: 0; padding: 13px 14px; }
.compact-stats div + div { border-left: 1px solid var(--line); }
.compact-stats small, .compact-stats b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-stats small { color: var(--muted); font-size: 10px; }
.compact-stats b { margin-top: 3px; font-size: 14px; }
.compact-stats div:first-child b { color: var(--primary); }

.section-heading { margin: 24px 2px 11px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 3px 0 0; font-size: 21px; }
.section-heading button { min-height: 40px; color: var(--cyan); font-size: 12px; }
.page-title { padding: 8px 2px 16px; }
.page-title h1 { margin: 5px 0 0; font-size: 30px; line-height: 1.1; overflow-wrap: anywhere; }

.search-panel { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(17, 21, 25, .74); box-shadow: inset 0 1px rgba(255,255,255,.1), 0 20px 48px rgba(0,0,0,.24); backdrop-filter: blur(30px) saturate(155%); }
.sticky-search { position: sticky; top: calc(76px + var(--safe-top)); z-index: 20; backdrop-filter: blur(18px); }
.search-box { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.search-box > span { display: grid; color: var(--cyan); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 16px; }
.search-box input::placeholder { color: #767c86; }
.search-box .icon-control { width: 38px; height: 38px; border: 0; background: transparent; color: var(--muted); }
.source-tabs, .library-tabs { gap: 4px; margin-top: 10px; padding: 4px; border-radius: var(--radius); background: var(--surface-2); }
.source-tabs { display: flex; }
.source-tabs button { flex: 1; }
.library-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
.source-tabs button, .library-tabs button { min-width: 0; min-height: 38px; padding: 7px 5px; border-radius: 6px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-tabs button.active, .library-tabs button.active { background: var(--text); color: var(--bg); font-weight: 750; }
.source-tabs button { transition: transform .16s ease, background .16s ease, color .16s ease; }
.source-tabs button:hover { transform: translateY(-1px); color: var(--text); }
.library-tabs { margin: 0 0 12px; }

.track-list { display: grid; gap: 7px; }
.search-results, .search-empty { margin-top: 12px; }
.track {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 10px 25px rgba(0,0,0,.13);
  backdrop-filter: blur(20px) saturate(140%);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.track:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--cyan) 38%, var(--line)); background: rgba(30, 36, 42, .8); }
.track.external-track { border-left: 2px solid var(--cyan); }
.official-link { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, transparent); }
.track-cover { width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: var(--surface-3); color: var(--cyan); }
.track-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-copy { min-width: 0; flex: 1; padding: 0 2px; }
.track-copy .track-title, .artist-link { max-width: 100%; display: block; padding: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.track-copy .track-title { color: var(--text); font-size: 14px; font-weight: 700; }
.artist-link { margin-top: 2px; color: var(--muted); font-size: 12px; }
.track-copy small { display: block; margin-top: 3px; overflow: hidden; color: #747a84; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border-radius: var(--radius); color: var(--muted); }
.icon-button:hover { background: var(--surface-2); }
.icon-button.liked { color: var(--coral); }
.icon-button.liked svg { fill: color-mix(in srgb, var(--coral) 22%, transparent); }

.empty { padding: 34px 18px; border: 1px dashed #3a3d43; border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty b, .empty span { display: block; }
.empty b { color: var(--text); font-size: 15px; }
.empty span { margin-top: 4px; font-size: 11px; }
.empty .empty { padding: 0; border: 0; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.metric-grid article { padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.metric-grid small, .metric-grid b { display: block; }
.metric-grid small { color: var(--muted); font-size: 10px; }
.metric-grid b { margin-top: 5px; font-size: 20px; }
.skeleton { height: 70px; margin: 7px 0; border-radius: var(--radius); background: var(--surface); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { background: var(--surface-2); } }

.playlist-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.playlist-card > button { width: 100%; min-height: 76px; display: flex; align-items: center; gap: 12px; padding: 10px; text-align: left; }
.playlist-card b, .playlist-card small { display: block; }
.playlist-card b { overflow-wrap: anywhere; }
.playlist-card small { margin-top: 3px; color: var(--muted); }
.playlist-card > button > span:nth-child(2) { min-width: 0; flex: 1; }
.playlist-art, .album-art { display: grid; place-items: center; background: var(--surface-3); color: var(--cyan); }
.playlist-art { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 6px; }

.profile-head { display: flex; align-items: center; gap: 12px; padding: 8px 0 18px; }
.profile-head > div { width: 58px; height: 58px; flex: 0 0 58px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #111308; font-size: 21px; font-weight: 850; }
.profile-head > span { min-width: 0; flex: 1; }
.profile-head h1, .profile-head p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-head h1 { font-size: 23px; }
.profile-head p { color: var(--muted); }
.profile-head em { padding: 5px 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--cyan); font-size: 9px; font-style: normal; font-weight: 800; }
.account-summary { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.account-summary > * { min-width: 0; padding: 14px; text-align: left; }
.account-summary > * + * { border-left: 1px solid var(--line); }
.account-summary small, .account-summary b, .account-summary span { display: block; }
.account-summary small, .account-summary span { color: var(--muted); font-size: 10px; }
.account-summary b { margin: 5px 0; overflow-wrap: anywhere; font-size: 17px; }
.account-summary > button b { color: var(--primary); }
.account-summary i { color: var(--text); font-style: normal; }
.account-summary div > button { min-height: 35px; margin-top: 9px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--cyan); }

.profile-data, .settings-card { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.profile-data > div, .settings-card label { min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 11px 13px; }
.profile-data > div + div, .settings-card label + label { border-top: 1px solid var(--line); }
.profile-data span, .settings-card label > span { min-width: 0; flex: 1; color: var(--muted); }
.profile-data b { max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-data button { min-height: 36px; color: var(--cyan); font-size: 11px; }
.settings-card b, .settings-card small { display: block; }
.settings-card b { color: var(--text); }
.settings-card small { font-size: 10px; }
.settings-card select { max-width: 44%; padding: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--surface-2); }

.ref-card { margin-top: 12px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ref-card > div:nth-of-type(1) { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.ref-card h2, .ref-card p { margin: 7px 0 0; }
.ref-card h2 { font-size: 21px; }
.ref-card p { color: var(--muted); font-size: 11px; }
.ref-card > div:last-child { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 13px; }
.ref-card button { min-height: 40px; border: 1px solid var(--line); border-radius: 6px; }
.ref-card button.accent { border-color: var(--primary); background: var(--primary); color: #111308; font-weight: 750; }
.profile-actions, .menu-list { display: grid; gap: 7px; margin-top: 12px; }
.profile-actions > button, .menu-list .btn { min-height: 54px; display: flex; align-items: center; justify-content: flex-start; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; }
.profile-actions > button > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-3); color: var(--cyan); }
.profile-actions div { min-width: 0; flex: 1; }
.profile-actions b, .profile-actions small { display: block; }
.profile-actions small { color: var(--muted); font-size: 10px; }
.profile-actions > button > i { display: grid; color: var(--muted); }
.version { margin: 20px 0 8px; color: var(--muted); font-size: 11px; text-align: center; }

.mini-player {
  position: fixed;
  z-index: 35;
  left: 50%;
  bottom: calc(66px + var(--safe-bottom));
  width: min(calc(100% - 16px), 804px);
  min-height: 62px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid #41454d;
  border-radius: var(--radius);
  background: rgba(23, 28, 34, .76);
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 16px 42px rgba(0,0,0,.3);
  backdrop-filter: blur(28px) saturate(155%);
}
.player-cover { width: 46px; height: 46px; flex: 0 0 46px; overflow: hidden; padding: 0; border-radius: 6px; }
.player-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-player > div { min-width: 0; flex: 1; }
.mini-player b, .mini-player small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player small, .mini-player > span { color: var(--muted); font-size: 10px; }
.player-toggle { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #111308; }
.mini-player #playerError { min-height: 36px; padding: 6px 8px; border-radius: 6px; color: var(--danger); background: var(--surface-3); font-size: 10px; }

.bottom-nav {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 0;
  width: min(100%, 820px);
  min-height: calc(66px + var(--safe-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgba(9, 11, 14, .72);
  box-shadow: 0 -14px 38px rgba(0,0,0,.2);
  backdrop-filter: blur(28px) saturate(150%);
}
.bottom-nav button { min-width: 0; min-height: 58px; display: grid; place-items: center; align-content: center; gap: 2px; border-radius: 6px; color: var(--muted); }
.bottom-nav button span { height: 23px; display: grid; place-items: center; }
.bottom-nav button b { max-width: 100%; overflow: hidden; font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav button.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.bottom-nav button { transition: transform .16s ease, color .16s ease, background .16s ease; }
.bottom-nav button:hover { transform: translateY(-2px); color: var(--text); }

.btn { min-height: 42px; padding: 9px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: var(--surface-2); text-decoration: none; font-size: 13px; font-weight: 650; }
.btn.primary { border-color: var(--primary); background: var(--primary); color: #111308; }
.btn.secondary { background: var(--surface-2); }
.btn.danger { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.selected { border-color: var(--cyan); color: var(--cyan); }
.toolbar, .reorder { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0; }
.reorder { justify-content: flex-end; }
.reorder .btn { min-height: 36px; font-size: 11px; }

.modal { position: fixed; z-index: 80; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 12px; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
.sheet { position: relative; width: min(100%, 560px); max-height: 86dvh; overflow: auto; padding: 22px; border: 1px solid #41454d; border-radius: 8px; background: rgba(19,23,28,.88); box-shadow: inset 0 1px rgba(255,255,255,.12), 0 24px 70px rgba(0,0,0,.42); backdrop-filter: blur(32px) saturate(150%); animation: sheet-in .2s ease; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px); } }
.sheet .close { position: absolute; top: 11px; right: 11px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius); background: var(--surface-2); }
.sheet h2 { margin: 7px 44px 16px 0; font-size: 23px; overflow-wrap: anywhere; }
.sheet p { color: var(--muted); }
.modal-open { overflow: hidden; }
.field { display: grid; gap: 6px; margin: 14px 0; color: var(--muted); font-size: 11px; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: var(--surface-2); font-size: 16px; text-transform: none; }
.field textarea { min-height: 96px; resize: vertical; }
.field-error { min-height: 18px; color: var(--danger) !important; font-size: 11px; }
.option-row { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.option-row input { width: 22px; height: 22px; accent-color: var(--primary); }
.notice, .session-card { margin: 9px 0; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.notice h3 { margin-top: 0; }
.session-card p { font-size: 11px; overflow-wrap: anywhere; }
.session-card small { display: block; margin: 7px 0; color: var(--muted); }
.playlist-description { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }

.full-player { text-align: center; }
.album-art { width: min(64vw, 260px); aspect-ratio: 1; margin: 12px auto 18px; border-radius: var(--radius); }
.album-art img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.album-art svg { width: 62px; height: 62px; }
.full-player input { width: 100%; height: auto; padding: 0; accent-color: var(--primary); }
.time-row { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.player-controls { display: flex; justify-content: center; gap: 6px; margin: 18px 0; }
.player-controls .btn { width: 44px; padding: 8px; }
.player-controls .btn.primary { width: 50px; height: 50px; border-radius: 50%; }
.queue-row { display: flex; align-items: center; gap: 7px; margin: 7px 0; }
.queue-row b { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-row .btn { min-height: 36px; padding: 7px; font-size: 11px; }
.player-modal { padding: 10px; align-items: center; }
.player-modal .sheet { width: min(100%, 600px); max-height: calc(100dvh - 20px); padding: 22px 24px 24px; color: #f6f7f9; background: rgba(13, 17, 21, .9); }
.player-modal .sheet > h2 { margin: 3px 44px 14px; color: #98a0aa; font-size: 12px; font-weight: 750; text-align: center; text-transform: uppercase; }
.player-modal .full-player { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px 18px; }
.player-modal .album-art { grid-column: 1 / -1; width: min(68vw, 340px); margin: 4px auto 14px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--cyan) 24%, var(--line)); box-shadow: 0 34px 70px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.13); transform: perspective(900px) rotateX(2deg) rotateY(-2deg); transform-style: preserve-3d; }
.player-modal .album-art img { transition: transform .35s ease, filter .35s ease; }
.player-modal.is-playing .album-art img { animation: cover-breathe 5s ease-in-out infinite; }
@keyframes cover-breathe { 50% { transform: scale(1.035); filter: saturate(1.12); } }
.player-meta { min-width: 0; text-align: left; }
.player-meta > span { color: var(--cyan); font-size: 9px; font-weight: 850; }
.player-meta h3 { margin: 4px 0 2px; overflow: hidden; color: #f6f7f9; font-size: 23px; line-height: 1.08; text-overflow: ellipsis; white-space: nowrap; }
.player-meta p { margin: 0; overflow: hidden; color: #98a0aa; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.player-actions { display: flex; align-items: center; justify-content: end; gap: 2px; }
.player-actions .icon-button { color: #c8cdd3; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); }
.seek-slider { grid-column: 1 / -1; width: 100%; height: 24px; margin: 8px 0 -7px; accent-color: var(--primary); cursor: pointer; }
.player-modal .time-row { grid-column: 1 / -1; color: #98a0aa; }
.player-modal .player-controls { grid-column: 1 / -1; align-items: center; gap: clamp(7px, 4vw, 22px); margin: 10px 0 4px; }
.player-modal .player-controls .btn { width: 46px; height: 46px; padding: 0; color: #d8dce1; border-color: transparent; background: transparent; }
.player-modal .player-controls .btn.primary { width: 64px; height: 64px; border-color: var(--primary); background: var(--primary); box-shadow: 0 15px 34px rgba(205,239,77,.22); }
.player-modal .player-controls .btn.selected { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 11%, transparent); }
.player-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 45px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.12); color: #98a0aa; font-size: 10px; }
.player-footer .btn { min-height: 38px; color: #eef0f2; border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.05); }
.embed-modal { align-items: center; }
.embed-modal .sheet { width: min(calc(100% - 20px), 560px); background: rgba(13,17,21,.92); }
.embed-modal .sheet > h2 { color: #f6f7f9; }
.embedded-player { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 12px; }
.embedded-player > img { width: 70px; height: 70px; border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); object-fit: cover; box-shadow: 0 12px 28px rgba(0,0,0,.28); }
.embedded-player > div { min-width: 0; }
.embedded-player > div span { color: var(--cyan); font-size: 9px; font-weight: 850; }
.embedded-player h3, .embedded-player p { margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embedded-player h3 { color: #f6f7f9; font-size: 18px; }
.embedded-player p { color: #98a0aa; font-size: 12px; }
.embedded-player iframe { grid-column: 1 / -1; width: 100%; height: 175px; border: 0; border-radius: var(--radius); background: #fff; }
.embedded-player > .btn { grid-column: 1 / -1; width: 100%; color: #eef0f2; border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.05); }
.toast { position: fixed; z-index: 120; left: 50%; bottom: calc(142px + var(--safe-bottom)); max-width: calc(100% - 28px); padding: 11px 14px; transform: translate(-50%, 14px); border: 1px solid #42464e; border-radius: var(--radius); background: var(--text); color: var(--bg); font-weight: 700; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--danger); background: var(--surface); color: var(--danger); }
.image-fallback { background: var(--surface-3); }

[data-theme="light"] {
  --bg: #edf2f3;
  --surface: rgba(255, 255, 255, .72);
  --surface-2: rgba(236, 241, 242, .78);
  --surface-3: rgba(218, 228, 230, .75);
  --text: #17191b;
  --muted: #686f75;
  --line: rgba(18, 28, 31, .14);
  --primary: #b4d719;
  --cyan: #007da0;
  --coral: #d64f43;
  --success: #17865f;
  --danger: #bf354d;
  --warning: #9a6710;
  color-scheme: light;
}
[data-theme="light"] body::before { background: #edf2f3; }
[data-theme="light"] #sceneCanvas { opacity: .28; filter: saturate(.8) contrast(.85); }
[data-theme="light"] .topbar, [data-theme="light"] .bottom-nav { background: rgba(243, 247, 247, .72); }
[data-theme="light"] .search-panel { background: rgba(255,255,255,.74); }
[data-theme="light"] .track:hover { background: rgba(255,255,255,.9); }
[data-theme="light"] .now-card > img { border-color: #c9cdc5; }
[data-theme="light"] .mini-player { border-color: #c6cac2; box-shadow: 0 12px 28px rgba(45,50,42,.14); }
[data-theme="light"] .sheet { border-color: #c6cac2; box-shadow: 0 24px 60px rgba(45,50,42,.2); }

@media (max-width: 520px) {
  main { padding: 14px 12px 22px; }
  .topbar { padding-inline: 12px; }
  .now-card { min-height: 0; grid-template-columns: 112px 1fr; gap: 13px; padding: 13px; }
  .now-copy h1 { font-size: 25px; }
  .now-copy p { font-size: 12px; }
  .play-cta { margin-top: 12px; }
  .account-summary { grid-template-columns: 1fr; }
  .account-summary > * + * { border-top: 1px solid var(--line); border-left: 0; }
  .player-modal .sheet { padding: 18px 16px 16px; }
  .player-modal .album-art { width: min(76vw, 320px); }
  .player-meta h3 { font-size: 20px; }
}

@media (max-width: 360px) {
  .brand small { display: none; }
  .now-card { grid-template-columns: 92px 1fr; }
  .now-copy h1 { font-size: 21px; }
  .now-copy p { display: none; }
  .play-cta { min-height: 40px; padding: 8px 10px; font-size: 12px; }
  .compact-stats { grid-template-columns: 1fr; }
  .compact-stats div + div { border-top: 1px solid var(--line); border-left: 0; }
  .track { gap: 5px; padding: 7px; }
  .track-cover { width: 44px; height: 44px; flex-basis: 44px; }
  .icon-button { width: 36px; height: 36px; flex-basis: 36px; }
  .source-tabs button, .library-tabs button { font-size: 10px; }
  .bottom-nav button b { font-size: 8px; }
}

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