@font-face {
  font-family: "Geist Mono";
  src: url("../assets/geist-mono.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

code-block {
  display: flex;
  position: relative;
  align-items: flex-start;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #f5f5f5;
  color: #1d1d1f;
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: -0.18px;
  text-align: left;
}

code-block .code-block__viewport {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

code-block[data-smooth-corners] {
  border-color: transparent;
  background: transparent;
}

code-block .code-block__surface {
  display: none;
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  pointer-events: none;
  user-select: none;
}

code-block[data-smooth-corners] .code-block__surface { display: block; }

code-block .code-block__surface > path {
  fill: #f5f5f5;
  stroke: #e5e5e5;
  stroke-width: 2;
}

code-block .code-block__line {
  display: grid;
  grid-template-columns: var(--code-block-gutter, 9px) minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 22px;
}

code-block .code-block__line-number {
  width: var(--code-block-gutter, 9px);
  height: 22px;
  color: #8f8f8f;
  text-align: right;
  -webkit-user-select: none;
  user-select: none;
}

code-block .code-block__line-number::before {
  content: attr(data-line);
}

code-block .code-block__pre,
code-block .code-block__code {
  display: block;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  white-space: pre;
  tab-size: 2;
}

code-block .code-block__line-source {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

code-block .code-block__copy {
  display: flex;
  position: relative;
  z-index: 1;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  margin: 0;
  padding: 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #8f8f8f;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

code-block .code-block__copy-icon,
code-block .code-block__copy svg {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

code-block .code-block__copy-icon {
  background: currentColor;
  -webkit-mask: var(--copy-icon) center / contain no-repeat;
  mask: var(--copy-icon) center / contain no-repeat;
}

code-block .code-block__copy:hover:not(:disabled),
code-block .code-block__copy:focus-visible:not(:disabled) {
  color: #1d1d1f;
}

code-block .code-block__copy[data-copied]::after {
  position: absolute;
  z-index: 1;
  right: -4px;
  bottom: calc(100% + 8px);
  padding: 4px 7px;
  border-radius: 5px;
  background: #1d1d1f;
  color: #fff;
  font: 500 11px/16px "Geist Mono", monospace;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
  content: "Copied";
}

code-block .code-block__copy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

code-block .code-block__copy:focus-visible,
code-block .code-block__viewport:focus-visible {
  outline: 2px solid #666;
  outline-offset: 3px;
}

code-block .code-block__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

code-block .token.comment,
code-block .token.prolog,
code-block .token.doctype { color: #686868; }
code-block .token.tag,
code-block .token.keyword { color: #7c3aed; }
code-block .token.attr-name,
code-block .token.builtin,
code-block .token.function { color: #0969da; }
code-block .token.attr-value,
code-block .token.string { color: #12803e; }
code-block .token.punctuation,
code-block .token.operator { color: #6b6b6b; }
code-block .token.variable,
code-block .token.constant,
code-block .token.number,
code-block .token.boolean { color: #b04b00; }

@media (forced-colors: active) {
  code-block[data-smooth-corners] {
    border-color: ButtonText;
    background: Canvas;
  }
  code-block[data-smooth-corners] .code-block__surface { display: none; }
  code-block .code-block__copy-icon { background: ButtonText; }
}
