:root {
  --bg: #0a0908;
  --panel: #15130f;
  --panel-2: #1f1c16;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #c9972c;
  --accent-2: #f3d27a;
  --on-accent: #1a1204;
  --manual: #22c55e;
  --client: #38bdf8;
  --playlist: #94a3b8;
  --danger: #ef4444;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(circle at top left, #2a2110 0, var(--bg) 55%) fixed;
  color: var(--text);
  min-height: 100dvh;
}

h1, h2, h3 { margin: 0; }
button, input, select { font: inherit; }

.logo {
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.panel {
  background: rgba(21, 19, 15, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: transform 0.1s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: var(--on-accent); }
.btn.green { background: var(--manual); border: none; color: #052e16; }
.btn.danger { background: transparent; border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }
.btn.small { padding: 6px 10px; min-height: 36px; font-size: 0.85rem; border-radius: 10px; }

.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 1rem;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.row .meta { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .actions { display: flex; gap: 6px; flex-shrink: 0; }

.tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.tag.manual { background: rgba(34, 197, 94, 0.18); color: var(--manual); }
.tag.client { background: rgba(56, 189, 248, 0.18); color: var(--client); }
.tag.playlist { background: rgba(148, 163, 184, 0.18); color: var(--playlist); }

.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 12px; text-align: center; font-size: 0.9rem; }

.progress { height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.5s linear; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120px);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 12px;
  transition: transform 0.25s ease;
  z-index: 100;
  max-width: calc(100% - 32px);
}
.toast.show { transform: translateX(-50%) translateY(0); }

.brand-logo { border-radius: 50%; display: block; box-shadow: 0 0 0 1px rgba(243, 210, 122, 0.25), 0 10px 40px rgba(201, 151, 44, 0.18); }

input[type="checkbox"], input[type="range"] { accent-color: var(--accent); }

.back-btn { position: fixed; right: 16px; top: 16px; z-index: 50; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); cursor: pointer; }

.saved-pill { position: fixed; top: 14px; left: 50%; transform: translate(-50%, -80px); background: rgba(34, 197, 94, 0.16); color: var(--manual); border: 1px solid rgba(34, 197, 94, 0.4); padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; z-index: 120; transition: transform 0.25s ease; }
.saved-pill.show { transform: translate(-50%, 0); }
.pl-menu { position: fixed; z-index: 110; min-width: 230px; max-width: 320px; max-height: 60vh; overflow-y: auto; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); }
.pl-menu-title { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 6px 8px; }
.pl-menu button { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 10px 10px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.pl-menu button:hover { background: rgba(201, 151, 44, 0.16); }
.pl-menu .pl-menu-new { color: var(--accent-2); border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; }
.bpm { font-size: 0.72rem; color: var(--accent-2); border: 1px solid rgba(243, 210, 122, 0.35); border-radius: 999px; padding: 1px 7px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .saved-pill, .toast { transition: none; } }
