/* ═══════════════════════════════════════════════════════════════════════════
   TubeVault — stylesheet
   One file, organised top-down: tokens → base → layout → components → views
   → responsive. Theme swapping is done with data-theme on <html>.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────── tokens ─── */
:root {
  color-scheme: dark;
  --bg: #090b10;
  --bg-soft: #0d1017;
  --surface: #11141d;
  --surface-2: #171b26;
  --surface-3: #1f2431;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #eef1f8;
  --text-dim: #c2cadb;
  --muted: #8c96ab;
  --accent: #8b7bff;
  --accent-strong: #a496ff;
  --accent-soft: rgba(139, 123, 255, 0.14);
  --accent-line: rgba(139, 123, 255, 0.3);
  --accent-2: #49d6c1;
  --success: #43d18f;
  --danger: #ff6b81;
  --warn: #f5c451;
  --shadow: 0 26px 60px -34px rgba(0, 0, 0, 0.95);
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --surface-3: #e9edf6;
  --line: rgba(16, 24, 40, 0.09);
  --line-strong: rgba(16, 24, 40, 0.18);
  --text: #0f1420;
  --text-dim: #364052;
  --muted: #5d6779;
  --accent: #5b48e0;
  --accent-strong: #4a37cf;
  --accent-soft: rgba(91, 72, 224, 0.1);
  --accent-line: rgba(91, 72, 224, 0.24);
  --accent-2: #12a99a;
  --success: #12996a;
  --danger: #d92b47;
  --warn: #b07808;
  --shadow: 0 22px 50px -34px rgba(16, 24, 40, 0.35);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(760px 420px at 12% -8%, rgba(139, 123, 255, 0.16), transparent 65%),
    radial-gradient(680px 380px at 96% 4%, rgba(73, 214, 193, 0.1), transparent 60%);
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(760px 420px at 12% -8%, rgba(91, 72, 224, 0.1), transparent 65%),
    radial-gradient(680px 380px at 96% 4%, rgba(18, 169, 154, 0.08), transparent 60%);
}

h1,
h2,
h3 {
  letter-spacing: -0.015em;
  line-height: 1.25;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text-dim);
  white-space: nowrap;
}

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* ─────────────────────────────────────────────────────────────── layout ─── */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100dvh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 24px 16px 20px;
  border-right: 1px solid var(--line);
  background: rgba(9, 11, 16, 0.6);
  backdrop-filter: blur(14px);
}

html[data-theme="light"] .rail {
  background: rgba(255, 255, 255, 0.7);
}

.main {
  padding: 36px clamp(18px, 3.6vw, 46px) 96px;
  max-width: 1180px;
  width: 100%;
}

/* ──────────────────────────────────────────────────────────────── brand ─── */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #8b7bff, #5f4ae8 55%, #3fb9a8);
  box-shadow: 0 10px 24px -12px rgba(139, 123, 255, 0.9);
  flex: none;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong {
  font-size: 15.5px;
  letter-spacing: -0.02em;
}

.brand-text small {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ────────────────────────────────────────────────────────────────── nav ─── */
.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-item.is-active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.nav-item.is-active svg {
  color: var(--accent);
}

.nav-count {
  margin-left: auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
}

.nav-pulse {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(139, 123, 255, 0.6);
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(139, 123, 255, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(139, 123, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 123, 255, 0); }
}

.rail-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  color: var(--muted);
}

.tool-status-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.tool-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.tool-row span:nth-child(2) {
  color: var(--text-dim);
}

.tool-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.tool-dot.is-ok {
  background: var(--success);
  box-shadow: 0 0 8px rgba(67, 209, 143, 0.5);
}

.tool-dot.is-bad {
  background: var(--danger);
}

.tool-version {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--muted);
  font-family: var(--mono);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
}

.link-btn:hover {
  text-decoration: underline;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: 0.16s;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface);
}

.theme-toggle-icon svg {
  width: 16px;
  height: 16px;
}

