/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #101218;
  --bg2: #171a22;
  --bg3: #20242f;
  --bg4: #2a2f3c;
  --line: rgba(255, 255, 255, .08);
  --text: #eef0f6;
  --muted: #98a0b3;
  --accent: #8b6cff;
  --accent-2: #2dd4a7;
  --accent-soft: rgba(139, 108, 255, .16);
  --danger: #ff5f7e;
  --warn: #f5b84b;
  --track: rgba(255, 255, 255, .18);
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  --tabbar-h: 56px;
  --mini-h: 60px;
  --header-h: 52px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 12px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6f9;
    --bg2: #ffffff;
    --bg3: #eceef3;
    --bg4: #e1e4ec;
    --line: rgba(0, 0, 0, .08);
    --text: #14161d;
    --muted: #5f6678;
    --accent: #6a4cf0;
    --accent-soft: rgba(106, 76, 240, .12);
    --track: rgba(0, 0, 0, .15);
    --shadow: 0 12px 40px rgba(20, 22, 40, .18);
    color-scheme: light;
  }
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  overflow: hidden;
}
#app { height: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
img { -webkit-user-drag: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { fill: currentColor; flex-shrink: 0; display: block; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.small-text { font-size: 13px; }
.center { text-align: center; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.pad { padding: 12px 18px; }
.center-pad { display: grid; place-items: center; padding: 32px 0; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--track); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.spinner.small { width: 18px; height: 18px; border-width: 2px; }
.btn-spinner {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

/* ------------------------------------------------------------------ buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border: 0; border-radius: 999px;
  background: var(--bg3); color: var(--text); font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: transform .08s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.big { height: 46px; padding: 0 22px; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.primary.danger, .modal .btn.danger { background: var(--danger); color: #fff; }
.btn.wide { width: 100%; }
a.btn:hover { text-decoration: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.btn-row.tight { margin: 0; gap: 2px; flex-wrap: nowrap; }

.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex-shrink: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--text); cursor: pointer;
  transition: background .15s, color .15s, transform .08s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.active { color: var(--accent); }
.icon-btn.danger { color: var(--danger); }
a.icon-btn:hover { text-decoration: none; }

.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg3); color: var(--text); font-size: 16px;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.form-error { color: var(--danger); font-size: 14px; margin-top: 10px; }
.row { display: flex; gap: 8px; align-items: center; }
.row-between { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; vertical-align: middle; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 4px; vertical-align: middle; }
.dot.on { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(45, 212, 167, .18); }

input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0;
  background: transparent; cursor: pointer; --pct: 0%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(to right, var(--text) var(--pct), var(--track) var(--pct));
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%;
  background: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); transition: transform .1s;
}
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.25); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--track); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--text); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--text); }
input[type=range]:disabled { opacity: .4; cursor: default; }

.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--bg4); transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ------------------------------------------------------------------ covers */
.cover {
  position: relative; overflow: hidden; flex-shrink: 0; display: grid; place-items: center;
  border-radius: 6px; aspect-ratio: 1; color: rgba(255, 255, 255, .8);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.tiny { width: 32px; height: 32px; border-radius: 5px; }
.cover.tiny .icon { width: 16px; height: 16px; }
.cover.small { width: 44px; height: 44px; }
.cover.medium { width: 56px; height: 56px; }
.cover.round { border-radius: 50%; }
.cover.add-cover { background: var(--bg3); color: var(--text); }

/* ------------------------------------------------------------------ app shell */
.app { position: fixed; inset: 0; }
.main {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  scrollbar-width: thin; scrollbar-color: var(--bg4) transparent;
}
.app.mobile.has-player .main { padding-bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--safe-bottom) + 28px); }
.view { min-height: 100%; animation: fade .18s ease-out; }

.view-header {
  position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 4px;
  height: calc(var(--header-h) + var(--safe-top)); padding: var(--safe-top) 6px 0;
  transition: background .2s, border-color .2s; border-bottom: 1px solid transparent;
}
.view-header.solid {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border-bottom-color: var(--line);
}
.view-header-title { flex: 1; min-width: 0; text-align: center; font-weight: 700; font-size: 16px; opacity: 0; transition: opacity .2s; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.view-header.solid .view-header-title { opacity: 1; }
.view-header-actions { display: flex; min-width: 44px; justify-content: flex-end; }
.hdr-spacer { width: 44px; }

.page { padding: 4px 16px 24px; max-width: 1280px; }
.page-title { font-size: 28px; font-weight: 800; margin: 4px 0 8px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 8px; }
.section-title h2 { font-size: 19px; font-weight: 750; }
.list { display: flex; flex-direction: column; }

/* ------------------------------------------------------------------ tab bar (mobile) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 19; display: flex;
  height: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); font-weight: 500; }
.tab:hover { text-decoration: none; }
.tab.active { color: var(--text); }
.tab:active .icon { transform: scale(.9); }

/* ------------------------------------------------------------------ mini player (mobile) */
.mini-player {
  position: fixed; left: 8px; right: 8px; z-index: 20;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 6px); height: var(--mini-h);
  display: flex; align-items: center; gap: 10px; padding: 0 4px 0 8px; overflow: hidden;
  border-radius: 14px; cursor: pointer;
  background: color-mix(in srgb, var(--bg4) 90%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35); animation: sheet-up .3s ease-out;
}
.mini-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mini-text .muted { font-size: 13px; }
.mini-actions { display: flex; align-items: center; }
.progress-line { position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--track); border-radius: 2px; overflow: hidden; }
.progress-line i { display: block; height: 100%; background: var(--text); transition: width .25s linear; }
.output-hint { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent-2); font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }

.play-btn {
  position: relative; width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--text); color: var(--bg); cursor: pointer;
  transition: transform .08s;
}
.mini-player .play-btn { background: transparent; color: var(--text); }
.play-btn:active { transform: scale(.92); }
.play-btn.big { width: 72px; height: 72px; }
.play-btn .btn-spinner { position: absolute; inset: 3px; width: auto; height: auto; border-width: 2px; opacity: .5; }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 16px; padding: calc(var(--header-h) + var(--safe-top) + 8px) 20px 8px;
  margin-top: calc(-1 * (var(--header-h) + var(--safe-top)));
}
.hero-bg {
  position: absolute; inset: 0 0 -40px; z-index: -1; opacity: .55; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent);
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
}
.hero-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(48px) saturate(1.5); transform: scale(1.3); }
.hero-cover { width: min(56vw, 230px); border-radius: 10px; box-shadow: 0 16px 48px rgba(0, 0, 0, .45); }
.hero-cover .icon { width: 64px; height: 64px; }
.hero-text { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.hero h1 { font-size: 24px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.kicker a { color: var(--text); }
.hero-sub { color: var(--muted); font-size: 14px; }
.hero-sub a { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.crumbs { text-transform: none; letter-spacing: 0; font-weight: 600; }

/* ------------------------------------------------------------------ track rows */
.track-list { display: flex; flex-direction: column; }
.track-row, .folder-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  min-height: 58px; padding: 6px 6px 6px 8px; border-radius: 10px; cursor: pointer;
  -webkit-user-select: none; user-select: none; transition: background .12s;
  content-visibility: auto; contain-intrinsic-size: auto 58px;
}
.folder-row { grid-template-columns: 44px minmax(0, 1fr) auto; background: none; border: 0; text-align: left; width: 100%; }
.folder-row:hover { text-decoration: none; }
.track-row:has(.drag-handle) { grid-template-columns: 44px minmax(0, 1fr) auto auto auto; }
.track-row:active, .folder-row:active { background: var(--bg3); }
@media (hover: hover) {
  .track-row:hover, .folder-row:hover { background: var(--bg3); }
  .track-row .tr-more { opacity: .6; }
  .track-row:hover .tr-more { opacity: 1; }
}
.tr-lead { position: relative; width: 44px; height: 44px; display: grid; place-items: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.tr-eq-over { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); border-radius: 6px; color: #fff; }
.tr-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tr-title { font-weight: 500; }
.tr-sub { font-size: 13px; color: var(--muted); }
.tr-dur { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.track-row.current .tr-title { color: var(--accent); font-weight: 600; }
.track-row.unavailable { opacity: .45; }
.track-row.dragging { background: var(--bg3); box-shadow: var(--shadow); }
.is-dragging .track-row:not(.dragging) { transition: transform .15s; }
.drag-handle { cursor: grab; touch-action: none; color: var(--muted); }
@media (max-width: 520px) {
  .track-row:has(.drag-handle) { grid-template-columns: 44px minmax(0, 1fr) auto auto; }
  .track-row:has(.drag-handle) .tr-dur { display: none; }
}
.track-row.skeleton { cursor: default; }
.sk-line { height: 10px; border-radius: 5px; background: var(--bg3); width: 60%; }
.sk-line.short { width: 35%; margin-top: 6px; }

.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; color: var(--accent); }
.eq i { display: block; width: 3px; height: 45%; background: currentColor; border-radius: 1px; }
.eq i:nth-child(2) { height: 85%; }
.eq i:nth-child(3) { height: 60%; }
.eq.on i { animation: eq 1s ease-in-out infinite; }
.eq.on i:nth-child(2) { animation-delay: -.35s; }
.eq.on i:nth-child(3) { animation-delay: -.7s; }
.tr-eq-over .eq { color: #fff; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* ------------------------------------------------------------------ cards */
.card-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 140px; gap: 14px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  margin: 0 -16px; padding: 4px 16px 10px; scrollbar-width: none;
}
.card-row::-webkit-scrollbar { display: none; }
.card { display: flex; flex-direction: column; gap: 4px; scroll-snap-align: start; min-width: 0; }
.card:hover { text-decoration: none; }
.card-cover { width: 100%; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); transition: transform .15s; }
.card-cover .icon { width: 40px; height: 40px; }
.card:active .card-cover { transform: scale(.97); }
.card-title { font-weight: 600; font-size: 14px; margin-top: 4px; }
.card-sub { font-size: 12px; color: var(--muted); }

.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.root-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.root-card { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); transition: background .15s; }
.root-card:hover { text-decoration: none; background: var(--bg3); }
.root-cover { width: 56px; border-radius: 8px; }
.root-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 24px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 18px; }
.empty p { margin: 0; max-width: 380px; }
.empty-icon { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); color: var(--muted); margin-bottom: 4px; }

