:root {
  --cream: #f4efe5;
  --paper: #fffdf8;
  --paper-alt: #faf6ed;
  --navy: #11182d;
  --gold: #d39b32;
  --violet: #7665e8;
  --text: #11182d;
  --muted: #6f7788;
  --line: rgba(17, 24, 45, .13);
  --line-strong: rgba(17, 24, 45, .24);
  --danger: #b33e48;
  --shadow: 0 12px 34px rgba(17, 24, 45, .08);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(211,155,50,.08), transparent 280px),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.drawer-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .46;
}

img {
  display: block;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255,253,248,.96);
}

.header-inner {
  width: min(1280px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  width: 218px;
  flex: 0 0 218px;
  display: flex;
  align-items: center;
}

.brand img {
  width: 100%;
  height: 46px;
  object-fit: contain;
  object-position: left center;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

.header-button {
  margin-left: auto;
  min-height: 40px;
  border: 1px solid var(--navy);
  border-radius: 2px;
  padding: 0 15px;
  color: white;
  background: var(--navy);
  font-weight: 850;
}

.header-button span {
  margin-left: 7px;
  color: var(--gold);
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 24px auto 126px;
  display: grid;
  gap: 18px;
}

.section-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-label {
  display: block;
  margin-bottom: 4px;
  color: #95651b;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .68rem;
  font-weight: 900;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  letter-spacing: -.035em;
}

h1 {
  font-size: clamp(1.75rem, 3vw, 2.55rem);
}

h2 {
  font-size: 1.45rem;
}

.section-heading p,
.seed-layout p,
.empty-state p,
.privacy-copy,
.analysis-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.section-heading p {
  margin: 6px 0 0;
}

.source-switch {
  display: flex;
  border: 1px solid var(--line);
}

.source-button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 0 16px;
  color: var(--muted);
  background: white;
  font-weight: 850;
}

.source-button:last-child {
  border-right: 0;
}

.source-button.active {
  color: white;
  background: var(--navy);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.search-form input,
.match-controls input,
.upload-form input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0 13px;
  color: var(--text);
  background: white;
  outline: none;
}

.search-form input:focus,
.match-controls input:focus,
.upload-form input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(211,155,50,.12);
}

.primary-button,
.action-button,
.full-link,
.filter-button,
.playlist-actions button {
  min-height: 40px;
  border: 1px solid var(--navy);
  border-radius: 2px;
  padding: 0 13px;
  font-weight: 850;
}

.primary-button,
.action-button.primary {
  color: white;
  background: var(--navy);
}

.action-button.secondary,
.full-link,
.filter-button,
.playlist-actions button {
  color: var(--navy);
  background: white;
}

.full-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.quick-searches {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 10px 0 20px;
}

.quick-searches button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--paper-alt);
  font-size: .78rem;
  font-weight: 800;
}

.results-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.results-heading h2 {
  font-size: 1rem;
}

.results-heading span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.track-list,
.match-list,
.playlist-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.track-row,
.match-row,
.playlist-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: white;
}

.track-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.track-row:hover,
.match-row:hover,
.playlist-row:hover,
.is-playing {
  border-color: rgba(211,155,50,.58);
  background: #fffaf0;
}

.artwork {
  width: 56px;
  height: 56px;
  border-radius: 2px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--gold), var(--violet));
}

.track-copy,
.match-copy,
.playlist-copy {
  min-width: 0;
}

.track-copy strong,
.match-copy strong,
.playlist-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.track-copy span,
.match-copy span,
.playlist-copy span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: .80rem;
}

.track-actions,
.match-actions,
.seed-actions,
.playlist-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.action-button,
.full-link {
  min-height: 36px;
  font-size: .76rem;
}

.upload-box {
  min-height: 112px;
  border: 1px dashed var(--gold);
  border-radius: 2px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text);
  background: #fffaf0;
  cursor: pointer;
}

.upload-symbol {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--gold);
  font-size: 2rem;
  font-weight: 500;
}

.upload-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.upload-copy strong {
  font-size: 1rem;
}