/* ─────────────────────────────────────────────────────────────── views ─── */
.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: rise 0.32s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-head {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-head h1 {
  margin: 8px 0 10px;
  font-size: clamp(25px, 3vw, 35px);
  font-weight: 650;
}

.lede {
  max-width: 64ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

/* ──────────────────────────────────────────────────────────────── cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset;
}

html[data-theme="light"] .card {
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 30px -26px rgba(16, 24, 40, 0.3);
}

.card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.card-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

/* ──────────────────────────────────────────────────────────────── steps ─── */
.steps {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}

.step-num {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
}

.hint {
  margin-left: auto;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: help;
  display: grid;
  place-items: center;
  transition: 0.15s;
}

.hint:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ─────────────────────────────────────────────────────────────── inputs ─── */
.url-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}

.input-wrap {
  position: relative;
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  min-width: 0;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

input[type="text"],
input[type="search"],
select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px 12px 41px;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input[type="text"]::placeholder,
input[type="search"]::placeholder {
  color: var(--muted);
}

input[type="text"]:focus,
input[type="search"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}

.input-clear {
  position: absolute;
  right: 6px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.input-clear:hover {
  background: var(--surface-3);
  color: var(--text);
}

select {
  padding-left: 14px;
  cursor: pointer;
  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) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

/* ─────────────────────────────────────────────────────────────── buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.12s, opacity 0.15s,
    box-shadow 0.15s;
}

.btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #8b7bff, #6a56ef);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 26px -16px rgba(139, 123, 255, 0.95);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #9a8bff, #7763f5);
  box-shadow: 0 14px 30px -14px rgba(139, 123, 255, 0.9);
}

html[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #5b48e0, #4a37cf);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-dim);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  flex: none;
}

.btn-ghost .spinner,
.setup-banner .btn .spinner {
  border-color: var(--line-strong);
  border-top-color: var(--accent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.field-note {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

.field-note[data-kind="ok"] {
  color: var(--success);
}

.field-note[data-kind="error"] {
  color: var(--danger);
}

.field-note[data-kind="warn"] {
  color: var(--warn);
}

/* ────────────────────────────────────────────────────── setup banner ─── */
.setup-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(245, 196, 81, 0.28);
  background: linear-gradient(120deg, rgba(245, 196, 81, 0.1), rgba(139, 123, 255, 0.07));
  flex-wrap: wrap;
}

html[data-theme="light"] .setup-banner {
  border-color: rgba(176, 120, 8, 0.28);
  background: linear-gradient(120deg, rgba(245, 196, 81, 0.16), rgba(91, 72, 224, 0.05));
}

.setup-icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(245, 196, 81, 0.16);
  color: var(--warn);
}

.setup-icon svg {
  width: 18px;
  height: 18px;
}

.setup-body {
  flex: 1 1 280px;
  min-width: 0;
}

.setup-body h2 {
  font-size: 14px;
  margin: 2px 0 6px;
}

.setup-body p {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

.setup-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.setup-progress {
  margin-top: 12px;
}

.setup-progress-text {
  display: block;
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────────────────────────────────────── quality ─── */
.quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 9px;
}

.quality {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: 0.16s;
}

.quality:hover:not(:disabled) {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.quality.is-selected {
  border-color: var(--accent);
  background: linear-gradient(160deg, var(--accent-soft), transparent 72%);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

.quality.is-selected .quality-short {
  color: var(--accent-strong);
}

.quality:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.quality-short {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.quality-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.quality-na {
  position: absolute;
  top: 9px;
  right: 10px;
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warn);
}

/* ─────────────────────────────────────────────────────────── preview ─── */
.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.preview-placeholder svg {
  width: 30px;
  height: 30px;
  opacity: 0.7;
}

.preview-card {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.preview-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-3);
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-body {
  min-width: 0;
}

.preview-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.preview-meta {
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.duration-badge {
  position: absolute;
  right: 7px;
  bottom: 7px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(4, 6, 10, 0.8);
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  align-items: center;
}

.chip {
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

.actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.actions-row .field-note {
  margin-top: 0;
}

.preview-card.is-skeleton .preview-thumb {
  background: var(--surface-2);
}

.skeleton-block,
.skeleton-line {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 8px;
}

.skeleton-line {
  height: 11px;
  margin-bottom: 10px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ────────────────────────────────────────────────────────── playlist ─── */
.playlist-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.playlist-head .chip-row {
  margin-top: 0;
}

.playlist-scroll {
  margin-top: 12px;
  max-height: 330px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.playlist-item {
  display: grid;
  grid-template-columns: 16px 22px 64px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.12s;
}

.playlist-item:last-child {
  border-bottom: 0;
}

.playlist-item:hover {
  background: var(--surface-3);
}

.playlist-item.is-selected {
  background: var(--accent-soft);
}

.playlist-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

.pi-index {
  font-size: 10.5px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pi-thumb {
  width: 64px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-3);
  display: block;
}

.pi-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

.pi-duration {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ───────────────────────────────────────────────────────────── queue ─── */
.downloads-card {
  margin-bottom: 16px;
}

.downloads-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.queue-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  animation: rise 0.25s ease both;
}

.queue-thumb {
  width: 96px;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.queue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.queue-thumb svg {
  width: 18px;
  height: 18px;
}

.queue-main {
  min-width: 0;
}

.queue-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.queue-progress {
  margin-top: 8px;
}

.bar {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.28s linear;
}

.bar-fill.is-indeterminate {
  width: 38% !important;
  animation: sweep 1.5s ease-in-out infinite;
}

@keyframes sweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}

.queue-error {
  margin: 7px 0 0;
  font-size: 11.5px;
  color: var(--danger);
  line-height: 1.45;
}

.queue-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: 0.01em;
}

.status-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.status-downloading {
  color: var(--accent-strong);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.status-processing {
  color: var(--accent-2);
  border-color: rgba(73, 214, 193, 0.3);
  background: rgba(73, 214, 193, 0.1);
}

.status-completed {
  color: var(--success);
  border-color: rgba(67, 209, 143, 0.3);
  background: rgba(67, 209, 143, 0.09);
}

.status-failed {
  color: var(--danger);
  border-color: rgba(255, 107, 129, 0.3);
}

.status-canceled {
  color: var(--warn);
  border-color: rgba(245, 196, 81, 0.28);
}

.empty-inline {
  margin: 4px 2px 0;
  font-size: 12.5px;
  color: var(--muted);
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.15s;
  flex: none;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.icon-btn:hover {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--text);
}

.icon-btn.danger:hover {
  color: var(--danger);
  border-color: rgba(255, 107, 129, 0.35);
  background: rgba(255, 107, 129, 0.1);
}

.learn-card h2 {
  font-size: 14px;
}

.learn-list {
  margin: 12px 0 10px;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}

.learn-list li {
  margin-bottom: 4px;
}

.learn-list strong {
  color: var(--text);
}

/* ─────────────────────────────────────────────────────────── library ─── */
.stat-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.stat {
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  min-width: 118px;
}

.stat-value {
  display: block;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.library-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1 1 240px;
}

.select-wrap {
  display: flex;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 15px;
}

.library-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.library-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.lib-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: var(--surface-3);
  cursor: pointer;
  overflow: hidden;
}

.lib-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.22, 0.8, 0.3, 1);
}

.library-card:hover .lib-thumb img {
  transform: scale(1.05);
}

.lib-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: linear-gradient(140deg, var(--surface-2), var(--surface-3));
}

.lib-thumb-fallback svg {
  width: 30px;
  height: 30px;
}

.lib-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 6, 10, 0.38);
  opacity: 0;
  transition: opacity 0.18s;
}

.lib-play svg {
  width: 40px;
  height: 40px;
  color: #fff;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.55));
}

.lib-thumb:hover .lib-play,
.lib-thumb:focus-visible .lib-play {
  opacity: 1;
}

.lib-body {
  padding: 12px 14px 13px;
}

.lib-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.title-btn {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.title-btn:hover {
  color: var(--accent-strong);
}

.lib-meta {
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.lib-spacer {
  flex: 1;
}

.badge {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-strong);
  white-space: nowrap;
}

.lib-size {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.search-empty {
  grid-column: 1 / -1;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 60px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.empty-state h2 {
  font-size: 17px;
  margin: 4px 0 0;
}

.empty-state p {
  color: var(--muted);
  font-size: 13.5px;
  max-width: 40ch;
}

.empty-art {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-art svg {
  width: 28px;
  height: 28px;
}

.empty-state .btn {
  margin-top: 8px;
}

/* ──────────────────────────────────────────────────────────── player ─── */
.player-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.player-titles {
  flex: 1 1 240px;
  min-width: 0;
}

.player-titles h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.player-titles .card-sub {
  margin-top: 4px;
  font-size: 12px;
}

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.stage-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
}

.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #05070b;
  overflow: hidden;
}

.stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #05070b;
}

.stage.is-audio video {
  object-fit: cover;
  filter: blur(1px) brightness(0.55);
}

.stage-big-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 0;
  background: rgba(10, 12, 18, 0.62);
  backdrop-filter: blur(8px);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.16s, opacity 0.2s, transform 0.16s;
  z-index: 3;
}

.stage-big-play svg {
  width: 30px;
  height: 30px;
  margin-left: 3px;
}

.stage-big-play:hover {
  background: var(--accent);
  transform: scale(1.05);
}

.stage.is-playing .stage-big-play {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

.stage-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(8, 10, 16, 0.7);
  color: #fff;
  font-size: 11px;
  z-index: 3;
}

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 14px 10px;
  background: linear-gradient(to top, rgba(3, 5, 9, 0.92), rgba(3, 5, 9, 0.4) 55%, transparent);
  transition: opacity 0.22s;
  z-index: 2;
}

.stage.is-idle .controls {
  opacity: 0;
  pointer-events: none;
}

.seek {
  position: relative;
  display: flex;
  align-items: center;
  height: 16px;
  cursor: pointer;
  touch-action: none;
}

.seek-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.seek-buffer,
.seek-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 999px;
}

