@font-face {
  font-display: swap;
  font-family: "HelveticaNeuePV";
  font-style: normal;
  font-weight: 300;
  src: url("/static/fonts/HelveticaNeue-Light.otf") format("opentype");
}

@font-face {
  font-display: swap;
  font-family: "HelveticaNeuePV";
  font-style: normal;
  font-weight: 400;
  src: url("/static/fonts/HelveticaNeue-Roman.otf") format("opentype");
}

@font-face {
  font-display: swap;
  font-family: "HelveticaNeuePV";
  font-style: normal;
  font-weight: 500;
  src: url("/static/fonts/HelveticaNeue-Medium.otf") format("opentype");
}

@font-face {
  font-display: swap;
  font-family: "HelveticaNeuePV";
  font-style: normal;
  font-weight: 800;
  src: url("/static/fonts/HelveticaNeue-Heavy.otf") format("opentype");
}

:root {
  color-scheme: light;
  --background: #f2f0f5;
  --dark: #1b0333;
  --text: #1b0333;
  --muted: #6a6872;
  --soft: #5b5170;
  --white: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8f6fb;
  --line: rgba(27, 3, 51, 0.12);
  --line-strong: rgba(27, 3, 51, 0.2);
  --primary: #330761;
  --medium-blue: #5c08b1;
  --blue-violet: #6a3fe3;
  --blue-violet-2: #7827e9;
  --highlight: #d5ccff;
  --light-highlight: #e5e0ff;
  --purple-90: #e7cefc;
  --amber: #8d5d00;
  --amber-bg: #fff5d6;
  --red: #9c1d32;
  --red-bg: #ffe8ed;
  --success: #146a55;
  --success-bg: #dcfff4;
  --shadow: 0 14px 44px rgba(27, 3, 51, 0.14);
  --shadow-soft: 0 6px 22px rgba(27, 3, 51, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  background: var(--background);
  color: var(--text);
  font-family: "HelveticaNeuePV", Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  background-image:
    url("/static/white-falling-notes.svg"),
    linear-gradient(180deg, rgba(51, 7, 97, 0.96), rgba(92, 8, 177, 0.93));
  background-position: center top, center top;
  background-repeat: repeat-x, no-repeat;
  background-size: 820px auto, 100% 100%;
  content: "";
  height: 300px;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 0;
}

a {
  color: var(--blue-violet);
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 24px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 32px;
  box-shadow: 0 3px 32px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 8px 10px;
}

@supports (backdrop-filter: blur(18px)) {
  .topbar {
    backdrop-filter: blur(18px);
  }
}

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

.topbar form {
  margin: 0;
}

.brand {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 28px;
  color: var(--dark);
  display: flex;
  gap: 10px;
  min-width: 0;
  padding: 4px 12px 4px 4px;
}

.brand:hover {
  border-color: var(--highlight);
}

.brand img {
  border-radius: 14px;
  flex: 0 0 auto;
  height: 48px;
  width: 48px;
}

.brand-title {
  color: var(--dark);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.15;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.2;
  margin-top: 2px;
}

.button,
button {
  align-items: center;
  background: linear-gradient(180deg, var(--blue-violet-2), var(--medium-blue));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(51, 7, 97, 0.18);
  color: var(--white);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 500;
  justify-content: center;
  letter-spacing: 0;
  min-height: 46px;
  padding: 0 20px;
  text-decoration: none;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.button:hover,
button:hover {
  box-shadow: 0 10px 26px rgba(51, 7, 97, 0.22);
  color: var(--white);
  transform: translateY(-1px);
}

.button.secondary,
button.secondary {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(27, 3, 51, 0.12);
  box-shadow: none;
  color: var(--dark);
}

.button.secondary:hover,
button.secondary:hover {
  background: var(--light-highlight);
  color: var(--primary);
}

.google-button {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  color: var(--dark);
  gap: 10px;
  margin-top: 24px;
  width: 100%;
}

.google-button:hover {
  background: var(--panel-2);
  color: var(--dark);
}

.google-mark {
  align-items: center;
  border: 1px solid rgba(15, 17, 23, 0.12);
  border-radius: 999px;
  color: #4285f4;
  display: inline-flex;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.auth-divider {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.84rem;
  gap: 12px;
  margin-top: 20px;
}

.auth-divider::before,
.auth-divider::after {
  background: var(--line);
  content: "";
  flex: 1;
  height: 1px;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 16px;
  box-shadow: var(--shadow);
  max-width: 100%;
}

.panel.pad {
  padding: 28px;
}

.eyebrow {
  color: var(--blue-violet);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  color: var(--dark);
  font-size: 3.5rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.98;
  margin: 12px 0 16px;
  max-width: 700px;
  overflow-wrap: anywhere;
}

h2 {
  color: var(--dark);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  margin: 0 0 16px;
}

p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  overflow-wrap: anywhere;
}

.login-form,
.code-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

label {
  color: var(--soft);
  display: grid;
  font-size: 0.9rem;
  font-weight: 500;
  gap: 7px;
}

input,
select {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--dark);
  font: inherit;
  height: 50px;
  outline: none;
  padding: 0 14px;
  width: 100%;
}

input::placeholder {
  color: rgba(106, 104, 114, 0.68);
}

input:focus,
select:focus {
  border-color: var(--blue-violet);
  box-shadow: 0 0 0 4px rgba(106, 63, 227, 0.14);
}

select {
  appearance: none;
}

.link-code-entry {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  height: 54px;
  overflow: hidden;
}

.link-code-prefix {
  align-items: center;
  align-self: stretch;
  background: var(--light-highlight);
  border-right: 1px solid var(--line);
  color: var(--primary);
  display: inline-flex;
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0 14px;
}

.link-code-entry input {
  border: 0;
  border-radius: 0;
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 1.2rem;
  font-weight: 800;
  height: 100%;
  letter-spacing: 0;
  min-width: 0;
}

.link-code-entry:focus-within {
  border-color: var(--blue-violet);
  box-shadow: 0 0 0 4px rgba(106, 63, 227, 0.14);
}

.link-code-entry input:focus {
  box-shadow: none;
}

.status {
  border-radius: 12px;
  color: var(--soft);
  display: none;
  font-size: 0.92rem;
  margin-top: 14px;
  padding: 12px 14px;
}

.status.visible {
  display: block;
}

.status.ok {
  background: var(--success-bg);
  color: var(--success);
}

.status.error {
  background: var(--red-bg);
  color: var(--red);
}

.hidden {
  display: none;
}

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.metric {
  background: linear-gradient(180deg, var(--panel-2), var(--white));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.metric-value {
  color: var(--dark);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
}

.metric-label {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.dashboard-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.dashboard-email {
  color: var(--muted);
  font-size: 0.94rem;
  margin-top: 4px;
}

.dashboard-provider {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 4px;
  text-transform: capitalize;
}

.score-list {
  display: grid;
  gap: 10px;
}

.score-row {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.4fr) 0.7fr 0.9fr 0.8fr;
  padding: 14px 16px;
}

.pagination {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr;
  margin-top: 18px;
}

.pagination > :last-child {
  justify-self: end;
}

.score-piece {
  color: var(--dark);
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-sub,
.score-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.score-main {
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 800;
}

.profiles {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
}

.profile-line {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.empty {
  background: var(--light-highlight);
  border: 1px solid rgba(106, 63, 227, 0.2);
  border-radius: 12px;
  padding: 18px;
}

.headset-connect {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(229, 224, 255, 0.72)),
    var(--light-highlight);
  padding: 22px;
}

.headset-connect p {
  max-width: 720px;
}

.notice {
  background: var(--amber-bg);
  border: 1px solid rgba(141, 93, 0, 0.18);
  border-radius: 12px;
  color: var(--amber);
  margin-top: 18px;
  padding: 14px;
}

.link-shell {
  max-width: 760px;
}

.link-panel {
  margin: 0 auto;
  max-width: 680px;
  width: 100%;
}

.link-panel h1 {
  font-size: 3.2rem;
}

.link-profile-button {
  margin-top: 24px;
}

.library-shell {
  max-width: 1240px;
}

.library-panel {
  overflow: hidden;
}

.library-hero {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.library-title {
  margin-bottom: 8px;
}

.library-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
}

.library-stats div {
  background: linear-gradient(180deg, var(--panel-2), var(--white));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}

.library-stats strong,
.library-stats span {
  display: block;
}

.library-stats strong {
  color: var(--dark);
  font-size: 1.28rem;
  line-height: 1.1;
}

.library-stats span {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 3px;
}

.library-tabs {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
  padding: 4px;
}

.library-tabs a {
  align-items: center;
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  text-decoration: none;
}

.library-tabs a.active {
  background: var(--white);
  box-shadow: var(--shadow-soft);
  color: var(--primary);
}

.library-control-bar {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 0.8fr);
  margin-bottom: 22px;
  padding: 14px;
}

.library-search span,
.library-selects label,
.artist-sort-bar label {
  color: var(--soft);
  font-size: 0.82rem;
}

.library-selects {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(120px, 1fr) minmax(150px, 1fr) auto;
}

.library-selects.compact {
  grid-template-columns: minmax(160px, 1fr) auto;
}

.section-heading-row {
  align-items: baseline;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 22px 0 12px;
}

.section-heading-row h2 {
  margin: 0;
}

.library-summary {
  color: var(--muted);
  font-size: 0.9rem;
}

.text-link,
.inline-link,
.back-link {
  color: var(--blue-violet);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover,
.inline-link:hover,
.back-link:hover {
  color: var(--primary);
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
}

.artist-rail {
  display: grid;
  gap: 12px;
  grid-auto-columns: minmax(170px, 190px);
  grid-auto-flow: column;
  margin-left: -4px;
  margin-right: -4px;
  overflow-x: auto;
  padding: 4px 4px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.artist-rail::-webkit-scrollbar {
  display: none;
}

.artist-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
}

.artist-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--dark);
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  scroll-snap-align: start;
  text-decoration: none;
}

.artist-card:hover {
  border-color: rgba(106, 63, 227, 0.34);
  color: var(--dark);
}

.artist-card-body {
  min-width: 0;
}

.artist-card-name {
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artist-card-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 6px;
  margin-top: 3px;
}

.artist-card-meta span::before {
  content: "·";
  margin-right: 6px;
}

.music-list {
  display: grid;
  gap: 10px;
}

.music-row {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  min-height: 78px;
  padding: 10px 12px;
}

.music-art {
  align-items: center;
  aspect-ratio: 1;
  background:
    linear-gradient(180deg, rgba(120, 39, 233, 0.88), rgba(51, 7, 97, 0.95)),
    var(--primary);
  border-radius: 12px;
  color: var(--white);
  display: flex;
  font-size: 1.3rem;
  font-weight: 800;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  width: 54px;
}

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

.music-art.artist {
  border-radius: 999px;
}

.music-art.hero-art {
  width: 132px;
}

.music-main {
  min-width: 0;
}

.music-title {
  color: var(--dark);
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-subline {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.86rem;
  gap: 6px;
  min-width: 0;
}

.music-subline > span + span::before,
.music-subline > a + span::before {
  content: "·";
  margin-right: 6px;
}

.music-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.music-meta span,
.tier-pill,
.score-pill,
.artist-stat-row span {
  background: var(--white);
  border: 1px solid rgba(27, 3, 51, 0.09);
  border-radius: 999px;
  color: var(--soft);
  display: inline-flex;
  font-size: 0.76rem;
  line-height: 1;
  padding: 6px 8px;
}

.music-side {
  align-items: center;
  display: flex;
  justify-content: flex-end;
}

.score-pill {
  background: linear-gradient(180deg, var(--blue-violet-2), var(--medium-blue));
  border: 0;
  color: var(--white);
  font-weight: 800;
  min-width: 46px;
  justify-content: center;
}

.artist-hero {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(229, 224, 255, 0.82)),
    var(--light-highlight);
  border: 1px solid rgba(106, 63, 227, 0.2);
  border-radius: 18px;
  display: grid;
  gap: 20px;
  grid-template-columns: auto minmax(0, 1fr);
  margin-bottom: 18px;
  padding: 18px;
}

.artist-hero-copy {
  min-width: 0;
}

.artist-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.artist-sort-bar {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 260px) max-content;
  margin: 18px 0 6px;
}

