/* 拾音 */
:root {
  --bg: #f6f5f3;
  --surface: #ffffff;
  --surface2: #ecebe8;
  --text: #1a1a1d;
  --muted: #6e6d72;
  --line: rgba(20, 20, 30, .09);
  --accent: #e2553a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(226, 85, 58, .12);
  --danger: #d93a3a;
  --blur-bg: rgba(246, 245, 243, .82);
  --shadow: 0 10px 30px rgba(0, 0, 0, .12);
  --row: 62px;
  --tabh: 54px;
  --minih: 60px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --maxw: 760px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111114;
    --surface: #1c1c21;
    --surface2: #26262c;
    --text: #f1f0f3;
    --muted: #9b9aa3;
    --line: rgba(255, 255, 255, .08);
    --accent: #ff7556;
    --accent-ink: #1a0d09;
    --accent-soft: rgba(255, 117, 86, .16);
    --danger: #ff6464;
    --blur-bg: rgba(17, 17, 20, .82);
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
  padding-bottom: calc(var(--tabh) + var(--safe-b) + 16px);
  min-height: 100vh;
  overscroll-behavior-y: none;
}
body.has-mini { padding-bottom: calc(var(--tabh) + var(--minih) + var(--safe-b) + 24px); }
body.np-open, body.layer-open { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .4; cursor: default; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
audio { display: none; }
.ic { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 4px 16px 8px; font-size: 13px; }
.vh { position: fixed; left: -200px; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#view { max-width: var(--maxw); margin: 0 auto; }

/* ---------- 頂列 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  padding: calc(var(--safe-t) + 6px) 8px 6px 16px;
  background: var(--blur-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
}
.topbar-row { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.topbar-title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 26px; font-weight: 750; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back + .topbar-title h1 { font-size: 19px; font-weight: 700; }
.topbar-sub { font-size: 12px; color: var(--muted); margin-top: -2px; }
.topbar .back { margin-left: -10px; }
.topbar-actions { display: flex; gap: 2px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text); flex: none; }
.icon-btn:active { background: var(--surface2); }
.topbar .icon-btn { color: var(--accent); }

.sticky-search {
  position: sticky; top: calc(var(--safe-t) + 56px); z-index: 9;
  padding: 2px 16px 10px;
  background: var(--blur-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
}
.search { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 6px 0 10px; border-radius: 12px; background: var(--surface2); cursor: text; }
.search-ic { color: var(--muted); display: inline-flex; }
.search-ic .ic { width: 18px; height: 18px; }
.search-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; height: 100%; -webkit-appearance: none; appearance: none; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.search-clear .ic { width: 16px; height: 16px; }
.search-input:placeholder-shown + .search-clear { visibility: hidden; }
.group-search { padding: 0 16px 10px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-top: 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--surface2); white-space: nowrap; font-size: 14px; flex: none; }
.chip .ic { width: 15px; height: 15px; }
.chip.on { background: var(--accent); color: var(--accent-ink); }
.chip.partial { background: var(--accent-soft); color: var(--accent); }
.chip b { font-weight: 800; }

.segmented { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-top: 2px; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { height: 34px; padding: 0 16px; border-radius: 17px; background: var(--surface2); font-size: 14px; font-weight: 600; white-space: nowrap; flex: none; }
.segmented button.on { background: var(--text); color: var(--bg); }

.list-info { padding: 4px 16px 10px; }
.list-info-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; font-size: 13px; }
.link { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 6px 0; font-size: 14px; }
.link .ic { width: 18px; height: 18px; }
.link.strong { font-weight: 750; }

/* ---------- 按鈕 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 650; font-size: 15px; white-space: nowrap; }
.btn .ic { width: 19px; height: 19px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: var(--surface2); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn.big { height: 52px; padding: 0 26px; font-size: 17px; border-radius: 14px; }
.btn:active { transform: scale(.97); }
.play-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }

/* ---------- 列 ---------- */
.vlist { position: relative; contain: strict; width: 100%; }
.vlist > .row { position: absolute; top: 0; left: 0; right: 0; }
.row { position: relative; display: flex; align-items: center; gap: 12px; padding: 0 6px 0 16px; height: var(--row); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer; }
.row:active { background: var(--surface2); }
.row .meta { flex: 1; min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.row::after { content: ""; position: absolute; left: 74px; right: 0; bottom: 0; height: 1px; background: var(--line); }
.row.group::after { left: 80px; }
.row.selecting::after { left: 110px; }
.row .t { display: flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 520; white-space: nowrap; overflow: hidden; }
.row .tt { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .dur { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; align-self: stretch; display: flex; align-items: center; padding-left: 4px; }
.row .more, .row .grip { width: 40px; height: 100%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.row .grip { cursor: grab; touch-action: none; }
.row .chev { color: var(--muted); transform: rotate(180deg); padding: 0 10px; display: inline-flex; }
.row .chev .ic { width: 16px; height: 16px; }
.row.playing .tt { color: var(--accent); font-weight: 650; }
.row.past { opacity: .5; }
.row.disabled { opacity: .45; }
.yt-badge { display: inline-block; font-size: 10.5px; font-weight: 750; letter-spacing: .02em; color: #fff; background: #e62117; padding: 1px 6px; border-radius: 5px; }
.fav-dot { color: var(--accent); display: inline-flex; flex: none; }
.fav-dot .ic { width: 13px; height: 13px; }

.thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface2); }
.thumb.round { border-radius: 50%; }
.thumb.ph, .cover-lg.ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 700; font-size: 18px; }
.thumb.ph .ic { width: 22px; height: 22px; opacity: .6; }
.tagph { color: var(--accent) !important; background: var(--accent-soft) !important; }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; overflow: hidden; gap: 0; }
.grid4 .m { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }
.row.group { height: calc(var(--row) + 6px); }
.row.group .thumb { width: 52px; height: 52px; }

.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: none; color: transparent; }
.check .ic { width: 15px; height: 15px; }
.selected .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.row.song.selecting { padding-right: 16px; }

.songs.plain > .row { position: relative; transition: transform .18s ease; background: var(--bg); }
.songs.plain > .row.dragging { transition: none; z-index: 2; box-shadow: var(--shadow); background: var(--surface); }

/* 正在播放的小動畫 */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 14px; height: 13px; flex: none; }
.eq i { width: 3px; height: 30%; background: var(--accent); border-radius: 1px; }
.eq.on i { animation: eq 0.9s ease-in-out infinite; }
.eq.on i:nth-child(2) { animation-delay: -.3s; }
.eq.on i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { .eq.on i { animation: none; height: 70%; } }

