* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --tl-green: #1DB954;
  --tl-green-lift: #34d873;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, sans-serif;
}

body {
  font-family: var(--sans);
  background: #0a0a1a;
  color: #e0e0e0;
}

/* ── Home atmosphere: aurora bloom + fine grain ───────── */
body.home { background: #06060e; }
body.home::before,
body.home::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body.home::before {
  background:
    radial-gradient(920px 560px at 50% -10%, rgba(29, 185, 84, 0.16), transparent 62%),
    radial-gradient(720px 520px at 86% 12%, rgba(74, 144, 217, 0.09), transparent 60%),
    radial-gradient(760px 620px at 10% 34%, rgba(142, 68, 173, 0.08), transparent 62%);
}
body.home::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04;
  mix-blend-mode: screen;
}
body.home #searchHome { position: relative; z-index: 1; }

/* ── Search-first homepage (desktop + mobile) ─── */

#topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(10, 10, 26, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.nav-left { display: flex; align-items: center; }
.nav-logo { color: #1DB954; font-size: 15px; font-weight: 700; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-link { color: #888; font-size: 12px; text-decoration: none; font-weight: 500; transition: color 0.2s; }
.nav-link:hover { color: #e0e0e0; }

#searchHome {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
  padding-top: 48px;
}

.hero {
  text-align: center;
  padding: 74px 0 24px;
}

.hero-title {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(48px, 9vw, 78px);
  line-height: 0.96;
  letter-spacing: -0.028em;
  color: var(--tl-green);
  margin-bottom: 16px;
  text-shadow: 0 0 46px rgba(29, 185, 84, 0.30);
}

.hero-sub {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(17px, 2.6vw, 23px);
  line-height: 1.3;
  color: #cbcbd8;
  letter-spacing: 0.01em;
}

.search-wrap {
  max-width: 600px;
  margin: 0 auto 30px;
}

.search-wrap input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.028);
  color: #d8d8e2;
  font-size: 15px;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.search-wrap input:focus {
  border-color: #1DB954;
  background: rgba(255, 255, 255, 0.06);
}

