/* ==========================================================================
   Giat Music — стиль Giat Dark
   Чёрный фон, светлые кнопки, один акцент (--accent). Акцент меняется
   из настроек оформления или подстраивается под обложку трека.
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg: #000;
  --bg2: #070707;
  --surface: #0d0d0d;
  --surface2: #151515;
  --hover: #1a1a1a;
  --line: #1c1c1c;
  --line2: #2a2a2a;
  --text: #ededed;
  --muted: #8f8f8f;
  --btn-bg: #ededed;
  --btn-fg: #000;
  --accent: #ff3b47;
  --danger: #ff4d55;
  --ok: #6fdc8c;
  --warn: #ffb74d;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Manrope", var(--font);
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --side-w: 240px;
  --top-h: 64px;
  --bar-h: 72px;
  --tab-h: 0px;
  --radius: 12px;
  color-scheme: dark;
}

[data-theme="mono"] {
  --accent: #ededed;
}

[data-theme="term"] {
  --bg: #030603;
  --bg2: #050a05;
  --surface: #081008;
  --surface2: #0c170c;
  --hover: #102010;
  --line: #143014;
  --line2: #1e4a1e;
  --text: #b8ffc6;
  --muted: #6fb37f;
  --btn-bg: #7dff9a;
  --btn-fg: #021002;
  --accent: #7dff9a;
  --font: "JetBrains Mono", ui-monospace, monospace;
  --font-head: var(--font);
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.np-open { overflow: hidden; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }

a { color: var(--text); }
[hidden] { display: none !important; }

button, .trow, a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0; min-height: 1em; }
.hint.bad, .error, .error-text { color: var(--danger); }
.error { min-height: 1.2em; font-size: 14px; margin: 4px 0 10px; }
.empty { color: var(--muted); padding: 24px 0; }
.link { color: var(--accent); }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 10px;
  background: var(--btn-bg); color: var(--btn-fg);
  font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none;
  transition: filter 0.15s, background 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line2); }
.btn-ghost:hover { background: var(--hover); filter: none; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #000; }

input, textarea, select {
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line2); border-radius: 10px;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  width: 100%; min-height: 44px; padding: 0 14px;
}
input:focus { outline: none; border-color: var(--accent); }

.search { margin: 0 0 14px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }

/* ---------- вход / приглашение ---------- */
.center {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
}
.card {
  width: min(400px, 100%); padding: 32px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
}
.logo {
  font-family: var(--font-head); font-weight: 800; font-size: 26px;
  letter-spacing: 0.04em; margin-bottom: 4px;
}
.logo span { color: var(--accent); }
.card .muted { margin: 0 0 22px; }

/* ==========================================================================
   Каркас: меню слева, контент, мини-плеер снизу
   ========================================================================== */
.shell { min-height: 100dvh; }