.upload-copy small {
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.upload-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.upload-form label {
  min-width: 0;
}

.upload-form label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
}

.privacy-copy {
  margin: 8px 0 0;
  font-size: .76rem;
}

.seed-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: 130px minmax(0,1fr) auto;
  gap: 20px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.seed-layout.empty {
  grid-template-columns: 70px minmax(0,1fr);
}

.seed-cover {
  width: 130px;
  height: 130px;
  border-radius: 2px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--gold), var(--violet));
}

.seed-placeholder {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--gold), var(--violet));
  font-size: 1.8rem;
}

.seed-copy {
  min-width: 0;
}

.seed-copy h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.4rem, 3vw, 2.25rem);
  letter-spacing: -.04em;
}

.seed-copy p {
  margin: 7px 0 0;
}

.seed-details {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 13px;
}

.detail-chip,
.signal-chip {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 5px 7px;
  color: var(--muted);
  background: var(--paper-alt);
  font-size: .72rem;
  font-weight: 800;
}

.analysis-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 14px;
  background: var(--paper-alt);
}

.analysis-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.analysis-heading span {
  color: var(--muted);
  font-size: .78rem;
}

.progress-bar {
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  background: rgba(17,24,45,.09);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--violet));
  transition: width .2s ease;
}

.analysis-panel p {
  margin: 8px 0 0;
  font-size: .78rem;
}

.matches-heading {
  align-items: flex-start;
}

.match-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.match-controls input {
  width: 190px;
}

.filter-button {
  min-height: 38px;
  font-size: .76rem;
}

.filter-button.active {
  color: white;
  background: var(--navy);
}

.match-row {
  display: grid;
  grid-template-columns: 56px minmax(200px,1fr) minmax(160px,.65fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.match-score {
  margin-top: 5px;
  color: #98641a;
  font-size: .75rem;
  font-weight: 900;
}

.match-signals {
  min-width: 0;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.playlist-drawer {
  position: fixed;
  z-index: 70;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100vh;
  padding: 20px;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  gap: 14px;
  border-left: 1px solid var(--line);
  background: var(--paper);
  box-shadow: -18px 0 50px rgba(17,24,45,.15);
  transform: translateX(105%);
  transition: transform .2s ease;
}

.playlist-drawer.open {
  transform: translateX(0);
}

.drawer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.close-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--danger);
  background: white;
  font-size: 1.2rem;
}

.playlist-list {
  overflow-y: auto;
}

.playlist-row {
  display: grid;
  grid-template-columns: 46px minmax(0,1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px;
}

.playlist-row .artwork {
  width: 46px;
  height: 46px;
}

.remove-button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(179,62,72,.25);
  border-radius: 2px;
  color: var(--danger);
  background: white;
}

.playlist-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.playlist-actions .danger-button {
  grid-column: 1 / -1;
  color: var(--danger);
  border-color: rgba(179,62,72,.3);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(17,24,45,.36);
}

.drawer-backdrop[hidden] {
  display: none;
}

.player-bar {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 12px;
  width: min(1280px, calc(100% - 32px));
  min-height: 78px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(220px,.8fr) minmax(340px,1.4fr) minmax(120px,.4fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 10px 14px;
  background: rgba(255,253,248,.97);
  box-shadow: 0 16px 46px rgba(17,24,45,.16);
  backdrop-filter: blur(18px);
}

.now-playing {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0,1fr);
  gap: 10px;
  align-items: center;
}

.now-playing img {
  width: 52px;
  height: 52px;
  border-radius: 2px;
  object-fit: contain;
  background: white;
}

.now-playing strong,
.now-playing span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.now-playing span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .76rem;
}

.player-controls {
  display: grid;
  grid-template-columns: 40px 42px minmax(100px,1fr) 42px;
  gap: 8px;
  align-items: center;
}

.player-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--navy);
  border-radius: 2px;
  color: white;
  background: var(--navy);
  font-weight: 900;
}

.pause-symbol {
  display: none;
}

.player-bar.playing .play-symbol {
  display: none;
}

.player-bar.playing .pause-symbol {
  display: inline;
}