.search-wrap input::placeholder { color: #555; }

.examples {
  text-align: center;
  margin-bottom: 40px;
}

.examples-label {
  font-size: 12px;
  color: #555;
  font-weight: 500;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.search-chip {
  font-size: 13px;
  color: #999;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.search-chip:hover {
  color: #1DB954;
  border-color: rgba(29, 185, 84, 0.3);
  background: rgba(29, 185, 84, 0.06);
}

.lucky-wrap {
  margin-top: 20px;
}

.lucky-btn {
  padding: 10px 28px;
  border: 1px solid rgba(29, 185, 84, 0.3);
  border-radius: 24px;
  background: rgba(29, 185, 84, 0.06);
  color: #1DB954;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.lucky-btn:hover { background: rgba(29, 185, 84, 0.12); }

.results-container {
  padding-bottom: 80px;
}

.searching {
  color: #555;
  font-size: 14px;
  text-align: center;
  padding: 24px 0;
}

.error-msg {
  color: #E84040;
  font-size: 14px;
  padding: 16px 0;
}

.result-header {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.result-sub {
  font-size: 12px;
  color: #666;
  margin-bottom: 20px;
}

.parsed-dims {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.result-card {
  padding: 14px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 10px;
  border-left: 3px solid #333;
  transition: background 0.2s;
}

.result-card:hover { background: rgba(255, 255, 255, 0.05); }

.result-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.result-artist {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.result-score {
  font-size: 18px;
  font-weight: 700;
  color: #555;
}

.dim-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.dim-tag {
  font-size: 11px;
  border: 1px solid;
  border-radius: 12px;
  padding: 2px 8px;
}

.edge-note {
  margin: 8px 0 8px 8px;
  padding: 8px 14px;
  border-left: 2px solid #555;
  background: rgba(255, 255, 255, 0.015);
  border-radius: 0 8px 8px 0;
}

.edge-note-dim {
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 3px;
}

.edge-note-text {
  font-size: 12px;
  color: #aaa;
  line-height: 1.5;
  font-style: italic;
}

.reset-wrap {
  text-align: center;
  padding: 32px 0;
}

.reset-btn {
  padding: 8px 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: none;
  color: #888;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.reset-btn:hover {
  color: #e0e0e0;
  border-color: rgba(255, 255, 255, 0.2);
}

.home-footer {
  text-align: center;
  padding: 40px 0;
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
}

.footer-stat {
  font-size: 12px;
  color: #444;
}

.footer-link {
  font-size: 12px;
  color: #666;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover { color: #1DB954; }

/* Graph page keeps the old layout */
body.graph-page { overflow: hidden; height: 100vh; }
body.graph-page #topnav { display: none; }

/* ── Responsive ─────────────────────────────── */

@media (max-width: 768px) {
  #topnav { padding: 0 16px; }
  .nav-link { display: none; }
  .hero { padding: 56px 0 20px; }
  .hero-title { font-size: 42px; }
  .search-wrap input { font-size: 15px; padding: 14px 16px; }
  .search-chip { font-size: 12px; padding: 6px 12px; }
  #searchHome { padding-top: 48px; }
  .home-footer { flex-direction: column; gap: 8px; }
}

/* ── Status banner ────────────────────────────── */

.status-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: rgba(29, 185, 84, 0.1);
  border-bottom: 1px solid rgba(29, 185, 84, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
  color: #aaa;
  z-index: 200;
}

body.has-banner #topbar { top: 32px; }
body.has-banner #graphContainer { top: 88px; }
body.has-banner #sidePanel { top: 88px; }

.banner-link {
  color: #1DB954;
  text-decoration: none;
  font-weight: 500;
}
.banner-link:hover { text-decoration: underline; }

.banner-close {
  background: none;
  border: none;
  color: #555;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.banner-close:hover { color: #aaa; }

/* ── Top bar ────────────────────────��────────── */

#topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(10, 10, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  gap: 20px;
}

.topbar-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-left h1 {
  font-size: 16px;
  font-weight: 700;
  color: #1DB954;
}

.subtitle {
  font-size: 11px;
  color: #666;
  font-weight: 400;
}

.topbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

#searchInput {
  width: 350px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

#searchInput:focus {
  border-color: #1DB954;
  background: rgba(255, 255, 255, 0.08);
}

#searchInput::placeholder { color: #555; }

.welcome-prompt {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.4s;
}

.welcome-prompt.hidden { opacity: 0; pointer-events: none; }

.welcome-text {
  font-size: 14px;
  color: #555;
  margin-bottom: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.welcome-chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  pointer-events: auto;
}

.example-chip {
  font-size: 12px;
  color: #888;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(8px);
}

.example-chip:hover {
  color: #1DB954;
  border-color: rgba(29, 185, 84, 0.3);
  background: rgba(29, 185, 84, 0.08);
}

.topbar-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.about-btn {
  color: #888;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s;
}
.about-btn:hover { color: #1DB954; }

.admin-btn {
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #555;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.admin-btn:hover { color: #888; }
.admin-btn.active { color: #1DB954; }

.spotify-btn {
  padding: 5px 14px;
  border: 1px solid #1DB954;
  border-radius: 20px;
  background: transparent;
  color: #1DB954;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.spotify-btn:hover { background: rgba(29, 185, 84, 0.15); }

.spotify-btn.connected {
  background: #1DB954;
  color: #0a0a1a;
}

.playlist-btn {
  width: 100%;
  padding: 10px;
  margin-top: 16px;
  border: 1px solid #1DB954;
  border-radius: 8px;
  background: rgba(29, 185, 84, 0.1);
  color: #1DB954;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.playlist-btn:hover { background: rgba(29, 185, 84, 0.25); }
.playlist-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.flag-btn {
  margin-top: 6px;
  padding: 3px 8px;
  border: 1px solid #555;
  border-radius: 4px;
  background: transparent;
  color: #666;
  font-size: 10px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.flag-btn:hover { border-color: #F39C12; color: #F39C12; }
.flag-btn:disabled { opacity: 0.5; cursor: default; }
.playlist-btn.success { background: #1DB954; color: #0a0a1a; }

.filter-toggles {
  display: flex;
  gap: 6px;
}

.filter-btn {
  padding: 5px 12px;
  border: 1px solid var(--cat-color);
  border-radius: 20px;
  background: transparent;
  color: var(--cat-color);
  font-size: 11px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active {
  background: var(--cat-color);
  color: #0a0a1a;
}

.filter-btn:hover { opacity: 0.8; }

/* ── Graph container ─────────────────────────── */

#graphContainer {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 36px;
  background:
    radial-gradient(1200px 900px at 50% 42%, rgba(29, 185, 84, 0.05), transparent 62%),
    radial-gradient(1500px 1100px at 50% 45%, #0c0c1c 0%, #08080f 55%, #050509 100%);
}

/* ── Side panel ──────────────────────────────── */

#sidePanel {
  position: fixed;
  top: 56px;
  right: 0;
  width: 380px;
  bottom: 36px;
  background: rgba(15, 15, 30, 0.95);
  backdrop-filter: blur(12px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
  padding: 20px;
  z-index: 50;
  transition: transform 0.3s ease;
}

#sidePanel.hidden {
  transform: translateX(100%);
}

#closePanel {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

#closePanel:hover { color: #fff; }

/* Panel content */

.panel-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.panel-artist {
  font-size: 14px;
  color: #1DB954;
  margin-bottom: 16px;
}

.panel-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 12px;
  color: #888;
}

.panel-meta span { display: flex; align-items: center; gap: 4px; }

/* Fingerprint section */

.fp-section {
  margin-bottom: 20px;
}

.fp-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.fp-section-title.tonal { color: #4A90D9; }
.fp-section-title.rhythmic { color: #F39C12; }
.fp-section-title.emotional { color: #8E44AD; }
.fp-section-title.compositional { color: #27AE60; }

/* Connections list */

.connections-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin: 24px 0 12px;
}

.connection-item {
  padding: 10px 12px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background 0.2s;
}

.connection-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.connection-item .conn-song {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.connection-item .conn-artist {
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}

.connection-item .conn-dimension {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.connection-item .conn-note {
  font-size: 12px;
  color: #aaa;
  line-height: 1.4;
}

.connection-item[data-category="tonal"] { border-left-color: #4A90D9; }
.connection-item[data-category="tonal"] .conn-dimension { color: #4A90D9; }
.connection-item[data-category="rhythmic"] { border-left-color: #F39C12; }
.connection-item[data-category="rhythmic"] .conn-dimension { color: #F39C12; }
.connection-item[data-category="emotional"] { border-left-color: #8E44AD; }
.connection-item[data-category="emotional"] .conn-dimension { color: #8E44AD; }
.connection-item[data-category="compositional"] { border-left-color: #27AE60; }
.connection-item[data-category="compositional"] .conn-dimension { color: #27AE60; }

/* ── Bottom legend ───────────────────────────── */

#legend {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: rgba(10, 10, 26, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 20px;
  z-index: 100;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #888;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.line {
  width: 16px;
  height: 2px;
  border-radius: 1px;
  display: inline-block;
}

.legend-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
}

/* ── Stats overlay ───────────────────────────── */

#statsOverlay {
  position: fixed;
  bottom: 44px;
  left: 12px;
  font-size: 11px;
  color: #444;
  z-index: 50;
}

/* ── Nav buttons ─────────────────────────────── */

.nav-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #ccc;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: rgba(29, 185, 84, 0.15);
  border-color: #1DB954;
  color: #1DB954;
}

/* ── Preference buttons ─────────────────────── */

.pref-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.pref-btn {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--pref-color);
  border-radius: 6px;
  background: transparent;
  color: var(--pref-color);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.pref-btn.active {
  background: var(--pref-color);
  color: #0a0a1a;
}
.pref-btn:hover { opacity: 0.8; }

/* ── Scrollbar ───────────────────────────────── */

#sidePanel::-webkit-scrollbar { width: 4px; }
#sidePanel::-webkit-scrollbar-track { background: transparent; }
#sidePanel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Mobile-first search experience ─────────── */

#mobileHome { display: none; }

.mobile-hero {
  text-align: center;
  padding: 48px 20px 24px;
}

.mobile-hero-title {
  font-size: 32px;
  font-weight: 700;
  color: #1DB954;
  margin-bottom: 6px;
}

.mobile-hero-sub {
  font-size: 14px;
  color: #666;
  font-weight: 400;
}

.mobile-search-wrap {
  padding: 0 20px 24px;
}

.mobile-search-wrap input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #e0e0e0;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.mobile-search-wrap input:focus {
  border-color: #1DB954;
  background: rgba(255, 255, 255, 0.08);
}

.mobile-search-wrap input::placeholder { color: #555; }

.mobile-examples {
  padding: 0 20px 24px;
}

.mobile-examples-label {
  font-size: 12px;
  color: #555;
  font-weight: 500;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.mobile-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-chip {
  font-size: 13px;
  color: #999;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-chip:active {
  color: #1DB954;
  border-color: rgba(29, 185, 84, 0.3);
  background: rgba(29, 185, 84, 0.08);
}

.mobile-lucky-wrap {
  margin-top: 16px;
  text-align: center;
}

.mobile-lucky {
  padding: 10px 24px;
  border: 1px solid rgba(29, 185, 84, 0.3);
  border-radius: 24px;
  background: rgba(29, 185, 84, 0.08);
  color: #1DB954;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-lucky:active {
  background: rgba(29, 185, 84, 0.2);
}

#mobileResults {
  padding: 0 20px;
  padding-bottom: 80px;
}

#mobileResults .connection-item {
  margin-bottom: 8px;
}

.mobile-footer-links {
  padding: 24px 20px;
  text-align: center;
}

.mobile-footer-links a {
  color: #555;
  text-decoration: none;
  font-size: 13px;
}

.mobile-footer-links a:active { color: #1DB954; }

/* ── Responsive ─────────────────────────────── */

@media (max-width: 768px) {
  body { overflow: auto; height: auto; }
  body.has-banner .status-banner { position: relative; height: auto; padding: 10px 16px; }
  #topbar { display: none; }
  #graphContainer { display: none; }
  #legend { display: none; }
  #statsOverlay { display: none; }
  #mobileHome { display: block; }

  #sidePanel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-left: none;
    z-index: 200;
  }

  #sidePanel.hidden { transform: translateY(100%); }

  #closePanel {
    top: 16px;
    right: 16px;
    font-size: 28px;
    z-index: 210;
  }

  .panel-title { font-size: 18px; }

  .connection-item .conn-song { font-size: 14px; }
  .connection-item .conn-artist { font-size: 12px; }
}

/* ── YouTube sticky playlist player ───────────────────── */
#yt-sticky-player {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 26, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(29, 185, 84, 0.25);
  padding: 12px 14px 10px;
  margin: 0 0 16px;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
#yt-sticky-player .yt-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 220px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
#yt-sticky-player #yt-iframe-target {
  width: 100%;
  height: 100%;
}
#yt-sticky-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
#yt-sticky-player .yt-player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: #ccc;
}
#yt-sticky-player .yt-now-playing {
  flex: 1 1 auto;
  min-width: 200px;
  color: #888;
  line-height: 1.4;
}
#yt-sticky-player .yt-now-playing strong {
  color: #fff;
  font-weight: 600;
}
#yt-sticky-player .yt-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#yt-sticky-player .yt-btn {
  font: inherit;
  font-size: 11px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #ccc;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
#yt-sticky-player .yt-btn:hover {
  background: rgba(29, 185, 84, 0.12);
  border-color: rgba(29, 185, 84, 0.35);
  color: #fff;
}
#yt-sticky-player .yt-open {
  color: #1DB954;
}
#yt-sticky-player .yt-close {
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1;
}

/* Active-card highlight while a song plays */
[data-yt-card] {
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.12s;
}
[data-yt-card]:hover {
  border-color: rgba(29, 185, 84, 0.35) !important;
}
[data-yt-card].yt-active {
  border-color: #1DB954 !important;
  background: rgba(29, 185, 84, 0.06) !important;
  box-shadow: 0 0 0 1px rgba(29, 185, 84, 0.4) inset;
}

@media (max-width: 600px) {
  #yt-sticky-player {
    padding: 8px 10px;
    margin-bottom: 12px;
  }
  #yt-sticky-player .yt-player-wrap {
    max-height: 180px;
  }
  #yt-sticky-player .yt-now-playing {
    width: 100%;
    flex: 1 1 100%;
    font-size: 11px;
  }
}

/* Empty-state with "small catalog, email me to add" CTA */
.empty-state {
  padding: 24px 0 16px;
  color: #aaa;
  font-size: 14px;
  line-height: 1.6;
}
.empty-state-msg {
  color: #ccc;
  margin-bottom: 10px;
}
.empty-state-cta {
  color: #888;
  font-size: 13px;
}
.empty-state a {
  color: #1DB954;
  text-decoration: none;
  border-bottom: 1px solid rgba(29, 185, 84, 0.4);
}
.empty-state a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* ── Admin inspector ───────────────────────────────────── */

.admin-body { background: #0a0a1a; min-height: 100vh; }

.admin-crumb {
  margin-left: 16px;
  color: #888;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#adminMain {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}

.admin-section { width: 100%; }

.admin-h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.admin-sub {
  color: #888;
  font-size: 13px;
  margin-bottom: 20px;
  max-width: 640px;
  line-height: 1.5;
}

.admin-sub code {
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 11px;
}

.admin-login-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin-bottom: 12px;
}

.admin-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e0e0e0;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.admin-input:focus { border-color: #1DB954; }

.admin-primary-btn {
  background: #1DB954;
  color: #0a0a1a;
  border: 0;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.admin-primary-btn:hover { background: #1ed760; }

.admin-error {
  color: #e07a7a;
  font-size: 13px;
  background: rgba(224,122,122,0.08);
  border: 1px solid rgba(224,122,122,0.2);
  padding: 8px 12px;
  border-radius: 6px;
  max-width: 480px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 20px;
}

.admin-tab {
  background: transparent;
  border: 0;
  color: #888;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}
.admin-tab:hover { color: #ccc; }
.admin-tab.active { color: #1DB954; border-bottom-color: #1DB954; }

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}

.admin-filters .admin-input { min-width: 160px; }
.admin-range { width: 80px; }

.admin-range-label,
.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #888;
  font-size: 12px;
}

.admin-stats {
  color: #888;
  font-size: 12px;
  margin-bottom: 8px;
  padding-left: 4px;
}

.admin-table-wrap {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  overflow: auto;
  max-height: calc(100vh - 360px);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table thead th {
  position: sticky;
  top: 0;
  background: #14142a;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 10px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.admin-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
  line-height: 1.4;
}

.admin-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.admin-table tbody tr.label-gold { background: rgba(255,215,0,0.05); }
.admin-table tbody tr.label-gold:hover { background: rgba(255,215,0,0.08); }
.admin-table tbody tr.label-bad  { background: rgba(224,122,122,0.05); }
.admin-table tbody tr.label-bad:hover  { background: rgba(224,122,122,0.08); }

.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .muted { color: #666; font-size: 11px; }
.admin-table .note { color: #ccc; max-width: 320px; }
.admin-table .vals { color: #aaa; font-family: 'SF Mono', Menlo, monospace; font-size: 11px; }

.dim-chip {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(29,185,84,0.1);
  color: #1DB954;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.conf-low  { color: #e07a7a; }
.conf-mid  { color: #d4a64a; }
.conf-high { color: #1DB954; }

.label-cell {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

.label-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: #888;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-family: inherit;
}
.label-btn:hover { border-color: rgba(255,255,255,0.25); color: #ccc; }
.label-btn.label-gold.on  { background: #ffd700; color: #0a0a1a; border-color: #ffd700; }
.label-btn.label-bad.on   { background: #e07a7a; color: #0a0a1a; border-color: #e07a7a; }
.label-btn.label-clear:hover { color: #e07a7a; }

.admin-pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: #888;
  font-size: 12px;
}
.admin-pager .admin-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 12px;
}
.admin-pager .admin-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #ccc;
}

.play-link {
  display: inline-block;
  margin-left: 6px;
  padding: 0 4px;
  color: #888;
  font-size: 10px;
  text-decoration: none;
  border-radius: 3px;
  transition: color 0.15s;
  vertical-align: middle;
}
.play-link:hover { color: #1DB954; }
.play-link.play-sp:hover { color: #1DB954; }
.play-link.play-yt:hover { color: #ff0000; }

.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;
}

/* ── Home: journey composer + featured rail ───────────── */

.home-lead {
  text-align: center;
  color: #9a9ab0;
  font-size: 15px;
  line-height: 1.65;
  max-width: 560px;
  margin: 0 auto 30px;
}
.home-lead strong { color: #e6e6f0; font-weight: 600; }
.lead-kicker {
  display: block;
  margin-top: 12px;
  font-size: 13.5px;
  color: #6f6f86;
}
.lead-why {
  color: var(--tl-green);
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
}

/* Composer as a single "console" */
.journey-composer {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 640px;
  margin: 0 auto 10px;
  padding: 7px 7px 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 24px 64px -34px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.journey-composer:focus-within {
  border-color: rgba(29, 185, 84, 0.55);
  background: rgba(29, 185, 84, 0.045);
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.13), 0 26px 70px -32px rgba(0, 0, 0, 0.95);
}
.journey-composer input {
  flex: 1 1 0;
  min-width: 0;
  padding: 13px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #f1f1f7;
  font-size: 15px;
  font-family: var(--sans);
  outline: none;
  transition: background 0.2s;
}
.journey-composer input:focus { background: rgba(255, 255, 255, 0.045); }
.journey-composer input::placeholder { color: #64647a; }
.jc-arrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  color: var(--tl-green);
  font-size: 18px;
  font-weight: 700;
}
#jGo {
  flex: 0 0 auto;
  padding: 13px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--tl-green-lift), var(--tl-green));
  color: #04120a;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 26px -12px rgba(29, 185, 84, 0.65);
  transition: filter 0.2s, transform 0.08s, box-shadow 0.2s;
}
#jGo:hover { filter: brightness(1.08); box-shadow: 0 12px 30px -10px rgba(29, 185, 84, 0.75); }
#jGo:active { transform: translateY(1px); }

/* Featured journeys */
.featured { max-width: 760px; margin: 34px auto 0; }
.featured-label {
  font-size: 11px;
  color: #6a6a82;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  margin-bottom: 14px;
  text-align: center;
}
.featured-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.featured-card {
  position: relative;
  text-align: left;
  padding: 16px 16px 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
  cursor: pointer;
  overflow: hidden;
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.featured-card::after {
  content: '\25B6';
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 9px;
  color: #3b3b4c;
  transition: color 0.18s, transform 0.18s;
}
.featured-card:hover {
  transform: translateY(-3px);
  border-color: rgba(29, 185, 84, 0.45);
  background: rgba(29, 185, 84, 0.06);
  box-shadow: 0 18px 40px -22px rgba(29, 185, 84, 0.5);
}
.featured-card:hover::after { color: var(--tl-green); transform: scale(1.18); }
.fc-route {
  color: #ebebf3;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding-right: 16px;
}
.fc-route .fc-sep { color: var(--tl-green); margin: 0 7px; font-weight: 700; }
.fc-desc { color: #7d7d92; font-size: 12px; line-height: 1.45; }

.home-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 520px;
  margin: 46px auto 22px;
  color: #55556c;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.6px;
}
.home-divider::before,
.home-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* Staggered entrance */
@keyframes tl-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
body.home .hero,
body.home .home-lead,
body.home .journey-composer,
body.home .featured,
body.home .home-divider,
body.home .search-wrap,
body.home .examples {
  animation: tl-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
body.home .hero { animation-delay: 0.02s; }
body.home .home-lead { animation-delay: 0.10s; }
body.home .journey-composer { animation-delay: 0.18s; }
body.home .featured { animation-delay: 0.28s; }
body.home .home-divider { animation-delay: 0.36s; }
body.home .search-wrap { animation-delay: 0.40s; }
body.home .examples { animation-delay: 0.46s; }
@media (prefers-reduced-motion: reduce) {
  body.home .hero, body.home .home-lead, body.home .journey-composer,
  body.home .featured, body.home .home-divider, body.home .search-wrap,
  body.home .examples { animation: none; }
}

/* ── Journey theater ──────────────────────────────────── */

.journey {
  animation: journey-fade 0.4s ease;
}
@keyframes journey-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.journey-head { text-align: center; margin-bottom: 16px; }
.journey-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.jh-song {
  display: flex;
  flex-direction: column;
  font-size: 16px;
  font-weight: 700;
  color: #e8e8f0;
  line-height: 1.25;
}
.jh-song small { font-size: 11px; font-weight: 500; color: #777; }
.jh-dest { text-align: right; }
.jh-arrow { color: #1DB954; font-size: 20px; font-weight: 700; }
.journey-meta { margin-top: 8px; font-size: 12px; color: #666; }

.journey-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.journey-stage #journey-yt,
.journey-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.journey-play-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 20, 0.55);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  z-index: 3;
  transition: opacity 0.3s;
}
.journey.is-playing .journey-play-hint { opacity: 0; pointer-events: none; }

.journey-rail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 18px 0 6px;
  flex-wrap: wrap;
}
.jr-dot {
  padding: 6px;
  border: none;
  background: none;
  cursor: pointer;
  line-height: 0;
}
.jr-dot-mark {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #33334a;
  transition: all 0.25s;
}
.jr-dot.is-past .jr-dot-mark { background: #1DB954; opacity: 0.5; }
.jr-dot.is-active .jr-dot-mark {
  background: #1DB954;
  transform: scale(1.7);
  box-shadow: 0 0 0 4px rgba(29, 185, 84, 0.18);
}
.jr-link {
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.journey-now { text-align: center; margin: 6px 0 14px; }
.jn-step {
  font-size: 10px;
  color: #1DB954;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 4px;
}
.jn-title { font-size: 22px; font-weight: 700; color: #fff; line-height: 1.2; }
.jn-artist { font-size: 13px; color: #888; margin-top: 2px; }

.journey-reason {
  --reason-color: #27AE60;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 18px;
  border-radius: 12px;
  border-left: 3px solid var(--reason-color);
  background: rgba(255, 255, 255, 0.03);
  min-height: 64px;
}
.journey-reason.reason-in { animation: reason-slide 0.45s ease; }
@keyframes reason-slide { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.jrn-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #666;
  font-weight: 600;
  margin-bottom: 6px;
}
.jrn-dim {
  font-size: 13px;
  font-weight: 700;
  color: var(--reason-color);
  text-transform: capitalize;
  margin-bottom: 6px;
}
.jrn-note { font-size: 15px; color: #d8d8e4; line-height: 1.55; font-style: italic; }
.journey-reason.is-arrival {
  border-left-color: #1DB954;
  background: rgba(29, 185, 84, 0.07);
  text-align: center;
}
.journey-reason.is-arrival .jrn-note { font-style: normal; color: #cfcfe0; }
.journey-reason.is-arrival strong { color: #1DB954; }

.journey-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  margin: 18px auto 0;
}
.jc-btn {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #ccc;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.18s;
}
.jc-btn:hover { border-color: rgba(29, 185, 84, 0.4); color: #1DB954; }
.jc-toggle { min-width: 78px; }
.jc-share {
  border-color: rgba(29, 185, 84, 0.35);
  color: #1DB954;
  background: rgba(29, 185, 84, 0.07);
}
.jc-share:hover { background: rgba(29, 185, 84, 0.16); color: #1DB954; }
.jc-share.is-copied { background: #1DB954; color: #06120b; border-color: #1DB954; }
.jc-ghost { border-color: transparent; color: #777; }
.jc-ghost:hover { color: #aaa; border-color: transparent; }
.journey-progress {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.jp-fill {
  height: 100%;
  width: 0;
  background: #1DB954;
  border-radius: 2px;
}

@media (max-width: 768px) {
  .journey-composer { flex-wrap: wrap; }
  .journey-composer input { flex: 1 1 100%; }
  .jc-arrow { display: none; }
  #jGo { flex: 1 1 100%; padding: 13px; }
  .featured-rail { grid-template-columns: 1fr; }
  .jn-title { font-size: 19px; }
  .jc-ghost { display: none; }
}