/* ------------------------------------------------------------------ search */
.search-bar {
  position: sticky; top: 0; z-index: 6; padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.search-field { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 4px 0 14px; border-radius: 12px; background: var(--bg3); color: var(--muted); max-width: 720px; }
.search-field input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font-size: 16px; outline: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field .icon-btn { width: 36px; height: 36px; color: var(--muted); }

/* ------------------------------------------------------------------ queue */
.history-toggle { margin-top: 8px; color: var(--muted); }
.queue .section-title { margin-top: 18px; }

/* ------------------------------------------------------------------ overlays */
.overlay { position: fixed; inset: 0; z-index: 60; }
.overlay.sheet-mode, .overlay.modal-mode { background: rgba(0, 0, 0, .5); animation: backdrop .2s; }
@keyframes backdrop { from { background: transparent; } }
.overlay.closing { opacity: 0; transition: opacity .18s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--bg2); border-radius: 20px 20px 0 0; padding: 4px 0 calc(10px + var(--safe-bottom));
  animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); transition: transform .18s; box-shadow: var(--shadow);
}
.overlay.closing .sheet { transform: translateY(100%); }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--bg4); margin: 6px auto 4px; flex-shrink: 0; }
.sheet-title { font-weight: 700; font-size: 17px; padding: 8px 20px 6px; }
.sheet-scroll { overflow-y: auto; overscroll-behavior: contain; }
.popover {
  position: fixed; min-width: 230px; max-width: 320px; padding: 6px; z-index: 61;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  animation: pop .12s ease-out; transform-origin: top right;
}
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 20px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.popover .menu-head { padding: 6px 10px 10px; }
.menu-head-text { min-width: 0; display: flex; flex-direction: column; }
.menu-items { display: flex; flex-direction: column; }
.menu-item {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 13px 20px; border: 0;
  background: none; color: var(--text); text-align: left; cursor: pointer; font-size: 15px;
}
.menu-item .icon { color: var(--muted); }
.menu-item:active, .menu-item:hover { background: var(--bg3); }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.popover .menu-item { padding: 9px 10px; border-radius: 8px; gap: 12px; font-size: 14px; }
.popover .menu-item .icon { width: 20px; height: 20px; }