.player-controls > span,
.player-mode {
  color: var(--muted);
  font-size: .74rem;
}

.player-controls input {
  width: 100%;
  accent-color: var(--gold);
}

.player-mode {
  text-align: right;
}

.empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed var(--line);
  padding: 20px;
  text-align: center;
  background: var(--paper-alt);
}

.empty-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--navy);
}

.empty-state p {
  margin: 0;
  font-size: .80rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  z-index: 100;
  transform: translateX(-50%) translateY(140px);
  border-radius: 2px;
  padding: 11px 15px;
  color: white;
  background: var(--navy);
  box-shadow: 0 12px 32px rgba(17,24,45,.2);
  font-size: .82rem;
  font-weight: 850;
  transition: transform .2s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: #eee8dc !important;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: shimmer 1.15s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 920px) {
  .header-inner,
  .page-shell,
  .player-bar {
    width: min(100% - 20px, 1280px);
  }

  .tagline {
    display: none;
  }

  .upload-form {
    grid-template-columns: 1fr;
  }

  .seed-layout {
    grid-template-columns: 100px minmax(0,1fr);
  }

  .seed-cover {
    width: 100px;
    height: 100px;
  }

  .seed-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .matches-heading {
    flex-direction: column;
  }

  .match-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .match-controls input {
    width: min(100%, 280px);
  }

  .match-row {
    grid-template-columns: 52px minmax(0,1fr) auto;
  }

  .match-signals {
    grid-column: 2 / -1;
  }

  .player-bar {
    grid-template-columns: minmax(180px,.7fr) minmax(260px,1.3fr);
  }

  .player-mode {
    display: none;
  }
}

@media (max-width: 640px) {
  .header-inner {
    min-height: 64px;
  }

  .brand {
    width: 170px;
    flex-basis: 170px;
  }

  .brand img {
    height: 40px;
  }

  .header-button {
    padding: 0 10px;
  }

  .page-shell {
    margin-top: 14px;
    margin-bottom: 148px;
  }

  .section-block {
    padding: 15px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-switch {
    width: 100%;
  }

  .source-button {
    flex: 1;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .track-row {
    grid-template-columns: 48px minmax(0,1fr);
  }

  .track-row .artwork {
    width: 48px;
    height: 48px;
  }

  .track-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .upload-box {
    min-height: 94px;
    padding: 14px;
  }

  .seed-layout,
  .seed-layout.empty {
    grid-template-columns: 76px minmax(0,1fr);
    gap: 12px;
  }

  .seed-cover {
    width: 76px;
    height: 76px;
  }

  .seed-placeholder {
    width: 62px;
    height: 62px;
  }

  .seed-copy h3 {
    font-size: 1.35rem;
  }

  .match-controls input {
    width: 100%;
  }

  .filter-button {
    flex: 1;
  }

  .match-row {
    grid-template-columns: 48px minmax(0,1fr);
  }

  .match-row .artwork {
    width: 48px;
    height: 48px;
  }

  .match-signals,
  .match-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .player-bar {
    bottom: 8px;
    min-height: 112px;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 9px;
  }

  .now-playing img {
    width: 44px;
    height: 44px;
  }

  .player-controls {
    grid-template-columns: 36px 36px minmax(80px,1fr) 36px;
  }

  .player-toggle {
    width: 36px;
    height: 36px;
  }

  .toast {
    bottom: 132px;
  }
}


/* V8 playlist mode and platform handoff */

.match-control-stack {
  min-width: 0;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.playlist-mode-control {
  display: flex;
  align-items: center;
  gap: 9px;
}

.playlist-mode-control > span {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 850;
}

.playlist-mode-buttons {
  display: flex;
  border: 1px solid var(--line);
}

.playlist-mode-button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 0 11px;
  color: var(--muted);
  background: white;
  font-size: .74rem;
  font-weight: 850;
}

.playlist-mode-button:last-child {
  border-right: 0;
}

.playlist-mode-button.active {
  color: white;
  background: var(--navy);
}

.playlist-footer {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.playlist-mode-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.playlist-mode-summary span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 850;
}

.playlist-mode-summary button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 10px;
  color: var(--navy);
  background: white;
  font-size: .72rem;
  font-weight: 850;
}

.listen-heading {
  display: grid;
  gap: 2px;
}

.listen-heading strong {
  font-size: .83rem;
}

.listen-heading span {
  color: var(--muted);
  font-size: .72rem;
}

.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.platform-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--navy);
  background: white;
  font-size: .75rem;
  font-weight: 900;
}

