/* =====================================================================
   LaiMusic v2.2.0 — Design System (Spotify-inspired, bản sắc LaiMusic)
   Dark mode mặc định · font Inter · icon Lucide · spacing 4/8/12/16/24/32
   CHỈ là lớp trình bày: không đổi id/class mà JavaScript sử dụng.
   ===================================================================== */
:root {
  /* Bề mặt */
  --bg:          #121212;   /* nền nội dung chính */
  --bg-side:     #090909;   /* sidebar + nền ứng dụng */
  --bg-2:        #181818;   /* ô nhập, vùng lõm */
  --panel:       #1e1e1e;   /* thẻ */
  --panel-2:     #282828;   /* bề mặt nổi (menu, modal) */
  --hover:       #333333;
  --row-hover:   rgba(255,255,255,.07);
  --line:        #333333;
  --line-soft:   rgba(255,255,255,.08);
  /* Chữ */
  --text:        #ffffff;
  --muted:       #a7a7a7;
  --muted-2:     #7c7c7c;
  /* Màu nhận diện LaiMusic */
  --accent:      #22c7a9;
  --accent-hi:   #3ad8bb;
  --accent-ink:  #04140f;
  --accent-soft: rgba(34,199,169,.14);
  --danger:      #f15e6c;
  --danger-soft: rgba(241,94,108,.14);
  --warn:        #f2b64c;
  --warn-soft:   rgba(242,182,76,.12);
  --pro:         #22c7a9;
  --max:         #f2b64c;
  /* Giữ biến cũ cho các khối có tham chiếu */
  --accent-2:    var(--accent);
  --grad:        var(--accent);
  /* Hình khối */
  --radius:      8px;
  --radius-sm:   6px;
  --radius-lg:   12px;
  --shadow:      0 8px 24px rgba(0,0,0,.5);
  --shadow-sm:   0 4px 12px rgba(0,0,0,.35);
  --sidebar-w:   280px;
  --pbar-h:      80px;
  --nav-h:       0px;
  --safe-b:      env(safe-area-inset-bottom, 0px);
  --topbar-bg:   rgba(18,18,18,.92);
  --player-bg:   #000000;
  --t-fast:      .15s;
  --t-card:      .18s;
  --ease:        cubic-bezier(.3,0,.2,1);
  color-scheme: dark;
}

/* ---------- Giao diện sáng (tuỳ chọn có sẵn trong menu tài khoản) ---------- */
:root[data-theme="light"] {
  --bg:          #ffffff;
  --bg-side:     #f3f4f6;
  --bg-2:        #f5f6f8;
  --panel:       #f3f4f6;
  --panel-2:     #ffffff;
  --hover:       #e7e9ec;
  --row-hover:   rgba(0,0,0,.05);
  --line:        #dfe2e6;
  --line-soft:   rgba(0,0,0,.07);
  --text:        #121212;
  --muted:       #5b6169;
  --muted-2:     #858b93;
  --accent:      #0f9e86;
  --accent-hi:   #0c8a75;
  --accent-ink:  #ffffff;
  --accent-soft: rgba(15,158,134,.12);
  --danger:      #d93848;
  --danger-soft: rgba(217,56,72,.1);
  --warn:        #b7790f;
  --warn-soft:   rgba(183,121,15,.1);
  --shadow:      0 8px 24px rgba(20,24,30,.14);
  --shadow-sm:   0 4px 12px rgba(20,24,30,.1);
  --topbar-bg:   rgba(255,255,255,.92);
  --player-bg:   #ffffff;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-side);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; font-weight: 500; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.02em; }
.hidden { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

/* Icon Lucide */
.lc { display: block; flex: none; }
.lc-fill { fill: currentColor; }
.btn .lc, .drop-link .lc, .tab .lc, .np-tab .lc, .back-link .lc { display: inline-block; vertical-align: -3px; }

/* Thanh cuộn mảnh */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
:root[data-theme="light"] * { scrollbar-color: rgba(0,0,0,.25) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,.3); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; gap: 24px;
  align-items: center; justify-content: center;
  background: var(--bg-side);
}
.boot-img { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--shadow); }
.brand-img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex: none; }
.brand-word { color: var(--text); }
.auth-logo { display: block; width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 16px; box-shadow: var(--shadow-sm); }
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   KHUNG ỨNG DỤNG (desktop ≥ 1024px)
   ===================================================================== */
.app {
  min-height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 8px; padding: 8px 8px 0;
  background: var(--bg-side);
}
.main-col {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  min-height: calc(100vh - 8px);
  padding-bottom: calc(var(--pbar-h) + var(--nav-h) + var(--safe-b) + 8px);
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 8px;
  height: calc(100vh - var(--pbar-h) - 16px);
  min-height: 0;
}
.side-card { background: var(--bg); border-radius: var(--radius); }
.side-top { padding: 16px 12px 8px; flex: none; }
.side-lib { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 8px 12px; overflow: hidden; }
.brand {
  font-size: 19px; font-weight: 800; letter-spacing: -.03em;
  display: flex; align-items: center; gap: 10px; padding: 0 12px 16px;
}
.nav { display: flex; flex-direction: column; gap: 2px; flex: none; }
.nav a {
  display: flex; align-items: center; gap: 16px;
  min-height: 44px; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 700; font-size: 15px;
  transition: color var(--t-fast), background var(--t-fast);
}
.nav a .ni { width: 24px; display: grid; place-items: center; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); background: var(--row-hover); }
.nav a.active .ni { color: var(--accent); }

