/* ============ tokens ============ */
:root {
  --bg: #070b0e;
  --bg-soft: #0b1116;
  --surface: #111a21;
  --surface-2: #16222b;
  --line: rgba(255, 255, 255, .07);
  --text: #e9f2f5;
  --muted: #8ba0ab;
  --accent: #00d3e5;
  --accent-soft: rgba(0, 211, 229, .14);
  --danger: #ff6b81;
  --topbar-h: 54px;
  --tabbar-h: 56px;
  --mini-h: 62px;
  --radius: 16px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
*::-webkit-scrollbar { width: 0; height: 0; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
body { min-height: 100dvh; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
img { display: block; }
::selection { background: rgba(0, 211, 229, .3); }

.app { min-height: 100dvh; }

/* ============ topbar ============ */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: calc(var(--topbar-h) + var(--safe-t));
  padding: var(--safe-t) 14px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(7, 11, 14, .92) 55%, rgba(7, 11, 14, 0));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center;
  color: #04191d;
  background: linear-gradient(145deg, #33ecf7, #00b6c6);
  box-shadow: 0 4px 16px rgba(0, 211, 229, .28);
}
.brand-text { font-weight: 750; letter-spacing: .14em; font-size: 15px; }
.topbar-actions { display: flex; gap: 2px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text);
  transition: background .18s var(--ease), transform .12s var(--ease), color .18s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .07); }
.icon-btn:active { transform: scale(.9); }

/* ============ menu ============ */
.menu {
  position: fixed; z-index: 55;
  top: calc(var(--topbar-h) + var(--safe-t) + 2px);
  right: 12px; min-width: 208px; padding: 6px;
  background: rgba(20, 30, 37, .97);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform-origin: top right;
  animation: menu-in .18s var(--ease-out);
}
.menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; transform: none; } }
.menu-item {
  width: 100%; text-align: left; padding: 11px 12px; border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--text);
  transition: background .16s;
}
.menu-item:hover { background: rgba(255, 255, 255, .06); }
.menu-item:active { background: rgba(255, 255, 255, .1); }
.menu-meta {
  margin-top: 4px; padding: 8px 12px 4px;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted); letter-spacing: .04em;
}

