.underline {
    text-decoration: underline;
  }

/* Make individual display equations scrollable horizontally */
.katex-display { overflow: auto hidden }

/* Desktop-only table of contents for long posts */
.post-toc {
  display: none;
}

.post-toc-mobile {
  margin: 1rem 0 1.4rem;
  border-top: 1px solid color-mix(in srgb, var(--textcolor) 12%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--textcolor) 12%, transparent);
}

.post-toc-mobile summary {
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 0;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: color-mix(in srgb, var(--textcolor) 82%, #888);
}

.post-toc-mobile summary::-webkit-details-marker {
  display: none;
}

.post-toc-mobile summary::after {
  content: "▾";
  font-size: 0.9rem;
  opacity: 0.55;
  transform: rotate(-90deg);
  transition: transform 0.18s ease;
}

.post-toc-mobile[open] summary::after {
  transform: rotate(0deg);
}

.post-toc-mobile-body {
  padding: 0.25rem 0 0.65rem;
}

.post-toc-mobile #TableOfContentsMobile {
  font-size: 0.95rem;
  line-height: 1.45;
}

.post-toc-mobile #TableOfContentsMobile ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-toc-mobile #TableOfContentsMobile ul ul {
  margin-top: 0.15rem;
  padding-left: 0.9rem;
}

.post-toc-mobile #TableOfContentsMobile > ul > li > ul {
  display: none;
}

.post-toc-mobile #TableOfContentsMobile > ul > li > a::before {
  content: "• ";
  opacity: 0.75;
}

.post-toc-mobile #TableOfContentsMobile li {
  margin: 0.22rem 0;
}

.post-toc-mobile #TableOfContentsMobile a {
  border-bottom: none;
  color: inherit;
  opacity: 0.9;
}

.post-toc-mobile #TableOfContentsMobile a:hover {
  color: var(--maincolor);
  opacity: 1;
}

@media screen and (min-width: 1280px) {
  .post-layout {
    position: relative;
  }

  .post-toc-mobile {
    display: none;
  }

  .post-toc {
    display: block;
    position: fixed;
    top: 15.5rem;
    left: calc(50% + 425px);
    width: 14rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: color-mix(in srgb, var(--textcolor) 72%, #888);
    max-height: calc(100vh - 17rem);
    overflow: auto;
  }

  .post-toc-title {
    font-size: 0.9rem;
    text-transform: none;
    letter-spacing: 0.01em;
    color: color-mix(in srgb, var(--textcolor) 70%, #999);
    margin-bottom: 0.55rem;
  }

  .post-toc #TableOfContents {
    border-left: 1px solid color-mix(in srgb, var(--textcolor) 18%, transparent);
    padding-left: 0.8rem;
  }

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

  .post-toc ul ul {
    padding-left: 0.8rem;
    margin-top: 0.2rem;
  }

  .post-toc #TableOfContents > ul > li > ul {
    display: none;
  }

  .post-toc #TableOfContents > ul > li > a::before {
    content: "• ";
    opacity: 0.75;
  }

  .post-toc li {
    margin: 0.2rem 0;
  }

  .post-toc a {
    border-bottom: none;
    color: inherit;
    opacity: 0.88;
  }

  .post-toc a:hover {
    color: var(--maincolor);
    opacity: 1;
  }
}