/* Mục "Đã ghim" — thư viện nhanh */
.side-pins { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 0 4px; }
.side-pins-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--muted);
  padding: 4px 8px 12px; position: sticky; top: 0; background: var(--bg); z-index: 1;
}
.side-pins-t { display: inline-flex; align-items: center; gap: 12px; }
.side-pins-count {
  font-size: 11px; font-weight: 700; color: var(--text);
  background: var(--panel-2); border-radius: 999px; padding: 2px 8px;
}
.side-pins-empty {
  margin: 4px 4px 8px; padding: 16px; border-radius: var(--radius);
  background: var(--panel); font-size: 13px; color: var(--muted); line-height: 1.55; font-weight: 500;
}
.side-pins-list { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; }
.side-pin {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 8px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--t-fast);
}
.side-pin:hover { background: var(--row-hover); }
.side-pin-thumb {
  width: 44px; height: 44px; border-radius: 4px; flex: none; overflow: hidden;
  display: grid; place-items: center; color: var(--muted); background: var(--panel-2);
}
.side-pin-thumb.pl { border-radius: 4px; }
.side-pin-thumb.img { background: #000; }
.side-pin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-pin-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; padding-right: 24px; }
.side-pin-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-pin-sub { font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-pin-x {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
  background: transparent; color: var(--muted); padding: 0;
  display: grid; place-items: center; opacity: 0;
  transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.side-pin:hover .side-pin-x, .side-pin-x:focus-visible { opacity: 1; }
.side-pin-x:hover { background: var(--hover); color: var(--text); }
@media (hover: none) { .side-pin-x { opacity: 1; } }

.sidebar-foot { flex: none; padding: 12px 8px 0; border-top: 1px solid var(--line-soft); margin-top: 8px; }
.side-legal { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 4px 8px; }
.side-legal a, .legal-links a { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.side-legal a:hover, .legal-links a:hover { color: var(--text); text-decoration: underline; }
.side-version { font-size: 11.5px; color: var(--muted-2); padding: 0 4px 8px; font-weight: 500; }
.side-version b { color: var(--muted); font-weight: 600; }
.btn-logout { justify-content: flex-start; color: var(--muted); }
.btn-logout:hover { color: var(--text); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 12px 24px;
  position: sticky; top: 0; z-index: 10;
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-radius: var(--radius) var(--radius) 0 0;
}
.topbar-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-logo { width: 28px; height: 28px; border-radius: 7px; }
.topbar-spacer { flex: 1; }

/* Thẻ người dùng */
.user-menu { position: relative; flex: none; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.55); border: none; cursor: pointer;
  padding: 4px 12px 4px 4px; min-height: 40px; border-radius: 999px;
  color: var(--text); text-align: left;
  transition: background var(--t-fast), transform var(--t-fast);
}
:root[data-theme="light"] .user-chip { background: var(--panel); }
.user-chip:hover, .user-chip.open { background: var(--panel-2); }
.chip-ava { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.chip-ava-fb { display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--accent-ink); background: var(--accent); }
.chip-info { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; gap: 2px; }
.chip-name { color: var(--text); font-size: 13px; font-weight: 600; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-plan {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); display: inline-block; width: fit-content;
}
.chip-plan.pro { color: var(--pro); }
.chip-plan.max { color: var(--max); }
.chip-caret { color: var(--muted); transition: transform var(--t-card) var(--ease); display: grid; }
.user-chip.open .chip-caret { transform: rotate(180deg); }

.user-drop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 280px; z-index: 30;
  background: var(--panel-2); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; padding: 4px;
  animation: dropIn .16s var(--ease);
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.drop-head { display: flex; align-items: center; gap: 12px; padding: 12px; }
.drop-ava { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.drop-ava-fb { display: grid; place-items: center; font-size: 18px; font-weight: 700; color: var(--accent-ink); background: var(--accent); }
.drop-head-txt { min-width: 0; }
.drop-head-txt b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-head-txt span { font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.drop-plan { padding: 0 12px 12px; border-bottom: 1px solid var(--line-soft); }
.drop-links { padding: 4px 0; display: flex; flex-direction: column; }
.drop-link {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: none;
  color: var(--text); font-family: inherit; font-size: 14px; font-weight: 500;
  min-height: 44px; padding: 8px 12px; border-radius: 4px; cursor: pointer; transition: background var(--t-fast);
}
.drop-link .lc { color: var(--muted); }
.drop-link:hover { background: var(--hover); }
.drop-logout { color: var(--text); border-top: 1px solid var(--line-soft); border-radius: 0 0 4px 4px; margin-top: 4px; }
.drop-theme { padding: 12px; border-bottom: 1px solid var(--line-soft); }
.drop-theme-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.theme-switch { display: flex; background: var(--bg-2); border-radius: 999px; padding: 4px; gap: 4px; }
.theme-opt {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; border-radius: 999px; border: none; background: none;
  color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.theme-opt .lc { display: inline-block; }
.theme-opt:hover { color: var(--text); }
.theme-opt.active { background: var(--text); color: var(--bg); }
.drop-version { padding: 8px 12px; font-size: 11px; color: var(--muted-2); text-align: center; }

/* Nhãn gói Free / Pro / Max */
.plan-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); letter-spacing: .01em; white-space: nowrap;
}
.plan-pill.pro { color: var(--pro); border-color: rgba(34,199,169,.45); background: var(--accent-soft); }
.plan-pill.max { color: var(--max); border-color: rgba(242,182,76,.45); background: var(--warn-soft); }

/* ---------- Vùng nội dung ---------- */
.view { padding: 8px 24px 40px; max-width: 1280px; width: 100%; animation: viewIn .2s var(--ease); }
.view.view-full { max-width: none; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }
.page-head { margin: 8px 0 24px; }
.page-head h1 { margin: 0 0 4px; font-size: 32px; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.page-head p a { color: var(--text); }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; transition: color var(--t-fast); }
.back-link:hover { color: var(--text); }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 20px; border-radius: 999px;
  border: 1px solid #727272; background: transparent; color: var(--text);
  font-weight: 700; font-size: 14px; line-height: 1.2; cursor: pointer; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast), background var(--t-fast), color var(--t-fast), filter var(--t-fast);
}
:root[data-theme="light"] .btn { border-color: #9aa0a6; }
.btn:hover { border-color: var(--text); transform: scale(1.03); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hi); border-color: transparent; }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: transparent; background: var(--row-hover); }
.btn-danger { border-color: rgba(241,94,108,.55); color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn-block { width: 100%; }
.btn-sm { min-height: 32px; padding: 6px 14px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 12px 32px; font-size: 16px; }
.btn-upgrade { background: var(--text); color: var(--bg) !important; border-color: transparent; }
.btn-upgrade:hover { border-color: transparent; }
.icon-btn {
  background: transparent; border: none; color: var(--muted);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; padding: 0;
  display: inline-grid; place-items: center; flex: none;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover { color: var(--text); background: var(--row-hover); }
.icon-btn:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .35; cursor: default; transform: none; }
.icon-btn.pinned { color: var(--accent); }
.icon-btn.pinned .lc { fill: currentColor; }
.icon-btn.pinned:hover { color: var(--accent-hi); }

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text); margin-bottom: 8px; font-weight: 600; }
.input, .select {
  width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 500; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: var(--muted-2); }
