/* The Songbook, in Encore's stage style: artwork lights the room, controls are
   frosted pills, and anything active glows in the pink-to-amber gradient. */

:root {
  --stage: #110e1d;
  --card: #1a1530;
  --card-raised: #231c3d;
  --glass: #ffffff0a;
  --glass-strong: #ffffff14;
  --ink: #f8f1e7;
  --muted: #a8a0c0;
  --faint: #6f6889;
  --line: #ffffff17;
  --line-strong: #ffffff2e;
  --pink: #ff5a92;
  --coral: #ff8a5c;
  --amber: #ffba4a;
  --cyan: #45e0cf;
  --hot: linear-gradient(95deg, var(--pink), var(--coral) 55%, var(--amber));
  --on-hot: #1b0f1c;
  --glow: 0 4px 18px -4px #ff5a92aa;
  --shadow: 0 40px 90px -30px #000;
  --art-opacity: 0.55;
  --grain: 0.07;
  --display: 'Bricolage Grotesque', 'DM Sans', sans-serif;
  --body: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
}
/* A matinee version of the same stage, for the light toggle. */
:root[data-theme='light'] {
  --stage: #f7f2ee;
  --card: #ffffff;
  --card-raised: #fbf7f4;
  --glass: #2a1f4a0a;
  --glass-strong: #2a1f4a14;
  --ink: #1d1530;
  --muted: #5f5778;
  --faint: #8e87a3;
  --line: #2a1f4a1a;
  --line-strong: #2a1f4a33;
  --pink: #e0336f;
  --coral: #e8663a;
  --amber: #c78210;
  --cyan: #0e8f80;
  --on-hot: #fff8f4;
  --glow: 0 4px 18px -6px #e0336f88;
  --shadow: 0 30px 70px -34px #3a2a6060;
  --art-opacity: 0.3;
  --grain: 0.04;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  background: var(--stage);
  color: var(--ink);
  font: 450 15px/1.5 var(--body);
  accent-color: var(--pink);
}
/* The artwork, blown up and blurred, becomes the stage lighting. */
body::before {
  content: '';
  position: absolute;
  z-index: -2;
  inset: -120px 0 auto;
  height: 1150px;
  background:
    radial-gradient(60% 50% at 20% 20%, #ff5a9240, transparent 70%),
    radial-gradient(50% 45% at 85% 10%, #45e0cf26, transparent 70%),
    var(--song-art, none) center / cover;
  filter: blur(80px) saturate(1.7);
  opacity: var(--art-opacity);
  mask-image: linear-gradient(to bottom, #000 25%, transparent 95%);
  pointer-events: none;
}
/* Film grain keeps the dark stage from looking flat. */
body::after {
  content: '';
  position: fixed;
  z-index: -1;
  inset: 0;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}
::selection {
  background: #ff5a9266;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
button:disabled {
  cursor: default;
}
a {
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Small caps labels, as Encore's fact labels. */
.kicker,
.suggestions-label,
.facet legend,
.sort-label,
.artist-label,
.index-head {
  font: 700 11px/1.4 var(--body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.link-button {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.link-button:hover {
  color: var(--ink);
}
/* A frosted pill, the basic Encore control. */
.suggestion,
.chip,
.search,
.filters-toggle,
.load-more,
.sort select,
#prog-select,
.artist-pill {
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(10px);
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s,
    color 0.2s;
}

/* ---- Masthead ---------------------------------------------------------- */
.masthead {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 32px 40px;
}
.masthead-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 700 18px var(--display);
  letter-spacing: -0.02em;
}
.brand .brand-mark {
  width: 34px;
  height: 34px;
}
.masthead-links {
  display: flex;
  gap: 22px;
  align-items: center;
}
.brand span,
.masthead-links a,
#saved-link {
  white-space: nowrap;
}
.masthead-links a,
#saved-link {
  font: 700 14px var(--display);
  text-decoration: none;
  color: var(--ink);
}
.masthead-links a:hover,
#saved-link:hover {
  color: var(--amber);
}
#saved-link[aria-pressed='true'] {
  color: var(--pink);
}
#saved-count {
  margin-left: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--glass-strong);
  color: var(--muted);
  font: 700 11px var(--body);
}
.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -6px -8px -6px -6px;
  border-radius: 50%;
  color: var(--muted);
}
.theme-toggle:hover {
  background: var(--glass-strong);
  color: var(--ink);
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
}
/* Dark is the default stage: offer the sun there, the moon in light. */
.theme-toggle .moon,
:root[data-theme='light'] .theme-toggle .sun {
  display: none;
}
:root[data-theme='light'] .theme-toggle .moon {
  display: block;
}
.masthead-title {
  position: relative;
  max-width: 800px;
  padding-top: clamp(30px, 6vw, 64px);
}
/* "Now playing"-style kicker with Encore's four-bar equalizer. */
.kicker {
  display: inline-block;
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--amber);
  background:
    linear-gradient(var(--amber), var(--amber)) 0 100% / 3px 45% no-repeat,
    linear-gradient(var(--coral), var(--coral)) 4px 100% / 3px 90% no-repeat,
    linear-gradient(var(--pink), var(--pink)) 8px 100% / 3px 60% no-repeat,
    linear-gradient(var(--amber), var(--amber)) 12px 100% / 3px 30% no-repeat;
}
.masthead h1 {
  margin: 0;
  font: 800 clamp(44px, 7vw, 88px) / 0.95 var(--display);
  letter-spacing: -0.045em;
  text-wrap: balance;
  text-shadow: 0 6px 40px #0008;
}
.masthead h1 em {
  font-style: normal;
  background: var(--hot);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
.lede {
  margin: 20px 0 0;
  max-width: 540px;
  font-size: 17px;
  color: var(--muted);
  text-wrap: pretty;
}
/* A glowing chord chart hangs over the stage. */
.leadsheet {
  position: absolute;
  right: 32px;
  top: 118px;
  width: min(380px, 32vw);
  height: 150px;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 8px;
  font: 800 44px/1 var(--display);
  letter-spacing: -0.03em;
  color: var(--ink);
  transform: rotate(-2.5deg);
  background:
    linear-gradient(90deg, var(--line-strong) 0 1.5px, transparent 1.5px) 25% 64px / 25% 49px
      repeat-x,
    repeating-linear-gradient(to bottom, var(--line-strong) 0 1px, transparent 1px 12px) 0 64px /
      100% 49px no-repeat;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  text-shadow: 0 0 24px #ff5a9255;
}
.leadsheet span:nth-child(2) {
  background: var(--hot);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.search {
  background: color-mix(in srgb, var(--stage) 55%, transparent);
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 780px;
  margin-top: 34px;
  padding: 0 20px;
  height: 64px;
  border-radius: 999px;
  box-shadow: 0 20px 50px -20px #0008;
}
.search:focus-within {
  border-color: #ff5a9299;
  box-shadow: 0 0 0 3px #ff5a9226;
}
.search svg {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--muted);
}
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: 500 18px var(--body);
}
.search input::placeholder {
  color: var(--muted);
}
.search kbd {
  font: 700 12px/1 var(--body);
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
}
.suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  max-width: 780px;
}
.suggestions-label {
  margin-right: 4px;
}
.suggestion {
  background: color-mix(in srgb, var(--stage) 45%, transparent);
  padding: 7px 14px;
  border-radius: 999px;
  font: 600 13px var(--body);
  color: var(--muted);
}
.suggestion:hover {
  border-color: #ff5a9280;
  background: #ff5a921f;
  color: var(--ink);
  transform: translateY(-1px);
}