.modal-mode { display: grid; place-items: center; padding: 16px; }
.modal { width: min(420px, 100%); background: var(--bg2); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); animation: pop .15s ease-out; }
.modal h3 { font-size: 18px; margin-bottom: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.device-row { display: flex; align-items: center; gap: 8px; padding-right: 16px; }
.device-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px 20px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.device-main:hover { background: var(--bg3); }
.device-row.active .device-main, .device-row.active .device-main .icon { color: var(--accent-2); }

.toasts { position: fixed; left: 0; right: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
  bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--safe-bottom) + 20px); }
.toast { padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: pop .2s ease-out; max-width: 90vw; }

.banners { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); top: calc(var(--safe-top) + 58px); display: flex; flex-direction: column; gap: 6px; align-items: center; width: max-content; max-width: calc(100vw - 24px); pointer-events: none; }
.banner { pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border: 0; border-radius: 99px; background: var(--bg4); color: var(--text); font-size: 13px; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; animation: pop .2s ease-out; }
.banner.accent { background: var(--accent); color: #fff; }
.banner.warn { background: var(--warn); color: #1d1606; }
.banner.muted-banner { cursor: default; color: var(--muted); }

/* ------------------------------------------------------------------ now playing */
.now-playing {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); padding: var(--safe-top) 0 var(--safe-bottom);
  transform: translateY(100%); visibility: hidden;
  transition: transform .34s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .34s;
}
.now-playing.open { transform: none; visibility: visible; transition: transform .34s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.np-bg { position: absolute; inset: 0; z-index: -1; opacity: .9; }
.np-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(70px) saturate(1.6); transform: scale(1.4); opacity: .7; }
.np-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, .15), color-mix(in srgb, var(--bg) 92%, transparent) 75%); }
.np-top { display: flex; align-items: center; gap: 8px; padding: 6px 8px; flex-shrink: 0; }
.np-context { flex: 1; min-width: 0; text-align: center; font-size: 14px; }
.np-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.np-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.np-cover-wrap { flex: 1; min-height: 0; display: grid; place-items: center; padding: 8px 28px; }
.np-cover { width: min(86vw, 52vh, 520px); border-radius: 12px; box-shadow: 0 24px 64px rgba(0, 0, 0, .5); }
.np-cover .icon { width: 30%; height: 30%; }
.np-meta { padding: 8px 24px 12px; display: flex; flex-direction: column; gap: 10px; max-width: 640px; width: 100%; margin: 0 auto; }
.np-title-row { display: flex; align-items: center; gap: 12px; }
.np-titles { flex: 1; min-width: 0; }
.np-title { font-size: 22px; font-weight: 800; }
.np-artist { font-size: 16px; }
.np-artist a { font-weight: 600; }
.np-bottom { display: flex; justify-content: space-between; align-items: center; }
.now-playing, .sheet { touch-action: none; }
.np-queue, .sheet-scroll { touch-action: pan-y; }
.np-queue { display: none; min-height: 0; overflow-y: auto; padding: 0 12px 12px; overscroll-behavior: contain; }
.np-body.show-queue .np-cover-wrap { display: none; }
.np-body.show-queue .np-main { flex: 0 0 auto; order: 2; }
.np-body.show-queue .np-queue { display: block; flex: 1; order: 1; }
.device-btn { width: auto; min-width: 44px; padding: 0 10px; border-radius: 22px; gap: 6px; display: inline-flex; align-items: center; max-width: 70%; }
.device-btn.active { color: var(--accent-2); }
.device-btn span { font-size: 13px; font-weight: 600; }

