/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface-hover: #efeff4;
  --border: #e0e0e8;
  --text: #1c1c24;
  --text-dim: #6b6b80;
  --accent: #5b4cff;
  --accent-glow: rgba(91, 76, 255, 0.10);
  --accent-dim: #4235c0;
  --green: #10b981;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.15s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}

.header-inner h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* ── Main ──────────────────────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
}

/* ── Search ────────────────────────────────────────────────────────────────── */
.search-section {
  position: relative;
  margin-bottom: 1rem;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-dim);
  display: flex;
  pointer-events: none;
}

#search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  padding: 0.875rem 1rem 0.875rem 3rem;
  width: 100%;
}

#search-input::placeholder {
  color: var(--text-dim);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 1rem;
}

.spinner.hidden { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dropdown ──────────────────────────────────────────────────────────────── */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dropdown.hidden { display: none; }

.dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.dropdown-item:last-child { border-bottom: none; }

.dropdown-item:hover,
.dropdown-item.active {
  background: var(--surface-hover);
}

.dropdown-item .dd-title {
  font-weight: 500;
  font-size: 0.925rem;
}

.dropdown-item .dd-title em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}

.dropdown-item .dd-artist {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.dropdown-item .dd-artist em {
  font-style: normal;
  color: var(--accent);
}

.dropdown-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ── Selected Song ─────────────────────────────────────────────────────────── */
#selected-section {
  animation: fadeIn 0.25s ease;
}

.selected-card {
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.selected-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

#selected-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 0.15rem;
  letter-spacing: -0.01em;
}

#selected-artist {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.similarity-stats {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Open in YouTube ──────────────────────────────────────────────────────── */
.player-section {
  margin-bottom: 0.75rem;
  animation: fadeIn 0.3s ease;
}

.player-section.hidden { display: none; }

.yt-open-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  background: #ff0000;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, transform 0.1s ease;
}

.yt-open-btn:hover {
  background: #cc0000;
  transform: scale(1.02);
}

.yt-open-btn:active {
  transform: scale(0.97);
}

/* ── Mode Toggle ───────────────────────────────────────────────────────────── */
.mode-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mode-toggle.hidden { display: none; }

.mode-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.mode-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.mode-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Window Slider ─────────────────────────────────────────────────────────── */
.slider-section {
  animation: fadeIn 0.25s ease;
  margin-bottom: 1.5rem;
}

.slider-section.hidden { display: none; }

/* Slider bar */
.slider-bar-container {
  margin-bottom: 0.5rem;
}

.slider-bar {
  position: relative;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: visible;
}

.slider-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
  transition: width 0.15s ease, left 0.15s ease;
  pointer-events: none;
}

.slider-fill-past {
  left: 0;
  background: var(--border);
  z-index: 1;
}

.slider-fill-window {
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  z-index: 2;
}

.slider-range {
  position: absolute;
  top: -6px;
  left: -2px;
  width: calc(100% + 4px);
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  margin: 0;
  padding: 0;
}

.slider-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(124, 106, 255, 0.4);
  transition: transform 0.1s ease;
}

.slider-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(124, 106, 255, 0.4);
}

.slider-range:focus {
  outline: none;
}

/* Time display */
.slider-time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.slider-time-sep {
  color: var(--border);
  font-size: 0.75rem;
}

#slider-time-current {
  color: var(--accent);
  font-weight: 600;
}

#slider-time-end {
  color: var(--text);
}

#slider-time-total {
  color: var(--text-dim);
}

/* Navigation controls */
.slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.slider-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  line-height: 1;
  padding: 0;
}

.slider-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-dim);
}

.slider-btn:active {
  transform: scale(0.95);
}

.slider-btn-play {
  width: 40px;
  height: 40px;
  background: var(--accent-glow);
  border-color: var(--accent-dim);
  font-size: 1rem;
}

.slider-btn-play:hover {
  background: rgba(124, 106, 255, 0.25);
}

/* Slider results */
.slider-results {
  animation: fadeIn 0.25s ease;
}

.slider-results.hidden { display: none; }

/* Query badge */
.query-badge {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 500;
}

.result-item.is-query {
  border-color: var(--accent-dim);
  background: rgba(124, 106, 255, 0.05);
}

/* ── Results ───────────────────────────────────────────────────────────────── */
.results-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.timing {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: fadeIn 0.3s ease;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: default;
}