.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  display: flex; flex-direction: column;
  padding: 16px 10px calc(var(--bar-h) + 12px);
  background: var(--bg); border-right: 1px solid var(--line);
  overflow-y: auto; z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 20px; text-decoration: none; color: var(--text);
}
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 1.5px solid var(--accent); border-radius: 9px; color: var(--accent);
  transition: color 0.4s, border-color 0.4s;
}
.brand-mark svg { width: 17px; height: 17px; }
.brand-text { font-family: var(--font-head); font-weight: 800; font-size: 16px; letter-spacing: 0.12em; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 14px;
  min-height: 44px; padding: 0 14px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.side-link svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.side-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link:hover { background: var(--hover); color: var(--text); }
.side-link.active { background: var(--surface2); color: var(--text); font-weight: 600; }
.side-link.active svg { fill: var(--accent); }
.side-head {
  margin: 22px 14px 6px; padding-top: 18px; border-top: 1px solid var(--line);
  font: 500 11px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.side-pl { display: flex; flex-direction: column; gap: 1px; }
.side-pl-link { min-height: 38px; font-size: 14px; }
.side-pl-link svg { width: 18px; height: 18px; }
.side-empty { color: var(--muted); font-size: 13px; padding: 4px 14px; margin: 0; }

.content { margin-left: var(--side-w); min-height: 100dvh; position: relative; }

.topbar {
  position: sticky; top: 0; z-index: 15;
  height: var(--top-h); display: flex; align-items: center; gap: 16px;
  padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topsearch {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line2);
}
.topsearch:focus-within { border-color: var(--accent); }
.topsearch svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.topsearch input {
  flex: 1; min-width: 0; min-height: 0 !important; height: 100%; padding: 0 !important;
  background: transparent; border: 0; outline: none;
}
.avatar {
  margin-left: auto; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--line2);
  font-weight: 700; text-decoration: none; color: var(--text);
}
.avatar:hover { border-color: var(--accent); }

.view {
  padding: 28px 32px calc(var(--bar-h) + var(--tab-h) + 40px);
  max-width: 1360px;
}
.page { display: block; }
.page > h1 { margin-bottom: 20px; }

.tabbar { display: none; }

/* ==========================================================================
   Списки треков
   ========================================================================== */
.tracklist { display: flex; flex-direction: column; }
.trow {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer; outline: none;
}
.trow + .trow { border-top: 1px solid var(--line); }
.trow:hover, .trow:focus-visible { background: var(--hover); }
.trow.hasact { grid-template-columns: 48px minmax(0, 1fr) auto auto; }
.tcover {
  width: 48px; height: 48px; border-radius: 6px; overflow: hidden;
  background: var(--surface2); position: relative;
}
.tcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.trow.playing .tcover::after {
  content: ""; position: absolute; inset: 0;
  background: color-mix(in srgb, #000 55%, transparent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z'/%3E%3C/svg%3E")
    center / 22px no-repeat;
}
.tinfo { min-width: 0; }
.ttitle, .tartist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttitle { font-weight: 600; }
.tartist { color: var(--muted); font-size: 14px; }
.trow.playing .ttitle { color: var(--accent); }
.tdur { color: var(--muted); font: 13px var(--font-mono); }
.tactions { display: flex; gap: 2px; opacity: 0.6; }
.trow:hover .tactions, .trow:focus-within .tactions { opacity: 1; }
.ticon {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.ticon:hover:not(:disabled) { color: var(--text); background: var(--surface2); }
.ticon:disabled { opacity: 0.3; cursor: default; }
.ticon svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- главная ---------- */
.hblock { margin: 8px 0 40px; }
.hhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hhead h2 { margin: 0; font-size: 22px; }

.plgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.plcard { display: block; text-decoration: none; color: var(--text); }
.plcover {
  aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; margin-bottom: 10px;
  background: var(--surface2) center / 40% no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23333' d='M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z'/%3E%3C/svg%3E");
  border: 1px solid var(--line); transition: border-color 0.15s, transform 0.15s;
}
.plcard:hover .plcover { border-color: var(--accent); transform: translateY(-2px); }
.plcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plcount { color: var(--muted); font-size: 13px; }
.newpl, .pl-rename { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.newpl .search, .pl-rename .search { flex: 1; min-width: 180px; margin: 0; }
.pl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }

/* ---------- скачивание ---------- */
.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px;
  border-radius: 6px; border: 1px solid var(--line2);
  font: 500 11px/1 var(--font-mono); letter-spacing: 0.04em; color: var(--muted);
}
.badge.admin, .badge.run { color: var(--accent); border-color: var(--accent); }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.badge.err { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }

.exists-card {
  margin: 14px 0; padding: 18px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--accent);
}
.exists-title { font: 700 12px/1 var(--font); letter-spacing: 0.08em; color: var(--accent); margin-bottom: 6px; }
.exists-name { font-weight: 700; font-size: 17px; margin-bottom: 4px; }

.job {
  padding: 14px 16px; background: var(--bg2); border: 1px solid var(--line);
}
.job:first-child { border-radius: 12px 12px 0 0; }
.job:last-child { border-radius: 0 0 12px 12px; }
.job:only-child { border-radius: 12px; }
.job + .job { border-top: 0; }
.job-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.job-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.job-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.progress { height: 4px; margin-top: 10px; border-radius: 2px; background: var(--line2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }

/* ---------- окна поверх (в плейлист, редактирование) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  padding: 16px; background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.sheet {
  width: min(440px, 100%); max-height: 84dvh; overflow-y: auto; padding: 22px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line2);
}
.sheet h3 { margin: 0 0 14px; font-size: 18px; overflow-wrap: anywhere; }
.sheet-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.sheet-item {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px;
  border-radius: 10px; border: 1px solid var(--line2); background: transparent;
  color: var(--text); cursor: pointer; text-align: left; font: inherit;
}
.sheet-item:hover { border-color: var(--accent); }
.sheet-new { display: flex; gap: 8px; margin-bottom: 8px; }
.sheet-new .search { flex: 1; min-width: 0; margin: 0; }

.ed-sheet { width: min(540px, 100%); max-height: 90dvh; }
.ed-form { display: flex; flex-direction: column; gap: 14px; }
.ed-field { display: flex; flex-direction: column; gap: 6px; }
.ed-label { font-size: 13px; color: var(--muted); }
.ed-row2 { display: flex; gap: 12px; }
.ed-row2 .ed-field { flex: 1; min-width: 0; }
.ed-cover-box { display: flex; gap: 14px; align-items: flex-start; }
.ed-cover {
  width: 120px; height: 120px; flex: none; border-radius: 10px; background: var(--surface2);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 12px; color: var(--muted);
}
.ed-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-cover-tools { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.ed-url { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-url input { flex: 1; min-width: 140px; }
.ed-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-msg { min-height: 1.2em; font-size: 14px; margin: 0; }
.ed-msg.err { color: var(--danger); }
.ed-msg.ok { color: var(--ok); }
.ed-msg.warn { color: var(--warn); }
.ed-radio {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px; margin: 8px 0;
  border: 1px solid var(--line2); border-radius: 10px; cursor: pointer;
}
.ed-radio input { margin-top: 3px; accent-color: var(--accent); }

/* ---------- админ ---------- */
.admin-box h2 { margin-bottom: 14px; }
.section { margin: 18px 0 26px; }
.section h2 { font-size: 17px; }
.user-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 0;
}
.user-row + .user-row { border-top: 1px solid var(--line); }
.user-row .name { font-weight: 600; margin-right: auto; }
.linkbox { margin: 12px 0; padding: 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line2); }
.linkbox-row { display: flex; gap: 8px; }
.linkbox input { font-family: var(--font-mono); font-size: 13px; }
.linkbox-row .btn { flex: none; }
.hint-line { color: var(--muted); font-size: 13px; margin-top: 8px; }
.lg-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.lg-head { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.lg-track { font-weight: 600; margin: 3px 0; overflow-wrap: anywhere; }
.lg-line { font-size: 13px; color: var(--text); opacity: 0.8; overflow-wrap: anywhere; }

/* ==========================================================================
   Настройки
   ========================================================================== */
.settings { max-width: 820px; }
.set-card {
  margin-bottom: 22px; padding: 22px 24px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
}
.set-card > h2 { margin-bottom: 6px; }
.set-sub {
  margin: 22px 0 10px; font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.acc-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.acc-avatar {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--surface2); border: 1.5px solid var(--accent);
  font: 800 22px/1 var(--font-head);
}
.acc-who { display: flex; flex-direction: column; margin-right: auto; }
.acc-name { font-weight: 700; font-size: 18px; }

.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-top: 1px solid var(--line); cursor: default;
}
label.set-row { cursor: pointer; }
.set-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-name { font-weight: 600; }
.set-hint { color: var(--muted); font-size: 13px; }
.set-note { color: var(--muted); font-size: 12px; margin: 2px 0 0; }

