.workspace .results,
.workspace .saved-moments,
dialog:is(#catalog-dialog, #moment-dialog, #youtube-dialog, #credits-dialog) {
  --edition-rule: #50514d;
  --edition-paper: #f4efe6;
  --edition-quiet: #c3c2bb;
  --edition-mark: #ff8054;
}

.workspace .results {
  border-top: 1px solid var(--edition-rule);
  padding-block-start: clamp(1.5rem, 3.4vw, 3.2rem);
}
.results .result-heading { align-items: baseline; gap: .7rem; }
.results .result-heading .icon { align-self: center; color: var(--edition-mark); }
.results .result-heading h2 {
  font-family: var(--sans);
  font-size: clamp(2.1rem, 4.5vw, 4.2rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.047em;
  overflow-wrap: anywhere;
}
.results .result-context {
  margin-top: .78rem;
  color: var(--edition-quiet);
  max-width: 84ch;
  line-height: 1.66;
}
.workspace .result-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
.result-picks {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--edition-rule);
}
.result-pick-row {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: .15rem;
  border-bottom: 1px solid var(--edition-rule);
}
.result-pick-row:has(.result-pick-select[aria-pressed=true]) {
  background: #2b2926;
  box-shadow: inset 3px 0 var(--edition-mark);
}
.result-pick-row button {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--edition-paper);
  font: inherit;
}
.result-pick-select {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .57rem .8rem;
  text-align: start;
}
.result-pick-select .result-cover {
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
}
.result-pick-copy { min-width: 0; display: grid; gap: .17rem; }
.result-pick-title {
  color: inherit;
  font-size: clamp(1.35rem, 1.8vw, 1.8rem);
  font-weight: 400;
  line-height: 1.04;
  overflow-wrap: anywhere;
}
.result-pick-artist {
  color: var(--edition-quiet);
  font-size: .94rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.result-pick-play {
  flex: 0 0 2.75rem;
  min-height: 2.75rem;
  align-self: center;
  display: grid;
  place-items: center;
}
.result-pick-play .play-symbol { font-size: .84rem; }
.result-pick-row .result-pick-play:is(:hover,.is-playing) { color: var(--edition-mark); }
.result-pick-select:is(:hover,:focus-visible) .result-pick-title { text-decoration: underline; text-underline-offset: .17em; }
.result-pick-row button:focus-visible { outline: 2px solid var(--edition-mark); outline-offset: -3px; }
.workspace .result-list.has-result-picker { row-gap: 1.4rem; }
.has-result-picker .result-card[hidden] { display: none; }
.workspace .has-result-picker .result-card {
  display: flex;
  padding-top: 1rem;
  border-top-color: var(--edition-mark);
}
.workspace .result-card {
  --pair-line: var(--edition-rule);
  --pair-muted: var(--edition-quiet);
  --pair-ground: #282927;
  --pair-accent: #ff9a71;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 0;
  border-top: 1px solid var(--edition-rule);
  padding-block: clamp(1.4rem, 3.5vw, 3rem);
  background: transparent;
}
.workspace .result-card:first-child { border-top-color: var(--edition-mark); }
.result-card .result-top {
  display: grid;
  grid-template-columns: clamp(3.8rem, 7.5vw, 6rem) minmax(0, 1fr);
  align-items: start;
  gap: clamp(.85rem, 1.4vw, 1.35rem);
}
.result-card .result-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  align-self: start;
  grid-area: auto;
}
.result-card .result-title-group { grid-area: auto; min-width: 0; }
.result-card .result-title {
  color: var(--edition-paper);
  font-family: var(--sans);
  font-size: clamp(2.1rem, 3.4vw, 3.95rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -.033em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.result-card .result-meta { margin-top: .45rem; color: var(--edition-quiet); line-height: 1.4; }
.workspace .result-card > .result-match { margin: .65rem 0 .5rem; padding: .72rem 0; }
.result-card .result-match > p { max-width: 76ch; }
.workspace .result-card > .result-pair { gap: .65rem; }
.result-card .result-pair .result-side-play,
.result-card .result-pair-row > .result-pair-info {
  padding: .72rem .75rem;
  gap: .27rem;
  background-color: #262725;
  border-color: var(--pair-line);
}
.result-card .result-pair-info > strong {
  font-size: 1.23rem;
  color: var(--edition-paper);
  font-weight: 500;
}
.result-card .result-pair .result-side-play:is(:hover, :focus-visible, .is-playing, .is-audible) {
  border-color: var(--pair-accent);
  background-color: #312b28;
}
.result-card .result-pair-transport { gap: .45rem; flex-wrap: wrap; }
.result-card .result-pair-transport .result-pair-play {
  min-width: min(100%, 8rem);
  padding-inline: .75rem;
  background: var(--edition-mark);
  border: 1px solid var(--edition-mark);
  color: #211a16;
  font-weight: 600;
}
.result-card .result-pair-transport .result-pair-play .play-symbol { color: inherit; }
.result-card .result-pair-transport .result-pair-play:enabled:hover { background: #ffa47d; }
.result-card .result-repeat { overflow-wrap: anywhere; max-width: 100%; }
.workspace .result-card .result-chart-details,
.workspace .result-card .result-details { margin: .2rem 0 0; }
.result-card .result-comparison-graph { padding: .95rem clamp(.55rem, 1.8vw, 1.35rem); }
.result-card .result-source { text-underline-offset: .22em; }
.workspace .listening-panel {
  border-block: 1px solid var(--edition-rule);
  padding-block: .35rem;
}
.workspace .saved-moments {
  margin-block-start: 1.85rem;
  border-color: var(--edition-rule);
}
.workspace .saved-moments > summary { line-height: 1.55; padding-block: .85rem; }
.workspace .saved-moments > summary::marker,
.workspace .listening-panel > summary::marker { color: var(--edition-mark); }
.workspace .saved-moments li { padding-block: .68rem; border-color: var(--edition-rule); }
.workspace .saved-moments li strong { color: var(--edition-paper); font-weight: 500; }
.workspace .saved-moments li small { color: var(--edition-quiet); }
.workspace .saved-moments li button { overflow-wrap: anywhere; }
@media (min-width: 960px) {
  .workspace .result-list.has-result-picker {
    grid-template-columns: minmax(0, .84fr) minmax(0, 1.55fr);
    column-gap: clamp(1.8rem, 4.8vw, 5.8rem);
    align-items: start;
  }
  .has-result-picker > .result-card { grid-column: 2; grid-row: 1; }
  .result-picks {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 1.5rem;
  }
  .workspace .has-result-picker .result-card { align-items: stretch; }
  .result-pick-select { min-height: 4.8rem; gap: 1rem; }
  .result-pick-select .result-cover { width: 3.15rem; height: 3.15rem; }
  .workspace .result-card {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.55fr);
    column-gap: clamp(1.8rem, 4.8vw, 5.8rem);
    align-items: start;
  }
  .result-card > .result-top { grid-column: 1; grid-row: 1; }
  .result-card > :not(.result-top) { grid-column: 2; min-width: 0; }
  .workspace .result-card > .result-top + :is(.result-pair, .result-match) { margin-top: 0; }
  .workspace .result-card > .result-top + .result-match { padding-top: 0; border-top: 0; }
}

dialog:is(#catalog-dialog, #moment-dialog, #youtube-dialog, #credits-dialog) {
  color: var(--edition-paper);
  background: #272826;
  border: 1px solid var(--edition-rule);
  border-top-color: var(--edition-mark);
  box-shadow: 0 1.5rem 5rem #0006;
}
dialog:is(#catalog-dialog, #moment-dialog, #youtube-dialog, #credits-dialog)::backdrop { background-color: #111311d9; }
dialog:is(#catalog-dialog, #moment-dialog, #youtube-dialog, #credits-dialog) .dialog-head {
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--edition-rule);
  gap: .6rem;
}
dialog:is(#catalog-dialog, #moment-dialog, #youtube-dialog, #credits-dialog) .dialog-head h2 {
  font-size: clamp(1.54rem, 2.6vw, 2.45rem);
  letter-spacing: -.043em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
#catalog-dialog { width: min(43rem, calc(100% - 1.25rem)); }
#catalog-dialog .search-field { background: #20211f; border-color: #676863; }
#catalog-dialog .search-field select { color: var(--edition-paper); background: transparent; }
#catalog-dialog .search-field select option { background: #20211f; color: var(--edition-paper); }
#catalog-dialog .search-filters button[aria-pressed="true"] {
  border-bottom-color: var(--edition-mark);
  color: var(--edition-paper);
}
#catalog-dialog .catalog-row { border-color: var(--edition-rule); }
#catalog-dialog .catalog-row .track-info strong { font-size: 1.16rem; line-height: 1.22; }
#catalog-dialog .catalog-add:enabled { background: transparent; border-color: #656560; }
#catalog-dialog .catalog-add:enabled:hover { color: var(--edition-mark); border-color: var(--edition-mark); }
#catalog-dialog .catalog-list { scrollbar-color: #777873 #292a28; }
#moment-dialog { width: min(40rem, calc(100% - 1.25rem)); }
#moment-dialog .wave-control { border-color: var(--edition-rule); background-color: #20211f; }
#moment-dialog .wave-control svg { fill: #deddd4; }
#moment-dialog .wave-marker { background: var(--edition-mark); }
#moment-dialog .wave-marker::before {
  height: .48rem; width: .72rem; border-radius: 0;
  clip-path: polygon(0 0,100% 0,50% 100%); background: var(--edition-mark);
}
#moment-dialog .wave-times strong { color: var(--edition-mark); }
#moment-dialog .moment-actions { border-color: var(--edition-rule); }
@media (max-width: 600px) {
  .result-card .result-top { grid-template-columns: 3.75rem minmax(0,1fr); gap: .82rem; }
  .result-card .result-title { font-size: clamp(1.82rem, 7.8vw, 2.65rem); }
  .workspace .result-card > .result-pair { gap: .38rem; }
  .result-card .result-pair-info > strong { font-size: 1.08rem; }
  .workspace .saved-moments li { grid-template-columns: minmax(0,1fr) auto; gap: .18rem .5rem; }
  .workspace .saved-moments li > div { grid-column: 1 / -1; }
  .workspace .saved-moments li button { justify-self: start; }
}
@media (max-height: 540px) {
  #catalog-dialog[open] { display: block; max-height: 94dvh; }
  #catalog-dialog .catalog-list { max-height: 46dvh; }
}

#catalog-dialog .catalog-access {
  display: flex;
  flex-wrap: wrap;
  gap: .12rem .5rem;
  white-space: normal;
  color: var(--muted);
  font-size: .78rem;
}
.catalog-access .available { color: var(--ink); }
.catalog-access > span + span { border-inline-start: 1px solid var(--edition-rule); padding-inline-start: .5rem; }
.catalog-row:has(+ .catalog-editions) { border-bottom: 0; }
.catalog-editions { border-bottom: 1px solid var(--edition-rule); padding-inline-start: 2.8rem; }
.catalog-editions > summary {
  display: list-item;
  width: fit-content;
  cursor: pointer;
  color: var(--edition-quiet);
  font-size: .83rem;
  padding: .4rem .3rem .65rem;
}
.catalog-editions > summary:focus-visible { outline: 2px solid var(--edition-mark); }
.catalog-editions .catalog-row:last-child { border-bottom: 0; }
.catalog-editions .catalog-row { border-top: 1px solid var(--edition-rule); }