.input:hover, .select:hover { border-color: #5a5a5a; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { opacity: .6; }
textarea.input { min-height: 120px; }

/* ---------- Thẻ / panel ---------- */
.panel { background: var(--panel); border-radius: var(--radius); padding: 24px; }
.panel + .panel { margin-top: 16px; }
.panel h3 { font-weight: 700; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; }
.stat { background: var(--panel); border-radius: var(--radius); padding: 16px 20px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 28px; font-weight: 800; margin-top: 4px; letter-spacing: -.03em; }

/* Ảnh bìa mặc định của LaiMusic: nền tối trung tính + icon Lucide */
.art-fallback {
  background: linear-gradient(145deg, #2a2a2a, #1a1a1a) !important;
  color: #8a8a8a; display: grid; place-items: center;
}
:root[data-theme="light"] .art-fallback { background: linear-gradient(145deg, #e8eaed, #d9dce0) !important; color: #80868d; }

/* =====================================================================
   TRANG CHỦ
   ===================================================================== */
.dash-hero { margin: 8px 0 24px; }
.dash-hero-in { position: relative; }
.dash-greet { font-size: 14px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.dash-hero-in h1 { margin: 0 0 16px; font-size: 32px; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; overflow-wrap: anywhere; }
.dash-hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dash-hero-actions .plan-pill { margin-left: auto; }
.btn-play { padding-left: 16px; }

/* Tổng quan tài khoản (LM-03) — thay hàng lối tắt trùng sidebar */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card {
  background: var(--panel); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 124px;
}
.stat-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-ic { width: 32px; height: 32px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-val small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stat-val .plan-pill { font-size: 13px; }
.stat-na { font-size: 15px; font-weight: 600; color: var(--muted); }
.stat-note { font-size: 12.5px; color: var(--muted); font-weight: 500; line-height: 1.45; }
.stat-note.warn { color: var(--warn); }
.stat-bar { margin-top: auto; }
.stat-card.warn .quota-fill { background: var(--warn); }
.stat-card.is-loading { justify-content: center; }
.sk { border-radius: 6px; background: var(--line-soft); animation: sk-pulse 1.2s ease-in-out infinite; }
.sk-a { height: 14px; width: 45%; } .sk-b { height: 22px; width: 65%; } .sk-c { height: 6px; width: 100%; border-radius: 999px; }
@keyframes sk-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.dash-stats-err {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px;
  background: var(--panel); border-radius: var(--radius); border-left: 3px solid var(--warn); color: var(--text); font-size: 14px;
}
.dash-stats-err > svg { color: var(--warn); flex: none; }
.dash-stats-err .btn { margin-left: auto; }

/* Quản lý tài khoản tập trung (LM-01) */
.lai-acc-panel { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; border-left: 3px solid var(--accent); }
.lai-acc { display: flex; align-items: flex-start; gap: 14px; flex: 1 1 320px; min-width: 0; }
.lai-acc-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.lai-acc-txt h3 { margin: 0 0 6px; font-size: 16px; }
.lai-acc-txt p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.lai-acc-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; }

.dash-sec { margin-bottom: 32px; }
.dash-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dash-sec-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.025em; }
.dash-more { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.dash-more:hover { color: var(--text); text-decoration: underline; }

/* Thẻ bài hát / playlist */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; margin: 0 -12px; }
.mcard {
  position: relative; cursor: pointer; border-radius: var(--radius); padding: 12px;
  background: transparent; transition: background var(--t-card) var(--ease);
}
.mcard:hover, .mcard:focus-within { background: var(--row-hover); }
.mcard-cover {
  position: relative; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden;
  margin-bottom: 12px; display: grid; place-items: center; background: var(--panel-2);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
:root[data-theme="light"] .mcard-cover { box-shadow: var(--shadow-sm); }
.mcard-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcard-play {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; border: none; cursor: pointer;
  opacity: 0; transform: translateY(8px); transition: opacity var(--t-card) var(--ease), transform var(--t-card) var(--ease), background var(--t-fast);
  box-shadow: 0 8px 16px rgba(0,0,0,.35);
  pointer-events: none;
}
.mcard:hover .mcard-play, .mcard:focus-within .mcard-play { opacity: 1; transform: none; pointer-events: auto; }
.mcard-play:hover { background: var(--accent-hi); transform: scale(1.05) !important; }
.mcard-pin {
  position: absolute; right: 20px; top: 20px; z-index: 3;
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer; padding: 0;
  background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center;
  opacity: 0; transition: opacity var(--t-card), background var(--t-fast), color var(--t-fast);
}
.mcard:hover .mcard-pin, .mcard-pin:focus-visible { opacity: 1; }
.mcard-pin:hover { background: rgba(0,0,0,.82); }
.mcard-pin.pinned { opacity: 1; color: var(--accent); }
.mcard-pin.pinned .lc { fill: currentColor; }
.mcard-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard-sub { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
@media (hover: none) { .mcard-pin { opacity: 1; } .mcard-play { opacity: 1; transform: none; pointer-events: auto; width: 40px; height: 40px; } }

.dash-empty {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--panel); border-radius: var(--radius); padding: 24px;
}
.dash-empty .em { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--accent); flex: none; }
.dash-empty b { font-size: 16px; }
.dash-empty span { color: var(--muted); font-size: 14px; }
.dash-empty .btn { margin-left: auto; }
.dash-hint { color: var(--muted); font-size: 14px; }
.dash-hint a { color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* =====================================================================
   ĐĂNG NHẬP / ĐĂNG KÝ
   ===================================================================== */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 16px;
  background: linear-gradient(180deg, #1f1f1f 0%, #090909 60%);
}
:root[data-theme="light"] .auth-wrap { background: linear-gradient(180deg, #eef0f2 0%, #ffffff 60%); }
.auth-card {
  width: 100%; max-width: 420px; background: var(--bg);
  border-radius: var(--radius-lg); padding: 32px;
  box-shadow: var(--shadow);
}
.auth-card .brand { justify-content: center; padding: 0 0 8px; font-size: 24px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--text); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; gap: 4px; }
.auth-switch a .lc { display: inline-block; }
.form-err {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--danger-soft); color: #ffb8c0;
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; margin-bottom: 12px;
  border-left: 3px solid var(--danger);
}
:root[data-theme="light"] .form-err { color: #a3202f; }
.form-ok {
  background: var(--accent-soft); color: #9cf0de; border-left: 3px solid var(--accent);
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; margin-bottom: 12px;
}
:root[data-theme="light"] .form-ok { color: #0b6e5d; }

/* =====================================================================
   DANH SÁCH BÀI HÁT (Thư viện, Playlist)
   ===================================================================== */
.song-list { display: flex; flex-direction: column; gap: 0; }
.song {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 12px; border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.song:hover, .song:focus-within, .song.menu-open { background: var(--row-hover); }
.song.playing .song-title { color: var(--accent); }
.song-thumb {
  width: 40px; height: 40px; border-radius: 4px; flex: none; overflow: hidden;
  display: grid; place-items: center; color: var(--muted); background: var(--panel-2);
}
.song-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.song-thumb.yt { background: #000; }
.song-meta { min-width: 0; flex: 1; }
.song-title { font-weight: 600; font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-sub { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.song-flag { display: inline-flex; vertical-align: -2px; color: var(--accent); }
.song-flag .lc { display: inline-block; }
.song-dur { font-size: 13px; font-weight: 500; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }
.song-actions { display: flex; align-items: center; gap: 4px; flex: none; }

/* Ảnh + nút phát chồng lên ảnh */
.song-art { position: relative; flex: none; width: 40px; height: 40px; }
.song-play {
  position: absolute; inset: 0; border: none; border-radius: 4px; cursor: pointer; padding: 0;
  display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.55);
  opacity: 0; transition: opacity var(--t-fast);
}
.song:hover .song-play, .song-play:focus-visible { opacity: 1; }
@media (hover: none) { .song-play { background: transparent; } }

/* Bảng thư viện: cột #, Tiêu đề, thời lượng, thao tác */
.song-list-lib { counter-reset: songidx; }
.song-list-lib .song { display: grid; grid-template-columns: 24px 40px minmax(0, 1fr) 56px auto; gap: 12px; padding: 8px 12px; }
.song-list-lib .song::before {
  counter-increment: songidx; content: counter(songidx);
  color: var(--muted); font-size: 14px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums;
}
.song-list-head {
  display: grid; grid-template-columns: 24px 40px minmax(0, 1fr) 56px 88px; gap: 12px; align-items: center;
  padding: 0 12px 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line-soft);
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  position: sticky; top: 64px; background: var(--bg); z-index: 2;
}
.song-list-head span:nth-child(1) { text-align: right; }
.song-list-head span:nth-child(2) { grid-column: 2 / 4; }
.song-list-head span:nth-child(3) { display: flex; justify-content: flex-end; }
.modal-list .song { cursor: pointer; }

/* Thao tác hiện khi rê chuột (desktop) */
.act-hover { opacity: 0; }
.song:hover .act-hover, .song:focus-within .act-hover { opacity: 1; }
@media (hover: none) { .act-hover { opacity: 1; } }
.act-pin:not(.pinned) { opacity: 0; }
.song:hover .act-pin, .song:focus-within .act-pin, .song.menu-open .act-pin { opacity: 1; }
@media (hover: none) { .act-pin:not(.pinned) { opacity: 1; } }

/* ---------- Menu "⋯" (dropdown desktop / bottom sheet mobile) ---------- */
.more { position: relative; }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 40;
  min-width: 232px; padding: 4px; border-radius: var(--radius-sm);
  background: var(--panel-2); box-shadow: 0 16px 24px rgba(0,0,0,.3), 0 6px 8px rgba(0,0,0,.2);
  display: none;
}
.more.open .more-menu { display: block; animation: dropIn .15s var(--ease); }
.more.up .more-menu { top: auto; bottom: calc(100% + 4px); }
.more-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 40px; padding: 8px 12px; border: none; border-radius: 2px; background: none;
  color: var(--text); font-family: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background var(--t-fast);
}
.more-item:hover, .more-item:focus-visible { background: var(--hover); outline: none; }
.more-ic { color: var(--muted); display: grid; }
.more-item[data-danger] { color: var(--danger); }
.more-item[data-danger] .more-ic { color: var(--danger); }
.more-sep { height: 1px; background: var(--line-soft); margin: 4px 0; }
.more.open .more-btn { color: var(--text); background: var(--row-hover); }
.sheet-scrim { display: none; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 6px 14px; border-radius: 999px; border: none;
  background: rgba(255,255,255,.07); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: background var(--t-fast);
}
.tab:hover { background: rgba(255,255,255,.14); }
.tab.active { background: var(--text); color: var(--bg); }

/* ---------- Bảng (quản trị) ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--panel); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--row-hover); }
table.tbl td .btn + .btn { margin-left: 8px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.badge.pro { background: var(--accent-soft); color: var(--pro); }
.badge.max { background: var(--warn-soft); color: var(--max); }
.badge.admin { background: rgba(255,255,255,.1); color: var(--text); }

/* ---------- Trạng thái rỗng ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .em {
  width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; background: var(--panel); color: var(--muted);
}

/* =====================================================================
   THANH PHÁT NHẠC (desktop: 3 vùng)
   ===================================================================== */
.player-bar {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--pbar-h) + var(--safe-b));
  padding: 0 16px var(--safe-b);
  background: var(--player-bg);
  display: grid; grid-template-columns: minmax(180px, 30%) minmax(0, 40%) minmax(180px, 30%);
  align-items: center; gap: 8px; z-index: 20;
}
:root[data-theme="light"] .player-bar { border-top: 1px solid var(--line); }
.pb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-cover {
  width: 56px; height: 56px; border-radius: 4px; overflow: hidden; flex: none;
  background: var(--panel-2); box-shadow: var(--shadow-sm);
}
.pb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-cover .art-fallback { width: 100%; height: 100%; }
.pb-info { min-width: 0; }
.pb-info.clickable { cursor: pointer; }
.pb-info.clickable:hover .pb-title { text-decoration: underline; }
.pb-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-artist { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.pb-center { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; max-width: 722px; width: 100%; justify-self: center; }
.pb-controls { display: flex; align-items: center; gap: 8px; }
.pb-controls .icon-btn { width: 36px; height: 36px; color: var(--muted); }
.pb-controls .icon-btn:hover { color: var(--text); background: transparent; transform: scale(1.06); }
.pb-play, .pb-controls .pb-play {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--text); color: var(--bg);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast);
}
.pb-play:hover, .pb-controls .pb-play:hover { background: var(--text); color: var(--bg); transform: scale(1.06); }
.pb-play:active { transform: scale(.96) !important; }
.pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.pb-right .icon-btn { width: 36px; height: 36px; color: var(--muted); }
.pb-right .icon-btn:hover { color: var(--text); }

/* Trạng thái chưa chọn bài */
.player-bar.is-empty .pb-center, .player-bar.is-empty .pb-vol { opacity: .45; }
.player-bar.is-empty .pb-title { color: var(--muted); font-weight: 500; }
.player-bar [disabled] { cursor: default; }

/* Nút lặp lại */
.pb-loop { position: relative; }
.pb-loop.active, .pb-controls .pb-loop.active { color: var(--accent); }
.pb-loop.active::before {
  content: ""; position: absolute; bottom: 2px; left: 50%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: currentColor;
}
.pb-loop.one::after {
  content: "1"; position: absolute; right: 4px; top: 4px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font-size: 9px; font-weight: 800; line-height: 13px; text-align: center;
}

/* Thanh tiến trình + âm lượng */
.pb-progress { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.pb-time { font-size: 11.5px; font-weight: 500; color: var(--muted); min-width: 36px; text-align: center; flex: none; font-variant-numeric: tabular-nums; }
.pb-seek, .pb-volume {
  --pct: 0%;
  -webkit-appearance: none; appearance: none; height: 16px; margin: 0; padding: 0;
  background: transparent; outline: none; cursor: pointer;
}
.pb-seek { flex: 1; min-width: 0; }
.pb-seek::-webkit-slider-runnable-track, .pb-volume::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(to right, var(--text) 0 var(--pct), #4d4d4d var(--pct) 100%);
}
:root[data-theme="light"] .pb-seek::-webkit-slider-runnable-track, :root[data-theme="light"] .pb-volume::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--text) 0 var(--pct), #c9cdd2 var(--pct) 100%);
}
.pb-seek:hover::-webkit-slider-runnable-track, .pb-volume:hover::-webkit-slider-runnable-track,
.pb-seek:focus-visible::-webkit-slider-runnable-track {
  background: linear-gradient(to right, var(--accent) 0 var(--pct), #4d4d4d var(--pct) 100%);
}
.pb-seek::-webkit-slider-thumb, .pb-volume::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%;
  background: var(--text); border: none; opacity: 0; transition: opacity var(--t-fast);
  box-shadow: 0 2px 4px rgba(0,0,0,.5);
}
.pb-seek:hover::-webkit-slider-thumb, .pb-volume:hover::-webkit-slider-thumb,
.pb-seek:focus-visible::-webkit-slider-thumb, .pb-volume:focus-visible::-webkit-slider-thumb,
.pb-seek:active::-webkit-slider-thumb { opacity: 1; }
.pb-seek::-moz-range-track, .pb-volume::-moz-range-track { height: 4px; border-radius: 999px; background: #4d4d4d; }
.pb-seek::-moz-range-progress, .pb-volume::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--text); }
.pb-seek:hover::-moz-range-progress, .pb-volume:hover::-moz-range-progress { background: var(--accent); }
.pb-seek::-moz-range-thumb, .pb-volume::-moz-range-thumb { width: 12px; height: 12px; border: none; border-radius: 50%; background: var(--text); }
.pb-seek:disabled { cursor: default; }
.pb-vol { display: flex; align-items: center; gap: 6px; padding: 0 4px; }
.pb-vol-ico { color: var(--muted); display: grid; width: 32px; place-items: center; }
.pb-volume { width: 96px; }

/* Nút hàng đợi + số bài */
.pb-queue { position: relative; }
.pb-qcount {
  position: absolute; right: 0; top: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
}
#pb-sleep.active, .np-sleep.active { color: var(--accent); }

/* YouTube host: giữ trong DOM để phát nhưng đẩy khuất tầm nhìn */
.yt-host { position: fixed; width: 1px; height: 1px; left: -9999px; top: -9999px; overflow: hidden; }

/* Điều hướng dưới cùng: chỉ dùng trên màn hình < 1024px */
.bottom-nav { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--pbar-h) + var(--nav-h) + var(--safe-b) + 16px);
  transform: translateX(-50%) translateY(12px);
  background: var(--text); color: var(--bg);
  padding: 12px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  z-index: 60; max-width: min(92vw, 480px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok  { background: var(--text); color: var(--bg); }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: grid; place-items: center; z-index: 70; padding: 16px;
  animation: fadeIn .2s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--panel-2); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow);
  animation: modalIn .24s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
