/* TuneVault — dark UI in the style of YouTube Music */
:root {
  --bg: #0f0f0f;
  --bg-soft: #181818;
  --elev: #212121;
  --elev2: #282828;
  --line: rgba(255, 255, 255, 0.1);
  --hover: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text2: rgba(255, 255, 255, 0.7);
  --text3: rgba(255, 255, 255, 0.5);
  --accent: #ff0033;
  --r: 8px;
  --topbar-h: 56px;
  --bottomnav-h: 60px;
  --playerbar-h: 64px;
  --pagepad: 16px;
  --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  overscroll-behavior-y: none;
}
img { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- logo ---------- */
.logo-mark {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #ff4d6a, var(--accent) 62%);
  display: inline-grid; place-items: center; flex: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.logo-mark::before {
  content: ""; width: 0; height: 0; margin-left: 2px;
  border: 6px solid transparent; border-left: 9px solid #fff; border-right: 0;
}
.logo-text { font-size: 19px; font-weight: 400; letter-spacing: -0.2px; }
.logo-text b { font-weight: 700; }

/* ---------- login ---------- */
.login {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background:
    radial-gradient(50% 40% at 15% 0%, rgba(255, 0, 51, 0.18), transparent 70%),
    radial-gradient(45% 40% at 100% 100%, rgba(90, 40, 255, 0.14), transparent 70%),
    var(--bg);
  padding: 24px;
}
.login-card {
  width: min(360px, 100%); background: rgba(24, 24, 24, 0.85);
  border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px;
  display: flex; flex-direction: column; gap: 14px; backdrop-filter: blur(10px);
}
.login-logo { display: flex; align-items: center; gap: 10px; justify-content: center; }
.login-logo .logo-mark { width: 34px; height: 34px; }
.login-logo .logo-text { font-size: 24px; }
.login-sub { margin: 0; text-align: center; color: var(--text2); font-size: 13.5px; }
.login-card input {
  background: #0c0c0c; border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; outline: none;
}
.login-card input:focus { border-color: rgba(255, 255, 255, 0.4); }
.btn-primary {
  background: #fff; color: #000; font-weight: 600; border-radius: 999px;
  padding: 11px 16px; text-align: center;
}
.btn-primary:hover { background: #e6e6e6; }
.login-err { margin: 0; min-height: 18px; text-align: center; color: #ff6b81; font-size: 13px; }

/* ---------- avatars ---------- */
.avatar {
  display: grid; place-items: center; border-radius: 14px;
  font-weight: 700; color: #fff; line-height: 1; flex: none;
  width: 100%; aspect-ratio: 1; font-size: 42px; overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.avatar.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 17px; aspect-ratio: auto; }
.avatar.md { width: 46px; height: 46px; border-radius: 11px; font-size: 24px; aspect-ratio: auto; }

/* ---------- profile picker ---------- */
.profiles {
  position: fixed; inset: 0; z-index: 190; display: grid; place-items: center; overflow-y: auto;
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(255, 0, 51, 0.14), transparent 70%),
    radial-gradient(50% 45% at 100% 100%, rgba(90, 40, 255, 0.12), transparent 70%),
    var(--bg);
  padding: 40px 20px;
}
.profiles-inner { width: min(760px, 100%); text-align: center; }
.profiles-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 26px; }
.profiles-logo .logo-mark { width: 30px; height: 30px; }
.profiles-logo .logo-text { font-size: 21px; }
.profiles-title { font-size: clamp(26px, 5vw, 40px); font-weight: 800; letter-spacing: -0.6px; margin: 0 0 34px; }
.profile-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 140px));
  gap: 22px 26px; justify-content: center; align-items: start;
}
.profile-pick { display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; }
.profile-pick .avatar-wrap {
  width: 100%; max-width: 140px; border-radius: 14px; position: relative;
  outline: 3px solid transparent; outline-offset: 3px; transition: 0.15s;
}
.profile-pick:hover .avatar-wrap { outline-color: #fff; transform: translateY(-2px); }
.profile-pick .avatar-wrap .pin-badge {
  position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--elev2); border: 2px solid var(--bg); display: grid; place-items: center; color: var(--text2);
}
.profile-pick .avatar-wrap .pin-badge svg { width: 14px; height: 14px; }
.profile-pick .p-name { font-size: 15px; color: var(--text2); font-weight: 600; }
.profile-pick:hover .p-name { color: var(--text); }
.profile-pick.add .avatar { background: transparent; border: 2px dashed rgba(255, 255, 255, 0.28); color: var(--text3); }
.profile-pick.add:hover .avatar { border-color: #fff; color: #fff; }
.profile-pick.add .avatar svg { width: 40%; height: 40%; }
.profiles-manage {
  margin-top: 40px; border: 1px solid var(--line); color: var(--text2);
  padding: 10px 22px; border-radius: 999px; font-weight: 600; letter-spacing: 0.4px;
}
.profiles-manage:hover { background: var(--hover); color: var(--text); }
.profiles-manage.done { border-color: #fff; color: #fff; }
/* delete/edit affordance while managing */
.profile-pick.managing .avatar-wrap { outline-color: rgba(255, 255, 255, 0.25); }
.profile-pick .edit-badge {
  position: absolute; inset: 0; border-radius: 14px; background: rgba(0, 0, 0, 0.5);
  display: none; place-items: center; color: #fff;
}
.profile-pick .edit-badge svg { width: 30%; height: 30%; }
.profile-pick.managing .edit-badge { display: grid; }

/* topbar profile button */
.topbar-profile { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.topbar-profile:hover { background: var(--hover); }

/* PIN entry */
.pin-row { display: flex; gap: 10px; justify-content: center; margin: 8px 0 4px; }
.pin-dot { width: 46px; height: 54px; border-radius: 10px; background: #0c0c0c; border: 1px solid var(--line); text-align: center; font-size: 24px; }
.pin-dot:focus { border-color: #fff; outline: none; }

/* emoji + color pickers (in modals) */
.picker-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.swatch.active { border-color: #fff; transform: scale(1.08); }
.emoji-btn { width: 40px; height: 40px; border-radius: 10px; background: #0c0c0c; border: 1px solid var(--line); font-size: 20px; cursor: pointer; }
.emoji-btn.active { border-color: #fff; background: var(--elev2); }
.avatar-preview { display: flex; align-items: center; gap: 14px; margin: 4px 0 10px; }

/* ---------- shell ---------- */
.app { min-height: 100%; }
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--topbar-h); display: flex; align-items: center; gap: 6px;
  padding: 0 12px; background: rgba(15, 15, 15, 0.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 8px; padding: 6px; }
.topnav { display: none; gap: 4px; margin-left: 18px; }
.topnav a {
  padding: 8px 14px; border-radius: 999px; color: var(--text2); font-weight: 500;
}
.topnav a:hover { background: var(--hover); color: var(--text); }
.topnav a.active { color: var(--text); font-weight: 700; }
.topbar-spacer { flex: 1; }
.searchbox {
  display: none; align-items: center; gap: 10px; width: min(420px, 38vw);
  background: var(--elev); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; color: var(--text3);
}
.searchbox:focus-within { border-color: rgba(255, 255, 255, 0.35); background: #191919; }
.searchbox input { flex: 1; background: none; border: 0; outline: none; color: var(--text); }
.searchbox input::placeholder { color: var(--text3); }
.searchbox-icon, .icon-btn { display: grid; place-items: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; color: var(--text);
  flex: none;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn.active-accent { color: var(--accent); }
.icon-btn svg, .searchbox-icon svg, .bn-icon svg { width: 22px; height: 22px; }
#backBtn { display: none; }
.topbar.subpage #backBtn { display: grid; }

.view {
  padding: calc(var(--topbar-h) + 8px) var(--pagepad)
    calc(var(--bottomnav-h) + var(--playerbar-h) + var(--sab) + 24px);
  max-width: 1500px; margin: 0 auto; outline: none; min-height: 100vh;
}

/* bottom nav (mobile) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  height: calc(var(--bottomnav-h) + var(--sab)); padding-bottom: var(--sab);
  display: flex; background: rgba(15, 15, 15, 0.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 11px; color: var(--text2);
}
.bottomnav a.active { color: var(--text); }
.bottomnav a.active svg { stroke-width: 2.4; }

/* ---------- sections / shelves ---------- */
.section { margin: 26px 0 8px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-eyebrow { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text3); margin-bottom: 2px; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.section-more {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
  font-size: 13px; color: var(--text2); flex: none;
}
.section-more:hover { background: var(--hover); color: var(--text); }

.shelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 14px;
  overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.shelf > * { scroll-snap-align: start; }

.card { width: 100%; text-align: left; }
.card-art {
  position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden;
  background: var(--elev);
}
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-art .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text3); }
.card-art .ph svg { width: 34%; height: 34%; }
.card-play {
  position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.75); display: grid; place-items: center;
  opacity: 0; transform: translateY(4px); transition: 0.15s;
}
.card:hover .card-play { opacity: 1; transform: none; }
.card-play:hover { background: #000; transform: scale(1.06); }
.card-title { margin-top: 9px; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-sub { margin-top: 2px; color: var(--text2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.round .card-art { border-radius: 50%; }
.card.round .card-title { text-align: center; }
.card.round .card-sub { text-align: center; }

.gridwrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; padding: 4px 2px; }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 8px; background: var(--elev);
  border: 1px solid var(--line); font-size: 13.5px; color: var(--text);
}
.chip:hover { background: var(--elev2); }
.chip.active { background: #fff; color: #000; border-color: #fff; font-weight: 600; }

/* ---------- song rows ---------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 44px 1fr auto auto; gap: 12px; align-items: center;
  padding: 7px 8px; border-radius: var(--r); cursor: pointer; user-select: none;
}
.row:hover, .row.menu-open { background: var(--hover); }
.row-art { position: relative; width: 44px; height: 44px; border-radius: 4px; overflow: hidden; background: var(--elev); flex: none; }
.row-art img { width: 100%; height: 100%; object-fit: cover; }
.row-art .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text3); }
.row-art .ph svg { width: 20px; height: 20px; }
.row-art .eq { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; }
.row-num { width: 44px; text-align: center; color: var(--text2); font-variant-numeric: tabular-nums; }
.row-main { min-width: 0; }
.row-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.playing .row-title { color: var(--accent); }
.row-sub { color: var(--text2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub a:hover { text-decoration: underline; }
.row-dur { color: var(--text2); font-size: 13px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.row-dl { color: var(--text2); display: inline-flex; }
.row-dl svg { width: 15px; height: 15px; }
.row .icon-btn { width: 36px; height: 36px; opacity: 0.85; }

/* equalizer animation */
.eqbars { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.eqbars i { width: 3px; background: #fff; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.eqbars i:nth-child(1) { animation-delay: -0.4s; }
.eqbars i:nth-child(2) { animation-delay: -0.1s; }
.eqbars i:nth-child(3) { animation-delay: -0.7s; }
.eqbars.paused i { animation-play-state: paused; height: 5px !important; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 15px; } }

/* ---------- hero (album / artist / playlist) ---------- */
.hero { display: flex; gap: 22px; align-items: end; padding: 18px 2px 6px; }
.hero-art {
  width: 190px; height: 190px; flex: none; border-radius: 10px; overflow: hidden;
  background: var(--elev); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  position: relative;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-art .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text3); }
.hero-art .ph svg { width: 34%; height: 34%; }
.hero.round .hero-art { border-radius: 50%; }
.hero-info { min-width: 0; }
.hero-kind { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text2); }
.hero-title { font-size: clamp(26px, 5vw, 46px); font-weight: 800; letter-spacing: -0.8px; margin: 4px 0 6px; overflow-wrap: anywhere; }
.hero-sub { color: var(--text2); }
.hero-sub a { font-weight: 600; color: var(--text); }
.hero-sub a:hover { text-decoration: underline; }
.hero-actions { display: flex; align-items: center; gap: 10px; margin: 18px 0 4px; flex-wrap: wrap; }
.btn-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  border-radius: 999px; font-weight: 600;
}
.btn-pill svg { width: 20px; height: 20px; }
.btn-pill.solid { background: #fff; color: #000; }
.btn-pill.solid:hover { background: #e6e6e6; }
.btn-pill.ghost { border: 1px solid var(--line); color: var(--text); }
.btn-pill.ghost:hover { background: var(--hover); }
.btn-pill.ghost.on { border-color: transparent; background: rgba(255, 0, 51, 0.16); color: #ff8095; }

.empty { padding: 60px 10px; text-align: center; color: var(--text2); }
.empty svg { width: 46px; height: 46px; color: var(--text3); margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--text); }
.empty p { margin: 0 0 16px; }

/* library tabs */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

/* ---------- mini player ---------- */
.playerbar {
  position: fixed; left: 0; right: 0; z-index: 80;
  bottom: calc(var(--bottomnav-h) + var(--sab));
  background: rgba(24, 24, 24, 0.98); border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.pb-progress { height: 2px; background: rgba(255, 255, 255, 0.12); }
#pbFill { height: 100%; width: 0%; background: var(--accent); }
.pb-main { display: flex; align-items: center; gap: 12px; height: var(--playerbar-h); padding: 0 12px; cursor: pointer; }
.pb-cover { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; background: var(--elev); }
.pb-meta { flex: 1; min-width: 0; }
.pb-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-artist { color: var(--text2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-controls { display: flex; align-items: center; gap: 2px; }
.pb-play svg { width: 30px; height: 30px; }

/* ---------- full player ---------- */
.nowplaying {
  position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 55% at 50% -8%, var(--np-tint, #3a3a3a) 0%, transparent 60%),
    var(--bg);
  animation: npIn 0.22s ease;
}
@keyframes npIn { from { transform: translateY(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.np-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px 0; }
.np-toptitle { flex: 1; text-align: center; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--text2); }
.np-body { flex: 1; display: flex; flex-direction: column; padding: 8px 24px 0; max-width: 560px; width: 100%; margin: 0 auto; min-height: 0; }
.np-art-wrap { flex: 1; display: grid; place-items: center; min-height: 0; padding: 8px 0 16px; }
.np-art {
  width: min(78vw, 46vh, 420px); aspect-ratio: 1; object-fit: cover; border-radius: 12px;
  background: var(--elev); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.np-info { display: flex; align-items: center; gap: 10px; }
.np-titles { flex: 1; min-width: 0; }
.np-title { font-size: 21px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist a:hover { text-decoration: underline; }
.np-quick { display: flex; }
.np-seek { margin-top: 14px; }
.np-times { display: flex; justify-content: space-between; color: var(--text3); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.np-controls { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 10px 0 18px; }
.np-big svg { width: 30px; height: 30px; }
.np-playbtn {
  width: 64px; height: 64px; border-radius: 50%; background: #fff; color: #000;
  display: grid; place-items: center;
}
.np-playbtn:hover { transform: scale(1.04); }
.np-playbtn svg { width: 32px; height: 32px; }
.np-tabs { display: flex; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); }
.np-tabs button { flex: 1; padding: 12px 0 11px; color: var(--text3); font-weight: 600; font-size: 13px; letter-spacing: 0.6px; text-transform: uppercase; border-bottom: 2px solid transparent; }
.np-tabs button.active { color: var(--text); border-bottom-color: #fff; }
.np-panel { height: 34vh; overflow-y: auto; background: rgba(0, 0, 0, 0.25); padding: 10px 14px calc(16px + var(--sab)); }
.np-panel.collapsed { height: 0; padding: 0 14px; overflow: hidden; }
.autoplay-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 12px; color: var(--text2); font-size: 13.5px; }
.switch { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #4a4a4a; transition: 0.15s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: 0.15s; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 21px; }

/* lyrics */
.lyrics { padding: 6px 8px 20px; white-space: pre-wrap; color: var(--text2); font-size: 17px; line-height: 1.85; }
.lyrics.synced { color: var(--text3); }
.lyrics .lline { cursor: pointer; padding: 2px 0; transition: color 0.15s; }
.lyrics .lline.now { color: var(--text); font-weight: 700; }
.lyrics-tools { display: flex; gap: 8px; padding: 4px 8px 10px; flex-wrap: wrap; }
.genius-card {
  display: flex; gap: 12px; align-items: center; margin: 6px 8px 12px; padding: 10px 12px;
  background: var(--elev); border: 1px solid var(--line); border-radius: 10px;
}
.genius-card img { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }
.genius-card .g-main { flex: 1; min-width: 0; }
.genius-card .g-t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.genius-card .g-s { color: var(--text2); font-size: 12.5px; }
.genius-badge { background: #ffff64; color: #000; font-weight: 800; font-size: 11px; border-radius: 4px; padding: 3px 6px; flex: none; }

/* ---------- range inputs ---------- */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px; border-radius: 2px;
  background: linear-gradient(to right, #fff var(--fill, 0%), rgba(255, 255, 255, 0.2) var(--fill, 0%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; margin-top: -5px;
}
input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); }
input[type="range"]::-moz-range-progress { height: 3px; border-radius: 2px; background: #fff; }
input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }

/* ---------- sheet / context menu ---------- */
.overlay { position: fixed; inset: 0; z-index: 210; background: rgba(0, 0, 0, 0.55); }
.sheet {
  position: fixed; z-index: 220; left: 0; right: 0; bottom: 0;
  background: var(--elev); border-radius: 16px 16px 0 0; padding: 8px 8px calc(10px + var(--sab));
  max-height: 72vh; overflow-y: auto; animation: sheetIn 0.18s ease;
}
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0.5; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; gap: 12px; align-items: center; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet-head img { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; background: var(--bg); }
.sheet-head .sh-t { font-weight: 600; }
.sheet-head .sh-s { color: var(--text2); font-size: 13px; }
.sheet-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px 14px; border-radius: 8px; text-align: left; }
.sheet-item:hover { background: var(--hover); }
.sheet-item svg { width: 21px; height: 21px; color: var(--text2); flex: none; }
.sheet-item.danger, .sheet-item.danger svg { color: #ff6b81; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 240; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.6); }
.modal-card {
  width: min(440px, 100%); background: var(--elev); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; max-height: 86vh; overflow-y: auto;
  animation: sheetIn 0.16s ease;
}
.modal-card h3 { margin: 0 0 14px; font-size: 18px; }
.modal-card label { display: block; font-size: 12.5px; color: var(--text2); margin: 10px 0 4px; }
.modal-card input[type="text"], .modal-card input[type="number"], .modal-card textarea {
  width: 100%; background: #0c0c0c; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; outline: none;
}
.modal-card textarea { min-height: 140px; resize: vertical; }
.modal-card input:focus, .modal-card textarea:focus { border-color: rgba(255, 255, 255, 0.4); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn-ghost { padding: 9px 16px; border-radius: 999px; color: var(--text2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }

/* upload */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.25); border-radius: 12px; padding: 34px 16px;
  text-align: center; color: var(--text2); cursor: pointer;
}
.dropzone.drag { border-color: #fff; background: var(--hover); color: var(--text); }
.dropzone svg { width: 36px; height: 36px; margin-bottom: 8px; }
.upl-progress { margin-top: 14px; }
.upl-bar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.upl-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.15s; }
.upl-status { font-size: 13px; color: var(--text2); margin-top: 6px; }

/* playlist picker */
.pl-pick { display: flex; flex-direction: column; }
.pl-pick button { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 8px; text-align: left; }
.pl-pick button:hover { background: var(--hover); }
.pl-pick svg { width: 20px; height: 20px; color: var(--text2); }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 300; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottomnav-h) + var(--playerbar-h) + var(--sab) + 14px); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #f1f1f1; color: #0b0b0b; font-weight: 500; font-size: 14px;
  padding: 11px 18px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: sheetIn 0.18s ease; max-width: min(92vw, 480px); text-align: center;
}

/* search page */
.search-hint { color: var(--text2); padding: 30px 6px; }

/* ---------- desktop ---------- */
@media (min-width: 881px) {
  :root { --topbar-h: 64px; --pagepad: 28px; --playerbar-h: 72px; }
  .bottomnav { display: none; }
  .topnav { display: flex; }
  .searchbox { display: flex; }
  #searchBtn { display: none; }
  .playerbar { bottom: 0; }
  .view { padding-bottom: calc(var(--playerbar-h) + 40px); }
  .toasts { bottom: calc(var(--playerbar-h) + 18px); }
  .shelf { grid-auto-columns: 186px; }
  .sheet { left: auto; right: auto; bottom: auto; border-radius: 12px; width: 300px; max-height: 70vh; box-shadow: 0 14px 50px rgba(0, 0, 0, 0.6); padding: 6px; }
  .sheet-item { padding: 10px 12px; }
  .np-panel { height: 30vh; }
}
@media (max-width: 880px) {
  .only-wide { display: none !important; }
  .hero { flex-direction: column; align-items: center; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-art { width: min(62vw, 230px); height: auto; aspect-ratio: 1; }
  .row { grid-template-columns: 44px 1fr auto; }
  .row-dur .dur-num { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