/* ---------- 詳細頁頭 ---------- */
.detail-head { display: flex; gap: 16px; padding: 8px 16px 18px; align-items: flex-end; }
.cover-lg { width: 128px; height: 128px; border-radius: 14px; object-fit: cover; flex: none; background: var(--surface2); box-shadow: var(--shadow); }
.cover-lg.ph .ic { width: 44px; height: 44px; }
.cover-lg.grid4 { display: grid; }
.detail-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.detail-meta .play-btns { grid-template-columns: 1fr 1fr; }
.detail-meta .btn { padding: 0 10px; }
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 650; color: var(--accent); background: var(--accent-soft); padding: 2px 8px 2px 6px; border-radius: 10px; flex: none; align-self: flex-start; }
.badge .ic { width: 13px; height: 13px; }
.row .badge { align-self: center; }

/* ---------- 清單分頁 ---------- */
.auto-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 6px 16px 8px; }
.auto-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 12px; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.auto-ic { grid-row: span 2; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.auto-name { font-weight: 650; }
.auto-card .muted { font-size: 13px; }
.section-title { font-size: 20px; font-weight: 750; padding: 18px 16px 6px; }

/* ---------- 空狀態 ---------- */
.empty { text-align: center; padding: 48px 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty.small { padding: 32px 24px; }
.empty-art { width: 92px; height: 92px; border-radius: 26px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.empty-art .ic { width: 46px; height: 46px; }
.empty h2 { font-size: 22px; }
.empty p { color: var(--muted); max-width: 30em; }
.empty .hint { font-size: 13px; background: var(--surface); padding: 12px 14px; border-radius: 12px; text-align: left; }
.empty .hint b { color: var(--text); }

/* ---------- 設定 ---------- */
.card { background: var(--surface); margin: 12px 16px; padding: 16px; border-radius: 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.card h3 { font-size: 17px; }
.card > * { max-width: 100%; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.switch { -webkit-appearance: none; appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--surface2); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.about { text-align: center; padding: 20px; }
.diag-log { width: 100%; max-height: 220px; overflow: auto; background: var(--bg); border-radius: 10px; padding: 10px; margin: 0; font: 11.5px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; }
.input { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 16px; outline: none; }
.input:focus { border-color: var(--accent); }
.select { height: 44px; }
textarea.input { resize: vertical; line-height: 1.5; }

/* ---------- 迷你播放器、分頁列 ---------- */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  padding: 0 0 var(--safe-b);
  background: var(--blur-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
#tabs button { flex: 1; max-width: 190px; height: var(--tabh); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
#tabs button .ic { width: 24px; height: 24px; }
#tabs button.active { color: var(--accent); }

#mini {
  position: fixed; z-index: 21; left: 8px; right: 8px;
  bottom: calc(var(--tabh) + var(--safe-b) + 6px);
  max-width: calc(var(--maxw) - 16px); margin: 0 auto;
  height: var(--minih); border-radius: 14px;
  display: flex; align-items: center; gap: 10px; padding: 0 6px 0 8px;
  background: var(--surface); box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer;
}
#mini[hidden] { display: none; }
.mini-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--line); }
.mini-progress i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.mini-art .thumb { width: 44px; height: 44px; }
.mini-text { flex: 1; min-width: 0; }
.mini-title { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mini .icon-btn .ic { width: 26px; height: 26px; }

/* ---------- 選取列 ---------- */
#selectbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); box-shadow: 0 -6px 24px rgba(0,0,0,.12);
  padding: 6px 12px calc(var(--safe-b) + 6px);
  border-radius: 18px 18px 0 0;
}
#selectbar[hidden] { display: none; }
.selectbar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; max-width: var(--maxw); margin: 0 auto; }
.selectbar-count { font-weight: 650; }
.selectbar-actions { display: grid; grid-template-columns: repeat(5, 1fr); max-width: var(--maxw); margin: 0 auto; }
.selectbar-actions button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; font-size: 12px; font-weight: 600; color: var(--accent); }
.selectbar-actions button.danger { color: var(--danger); }
body.selecting #tabs, body.selecting #mini { visibility: hidden; }
body.selecting { padding-bottom: calc(130px + var(--safe-b)); }

/* ---------- 疊層 ---------- */
.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .38); opacity: 0; transition: opacity .25s; }
.backdrop.open { opacity: 1; }
.backdrop.full { background: transparent; }
.layer { position: fixed; z-index: 61; transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .25s; }
.layer.sheet { left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); max-width: 520px; margin: 0 auto; transform: translateY(calc(100% + 40px)); }
.layer.sheet.open { transform: none; }
.layer.center { left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.94); opacity: 0; width: min(360px, calc(100vw - 40px)); }
.layer.center.open { transform: translate(-50%, -50%); opacity: 1; }
.layer.full { inset: 0; transform: translateY(100%); background: var(--bg); }
.layer.full.open { transform: none; }