.modal p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.modal .input, .modal .select { background: var(--bg-2); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.modal-list { max-height: 340px; overflow-y: auto; margin: 4px -12px 8px; }
.modal-list .song-actions .btn { pointer-events: none; }

.legal { font-size: 12.5px; color: var(--muted); line-height: 1.55; font-weight: 500; }
.legal a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* =====================================================================
   Trang thêm nhạc — vùng chọn file + tiến trình upload
   ===================================================================== */
.upl-drop {
  border: 2px dashed #4d4d4d; border-radius: var(--radius); padding: 32px 16px; text-align: center;
  cursor: pointer; position: relative; background: var(--bg-2);
  transition: border-color var(--t-card), background var(--t-card);
}
.upl-drop:hover, .upl-drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.upl-drop-ic {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; color: var(--accent-ink); background: var(--accent);
  transition: transform var(--t-card) var(--ease);
}
.upl-drop:hover .upl-drop-ic, .upl-drop.drag .upl-drop-ic { transform: translateY(-2px) scale(1.04); }
.upl-drop-t { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.upl-drop-s { font-size: 13px; color: var(--muted); font-weight: 500; }
.upl-drop.disabled { opacity: .5; pointer-events: none; }
.upl-file-card {
  display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 8px 8px 8px 12px;
  background: var(--bg-2); border-radius: var(--radius-sm);
}
#u-pick { margin: 0 0 16px; }
#u-pick:empty { margin: 0; }
.upl-file-ic { width: 40px; height: 40px; border-radius: 4px; display: grid; place-items: center; color: var(--muted); background: var(--panel-2); flex: none; }
.upl-file-meta { min-width: 0; flex: 1; }
.upl-file-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upl-file-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.upl-file-x {
  background: none; border: none; color: var(--muted); cursor: pointer; padding: 0;
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  transition: background var(--t-fast), color var(--t-fast);
}
.upl-file-x:hover { background: var(--hover); color: var(--text); }
.upl-progress-wrap { margin-top: 16px; }
.upl-progress-bar { height: 6px; border-radius: 999px; background: #3a3a3a; overflow: hidden; }
:root[data-theme="light"] .upl-progress-bar { background: #dfe2e6; }
.upl-progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width .15s ease; border-radius: 999px; }
.upl-progress-txt { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 8px; font-weight: 500; }
.field label.field-ic { display: flex; align-items: center; gap: 8px; }
.field-ic .fi { color: var(--muted); display: grid; }

/* Hạn mức */
.quota-panel { margin-bottom: 16px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px 24px; }
.quota-panel > .legal { grid-column: 1 / -1; margin-top: 0 !important; }
.quota-item { margin-bottom: 0; }
.panel:not(.quota-panel) .quota-item { margin-bottom: 12px; }
.quota-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.quota-top span { color: var(--muted); font-weight: 500; }
.quota-top b { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.quota-bar { height: 6px; border-radius: 999px; background: #3a3a3a; overflow: hidden; }
:root[data-theme="light"] .quota-bar { background: #dfe2e6; }
.quota-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width .35s ease; }
.quota-item.warn .quota-fill { background: var(--warn); }
.feat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.feat-list li { display: inline-flex; align-items: center; gap: 6px; }
.feat-list .on .lc { color: var(--accent); }
.feat-list .off { color: var(--muted); }

/* Hàng đợi tải lên */
.uq-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.uq-head h3 { display: flex; align-items: center; gap: 8px; }
.uq-head h3 .lc { color: var(--muted); }
.uq-item { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.uq-item:first-child { border-top: none; }
.uq-top { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.uq-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uq-st { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.uq-uploading .uq-st, .uq-processing .uq-st { color: var(--text); }
.uq-done .uq-st { color: var(--accent); }
.uq-error .uq-st { color: var(--danger); }
.uq-cancelled .uq-name { color: var(--muted); text-decoration: line-through; }
.uq-item .upl-progress-bar { margin-top: 8px; }
.uq-processing .upl-progress-fill { background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hi) 50%, var(--accent) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* =====================================================================
   Thông báo pháp lý (đăng ký)
   ===================================================================== */
.legal-box {
  max-height: 300px; overflow-y: auto; border-radius: var(--radius-sm);
  padding: 16px; background: var(--bg-2); font-size: 13px; color: var(--muted); line-height: 1.65;
}
.legal-box h4 { color: var(--text); font-size: 14px; margin: 16px 0 8px; }
.legal-box h4:first-child { margin-top: 0; }
.legal-box p { margin: 0 0 8px; }
.legal-box ul { margin: 0 0 8px; padding-left: 20px; }
.legal-accept {
  display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 12px 4px 0;
  font-size: 14px; color: var(--text); cursor: pointer;
}
.legal-accept input { margin-top: 2px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }

/* ---------- Quên mật khẩu ---------- */
.auth-forgot { text-align: right; margin: -8px 0 16px; font-size: 13px; }
.auth-forgot a { color: var(--text); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-title { text-align: center; font-size: 22px; margin: 0 0 8px; }
.auth-step { animation: authStepIn .28s var(--ease) both; }
@keyframes authStepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.otp-input { text-align: center; font-size: 26px; letter-spacing: 10px; font-variant-numeric: tabular-nums; padding-left: 20px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0;
  color: var(--muted); cursor: pointer; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
}
.pw-toggle:hover { color: var(--text); }
.auth-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.auth-linkbtn { background: none; border: 0; padding: 4px 0; font-size: 14px; font-weight: 700; color: var(--text); cursor: pointer; min-height: 32px; }
.auth-linkbtn:disabled { color: var(--muted); cursor: default; font-weight: 500; }
.auth-done-ic {
  width: 64px; height: 64px; margin: 8px auto 24px; border-radius: 50%; display: grid; place-items: center;
  color: var(--accent-ink); background: var(--accent); animation: authStepIn .4s var(--ease) both;
}
.auth-card button:disabled { opacity: .6; cursor: not-allowed; }

/* =====================================================================
   Chống spam: overlay đóng băng tạm thời + reCAPTCHA
   ===================================================================== */
.ag-freeze {
  position: fixed; inset: 0; z-index: 9000;
  display: grid; place-items: center;
  background: rgba(0,0,0,.45); cursor: progress;
}
:root[data-theme="light"] .ag-freeze { background: rgba(255,255,255,.55); }
.ag-box {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 24px; border-radius: var(--radius-lg); text-align: center;
  background: var(--panel-2); box-shadow: var(--shadow);
}
.ag-box .spinner { width: 26px; height: 26px; margin: 0; }
.ag-title { font-weight: 700; font-size: 15px; color: var(--text); }
.ag-sub { font-size: 13px; color: var(--muted); }
body.ag-keep-player .player-bar { z-index: 9100; }
.captcha-box { display: flex; justify-content: center; margin: 4px 0 16px; min-height: 78px; }
.captcha-box > div { max-width: 100%; }

/* =====================================================================
   Thông báo gói / hết hạn
   ===================================================================== */
.notice-bar {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; margin-bottom: 24px; border-radius: var(--radius);
  background: var(--panel); color: var(--text); font-size: 14px; line-height: 1.55;
  border-left: 3px solid var(--accent);
}
.notice-bar > div { min-width: 0; flex: 1; }
.notice-bar .nb-ic { color: var(--accent); display: grid; margin-top: 1px; }
.notice-bar.warn { border-left-color: var(--warn); }
.notice-bar.warn .nb-ic { color: var(--warn); }
.notice-bar a { color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.notice-expired { max-width: 560px; margin: 32px auto; text-align: center; padding: 32px 24px; }
.notice-expired h2, .notice-expired h3 { margin: 8px 0; }
.notice-expired p { color: var(--muted); line-height: 1.6; }
.notice-ic { color: var(--warn); display: grid; place-items: center; margin-bottom: 8px; }
.badge.expired { background: var(--danger-soft); color: var(--danger); }
.badge.soon { background: var(--warn-soft); color: var(--warn); }

/* Liên kết pháp lý */
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; margin: 24px 0 8px; }
.legal-links a { font-size: 13px; }
.auth-wrap .legal-links { margin-top: 16px; }

/* =====================================================================
   MÀN HÌNH ĐANG PHÁT (Now Playing)
   ===================================================================== */
.np {
  position: fixed; left: 0; right: 0; top: 0; bottom: var(--pbar-h); z-index: 25;
  background: var(--bg); display: flex; flex-direction: column; overflow: hidden;
}
body.np-open { overflow: hidden; }
body.np-open .player-bar, body.np-open .bottom-nav { display: none; }
body.np-open .np { bottom: 0; }
.np-bg {
  position: absolute; inset: -80px; pointer-events: none; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(80px) saturate(1.3); opacity: 0; transform: translateZ(0);
  transition: opacity .5s ease;
}
.np-bg.has-img { opacity: .45; }
:root[data-theme="light"] .np-bg.has-img { opacity: .3; }
.np::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(18,18,18,.25) 0%, rgba(18,18,18,.82) 55%, var(--bg) 100%);
}
:root[data-theme="light"] .np::before { background: linear-gradient(180deg, rgba(255,255,255,.3) 0%, rgba(255,255,255,.85) 55%, var(--bg) 100%); }
.np-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); flex: none; }
.np-top-t { font-weight: 700; letter-spacing: .08em; color: var(--text); font-size: 12px; text-transform: uppercase; }
.np-top .icon-btn { color: var(--text); }
.np-body {
  position: relative; z-index: 1; flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(300px, 460px) minmax(0, 1fr);
  gap: 48px; padding: 8px 40px 32px; max-width: 1240px; width: 100%; margin: 0 auto;
}
.np-left { display: flex; flex-direction: column; align-items: stretch; justify-content: center; min-height: 0; }
.np-left > * { flex-shrink: 0; }
.np-cover {
  width: min(100%, 400px, 46vh); aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; align-self: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.55); background: var(--panel-2);
  transition: transform .4s var(--ease);
}
.np-cover.is-playing { transform: scale(1.01); }
.np-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-cover-art { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.np-eq { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; gap: 4px; justify-content: center; align-items: flex-end; height: 24px; opacity: 0; transition: opacity .3s; }
.np-eq i { width: 4px; background: rgba(255,255,255,.85); border-radius: 2px; height: 30%; animation: np-eq 1s ease-in-out infinite; animation-play-state: paused; }
.np-eq i:nth-child(2) { animation-delay: .2s; } .np-eq i:nth-child(3) { animation-delay: .4s; } .np-eq i:nth-child(4) { animation-delay: .1s; }
.np-cover.is-playing .np-eq { opacity: 1; }
.np-cover.is-playing .np-eq i { animation-play-state: running; }
@keyframes np-eq { 0%,100% { height: 25%; } 50% { height: 100%; } }
.np-meta { width: min(100%, 400px); align-self: center; margin-top: 24px; min-width: 0; }
.np-title { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.np-artist { color: var(--muted); margin-top: 4px; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-tools { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; width: min(100%, 400px); align-self: center; }
.np-tools .btn { border-color: transparent; background: rgba(255,255,255,.08); color: var(--text); }
:root[data-theme="light"] .np-tools .btn { background: rgba(0,0,0,.06); }
.np-tools .btn:hover { background: rgba(255,255,255,.16); }
.np-prog { display: flex; align-items: center; gap: 8px; width: min(100%, 400px); align-self: center; margin-top: 16px; }
.np-prog .pb-seek { height: 20px; }
.np-ctrls { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: min(100%, 400px); align-self: center; margin-top: 8px; }
.np-ctrls .icon-btn { width: 48px; height: 48px; color: var(--text); }
.np-ctrls .icon-btn:hover { background: transparent; transform: scale(1.06); }
.np-ctrls .np-sleep, .np-ctrls .pb-loop { color: var(--muted); }
.np-ctrls .np-sleep.active, .np-ctrls .pb-loop.active { color: var(--accent); }
.np-play, .np-ctrls .np-play { width: 64px !important; height: 64px !important; background: var(--text); color: var(--bg) !important; }
.np-ctrls .np-play:hover { background: var(--text); transform: scale(1.05); }
.np-sleep { position: relative; }
.np-sleep-t { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); font-size: 10px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

.np-right {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: rgba(0,0,0,.28); border-radius: var(--radius-lg); padding: 16px 16px 0;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
:root[data-theme="light"] .np-right { background: rgba(255,255,255,.6); }
.np-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex: none; }
.np-tab {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 16px;
  background: rgba(255,255,255,.08); border: none; border-radius: 999px; color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
:root[data-theme="light"] .np-tab { background: rgba(0,0,0,.06); }
.np-tab:hover { background: rgba(255,255,255,.16); }
.np-tab.active { background: var(--text); color: var(--bg); }
.np-qn { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.np-qn:empty { display: none; }
.np-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 0 4px 16px 0; }
.np-notes-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.np-notes-head h3 { margin: 0; font-size: 18px; }
.np-notes-text { white-space: pre-wrap; word-break: break-word; line-height: 1.75; font-size: 20px; font-weight: 700; letter-spacing: -.01em; padding-bottom: 24px; }
.np-textarea { min-height: 46vh; height: 46vh; resize: vertical; line-height: 1.6; font-family: inherit; }
.np-notes-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.np-empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.np-empty .em { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: var(--muted); }
.np-empty-sm { padding: 24px 16px; }

/* Hàng đợi */
.np-q-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 12px; margin-bottom: 12px; border-radius: var(--radius-sm); background: rgba(255,255,255,.06); font-size: 14px; }
:root[data-theme="light"] .np-q-now { background: rgba(0,0,0,.05); }
.np-q-now b { color: var(--accent); }
.np-q-now span { color: var(--muted); }
.np-q-nowtag { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; width: 100%; }
.np-q-list { display: flex; flex-direction: column; gap: 2px; }
.np-q-item { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 0; border-radius: var(--radius-sm); background: transparent; touch-action: pan-y; transition: background var(--t-fast); }
.np-q-item:hover { background: var(--row-hover); }
.np-q-item.dragging { background: var(--panel-2); box-shadow: var(--shadow); position: relative; z-index: 2; }
.np-q-handle { flex: none; width: 36px; height: 44px; border: none; background: none; color: var(--muted-2); cursor: grab; touch-action: none; border-radius: var(--radius-sm); display: grid; place-items: center; }
.np-q-handle:hover, .np-q-handle:focus-visible { color: var(--text); }
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; }
.np-q-main { flex: 1; min-width: 0; cursor: pointer; padding: 4px 0; }
.np-q-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-q-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-q-item .song-dur { min-width: 36px; }
.np-q-item .icon-btn { width: 40px; height: 40px; }

.np:not(.hidden) { animation: npIn .3s cubic-bezier(.2,.8,.2,1) both; }
@keyframes npIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.np-cover img.np-cover-img { animation: coverIn .3s ease both; }
@keyframes coverIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.np-title, .np-artist { animation: textIn .25s ease both; }
@keyframes textIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.np-cover { will-change: transform; }
.sleep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.sleep-grid .btn { border-radius: var(--radius-sm); }

/* ---- Ảnh bìa ---- */
.song-thumb.has-cover { padding: 0; overflow: hidden; background: var(--panel); }
.cover-default { width: 100%; height: 100%; display: grid; place-items: center; border-radius: inherit; }
.cover-pick { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.cover-prev { width: 152px; height: 152px; border-radius: var(--radius); overflow: hidden; flex: none; background: var(--panel); box-shadow: var(--shadow-sm); }
.cover-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-side { flex: 1; min-width: 180px; }

/* =====================================================================
   PLAYLIST
   ===================================================================== */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 0 -12px; }
.song.pl-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
  padding: 12px; min-height: 0; border-radius: var(--radius);
}
.pl-card-cover {
  position: relative; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); margin-bottom: 12px;
}
:root[data-theme="light"] .pl-card-cover { box-shadow: var(--shadow-sm); }
.song.pl-card:hover .mcard-play, .song.pl-card:focus-within .mcard-play { opacity: 1; transform: none; pointer-events: auto; }
.pl-card-body { display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.pl-card .song-meta { padding-top: 2px; }
/* Ghim + menu nổi ở góc ảnh bìa để tên playlist có đủ chỗ */
.pl-card .song-actions { position: absolute; top: 20px; right: 20px; gap: 6px; margin: 0; z-index: 3; }
.pl-card .song-actions .icon-btn { width: 32px; height: 32px; background: rgba(0,0,0,.62); color: #fff; }
.pl-card .song-actions .icon-btn:hover { background: rgba(0,0,0,.85); }
.pl-card .song-actions .icon-btn.pinned { color: var(--accent); }
.pl-card .act-pin:not(.pinned), .pl-card .more-btn { opacity: 0; }
.pl-card:hover .song-actions .icon-btn, .pl-card:focus-within .song-actions .icon-btn, .pl-card.menu-open .song-actions .icon-btn { opacity: 1; }
@media (hover: none) { .pl-card .act-pin:not(.pinned), .pl-card .more-btn { opacity: 1; } .pl-card .song-actions .icon-btn { width: 40px; height: 40px; } }

.pl-hero { margin-bottom: 24px; }
.pl-hero-in { display: flex; align-items: flex-end; gap: 24px; margin-top: 16px; }
.pl-hero-cover { width: 192px; height: 192px; border-radius: var(--radius-sm); flex: none; box-shadow: 0 8px 32px rgba(0,0,0,.5); }
.pl-hero-txt { min-width: 0; flex: 1; }
.pl-hero-kind { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.pl-hero h1 { font-size: clamp(32px, 5vw, 64px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin: 0 0 8px; overflow-wrap: anywhere; }
.pl-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* =====================================================================
   TRANG THÔNG TIN
   ===================================================================== */
.info-page { max-width: 780px; line-height: 1.7; font-weight: 500; }
.info-page h1 { font-size: 32px; font-weight: 800; margin: 8px 0 8px; letter-spacing: -.03em; }
.info-page h2 { font-size: 20px; margin: 32px 0 8px; }
.info-page ul { padding-left: 20px; } .info-page li { margin: 4px 0; }
.info-page code { background: var(--panel-2); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.info-page a { color: var(--accent); }
.info-meta { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.info-card { margin-top: 24px; padding: 16px 20px; border-radius: var(--radius); background: var(--panel); }
.info-wrap { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.info-nav { position: static; }
.info-main { flex: 1; width: 100%; max-width: 860px; margin: 0 auto; padding: 24px 16px 40px; }
.faq details { border-radius: var(--radius-sm); background: var(--panel); margin: 8px 0; transition: background var(--t-fast); }
.faq details:hover { background: var(--panel-2); }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 600; min-height: 44px; }
.faq details > div { padding: 0 16px 16px; color: var(--muted); }
.contact-grid { display: grid; gap: 1px; background: var(--line-soft); border-radius: var(--radius); overflow: hidden; margin-top: 12px; }
.contact-row { display: grid; grid-template-columns: 200px 1fr; gap: 12px; background: var(--panel); padding: 12px 16px; }
.contact-l { color: var(--muted); font-weight: 600; }

/* =====================================================================
   TÀI KHOẢN
   ===================================================================== */
.ava-row { display: flex; align-items: center; gap: 24px; margin-bottom: 16px; }
.ava-wrap { flex: none; }
.ava-img, .ava-fallback { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.ava-fallback { display: grid; place-items: center; font-size: 36px; font-weight: 800; color: var(--accent-ink); background: var(--accent); }
.ava-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* =====================================================================
   THANH TOÁN / NÂNG CẤP
   ===================================================================== */
.bl-sum { display: grid; gap: 0; margin: 0 0 16px; }
#bl-sum-note:not(:empty) { margin: -4px 0 16px; }
.bl-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.bl-row span { color: var(--muted); }
.bl-row b { text-align: right; font-weight: 600; }
.bl-state.warn { color: var(--warn); }
.bl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.bl-toggle { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-2); margin: 0 0 16px; }
.bl-toggle button { border: 0; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600; }
.bl-toggle button.on { background: var(--text); color: var(--bg); }
.bl-toggle i { font-style: normal; font-size: 11px; margin-left: 4px; opacity: .85; }
.bl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }
.bl-card { border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 12px; background: var(--panel); }
.bl-card.hi { box-shadow: inset 0 0 0 2px var(--accent); }
.bl-card.sel { outline: 2px solid var(--accent); outline-offset: 2px; }
.bl-name { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bl-price { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.bl-price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.bl-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; flex: 1; }
.bl-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); white-space: nowrap; }
.bl-badge.ok { background: var(--accent-soft); color: var(--accent); }
.bl-badge.bad { background: var(--danger-soft); color: var(--danger); }
.bl-badge.wait { background: var(--warn-soft); color: var(--warn); }
.bl-tablewrap { overflow-x: auto; }
.bl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bl-table th, .bl-table td { padding: 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line-soft); }
.bl-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.bl-table tbody tr:hover { background: var(--row-hover); }
.bl-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; }
.bl-empty { text-align: center; padding: 32px 16px; }
.br-state { text-align: center; padding: 24px 8px; }
.br-state h2 { margin: 8px 0; font-size: 24px; }
.br-state p { color: var(--muted); line-height: 1.6; }
.br-ico { display: grid; place-items: center; color: var(--accent); margin-bottom: 8px; }
.side-upgrade {
  margin: 8px 4px 0; padding: 16px; border-radius: var(--radius);
  background: var(--panel); display: grid; gap: 8px; font-size: 14px; flex: none;
}
.side-upgrade b { font-weight: 700; }
.side-upgrade span { color: var(--muted); font-size: 13px; font-weight: 500; }
.side-upgrade .btn { margin-top: 4px; }
.side-upgrade-link { display: flex; align-items: center; gap: 8px; margin: 8px 8px 0; min-height: 40px; font-size: 13px; font-weight: 600; color: var(--muted); }
.side-upgrade-link:hover { color: var(--text); }

/* =====================================================================
   LANDING PAGE
   ===================================================================== */
.lp { min-height: 100vh; background: var(--bg); overflow-x: hidden; }
.lp-nav { max-width: 1160px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; gap: 24px; }
.lp-brand { font-size: 20px; font-weight: 800; letter-spacing: -.03em; display: flex; align-items: center; gap: 10px; }
.lp-nav-links { display: flex; gap: 24px; margin-left: 24px; flex: 1; }
.lp-nav-links a { color: var(--muted); font-weight: 600; font-size: 14px; transition: color var(--t-fast); }
.lp-nav-links a:hover { color: var(--text); }
.lp-nav-cta { display: flex; gap: 8px; margin-left: auto; }
.lp-hero { position: relative; max-width: 1160px; margin: 0 auto; padding: 48px 24px 64px; }
.lp-orbs { display: none; }
.lp-hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.lp-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 24px;
}
.lp-badge .lc { display: inline-block; }
.lp-title { font-size: 64px; line-height: 1.02; letter-spacing: -.045em; margin: 0 0 24px; font-weight: 800; }
.grad-text { color: var(--accent); }
.lp-sub { font-size: 18px; color: var(--muted); line-height: 1.55; margin: 0 0 32px; max-width: 480px; font-weight: 500; }
.lp-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.lp-trust { font-size: 13px; color: var(--muted); }
.lp-hero-visual { position: relative; }
.mock-card { background: var(--panel); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.mock-cover { height: 180px; border-radius: var(--radius); display: grid; place-items: center; margin-bottom: 16px; }
.eq { display: flex; align-items: flex-end; gap: 6px; height: 56px; }
.eq span { width: 8px; background: var(--accent); border-radius: 4px; animation: eq 1s ease-in-out infinite; transform-origin: bottom; }
.eq span:nth-child(1) { height: 40%; animation-delay: 0s; }
.eq span:nth-child(2) { height: 80%; animation-delay: .2s; }
.eq span:nth-child(3) { height: 55%; animation-delay: .4s; }
.eq span:nth-child(4) { height: 95%; animation-delay: .1s; }
.eq span:nth-child(5) { height: 65%; animation-delay: .3s; }
@keyframes eq { 0%,100% { transform: scaleY(.5); } 50% { transform: scaleY(1); } }
.mock-info { margin-bottom: 16px; }
.mock-title { font-weight: 700; font-size: 16px; }
.mock-artist { font-size: 13px; color: var(--muted); }
.mock-bar { height: 4px; background: #4d4d4d; border-radius: 999px; overflow: hidden; margin-bottom: 16px; }
.mock-bar span { display: block; height: 100%; width: 42%; background: var(--text); border-radius: 999px; animation: prog 8s linear infinite; }
@keyframes prog { from { width: 8%; } to { width: 92%; } }
.mock-ctrls { display: flex; align-items: center; justify-content: center; gap: 24px; color: var(--text); }
.mock-ctrls span { display: grid; place-items: center; }
.mock-play { width: 48px; height: 48px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; }
.mock-list { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.mock-item { display: flex; align-items: center; gap: 12px; border-radius: var(--radius-sm); padding: 8px; }
.mock-item:hover { background: var(--row-hover); }
.mock-ic { width: 40px; height: 40px; border-radius: 4px; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); }
.mock-item-t { display: flex; flex-direction: column; }
.mock-item-t b { font-size: 14px; font-weight: 600; }
.mock-item-t i { font-size: 12.5px; color: var(--muted); font-style: normal; }
.lp-section { max-width: 1160px; margin: 0 auto; padding: 64px 24px; }
.lp-section-head { text-align: center; margin-bottom: 40px; }
.lp-section-head h2 { font-size: 36px; letter-spacing: -.035em; margin: 0 0 8px; font-weight: 800; }
.lp-section-head p { color: var(--muted); font-size: 16px; margin: 0; }
.lp-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.lp-feat { background: var(--panel); border-radius: var(--radius); padding: 24px; transition: background var(--t-card); }
.lp-feat:hover { background: var(--panel-2); }
.lp-feat-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.lp-feat h3 { margin: 0 0 8px; font-size: 16px; }
.lp-feat p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-step { text-align: center; padding: 16px; }
.lp-step-n { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; font-size: 20px; font-weight: 800; color: var(--accent-ink); background: var(--accent); }
.lp-step h3 { margin: 0 0 8px; font-size: 17px; }
.lp-step p { margin: 0; color: var(--muted); font-size: 14px; }
.lp-pricing { display: grid; grid-template-columns: repeat(3, minmax(0, 320px)); gap: 16px; justify-content: center; }
.lp-price { position: relative; background: var(--panel); border-radius: var(--radius-lg); padding: 28px; display: flex; flex-direction: column; }
.lp-price.hi { box-shadow: inset 0 0 0 2px var(--accent); }
.lp-price-flag { position: absolute; top: -12px; left: 28px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.lp-price-name { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lp-price-amt { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 4px; }
.lp-price-tag { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.lp-price ul { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; border-top: 1px solid var(--line-soft); padding-top: 20px; }
.lp-price li { font-size: 14px; color: var(--text); display: flex; gap: 8px; align-items: flex-start; }
.lp-price li .lc { color: var(--accent); margin-top: 1px; }
.lp-price-note { text-align: center; max-width: 640px; margin: 24px auto 0; }
.lp-cta { padding: 16px 24px 80px; }
.lp-cta-inner { max-width: 900px; margin: 0 auto; text-align: center; padding: 56px 32px; border-radius: var(--radius-lg); background: var(--panel); }
.lp-cta-inner h2 { font-size: 30px; letter-spacing: -.03em; margin: 0 0 24px; font-weight: 800; }
.lp-footer { margin-top: 16px; padding: 40px 24px 48px; text-align: center; border-top: 1px solid var(--line-soft); }
.lp-footer .lp-brand { justify-content: center; margin-bottom: 12px; font-size: 20px; }
.lp-footer .legal { max-width: 560px; margin: 0 auto; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
.only-mobile { display: none !important; }
.scrim { display: none; }

/* Desktop hẹp: thu gọn sidebar */
@media (max-width: 1279px) and (min-width: 1024px) {
  :root { --sidebar-w: 240px; }
  .pb-volume { width: 72px; }
}

/* Tablet + điện thoại: drawer + điều hướng dưới cùng */
@media (max-width: 1023px) {
  :root { --nav-h: 64px; --pbar-h: 72px; }
  .app { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  .main-col { border-radius: 0; min-height: 100vh; }
  .topbar { border-radius: 0; padding: 8px 16px; min-height: 56px; padding-top: max(8px, env(safe-area-inset-top)); }
  .only-mobile { display: inline-grid !important; }
  img.only-mobile { display: block !important; }
  .song-list-head { top: 56px; }

  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 40; width: min(86vw, 320px); height: 100%;
    padding: 8px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: calc(8px + var(--safe-b));
    background: var(--bg-side);
    transform: translateX(-100%); transition: transform .26s var(--ease);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.show { opacity: 1; pointer-events: auto; }

  /* Điều hướng dưới cùng */
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
    height: calc(var(--nav-h) + var(--safe-b)); padding: 4px 8px var(--safe-b);
    background: linear-gradient(180deg, rgba(0,0,0,.82) 0%, #000 45%);
  }
  :root[data-theme="light"] .bottom-nav { background: rgba(255,255,255,.97); border-top: 1px solid var(--line); }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 48px; color: var(--muted); font-size: 11px; font-weight: 600;
    transition: color var(--t-fast);
  }
  .bottom-nav a .ni { display: grid; transition: transform var(--t-fast); }
  .bottom-nav a:active .ni { transform: scale(.9); }
  .bottom-nav a.active { color: var(--text); }
  .bottom-nav a.active .ni { color: var(--accent); }
  .bottom-nav .nl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

  /* Mini player nổi phía trên điều hướng */
  .player-bar {
    left: 8px; right: 8px; bottom: calc(var(--nav-h) + var(--safe-b));
    height: 64px; padding: 0 8px; border-radius: var(--radius);
    background: #2a2a2a; box-shadow: 0 -4px 20px rgba(0,0,0,.35);
    grid-template-columns: minmax(0, 1fr) auto; gap: 4px;
  }
  :root[data-theme="light"] .player-bar { background: #ffffff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
  .pb-cover { width: 48px; height: 48px; }
  .pb-center { display: contents; }
  .pb-controls { gap: 0; }
  .pb-controls .icon-btn { width: 44px; height: 44px; color: var(--text); }
  .pb-controls .pb-play { width: 44px; height: 44px; background: transparent; color: var(--text); }
  .pb-controls .pb-play:hover { background: transparent; color: var(--text); }
  .pb-controls .pb-play .lc { width: 24px; height: 24px; }
  .pb-progress { position: absolute; left: 8px; right: 8px; bottom: 0; gap: 0; }
  .pb-progress .pb-time { display: none; }
  .pb-progress .pb-seek { height: 10px; margin-bottom: -4px; }
  .pb-progress .pb-seek::-webkit-slider-runnable-track { height: 2px; }
  .pb-progress .pb-seek::-webkit-slider-thumb { margin-top: -5px; }
  .pb-progress .pb-seek::-moz-range-track, .pb-progress .pb-seek::-moz-range-progress { height: 2px; }
  .pb-vol { display: none; }
  .player-bar.is-empty .pb-center { opacity: 1; }
  .player-bar.is-empty .pb-controls { opacity: .45; }
  .pb-right { display: none; }
  .np { bottom: calc(var(--nav-h) + var(--safe-b)); }

  .view { padding: 8px 16px 32px; }
  .chip-info, .chip-caret { display: none; }
  .user-chip { padding: 4px; min-height: 40px; }
  .page-head h1, .dash-hero-in h1 { font-size: 28px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .np-body { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 0 24px 24px; overflow-y: auto; max-width: 640px; }
  .np-left { justify-content: flex-start; min-height: auto; }
  .np-cover { width: min(100%, 420px, 44vh); }
  .np-right { min-height: 420px; }

  .lp-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tablet: giữ đủ điều khiển trong mini player */
@media (min-width: 768px) and (max-width: 1023px) {
  .player-bar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .pb-controls .pb-sec { display: inline-grid; }
  .pb-right { display: flex; }
  .pb-right #pb-sleep, .pb-right .pb-vol { display: none; }
  .pb-right .icon-btn { width: 44px; height: 44px; }
}

/* Điện thoại */
@media (max-width: 767px) {
  .pb-controls .pb-sec { display: none; }
  .player-bar .pb-title { font-size: 13.5px; }
  .player-bar .pb-artist { font-size: 12px; }

  .page-head { margin-bottom: 16px; }
  .page-head h1, .dash-hero-in h1 { font-size: 24px; }
  .dash-hero-actions .plan-pill { margin-left: 0; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin: 0 -8px; gap: 4px; }
  .mcard { padding: 8px; }
  .mcard-pin { right: 14px; top: 14px; }
  .mcard-title { font-size: 14px; }
  .stat-grid { gap: 8px; }
  .stat-card { padding: 14px; min-height: 112px; }
  .stat-val { font-size: 19px; }
  .lai-acc-btn { width: 100%; justify-content: center; }
  .dash-empty .btn { margin-left: 0; }

  /* Thư viện gọn: ảnh, tên, ghim, menu */
  .song { padding: 8px; min-height: 64px; }
  .song-list-lib .song { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; padding: 8px; }
  .song-list-lib .song::before { display: none; }
  .song-list-lib .song-dur, .song-list-head { display: none; }
  .song-art, .song-list-lib .song-thumb, .song-art .song-thumb { width: 48px; height: 48px; }
  .song .icon-btn { width: 44px; height: 44px; }
  .song-actions { gap: 0; margin-right: -8px; }
  .song-list-lib { margin: 0 -8px; }

  /* Menu "⋯" thành bottom sheet */
  .sheet-scrim { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sheet-scrim.show { opacity: 1; pointer-events: auto; }
  .more.open .more-menu {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 81;
    min-width: 0; max-height: 75vh; overflow-y: auto;
    padding: 8px 8px calc(16px + var(--safe-b));
    border-radius: 16px 16px 0 0; background: var(--panel-2);
    animation: sheetUp .26s var(--ease);
  }
  .more.open .more-menu::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 999px; background: var(--muted-2); margin: 4px auto 12px; }
  .more-item { min-height: 52px; font-size: 16px; padding: 12px 16px; border-radius: var(--radius-sm); gap: 16px; }
  .more-ic .lc { width: 22px; height: 22px; }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

  /* Playlist */
  .pl-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 0 -8px; gap: 4px; }
  .song.pl-card { padding: 8px; }
  .pl-card .song-actions { top: 14px; right: 14px; margin: 0; }
  .pl-hero-in { flex-direction: column; align-items: flex-start; gap: 16px; }
  .pl-hero-cover { width: 160px; height: 160px; align-self: center; }
  .pl-hero h1 { font-size: 28px; }

  .panel { padding: 16px; }
  .quota-panel { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .upl-drop { padding: 24px 16px; }
  .btn#u-submit { width: 100%; }
  .modal-back { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 16px 16px 0 0; padding: 24px 16px calc(24px + var(--safe-b)); max-height: 88vh; animation: sheetUp .26s var(--ease); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; min-height: 48px; }
  .sleep-grid { grid-template-columns: repeat(2, 1fr); }
  .sleep-grid .btn { min-height: 48px; }
  .ava-row { gap: 16px; }
  .ava-img, .ava-fallback { width: 80px; height: 80px; font-size: 30px; }

  /* Đang phát trên điện thoại */
  .np-top { padding: 8px; padding-top: max(8px, env(safe-area-inset-top)); }
  .np-body { padding: 0 24px calc(24px + var(--safe-b)); gap: 24px; }
  .np-cover { width: min(100%, 360px, 42vh); margin-top: 8px; }
  .np-meta, .np-tools, .np-prog, .np-ctrls { width: 100%; }
  .np-title { font-size: 22px; }
  .np-ctrls .icon-btn { width: 48px; height: 48px; }
  .np-ctrls .np-play { width: 64px !important; height: 64px !important; }
  .np-right { min-height: 380px; padding: 12px 12px 0; }
  .np-notes-text { font-size: 18px; }
  .np-textarea { min-height: 40vh; height: 40vh; }

  .contact-row { grid-template-columns: 1fr; gap: 2px; }
  .bl-table thead { display: none; }
  .bl-table, .bl-table tbody, .bl-table tr, .bl-table td { display: block; width: 100%; }
  .bl-table tr { padding: 12px; border-bottom: 1px solid var(--line-soft); }
  .bl-table td { border: 0; padding: 4px 0; white-space: normal; display: flex; justify-content: space-between; gap: 12px; }
  .bl-table td[data-l]::before { content: attr(data-l); color: var(--muted); }

  /* Landing */
  .lp-hero { padding: 24px 16px 48px; }
  .lp-hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .lp-title { font-size: 40px; }
  .lp-sub { font-size: 16px; }
  .lp-section { padding: 48px 16px; }
  .lp-section-head h2 { font-size: 28px; }
  .lp-features, .lp-steps, .lp-pricing { grid-template-columns: 1fr; }
  .lp-nav { padding: 12px 16px; gap: 12px; }
  .lp-nav-links { display: none; }
  .lp-cta-inner { padding: 40px 20px; }
  .auth-card { padding: 24px 20px; }
  .otp-input { font-size: 22px; letter-spacing: 7px; }
}

@media (max-width: 900px) and (min-width: 768px) {
  .lp-hero-inner { grid-template-columns: 1fr; }
  .lp-pricing { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .lp-nav-links { display: none; }
}

/* Điện thoại nhỏ 320–375px */
@media (max-width: 375px) {
  .view { padding: 8px 12px 24px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-card { min-height: 0; }
  .card-grid, .pl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-title { font-size: 34px; }
  .lp-nav-cta .btn-sm { padding: 6px 10px; }
  .np-body { padding: 0 16px calc(16px + var(--safe-b)); }
  .np-ctrls .icon-btn { width: 44px; height: 44px; }
  .np-ctrls .np-play { width: 56px !important; height: 56px !important; }
  .bottom-nav a { font-size: 10px; }
  .captcha-box { transform: scale(.9); transform-origin: center top; margin-bottom: 8px; }
}

/* ---- Chuyển động: tôn trọng "giảm chuyển động" của hệ điều hành ---- */
/* (Có thể bỏ qua trong "Hiệu ứng & chuyển động" → Chung: html[data-fx-rm="ignore"]) */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-fx-rm="ignore"]) *, :root:not([data-fx-rm="ignore"]) *::before, :root:not([data-fx-rm="ignore"]) *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  :root:not([data-fx-rm="ignore"]) .np-eq i { animation: none !important; height: 60%; }
  .mock-card, .eq span, .mock-bar span, .uq-processing .upl-progress-fill { animation: none !important; }
  .btn:hover, .icon-btn:active, .pb-play:hover { transform: none !important; }
}

/* ---------- Product Key (v2.4) ---------- */
.pk-panel { border-left: 3px solid var(--accent); }
.pk-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.pk-head h3 { margin: 0 0 6px; font-size: 16px; }
.pk-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.pk-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.pk-form { display: flex; gap: 8px; flex-wrap: wrap; }
.pk-form .input { flex: 1 1 260px; min-width: 0; }
.pk-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; }
.pk-out:not(:empty) { margin-top: 12px; }
.pk-preview { background: var(--panel-2); border-radius: var(--radius); padding: 14px 16px; }
.pk-prev-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pk-prev-top .legal { margin-left: auto; font-family: ui-monospace, Menlo, Consolas, monospace; }
.pk-prev-sum { margin-top: 8px; font-size: 14px; }
.pk-accept { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; cursor: pointer; }
.pk-done { margin: 0; }
.pk-hist-t { margin: 16px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pk-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pk-hist li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.pk-hist li .legal { margin-left: auto; }
.pk-modal { max-width: 640px; width: calc(100vw - 32px); }
.ad-tabs { margin: -8px 0 18px; }
.pk-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.pk-toolbar .input { flex: 1 1 240px; max-width: 340px; }
.pk-toolbar .select { width: auto; }
.pk-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; white-space: nowrap; }
.pk-note { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }
.pk-keys { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; letter-spacing: .04em; resize: vertical; }
.pk-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 14px; font-size: 14px; }
.pk-dl dt { color: var(--muted); }
.pk-dl dd { margin: 0; }
.pk-sub { margin: 16px 0 8px; font-size: 14px; }
.pk-acts { display: flex; gap: 6px; justify-content: flex-end; }
.pk-ib { padding: 0; width: 34px; height: 34px; min-height: 34px; display: inline-grid; place-items: center; }
.pk-tbl td, .pk-tbl th { white-space: nowrap; }
.pk-tbl .pk-note { white-space: nowrap; max-width: 180px; }

/* Menu tài khoản gọn (v2.4): gói bấm được, Hiệu ứng nằm trong nhóm Giao diện */
.drop-plan-link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; cursor: pointer; transition: filter var(--t-fast); }
.drop-plan-link:hover { filter: brightness(1.08); }
.drop-plan-link .lc { opacity: .7; }
.drop-sub {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 9px 10px;
  background: none; border: none; border-radius: var(--radius-sm); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left;
}
.drop-sub span { flex: 1; }
.drop-sub .lc { color: var(--muted); }
.drop-sub:hover { background: var(--hover); }

/* ---------- Ô tìm kiếm danh sách (Thư viện / Playlist) ---------- */
.ls-box { position: relative; max-width: 420px; margin: 0 0 14px; }
.ls-box .ls-input { padding-left: 42px; padding-right: 42px; border-radius: 999px; }
.ls-box .ls-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.ls-box .ls-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); display: flex; pointer-events: none; }
.ls-box .ls-input:focus ~ .ls-ic, .ls-box:focus-within .ls-ic { color: var(--text); }
.ls-box .ls-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; min-height: 0; }
.ls-box .ls-clear[hidden] { display: none; }
.modal .ls-box { max-width: none; margin: 4px 0 10px; }
.ls-hide { display: none !important; }
.ls-empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.ls-empty[hidden] { display: none; }
@media (max-width: 720px) { .ls-box { max-width: none; } }