.platform-button.youtube-music:not(:disabled) {
  border-color: rgba(255,0,0,.34);
}

.platform-button.spotify:not(:disabled) {
  border-color: rgba(30,215,96,.48);
}

.platform-button.apple-music:not(:disabled) {
  border-color: rgba(250,45,72,.38);
}

.platform-button.audiomack:not(:disabled) {
  border-color: rgba(255,132,0,.42);
}

.clear-playlist-button {
  min-height: 36px;
  border: 1px solid rgba(179,62,72,.28);
  border-radius: 2px;
  color: var(--danger);
  background: white;
  font-size: .75rem;
  font-weight: 850;
}

.player-options {
  min-width: 0;
  display: grid;
  gap: 5px;
  justify-items: end;
}

.extended-preview-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}

.extended-preview-option input {
  accent-color: var(--gold);
}

.player-mode {
  text-align: right;
}

.platform-page {
  width: min(980px, calc(100% - 32px));
  margin: 28px auto 60px;
}

.platform-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.platform-page-header img {
  width: 220px;
  height: 52px;
  object-fit: contain;
  object-position: left center;
}

.platform-back-link {
  color: var(--navy);
  font-size: .82rem;
  font-weight: 850;
}

.platform-panel {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.platform-provider-switch {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 16px 0 20px;
}

.provider-choice {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 13px;
  color: var(--muted);
  background: white;
  font-size: .76rem;
  font-weight: 850;
}

.provider-choice.active {
  color: white;
  background: var(--navy);
}

.transfer-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.transfer-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: .80rem;
}

.open-next-button {
  min-height: 40px;
  border: 1px solid var(--navy);
  border-radius: 2px;
  padding: 0 14px;
  color: white;
  background: var(--navy);
  font-weight: 850;
}

.transfer-list {
  display: grid;
  gap: 8px;
}

.transfer-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 50px minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 9px;
  background: white;
}

.transfer-row img {
  width: 50px;
  height: 50px;
  border-radius: 2px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--gold), var(--violet));
}

.transfer-row-copy {
  min-width: 0;
}

.transfer-row-copy strong,
.transfer-row-copy span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.transfer-row-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .78rem;
}

.transfer-open-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0 11px;
  color: var(--navy);
  background: white;
  text-decoration: none;
  font-size: .75rem;
  font-weight: 850;
}

@media (max-width: 920px) {
  .match-control-stack {
    width: 100%;
    justify-items: start;
  }

  .playlist-mode-control {
    width: 100%;
    justify-content: space-between;
  }

  .player-options {
    display: none;
  }
}

@media (max-width: 640px) {
  .platform-grid {
    grid-template-columns: 1fr;
  }

  .platform-page-header,
  .transfer-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .transfer-row {
    grid-template-columns: 44px minmax(0,1fr);
  }

  .transfer-row img {
    width: 44px;
    height: 44px;
  }

  .transfer-open-link {
    grid-column: 1 / -1;
  }
}


/* V8: real YouTube playlist saving and Font Awesome controls */

button i,
a i {
  margin-right: .42rem;
}

.header-button i,
.remove-button i,
.player-toggle i {
  margin-right: 0;
}

.youtube-title-field,
.youtube-privacy-field {
  display: grid;
  gap: 5px;
}

.youtube-title-field > span,
.youtube-privacy-field > span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
}

.youtube-title-field input,
.youtube-privacy-field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0 11px;
  color: var(--text);
  background: white;
}

.youtube-save-button {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  border-color: #ff0033;
  background: #ff0033;
}

.youtube-save-button i {
  font-size: 1.05rem;
}

