:root {
  color-scheme: dark;
  --bg: #14121f;
  --surface: #1d1a2c;
  --surface-2: #27233a;
  --border: #322d49;
  --text: #f1eff8;
  --muted: #a39fb8;
  --accent: #9b87ff;
  --accent-text: #14121f;
  --danger: #ff6b7d;
  --ok: #5fd39a;
  --radius: 12px;
  --tabbar-h: 58px;
  --player-h: 64px;
  --sidebar-w: 240px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f6f5fb;
    --surface: #ffffff;
    --surface-2: #ece9f7;
    --border: #dcd8ec;
    --text: #1b1830;
    --muted: #6a6585;
    --accent: #6750e0;
    --accent-text: #ffffff;
    --danger: #d2334a;
    --ok: #1d9a60;
  }
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body.np-open { overflow: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.6rem; line-height: 1.2; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 0.92rem; }
.center { text-align: center; }
.icon { fill: currentColor; flex: none; display: block; }
[hidden] { display: none !important; }
.desktop-only { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- каркас ---------- */

.sidebar { display: none; }

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  min-height: 100vh;
}
body.has-player .main { padding-bottom: calc(var(--tabbar-h) + var(--player-h) + var(--safe-bottom) + 24px); }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  text-decoration: none !important;
}
.nav-link.active { color: var(--accent); }

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 12px;
}
.page-title { flex: 1; min-width: 0; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- кнопки и поля ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.on { color: var(--accent); }
.icon-btn.primary { background: var(--accent); color: var(--accent-text); }
.icon-btn.lg .icon { width: 36px; height: 36px; }
.icon-btn.xl { width: 68px; height: 68px; }
.icon-btn.xl .icon { width: 38px; height: 38px; }

input[type='text'], input[type='password'], input[type='number'], input[type='search'], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
textarea { resize: vertical; line-height: 1.5; }
.lyrics-input { min-height: 240px; }

.form { display: grid; gap: 16px; max-width: 720px; }
.form.narrow { max-width: 360px; }
.field { display: grid; gap: 6px; }
.field .label { font-weight: 600; font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.82rem; }
.hint .icon { display: inline-block; vertical-align: -2px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.actions.start { justify-content: flex-start; }

.dropzone {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--text); }

.upload-progress {
  position: relative;
  height: 32px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.upload-progress .fill { height: 100%; width: 0; background: var(--accent); opacity: 0.45; transition: width 0.2s; }
.upload-progress span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.85rem; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.88rem;
  text-decoration: none !important;
}
a.chip:hover { background: var(--border); }
.chip button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.chip button:hover { background: var(--border); }
.authors-input { display: grid; gap: 8px; }
.authors-input .chips:empty { display: none; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 600; }
.badge.ok { color: var(--ok); }

/* ---------- панель поиска ---------- */

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; align-items: center; }
.search { position: relative; flex: 1 1 240px; display: block; }
.search .icon { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.search input { padding-left: 40px; border-radius: 999px; }
.toolbar select { width: auto; border-radius: 999px; }
.chip-toggle { cursor: pointer; }
.chip-toggle input { position: absolute; opacity: 0; }
.chip-toggle span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 0.9rem; white-space: nowrap;
}
.chip-toggle input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip-toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- обложки ---------- */

.cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: rgba(255, 255, 255, 0.85);
  flex: none;
}
.cover.sm { width: 44px; border-radius: 8px; }
.cover.md { width: 96px; }
.cover.lg { width: 160px; }
.cover.xl { width: min(70vw, 38vh, 340px); border-radius: 20px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4); }
.cover.has-img { background-size: cover !important; background-position: center !important; }
.cover.has-img > .icon { display: none; }
.cover.has-img > .num { text-shadow: 0 0 6px #000, 0 0 2px #000; }
.cover .num { font-weight: 700; font-size: 0.95rem; }

/* ---------- список треков ---------- */

.track-list { display: grid; margin: 0 -8px; }
.track-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 6px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
}
.track-row:hover { background: var(--surface); }
.meta { flex: 1; min-width: 0; text-align: left; }
.title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.track-row .dur { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.track-row .status { display: grid; place-items: center; width: 16px; color: var(--ok); }
.track-row.current .title { color: var(--accent); }
.track-row.unavailable { opacity: 0.4; }

.eq { display: none; position: absolute; inset: 0; border-radius: inherit; background: rgba(0, 0, 0, 0.55); align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 13px; }
.track-row.current .eq { display: flex; }
.eq i { width: 3px; height: 6px; background: #fff; border-radius: 2px; }
.track-row.playing .eq i { animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: 0.3s !important; }
.eq i:nth-child(3) { animation-delay: 0.6s !important; }
@keyframes eq { 0%, 100% { height: 5px; } 50% { height: 18px; } }

.spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .track-row.playing .eq i, .spinner { animation: none; }
  .nowplaying, .dialog { transition: none !important; animation: none !important; }
}

/* ---------- выделение и перетаскивание ---------- */

.tick { display: none; position: absolute; inset: 0; border-radius: inherit; place-items: center; background: var(--accent); color: var(--accent-text); }
.track-row.selected { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.track-row.selected .tick { display: grid; }
body.selecting .track-row .eq { display: none; }
body.selecting .track-row:not(.selected) .cover::after { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 2px solid rgba(255, 255, 255, 0.8); background: rgba(0, 0, 0, 0.35); }
body.selecting .row-more, body.selecting .drag-handle { visibility: hidden; }

.selectbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: none; align-items: center; gap: 4px;
  padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
body.selecting .selectbar { display: flex; }
.selectbar .count { flex: 1; font-weight: 700; white-space: nowrap; }

.drag-handle {
  display: grid; place-items: center; width: 40px; height: 44px; flex: none; margin-left: -8px;
  border: 0; border-radius: 8px; background: var(--surface-2); color: var(--muted);
  cursor: grab; touch-action: none;
}
.drag-handle:hover { color: var(--text); }
.track-row.dragging { position: relative; z-index: 2; background: var(--surface-2); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); cursor: grabbing; }
.track-row.dragging .drag-handle { cursor: grabbing; }

/* ---------- форма трека: обложка и поиск ---------- */

.title-row { display: flex; flex-wrap: wrap; gap: 8px; }
.title-row input { flex: 1 1 220px; }
.cover-row { display: flex; align-items: center; gap: 16px; }
.cover-row .actions { margin: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }

.lookup-form { display: flex; gap: 8px; }
.lookup-form input { flex: 1; min-width: 0; }
.lookup-results { display: grid; min-height: 120px; align-content: start; margin: 0 -8px; }
.lookup-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border: 0; border-radius: var(--radius); background: transparent; text-align: left; cursor: pointer; }
.lookup-row:hover { background: var(--surface-2); }
.lookup-row img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }

/* ---------- караоке ---------- */

.karaoke {
  max-height: min(60vh, 560px);
  overflow-y: auto;
  padding: 20vh 4px;
  scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}
.kline {
  display: block; width: 100%; padding: 8px 12px;
  border: 0; border-radius: var(--radius); background: transparent;
  color: var(--muted); font-size: 1.35rem; font-weight: 700; line-height: 1.3; text-align: center;
  opacity: 0.55; cursor: pointer; transition: color 0.25s, opacity 0.25s, transform 0.25s;
}
.kline:hover { opacity: 0.9; }
.kline.past { opacity: 0.35; }
.kline.active { color: var(--text); opacity: 1; transform: scale(1.04); }

/* ---------- ИИ ---------- */

