@charset "UTF-8";
/* =====================================================================
   SÓNG MUSIC - stylesheet
   Design system (theo mẫu): Primary #1E6FFF · Primary Light #4DA3FF · Accent #7CEAFF
                             Surface #F4FAFF · Navy #0B1F4D · Text #1E2A44 · Subtext #64748B
   Phong cách: nền sóng xanh nhạt, các khối "kính mờ" (trắng trong suốt + blur), bo góc lớn.

   Mục lục:
     1. Biến & reset            8. Trang chủ / tìm kiếm / thư viện / upload
     2. Khung ứng dụng          9. Cột "Đang phát"
     3. Sidebar                10. Thanh player
     4. Topbar                 11. Menu, dialog, toast, flash
     5. Thành phần dùng chung  12. Đăng nhập / trang lỗi
     6. Trang chi tiết         13. Trang quản trị
     7. Danh sách bài hát      14. Responsive (≤1280, ≤1024, ≤768 điện thoại)
   ===================================================================== */

/* ---------- 1. Biến & reset ---------- */
:root {
    --primary: #1E6FFF;
    --primary-dark: #1557D6;
    --primary-light: #4DA3FF;
    --accent: #7CEAFF;
    --surface: #F4FAFF;
    --navy: #0B1F4D;
    --text: #1E2A44;
    --text-sub: #64748B;
    --text-dim: #9AA8BC;
    --white: #FFFFFF;
    --line: rgba(30, 111, 255, .10);
    --hover: rgba(30, 111, 255, .07);
    --active: rgba(30, 111, 255, .13);
    --primary-soft: #E3EEFF;
    --danger: #E5484D;

    --glass: rgba(255, 255, 255, .62);
    --glass-strong: rgba(255, 255, 255, .82);
    --glass-border: rgba(255, 255, 255, .75);
    --blur: blur(18px) saturate(140%);
    --shadow: 0 8px 30px rgba(30, 80, 170, .10);
    --shadow-lg: 0 18px 50px rgba(20, 60, 140, .20);
    --grad-primary: linear-gradient(135deg, #4DA3FF, #1E6FFF);
    --grad-deep: linear-gradient(160deg, #3D8BFF 0%, #1E6FFF 45%, #1546B8 100%);

    --radius-lg: 24px;
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-w: 260px;
    --now-w: 340px;
    --topbar-h: 64px;
    --player-h: 84px;
    --gap: 16px;
    --font: "Inter", "Segoe UI", "SF Pro Display", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    color: var(--text); font-family: var(--font); font-size: 14px; overflow: hidden;
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
    /* Nền: xanh nhạt + vài vệt sáng như mặt nước */
    background:
        radial-gradient(1200px 500px at 10% 110%, rgba(77, 163, 255, .35), transparent 60%),
        radial-gradient(900px 420px at 95% 105%, rgba(124, 234, 255, .35), transparent 60%),
        radial-gradient(700px 360px at 85% -10%, rgba(77, 163, 255, .25), transparent 60%),
        linear-gradient(180deg, #EEF6FF 0%, #E4F0FF 100%);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.icon { width: 24px; height: 24px; flex: none; fill: currentColor; }
.icon-sm { width: 16px; height: 16px; }
.icon-xs { width: 12px; height: 12px; }
.muted { color: var(--text-sub); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(30, 111, 255, .18); border: 3px solid transparent; background-clip: padding-box; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(30, 111, 255, .32); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Khối kính mờ dùng chung */
.glass, .sidebar, .main, .now-panel, .player {
    background: var(--glass);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

/* ---------- 2. Khung ứng dụng ---------- */
.app {
    display: grid;
    height: 100vh;
    height: 100dvh;
    padding: var(--gap);
    gap: var(--gap);
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--player-h);
    grid-template-areas:
        "side   top"
        "side   main"
        "player player";
}
.app.now-open {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--now-w);
    grid-template-areas:
        "side   top    now"
        "side   main   now"
        "player player player";
}
.sidebar { grid-area: side; }
.topbar { grid-area: top; }
.main { grid-area: main; }
.now-panel { grid-area: now; }
.player { grid-area: player; }
.app:not(.now-open) .now-panel { display: none; }
.bottom-nav { display: none; }

.main { position: relative; overflow-y: auto; overflow-x: hidden; min-height: 0; border-radius: var(--radius-lg); }

@media (min-width: 769px) { .show-mobile { display: none !important; } }

/* ---------- 3. Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-radius: var(--radius-lg); padding: 22px 14px 14px; }
.sidebar-head { padding: 0 10px 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; letter-spacing: -.6px; color: var(--navy); }
.brand .logo { width: 46px; height: 32px; }
.brand-tagline { margin-top: 6px; font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--text-sub); }

.side-nav { display: grid; gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.nav-link { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--text); text-align: left; transition: background .15s, color .15s; }
.nav-link .icon { width: 22px; height: 22px; color: var(--text-sub); }
.nav-link:hover { background: var(--hover); }
.nav-link.is-active { background: linear-gradient(90deg, rgba(77, 163, 255, .35), rgba(77, 163, 255, .18)); color: var(--primary-dark); }
.nav-link.is-active .icon { color: var(--primary); }

.library { flex: 1; overflow-y: auto; padding-top: 12px; margin: 0 -6px; padding-left: 6px; padding-right: 6px; }
.side-label { font-size: 13px; font-weight: 600; color: var(--text-sub); padding: 6px 12px; }
.side-group { margin-top: 10px; }
.side-group summary { display: flex; align-items: center; cursor: pointer; list-style: none; border-radius: 10px; padding-right: 8px; }
.side-group summary::-webkit-details-marker { display: none; }
.side-group summary:hover { background: var(--hover); }
.side-group summary .side-label { flex: 1; padding: 8px 12px; }
.side-group .chev { width: 18px; height: 18px; color: var(--text-sub); transition: transform .2s; }
.side-group:not([open]) .chev { transform: rotate(-90deg); }
.mini-add { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--primary); background: var(--white); box-shadow: 0 2px 8px rgba(30, 111, 255, .15); margin-right: 6px; }
.mini-add .icon { width: 18px; height: 18px; }
.library-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 10px; border-radius: 12px; text-align: left; }
.library-item:hover { background: var(--hover); }
.library-item.is-active { background: var(--active); }
.library-item .cover { width: 42px; height: 42px; border-radius: 10px; }
.library-item .cover.is-round { border-radius: 50%; }
.library-item-text { display: grid; min-width: 0; }
.library-item-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library-item-sub { font-size: 12px; color: var(--text-sub); }
.library-item.new-item { color: var(--primary-dark); }
.library-item.new-item .icon { width: 22px; height: 22px; margin: 0 10px; }

/* ---------- 4. Topbar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; min-width: 0; }
.history-btns { display: flex; gap: 8px; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--glass-strong); border: 1px solid var(--glass-border); color: var(--text); box-shadow: 0 4px 14px rgba(30, 80, 170, .10); transition: background .15s, color .15s; }
.round-btn:hover { background: var(--white); color: var(--primary); }
.round-btn .icon { width: 22px; height: 22px; }

.search-box { position: relative; flex: 1; max-width: 720px; display: flex; align-items: center; }
.search-box > .icon { position: absolute; left: 16px; color: var(--text-sub); width: 22px; height: 22px; pointer-events: none; }
.search-box input {
    width: 100%; height: 48px; padding: 0 20px 0 48px;
    background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 500px; outline: none;
    box-shadow: 0 4px 14px rgba(30, 80, 170, .08); transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(77, 163, 255, .2); }
.search-box input::placeholder { color: var(--text-sub); }

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.user-menu { position: relative; }
.avatar-btn { width: 44px; height: 44px; border-radius: 50%; padding: 3px; background: var(--white); box-shadow: 0 4px 14px rgba(30, 80, 170, .15); }
.avatar { width: 100%; height: 100%; border-radius: 50%; background: var(--grad-primary); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.avatar.sm { width: 34px; height: 34px; flex: none; font-size: 13px; }

/* ---------- 5. Thành phần dùng chung ---------- */
.page { --hero-rgb: 77, 163, 255; min-height: 100%; }
.content { padding: 24px 28px 36px; }

.cover { position: relative; overflow: hidden; background: linear-gradient(135deg, #DCEBFF, #BFDBFF); color: var(--primary-light); display: grid; place-items: center; flex: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .icon { width: 45%; height: 45%; }
.cover.is-round { border-radius: 50% !important; }
.cover.is-liked { background: linear-gradient(135deg, #7C9CFF, #4DA3FF 55%, #7CEAFF); color: #fff; }

/* Nút chính dạng viên thuốc (Play) */
.play-pill { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 28px; border-radius: 500px; background: var(--grad-primary); color: #fff; font-weight: 700; font-size: 16px; box-shadow: 0 10px 22px rgba(30, 111, 255, .35); transition: transform .12s, box-shadow .15s; }
.play-pill:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(30, 111, 255, .45); }
.play-pill .icon { width: 22px; height: 22px; }
.play-pill .icon-pause, .play-pill .label-pause { display: none; }
.play-pill.is-active .icon-play, .play-pill.is-active .label-play { display: none; }
.play-pill.is-active .icon-pause, .play-pill.is-active .label-pause { display: inline; }
/* Nút phụ trắng viền (Shuffle, Save) */
.ghost-pill { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 500px; background: var(--glass-strong); border: 1px solid var(--glass-border); color: var(--text); font-weight: 600; font-size: 15px; box-shadow: 0 4px 14px rgba(30, 80, 170, .10); transition: background .15s, color .15s; }
.ghost-pill:hover { background: var(--white); color: var(--primary); }
.ghost-pill .icon { width: 22px; height: 22px; }
.ghost-pill.is-on-dark { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .7); color: #fff; box-shadow: none; }
.ghost-pill.is-on-dark:hover { background: rgba(255, 255, 255, .28); color: #fff; }

.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 500px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; white-space: nowrap; transition: background .15s; }
.pill-btn:hover { background: #D2E3FF; }
.pill-btn .icon { width: 18px; height: 18px; }
.pill-btn.is-primary { background: var(--primary); color: #fff; }
.pill-btn.is-danger { background: transparent; color: var(--danger); border: 1px solid rgba(229, 72, 77, .5); }
.pill-btn.is-danger:hover { background: rgba(229, 72, 77, .08); }
.pill-btn.is-disabled { opacity: .4; pointer-events: none; }
button.pill-btn:disabled { opacity: .5; cursor: progress; }

.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 500px; background: var(--white); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 13px; white-space: nowrap; }
.chip:hover { border-color: var(--primary-light); color: var(--primary); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Nút play tròn nhỏ trên card */
.play-fab { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--white); color: var(--primary); box-shadow: 0 6px 16px rgba(11, 31, 77, .25); transition: transform .12s; }
.play-fab:hover { transform: scale(1.08); }
.play-fab .icon { width: 22px; height: 22px; }

.section { margin-top: 34px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; color: var(--navy); }
.section-sub { color: var(--text-sub); margin-top: 2px; }
.section-head > a { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 700; font-size: 14px; }
.genre-chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* Lưới card và hàng card cuộn ngang */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.card-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; margin: 0 -2px; scrollbar-width: thin; }
.card-row > * { scroll-snap-align: start; }
.card { position: relative; min-width: 0; }
.card-art { position: relative; }
.card .cover { width: 100%; aspect-ratio: 1; border-radius: 18px; box-shadow: 0 10px 24px rgba(30, 80, 170, .18); transition: transform .2s; }
.card:hover .cover { transform: translateY(-3px); }
.card .play-fab { position: absolute; z-index: 2; right: 10px; bottom: 10px; }
.card-title { display: block; margin-top: 10px; font-weight: 700; font-size: 15px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { margin-top: 2px; color: var(--text-sub); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-link::after { content: ""; position: absolute; inset: 0; }   /* cả card bấm được */
.card .card-sub a { position: relative; z-index: 2; }
.card.is-current .card-title { color: var(--primary); }

.list-card { background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 10px; box-shadow: var(--shadow); }

.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .icon { width: 64px; height: 64px; color: var(--primary-light); margin-bottom: 16px; }
.empty-state h3 { font-size: 22px; color: var(--navy); margin-bottom: 8px; }
.empty-state p { color: var(--text-sub); margin-bottom: 24px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 30px; border-radius: 500px; font-weight: 700; font-size: 16px; transition: transform .1s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad-primary); color: #fff; box-shadow: 0 10px 22px rgba(30, 111, 255, .3); }
.btn-light { background: var(--white); color: var(--text); border: 1px solid var(--line); }
.btn-light:hover { color: var(--primary); border-color: var(--primary-light); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }

.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: 14px; color: var(--navy); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input { width: 100%; height: 46px; padding: 0 14px; background: var(--white); border: 1px solid #D5E3F7; border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(77, 163, 255, .18); }
select.input { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--text-sub) 50%), linear-gradient(135deg, var(--text-sub) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input-sm { height: 36px; padding: 0 10px; width: auto; min-width: 150px; }
.form-error { padding: 12px 16px; margin-bottom: 16px; border-radius: 12px; background: #FDECEC; color: #B42318; border: 1px solid #F9C9C9; font-weight: 600; }
.form-info { padding: 12px 16px; margin-bottom: 16px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); border: 1px solid #C7DCFF; font-weight: 600; }
.checkbox { display: flex; align-items: center; gap: 10px; margin: 8px 0 16px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.progress { height: 6px; border-radius: 3px; background: #D5E3F7; overflow: hidden; margin: 16px 0; }
.progress > div { height: 100%; width: 0; background: var(--grad-primary); transition: width .2s; }
.page-intro { margin-bottom: 8px; }
.page-heading { font-size: 34px; font-weight: 800; letter-spacing: -.8px; color: var(--navy); margin-bottom: 4px; }
.narrow-wrap { max-width: 480px; }
.narrow-wrap .lead { color: var(--text-sub); margin-bottom: 24px; }

/* ---------- 6. Trang chi tiết (album, playlist, nghệ sĩ...) ---------- */
.hero {
    display: flex; align-items: center; gap: 30px;
    padding: 32px 32px 26px;
    color: var(--navy);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .75) 85%),
        linear-gradient(120deg, rgba(var(--hero-rgb), .45), rgba(124, 234, 255, .25)),
        url("../img/hero-waves.svg") right center / cover no-repeat;
}
.hero .cover { width: 230px; height: 230px; border-radius: 22px; box-shadow: 0 18px 40px rgba(20, 60, 140, .3); border: 4px solid rgba(255, 255, 255, .7); }
.hero-text { min-width: 0; }
.hero-type { font-size: 13px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase; color: var(--text); }
.hero-title { font-size: clamp(32px, 4.6vw, 64px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin: 8px 0 12px; overflow-wrap: anywhere; color: var(--navy); }
.hero-title.is-editable { cursor: pointer; }
.hero-desc { color: var(--text-sub); margin-bottom: 8px; max-width: 640px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 15px; color: var(--text); }
.hero-meta strong a { font-weight: 700; color: var(--navy); }
.hero-meta strong a:hover { color: var(--primary); }
.hero-meta .dot::before { content: "•"; margin: 0 6px; color: var(--text-sub); }
.hero-meta .sub { color: var(--text-sub); }

.page-body { padding-bottom: 8px; }
.action-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 22px 32px; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; color: var(--text); display: grid; place-items: center; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: 0 4px 14px rgba(30, 80, 170, .10); transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--primary); background: var(--white); }
.icon-btn .icon { width: 22px; height: 22px; }
.page-body .content { padding-top: 0; }

/* ---------- 7. Danh sách bài hát ---------- */
.tracklist { --cols: 28px minmax(160px, 4fr) minmax(120px, 2fr) 40px 56px 36px; background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 8px; box-shadow: var(--shadow); }
.list-card .tracklist { background: none; border: 0; box-shadow: none; padding: 0; }
.tracklist.no-album { --cols: 28px minmax(160px, 1fr) 40px 56px 36px; }
.tracklist-head, .track-row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 16px; padding: 0 14px; }
.tracklist-head { height: 40px; border-bottom: 1px solid var(--line); margin-bottom: 6px; color: var(--text-sub); font-size: 13px; }
.tracklist-head .icon { width: 16px; height: 16px; }
.track-row { height: 56px; border-radius: 12px; color: var(--text-sub); user-select: none; border-bottom: 1px solid rgba(30, 111, 255, .05); }
.track-row:hover { background: var(--hover); }
.track-row.is-current { background: linear-gradient(90deg, rgba(77, 163, 255, .22), rgba(77, 163, 255, .10)); }

.track-index { position: relative; text-align: center; font-size: 15px; font-weight: 600; color: var(--text); }
.track-index .row-play { display: none; position: absolute; inset: 0; margin: auto; width: 24px; height: 24px; color: var(--primary); }
.track-index .row-play .icon { width: 20px; height: 20px; }
.track-row:hover .track-index .num, .track-row:hover .track-index .eq { visibility: hidden; }
.track-row:hover .track-index .row-play { display: grid; place-items: center; }
/* Sóng nhạc nhảy ở bài đang phát */
.eq { display: none; position: absolute; inset: 0; margin: auto; width: 18px; height: 16px; align-items: flex-end; justify-content: center; gap: 2px; }
.eq i { width: 3px; height: 40%; background: var(--primary); border-radius: 2px; }
.track-row.is-current .num { display: none; }
.track-row.is-current .eq { display: flex; }
body.is-playing .track-row.is-current .eq i { animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s !important; height: 80%; }
.eq i:nth-child(3) { animation-delay: .4s !important; height: 60%; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

.track-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.track-main .cover { width: 42px; height: 42px; border-radius: 10px; }
.track-text { min-width: 0; }
.track-title { color: var(--navy); font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-row.is-current .track-title { color: var(--primary); }
.track-artist, .track-album { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.track-artist a:hover, .track-album a:hover { color: var(--primary); }
.track-duration { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }

.like-btn { color: var(--text-sub); display: grid; place-items: center; transition: transform .12s; }
.like-btn:hover { transform: scale(1.1); color: var(--primary); }
.like-btn .icon { width: 22px; height: 22px; }
.like-btn .icon-on { display: none; }
.like-btn.is-liked { color: var(--primary); }
.like-btn.is-liked .icon-on { display: block; }
.like-btn.is-liked .icon-off { display: none; }

.row-more { color: var(--text-sub); display: grid; place-items: center; }
.row-more .icon { width: 20px; height: 20px; }
.row-more:hover { color: var(--primary); }

/* Thịnh hành: chia 2 cột trên màn hình rộng */
.tracklist.is-two-col { columns: 2; column-gap: 28px; column-rule: 1px solid var(--line); }
.tracklist.is-two-col .tracklist-head { display: none; }
.tracklist.is-two-col .track-row { break-inside: avoid; --cols: 28px minmax(120px, 1fr) 36px 48px 32px; }

/* ---------- 8. Trang chủ / tìm kiếm / thư viện / upload ---------- */
.greeting-block { margin-bottom: 18px; }
.greeting { font-size: 30px; font-weight: 800; letter-spacing: -.6px; color: var(--navy); }

.feature-banner {
    position: relative; display: flex; align-items: center; min-height: 270px; padding: 40px 44px;
    border-radius: var(--radius-lg); overflow: hidden; color: #fff;
    background:
        linear-gradient(90deg, rgba(21, 70, 184, .85) 0%, rgba(30, 111, 255, .55) 45%, rgba(30, 111, 255, 0) 75%),
        url("../img/hero-waves.svg") center / cover no-repeat;
    box-shadow: 0 18px 40px rgba(30, 111, 255, .28);
    border: 2px solid rgba(255, 255, 255, .7);
}
.feature-text { max-width: 520px; position: relative; z-index: 1; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase; opacity: .9; }
.feature-banner h2 { font-size: clamp(32px, 3.3vw, 56px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin: 8px 0 12px; }
.feature-banner p { font-size: 16px; opacity: .92; margin-bottom: 22px; }
.feature-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.play-pill.is-light-shadow { background: var(--white); color: var(--primary); box-shadow: 0 10px 22px rgba(11, 31, 77, .25); }
.feature-note { font-weight: 600; }
.feature-badge { position: absolute; top: 22px; right: 22px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 500px; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .55); font-weight: 600; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.feature-badge .icon { width: 18px; height: 18px; }
.feature-fab { position: absolute; z-index: 2; /* nổi trên đoạn chữ của banner, nếu không sẽ không bấm được trên điện thoại */ right: 18px; bottom: 18px; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--white); color: var(--primary); box-shadow: 0 8px 18px rgba(11, 31, 77, .3); }

.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.genre-tile {
    --tile: #1E6FFF;
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 1.75;
    border-radius: 20px; padding: 18px; color: #fff; overflow: hidden;
    background:
        url("../img/hero-waves.svg") right bottom / 200% auto no-repeat,
        linear-gradient(135deg, var(--tile), #4DA3FF);
    background-blend-mode: soft-light, normal;
    box-shadow: 0 10px 24px rgba(30, 80, 170, .18);
    transition: transform .2s;
}
.genre-tile:hover { transform: translateY(-3px); }
.genre-tile span { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.genre-tile small { opacity: .85; }

.search-top { display: grid; grid-template-columns: minmax(260px, 2fr) 3fr; gap: 24px; }
.top-result { position: relative; padding: 22px; border-radius: var(--radius-lg); background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.top-result .cover { width: 96px; height: 96px; border-radius: 16px; box-shadow: var(--shadow); }
.top-result h3 { font-size: 28px; color: var(--navy); margin: 18px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-result .sub { color: var(--text-sub); }
.top-result .sub .tag { background: var(--primary-soft); color: var(--primary-dark); padding: 4px 12px; border-radius: 500px; font-weight: 700; margin-left: 8px; }
.top-result .play-fab { position: absolute; right: 22px; bottom: 22px; background: var(--primary); color: #fff; }

.shortcut-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.shortcut { display: grid; justify-items: center; gap: 4px; padding: 22px 12px; border-radius: 20px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); text-align: center; transition: transform .2s; }
.shortcut:hover { transform: translateY(-3px); }
.shortcut .icon { width: 34px; height: 34px; color: var(--primary); margin-bottom: 6px; }
.shortcut strong { color: var(--navy); }
.shortcut span { color: var(--text-sub); font-size: 13px; }
.row-list { display: grid; gap: 4px; }
.row-link { display: flex; align-items: center; gap: 14px; padding: 8px; border-radius: 14px; }
.row-link:hover { background: var(--hover); }
.row-link .cover { width: 54px; height: 54px; border-radius: 12px; }
.row-text { flex: 1; min-width: 0; display: grid; }
.row-text strong { color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-text small { color: var(--text-sub); }
.row-chev { color: var(--text-sub); }

.upload-wrap { max-width: 900px; }
.upload-wrap h1 { font-size: 32px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.upload-wrap .lead { color: var(--text-sub); margin-bottom: 24px; }
.upload-grid { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.cover-picker { position: relative; width: 220px; height: 220px; border-radius: 22px; background: var(--white); border: 2px dashed #B9D2F5; display: grid; place-items: center; color: var(--text-sub); cursor: pointer; overflow: hidden; }
.cover-picker:hover { color: var(--primary); border-color: var(--primary-light); }
.cover-picker img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-picker .hint { text-align: center; display: grid; justify-items: center; gap: 8px; }
.cover-picker .icon { width: 44px; height: 44px; }
.drop-zone { display: flex; align-items: center; gap: 16px; padding: 20px; border: 2px dashed #B9D2F5; border-radius: 18px; cursor: pointer; background: var(--white); transition: border-color .15s, background .15s; margin-bottom: 16px; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--primary-light); background: var(--primary-soft); }
.drop-zone .icon { width: 40px; height: 40px; color: var(--primary); }
.drop-zone strong { display: block; font-size: 15px; color: var(--navy); }
.drop-zone span { color: var(--text-sub); }

/* ---------- 9. Cột "Đang phát" ---------- */
.now-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-radius: var(--radius-lg); }
.now-panel-head { display: flex; align-items: center; gap: 6px; padding: 14px 14px 10px; }
.now-panel-head .tab { padding: 8px 16px; border-radius: 500px; font-weight: 700; font-size: 13px; color: var(--text); }
.now-panel-head .tab.is-active { background: var(--grad-primary); color: #fff; box-shadow: 0 6px 14px rgba(30, 111, 255, .3); }
.now-panel-head .round-btn { margin-left: auto; width: 34px; height: 34px; }
.now-panel-head .round-btn .icon { width: 18px; height: 18px; }
.now-panel-body { flex: 1; overflow-y: auto; padding: 0 14px 14px; }

.np-hero { padding: 16px; border-radius: 22px; background: var(--grad-deep); color: #fff; box-shadow: 0 16px 34px rgba(30, 111, 255, .35); }
.np-cover { width: 100%; aspect-ratio: 1; border-radius: 18px; box-shadow: 0 12px 28px rgba(11, 31, 77, .35); background: rgba(255, 255, 255, .18); color: #fff; }
.np-cover .icon { width: 30%; height: 30%; }
.np-info { display: flex; align-items: center; gap: 12px; margin: 16px 0 10px; }
.np-text { flex: 1; min-width: 0; }
.np-title { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { display: block; opacity: .85; font-size: 14px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-hero .like-btn { color: rgba(255, 255, 255, .85); }
.np-hero .like-btn.is-liked { color: #fff; }
.np-hero .like-btn .icon { width: 26px; height: 26px; }
.np-hero .seek-row { color: rgba(255, 255, 255, .85); }
.np-hero .control-buttons { justify-content: space-between; margin-top: 8px; }
.np-hero .ctrl { color: rgba(255, 255, 255, .9); }
.np-hero .ctrl:hover { color: #fff; }
.np-hero .ctrl.is-on { color: var(--accent); }
.np-hero .ctrl.is-on::after { background: var(--accent); }
.np-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.np-actions button { display: grid; justify-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; background: rgba(255, 255, 255, .12); font-size: 12px; color: rgba(255, 255, 255, .92); }
.np-actions button:hover { background: rgba(255, 255, 255, .22); }
.np-actions .icon { width: 22px; height: 22px; }

.np-card { margin-top: 14px; padding: 14px; border-radius: 20px; background: var(--glass-strong); border: 1px solid var(--glass-border); }
.np-card h3 { font-size: 16px; color: var(--navy); margin-bottom: 8px; }
.np-queue li { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 12px; cursor: pointer; }
.np-queue li:hover { background: var(--hover); }
.np-queue .cover { width: 42px; height: 42px; border-radius: 10px; }
.np-queue .q-text { flex: 1; min-width: 0; }
.np-queue .q-title { font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-queue .q-artist { font-size: 12px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-queue .q-time { font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.np-queue .q-empty { color: var(--text-sub); cursor: default; }
.np-queue .q-empty:hover { background: none; }

/* ---------- 10. Thanh player ---------- */
.player {
    display: grid; grid-template-columns: minmax(200px, 28%) minmax(360px, 1fr) minmax(200px, 28%);
    align-items: center; gap: 16px; padding: 0 22px; border-radius: var(--radius-lg);
    background: var(--glass-strong);
}
.now-playing { display: flex; align-items: center; gap: 14px; min-width: 0; }
.now-playing .cover { width: 60px; height: 60px; border-radius: 14px; box-shadow: 0 6px 16px rgba(30, 80, 170, .2); }
.now-text { min-width: 0; }
.now-title { display: block; font-size: 16px; font-weight: 800; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-artist { display: block; font-size: 13px; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-artist:hover { color: var(--primary); }
.player.is-empty .now-playing > *:not(.cover) { visibility: hidden; }

.controls { display: flex; align-items: center; gap: 22px; }
.control-buttons { display: flex; align-items: center; gap: 14px; }
.ctrl { color: var(--text); position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; }
.ctrl:hover { color: var(--primary); }
.ctrl .icon { width: 22px; height: 22px; }
.ctrl.is-on { color: var(--primary); }
.ctrl.is-on::after { content: ""; position: absolute; bottom: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.ctrl-play { width: 48px; height: 48px; border-radius: 50%; flex: none; background: var(--grad-primary); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px rgba(30, 111, 255, .4); transition: transform .12s; }
.ctrl-play:hover { transform: scale(1.06); }
.ctrl-play .icon { width: 24px; height: 24px; }
.ctrl-play.is-white { background: #fff; color: var(--primary); box-shadow: 0 10px 22px rgba(11, 31, 77, .3); }
.ctrl-play .icon-pause, body.is-playing .ctrl-play .icon-play { display: none; }
body.is-playing .ctrl-play .icon-pause { display: block; }
.control-buttons.is-large .ctrl-play { width: 60px; height: 60px; }
.control-buttons.is-large .ctrl-play .icon { width: 28px; height: 28px; }

.seek-row { display: flex; align-items: center; gap: 10px; flex: 1; font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.seek-row span { min-width: 36px; }
.seek-row span:first-child { text-align: right; }

.range { --fill: 0%; flex: 1; min-width: 0; height: 16px; appearance: none; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(to right, var(--primary) var(--fill), #D5E3F7 var(--fill)); }
.range::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--primary); margin-top: -6px; box-shadow: 0 2px 6px rgba(30, 111, 255, .4); }
.range::-moz-range-track { height: 5px; border-radius: 3px; background: #D5E3F7; }
.range::-moz-range-progress { height: 5px; border-radius: 3px; background: var(--primary); }
.range::-moz-range-thumb { width: 10px; height: 10px; border: 4px solid var(--primary); border-radius: 50%; background: #fff; }
.range.is-light::-webkit-slider-runnable-track { background: linear-gradient(to right, #fff var(--fill), rgba(255, 255, 255, .3) var(--fill)); }
.range.is-light::-webkit-slider-thumb { border-color: #fff; background: #fff; }
.range.is-light::-moz-range-track { background: rgba(255, 255, 255, .3); }
.range.is-light::-moz-range-progress { background: #fff; }

.player-extra { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.player-extra .range { flex: 0 0 110px; }
.player-extra .ctrl.is-on::after { display: none; }

/* ---------- 11. Menu, dialog, toast, flash ---------- */
.dropdown, .context-menu { background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: 16px; padding: 6px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 250px; z-index: 80; }
.dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dropdown-head strong { display: block; color: var(--navy); }
.dropdown-head span { color: var(--text-sub); font-size: 12px; }
.dropdown-item, .context-menu button, .context-menu a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 10px; text-align: left; }
.dropdown-item:hover, .context-menu button:hover, .context-menu a:hover { background: var(--hover); color: var(--primary); }
.dropdown-item .icon { width: 18px; height: 18px; color: var(--text-sub); }
.context-menu { position: fixed; z-index: 100; min-width: 230px; max-width: 320px; max-height: 360px; overflow-y: auto; }
.context-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.context-menu .menu-title { padding: 8px 12px; font-size: 12px; color: var(--text-sub); font-weight: 700; }

dialog.modal { margin: auto; width: min(500px, 92vw); border: 0; border-radius: var(--radius-lg); background: var(--white); color: var(--text); padding: 26px; box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(11, 31, 77, .4); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-head h2 { font-size: 22px; color: var(--navy); }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--player-h) + 32px); transform: translate(-50%, 20px); padding: 12px 20px; border-radius: 500px; background: var(--navy); color: #fff; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200; box-shadow: var(--shadow-lg); max-width: 90vw; text-align: center; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

.flash { margin: 16px 28px 0; padding: 12px 16px; border-radius: 14px; font-weight: 600; }
.flash.is-success { background: #E7F8EE; color: #15803D; border: 1px solid #BBE5C9; }
.flash.is-error { background: #FDECEC; color: #B42318; border: 1px solid #F9C9C9; }

/* ---------- 12. Đăng nhập / trang lỗi ---------- */
.auth-page { overflow: auto; min-height: 100vh; padding: 40px 16px; }
.auth-card { max-width: 520px; margin: 0 auto; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); border-radius: 28px; padding: 44px 28px 48px; text-align: center; box-shadow: var(--shadow-lg); }
.auth-card .brand { justify-content: center; font-size: 30px; }
.auth-card h1 { font-size: 28px; font-weight: 800; color: var(--navy); margin: 18px 0 28px; letter-spacing: -.6px; }
.auth-form { max-width: 360px; margin: 0 auto; text-align: left; }
.auth-form .btn { width: 100%; margin-top: 8px; }
.auth-switch { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--text-sub); text-align: center; }
.auth-switch a { color: var(--primary); font-weight: 700; }

.error-page { display: grid; place-items: center; text-align: center; min-height: 60vh; padding: 48px 24px; }
.error-page .code { font-size: 104px; font-weight: 900; letter-spacing: -4px; background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page p { color: var(--text-sub); margin: 8px 0 32px; font-size: 16px; }

/* ---------- 13. Trang quản trị ---------- */
.admin-head { margin-bottom: 20px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.admin-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 500px; background: var(--white); border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.admin-tab .icon { width: 18px; height: 18px; color: var(--text-sub); }
.admin-tab:hover { color: var(--primary); }
.admin-tab.is-active { background: var(--grad-primary); color: #fff; border-color: transparent; }
.admin-tab.is-active .icon { color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { padding: 18px; border-radius: 20px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.stat-card span { display: block; color: var(--text-sub); font-size: 13px; margin-bottom: 8px; }
.stat-card strong { font-size: 28px; letter-spacing: -.5px; color: var(--primary); }

.admin-columns { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; margin-bottom: 16px; }
.admin-box { padding: 20px; border-radius: 20px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); margin-bottom: 16px; }
.admin-columns .admin-box { margin-bottom: 0; }
.admin-box h2 { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; color: var(--navy); margin-bottom: 16px; }
.admin-box h2 small, .admin-box h2 a { font-size: 13px; font-weight: 600; color: var(--primary); }
.empty-row { padding: 24px; text-align: center; }

.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 20px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar-fill { width: 100%; min-height: 4px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #7CEAFF, #1E6FFF); transition: height .4s; }
.bar-value, .bar-label { font-size: 12px; color: var(--text-sub); }

.mini-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li > div { flex: 1; min-width: 0; }
.mini-list small, .cell-media small { display: block; color: var(--text-sub); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-search { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-search .input { max-width: 360px; height: 42px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--glass-strong); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.admin-table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-sub); text-transform: uppercase; letter-spacing: .5px; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:hover td { background: var(--hover); }
.admin-table tr.is-disabled td { opacity: .55; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .actions { text-align: right; white-space: nowrap; }
.admin-table tr.is-current strong { color: var(--primary); }
.cell-media { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-media strong { color: var(--navy); }
.cell-media .cover { width: 40px; height: 40px; border-radius: 10px; }
.row-play-admin { color: var(--text-sub); display: grid; place-items: center; }
.row-play-admin:hover { color: var(--primary); }
.row-play-admin .icon { width: 18px; height: 18px; }

.badge { display: inline-block; padding: 4px 11px; border-radius: 500px; font-size: 12px; font-weight: 700; background: #EEF2F8; color: var(--text-sub); white-space: nowrap; }
.badge.is-ok { background: #E7F8EE; color: #15803D; }
.badge.is-danger { background: #FDECEC; color: #B42318; }
.badge.is-warning { background: #FEF3C7; color: #B45309; }
.badge.role-ADMIN { background: #EDE9FE; color: #6D28D9; }
.badge.role-ARTIST { background: var(--primary-soft); color: var(--primary-dark); }

.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 24px 0; color: var(--text-sub); }
.genre-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.genre-form .input { max-width: 280px; }
.genre-form.inline { flex-wrap: nowrap; }
.color-input { width: 40px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }

/* =====================================================================
   14. Responsive
   ===================================================================== */

/* ----- ≤1280: cột "Đang phát" nổi lên đè nội dung ----- */
@media (max-width: 1280px) {
    .app.now-open {
        grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
        grid-template-areas: "side top" "side main" "player player";
    }
    .app.now-open .now-panel {
        position: fixed; z-index: 40;
        right: calc(var(--gap) + 8px); top: calc(var(--gap) + var(--topbar-h) + 8px); bottom: calc(var(--player-h) + var(--gap) * 2);
        width: var(--now-w); background: rgba(255, 255, 255, .9); box-shadow: var(--shadow-lg);
    }
    .tracklist.is-two-col { columns: 1; }
}

/* ----- ≤1024 (tablet): sidebar chỉ còn icon ----- */
@media (max-width: 1024px) {
    :root { --sidebar-w: 84px; --gap: 12px; }
    .sidebar { padding: 18px 10px; align-items: center; }
    .sidebar-head { padding: 0 0 14px; }
    .brand span, .brand-tagline, .nav-link span, .side-label, .library-item-text, .library-item .library-item-title, .mini-add { display: none; }
    .nav-link { justify-content: center; padding: 12px; }
    .side-group summary { justify-content: center; padding: 6px; }
    .library-item { justify-content: center; padding: 6px; }
    .library { width: 100%; }
    .tracklist { --cols: 28px minmax(160px, 1fr) 40px 56px 36px; }
    .tracklist .track-album, .tracklist .col-album { display: none; }
    .search-top, .admin-columns { grid-template-columns: 1fr; }
    .player { grid-template-columns: minmax(170px, 1fr) minmax(300px, 1.5fr) auto; padding: 0 16px; }
    .controls .seek-row { display: none; }
    .player-extra .range { display: none; }
}

/* ----- ≤768: ĐIỆN THOẠI ----- */
@media (max-width: 768px) {
    :root { --topbar-h: 60px; --player-h: 64px; --bottom-nav-h: 64px; }
    .hide-mobile { display: none !important; }

    .app, .app.now-open {
        padding: 0;
        gap: 0;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: var(--topbar-h) minmax(0, 1fr) auto auto;
        grid-template-areas: "top" "main" "player" "nav";
    }
    .sidebar { display: none; }   /* điện thoại dùng trang /library thay cho sidebar */
    .main { border-radius: 0; border: 0; box-shadow: none; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }

    .topbar { padding: calc(env(safe-area-inset-top)) 16px 0; }
    .topbar .brand .logo { width: 40px; height: 28px; }
    .topbar .search-box { display: none; }
    .avatar-btn { width: 40px; height: 40px; }

    /* Màn "Đang phát" toàn màn hình, nền xanh như mẫu */
    .app .now-panel, .app.now-open .now-panel {
        display: flex; position: fixed; inset: 0; z-index: 70; width: auto; border-radius: 0; border: 0;
        transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
        background: var(--grad-deep); color: #fff;
    }
    body.now-sheet-open .now-panel { transform: none !important; }
    .now-panel-head { padding: calc(12px + env(safe-area-inset-top)) 16px 4px; justify-content: space-between; }
    .now-panel-head .round-btn { margin: 0; background: transparent; border: 0; box-shadow: none; color: #fff; }
    .now-panel-head .tab.is-active { background: none; box-shadow: none; padding: 0; font-size: 15px; }
    .np-head-spacer { width: 34px; }
    .now-panel-body { padding: 4px 24px calc(24px + env(safe-area-inset-bottom)); }
    .np-hero { background: none; box-shadow: none; padding: 0; }
    .np-cover { max-width: 420px; margin: 12px auto 0; border-radius: 24px; }
    .np-title { font-size: 26px; }
    .np-info { margin: 24px 0 14px; }
    .np-card { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); }
    .np-card h3, .np-queue .q-title { color: #fff; }
    .np-queue .q-artist, .np-queue .q-time, .np-queue .q-empty { color: rgba(255, 255, 255, .75); }
    .np-queue li:hover { background: rgba(255, 255, 255, .1); }

    /* Mini player nổi phía trên menu dưới */
    .player {
        position: relative; display: block; margin: 0 10px 8px; padding: 8px 10px;
        border-radius: 18px; box-shadow: var(--shadow-lg); background: rgba(255, 255, 255, .9);
    }
    .player.is-empty { display: none; }
    .now-playing { gap: 10px; cursor: pointer; }
    .now-playing .cover { width: 46px; height: 46px; border-radius: 12px; }
    .now-text { flex: 1; }
    .now-title { font-size: 14px; }
    .now-playing .ctrl-play { width: 40px; height: 40px; }
    .now-playing .ctrl-play .icon { width: 20px; height: 20px; }
    .mini-progress { position: absolute; left: 16px; right: 16px; bottom: 3px; height: 3px; border-radius: 3px; background: #D5E3F7; overflow: hidden; }
    .mini-progress span { display: block; height: 100%; width: 0; background: var(--primary); }

    /* Menu dưới */
    .bottom-nav {
        grid-area: nav; display: flex; justify-content: space-around;
        height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
        border-top: 1px solid var(--line);
    }
    .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-sub); }
    .bottom-nav .icon { width: 25px; height: 25px; }
    .bottom-nav .is-active { color: var(--primary); }

    /* Nội dung */
    .content { padding: 8px 16px 24px; }
    .flash { margin: 8px 16px 0; }
    .page-heading { font-size: 28px; }
    .greeting { font-size: 28px; }
    .page-search { display: flex; margin-top: 14px; }
    .page-search input { height: 46px; }
    .section { margin-top: 26px; }
    .section-head { margin-bottom: 12px; }
    .section-head h2 { font-size: 21px; }

    .feature-banner { min-height: 190px; padding: 22px 20px; border-radius: 22px; background: linear-gradient(180deg, rgba(21, 70, 184, .1), rgba(21, 70, 184, .65)), url("../img/hero-waves.svg") center / cover no-repeat; align-items: flex-end; }
    .feature-banner h2 { font-size: 30px; margin: 4px 0 6px; }
    .feature-banner p { font-size: 13px; margin-bottom: 0; padding-right: 56px; }
    .feature-actions { display: none; }

    .card-row { grid-auto-columns: 128px; gap: 12px; scrollbar-width: none; }
    .card-row::-webkit-scrollbar { display: none; }
    .card .cover { border-radius: 16px; }
    .card .play-fab { width: 34px; height: 34px; right: 8px; bottom: 8px; }
    .card .play-fab .icon { width: 18px; height: 18px; }
    .card-title { font-size: 13px; margin-top: 8px; }
    .card-sub { font-size: 12px; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

    /* "Nghe gần đây" thành danh sách dọc: ảnh nhỏ + tên + nút play */
    .card-row.as-list-mobile { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; gap: 4px; }
    .as-list-mobile .card { display: grid; grid-template-columns: 54px 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 6px 0; }
    .as-list-mobile .card-art { grid-row: 1 / span 2; position: static; }
    .as-list-mobile .card .cover { width: 54px; height: 54px; border-radius: 12px; }
    .as-list-mobile .card-title { margin-top: 0; align-self: end; padding-right: 50px; }
    .as-list-mobile .card-sub { align-self: start; padding-right: 50px; }
    .as-list-mobile .card .play-fab { right: 0; bottom: auto; top: 50%; transform: translateY(-50%); background: var(--white); }

    .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .genre-tile { border-radius: 18px; padding: 14px; }
    .genre-tile span { font-size: 18px; }
    .shortcut-grid { gap: 10px; }
    .shortcut { padding: 16px 6px; }
    .shortcut strong { font-size: 13px; }

    /* Trang chi tiết */
    .hero { flex-direction: column; align-items: flex-start; gap: 16px; padding: 22px 16px 16px; }
    .hero .cover { width: 200px; height: 200px; align-self: center; }
    .hero-type { letter-spacing: 3px; font-size: 11px; }
    .hero-title { font-size: clamp(26px, 8vw, 40px); margin: 4px 0 8px; }
    .action-bar { padding: 14px 16px; gap: 10px; }
    .play-pill, .ghost-pill { height: 44px; padding: 0 20px; font-size: 15px; }
    .icon-btn { width: 44px; height: 44px; }

    /* Danh sách bài: ảnh + tên + tim + ••• (chạm vào dòng để phát) */
    .tracklist, .tracklist.no-album, .tracklist.is-two-col .track-row { --cols: minmax(0, 1fr) 30px 30px; }
    .tracklist { padding: 4px; border-radius: 18px; }
    .tracklist-head, .track-index, .track-duration, .tracklist .track-album { display: none; }
    .track-row { padding: 0 8px; gap: 8px; height: 62px; }
    .like-btn:not(.is-liked) { color: var(--text-dim); }

    .top-result h3 { font-size: 22px; }
    .upload-grid, .field-row { grid-template-columns: 1fr; }
    .cover-picker { width: 160px; height: 160px; }

    /* Admin */
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card strong { font-size: 22px; }
    .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
    .bar-chart { gap: 6px; height: 160px; }
    .genre-form.inline { flex-wrap: wrap; }

    /* Menu ba chấm thành bảng trượt từ dưới lên */
    .context-menu { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)); max-width: none; max-height: 60vh; border-radius: 20px; }
    .toast { bottom: calc(var(--player-h) + var(--bottom-nav-h) + 24px); }
    .auth-card { padding: 32px 18px 40px; border-radius: 24px; }
}

/* ---------- Upload: ảnh bìa / thông tin lấy từ file nhạc ---------- */
.cover-badge { position: absolute; left: 10px; bottom: 10px; z-index: 1; padding: 4px 10px; border-radius: 500px; background: rgba(11, 31, 77, .75); color: #fff; font-size: 12px; font-weight: 700; }
.tags-note { margin: -6px 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); font-size: 13px; font-weight: 600; }

/* ---------- Upload nhiều bài / thư mục ---------- */
.upload-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.upload-tabs .chip { height: 38px; padding: 0 18px; font-size: 14px; cursor: pointer; }
.batch-pickers { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.batch-pickers .ghost-pill { cursor: pointer; height: 42px; }
.batch-help { font-size: 13px; margin: -4px 0 16px; line-height: 1.6; }
.batch-help code { background: var(--primary-soft); color: var(--primary-dark); padding: 1px 6px; border-radius: 6px; }
.batch-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--glass-border); }
.batch-summary #batch-count { font-weight: 700; color: var(--navy); }
.batch-actions { display: flex; gap: 10px; }
.batch-actions .play-pill, .batch-actions .ghost-pill { height: 42px; }
.batch-actions .play-pill:disabled { opacity: .55; cursor: progress; transform: none; }
.batch-list { display: grid; gap: 8px; margin-top: 12px; }
.batch-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) 150px 34px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--glass-border); }
.batch-item .cover { width: 52px; height: 52px; border-radius: 12px; }
.batch-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; min-width: 0; }
.batch-fields .input-sm { width: 100%; min-width: 0; }
.batch-meta { grid-column: 1 / -1; color: var(--text-sub); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-status { display: grid; justify-items: start; gap: 2px; }
.batch-message { color: #B42318; font-size: 12px; }
.batch-link { color: var(--primary); font-weight: 700; font-size: 13px; }
.batch-remove { width: 32px; height: 32px; box-shadow: none; }
.batch-remove .icon { width: 18px; height: 18px; }
.batch-remove:disabled { opacity: .3; }
.batch-item.is-uploading { border-color: var(--primary-light); }
.batch-item.is-uploading .batch-badge { background: var(--primary-soft); color: var(--primary-dark); }
.batch-item.is-done .batch-badge { background: #E7F8EE; color: #15803D; }
.batch-item.is-error { border-color: #F9C9C9; }
.batch-item.is-error .batch-badge { background: #FDECEC; color: #B42318; }

/* ---------- Admin: chọn nhiều bài để xoá ---------- */
.bulk-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--glass-border); }
.bulk-bar .checkbox { margin: 0; }
.bulk-bar .pill-btn { margin-left: auto; }
.bulk-bar .pill-btn:disabled { opacity: .45; cursor: not-allowed; }
.admin-table .col-check { width: 36px; }
.admin-table .bulk-check { width: 18px; height: 18px; accent-color: var(--primary); }
.admin-table tr.is-selected td { background: rgba(229, 72, 77, .06); }

@media (max-width: 768px) {
    .batch-item { grid-template-columns: 44px minmax(0, 1fr) 32px; }
    .batch-item .cover { width: 44px; height: 44px; }
    .batch-fields { grid-template-columns: 1fr; }
    .batch-status { grid-column: 2 / 3; grid-row: 2; }
    .bulk-bar .pill-btn { margin-left: 0; }
}

/* =====================================================================
   15. Bổ sung v2.4: hồ sơ, thống kê nghe nhạc, gợi ý, sửa giao diện điện thoại
   ===================================================================== */

/* ---------- Admin: ô Lưu trữ ---------- */
.storage-box { margin-bottom: 16px; display: grid; gap: 10px; }
.storage-box h2 small strong { color: var(--primary); }
.storage-box .progress { margin: 0; }
.storage-box code { background: var(--primary-soft); color: var(--primary-dark); padding: 1px 6px; border-radius: 6px; }
.text-danger { color: #B42318; font-weight: 600; }

/* ---------- Ảnh đại diện ---------- */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.is-lg { width: 120px; height: 120px; font-size: 44px; }
.avatar.is-xl { width: 220px; height: 220px; font-size: 84px; box-shadow: 0 18px 40px rgba(20, 60, 140, .3); border: 4px solid rgba(255, 255, 255, .7); }
.dropdown-head { display: block; }
.dropdown-head:hover strong { color: var(--primary); }

/* ---------- Trang hồ sơ ---------- */
.profile-hero { --hero-rgb: 77, 163, 255; }
.profile-avatar-btn, .profile-edit-avatar { position: relative; border-radius: 50%; flex: none; cursor: pointer; display: block; }
.profile-avatar-hint {
    position: absolute; inset: 0; border-radius: 50%; display: grid; place-content: center; justify-items: center; gap: 6px;
    background: rgba(11, 31, 77, .55); color: #fff; font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .15s;
}
.profile-avatar-hint .icon { width: 30px; height: 30px; }
.profile-avatar-btn:hover .profile-avatar-hint, .profile-edit-avatar:hover .profile-avatar-hint,
.profile-avatar-btn:focus-visible .profile-avatar-hint { opacity: 1; }
.profile-actions { flex-wrap: wrap; }
.stats-teaser {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 4px 0 8px; border-radius: 20px;
    background: var(--grad-deep); color: #fff; box-shadow: 0 14px 30px rgba(30, 111, 255, .28); transition: transform .15s;
}
.stats-teaser:hover { transform: translateY(-2px); }
.content > .stats-teaser { margin-top: 18px; }
.stats-teaser-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); flex: none; }
.stats-teaser-icon .icon { width: 26px; height: 26px; }
.stats-teaser-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.stats-teaser-text strong { font-size: 16px; }
.stats-teaser-text small { color: rgba(255, 255, 255, .85); font-size: 13px; }
.stats-teaser .row-chev { width: 22px; height: 22px; }
.account-box { display: grid; gap: 16px; padding: 18px; border-radius: 20px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.account-row { display: grid; gap: 2px; }
.account-row strong { color: var(--navy); overflow-wrap: anywhere; }
.account-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.account-buttons .ghost-pill, .account-buttons .pill-btn { height: 42px; }
.empty-inline { padding: 8px 0; }
.small { font-size: 12px; }
.profile-edit { display: flex; gap: 20px; align-items: center; margin-bottom: 12px; }
.profile-edit-fields { flex: 1; min-width: 0; }
.profile-edit-fields .field { margin-bottom: 8px; }

/* ---------- Thống kê nghe nhạc ---------- */
.stats-page { max-width: 1080px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 700; margin-bottom: 8px; }
.stats-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.stats-range { font-size: 18px; color: var(--text); font-weight: 600; }
.stat-tiles {
    display: grid; gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "minutes song" "artist song";
}
.stat-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 22px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); min-width: 0; }
.tile-minutes { grid-area: minutes; }
.tile-song { grid-area: song; }
.tile-artist { grid-area: artist; }
.tile-label { color: var(--text-sub); font-weight: 600; font-size: 14px; }
.tile-number { font-size: 64px; font-weight: 800; letter-spacing: -2px; color: var(--navy); line-height: 1.05; }
.tile-title { font-size: 18px; font-weight: 800; color: var(--navy); overflow-wrap: anywhere; }
a.tile-title:hover { color: var(--primary); }
.tile-sub { color: var(--text-sub); font-size: 13px; }
.tile-empty { font-size: 18px; color: var(--text-sub); line-height: 1.35; }
.tile-art { margin: 8px 0 4px; }
.tile-art .cover { width: 100%; aspect-ratio: 1; border-radius: 18px; }
.tile-artist .tile-art { width: min(100%, 220px); align-self: center; }
.tile-track { position: relative; }
.tile-track .play-fab { position: absolute; right: 12px; bottom: 12px; }
.stats-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.stat-list { list-style: none; display: grid; gap: 4px; padding: 8px; border-radius: 20px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow); }
.stat-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; }
.stat-row:hover { background: var(--hover); }
.stat-row.is-current .stat-text strong { color: var(--primary); }
.stat-row .cover { width: 46px; height: 46px; border-radius: 10px; }
.stat-rank { width: 20px; text-align: center; font-weight: 800; color: var(--text-sub); flex: none; }
.stat-text { flex: 1; min-width: 0; display: grid; }
.stat-text strong { color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-text small { color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-count { color: var(--text-sub); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-row .row-play-admin { width: 36px; height: 36px; }

.insight-row { display: grid; grid-auto-flow: column; grid-auto-columns: 230px; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.insight {
    --insight-color: #8D67AB;
    scroll-snap-align: start; position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
    min-height: 300px; padding: 16px; border-radius: 20px; overflow: hidden; color: var(--navy);
    box-shadow: var(--shadow);
}
.insight.is-lavender { background: linear-gradient(170deg, #F3E8FF, #DCC7FF); }
.insight.is-sky { background: linear-gradient(170deg, #E8F4FF, #BFDBFF); }
.insight.is-mint { background: linear-gradient(170deg, #E6FFF6, #B5F0DA); }
.insight.is-sunset { background: linear-gradient(170deg, #FFE9D6, #FFC2A8); }
.insight.is-genre { background: linear-gradient(170deg, var(--insight-color), #0B1F4D); color: #fff; }
.insight-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; opacity: .75; }
.insight-headline { font-size: 26px; font-weight: 800; letter-spacing: -.6px; line-height: 1.15; }
.insight-symbol { flex: 1; display: grid; place-items: center; opacity: .55; }
.insight-symbol .icon { width: 72px; height: 72px; }
.insight-art { flex: 1; display: grid; align-content: start; gap: 6px; margin-bottom: 8px; }
.insight-art.is-grid { grid-template-columns: repeat(3, 1fr); }
.insight-art.is-grid .cover { width: 100%; aspect-ratio: 1; }
.insight-art.is-stack { position: relative; min-height: 150px; }
.insight-art.is-stack .cover { position: absolute; width: 120px; height: 120px; border-radius: 16px; box-shadow: 0 10px 24px rgba(11, 31, 77, .25); }
.insight-art.is-stack .cover:nth-child(1) { left: 0; top: 0; }
.insight-art.is-stack .cover:nth-child(2) { left: 70px; top: 30px; }
.insight-art.is-stack.count-1 .cover { left: 50%; transform: translateX(-50%); width: 140px; height: 140px; }
.week-list .row-text { display: grid; min-width: 0; }
.week-list strong { color: var(--navy); font-size: 16px; }
.week-top { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-list small { color: var(--text-sub); }
.stats-note { margin-top: 24px; }

/* ---------- Đang phát: radio, xoá khỏi hàng chờ, công tắc tự phát ---------- */
.np-actions { grid-template-columns: repeat(4, 1fr); }
.np-queue .q-remove { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--text-sub); flex: none; opacity: .7; }
.np-queue .q-remove:hover { opacity: 1; color: var(--danger); background: var(--hover); }
.np-queue .q-remove .icon { width: 16px; height: 16px; }
.autoplay-switch { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 10px 6px 4px; border-top: 1px solid var(--line); text-align: left; }
.autoplay-text { flex: 1; display: grid; gap: 2px; }
.autoplay-text strong { color: var(--navy); font-size: 13px; }
.autoplay-text small { color: var(--text-sub); font-size: 12px; }
.switch-track { width: 40px; height: 24px; border-radius: 12px; background: #C9D6E8; position: relative; flex: none; transition: background .15s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.autoplay-switch.is-on .switch-track { background: var(--primary); }
.autoplay-switch.is-on .switch-thumb { transform: translateX(16px); }

/* ---------- Menu ba chấm trên điện thoại: nền mờ + nút Huỷ ---------- */
.menu-backdrop { position: fixed; inset: 0; z-index: 99; background: rgba(11, 31, 77, .35); }
.context-menu .menu-cancel { justify-content: center; font-weight: 700; color: var(--text-sub); border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; margin-top: 4px; }

/* ---------- Nút ‹ quay lại ở thanh trên (chỉ trang con trên điện thoại) ---------- */
.mobile-back { display: none !important; }

@media (max-width: 1024px) {
    .avatar.is-xl { width: 180px; height: 180px; font-size: 64px; }
}

@media (max-width: 768px) {
    /* Thanh trên: trang con hiện nút ‹, 3 tab chính hiện logo */
    body:not(.is-root-page) .mobile-brand { display: none !important; }
    body:not(.is-root-page) .mobile-back { display: grid !important; background: transparent; border: 0; box-shadow: none; }

    /* Vùng chạm tối thiểu ~44px */
    .np-info .like-btn { width: 44px; height: 44px; display: grid; place-items: center; }
    .control-buttons.is-large .ctrl { width: 48px; height: 48px; }
    .control-buttons.is-large .ctrl .icon { width: 26px; height: 26px; }
    .track-row .like-btn, .track-row .row-more { width: 40px; height: 40px; display: grid; place-items: center; }
    .tracklist, .tracklist.no-album, .tracklist.is-two-col .track-row { --cols: minmax(0, 1fr) 40px 40px; }
    .np-queue .q-remove { width: 40px; height: 40px; opacity: .85; color: rgba(255, 255, 255, .8); }

    /* Trộn bài / lặp đang bật: nền sáng + chấm rõ trên nền xanh */
    .np-hero .ctrl.is-on { color: #fff; background: rgba(255, 255, 255, .18); border-radius: 50%; }
    .np-hero .ctrl.is-on::after { background: #fff; width: 5px; height: 5px; bottom: -2px; }

    .np-actions { gap: 6px; }
    .np-actions button { font-size: 11px; padding: 10px 2px; }
    .autoplay-switch { border-top-color: rgba(255, 255, 255, .2); }
    .autoplay-text strong { color: #fff; }
    .autoplay-text small { color: rgba(255, 255, 255, .75); }
    .autoplay-switch:not(.is-on) .switch-track { background: rgba(255, 255, 255, .3); }
    .autoplay-switch.is-on .switch-track { background: var(--accent); }

    /* Thanh nút đầu trang (Phát, Ngẫu nhiên, sửa, xoá) không bị rớt dòng */
    .action-bar { flex-wrap: nowrap; }
    .action-bar .ghost-pill { padding: 0 14px; }
    .action-bar .ghost-pill:has(.icon) span { display: none; }
    .profile-actions { flex-wrap: wrap; }
    .profile-actions .ghost-pill { padding: 0 18px; }

    /* Menu ba chấm: nổi trên nền mờ */
    .context-menu { z-index: 100; padding: 8px; }
    .context-menu button { padding: 14px 12px; }

    /* Hồ sơ */
    .avatar.is-xl { width: 160px; height: 160px; font-size: 60px; }
    .profile-avatar-btn { align-self: center; }
    .profile-avatar-hint { opacity: 0 !important; }
    .profile-edit { flex-direction: column; align-items: stretch; }
    .profile-edit-avatar { align-self: center; }
    .profile-edit-avatar .profile-avatar-hint { opacity: 1 !important; background: rgba(11, 31, 77, .35); }

    /* Thống kê */
    .stats-range { font-size: 16px; }
    .stat-tiles { gap: 10px; }
    .stat-tile { padding: 12px; border-radius: 18px; }
    .tile-number { font-size: 48px; }
    .tile-title { font-size: 15px; }
    .tile-empty { font-size: 15px; }
    .tile-label { font-size: 12px; }
    .stats-columns { grid-template-columns: 1fr; }
    .insight-row { grid-auto-columns: 74%; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; scrollbar-width: none; }
    .insight-row::-webkit-scrollbar { display: none; }
    .insight { min-height: 280px; }
    .insight-headline { font-size: 23px; }
}
