:root {
  --background: white;
  --color: black;
}

body {
  background: var(--background);
  color: var(--color);
  font-family: system-ui;

  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: initial;
}

.wrapper {
  max-width: 1400px;
  margin: auto;
  padding: 1em;
}

.wrapper > :first-child,
.wrapper div > :first-child {
  margin-top: 0;
}

.wrapper > :last-child,
.wrapper div > :last-child {
  margin-bottom: 0;
}

header {
  border-bottom: 1px solid;
}

main {
  flex: 1;
  overflow: auto;
}

footer {
  border-top: 1px solid;
}

header .wrapper,
footer .wrapper {
  display: flex;
  align-items: center;
  gap: 1em;
}

header .wrapper a {
  max-width: 50%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

header .wrapper form,
footer .wrapper span {
  flex: 1;
}

header .wrapper input {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  width: 100%;
}

main .wrapper .page,
main .wrapper .subpage {
  display: grid;
  align-items: start;
  gap: 1em;
}

main .wrapper .page {
  grid-template-columns: auto 250px;
}

main .wrapper .subpage {
  grid-template-columns: 250px auto 250px;
}

main .wrapper img,
main .wrapper table {
  width: 100%;
}

main .wrapper table td {
  vertical-align: top;
}

main .wrapper table td[colspan] {
  padding: initial !important;
}

main .wrapper table td[colspan] audio {
  width: 100%;
  margin-top: 4px;
}

main .wrapper table td:not(:nth-child(2)) {
  width: 0;
  white-space: nowrap;
  text-align: right;
}

main .wrapper table td:first-child {
  padding-right: 0.5em;
}

main .wrapper table td:last-child {
  padding-left: 0.5em;
}

main .wrapper .results,
main .wrapper .results a {
  display: grid;
  gap: 1em;
}

main .wrapper .results {
  grid-template-columns: repeat(auto-fill, minmax(300px, auto));
}

main .wrapper .results a {
  grid-template-columns: 100px auto;
  align-items: center;
}

main .wrapper .results img {
  width: 100px;
  height: 100px;
  object-fit: cover;
}

main .wrapper .tracks a,
main .wrapper .sidebar a {
  font-weight: bold;
}

a {
  color: inherit;
  text-decoration: initial;
}

#icon {
  height: 12px;
}

::selection {
  background: var(--color);
  color: var(--background);
}

@media (max-width: 1000px) {
  main .wrapper .page,
  main .wrapper .subpage {
    grid-template-columns: auto;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: black;
    --color: white;
  }

  #icon {
    filter: invert(1);
  }
}