.enrich-report { display: grid; gap: 2px; max-height: 40vh; overflow-y: auto; }
.enrich-report:empty { display: none; }
.enrich-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 0.9rem; }
.enrich-row .icon { margin-top: 2px; }
.enrich-row.updated .icon { color: var(--ok); }
.enrich-row.error .icon { color: var(--danger); }
.enrich-row.notfound .icon, .enrich-row.skipped .icon { color: var(--muted); }
.enrich-row .title { white-space: normal; }
.lrc-input { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }

/* ---------- сетка альбомов / плейлистов ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.card { display: grid; gap: 6px; color: var(--text); text-decoration: none !important; }
.card .cover { width: 100%; transition: transform 0.15s; }
.card:hover .cover { transform: scale(1.02); }

.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; margin-bottom: 20px; }
.hero-info { display: grid; gap: 8px; min-width: 0; justify-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-top: 6px; }
.hero .chips { justify-content: center; }

.block { margin: 0 0 16px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.block > * + * { margin-top: 10px; }
.prose, .lyrics { white-space: pre-wrap; overflow-wrap: anywhere; }
.lyrics { line-height: 1.7; font-size: 1.02rem; }

.empty { display: grid; justify-items: center; gap: 14px; padding: 56px 16px; color: var(--muted); text-align: center; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* ---------- нижняя панель проигрывателя ---------- */

.playerbar {
  position: fixed;
  left: 8px; right: 8px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 6px);
  z-index: 21;
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--player-h);
  padding: 0 6px 0 0;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.playerbar.hidden { display: none; }
.bar-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }
.bar-info {
  flex: 1; min-width: 0; height: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 0 0 0 10px; border: 0; background: transparent; cursor: pointer;
}
.bar-controls { display: flex; align-items: center; gap: 2px; }
.bar-controls .icon-btn.primary { box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- экран «Сейчас играет» ---------- */

.nowplaying {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0px) 0 var(--safe-bottom);
  background: var(--bg);
  overflow: hidden;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.28s ease, visibility 0.28s;
}
.nowplaying.open { transform: none; visibility: visible; }
/* размытая обложка на фоне и вуаль под цвет страницы */
.np-backdrop {
  position: absolute; inset: -10%; z-index: 0;
  background-size: cover !important; background-position: center !important;
  filter: blur(70px) saturate(1.4);
  opacity: 0.55;
  transition: background 0.5s;
}
.np-backdrop.cover { border-radius: 0; aspect-ratio: auto; }
.np-veil {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 20%, transparent), color-mix(in srgb, var(--bg) 75%, transparent) 60%, var(--bg));
}
.np-head, .np-body { position: relative; z-index: 1; }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 8px; flex: none; }
.np-body { flex: 1; overflow-y: auto; padding: 0 20px 24px; display: grid; gap: 28px; align-content: start; }
.np-main { display: grid; justify-items: center; gap: 10px; text-align: center; }
.np-main .cover.xl { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06); }
.np-title { margin-top: 16px; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.np-sub { color: var(--muted); min-height: 1.4em; font-size: 1.02rem; }
.np-seek { width: 100%; max-width: 480px; margin-top: 6px; }
.np-times { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.np-controls { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 380px; }
.np-controls .icon-btn.xl { box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 50%, transparent); transition: transform 0.15s; }
.np-controls .icon-btn.xl:active { transform: scale(0.94); }
.np-side { min-width: 0; width: 100%; max-width: 640px; margin: 0 auto; }

.tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 16px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  backdrop-filter: blur(12px);
}
.tab { flex: 1; min-height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.tab.active { background: var(--surface-2); color: var(--text); }
.np-panel .lyrics { text-align: center; font-size: 1.1rem; padding: 0 8px; }

.queue-row { display: flex; align-items: center; border-radius: var(--radius); }
.queue-row:hover { background: var(--surface); }
.queue-row.playing .title { color: var(--accent); }
.queue-row.unavailable { opacity: 0.4; }
.queue-main { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 8px 10px; border: 0; background: transparent; text-align: left; cursor: pointer; }

/* ползунки */
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; }
input[type='range']::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--fill, 0%), var(--border) var(--fill, 0%)); }
input[type='range']::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border); }
input[type='range']::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--text); }
input[type='range']::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--text); }
.volume { --fill: 100%; }