/* ---- On your stand ------------------------------------------------------- */
.stand,
.shelf,
.workspace,
.colophon {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}
.stand h2,
.shelf h2,
.filters h2 {
  margin: 0;
  font: 800 28px/1.1 var(--display);
  letter-spacing: -0.035em;
}
.stand {
  margin-bottom: 44px;
}
.stand ol {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stand-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(var(--card-raised), var(--card));
  box-shadow: inset 0 1px #ffffff14;
  text-decoration: none;
  overflow: hidden;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.stand-card:hover {
  border-color: #ff5a9280;
  transform: translateY(-2px);
}
.stand-card img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 20px -8px #000c;
}
.stand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.stand-text b,
.stand-text small {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.stand-text b {
  font: 700 15px var(--display);
}
.stand-text small {
  color: var(--muted);
  font-size: 13px;
}
.stand-text .stand-where {
  margin-top: 4px;
  font-weight: 700;
  font-size: 12px;
  color: var(--amber);
}
.stand-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--line);
}
.stand-progress::after {
  content: '';
  display: block;
  height: 100%;
  width: calc(var(--progress) * 100%);
  background: var(--hot);
  box-shadow: 0 0 10px #ff5a92;
}

/* ---- Progression shelf --------------------------------------------------- */
.shelf {
  margin-bottom: 52px;
}
.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.shelf-head p {
  margin: 0;
  color: var(--muted);
  max-width: 460px;
}
.shelf-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.shelf-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 18px 18px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(80% 60% at 50% -20%, #ffba4a1c, transparent 70%),
    linear-gradient(var(--card-raised), var(--card));
  box-shadow: inset 0 1px #ffffff14;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.shelf-card:hover {
  border-color: #ff5a9280;
  transform: translateY(-2px);
}
.shelf-card .numerals {
  font: 800 28px/1 var(--display);
  letter-spacing: -0.02em;
  word-spacing: 0.1em;
  background: var(--hot);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.shelf-card b {
  font: 700 15px/1.3 var(--display);
}
.shelf-card b::first-letter {
  text-transform: uppercase;
}
.shelf-card .flavor {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shelf-card small {
  margin-top: auto;
  padding-top: 6px;
  font-weight: 700;
  font-size: 12px;
  color: var(--faint);
}

/* ---- Workspace --------------------------------------------------------- */
.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
/* Both columns sit on Encore's spotlit sheet. */
.filters,
.index {
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(70% 40% at 50% -8%, #ffba4a14, transparent 70%),
    linear-gradient(var(--card), color-mix(in srgb, var(--card) 80%, var(--stage)));
  box-shadow:
    var(--shadow),
    inset 0 1px #ffffff14;
}
.filters {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  padding: 20px 20px 24px;
}
.filters-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.filters h2 {
  font-size: 22px;
}
.close-filters,
.show-results,
.filters-toggle {
  display: none;
}
.facet {
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.facet legend {
  display: contents;
}
.facet > legend + * {
  margin-top: 12px;
}
.facet-hint {
  float: right;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.chips,
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font: 600 13px var(--body);
}
.chip:hover:not(:disabled) {
  border-color: #ff5a9280;
  background: #ff5a921f;
}
/* Anything switched on glows like Encore's active tab. */
.chip[aria-pressed='true'],
.chord-key[aria-pressed='true'],
.segmented [aria-checked='true'],
.shuffle,
.active-chip {
  border-color: transparent;
  background: var(--hot);
  color: var(--on-hot);
  box-shadow: var(--glow);
}
.chip:disabled {
  opacity: 0.35;
}
.chip .count,
.chip .chip-extra {
  font-size: 11px;
  font-weight: 700;
  color: var(--faint);
}
.chip[aria-pressed='true'] .count,
.chip[aria-pressed='true'] .chip-extra {
  color: inherit;
  opacity: 0.7;
}
.chord-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  margin-top: 12px;
}
.chord-key {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  font: 700 15px/1 var(--display);
  letter-spacing: -0.01em;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.chord-key.minor {
  background: var(--glass);
  color: var(--muted);
}
.chord-key:nth-child(n + 7):nth-child(-n + 12) {
  margin-bottom: 6px;
}
.chord-key:hover {
  border-color: #ff5a9280;
  color: var(--ink);
}
.chord-key[aria-pressed='true'],
.chord-key.minor[aria-pressed='true'] {
  background: var(--hot);
  color: var(--on-hot);
}
.chord-options {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}
.switch {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}
.switch input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: #0000004d;
  box-shadow: inset 0 0 0 1px var(--line);
}
:root[data-theme='light'] .segmented {
  background: var(--glass-strong);
}
.segmented button {
  padding: 7px 4px;
  border-radius: 999px;
  font: 700 12px var(--display);
  color: var(--muted);
}
.segmented button:hover {
  color: var(--ink);
}
.segmented [aria-checked='true'],
.segmented [aria-checked='true']:hover {
  color: var(--on-hot);
}
.circle svg {
  display: block;
  width: 100%;
  max-width: 250px;
  margin: 0 auto;
  overflow: visible;
}
.wedge {
  cursor: pointer;
  outline: none;
}
.wedge path {
  fill: var(--pink);
  fill-opacity: var(--weight);
  stroke: var(--card);
  stroke-width: 2;
  transition: fill-opacity 0.15s;
}
.wedge:hover path,
.wedge:focus-visible path {
  fill-opacity: 0.85;
}
.wedge:focus-visible path {
  stroke: var(--amber);
}
.wedge.selected path {
  fill: var(--amber);
  fill-opacity: 1;
  filter: drop-shadow(0 0 8px #ffba4a88);
}
.wedge text {
  fill: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.wedge.selected text {
  fill: var(--on-hot);
}
.wedge.empty text {
  fill-opacity: 0.3;
}
.circle-center {
  font: 800 22px var(--display);
  letter-spacing: -0.02em;
  fill: var(--muted);
  text-anchor: middle;
  dominant-baseline: central;
}
#prog-select,
.sort select {
  padding: 9px 12px;
  border-radius: 12px;
  font: 500 14px var(--body);
  color: var(--ink);
}
#prog-select {
  width: 100%;
}
select option {
  background: var(--card-raised);
  color: var(--ink);
}

/* ---- Index ----------------------------------------------------------------- */
.index {
  min-width: 0;
  padding: 22px 22px 26px;
  scroll-margin-top: 12px;
}
.index-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
#result-count {
  margin: 0;
  font: 800 28px/1.1 var(--display);
  letter-spacing: -0.035em;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sort {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shuffle {
  padding: 10px 18px;
  border-radius: 999px;
  font: 700 14px var(--display);
  transition: transform 0.2s;
}
.shuffle::before {
  content: '⚄ ';
}
.shuffle:hover:not(:disabled) {
  transform: translateY(-1px);
}
.shuffle:disabled {
  opacity: 0.4;
  box-shadow: none;
}
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.active-filters:empty {
  display: none;
}
.active-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 5px 9px 5px 13px;
  border-radius: 999px;
  font: 700 13px var(--body);
}
.active-chip span:first-child::first-letter {
  text-transform: uppercase;
}
.active-chip .x {
  opacity: 0.6;
  font-size: 15px;
  line-height: 1;
}
.active-chip:hover {
  filter: brightness(1.08);
}
.artist-matches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 16px;
}
.artist-label {
  margin-right: 4px;
}
.artist-pill {
  display: inline-grid;
  grid-template-columns: 32px auto;
  column-gap: 10px;
  align-items: center;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  text-decoration: none;
}
.artist-pill:hover {
  border-color: #ff5a9280;
  background: #ff5a921f;
}
.artist-pill img {
  grid-row: span 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.artist-pill b {
  font: 700 13px/1.1 var(--display);
}
.artist-pill small {
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
}

.index-head,
.row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.25fr) 86px 44px 44px minmax(0, 1fr) 34px;
  column-gap: 16px;
}
.index-head {
  margin-top: 22px;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.row {
  position: relative;
  grid-template-rows: auto auto;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  border-radius: 14px;
  transition: background 0.15s;
}
.row:last-child {
  border-bottom: 0;
}
body:not(.ready) .row {
  grid-template-columns: 48px minmax(0, 1fr);
}
.row:hover {
  background: var(--glass);
}
.row.fits::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.row-link {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 16px;
  align-items: start;
  align-self: stretch;
  text-decoration: none;
}
.art {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--card-raised);
  box-shadow:
    0 10px 20px -10px #000c,
    0 0 0 1px #ffffff14;
}
.row-title {
  min-width: 0;
  padding-top: 3px;
}
.row-title b {
  display: block;
  font: 700 17px/1.2 var(--display);
  letter-spacing: -0.015em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.row-link:hover b {
  color: var(--amber);
}
.row-sub {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  color: var(--muted);
  position: relative;
}
.row-artist {
  text-decoration: none;
}
.row-artist:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #ff5a9266;
  text-underline-offset: 3px;
}
.row-year {
  color: var(--faint);
}
body:not(.ready) .row-artist {
  grid-column: 2;
  grid-row: 2;
  font-size: 13px;
  color: var(--muted);
}
.row-meta {
  display: contents;
}
.cell {
  grid-row: 1 / 3;
}
.key {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.key b {
  font: 800 19px/1 var(--display);
  letter-spacing: -0.02em;
}
.key small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.key .shifted {
  color: var(--amber);
  letter-spacing: 0.02em;
  text-transform: none;
  margin-top: 2px;
}
.bpm,
.meter {
  font: 600 14px var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.chords {
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.chord-strip {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  align-items: baseline;
  gap: 2px 12px;
  min-width: 0;
}
.chord {
  font: normal 700 17px/1.2 var(--display);
  letter-spacing: -0.01em;
}
.chord.unknown {
  color: var(--coral);
  text-decoration: underline wavy;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.chord.known {
  color: var(--cyan);
}
.chord-strip .more {
  font-size: 11px;
  font-weight: 700;
  color: var(--faint);
}
.fit {
  flex: none;
  min-width: 48px;
  padding: 3px 8px;
  border-radius: 999px;
  font: 800 12px var(--display);
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: var(--glass-strong);
  color: var(--muted);
}
.fit.full {
  background: color-mix(in srgb, var(--cyan) 18%, transparent);
  color: var(--cyan);
}
.fit.near {
  background: color-mix(in srgb, var(--amber) 18%, transparent);
  color: var(--amber);
}
.save {
  grid-row: 1 / 3;
  grid-column: 7;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 19px;
  color: var(--faint);
  transition:
    background 0.2s,
    color 0.2s;
}
.save:hover {
  background: var(--glass-strong);
  color: var(--ink);
}
.save[aria-pressed='true'] {
  color: var(--amber);
  text-shadow: 0 0 12px #ffba4a99;
}
.empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 48px 8px;
  text-align: center;
  color: var(--muted);
}
.empty b {
  font: 800 26px var(--display);
  letter-spacing: -0.03em;
  color: var(--ink);
}
#library-status {
  color: var(--muted);
  margin: 16px 8px;
}
#library-status:empty {
  display: none;
}
.load-more {
  display: block;
  margin: 24px auto 0;
  padding: 10px 22px;
  border-radius: 999px;
  font: 700 14px var(--display);
}
.load-more:hover {
  border-color: #ff5a9280;
  background: #ff5a921f;
}
.catalog-pagination {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
}
.catalog-pagination a:hover {
  color: var(--ink);
}
.catalog-pagination span:first-child {
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.colophon {
  margin-top: 60px;
  padding-bottom: 40px;
}
.colophon p {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
}

/* ---- Narrower screens ---------------------------------------------------- */
@media (max-width: 1100px) {
  .shelf-cards,
  .stand ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workspace {
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 20px;
  }
  .index-head,
  .row {
    grid-template-columns: 48px minmax(0, 1fr) 80px 40px 40px minmax(0, 0.8fr) 34px;
    column-gap: 12px;
  }
  .leadsheet {
    display: none;
  }
}
@media (max-width: 900px) {
  .masthead,
  .stand,
  .shelf,
  .workspace,
  .colophon {
    padding-left: 16px;
    padding-right: 16px;
  }
  .workspace {
    display: block;
  }
  .filters {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    z-index: 20;
    max-height: 86vh;
    padding: 18px 16px 88px;
    border-radius: 24px 24px 0 0;
    background: var(--card);
    box-shadow: 0 -20px 60px rgb(0 0 0 / 50%);
  }
  .filters-open .filters {
    display: block;
  }
  .filters-open::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 10;
    opacity: 1;
    background: rgb(0 0 0 / 55%);
    mix-blend-mode: normal;
  }
  .filters-head {
    gap: 16px;
  }
  .filters-head h2 {
    margin-right: auto;
  }
  .close-filters {
    display: block;
    font-size: 18px;
    width: 36px;
    height: 36px;
    color: var(--muted);
  }
  .show-results {
    display: block;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 21;
    padding: 14px;
    border-radius: 999px;
    background: var(--hot);
    color: var(--on-hot);
    box-shadow: var(--glow);
    font: 700 15px var(--display);
  }
  .filters-toggle {
    display: inline-flex;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font: 700 14px var(--display);
  }
  #filter-count:not(:empty) {
    padding: 0 7px;
    border-radius: 999px;
    background: var(--hot);
    color: var(--on-hot);
    font: 800 12px/18px var(--display);
  }
  .circle svg {
    max-width: 280px;
  }
  .index {
    padding: 16px 14px 20px;
    border-radius: 20px;
  }
  .index-head {
    display: none;
  }
  .rows {
    margin-top: 12px;
  }
  .row,
  body:not(.ready) .row {
    grid-template-columns: 48px minmax(0, 1fr) 34px;
    grid-template-rows: auto auto auto auto;
    column-gap: 12px;
    row-gap: 2px;
    padding: 12px 4px;
    border-radius: 0;
  }
  .row:hover {
    background: none;
  }
  .row.fits::before {
    left: -8px;
  }
  .row-link {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    column-gap: 12px;
  }
  .row-meta {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 6px;
  }
  .cell {
    grid-row: auto;
  }
  .key {
    flex-direction: row;
    align-items: baseline;
    gap: 5px;
  }
  .key b {
    font-size: 17px;
  }
  .bpm::after {
    content: ' bpm';
    font-size: 11px;
  }
  .bpm,
  .meter {
    font-size: 13px;
  }
  .chords {
    grid-column: 2;
    grid-row: 4;
    margin-top: 2px;
  }
  .chord {
    font-size: 16px;
  }
  .save {
    grid-column: 3;
    grid-row: 1 / 3;
  }
  .index-toolbar {
    align-items: flex-end;
  }
  #result-count {
    font-size: 24px;
  }
  .toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .sort {
    margin-left: auto;
  }
  .sort-label {
    display: none;
  }
  .masthead-bar {
    padding-bottom: 14px;
  }
  .masthead-links {
    gap: 14px;
  }
  .brand {
    font-size: 16px;
  }
  .search {
    height: 56px;
    margin-top: 26px;
  }
  .search kbd {
    display: none;
  }
  .lede {
    font-size: 16px;
  }
  .stand ol {
    grid-template-columns: 1fr;
  }
  .shelf-cards {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 16px;
    padding-bottom: 6px;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    scrollbar-width: none;
  }
  .shelf-card {
    flex: 0 0 74%;
    scroll-snap-align: start;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 400px) {
  /* Too narrow for the wordmark beside the links; the logo still goes home. */
  .brand span {
    display: none;
  }
}
