.code-block {
  --indent-size: 2ch;
  overflow: hidden;
  margin: 1.2rem 0;
  border: 1px solid #292d35;
  border-radius: 4px;
  background: #121212;
  color: #dbd7ca;
}

.code-header {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 12px 4px 16px;
  border-bottom: 1px solid #292d35;
  background: #032024;
  color: #c9c9c9;
  font: 500 .82rem/1.3 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.code-language {
  flex: 1;
  color: #f1f1f1;
}

.code-copy {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  border: 1px solid #3a3d43;
  border-radius: 7px;
  padding: 0;
  background: transparent;
  color: #d4d4d4;
  font: inherit;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.code-copy svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.code-copy:hover {
  border-color: #777d87;
  background: #292b2f;
}

.code-copy:focus-visible {
  outline: 2px solid #8ab4f8;
  outline-offset: 2px;
}

.code-copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.prose .code-block > pre.shiki {
  max-width: 100%;
  margin: 0;
  padding: 16px 20px 16px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .8rem;
  line-height: 0.95;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}

.prose .code-block > pre.shiki code {
  display: block;
  min-width: max-content;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.code-block .line {
  position: relative;
  display: block;
  min-height: 0.95em;
  isolation: isolate;
}

.code-block .line::before {
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 0;
  width: var(--indent-width, 0);
  background: repeating-linear-gradient(
    to right,
    transparent 0 calc(var(--indent-size) - 1px),
    rgb(255 255 255 / 14%) calc(var(--indent-size) - 1px) var(--indent-size)
  );
  content: "";
  pointer-events: none;
}

.code-block--diff .line.is-addition {
  background: rgb(46 160 67 / 13%);
}

.code-block--diff .line.is-deletion {
  background: rgb(248 81 73 / 13%);
}

@media (max-width: 560px) {
  .prose .code-block > pre.shiki {
    padding: 12px 15px 13px;
    font-size: .82rem;
  }

  .code-header {
    min-height: 42px;
  }
}