.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 46px; height: 26px; border-radius: 13px; margin: 0;
  background: var(--line2); position: relative; cursor: pointer; transition: background 0.2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); background: #000; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line2); flex: none; }
.seg-btn {
  min-height: 36px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font: 500 13px var(--font); cursor: pointer;
}
.seg-btn[aria-checked="true"] { background: var(--btn-bg); color: var(--btn-fg); font-weight: 600; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.theme-card {
  display: flex; flex-direction: column; gap: 10px; padding: 10px; text-align: left;
  border-radius: 12px; background: var(--bg2); border: 1px solid var(--line2);
  color: var(--text); font: 600 14px var(--font); cursor: pointer;
}
.theme-card[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-prev {
  height: 78px; border-radius: 8px; padding: 10px;
  display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr auto; gap: 6px 8px;
  border: 1px solid #222;
  --p-bg: #000; --p-fg: #ededed; --p-ac: #ff3b47;
  background: var(--p-bg);
}
.theme-card[data-preview="dark"] .theme-prev { --p-ac: var(--accent); }
.theme-card[data-preview="mono"] .theme-prev { --p-ac: #ededed; }
.theme-card[data-preview="term"] .theme-prev { --p-bg: #030603; --p-fg: #7dff9a; --p-ac: #7dff9a; }
.tp-line { grid-column: 1 / -1; width: 55%; height: 6px; border-radius: 3px; background: var(--p-fg); }
.tp-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--p-fg); align-self: end; }
.tp-bar { height: 4px; border-radius: 2px; background: var(--p-ac); align-self: center; }

.swatches { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.swatch {
  width: 44px; height: 44px; padding: 7px; border-radius: 50%;
  border: 2px solid transparent; background: transparent; cursor: pointer;
}
.swatch::before { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c); }
.swatch[aria-pressed="true"] { border-color: var(--text); }
.swatch:disabled { opacity: 0.25; cursor: default; }

/* ==========================================================================
   Мини-плеер (внизу, как в YouTube Music)
   ========================================================================== */
.playerbar {
  position: fixed; left: 0; right: 0; bottom: var(--tab-h); z-index: 40;
  height: var(--bar-h);
  background: var(--bg2); border-top: 1px solid var(--line);
}
.pb-progress { position: absolute; left: 0; right: 0; top: -2px; height: 4px; }
.pb-progress::before { content: ""; position: absolute; inset: 0; background: var(--line2); }
.pb-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); transition: background 0.4s; }
.pb-range {
  position: absolute; left: 0; right: 0; top: -8px; width: 100%; height: 20px; margin: 0;
  opacity: 0; cursor: pointer;
}
.pb-progress:hover { height: 6px; top: -3px; }