.artist-sort-bar button {
  min-width: 150px;
}

@media (max-width: 880px) {
  body::before {
    height: 260px;
  }

  .shell {
    padding: 18px;
  }

  .topbar {
    align-items: stretch;
    border-radius: 24px;
    flex-direction: column;
  }

  .topbar-actions {
    align-items: stretch;
  }

  .topbar-actions .button,
  .topbar-actions form,
  .topbar-actions button {
    width: 100%;
  }

  .library-shell .topbar-actions {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .library-shell .topbar-actions .button,
  .library-shell .topbar-actions form,
  .library-shell .topbar-actions button {
    min-width: 0;
  }

  .library-shell .topbar-actions .button,
  .library-shell .topbar-actions button {
    font-size: 0.95rem;
    padding-left: 10px;
    padding-right: 10px;
  }

  .dashboard-header .button {
    width: 100%;
  }

  .layout,
  .metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-header,
  .library-control-bar,
  .library-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .library-control-bar,
  .library-selects {
    grid-template-columns: 1fr;
  }

  .library-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .artist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  h1,
  .link-panel h1 {
    font-size: 2.7rem;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }

  .shell {
    padding: 14px;
  }

  .brand {
    padding-right: 6px;
  }

  .brand img {
    height: 42px;
    width: 42px;
  }

  .button,
  button {
    min-height: 44px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .panel.pad {
    padding: 18px;
  }

  .library-panel.panel.pad {
    padding: 14px;
  }

  h1,
  .link-panel h1 {
    font-size: 2.2rem;
    line-height: 1.04;
  }

  .library-title {
    font-size: 2rem;
  }

  .library-stats {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .library-stats div:last-child {
    grid-column: 1 / -1;
  }

  .library-stats div {
    padding: 10px;
  }

  .library-shell .topbar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-shell .topbar-actions form {
    grid-column: 1 / -1;
  }

  .library-control-bar {
    border-radius: 14px;
    padding: 10px;
  }

  .library-selects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-selects.compact {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .library-selects button {
    grid-column: 1 / -1;
  }

  .library-selects.compact button {
    grid-column: auto;
  }

  .artist-rail {
    grid-auto-columns: minmax(132px, 42%);
  }

  .artist-grid {
    gap: 10px;
  }

  .artist-card {
    padding: 10px;
  }

  .music-row {
    gap: 10px;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    min-height: 68px;
    padding: 9px 10px;
  }

  .music-art {
    border-radius: 10px;
    width: 46px;
  }

  .music-art.artist {
    border-radius: 999px;
  }

  .music-art.hero-art {
    width: 104px;
  }

  .music-meta {
    gap: 5px;
    margin-top: 5px;
  }

  .music-meta span,
  .tier-pill,
  .score-pill,
  .artist-stat-row span {
    font-size: 0.72rem;
    padding: 5px 7px;
  }

  .music-title,
  .artist-card-name {
    font-size: 0.96rem;
  }

  .music-subline {
    font-size: 0.8rem;
  }

  .artist-hero {
    align-items: flex-start;
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .artist-sort-bar {
    grid-template-columns: 1fr;
  }

  .artist-sort-bar button {
    width: 100%;
  }

  .pagination {
    grid-template-columns: 1fr;
  }

  .pagination > :last-child {
    justify-self: stretch;
  }
}
