/* ═══════════════════════════════════════════════
   SETBUILDER — Design System
   Aesthetic: Precision Tool / Editorial Minimal
   Inspired by: Linear, Vercel, Raycast
   ═══════════════════════════════════════════════ */

/* ── Tokens ────────────────────────────────────── */
:root {
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Courier New', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --nav-h: 56px;
  --transition: 180ms ease;
}

/* ── Dark Mode (default) ───────────────────────── */
[data-theme="dark"] {
  --bg:          #0C0C0E;
  --bg-raised:   #111114;
  --surface:     #18181C;
  --surface-2:   #1F1F24;
  --border:      #2A2A30;
  --border-sub:  #222228;

  --text:        #EDEDF0;
  --text-sub:    #888892;
  --text-muted:  #52525C;

  --accent:      #F97316;
  --accent-dim:  rgba(249,115,22,0.12);
  --accent-hover:#FB923C;

  --green:       #22C55E;
  --teal:        #06B6D4;
  --purple:      #A78BFA;
  --red:         #F87171;

  --tag-bg:      #1F1F26;
  --tag-border:  #2E2E38;

  --card-hover:  #1C1C22;
  --shadow:      0 1px 3px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.5);
}

/* ── Light Mode ────────────────────────────────── */
[data-theme="light"] {
  --bg:          #FAFAFA;
  --bg-raised:   #F4F4F5;
  --surface:     #FFFFFF;
  --surface-2:   #F4F4F5;
  --border:      #E4E4E7;
  --border-sub:  #ECECEE;

  --text:        #09090B;
  --text-sub:    #52525B;
  --text-muted:  #A1A1AA;

  --accent:      #EA6C10;
  --accent-dim:  rgba(234,108,16,0.08);
  --accent-hover:#F97316;

  --green:       #16A34A;
  --teal:        #0891B2;
  --purple:      #7C3AED;
  --red:         #DC2626;

  --tag-bg:      #F4F4F5;
  --tag-border:  #E4E4E7;

  --card-hover:  #F0F0F2;
  --shadow:      0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.10);
}

/* ── Reset & Base ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

body { background: var(--bg); min-height: 100vh; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Navbar ────────────────────────────────────── */
.sb-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}

.sb-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
}

.sb-nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sb-nav-spacer {
  flex: 1;
}

/* 1. Brand */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.4px;
  color: var(--text);
  flex-shrink: 0;
  text-decoration: none;
  margin-right: 12px;
}

.sb-logo-icon { flex-shrink: 0; }
.sb-brand-name { letter-spacing: -0.4px; }

/* 2. Nav links */
.sb-nav-link {
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-sub);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.sb-nav-link:hover { color: var(--text); background: var(--surface); }
.sb-nav-link.active { color: var(--text); }

/* 3. Search - right aligned */
.sb-nav-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 220px;
  margin: 0 4px;
}

.sb-nav-search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.sb-nav-search-input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  font-size: 13px;
  font-family: var(--font-sans);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
}

.sb-nav-search-input::placeholder { color: var(--text-muted); }

.sb-nav-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg-raised);
}

/* 4. Add Track button */
.sb-nav-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition);
  text-decoration: none;
}

.sb-nav-add:hover { background: var(--accent-hover); color: #fff; }
.sb-nav-add.active { background: var(--accent); }

/* 5. Random Track icon button */
.sb-nav-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.sb-nav-icon-btn:hover { color: var(--text); background: var(--surface); border-color: var(--accent); }
.sb-nav-icon-btn.active { color: var(--accent); border-color: var(--accent); }

/* Separator */
.sb-nav-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 4px;
}

/* 6. Library count pill */
.sb-nav-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
  padding: 0 4px;
}

/* 7. Theme toggle */
.sb-theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  margin-left: 2px;
}

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

[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }

/* ── Main ──────────────────────────────────────── */
.sb-main {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

/* ── Page Container ────────────────────────────── */
.sb-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.sb-page-sm {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Typography ────────────────────────────────── */
.sb-heading {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.6px;
  color: var(--text);
  line-height: 1.2;
}

.sb-subheading {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-sub);
  margin-top: 6px;
}

.sb-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Track Cards ───────────────────────────────── */
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 200ms ease;
  display: block;
  color: var(--text);
}

.track-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.track-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--surface-2);
}

.track-card-img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-card-body {
  padding: 12px 14px 14px;
}

.track-card-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-card-artist {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.bpm-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 7px;
  border-radius: 4px;
}

.key-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Mix reason label ──────────────────────────── */
.sb-mix-reason {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.sb-mixable-hidden { display: none; }

/* ── Tags / Pills ──────────────────────────────── */
.sb-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 400;
  border-radius: 100px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--text-sub);
  white-space: nowrap;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.sb-tag:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.sb-tag-accent {
  background: var(--accent-dim);
  border-color: transparent;
  color: var(--accent);
}

.sb-tag-green {
  background: rgba(34,197,94,0.1);
  border-color: transparent;
  color: var(--green);
}

.sb-tag-teal {
  background: rgba(6,182,212,0.1);
  border-color: transparent;
  color: var(--teal);
}

.sb-tag-purple {
  background: rgba(167,139,250,0.1);
  border-color: transparent;
  color: var(--purple);
}

/* ── Divider ───────────────────────────────────── */
.sb-divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* ── Section header ────────────────────────────── */
.sb-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sb-section-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Buttons ───────────────────────────────────── */
.sb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.sb-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.sb-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.sb-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.sb-btn-secondary:hover { background: var(--surface-2); color: var(--text); }

.sb-btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border-color: transparent;
}
.sb-btn-ghost:hover { background: var(--surface); color: var(--text); }

.sb-btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--border);
}
.sb-btn-danger:hover { background: rgba(248,113,113,0.08); border-color: var(--red); }

.sb-btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ── Search Bar ────────────────────────────────── */
.sb-search-wrap {
  position: relative;
  max-width: 560px;
}

.sb-search-input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 16px;
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
}

.sb-search-input::placeholder { color: var(--text-muted); }
.sb-search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

.sb-search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.sb-search-btn:hover { background: var(--accent-hover); }

/* ── Search result row ─────────────────────────── */
.search-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-sub);
  background: var(--surface);
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  margin-bottom: 8px;
}

.search-result:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  color: var(--text);
}

.search-result-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
}

.search-result-info { flex: 1; min-width: 0; }

.search-result-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-artist {
  font-size: 12.5px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Search highlight ──────────────────────────── */
mark {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 1px;
}

/* ── View page ─────────────────────────────────── */
.view-hero {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.view-art {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}

.view-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.view-art-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.view-identity { flex: 1; padding-top: 4px; }

.view-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.8px;
  line-height: 1.1;
  color: var(--text);
}

.view-artist {
  font-size: 17px;
  color: var(--text-sub);
  margin-top: 6px;
  font-weight: 400;
}

.view-artist a {
  color: var(--accent);
  font-weight: 500;
}
.view-artist a:hover { color: var(--accent-hover); }

.view-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.view-year-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ── DJ Stats grid ─────────────────────────────── */
.dj-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 32px 0;
}

.dj-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px 16px;
  position: relative;
  overflow: hidden;
}

.dj-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-color, var(--accent));
}

.dj-stat-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--stat-color, var(--text));
  line-height: 1;
  letter-spacing: -0.5px;
}

.dj-stat-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── Form ──────────────────────────────────────── */
.sb-form-group {
  margin-bottom: 20px;
}

.sb-form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.sb-form-input,
.sb-form-select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
  -webkit-appearance: none;
}

.sb-form-input:focus,
.sb-form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.sb-form-input.error,
.sb-form-select.error { border-color: var(--red); }

.sb-form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888892' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.sb-form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 5px;
  display: none;
}

.sb-form-error.visible { display: block; }

/* ── Success banner ────────────────────────────── */
.sb-success-banner {
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  display: none;
}

