.katex-display, .box {
  background-color: var(--quote-bg);
  border-radius: 4px;
  padding: 0.75em 1em;
  margin: 1em 0;
  overflow-x: auto;
}

.katex-display>.katex {
  text-align: left !important;
}

#of-tensor-programs {
  margin-top: -24px;
}

#of-tensor-programs+p {
  margin-top: 0;
}

#recommended-books,
#recommended-books-1,
#recommended-books-2,
#recommended-books-3,
#recommended-lectures,
#recommended-lectures-1,
#recommended-lectures-2 {
  margin-bottom: -16px;
}

#recommended-lectures,
#recommended-lectures-1,
#recommended-lectures-2 {
  margin-top: 0;
}

p:has(> em)+h5[id^="recommended-"] {
  margin-top: 0;
}

p:has(> em:only-child) {
  margin: 0;
}

#mathematics-for-machine-learning,
#tensor-programming,
#tensor-interpretation-and-compilation {
  margin-bottom: -16px;
}

.full-bleed {
  width: 90vw;
  position: relative;
  left: 50%;
  margin-left: -45vw;
}

.full-bleed iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
}

.full-bleed-side {
  width: 90vw;
  position: relative;
  left: 50%;
  margin-left: -45vw;
  display: flex;
  gap: 1rem;
}

.full-bleed-side iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
}

.sidenote {
  float: right;
  clear: right;
  margin-right: -44%;
  width: 35%;
  margin-top: 0.3rem;
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.3;
}

blockquote .sidenote {
  margin-right: calc(-44% - 20px);
}

.sidenote-number {
  counter-increment: sidenote-counter;
}

.sidenote-number::after,
.sidenote::before {
  font-size: 12px;
  position: relative;
  vertical-align: baseline;
}

.sidenote-number::after {
  content: counter(sidenote-counter);
  top: -0.5rem;
  left: 0.1rem;
  color: rgb(0, 150, 207)
}

.sidenote::before {
  content: counter(sidenote-counter) " ";
  top: -0.5rem;
  color: rgb(0, 150, 207)
}

.content {
  counter-reset: sidenote-counter;
}

@media (max-width: 1000px) {
  .sidenote {
    display: none;
  }

  .sidenote-number::after {
    content: counter(sidenote-counter);
    cursor: pointer;
    text-decoration: underline;
  }
}

p:has(> small > a[href="#table-of-contents"]) {
  margin-top: 0;
}

h2:has(+ p > small > a[href="#table-of-contents"]) {
  margin-bottom: 0;
}

p:has(+ ul) {
  margin-bottom: 0;
}

p + ul {
  margin-top: 0;
}

.mobile-only {
  display: none;
}

@media (max-width: 1000px) {
  .mobile-only {
    display: block;
  }

  .mobile-sidenotes {
    margin-top: 2rem;
    border-top: 1px solid currentColor;
    opacity: 0.7;
  }

  .mobile-sidenotes h6 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
  }

  .mobile-sidenotes ol {
    font-size: 12px;
    line-height: 1.4;
    padding-left: 1.5rem;
    margin: 0;
  }
}

.ayu .playground-iframe,
.navy .playground-iframe,
.coal .playground-iframe {
  filter: invert(1) hue-rotate(180deg);
}

.light pre, .rust pre {
  background: #f6f7f6;
}

.coal pre, .navy pre {
  background: #1d1f21;
}

.ayu pre {
  background: #191f26;
}

.material-lighter pre {
  background: #E0F7FA;
}

/* Material Theme Lighter menu title */
.material-lighter .menu-title {
  color: #C83E36;
}

/* Material Theme Lighter headings */
.material-lighter h1,
.material-lighter h1 a.header:link,
.material-lighter h1 a.header:visited {
  color: #C83E36;
}

.material-lighter h2,
.material-lighter h2 a.header:link,
.material-lighter h2 a.header:visited {
  color: #C83E36;
}

.material-lighter h3,
.material-lighter h3 a.header:link,
.material-lighter h3 a.header:visited,
.material-lighter h4,
.material-lighter h4 a.header:link,
.material-lighter h4 a.header:visited,
.material-lighter h5,
.material-lighter h5 a.header:link,
.material-lighter h5 a.header:visited,
.material-lighter h6,
.material-lighter h6 a.header:link,
.material-lighter h6 a.header:visited {
  color: #CE8B32;
}

/* Material Theme Lighter inline code */
.material-lighter :not(pre) > code.hljs {
  color: #8FAE58;
}

/* Material Theme Lighter syntax highlighting */
.material-lighter .hljs {
  background: #F5F5F5;
  color: #546E7A;
}

.material-lighter .hljs-keyword,
.material-lighter .hljs-selector-tag,
.material-lighter .hljs-built_in,
.material-lighter .hljs-name,
.material-lighter .hljs-tag {
  color: #59A1AA;
}

.material-lighter .hljs-string,
.material-lighter .hljs-title,
.material-lighter .hljs-section,
.material-lighter .hljs-attribute,
.material-lighter .hljs-literal,
.material-lighter .hljs-template-tag,
.material-lighter .hljs-template-variable,
.material-lighter .hljs-type {
  color: #8FAE58;
}

.material-lighter .hljs-number,
.material-lighter .hljs-attr,
.material-lighter .hljs-params {
  color: #F76D47;
}

.material-lighter .hljs-comment,
.material-lighter .hljs-quote {
  color: #90A4AE;
  font-style: italic;
}

.material-lighter .hljs-title.function_,
.material-lighter .hljs-function,
.material-lighter .hljs-selector-id,
.material-lighter .hljs-selector-class {
  color: #6182B8;
}

.material-lighter .hljs-class .hljs-title,
.material-lighter .hljs-variable.language_ {
  color: #E53935;
}

.material-lighter .hljs-regexp,
.material-lighter .hljs-link {
  color: #59A1AA;
}

.material-lighter .hljs-symbol,
.material-lighter .hljs-bullet,
.material-lighter .hljs-meta {
  color: #7986CB;
}

.material-lighter .hljs-deletion {
  color: #E53935;
}

.material-lighter .hljs-addition {
  color: #8FAE58;
}


.material-lighter .hljs-emphasis {
  font-style: italic;
}

.material-lighter .hljs-strong {
  font-weight: bold;
}

/* Material Theme Lighter sidenotes */
.material-lighter .sidenote-number::after,
.material-lighter .sidenote::before {
  color: #C83E36;
}