#content:has(#toc) {
  @media (min-width: 1024px) {
    padding-right: 220px;
  }
  @media (min-width: 1280px) {
    padding-right: 270px;
  }
}

@media (min-width: 1024px) {
  .floating {
    position: absolute;
    top: 1rem;
    right: 0;

    @media (min-width: 1024px) {
      width: 200px;
    }
    @media (min-width: 1280px) {
      width: 250px;
    }
    #toc {
      position: fixed;
    }
  }
}

details#toc {
  display: inline-block;
  padding: 1rem;
  font-size: 0.9rem;
  border: 1px solid #353841;
  border-radius: 10px;

  @media (min-width: 1024px) {
    display: block;
    border-width: 0;
  }

  summary {
    font-size: 1rem;

    @media (min-width: 1024px) {
      pointer-events: none;
      &::after {
        display: none;
      }
    }
  }
  ul {
    padding-left: 0;
    li {
      list-style: none;

      &.h3 { margin-left: 10px; }
      &.h4 { margin-left: 20px; }
      &.h5 { margin-left: 30px; }
      &.h5 { margin-left: 40px; }

      a {
        text-decoration: none;
        &.active {
          color: white;
          font-weight: bold;
          transition: color 0.5s ease-in-out 0;
          transition: font-weight 0.5s ease-in-out 0;
        }
      }
    }
  }
}