.saved-playlist-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ff0033;
  border-radius: 2px;
  color: #ff0033;
  background: white;
  text-decoration: none;
  font-size: .78rem;
  font-weight: 900;
}

.youtube-connection-status {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
}

.youtube-connection-status .fa-circle-check {
  color: #258a50;
}

.youtube-connection-status .fa-triangle-exclamation {
  color: var(--danger);
}

.audiomack-coming-soon {
  width: 100%;
  min-height: 40px;
}

.fa-spinner {
  animation-duration: .75s;
}


/* V9: simple per-track listening links; no playlist integrations. */

.header-note {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-align: right;
}

.header-note i {
  color: var(--gold);
}

.match-row {
  grid-template-columns: 56px minmax(0, 1fr) minmax(300px, auto);
}

.match-copy .match-signals {
  margin-top: 8px;
}

.match-actions {
  min-width: 0;
  align-items: center;
}

.service-links {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.service-link {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--navy);
  background: white;
  text-decoration: none;
  font-size: .74rem;
  font-weight: 850;
  white-space: nowrap;
}

.service-link i {
  margin-right: 0;
  font-size: .95rem;
}

.service-link.spotify {
  border-color: rgba(30, 215, 96, .48);
}

.service-link.spotify i {
  color: #1db954;
}

.service-link.youtube {
  border-color: rgba(255, 0, 51, .38);
}

.service-link.youtube i {
  color: #ff0033;
}

.service-link.apple {
  border-color: rgba(17, 24, 45, .26);
}

.service-link.apple i {
  color: #11182d;
}

.service-link.audiomack {
  border-color: rgba(255, 132, 0, .45);
}

.service-link.audiomack i {
  color: #f28a00;
}

.seed-services {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.listen-label {
  width: 100%;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-align: right;
}

@media (max-width: 920px) {
  .header-note {
    display: none;
  }

  .match-row {
    grid-template-columns: 52px minmax(0,1fr);
  }

  .match-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .service-links,
  .seed-services {
    justify-content: flex-start;
  }

  .listen-label {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .service-link {
    flex: 1 1 calc(50% - 6px);
  }

  .match-actions > .action-button {
    width: 100%;
  }
}


/* V10 mobile vertical preview feed */

.mobile-feed-guide {
  display: none;
}

.feed-visual {
  position: relative;
  width: 56px;
  height: 56px;
  min-width: 56px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--gold), var(--violet));
}

.feed-visual .artwork {
  width: 100%;
  height: 100%;
}

.feed-play-toggle,
.feed-match-badge,
.feed-swipe-hint,
.feed-progress {
  display: none;
}

.preview-feed-card.feed-active {
  border-color: rgba(211,155,50,.72);
}