.result-item:hover {
  background: var(--surface-hover);
  border-color: var(--accent-dim);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.result-rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  width: 1.75rem;
  flex-shrink: 0;
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-title {
  font-weight: 500;
  font-size: 0.925rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-artist {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-similarity {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green);
  flex-shrink: 0;
  margin-left: 0.5rem;
}

/* ── Result action buttons ──────────────────────────────────────────────────── */
.result-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.1s ease;
}

.result-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.08);
}

.result-btn:active {
  transform: scale(0.95);
}

.result-yt {
  color: #ff0000;
  border-color: transparent;
  font-size: 0.85rem;
}

.result-yt:hover {
  background: #fff0f0;
  border-color: #ff0000;
  color: #cc0000;
}

/* ── Status ────────────────────────────────────────────────────────────────── */
.status-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.status-message .spinner {
  margin-right: 0;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
.dropdown::-webkit-scrollbar,
.results-grid::-webkit-scrollbar {
  width: 6px;
}
.dropdown::-webkit-scrollbar-track,
.results-grid::-webkit-scrollbar-track {
  background: transparent;
}
.dropdown::-webkit-scrollbar-thumb,
.results-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { padding: 1.25rem 1rem 1rem; }
  .header-inner h1 { font-size: 1.4rem; }
  main { padding: 1rem; }
  .selected-card { flex-direction: column; }
  .similarity-stats { text-align: left; }
  .result-item { padding: 0.75rem 0.875rem; }
  .slider-controls { gap: 0.35rem; }
  .slider-btn { width: 32px; height: 32px; font-size: 0.8rem; }
  .slider-btn-play { width: 36px; height: 36px; }
  .nav-inner { padding: 0 1rem; }
  .nav-links { gap: 0.25rem; }
  .nav-links a { font-size: 0.8rem; padding: 0.4rem 0.65rem; }
  .path-pickers { flex-direction: column; }
  .swipe-card { height: 260px; }
  .swipe-title { font-size: 1.25rem; }
}

/* ── Navigation Bar ──────────────────────────────────────────────────────── */
.top-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.92);
}

.nav-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 52px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 0.35rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.nav-links a:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-links a.active {
  background: var(--accent-glow);
  color: var(--accent);
}

/* ── Info Card (explanations) ────────────────────────────────────────────── */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.info-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.info-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.info-card p:last-child {
  margin-bottom: 0;
}

.info-card strong {
  color: var(--text);
}

.info-card em {
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
}

/* ── Primary / Secondary Buttons ─────────────────────────────────────────── */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), transform 0.1s ease, opacity 0.2s ease;
}

.primary-btn:hover:not(:disabled) {
  background: var(--accent-dim);
  transform: scale(1.02);
}

.primary-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.secondary-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-dim);
  color: var(--text);
}

/* ── Song Path Page ──────────────────────────────────────────────────────── */
.path-pickers {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.path-picker {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.path-picker label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.path-picker .search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.path-picker .search-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.path-picker .search-wrapper input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0.75rem 1rem;
  width: 100%;
}

.path-picker .search-wrapper input::placeholder {
  color: var(--text-dim);
}

.path-picker .search-wrapper input:disabled {
  opacity: 0.4;
}

.path-picker .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 240px;
  overflow-y: auto;
}

.path-selection {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.path-selection.hidden { display: none; }

.path-song-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.path-clear {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.path-clear:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}

#find-path-btn {
  align-self: flex-start;
}

#path-spinner {
  align-self: flex-start;
  margin-left: 1rem;
}

/* Path results list */
.path-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  animation: fadeIn 0.4s ease;
}

.path-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.path-item:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.path-step-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
  flex-shrink: 0;
}

