:root {
  --bg: #0b0b12;
  --bg-2: #12121c;
  --panel: #161624;
  --panel-2: #1d1d2e;
  --border: #2a2a40;
  --text: #ececf4;
  --muted: #9a9ab3;
  --faint: #6b6b85;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --grad: linear-gradient(135deg, #8b5cf6, #ec4899);
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --info: #38bdf8;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --sidebar: 236px;
  --player: 0px;
  --player-h: 76px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f6fb;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f0f0f7;
  --border: #e2e2ee;
  --text: #16161f;
  --muted: #5d5d75;
  --faint: #8d8da5;
  --shadow: 0 10px 30px rgba(20, 20, 50, .08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 750; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.between { justify-content: space-between; }
.gap-lg { gap: 20px; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 28px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 12px calc(var(--player) + 12px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: 18px; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.nav a { flex: none; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 550; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--border); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex: none; text-transform: uppercase;
}
.main { min-width: 0; overflow-x: clip; padding: 26px 32px calc(var(--player) + 40px); }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.topbar .search { flex: 1; max-width: 560px; }
.mobile-only { display: none !important; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 8px; }
.btn svg { width: 16px; height: 16px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-2); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, .2); }
textarea.input { min-height: 90px; resize: vertical; }
.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--faint); }
.search .input { padding-left: 40px; }
label.field { display: flex; flex-direction: column; gap: 6px; }
label.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
label.field small { color: var(--faint); font-size: 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch i { width: 38px; height: 22px; border-radius: 99px; background: var(--border); position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs button.active { background: var(--panel-2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.1); }
.badge.warn { color: var(--warn); border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.1); }
.badge.err { color: var(--err); border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.1); }
.badge.info { color: var(--info); border-color: rgba(56,189,248,.35); background: rgba(56,189,248,.1); }
.badge.accent { color: #c4b5fd; border-color: rgba(139,92,246,.4); background: rgba(139,92,246,.14); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--err); }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card.flat { padding: 0; overflow: hidden; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 28px 0 14px; }
.section-head:first-child { margin-top: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 30px; margin-bottom: 8px;
  background: radial-gradient(1200px 300px at 0% 0%, rgba(139,92,246,.35), transparent 60%),
              radial-gradient(800px 300px at 100% 100%, rgba(236,72,153,.25), transparent 60%), var(--panel);
  border: 1px solid var(--border);
}
.hero h1 { font-size: 30px; }
.hero .search { max-width: 640px; margin-top: 18px; }
.hero .search .input { padding: 14px 16px 14px 44px; font-size: 15px; border-radius: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px; }
.tile { position: relative; cursor: pointer; min-width: 0; }
.tile .art {
  position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--panel-2);
  box-shadow: var(--shadow); transition: transform .18s;
}
.tile:hover .art { transform: translateY(-3px); }
.tile .art img { width: 100%; height: 100%; object-fit: cover; }
.tile .art .ph, .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--panel-2), var(--border)); color: var(--faint); font-size: 34px; font-weight: 800;
}
.tile .art .overlay {
  position: absolute; inset: auto 8px 8px auto; display: flex; gap: 6px; opacity: 0; transform: translateY(6px); transition: .18s;
}
.tile:hover .art .overlay { opacity: 1; transform: none; }
.tile .art .corner { position: absolute; top: 8px; left: 8px; }
.tile .t { margin-top: 9px; font-weight: 650; }
.tile .s { color: var(--muted); font-size: 13px; }
.round .art { border-radius: 50%; }
.fab {
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(139,92,246,.5);
}
.fab svg { width: 18px; height: 18px; }
.fab.light { background: rgba(0,0,0,.6); box-shadow: none; backdrop-filter: blur(6px); }