.seek { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 8px; width: 100%; }
.seek-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.seek.big { grid-template-columns: 1fr 1fr; row-gap: 0; }
.seek.big input { grid-column: 1 / -1; grid-row: 1; height: 28px; }
.seek.big .seek-time { grid-row: 2; text-align: left; }
.seek.big .seek-time:last-child { text-align: right; }
.seek.big input::-webkit-slider-runnable-track { height: 5px; }

.controls { display: flex; align-items: center; justify-content: center; gap: 8px; }
.controls.big { justify-content: space-between; }
.controls.big .icon-btn { width: 56px; height: 56px; }

/* ------------------------------------------------------------------ settings */
.settings { max-width: 760px; }
.card-section { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px 16px; margin-top: 14px; }
.card-section .section-title { margin: 12px 0 6px; }
.card-section .section-title h2 { font-size: 17px; }
.card-section p { margin: 4px 0 10px; }
.inline-form .row .input { flex: 1; }
.source { padding: 10px 0; border-top: 1px solid var(--line); }
.source:first-of-type { border-top: 0; }
.root-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 2px 0 0 14px; }
.root-line .ellipsis { flex: 1; }
.list-line { padding: 8px 0; border-top: 1px solid var(--line); }
.token-box { background: var(--accent-soft); border-radius: 10px; padding: 12px; margin: 8px 0; }
.token { display: block; word-break: break-all; font-size: 13px; margin-top: 6px; padding: 8px; background: var(--bg); border-radius: 8px; user-select: all; -webkit-user-select: all; }
.meter { height: 8px; border-radius: 4px; background: var(--bg3); overflow: hidden; margin: 6px 0; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ------------------------------------------------------------------ login */
.login { position: fixed; inset: 0; overflow-y: auto; display: grid; place-items: center; padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px);
  background: radial-gradient(1200px 600px at 20% -10%, rgba(139, 108, 255, .28), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(45, 212, 167, .18), transparent 60%), var(--bg); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; }