.seek-buffer {
  background: rgba(255, 255, 255, 0.34);
}

.seek-played {
  background: linear-gradient(90deg, #8b7bff, #49d6c1);
}

.seek-handle {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.14s;
  pointer-events: none;
  z-index: 2;
}

.seek:hover .seek-handle,
.seek:focus-visible .seek-handle {
  transform: translate(-50%, -50%) scale(1);
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: #fff;
}

.ctrl {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s;
  flex: none;
}

.ctrl:hover {
  background: rgba(255, 255, 255, 0.14);
}

.ctrl svg {
  width: 18px;
  height: 18px;
}

.ctrl-text {
  width: auto;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.time {
  display: flex;
  gap: 5px;
  margin-left: 5px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
}

.time-sep {
  opacity: 0.45;
}

.controls-spacer {
  flex: 1;
}

.volume-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

#volume {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  padding: 0;
  border: 0;
  cursor: pointer;
}

#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

#volume::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.player-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-card {
  padding: 16px;
}

.side-card h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 650;
  margin-bottom: 10px;
}

.up-next {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.up-next-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: 0.15s;
}

.up-next-item:hover {
  background: var(--surface-2);
  border-color: var(--line);
}

.up-next-item img,
.up-next-thumb {
  width: 62px;
  height: 35px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-3);
  flex: none;
}