/* ============ main / views ============ */.main {
  padding: calc(var(--topbar-h) + var(--safe-t) + 8px) 0 calc(var(--tabbar-h) + var(--mini-h) + var(--safe-b) + 26px);
  min-height: 100dvh;
  outline: none;
}
.view { animation: view-in .32s var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* card / row entry — backwards fill so hover & press vẫn hoạt động sau animation */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rail > * { animation: rise .42s var(--ease-out) backwards; }
.rail > *:nth-child(2) { animation-delay: 35ms; }
.rail > *:nth-child(3) { animation-delay: 70ms; }
.rail > *:nth-child(4) { animation-delay: 105ms; }
.rail > *:nth-child(5) { animation-delay: 140ms; }
.rail > *:nth-child(6) { animation-delay: 175ms; }
.rail > *:nth-child(7) { animation-delay: 210ms; }
.rail > *:nth-child(8) { animation-delay: 245ms; }
.rail > *:nth-child(n+9) { animation-delay: 260ms; }

.rows > * { animation: rise .38s var(--ease-out) backwards; }
.rows > *:nth-child(2) { animation-delay: 22ms; }
.rows > *:nth-child(3) { animation-delay: 44ms; }
.rows > *:nth-child(4) { animation-delay: 66ms; }
.rows > *:nth-child(5) { animation-delay: 88ms; }
.rows > *:nth-child(6) { animation-delay: 110ms; }
.rows > *:nth-child(7) { animation-delay: 132ms; }
.rows > *:nth-child(8) { animation-delay: 154ms; }
.rows > *:nth-child(9) { animation-delay: 176ms; }
.rows > *:nth-child(10) { animation-delay: 198ms; }
.rows > *:nth-child(n+11) { animation-delay: 210ms; }
.rows.is-filtered > * { animation: none; }

.section { margin: 26px 0 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 16px; margin-bottom: 12px;
}
.section-title { margin: 0; font-size: 18px; font-weight: 720; letter-spacing: -.01em; }
.section-link { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.section-link:active { color: var(--accent); }

.rail {
  display: flex; gap: 12px; overflow-x: auto;
  padding: 2px 16px 6px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.rail > * { scroll-snap-align: start; flex: 0 0 auto; }

/* ============ cards ============ */
.card { width: 148px; text-align: left; display: block; }
.card-art {
  position: relative; width: 148px; height: 148px;
  border-radius: 14px; overflow: hidden; background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.card-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .card:hover .card-art img { transform: scale(1.05); }
}
.card:active .card-art { transform: scale(.97); }
.card-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent 55%);
  opacity: .8;
}
.card.is-round .card-art { border-radius: 50%; }
.card-name {
  margin: 9px 1px 0; font-size: 13.5px; font-weight: 620; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-sub {
  margin: 3px 1px 0; font-size: 11.5px; color: var(--muted); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.play-fab {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  color: #04191d; background: var(--accent);
  box-shadow: 0 6px 18px rgba(0, 211, 229, .45);
  transform: translateY(6px) scale(.9); opacity: 0;
  transition: all .25s var(--ease);
}
.card:hover .play-fab { transform: none; opacity: 1; }
@media (hover: none) { .play-fab { opacity: 1; transform: none; } }

/* hero */
.hero-rail { padding-top: 4px; }
.hero {
  width: min(78vw, 330px); height: 178px;
  border-radius: 20px; overflow: hidden; position: relative;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(4, 10, 14, .92) 8%, rgba(4, 10, 14, .55) 46%, rgba(4, 10, 14, .05) 85%);
}
.hero-body { position: absolute; inset: auto 16px 14px; z-index: 2; }
.hero-kicker { font-size: 10px; letter-spacing: .16em; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.hero-name {
  margin: 6px 0 0; font-size: 17px; font-weight: 740; line-height: 1.25; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-play {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 99px;
  background: var(--accent); color: #04191d; font-size: 12.5px; font-weight: 720;
}

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px; }
.chip {
  flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  transition: background .18s, border-color .18s, transform .16s var(--ease-out);
}
.chip:active { background: var(--surface-2); border-color: rgba(0, 211, 229, .35); transform: scale(.96); }
.chip img { width: 20px; height: 20px; border-radius: 6px; object-fit: cover; }

/* ============ song rows ============ */
.rows { padding: 0 12px; }
.row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 8px 4px; border-radius: 12px; text-align: left;
  transition: background .16s;
}
.row:hover { background: rgba(255, 255, 255, .045); }
.row:active { background: rgba(255, 255, 255, .075); }
.row-art {
  width: 48px; height: 48px; border-radius: 9px; object-fit: cover; flex: 0 0 auto;
  background: var(--surface-2); box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}
.row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.row-name {
  font-size: 14px; font-weight: 600; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-sub {
  margin-top: 2px; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-meta { flex: 0 0 auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 4px; }
.row.is-active .row-name { color: var(--accent); }
.row.is-active .row-art { box-shadow: 0 0 0 2px rgba(0, 211, 229, .55); }
.row-index { width: 18px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }

/* equalizer */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; width: 14px; }
.eq i { width: 2.5px; background: var(--accent); border-radius: 2px; height: 30%; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .18s; }
.eq i:nth-child(3) { animation-delay: .36s; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }

/* ============ search ============ */
.search-bar {
  position: sticky; top: calc(var(--topbar-h) + var(--safe-t)); z-index: 20;
  padding: 6px 16px 10px; background: var(--bg);
}
.search-field {
  display: flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 14px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s, background .2s;
}
.search-field:focus-within { border-color: rgba(0, 211, 229, .5); background: var(--surface-2); }
.search-field svg { color: var(--muted); flex: 0 0 auto; }
.search-field input {
  flex: 1 1 auto; min-width: 0; background: none; border: 0; outline: none;
  font-size: 15px; color: var(--text);
}
.search-field input::placeholder { color: var(--muted); }
.search-field input::-webkit-search-cancel-button,
.search-field input::-webkit-search-decoration { -webkit-appearance: none; display: none; }

/* tìm trong danh sách yêu thích */
.fav-search {
  display: flex; align-items: center; gap: 8px;
  margin: 0 16px 10px; height: 40px; padding: 0 12px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s, background .2s;
}
.fav-search:focus-within { border-color: rgba(0, 211, 229, .45); background: var(--surface-2); }
.fav-search svg { color: var(--muted); flex: 0 0 auto; }
.fav-search input {
  flex: 1 1 auto; min-width: 0; background: none; border: 0; outline: none;
  font-size: 14px; color: var(--text);
}
.fav-search input::placeholder { color: var(--muted); }
.fav-search input::-webkit-search-cancel-button,
.fav-search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search-clear { color: var(--muted); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }

.segmented { display: flex; gap: 6px; padding: 0 16px 12px; overflow-x: auto; }
.seg {
  height: 30px; padding: 0 13px; border-radius: 99px; font-size: 12.5px; font-weight: 620;
  color: var(--muted); background: transparent; border: 1px solid transparent; white-space: nowrap;
  transition: color .2s, background .2s, transform .16s var(--ease-out);
}
.seg:active { transform: scale(.95); }
.seg.is-on { color: #04191d; background: var(--accent); }

.empty { padding: 40px 28px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }

/* ============ detail header ============ */
.detail-top { padding: 6px 16px 0; }
.detail-hero { display: flex; gap: 15px; align-items: flex-end; }
.detail-cover {
  width: 118px; height: 118px; border-radius: 14px; object-fit: cover; flex: 0 0 auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}
.detail-cover.round { border-radius: 50%; }
.detail-kicker { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.detail-title {
  margin: 6px 0 0; font-size: 21px; font-weight: 760; line-height: 1.22; letter-spacing: -.02em;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.detail-sub { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.detail-actions { display: flex; gap: 10px; align-items: center; padding: 18px 16px 8px; }
.btn-primary {
  height: 42px; padding: 0 22px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #04191d; font-weight: 720; font-size: 14px;
  box-shadow: 0 8px 22px rgba(0, 211, 229, .3);
  transition: transform .14s var(--ease), filter .18s;
}
.btn-primary:active { transform: scale(.96); filter: brightness(.94); }
.btn-ghost {
  height: 42px; padding: 0 18px; border-radius: 99px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
  font-weight: 620; font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px;
  transition: background .18s, transform .14s var(--ease-out);
}
.btn-ghost:active { background: rgba(255, 255, 255, .09); transform: scale(.97); }

/* ============ library ============ */
.lib-head { padding: 8px 16px 0; }
.lib-title { font-size: 26px; font-weight: 780; letter-spacing: -.03em; margin: 0; }
.lib-sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.stat-row { display: flex; gap: 10px; padding: 18px 16px 0; }
.stat {
  flex: 1 1 0; padding: 14px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line);
}
.stat b { display: block; font-size: 20px; font-weight: 750; }
.stat span { font-size: 11.5px; color: var(--muted); }

/* profile + login */
.profile {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
}
.profile-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.profile-initial {
  display: grid; place-items: center;
  background: linear-gradient(145deg, #33ecf7, #00b6c6);
  color: #04191d; font-size: 20px; font-weight: 780;
}
.profile-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-info b {
  font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-info span { font-size: 11.5px; color: var(--muted); }
.profile-info span.is-vip { color: var(--accent); font-weight: 650; }
.profile .link-btn { color: var(--muted); }

.login-cta {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 14px; border-radius: 14px;
  background: linear-gradient(120deg, rgba(0, 211, 229, .16), rgba(0, 211, 229, .04));
  border: 1px solid rgba(0, 211, 229, .28);
}
.login-cta-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.login-cta-text b { font-size: 13.5px; font-weight: 680; }
.login-cta-text span { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.login-cta-btn {
  flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 99px;
  background: var(--accent); color: #04191d; font-size: 12.5px; font-weight: 720;
  display: inline-flex; align-items: center;
}

/* login screen */
.login-view { padding: 8px 16px 24px; }
.login-card {
  max-width: 420px; margin: 12px auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 24px 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.login-mark {
  width: 52px; height: 52px; border-radius: 16px; margin-bottom: 16px;
  display: grid; place-items: center; color: #04191d;
  background: linear-gradient(145deg, #33ecf7, #00b6c6);
  box-shadow: 0 8px 24px rgba(0, 211, 229, .3);
}
.login-title { margin: 0; font-size: 24px; font-weight: 780; letter-spacing: -.02em; }
.login-sub { margin: 6px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.login-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 13px;
}
.login-tab {
  flex: 1 1 0; height: 36px; border-radius: 9px;
  font-size: 12.5px; font-weight: 650; color: var(--muted);
  transition: background .2s, color .2s;
}
.login-tab.is-on { background: var(--surface-2); color: var(--text); box-shadow: 0 2px 10px rgba(0, 0, 0, .28); }

.phone-row { display: flex; gap: 8px; }
.phone-row select {
  width: 108px; height: 46px; border-radius: 12px; flex: 0 0 auto;
  border: 1px solid var(--line); background: var(--bg-soft);
  padding: 0 8px; font-size: 12.5px; color: var(--text); outline: none;
}
.phone-row input { flex: 1 1 auto; min-width: 0; }

.otp-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.otp-head {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.otp-hint { margin: 0 0 10px; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.otp-row { display: flex; gap: 8px; }
.otp-row input {
  flex: 1 1 auto; min-width: 0; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-soft);
  padding: 0 14px; font-size: 16px; letter-spacing: .22em; outline: none;
  transition: border-color .2s;
}
.otp-row input:focus { border-color: rgba(0, 211, 229, .55); }
.otp-row .btn-ghost { height: 44px; flex: 0 0 auto; }
.otp-link { display: inline-block; margin-top: 10px; font-size: 11.5px; color: var(--accent); }

.field { display: block; margin-bottom: 12px; }
.field > span:first-child {
  display: block; font-size: 11px; font-weight: 650; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.field input {
  width: 100%; height: 46px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-soft);
  padding: 0 14px; font-size: 15px; outline: none;
  transition: border-color .2s, background .2s;
}
.field input:focus { border-color: rgba(0, 211, 229, .55); background: var(--surface-2); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  height: 34px; padding: 0 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.pw-toggle:active { background: rgba(255, 255, 255, .06); }
.login-submit { width: 100%; height: 46px; justify-content: center; margin-top: 6px; }
.login-submit:disabled { opacity: .6; pointer-events: none; }
.login-error { margin: 0 0 10px; color: var(--danger); font-size: 12.5px; line-height: 1.5; }
.login-note { margin: 14px 0 0; font-size: 11px; color: var(--muted); line-height: 1.55; }
.login-back { display: inline-block; margin-top: 14px; font-size: 12.5px; color: var(--accent); }

/* ============ tabbar ============ */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 31;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: flex; align-items: stretch;
  background: rgba(9, 14, 18, .86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 620; letter-spacing: .01em;
  transition: color .2s;
}
.tab svg { transition: transform .22s var(--ease); }
.tab.is-active { color: var(--accent); }
.tab.is-active svg { transform: translateY(-1px) scale(1.06); }
.tab:active svg { transform: scale(.9); }

/* ============ mini player ============ */
.mini {
  position: fixed; z-index: 32;
  left: 8px; right: 8px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 7px);
  height: var(--mini-h);
  border-radius: 14px;
  display: flex; align-items: center;
  background: rgba(22, 34, 43, .92);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  animation: mini-in .34s var(--ease-out);
}
@keyframes mini-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.mini[hidden] { display: none; }
.mini-progress { position: absolute; inset: auto 0 0; height: 2px; background: rgba(255, 255, 255, .08); }
.mini-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s linear; }
.mini-body { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 4px 0 8px; height: 100%; text-align: left; }
.mini-art { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: var(--surface-2); }
.mini-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mini-title { font-size: 13px; font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-artist { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-actions { display: flex; align-items: center; padding-right: 4px; }

/* ============ now playing sheet ============ */
.sheet {
  position: fixed; inset: 0; z-index: 60;
  transform: translateY(100%);
  transition: transform .46s var(--ease-drawer);
  background: #080d11;
  visibility: hidden;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sheet.is-open { transform: none; visibility: visible; }

/* nội dung sheet vào nhẹ, lệch nhịp một chút */
@keyframes sheet-item { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.sheet.is-open .sheet-cover-wrap { animation: sheet-item .5s var(--ease-out) backwards; }
.sheet.is-open .sheet-info { animation: sheet-item .46s var(--ease-out) 40ms backwards; }
.sheet.is-open .seek { animation: sheet-item .44s var(--ease-out) 70ms backwards; }
.sheet.is-open .controls { animation: sheet-item .44s var(--ease-out) 100ms backwards; }
.sheet.is-open .sheet-tools { animation: sheet-item .42s var(--ease-out) 130ms backwards; }
.sheet-bg {
  position: absolute; inset: -20% -20% auto;
  height: 95%;
  background-size: cover; background-position: center;
  filter: blur(48px) saturate(160%);
  transform: scale(1.15);
  opacity: .5;
  transition: background-image .4s;
}
.sheet-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(8, 13, 17, .35), #080d11 78%);
}
.sheet-inner {
  position: relative; z-index: 1;
  flex: 1 1 auto; display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 6px) 22px calc(var(--safe-b) + 18px);
  overflow-y: auto; overscroll-behavior: contain;
}
.sheet-head { display: flex; align-items: center; gap: 8px; }
.sheet-head-meta { flex: 1 1 auto; min-width: 0; text-align: center; }
.sheet-context { display: block; font-size: 10px; letter-spacing: .18em; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.sheet-source { display: block; font-size: 11.5px; color: var(--text); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .8; }

.sheet-cover-wrap { margin: clamp(14px, 4vh, 34px) auto 0; width: 100%; max-width: 340px; }
.sheet-cover {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, .65);
  background: var(--surface-2);
  transition: transform .4s var(--ease);
}
.sheet.is-paused .sheet-cover { transform: scale(.94); }

.sheet-info { display: flex; align-items: center; gap: 12px; margin-top: clamp(16px, 3vh, 26px); }
.sheet-info-text { flex: 1 1 auto; min-width: 0; }
.sheet-title { margin: 0; font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.3; }
.sheet-artist { margin: 5px 0 0; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.like-btn { color: var(--muted); flex: 0 0 auto; }
.like-btn svg path { transition: fill .2s ease, stroke .2s ease; }
.like-btn.is-on { color: var(--accent); }
.like-btn.is-on svg path { fill: var(--accent); stroke: var(--accent); }

.seek { margin-top: 18px; }
.seek input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0;
}
.seek input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 99px;
  background: linear-gradient(to right, var(--accent) var(--p, 0%), rgba(255, 255, 255, .16) var(--p, 0%));
}
.seek input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; margin-top: -5px; box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
  transition: transform .15s;
}
.seek input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.25); }
.seek input[type="range"]::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .16); }
.seek input[type="range"]::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--accent); }
.seek input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.seek-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }

.controls { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.ctrl { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--text); transition: transform .13s var(--ease), color .2s; }
.ctrl:active { transform: scale(.88); }
.ctrl.is-on { color: var(--accent); }
.ctrl-play {
  width: 64px; height: 64px; border-radius: 50%;
  background: #fff; color: #071014;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
}
.ctrl-play:active { transform: scale(.94); }
.ctrl-side { color: #dfe9ed; }
.ctrl.is-busy { opacity: .5; pointer-events: none; }

.sheet-tools { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.pill {
  height: 32px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05);
  font-size: 12px; font-weight: 620; color: var(--muted);
  transition: color .2s, border-color .2s, background .2s, transform .15s var(--ease-out);
}
.pill:active { transform: scale(.95); }
.pill.is-on { color: var(--accent); border-color: rgba(0, 211, 229, .45); background: var(--accent-soft); }

.sheet-panel { margin-top: 20px; animation: panel-in .3s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px); } }
.lyrics {
  max-height: 40vh; overflow-y: auto;
  padding: 16px 4px 24px; text-align: center;
  font-size: 15.5px; line-height: 1.95; color: #c9d8de;
  white-space: pre-wrap;
}
.queue-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px; font-size: 12px; color: var(--muted); font-weight: 620; }
.link-btn { color: var(--accent); font-size: 12px; font-weight: 650; }
.queue { max-height: 44vh; overflow-y: auto; }
.queue .row-art { width: 40px; height: 40px; }
.queue .row { padding: 6px 4px; }

/* ============ toast ============ */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--safe-b) + 26px);
  transform: translate(-50%, 16px); z-index: 80;
  background: rgba(24, 36, 44, .96);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--text); font-size: 12.5px; font-weight: 560;
  padding: 10px 16px; border-radius: 99px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none;
  transition: all .28s var(--ease);
  max-width: min(84vw, 420px); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ============ skeleton ============ */