.login-logo { border-radius: 18px; margin: 0 auto 18px; box-shadow: 0 12px 36px rgba(139, 108, 255, .35); }
.login-card h1 { text-align: center; font-size: 24px; margin-bottom: 8px; }
.login-card p { text-align: center; margin: 0 0 8px; }
.login-card .btn { margin-top: 22px; }

/* ------------------------------------------------------------------ responsive */
.only-desktop { display: none; }
@media (min-width: 900px) {
  .only-mobile { display: none !important; }
  .only-desktop { display: block; }
  .app.desktop { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 90px; grid-template-areas: "side main" "bar bar"; }
  .app.desktop .main { position: relative; inset: auto; grid-area: main; padding-bottom: 40px; border-radius: 12px 12px 0 0; }
  .sidebar { grid-area: side; display: flex; flex-direction: column; gap: 8px; padding: 18px 10px 10px; background: var(--bg2); border-right: 1px solid var(--line); min-height: 0; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 14px; font-weight: 800; font-size: 17px; }
  .brand img { border-radius: 8px; }
  .brand:hover { text-decoration: none; }
  .side-link { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; }
  .side-link:hover { text-decoration: none; color: var(--text); background: var(--bg3); }
  .side-link.active { color: var(--text); background: var(--bg3); }
  .side-playlists { flex: 1; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; scrollbar-width: thin; }
  .side-pl { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; }
  .side-pl:hover { text-decoration: none; background: var(--bg3); color: var(--text); }
  .side-pl.active { color: var(--text); background: var(--bg3); }

  .player-bar { grid-area: bar; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 16px; padding: 0 16px; background: var(--bg2); border-top: 1px solid var(--line); z-index: 10; }
  .pb-left { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
  .pb-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .pb-text .muted { font-size: 13px; }
  .pb-center { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 640px; width: 100%; justify-self: center; }
  .pb-center .controls .icon-btn { width: 38px; height: 38px; }
  .pb-center .play-btn { width: 40px; height: 40px; }
  .pb-right { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
  .volume { display: flex; align-items: center; width: 150px; }

  .view-header { height: 56px; padding: 0 16px; }
  .view-header-title { text-align: left; padding-left: 4px; }
  .page { padding: 4px 32px 32px; }
  .card-row { margin: 0 -32px; padding: 4px 32px 10px; grid-auto-columns: 168px; gap: 18px; }
  .hero { flex-direction: row; align-items: flex-end; text-align: left; gap: 28px; padding: 76px 32px 12px; margin-top: -56px; }
  .hero-cover { width: 220px; }
  .hero-text { align-items: flex-start; }
  .hero h1 { font-size: clamp(28px, 4vw, 52px); }
  .hero-actions { justify-content: flex-start; }
  .banners { top: 66px; left: calc(50% + 120px); }
  .toasts { bottom: 110px; left: 240px; }

  .now-playing { z-index: 50; }
  .np-body { flex-direction: row; padding: 0 24px 24px; gap: 32px; }
  .np-main { flex: 1.2; justify-content: center; }
  .np-cover { width: min(44vw, 58vh, 560px); }
  .np-queue { display: block; flex: 1; background: color-mix(in srgb, var(--bg2) 70%, transparent); border-radius: 16px; padding: 8px 12px; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
  .np-body.show-queue .np-cover-wrap { display: grid; }

  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 440px; max-height: 70vh; border-radius: 16px; transform: translate(-50%, -50%); animation: pop .15s ease-out; padding-bottom: 10px; }
  .overlay.closing .sheet { transform: translate(-50%, -50%); }
  .sheet-grip { display: none; }
}
@media (min-width: 1400px) {
  .app.desktop { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .controls.big .icon-btn { width: 48px; height: 48px; }
  .hero-actions .btn.big { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