/* ---------- lists / tables ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-bottom: 1px solid var(--border); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--panel-2); }
.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--panel-2); flex: none; position: relative; overflow: hidden; }
.thumb.lg { width: 64px; height: 64px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--panel-2); }
.table td.num { width: 40px; color: var(--faint); text-align: right; }
.tracklist .playing td { color: var(--accent); }
.progress { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: inherit; transition: width .4s; }

/* ---------- detail header ---------- */
.detail-head { display: flex; gap: 28px; align-items: flex-end; margin-bottom: 24px; }
.detail-head .cover { width: 220px; height: 220px; border-radius: 16px; overflow: hidden; flex: none; position: relative; background: var(--panel-2); box-shadow: var(--shadow); }
.detail-head .cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-head.artist .cover { border-radius: 50%; }
.bio { margin-bottom: 8px; padding: 16px 18px 10px; }
.bio p { margin: 0 0 8px; line-height: 1.6; max-width: 80ch; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.detail-head .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.detail-head h1 { font-size: 40px; margin: 6px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- auth ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 10% 0%, rgba(139,92,246,.28), transparent 60%),
              radial-gradient(900px 500px at 100% 100%, rgba(236,72,153,.2), transparent 60%), var(--bg);
}
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.auth-card .brand { justify-content: center; padding: 0 0 6px; font-size: 24px; }
.auth-card .brand img { width: 40px; height: 40px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.error-box { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); color: #fca5a5; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
:root[data-theme="light"] .error-box { color: #b91c1c; }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5,5,10,.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; width: 100%; min-width: 0; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .18s; }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); gap: 10px; }
.modal-body { padding: 20px 22px; overflow: auto; overflow-x: hidden; min-width: 0; }
.modal-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .modal-bg { padding: 8px; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: 18px 18px 12px 12px; }
  .modal-head { padding: 14px 16px; } .modal-head h2 { font-size: 17px; }
  .modal-body { padding: 14px 16px; }
}
/* picker results: stacked rows that wrap instead of a wide table */
.pick-row { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--border); min-width: 0; }
.pick-row .grow { min-width: 0; }
.pick-row .pt { font-weight: 600; overflow-wrap: anywhere; }
.pick-row .ps { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-row .pm { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
.pick-row .btn { flex: none; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
#toasts { position: fixed; right: 18px; bottom: calc(var(--player) + 18px); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 380px; animation: pop .2s; }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }

/* ---------- player ---------- */
body.has-player { --player: var(--player-h); }
.player {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--player-h); z-index: 50;
  background: color-mix(in srgb, var(--bg-2) 90%, transparent); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center; gap: 18px; padding: 0 20px;
}
.player .now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player .now .thumb { width: 48px; height: 48px; border-radius: 8px; }
.player .ctrls { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.player .ctrls .row { gap: 6px; }
.player .seek { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 11px; color: var(--faint); }
.player input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }
.player #seek { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; touch-action: none; --p: 0%; }
.player #seek::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p), var(--border) var(--p)); }
.player #seek::-moz-range-track { height: 5px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p), var(--border) var(--p)); }
.player #seek::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; margin-top: -5px; border-radius: 50%; background: var(--text); border: 0; }
.player #seek::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--text); border: 0; }
.player .seek span { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.player .right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; min-width: 0; }
.player .right input { max-width: 100px; }
.play-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: var(--bg); border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.play-btn svg { width: 18px; height: 18px; }
.tracklist tr.playing td { color: var(--accent); }
.tracklist tbody tr { cursor: pointer; }
.tile .art .overlay .fab { box-shadow: 0 6px 18px rgba(139,92,246,.5); }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: var(--faint); margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav button { text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 9px; color: var(--muted); cursor: pointer; font-weight: 600; }
.settings-nav button.active { background: var(--panel-2); color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.code { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; }
.diff-old { color: var(--faint); text-decoration: line-through; }
.diff-new { color: var(--ok); }
.status-pill { display: inline-flex; gap: 6px; align-items: center; }
.kbd { font-family: ui-monospace, monospace; font-size: 11px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 6px; color: var(--faint); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
}
@media (max-width: 960px) {
  /* phones/tablets: the seek bar gets its own full-width row so it's easy to drag with a finger */
  body.has-player { --player: 112px; }
  .player { height: 112px; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: auto 1fr; gap: 0 8px; padding: 6px 12px 8px; }
  .player .ctrls { display: contents; }
  .player .seek { grid-column: 1 / -1; grid-row: 1; display: flex; }
  .player .seek #seek { height: 32px; }
  .player .seek #seek::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -7.5px; }
  .player .now { grid-column: 1; grid-row: 2; }
  .player .ctrls .row { grid-column: 2; grid-row: 2; }
  .player .right { grid-column: 3; grid-row: 2; }
  .player .right input, .player .right .faint, .player .right .badge { display: none; }
  .player .ctrls .row .btn.icon#p-prev { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .mobile-only { display: inline-flex !important; }
}
@media (max-width: 760px) {
  .main { padding: 16px 16px calc(var(--player) + 30px); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
  .detail-head { flex-direction: column; align-items: flex-start; }
  .detail-head .cover { width: 160px; height: 160px; }
  .detail-head h1 { font-size: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .hero { padding: 22px; }
  .hide-sm { display: none; }
  .show-sm { display: inline !important; }
}

/* settings: test results + value sources */
.test-result { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 10px; margin-bottom: 16px;
  border: 1px solid var(--border); background: var(--panel-2); font-weight: 550; }
.test-result svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.test-result.ok { color: var(--ok); border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.1); }
.test-result.err { color: var(--err); border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.1); }
.test-result span { word-break: break-word; }
small.src { color: var(--muted); }
small.src.env { color: var(--info); }
small.src a { color: var(--accent); }
.input:disabled, select.input:disabled { opacity: .65; cursor: not-allowed; }
.diag-raw { margin-top: 8px; white-space: pre-wrap; max-height: 220px; overflow: auto; }

/* ---------- ⋯ menus ---------- */
.menu-bg { position: fixed; inset: 0; z-index: 140; }
.menu-pop { position: fixed; z-index: 141; min-width: 220px; max-width: 320px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; animation: pop .12s; }
.menu-pop button, .menu-pop a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: transparent; color: var(--text); border-radius: 8px; cursor: pointer; font: inherit; text-align: left; text-decoration: none; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--panel-2); }
.menu-pop .danger { color: var(--err, #ef4444); }
.menu-pop svg { width: 16px; height: 16px; flex: none; opacity: .85; }
.menu-pop hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
@media (max-width: 760px) {
  .menu-bg { background: rgba(5,5,10,.5); }
  .menu-pop { left: 8px !important; right: 8px; bottom: 8px; top: auto !important; max-width: none; border-radius: 16px; padding: 8px; }
  .menu-pop button, .menu-pop a { padding: 13px 12px; font-size: 15px; }
}
.dir-btn { min-width: 38px; justify-content: center; }

.show-sm { display: none; }
.play-thumb { border: 0; padding: 0; cursor: pointer; width: 44px; height: 44px; }
.play-thumb img, .play-thumb .ph { width: 100%; height: 100%; object-fit: cover; }
.play-thumb i { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .15s; color: #fff; }
.play-thumb i svg { width: 18px; height: 18px; }
.play-thumb:hover i, .play-thumb:focus-visible i { opacity: 1; }

.storage-mini { display: block; margin: 8px 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; }
.storage-mini:hover { background: var(--panel-2); }

/* ---------- full-screen player ---------- */
.player .now { cursor: pointer; border-radius: 10px; }
.player .now:hover .thumb { outline: 2px solid var(--accent); }
.np-full { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; animation: fade .15s; }
.np-full .np-backdrop { position: absolute; inset: -40px; background: var(--np-bg) center / cover no-repeat; filter: blur(60px) saturate(1.3); opacity: .35; pointer-events: none; }
.np-full > *:not(.np-backdrop) { position: relative; }
body.np-open { overflow: hidden; }
.np-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 14px 18px; gap: 10px; }
.np-tabs { justify-self: center; }
.np-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; padding: 8px 40px 28px; }
.np-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 0; }
.np-art { position: relative; width: min(52vh, 100%); aspect-ratio: 1; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.45); background: var(--panel-2); }
.np-art img, .np-art .ph { width: 100%; height: 100%; object-fit: cover; }
.np-meta { text-align: center; max-width: 100%; }
.np-meta h2 { font-size: 26px; margin: 0 0 4px; }
.np-meta a { color: inherit; }
.np-seek { width: min(560px, 100%); display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--faint); }
.np-seek span { min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; }
#fseek { -webkit-appearance: none; appearance: none; flex: 1; height: 28px; background: transparent; cursor: pointer; touch-action: none; --p: 0%; }
#fseek::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p), var(--border) var(--p)); }
#fseek::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p), var(--border) var(--p)); }
#fseek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--text); }
#fseek::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 0; }
.np-ctrls { display: flex; align-items: center; gap: 14px; }
.np-ctrls .btn.on { color: var(--accent); }
.np-ctrls sup { font-size: 9px; margin-left: -4px; }
.play-btn.lg { width: 64px; height: 64px; }
.play-btn.lg svg { width: 26px; height: 26px; }
.np-vol { width: min(260px, 100%); gap: 10px; }
.np-vol input { flex: 1; accent-color: var(--accent); }
.np-lyrics, .np-queue { min-height: 0; overflow-y: auto; }
.np-body.pane-now .np-lyrics, .np-body.pane-queue .np-lyrics, .np-body.pane-lyrics .np-queue, .np-body.pane-now .np-queue { display: none; }
.np-body.pane-now .np-queue { display: block; }
.np-lyrics { padding: 30vh 8px; mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.np-lyrics p { font-size: 24px; font-weight: 700; line-height: 1.35; margin: 0 0 18px; color: var(--muted); opacity: .55; cursor: pointer; transition: opacity .2s, color .2s; }
.np-lyrics p.on { opacity: 1; color: var(--text); }
.np-lyrics .np-plain { white-space: pre-wrap; font-size: 18px; line-height: 1.6; }
.np-lyrics .np-empty { padding-top: 10vh; text-align: center; }
.np-queue h3 { margin: 6px 0 10px; }
.np-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.np-item:hover { background: color-mix(in srgb, var(--panel-2) 80%, transparent); }
.np-item .thumb { width: 42px; height: 42px; }
@media (max-width: 760px) {
  .np-top { padding: 10px 10px; grid-template-columns: 40px 1fr 8px; }
  .np-tabs button { padding: 6px 10px; font-size: 13px; }
  .np-body { display: block; padding: 6px 18px 18px; overflow-y: auto; }
  .np-body .np-main, .np-body .np-lyrics, .np-body .np-queue { display: none !important; }
  .np-body.pane-now .np-main { display: flex !important; min-height: 100%; }
  .np-body.pane-lyrics .np-lyrics { display: block !important; height: 100%; padding: 25vh 4px; }
  .np-body.pane-queue .np-queue { display: block !important; }
  .np-art { width: min(82vw, 46vh); }
  .np-meta h2 { font-size: 21px; }
  .np-lyrics p { font-size: 21px; }
  .player .right .btn#p-queue { display: inline-flex; }
}
.art-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.art-pick { background: none; border: 1px solid transparent; border-radius: 12px; padding: 6px; cursor: pointer; text-align: left; color: inherit; }
.art-pick:hover { border-color: var(--accent); }
.art-pick.busy { opacity: .5; pointer-events: none; }
/* show/hide for passwords and keys */
.pw-wrap { position: relative; display: block; min-width: 0; }
.row > .pw-wrap:not(.grow) { flex: 0 1 auto; }
.pw-wrap > input { width: 100%; padding-right: 42px; }
.eye-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.pw-wrap > .eye-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.eye-btn:hover { color: var(--text); background: var(--panel-2); }