.pb-row {
  height: 100%; display: grid; align-items: center; gap: 16px;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 1.6fr) minmax(200px, 1fr);
  padding: 0 16px;
}
.pb-left, .pb-right { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pb-right { justify-content: flex-end; }
.pb-btn {
  position: relative; display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--text); cursor: pointer;
}
.pb-btn:hover { background: var(--hover); }
.pb-btn svg { width: 24px; height: 24px; fill: currentColor; }
.pb-btn.on { color: var(--accent); }
.pb-btn[data-mode="one"]::after {
  content: "1"; position: absolute; right: 8px; bottom: 7px; font: 800 10px/1 var(--font);
}
.pb-play { width: 48px; height: 48px; }
.pb-play svg { width: 34px; height: 34px; }
.pb-time { margin-left: 10px; color: var(--muted); font: 12px var(--font-mono); white-space: nowrap; }

.pb-center {
  display: flex; align-items: center; gap: 12px; justify-self: center;
  max-width: 100%; min-width: 0; padding: 6px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.pb-center:hover { background: var(--hover); }
.pb-cover { width: 44px; height: 44px; flex: none; border-radius: 6px; overflow: hidden; background: var(--surface2); }
.pb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-info { display: flex; flex-direction: column; min-width: 0; }
.pb-title, .pb-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-title { font-weight: 600; font-size: 14px; }
.pb-artist { color: var(--muted); font-size: 13px; }

.pb-vol { display: flex; align-items: center; }
.pb-vol input[type="range"] { width: 96px; accent-color: var(--accent); margin: 0 6px 0 0; }
.pb-expand svg { transition: transform 0.25s; }
body.np-open .pb-expand svg { transform: rotate(180deg); }

/* ==========================================================================
   Экран плеера
   ========================================================================== */
.np {
  position: fixed; z-index: 30; left: var(--side-w); right: 0; top: 0;
  bottom: calc(var(--bar-h) + var(--tab-h));
  background: var(--bg); overflow: hidden;
  animation: np-in 0.22s ease-out;
}
@keyframes np-in { from { opacity: 0; transform: translateY(16px); } }
.np-bg { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.np-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(70px) saturate(1.4); transform: scale(1.3); }
.np.blur-bg .np-bg { opacity: 0.35; }
.np-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.35), var(--bg)); }
.np-bg img:not([src]) { display: none; }