.sk { position: relative; overflow: hidden; background: var(--surface); border-radius: 10px; }
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .055) 45%, transparent 70%);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sk-card { width: 148px; }
.sk-card .sk-art { width: 148px; height: 148px; border-radius: 14px; }
.sk-card .sk-line { height: 11px; margin: 11px 2px 0; border-radius: 5px; }
.sk-card .sk-line.short { width: 62%; }

/* ============ splash ============ */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .45s var(--ease), visibility .45s;
}
.splash.is-done { opacity: 0; visibility: hidden; }
.splash-logo {
  width: 64px; height: 64px; border-radius: 20px;
  display: grid; place-items: center; color: #04191d;
  background: linear-gradient(145deg, #33ecf7, #00b6c6);
  box-shadow: 0 12px 40px rgba(0, 211, 229, .35);
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.06); } }

/* ============ desktop ============ */
@media (min-width: 760px) {
  .main { max-width: 1080px; margin: 0 auto; padding-left: 8px; padding-right: 8px; }
  .topbar { padding-left: max(18px, calc((100vw - 1080px) / 2 + 18px)); padding-right: max(18px, calc((100vw - 1080px) / 2 + 18px)); }
  .rail, .section-head, .detail-top, .detail-actions, .lib-head, .search-bar, .stat-row { padding-left: 20px; padding-right: 20px; }
  .fav-search { margin-left: 20px; margin-right: 20px; }
  .rows { padding: 0 16px; }
  .sheet-inner { max-width: 460px; margin: 0 auto; width: 100%; }
  .sheet-cover-wrap { max-width: 320px; }
  .tabbar { max-width: 560px; margin: 0 auto; border-radius: 20px 20px 0 0; border: 1px solid var(--line); border-bottom: 0; }
  .mini { max-width: 560px; left: 50%; right: auto; transform: translateX(-50%); width: 100%; }
  .toast { bottom: 120px; }
  .hero { width: 330px; }
}

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