@media (max-width: 640px) {
  .matches-section {
    padding: 0;
    overflow: hidden;
    background: var(--paper);
  }

  .matches-section > .section-heading {
    margin: 0;
    padding: 15px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  .mobile-feed-guide {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 15px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    background: var(--paper-alt);
    font-size: .68rem;
    font-weight: 800;
  }

  .mobile-feed-guide span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .match-list {
    height: calc(100dvh - 286px);
    min-height: 430px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    background: #0f1425;
  }

  .match-list::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .preview-feed-card {
    position: relative;
    min-height: calc(100dvh - 286px);
    display: flex;
    flex-direction: column;
    gap: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.13);
    background: #0f1425;
    color: white;
  }

  .preview-feed-card:hover,
  .preview-feed-card.is-playing,
  .preview-feed-card.feed-active {
    border-color: transparent;
    background: #0f1425;
  }

  .feed-visual {
    position: relative;
    width: 100%;
    min-width: 0;
    height: min(58dvh, 520px);
    flex: 0 0 auto;
    overflow: hidden;
    background: #141b31;
  }

  .feed-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(15,20,37,.08) 35%, rgba(15,20,37,.88) 100%);
    pointer-events: none;
  }

  .feed-visual .artwork {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    transform: scale(1.01);
  }

  .feed-match-badge {
    position: absolute;
    z-index: 2;
    top: 13px;
    left: 13px;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid rgba(255,255,255,.26);
    color: white;
    background: rgba(17,24,45,.66);
    backdrop-filter: blur(10px);
    font-size: .72rem;
    font-weight: 900;
  }

  .feed-play-toggle {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 50%;
    color: white;
    background: rgba(17,24,45,.62);
    backdrop-filter: blur(12px);
    font-size: 1.25rem;
  }

  .feed-play-toggle i {
    margin: 0;
  }

  .preview-feed-card.is-playing .feed-play-toggle {
    opacity: .18;
  }

  .preview-feed-card.is-playing .feed-play-toggle:hover {
    opacity: 1;
  }

  .feed-swipe-hint {
    position: absolute;
    z-index: 2;
    right: 13px;
    bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.82);
    font-size: .68rem;
    font-weight: 800;
  }

  .feed-progress {
    position: absolute;
    z-index: 4;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    display: block;
    background: rgba(255,255,255,.22);
  }

  .feed-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--gold);
    transition: width .12s linear;
  }

  .preview-feed-card .match-copy {
    padding: 14px 15px 9px;
    color: white;
    background: #0f1425;
  }

  .preview-feed-card .match-copy > strong {
    color: white;
    font-size: 1.16rem;
  }

  .preview-feed-card .match-copy > span {
    color: rgba(255,255,255,.68);
    white-space: normal;
    line-height: 1.35;
  }

  .preview-feed-card .match-score {
    color: var(--gold);
  }

  .preview-feed-card .signal-chip {
    color: rgba(255,255,255,.78);
    border-color: rgba(255,255,255,.15);
    background: rgba(255,255,255,.07);
  }

  .preview-feed-card .match-actions {
    margin-top: auto;
    padding: 8px 15px 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    background: #0f1425;
  }

  .preview-feed-card .match-actions > .action-button {
    display: none;
  }

  .preview-feed-card .service-links {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .preview-feed-card .service-link {
    min-height: 42px;
    color: white;
    border-color: rgba(255,255,255,.18);
    background: rgba(255,255,255,.07);
  }

  .preview-feed-card .service-link.apple i {
    color: white;
  }

  .preview-feed-card .service-link span {
    color: white;
  }

  .player-bar {
    z-index: 55;
  }
}

@media (max-width: 420px) {
  .mobile-feed-guide {
    font-size: .62rem;
  }

  .match-list,
  .preview-feed-card {
    min-height: 400px;
  }

  .feed-visual {
    height: min(54dvh, 460px);
  }
}


/* V11.2 mobile Open in flow */

.mobile-open-in-button {
  display: none;
}

.open-in-backdrop {
  position: fixed;
  inset: 0;
  z-index: 88;
  background: rgba(10, 14, 27, .56);
  backdrop-filter: blur(4px);
}

.open-in-backdrop[hidden] {
  display: none;
}

.open-in-sheet {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 0;
  width: min(520px, 100%);
  max-height: 82dvh;
  overflow-y: auto;
  transform: translate(-50%, 105%);
  border-top: 1px solid var(--line-strong);
  border-radius: 14px 14px 0 0;
  padding: 10px 16px 18px;
  background: var(--paper);
  box-shadow: 0 -20px 50px rgba(17, 24, 45, .22);
  transition: transform .22s ease;
}

.open-in-sheet.open {
  transform: translate(-50%, 0);
}

.open-in-handle {
  width: 46px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: rgba(17, 24, 45, .18);
}

.open-in-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.open-in-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.open-in-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 2px;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: white;
}

.open-in-close i {
  margin: 0;
}

.open-in-track {
  min-width: 0;
  margin: 16px 0;
  padding: 10px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--paper-alt);
}

.open-in-track img {
  width: 54px;
  height: 54px;
  border-radius: 2px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--gold), var(--violet));
}

.open-in-track strong,
.open-in-track span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.open-in-track span {
  margin-top: 4px;
  color: var(--muted);
  font-size: .78rem;
}

.open-in-options {
  display: grid;
  gap: 8px;
}

.open-in-option {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 9px 11px;
  color: var(--navy);
  background: white;
  text-decoration: none;
}