.sb-success-banner.visible { display: flex; }

.sb-success-text {
  font-size: 13.5px;
  color: var(--green);
  font-weight: 500;
}

/* ── Hero (home) ───────────────────────────────── */
.sb-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.sb-hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.sb-hero-title {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -1.2px;
  line-height: 1.08;
  color: var(--text);
  max-width: 620px;
}

.sb-hero-title em {
  font-style: normal;
  color: var(--accent);
}

.sb-hero-desc {
  font-size: 16px;
  color: var(--text-sub);
  max-width: 480px;
  margin-top: 16px;
  line-height: 1.65;
  font-weight: 300;
}

.sb-hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  align-items: center;
}

.sb-hero-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sb-hero-stat-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-sub);
}

/* ── Dialog / Modal ────────────────────────────── */
.sb-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.sb-dialog-overlay.visible { display: flex; }

.sb-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.sb-dialog-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.sb-dialog-body {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 24px;
}

.sb-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── No results ────────────────────────────────── */
.sb-empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.sb-empty-icon { font-size: 40px; margin-bottom: 12px; }
.sb-empty-title { font-size: 16px; font-weight: 500; color: var(--text-sub); margin-bottom: 6px; }
.sb-empty-sub { font-size: 13.5px; }

/* ── Spotify import panel ──────────────────────── */
.sb-spotify-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sb-spotify-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: color-mix(in srgb, #1DB954 6%, var(--surface));
  border-bottom: 1px solid var(--border);
}

.sb-spotify-panel-body {
  padding: 14px 16px;
  background: var(--surface);
}

.sb-btn-spotify {
  background: #1DB954;
  color: #000;
  border: none;
  font-weight: 600;
  font-size: .82rem;
  padding: 0 16px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .15s, opacity .15s;
}

.sb-btn-spotify:hover  { background: #1ed760; }
.sb-btn-spotify:active { background: #17a844; }
.sb-btn-spotify:disabled { opacity: .5; cursor: not-allowed; }

.sb-btn-soundcloud {
  background: #FF5500;
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: .82rem;
  padding: 0 16px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .15s;
  text-decoration: none;
}

.sb-btn-soundcloud:hover  { background: #FF7733; color: #fff; }
.sb-btn-soundcloud:active { background: #E64D00; }

#spotifyStatus.success { color: #1DB954; }
#spotifyStatus.error   { color: var(--error, #f87171); }

.sb-form-input.spotify-filled,
.sb-form-select.spotify-filled {
  border-color: #1DB954;
  box-shadow: 0 0 0 2px color-mix(in srgb, #1DB954 18%, transparent);
}

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

/* ── Artist chips (horizontal scroll) ─────────── */
.sb-artist-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sb-artist-scroll::-webkit-scrollbar { height: 4px; }
.sb-artist-scroll::-webkit-scrollbar-track { background: transparent; }
.sb-artist-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sb-artist-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  white-space: nowrap;
  flex-shrink: 0;
  scroll-snap-align: start;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
}

.sb-artist-chip:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--text);
}

.sb-artist-chip-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
}

.sb-artist-chip-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.sb-artist-chip-name {
  font-size: 13px;
  font-weight: 500;
}

.sb-artist-chip-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 100px;
}

/* ── Animations ────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeUp 320ms ease both;
}

.stagger > * {
  animation: fadeUp 320ms ease both;
}
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }

/* ── Footer ────────────────────────────────────── */
.sb-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
}

.sb-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sb-footer-text {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.sb-footer-sep {
  color: var(--border);
  font-size: 12px;
}

.sb-footer-spacer { flex: 1; }

.sb-footer-link {
  font-size: 12px;
  color: var(--text-muted);
  transition: color var(--transition);
  margin-left: 12px;
}

.sb-footer-link:hover { color: var(--text); }

/* ── Image Placeholders ───────────────────────── */
.sb-placeholder-initial {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  user-select: none;
}

.sb-placeholder-initial.sb-placeholder-lg {
  font-size: 40px;
}

/* ── Nav set count badge ──────────────────────── */
.sb-set-count {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--accent);
  color: #fff;
  padding: 0 5px;
  border-radius: 100px;
  margin-left: 4px;
  line-height: 16px;
  min-width: 16px;
  text-align: center;
  display: none;
}

