code, pre, kbd {
  font-family: var(--mt-font-mono);
}

:not(pre) > code {
  font-size: 0.875em;
  background: var(--mt-accent);
  border: 1px solid var(--mt-border);
  padding: 0 0.25rem;
  border-radius: var(--mt-p-radius-sm);
  overflow-wrap: anywhere;
}

:is(p, li) > code {
  display: inline-block;
  max-inline-size: 100%;
}

pre {
  font-size: 0.875rem;
  line-height: 1.5rem;
  background: var(--mt-code-background);
  color: var(--mt-code-foreground);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-code-radius, var(--mt-radius));
  padding: 1rem;
  margin: 0 0 1.25rem;
  overflow-x: auto;
  tab-size: 2;
}

pre code {
  font-size: inherit;
}

div.highlighter-rouge, figure.highlight {
  margin: 0 0 1.25rem;
}

div.highlighter-rouge pre, figure.highlight pre {
  margin: 0;
}

.highlight :is(.c, .c1, .cm, .cs, .cp, .cd) {
  color: var(--mt-code-comment);
  font-style: italic;
}

.highlight :is(.k, .kd, .kn, .kp, .kr, .kt, .kc, .ow) {
  color: var(--mt-code-keyword);
}

.highlight .nt {
  color: var(--mt-code-tag);
}

.highlight :is(.s, .s1, .s2, .sb, .sc, .sd, .se, .sh, .si, .sx, .sr, .ss), .highlight .na + .s {
  color: var(--mt-code-string);
}

.highlight :is(.m, .mi, .mf, .mh, .mo, .il) {
  color: var(--mt-code-number);
}

.highlight :is(.no, .bp, .py) {
  color: var(--mt-code-constant);
}

.highlight :is(.vc, .vg, .vi) {
  color: var(--mt-code-variable);
}

.highlight .na {
  color: var(--mt-code-attribute);
}

.highlight :is(.nf, .fm, .nn, .nb, .nd, .ne) {
  color: var(--mt-code-function);
}

.highlight .nc {
  color: var(--mt-code-type);
}

.highlight .o {
  color: var(--mt-code-operator);
}

.highlight :is(.gd, .err) {
  color: var(--mt-code-deleted);
}

.highlight .gi {
  color: var(--mt-code-inserted);
}

.mt-code {
  position: relative;
}

.mt-code-copy {
  position: absolute;
  top: 0.25rem;
  inset-inline-end: 0.25rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: var(--mt-radius);
  background: var(--mt-code-background);
  color: var(--mt-muted-foreground);
  cursor: pointer;
  transition: 0.15s;
}

.mt-code-copy:hover, .mt-code-copy:focus-visible {
  color: var(--mt-foreground);
  background: var(--mt-accent);
}

.mt-code-title + .mt-code .mt-code-copy {
  top: -2.25rem;
}

@media (scripting: enabled) {
  .mt-main pre {
    padding-inline-end: 3rem;
  }
  .mt-main .mt-code-title + div pre {
    padding-inline-end: 1rem;
  }
  .mt-main div.highlight {
    container: mt-code/inline-size;
    font-family: var(--mt-font-mono);
    font-size: 0.875rem;
  }
  .mt-main .mt-code-title + div div.highlight {
    container: none;
  }
  pre[data-mt-line=x] {
    padding-top: 2.5rem;
  }
  .mt-code-title + div pre[data-mt-line=x] {
    padding-top: 1rem;
  }
  @container mt-code (max-width: calc(8ch + 58px)) {
    [data-mt-line="1"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(16ch + 58px)) {
    [data-mt-line="2"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(24ch + 58px)) {
    [data-mt-line="3"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(32ch + 58px)) {
    [data-mt-line="4"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(40ch + 58px)) {
    [data-mt-line="5"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(48ch + 58px)) {
    [data-mt-line="6"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(56ch + 58px)) {
    [data-mt-line="7"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(64ch + 58px)) {
    [data-mt-line="8"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(72ch + 58px)) {
    [data-mt-line="9"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(80ch + 58px)) {
    [data-mt-line="10"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(88ch + 58px)) {
    [data-mt-line="11"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(96ch + 58px)) {
    [data-mt-line="12"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(104ch + 58px)) {
    [data-mt-line="13"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(112ch + 58px)) {
    [data-mt-line="14"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(120ch + 58px)) {
    [data-mt-line="15"] {
      padding-top: 2.5rem;
    }
  }
  @container mt-code (max-width: calc(128ch + 58px)) {
    [data-mt-line="16"] {
      padding-top: 2.5rem;
    }
  }
}
@media (pointer: coarse) {
  .mt-code-copy {
    min-height: 2.75rem;
  }
  .mt-code-copy {
    width: 2.75rem;
    height: 2.75rem;
  }
  .mt-code pre, pre.mt-code {
    padding-top: 3.25rem;
  }
  .mt-code-title + div pre {
    padding-top: 1rem;
  }
}
@media (forced-colors: active) {
  .mt-code-copy {
    border: 1px solid ButtonText;
  }
}
.mt-code {
  margin: 0 0 1.25rem;
}

.mt-code-title {
  display: flex;
  align-items: center;
  height: 2.5rem;
  margin: 0;
  padding: 0 1rem;
  border: 1px solid var(--mt-border);
  border-bottom: 0;
  border-radius: var(--mt-code-radius, var(--mt-radius)) var(--mt-code-radius, var(--mt-radius)) 0 0;
  background: var(--mt-code-background);
  color: var(--mt-muted-foreground);
  font: 0.75rem/1rem var(--mt-font-mono);
}

.mt-code-title + div.highlighter-rouge pre {
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}

.language-diff .gi, .language-diff .gd {
  display: block;
}

.language-diff .gi {
  background: color-mix(in srgb, var(--mt-tip) 16%, transparent);
  color: var(--mt-foreground);
}

.language-diff .gd {
  background: color-mix(in srgb, var(--mt-caution) 16%, transparent);
  color: var(--mt-foreground);
}