.open-in-option > i:first-child {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  margin: 0;
  font-size: 1.05rem;
}

.open-in-option > i:last-child {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
}

.open-in-option strong,
.open-in-option small {
  display: block;
}

.open-in-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .70rem;
}

.open-in-option.spotify > i:first-child {
  color: #1db954;
}

.open-in-option.youtube > i:first-child {
  color: #ff0033;
}

.open-in-option.audiomack > i:first-child {
  color: #f28a00;
}

.open-in-option.apple > i:first-child {
  color: #11182d;
}

body.open-in-open {
  overflow: hidden;
}

@media (min-width: 641px) {
  .open-in-sheet,
  .open-in-backdrop {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .preview-feed-card .service-links {
    display: none;
  }

  .mobile-open-in-button {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    background: rgba(255,255,255,.09);
    font-size: .80rem;
    font-weight: 900;
  }

  .mobile-open-in-button i {
    margin: 0;
  }
}


/* V12.2: hide the fixed preview player during the mobile swipe feed */

@media (max-width: 640px) {
  body.mobile-feed-active .player-bar {
    display: none !important;
  }

  body.mobile-feed-active .page-shell {
    margin-bottom: 24px;
  }

  body.mobile-feed-active .toast {
    bottom: calc(18px + env(safe-area-inset-bottom));
  }

  body.mobile-feed-active .preview-feed-card .match-actions {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  body.mobile-feed-active .mobile-open-in-button {
    position: relative;
    z-index: 6;
    min-height: 48px;
  }

  body.mobile-feed-active .match-list {
    height: calc(100dvh - 174px);
    min-height: 460px;
  }

  body.mobile-feed-active .preview-feed-card {
    min-height: calc(100dvh - 174px);
  }
}

@media (max-width: 420px) {
  body.mobile-feed-active .match-list,
  body.mobile-feed-active .preview-feed-card {
    min-height: 430px;
  }
}


/* V12.3: Open in is always visible on the active mobile preview */

.feed-open-in-button {
  display: none;
}

@media (max-width: 640px) {
  .feed-open-in-button {
    position: absolute;
    z-index: 5;
    right: 13px;
    bottom: 54px;
    min-height: 42px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 2px;
    color: white;
    background: rgba(17,24,45,.76);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 28px rgba(0,0,0,.24);
    font-size: .76rem;
    font-weight: 900;
  }

  .feed-open-in-button i {
    margin: 0;
  }

  .feed-open-in-button:active {
    transform: scale(.97);
  }

  .preview-feed-card .match-actions {
    padding-top: 5px;
  }

  .mobile-open-in-button {
    display: none !important;
  }
}

@media (max-width: 390px) {
  .feed-open-in-button {
    right: 11px;
    bottom: 50px;
    min-height: 40px;
    padding-inline: 11px;
  }
}


/* V12.4: list is the default mobile results view; swipe feed is optional */

.mobile-view-switch,
.list-open-in-button {
  display: none;
}

.mobile-feed-guide[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .mobile-view-switch {
    min-height: 54px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  .mobile-view-label {
    color: var(--muted);
    font-size: .70rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .07em;
  }

  .mobile-view-options {
    padding: 3px;
    display: grid;
    grid-template-columns: auto auto;
    gap: 3px;
    border: 1px solid var(--line);
    background: var(--paper-alt);
  }

  .match-view-button {
    min-height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: 1px;
    color: var(--muted);
    background: transparent;
    font-size: .70rem;
    font-weight: 900;
    white-space: nowrap;
  }

  .match-view-button i {
    margin: 0;
  }

  .match-view-button.active {
    color: white;
    background: var(--navy);
    box-shadow: 0 5px 14px rgba(17,24,45,.13);
  }

  /* Clean default result list. */
  body.mobile-list-active .matches-section {
    padding: 0;
    overflow: visible;
    background: var(--paper);
  }

  body.mobile-list-active .matches-section > .section-heading {
    margin: 0;
    padding: 15px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  body.mobile-list-active .mobile-feed-guide {
    display: none !important;
  }

  body.mobile-list-active .match-list {
    height: auto;
    min-height: 0;
    padding: 10px;
    overflow: visible;
    scroll-snap-type: none;
    overscroll-behavior: auto;
    background: var(--paper-alt);
  }

  body.mobile-list-active .preview-feed-card {
    min-height: 0;
    padding: 11px;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--text);
    background: white;
    scroll-snap-align: none;
  }

  body.mobile-list-active .preview-feed-card:hover,
  body.mobile-list-active .preview-feed-card.is-playing,
  body.mobile-list-active .preview-feed-card.feed-active {
    border-color: rgba(211,155,50,.58);
    background: #fffaf0;
  }

  body.mobile-list-active .feed-visual {
    width: 64px;
    min-width: 64px;
    height: 64px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--gold), var(--violet));
  }

  body.mobile-list-active .feed-visual::after {
    display: none;
  }

  body.mobile-list-active .feed-visual .artwork {
    width: 64px;
    height: 64px;
    border-radius: 2px;
    object-fit: cover;
    transform: none;
  }

  body.mobile-list-active .feed-play-toggle,
  body.mobile-list-active .feed-match-badge,
  body.mobile-list-active .feed-swipe-hint,
  body.mobile-list-active .feed-progress,
  body.mobile-list-active .feed-open-in-button {
    display: none !important;
  }

  body.mobile-list-active .preview-feed-card .match-copy {
    min-width: 0;
    padding: 1px 0 0;
    color: var(--text);
    background: transparent;
  }

  body.mobile-list-active .preview-feed-card .match-copy > strong {
    color: var(--text);
    font-size: .98rem;
    line-height: 1.25;
    white-space: normal;
  }

  body.mobile-list-active .preview-feed-card .match-copy > span {
    margin-top: 4px;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.35;
    white-space: normal;
  }

  body.mobile-list-active .preview-feed-card .match-score {
    margin-top: 6px;
    color: var(--gold-dark);
    font-size: .72rem;
  }

  body.mobile-list-active .preview-feed-card .match-signals {
    margin-top: 7px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
  }

  body.mobile-list-active .preview-feed-card .signal-chip {
    min-height: 25px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    border: 1px solid var(--line);
    background: var(--paper-alt);
    font-size: .64rem;
  }

  body.mobile-list-active .preview-feed-card .match-actions {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    background: transparent;
  }

  body.mobile-list-active .preview-feed-card .match-actions > .action-button {
    width: 100%;
    min-height: 42px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  body.mobile-list-active .list-open-in-button {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--navy);
    border-radius: 2px;
    color: white;
    background: var(--navy);
    font-size: .76rem;
    font-weight: 900;
  }

  body.mobile-list-active .list-open-in-button i {
    margin: 0;
  }

  body.mobile-list-active .preview-feed-card .service-links {
    display: none !important;
  }

  /* Swipe feed stays available as an optional mode. */
  body.mobile-feed-active .mobile-view-switch {
    border-bottom-color: rgba(255,255,255,.12);
    background: #0f1425;
  }

  body.mobile-feed-active .mobile-view-label {
    color: rgba(255,255,255,.60);
  }

  body.mobile-feed-active .mobile-view-options {
    border-color: rgba(255,255,255,.15);
    background: rgba(255,255,255,.06);
  }

  body.mobile-feed-active .match-view-button {
    color: rgba(255,255,255,.68);
  }

  body.mobile-feed-active .match-view-button.active {
    color: var(--navy);
    background: var(--gold);
  }

  body.mobile-feed-active .list-open-in-button {
    display: none !important;
  }

  body.mobile-feed-active .mobile-feed-guide {
    display: flex;
  }
}

@media (max-width: 390px) {
  .mobile-view-switch {
    padding-inline: 11px;
  }

  .mobile-view-label {
    display: none;
  }

  .mobile-view-options {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .match-view-button {
    padding-inline: 7px;
  }

  body.mobile-list-active .preview-feed-card {
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 10px;
  }

  body.mobile-list-active .feed-visual,
  body.mobile-list-active .feed-visual .artwork {
    width: 58px;
    min-width: 58px;
    height: 58px;
  }
}
