.toc {
  display: block;
  margin: 1.5em 0;
  background-color: var(--base-3);
  border-radius: 15px;
  border: 1px solid var(--base);
  contain: content;
  padding: 20px;
}

.toc .title {
  font-size: 24px;
  text-transform: uppercase;
  color: var(--contrast-2);
  font-weight: 600;
  margin-bottom: 20px;
}

.toc .title svg {
  margin-right: 10px;
  vertical-align: -0.1em;
}

.toc ul {
  margin: 0;
  list-style-type: none;
}

.toc li {
  counter-increment: chapters;
  display: grid;
  grid-template-columns: 50px auto;
  align-items: center;
}

.toc li + li {
  border-top: 1px solid var(--base);
  padding-top: .5em;
  margin-top: .5em;
}

.toc a {
  font-size: 16px;
  text-wrap: balance;
  font-weight: 500;
  color: var(--contrast);
}

.toc li::before {
  display: inline-block;
  width: 36px;
  height: 36px;
  text-align: center;
  font-size: 1.2em;
  font-weight: 600;
  content: counter(chapters);
  background-color: var(--contrast);
  color: var(--base-3);
  border-radius: 50%;
  transition: transform 100ms ease-in-out;
  line-height: 36px;
}

.toc li:hover a {
  color: var(--darker);
}

.toc li:hover::before {
  transform: scale(1.1);
  background-color: var(--darker);
}