.sb-set-count.visible { display: inline-block; }

/* ── Search Filters ───────────────────────────── */
.sb-filters {
  margin-bottom: 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.sb-filters-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.sb-filters-row:last-child { margin-bottom: 0; }

.sb-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sb-filter-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 52px;
  flex-shrink: 0;
}

.sb-filter-input {
  width: 72px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.sb-filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.sb-filter-sep {
  font-size: 12px;
  color: var(--text-muted);
}

.sb-filter-select {
  height: 30px;
  padding: 0 24px 0 8px;
  font-size: 12px;
  font-family: var(--font-mono);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888892' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  cursor: pointer;
}

.sb-filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.sb-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sb-tag.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Set Builder ──────────────────────────────── */
.sb-set-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sb-set-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), opacity var(--transition);
  cursor: grab;
}

.sb-set-item:active { cursor: grabbing; }
.sb-set-item.dragging { opacity: 0.4; border-color: var(--accent); }
.sb-set-item.drag-over { border-color: var(--accent); }

.sb-set-handle {
  color: var(--text-muted);
  flex-shrink: 0;
  cursor: grab;
}

.sb-set-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  min-width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.sb-set-img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
}

.sb-set-info { flex: 1; min-width: 0; }

.sb-set-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.sb-set-title:hover { color: var(--accent); }

.sb-set-artist {
  font-size: 12px;
  color: var(--text-sub);
}

.sb-set-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sb-set-remove {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.sb-set-remove:hover { color: var(--red); background: rgba(248,113,113,0.08); }

.sb-set-transition-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 14px 2px 60px;
}

.sb-set-transition-line {
  width: 1px;
  height: 12px;
  background: var(--border);
}

.sb-set-transition-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.sb-set-transition-label.compatible { color: var(--green); }
.sb-set-transition-label.incompatible { color: var(--red); }

/* ── Filter toggle button ─────────────────────── */
.sb-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-sub);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.sb-filter-toggle:hover { border-color: var(--accent); color: var(--text); }
.sb-filter-toggle.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.sb-filter-toggle .sb-filter-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--accent);
  color: #fff;
  padding: 0 5px;
  border-radius: 100px;
  line-height: 16px;
  min-width: 16px;
  text-align: center;
  display: none;
}

.sb-filter-toggle .sb-filter-badge.visible { display: inline-block; }

/* Filters panel — hidden by default */
.sb-filters { display: none; }
.sb-filters.open { display: block; }

/* ── Responsive helpers ─────────────────────────── */
.sb-mobile-only { display: none !important; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 768px) {
  .sb-desktop-only { display: none !important; }
  .sb-mobile-only { display: flex !important; }
  .dj-stats { grid-template-columns: repeat(2, 1fr); }
  .view-hero { flex-direction: column; }
  .view-art { width: 160px; height: 160px; }
  .view-title { font-size: 26px; }
  .sb-hero-title { font-size: 34px; }
  .track-grid { grid-template-columns: repeat(2, 1fr); }
  .search-result-meta { display: none; }
  .sb-brand-name { display: none; }
  .sb-nav-count { display: none; }
  .sb-nav-sep { display: none; }

  .sb-nav-inner { gap: 6px; }
  .sb-nav-group { gap: 4px; }
  .sb-nav-link { padding: 4px 6px; font-size: 12px; }
  .sb-nav-icon-btn { width: 30px; height: 30px; }
  .sb-theme-toggle { width: 30px; height: 30px; }

  .sb-footer-inner { flex-wrap: wrap; }
  .sb-filter-toggle { height: 36px; padding: 0 10px; font-size: 12px; }
}