/* ---------- перетаскивание файлов на страницу ---------- */

.drop-overlay {
  position: fixed; inset: 12px; z-index: 70;
  display: grid; place-items: center; align-content: center; gap: 12px;
  border: 3px dashed var(--accent); border-radius: 24px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  color: var(--accent); font-size: 1.2rem; font-weight: 700;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.15s, visibility 0.15s;
}
.drop-overlay.show { opacity: 1; visibility: visible; }

/* ---------- окна и меню ---------- */

.backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.55); }
.dialog {
  width: 100%; max-width: 520px; max-height: 88vh;
  display: flex; flex-direction: column;
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  padding-bottom: var(--safe-bottom);
  animation: sheet 0.22s ease;
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 4px 20px; }
.dialog-head h2 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog-body { padding: 8px 20px 20px; overflow-y: auto; }
.menu { display: grid; margin: 0 -12px; }
.menu-item { display: flex; align-items: center; gap: 16px; min-height: 50px; padding: 0 12px; border: 0; border-radius: var(--radius); background: transparent; text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }

.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--player-h) + var(--safe-bottom) + 20px); z-index: 60; display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast { max-width: 480px; padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 0.9rem; font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.toast.error { background: var(--danger); color: #fff; border-radius: 16px; }

/* ---------- компьютер ---------- */

@media (min-width: 900px) {
  .desktop-only { display: revert !important; }
  .mobile-only { display: none !important; }
  .tabbar { display: none; }
  :root { --player-h: 80px; }

  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    display: flex; flex-direction: column; gap: 4px;
    padding: 20px 12px;
    background: var(--surface);
    border-right: 1px solid var(--border);
  }
  body.has-player .sidebar { bottom: var(--player-h); }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; font-weight: 700; }
  .sidebar .nav-link { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 11px 12px; border-radius: var(--radius); font-size: 0.95rem; font-weight: 600; }
  .sidebar .nav-link:hover { background: var(--surface-2); color: var(--text); }
  .sidebar .nav-link.active { background: var(--surface-2); }
  .sidebar .offline-badge { margin: auto 10px 0; align-self: flex-start; }

  .app { padding-left: var(--sidebar-w); }
  .selectbar { left: var(--sidebar-w); padding: 10px 24px; gap: 8px; }
  .dialog.wide { max-width: 640px; }
  .main { padding: 24px 32px 40px; }
  body.has-player .main { padding-bottom: calc(var(--player-h) + 40px); }

  .hero { flex-direction: row; align-items: flex-end; text-align: left; gap: 24px; }
  .hero-info { justify-items: start; }
  .hero-actions, .hero .chips { justify-content: flex-start; }
  .cover.lg { width: 200px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 24px; }

  .playerbar {
    left: 0; right: 0; bottom: 0;
    padding: 0 20px 0 0;
    gap: 16px;
    border-radius: 0;
    border: 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
    box-shadow: none;
  }
  .bar-progress { display: none; }
  .bar-info { flex: 0 1 300px; padding-left: 20px; }
  .bar-seek { flex: 1; display: flex !important; align-items: center; gap: 12px; }
  .bar-seek .time { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .volume { width: 110px !important; flex: none; }

  .karaoke { max-height: calc(100vh - 200px); }
  .np-panel .lyrics { max-height: calc(100vh - 200px); overflow-y: auto; padding-right: 12px; }
  .np-body { grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr); gap: 56px; padding: 16px 56px 32px; align-items: start; max-width: 1200px; margin: 0 auto; width: 100%; }
  .np-main { position: sticky; top: 16px; }
  .playerbar { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px); }

  .backdrop { align-items: center; }
  .dialog { border-radius: 20px; }
  .toasts { bottom: calc(var(--player-h) + 24px); }
}