.up-next-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
}

.up-next-meta {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
}

.shortcut-list {
  display: grid;
  gap: 7px;
  margin: 0;
  font-size: 12px;
}

.shortcut-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.shortcut-list dt,
.shortcut-list dd {
  margin: 0;
  color: var(--muted);
}

.shortcut-list dd {
  text-align: right;
}

kbd {
  font: inherit;
  font-size: 10.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--text-dim);
}

/* ───────────────────────────────────────────────────────────── guide ─── */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 13px;
  margin-bottom: 13px;
}

.guide-grid h2 {
  font-size: 14.5px;
  margin: 8px 0 8px;
}

.guide-grid p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.68;
}

.guide-icon {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.guide-table-card {
  margin-bottom: 13px;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 520px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 650;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

.data-table td {
  color: var(--text-dim);
}

.file-tree {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.file-tree li {
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  flex-wrap: wrap;
}

.file-tree code {
  flex: none;
}

.guide-table-card details {
  border-top: 1px solid var(--line);
  padding: 11px 0;
}

.guide-table-card details:first-of-type {
  border-top: 0;
}

.guide-table-card summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-dim);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guide-table-card summary::-webkit-details-marker {
  display: none;
}

.guide-table-card summary::after {
  content: "+";
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.guide-table-card details[open] summary::after {
  content: "−";
}

.guide-table-card details p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

/* ──────────────────────────────────────────────────────────── tooltip ─── */
[data-tip] {
  position: relative;
}

[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 250px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #0b0e15;
  border: 1px solid var(--line-strong);
  color: #eef1f8;
  font-size: 11.5px;
  font-weight: 450;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
  z-index: 60;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
}

[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ──────────────────────────────────────────────────────────── toasts ─── */
.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 380px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #0e1119;
  color: #eef1f8;
  font-size: 12.5px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 20px 44px -22px rgba(0, 0, 0, 0.95);
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast-icon {
  width: 15px;
  height: 15px;
  flex: none;
}

.toast-success {
  border-color: rgba(67, 209, 143, 0.4);
}

.toast-success .toast-icon {
  color: #43d18f;
}

.toast-error {
  border-color: rgba(255, 107, 129, 0.42);
}

.toast-error .toast-icon {
  color: #ff8598;
}

.toast-info .toast-icon {
  color: #8b7bff;
}

/* ───────────────────────────────────────────────────────────── modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 11, 0.66);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.16s;
}

.modal-overlay.is-visible {
  opacity: 1;
}

.modal {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateY(6px);
  transition: transform 0.16s;
}

.modal-overlay.is-visible .modal {
  transform: none;
}

.modal h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.modal p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ──────────────────────────────────────────────────────── responsive ─── */
@media (max-width: 1100px) {
  .player-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .player-side {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: rgba(11, 14, 21, 0.92);
    backdrop-filter: blur(18px);
    z-index: 100;
  }

  html[data-theme="light"] .rail {
    background: rgba(255, 255, 255, 0.94);
  }

  .brand {
    display: none;
  }

  .nav {
    flex-direction: row;
    flex: 1;
    gap: 4px;
  }

  .nav-item {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 7px 4px;
    font-size: 10.5px;
    justify-content: center;
  }

  .nav-item svg {
    width: 19px;
    height: 19px;
  }

  .nav-count,
  .nav-pulse {
    position: absolute;
    top: 4px;
    right: 8px;
    margin: 0;
    font-size: 9px;
    padding: 0 4px;
  }

  .nav-pulse {
    width: 7px;
    height: 7px;
    right: 12px;
  }

  .rail-footer {
    margin: 0;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .tool-status {
    display: none;
  }

  .theme-toggle {
    padding: 8px;
    border-color: transparent;
  }

  .theme-toggle [data-role="theme-label"] {
    display: none;
  }

  .main {
    padding: 24px 16px 104px;
  }

  .preview-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-thumb {
    max-width: 100%;
  }

  .toasts {
    left: 12px;
    right: 12px;
    bottom: 84px;
    align-items: stretch;
  }

  .toast {
    max-width: none;
  }

  .card {
    padding: 17px;
  }
}

@media (max-width: 560px) {
  .quality-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .url-row .btn {
    flex: 1;
  }

  .queue-item {
    grid-template-columns: 68px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .queue-thumb {
    width: 68px;
  }

  .player-head .btn {
    padding: 8px 11px;
    font-size: 12px;
  }

  .stage-big-play {
    width: 60px;
    height: 60px;
  }

  .stage-big-play svg {
    width: 24px;
    height: 24px;
  }

  .controls {
    padding: 26px 8px 6px;
  }

  .ctrl {
    width: 31px;
    height: 31px;
  }

  #ctrl-rate {
    display: none;
  }

  .volume-group #volume {
    display: none;
  }

  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .lib-title {
    font-size: 12px;
  }

  .playlist-item {
    grid-template-columns: 16px 56px minmax(0, 1fr) auto;
  }

  .pi-index {
    display: none;
  }

  .pi-thumb {
    width: 56px;
    height: 32px;
  }

  .stat {
    flex: 1;
    min-width: 96px;
    padding: 9px 12px;
  }

  .stat-value {
    font-size: 16px;
  }
}

@media (hover: none) {
  .stage.is-idle .controls {
    opacity: 1;
    pointer-events: auto;
  }

  .lib-play {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