.sheet-card { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 60px - var(--safe-t)); }
.sheet-actions, .sheet-title { background: var(--surface); }
.sheet-title { border-radius: 16px 16px 0 0; padding: 14px 16px 10px; text-align: center; border-bottom: 1px solid var(--line); margin-bottom: -8px; }
.sheet-t1 { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-t2 { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-actions { border-radius: 16px; overflow-y: auto; }
.sheet-title + .sheet-actions { border-radius: 0 0 16px 16px; }
.sheet-btn { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 18px; min-height: 52px; border-bottom: 1px solid var(--line); }
.sheet-btn:last-child { border-bottom: 0; }
.sheet-btn:active { background: var(--surface2); }
.sheet-btn .ic { grid-row: span 2; color: var(--accent); }
.sheet-btn.danger, .sheet-btn.danger .ic { color: var(--danger); }
.sheet-label { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-hint { font-size: 12px; color: var(--muted); grid-column: 2; }
.sheet-sep { height: 6px; background: var(--bg); }
.sheet-cancel { background: var(--surface); border-radius: 16px; height: 54px; font-weight: 700; font-size: 17px; color: var(--accent); }

.dialog { background: var(--surface); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.dialog-title { font-size: 17px; font-weight: 700; }
.dialog-msg { color: var(--muted); font-size: 14px; }
.dialog-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.progress-bar { height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.panel { height: 100%; display: flex; flex-direction: column; max-width: var(--maxw); margin: 0 auto; }
.panel-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: calc(var(--safe-t) + 6px) 12px 6px; min-height: 52px; border-bottom: 1px solid var(--line); }
.panel-title { font-weight: 700; font-size: 16px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.panel-cancel { justify-self: start; color: var(--accent); padding: 8px 4px; font-size: 16px; }
.panel-ok { justify-self: end; color: var(--accent); font-weight: 750; padding: 8px 4px; font-size: 16px; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: var(--safe-b); display: flex; flex-direction: column; }
.panel-search { padding: 10px 16px; }
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.add-songs { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.add-tools { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; font-size: 13px; }
.pick-list { display: flex; flex-direction: column; }
.pick-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 16px; }
.pick-item:active { background: var(--surface2); }
.edit-form { padding: 14px 16px 40px; display: flex; flex-direction: column; gap: 12px; }
.field { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 10px; }
.field > span, .field-label { font-size: 14px; color: var(--muted); }
.field-label { margin-top: 8px; }
.tag-box { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-add { display: flex; gap: 8px; }
.lyrics-input { min-height: 140px; }

#toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(var(--tabh) + var(--minih) + var(--safe-b) + 18px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); width: max-content;
  background: #26262b; color: #fff; padding: 10px 16px; border-radius: 14px; font-size: 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow);
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-act { color: #ffb19f; font-weight: 750; flex: none; }
body.np-open #toast { bottom: calc(var(--safe-b) + 120px); }

/* ---------- 正在播放 ---------- */
#np {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  padding: 0 24px calc(var(--safe-b) + 8px);
  background: var(--bg);
  transform: translateY(100%);
  transition: transform .34s cubic-bezier(.2, .8, .2, 1);
  visibility: hidden;
}
#np.open { transform: none; visibility: visible; }
#np > * { width: 100%; max-width: 480px; margin-left: auto; margin-right: auto; position: relative; }
#np > .np-bg { position: absolute; inset: 0; max-width: none; background: linear-gradient(180deg, color-mix(in srgb, var(--np-tint, var(--accent)) 42%, var(--bg)) 0%, color-mix(in srgb, var(--np-tint, var(--accent)) 14%, var(--bg)) 55%, var(--bg) 100%); transition: background .6s; }
.np-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; padding-top: calc(var(--safe-t) + 4px); min-height: 56px; touch-action: none; }
.np-handle { position: absolute; top: calc(var(--safe-t) + 6px); left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--muted); opacity: .4; }
.np-source { text-align: center; font-size: 12px; font-weight: 650; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 10px; }
.np-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; margin: 6px auto 14px; }
.np-art-wrap { position: relative; width: 100%; max-height: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
#np-viz { position: absolute; inset: 0; width: 100%; height: 100%; }
.np-art { width: 100%; height: 100%; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); background: var(--surface2); transition: transform .45s cubic-bezier(.2, .8, .2, 1), border-radius .45s; }
.np-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.np-ph .ic { width: 30%; height: 30%; opacity: .5; }
#np.paused .np-art { transform: scale(.86); }
#np-viz:not([hidden]) + .np-art { transform: scale(.64); border-radius: 50%; }
#np.paused #np-viz:not([hidden]) + .np-art { transform: scale(.6); }
.np-lyrics, .np-queue { display: none; width: 100%; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#np[data-panel="lyrics"] .np-art-wrap, #np[data-panel="queue"] .np-art-wrap { display: none; }
#np[data-panel="lyrics"] .np-lyrics { display: block; }
#np[data-panel="queue"] .np-queue { display: block; }
#np[data-panel="lyrics"] .np-stage, #np[data-panel="queue"] .np-stage { align-items: stretch; }
.np-lyrics { padding: 30% 4px 45%; -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 80%, transparent); mask-image: linear-gradient(transparent, #000 12%, #000 80%, transparent); }
.ly { font-size: 22px; font-weight: 750; line-height: 1.35; margin: 0 0 16px; color: var(--text); opacity: .9; white-space: pre-wrap; }
.ly.synced { opacity: .32; cursor: pointer; transition: opacity .3s, transform .3s; transform-origin: left center; }
.ly.synced.on { opacity: 1; transform: scale(1.03); }
.lyrics-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); margin-top: -30%; }
.np-queue { margin: 0 -24px; width: calc(100% + 48px); }
.np-queue .row { background: transparent; }
.queue-head { display: flex; justify-content: space-between; align-items: center; padding: 0 16px 6px; position: sticky; top: 0; z-index: 3; }
.songs.plain.queue-list > .row { background: transparent; }
.songs.plain.queue-list > .row.dragging { background: var(--surface); }
.queue-list .row::after { left: 74px; right: 16px; }
.np-info { display: flex; align-items: center; gap: 10px; }
.np-text { flex: 1; min-width: 0; }
.np-title { font-size: 21px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; text-align: left; }
#np-fav { color: var(--muted); }
#np-fav.on { color: var(--accent); }
.np-seek-wrap { margin-top: 14px; }
#np-seek { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; --p: 0%; touch-action: none; }
#np-seek::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--text) var(--p), color-mix(in srgb, var(--text) 18%, transparent) var(--p)); }
#np-seek::-moz-range-track { height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--text) var(--p), color-mix(in srgb, var(--text) 18%, transparent) var(--p)); }
#np-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); margin-top: -4.5px; border: 0; }
#np-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }
.np-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.np-controls { display: flex; align-items: center; justify-content: space-between; margin: 10px auto 6px; }
.np-controls .icon-btn.big { width: 60px; height: 60px; }
.np-controls .icon-btn.big .ic { width: 36px; height: 36px; }
.np-controls .icon-btn.huge { width: 76px; height: 76px; }
.np-controls .icon-btn.huge .ic { width: 48px; height: 48px; }
.np-controls .mode { color: var(--muted); }
.np-controls .mode.on { color: var(--accent); background: var(--accent-soft); }
.np-tabs { display: flex; justify-content: center; gap: 28px; padding-top: 4px; }
.np-tabs button { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; color: var(--muted); padding: 8px 14px; border-radius: 18px; }
.np-tabs button .ic { width: 19px; height: 19px; }
.np-tabs button.on { color: var(--accent); background: var(--accent-soft); }

@media (max-height: 640px) {
  .np-title { font-size: 18px; }
  .np-controls .icon-btn.huge { width: 64px; height: 64px; }
  .np-seek-wrap { margin-top: 8px; }
}
@media (min-width: 820px) {
  .row { border-radius: 10px; }
}