.path-step-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-glow);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.path-step-pct {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.path-item-info {
  flex: 1;
  min-width: 0;
}

.path-item-title {
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.path-item-artist {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Music Dating Page ───────────────────────────────────────────────────── */
.swipe-card {
  max-width: 420px;
  margin: 0 auto 1rem;
  height: 300px;
  perspective: 1000px;
}

.swipe-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
}

.swipe-card-inner.swiping-right {
  transform: translateX(120px) rotate(12deg);
  box-shadow: -4px 4px 20px rgba(0,0,0,0.08);
}

.swipe-card-inner.swiping-left {
  transform: translateX(-120px) rotate(-12deg);
  box-shadow: 4px 4px 20px rgba(0,0,0,0.08);
}

.swipe-card-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 0;
}

.swipe-like-bg {
  background: linear-gradient(135deg, #10b98130, #05966920);
  color: #10b981;
}

.swipe-nope-bg {
  background: linear-gradient(135deg, #ef444430, #dc262620);
  color: #ef4444;
}

.swiping-right .swipe-like-bg {
  opacity: 1;
}

.swiping-left .swipe-nope-bg {
  opacity: 1;
}

.swipe-card-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.swipe-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.swipe-artist {
  color: var(--text-dim);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.swipe-card-content .yt-open-btn {
  display: inline-flex;
}

/* Swipe action buttons */
.swipe-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

.swipe-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.swipe-btn-nope {
  color: #ef4444;
  border-color: #fecaca;
}

.swipe-btn-nope:hover {
  background: #fef2f2;
  border-color: #ef4444;
  transform: scale(1.05);
}

.swipe-btn-nope:active {
  transform: scale(0.95);
}

.swipe-btn-yep {
  color: #10b981;
  border-color: #a7f3d0;
}

.swipe-btn-yep:hover {
  background: #ecfdf5;
  border-color: #10b981;
  transform: scale(1.05);
}

.swipe-btn-yep:active {
  transform: scale(0.95);
}

.swipe-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

/* Swipe stats */
.swipe-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.swipe-stats strong {
  color: var(--text);
}

/* Playlist section */
.playlist-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.playlist-explanation {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.result-item.is-favorite {
  border-color: #fbbf24;
  background: #fffbeb;
}

.result-item.is-favorite .result-rank {
  color: #f59e0b;
  font-size: 1rem;
}

/* ── Pipeline Page ──────────────────────────────────────────────────────── */

/* Distinct nav badge style */
.nav-pipeline-badge {
  font-size: 0.78rem !important;
  padding: 0.25rem 0.7rem !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 100px !important;
  background: transparent !important;
  color: var(--text-dim) !important;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition) !important;
}

.nav-pipeline-badge:hover {
  border-color: var(--accent-dim) !important;
  background: var(--accent-glow) !important;
  color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

.nav-pipeline-badge.active {
  border-color: var(--accent) !important;
  background: var(--accent-glow) !important;
  color: var(--accent) !important;
}

/* Pipeline page hero */
.pipeline-page {
  --pipeline-accent: #5b4cff;
  --pipeline-bg-alt: #f0eff6;
}

.pipeline-hero {
  background: linear-gradient(135deg, #1c1c24 0%, #2d2d3a 100%);
  border-bottom: none;
  position: relative;
  overflow: hidden;
}

.pipeline-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(91, 76, 255, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 100px;
  padding: 0.25rem 0.85rem;
  margin-bottom: 1rem;
}

.hero-inner h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
}

.hero-summary {
  color: rgba(255,255,255,0.65);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-top: 0.75rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-summary em {
  color: rgba(255,255,255,0.9);
  font-style: normal;
  font-weight: 500;
}

/* Pipeline main content */
.pipeline-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  width: 100%;
  flex: 1;
}

/* Individual step */
.pipeline-step {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  animation: fadeIn 0.4s ease both;
}

.pipeline-step:nth-child(1) { animation-delay: 0.05s; }
.pipeline-step:nth-child(2) { animation-delay: 0.10s; }
.pipeline-step:nth-child(3) { animation-delay: 0.15s; }
.pipeline-step:nth-child(4) { animation-delay: 0.20s; }

.step-number {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
  box-shadow: 0 4px 12px rgba(91, 76, 255, 0.25);
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-body h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.step-intro {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.step-intro strong {
  color: var(--text);
}

.step-details {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step-details li {
  position: relative;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-dim);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.step-details li:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.step-details li strong {
  color: var(--text);
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.15rem;
}

.step-details li code {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 500;
}

.step-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-dim);
}

/* Feature grid (step 2) */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.feature-card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 3px 12px rgba(0,0,0,0.05);
  transform: translateY(-2px);
}

.feature-dims {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.15rem;
}

.feature-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.feature-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Tech stack */
.tech-stack {
  text-align: center;
  padding: 2rem 0 1rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.tech-stack p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.8;
}

.tech-stack a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition), border-color var(--transition);
  border-bottom: 1px solid transparent;
}

.tech-stack a:hover {
  color: var(--accent-dim);
  border-bottom-color: var(--accent-dim);
}

/* ── Responsive (pipeline overrides) ──────────────────────────────────── */
@media (max-width: 600px) {
  .hero-inner { padding: 2rem 1rem 1.75rem; }
  .hero-inner h1 { font-size: 1.5rem; }
  .pipeline-main { padding: 1.5rem 1rem; }
  .pipeline-step { flex-direction: column; gap: 0.75rem; }
  .step-number { width: 36px; height: 36px; font-size: 0.95rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .step-details li { padding: 0.85rem 1rem; }
}