.np-close {
  position: absolute; top: 14px; left: 18px; z-index: 2;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: transparent; color: var(--text); cursor: pointer;
}
.np-close:hover { background: var(--hover); }
.np-close svg { width: 28px; height: 28px; fill: currentColor; }

.np-body {
  position: relative; z-index: 1; height: 100%;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 48px;
  padding: 64px 48px 24px;
}
.np-art { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 0; }
.np-cover {
  width: min(100%, 56vh, 560px); aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: var(--surface2); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.np-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-cover.empty img { display: none; }
.np-meta { text-align: center; max-width: min(100%, 560px); }
.np-title { margin: 0 0 4px; font-size: 26px; overflow-wrap: anywhere; }
.np-artist { margin: 0; color: var(--muted); font-size: 16px; }
.np-viz { width: min(100%, 560px); height: 70px; color: var(--accent); flex: none; }

.np-side { display: flex; flex-direction: column; min-height: 0; }
.np-tabs { display: flex; border-bottom: 1px solid var(--line2); margin-bottom: 8px; flex: none; }
.np-tab {
  flex: 1; min-height: 48px; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font: 600 13px var(--font); letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.np-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.np-pane { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.np-empty { padding: 28px 8px; }

.np-qlist { list-style: none; margin: 0; padding: 0; }
.np-qitem {
  width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 8px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.np-qitem:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.np-qitem.current { background: color-mix(in srgb, var(--text) 12%, transparent); }
.np-qitem.current .np-qtitle { color: var(--accent); }
.np-qitem.past { opacity: 0.5; }
.np-qcover { width: 44px; height: 44px; border-radius: 4px; overflow: hidden; background: var(--surface2); }
.np-qcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-qinfo { display: flex; flex-direction: column; min-width: 0; }
.np-qtitle, .np-qartist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-qtitle { font-weight: 600; font-size: 14px; }
.np-qartist { color: var(--muted); font-size: 13px; }
.np-qdur { color: var(--muted); font: 12px var(--font-mono); }

/* ---------- текст песни ---------- */
.lyr { padding: 24px 8px 40vh; --ls: 26px; }
[data-lyrics="s"] .lyr { --ls: 20px; }
[data-lyrics="l"] .lyr { --ls: 34px; }
[data-lyrics-align="center"] .lyr { text-align: center; }
.lyr-line {
  display: block; width: 100%; margin: 0; padding: 8px 0; border: 0; background: transparent;
  color: var(--text); font: 700 var(--ls)/1.3 var(--font-head); text-align: inherit;
  opacity: 0.35; transition: opacity 0.25s, color 0.25s, transform 0.25s;
  transform-origin: left center;
}
[data-lyrics-align="center"] .lyr-line { transform-origin: center; }
.lyr.synced .lyr-line { cursor: pointer; }
.lyr.synced .lyr-line:hover { opacity: 0.7; }
.lyr.synced .lyr-line.passed { opacity: 0.5; }
.lyr.synced .lyr-line.active { opacity: 1; color: var(--accent); transform: scale(1.03); }
.lyr.plain { padding-bottom: 24px; }
.lyr.plain .lyr-line { opacity: 0.9; font-size: calc(var(--ls) * 0.75); padding: 3px 0; }
.np-credit { color: var(--muted); font-size: 11px; font-family: var(--font-mono); margin: 8px 8px 10px; }

/* ==========================================================================
   Телефон
   ========================================================================== */
@media (max-width: 899px) {
  :root { --side-w: 0px; --tab-h: calc(60px + env(safe-area-inset-bottom)); --bar-h: 64px; }
  .side { display: none; }
  .topbar { padding: 0 14px; gap: 10px; }
  .view { padding: 18px 14px calc(var(--bar-h) + var(--tab-h) + 28px); }
  h1 { font-size: 24px; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: grid; grid-template-columns: repeat(4, 1fr);
    height: var(--tab-h); padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg); border-top: 1px solid var(--line);
  }
  .tab-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); text-decoration: none; font-size: 11px;
  }
  .tab-link svg { width: 24px; height: 24px; fill: currentColor; }
  .tab-link.active { color: var(--text); }
  .tab-link.active svg { fill: var(--accent); }

  .pb-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px; padding: 0 6px 0 8px; }
  .pb-center { order: 1; justify-self: stretch; padding: 4px; }
  .pb-left { order: 2; }
  .pb-right, .pb-prev, .pb-time { display: none; }
  .pb-play svg { width: 30px; height: 30px; }

  .np { left: 0; }
  .np-body {
    grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr);
    gap: 14px; padding: 58px 16px 8px;
  }
  .np-close { top: 8px; left: 8px; }
  .np-cover { width: min(70vw, 34vh); }
  .np-art { gap: 12px; }
  .np-title { font-size: 20px; }
  .np-artist { font-size: 14px; }
  .np-viz { height: 40px; }
  .lyr { --ls: 22px; padding-bottom: 30vh; }
  [data-lyrics="s"] .lyr { --ls: 17px; }
  [data-lyrics="l"] .lyr { --ls: 28px; }

  .trow { padding: 8px 4px; gap: 12px; }
  .trow.hasact .tdur { display: none; }
  .tactions { opacity: 1; }
  .set-card { padding: 18px 16px; }
  .set-row { flex-wrap: wrap; }
  .swatches { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- управление на экране плеера ---------- */
.np-seek { width: min(100%, 560px); display: flex; align-items: center; gap: 10px; }
.np-seek input { flex: 1; min-width: 0; accent-color: var(--accent); margin: 0; }
.np-t { color: var(--muted); font: 12px var(--font-mono); min-width: 36px; text-align: center; }
.np-controls { display: flex; align-items: center; justify-content: center; gap: 10px; }
.np-cbtn {
  position: relative; display: grid; place-items: center; width: 48px; height: 48px;
  border: 0; border-radius: 50%; background: transparent; color: var(--text); cursor: pointer;
}
.np-cbtn:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.np-cbtn svg { width: 26px; height: 26px; fill: currentColor; }
.np-cbtn.on { color: var(--accent); }
.np-cbtn[data-mode="one"]::after { content: "1"; position: absolute; right: 10px; bottom: 9px; font: 800 10px/1 var(--font); }
.np-cplay { width: 64px; height: 64px; background: var(--btn-bg); color: var(--btn-fg); }
.np-cplay:hover { background: var(--btn-bg); filter: brightness(1.1); }
.np-cplay svg { width: 34px; height: 34px; }
/* на компьютере всё управление уже есть в мини-плеере */
@media (min-width: 900px) {
  .np-seek, .np-controls { display: none; }
}
