.code { position: relative; margin: 1rem 0; border-radius: 0.5rem; overflow: hidden; }
.code pre { margin: 0; padding: 0.75rem 1rem; overflow-x: auto; background: var(--code-background); color: var(--code-foreground); }
.code pre.wrap { white-space: pre-wrap; }
.code code { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.code .line { display: inline-block; min-width: 100%; }
.code .line.mark { background: var(--code-mark); }
.code .line.ins { background: var(--code-ins); }
.code .line.del { background: var(--code-del); }
.code .line-number { display: inline-block; min-width: 2ch; margin-right: 1.5ch; text-align: right; opacity: 0.5; user-select: none; }
.code mark { background: var(--code-mark); color: inherit; }
.code ins { background: var(--code-ins); text-decoration: none; }
.code del { background: var(--code-del); text-decoration: none; }
.code-title { padding: 0.4rem 1rem; font-size: 0.85em; background: var(--code-title-background); color: var(--code-foreground); }
.code-copy { position: absolute; top: 0.4rem; right: 0.4rem; font-size: 0.75em; opacity: 0.6; }
.code:not(:hover) .code-copy { opacity: 0; }
.code-section summary { cursor: pointer; opacity: 0.7; }
.twoslash-hover { position: relative; border-bottom: 1px dotted currentColor; }
.twoslash-popup { display: none; position: absolute; left: 0; top: 100%; z-index: 10; min-width: max-content; max-width: 40rem; padding: 0.5rem; border-radius: 0.3rem; background: var(--code-background); box-shadow: 0 2px 8px rgb(0 0 0 / 30%); white-space: normal; }
.twoslash-popup .code { margin: 0; }
.twoslash-hover:hover > .twoslash-popup, .twoslash-hover:focus > .twoslash-popup { display: block; }
.twoslash-error-underline { text-decoration: underline wavy red; }
.twoslash-error, .twoslash-query { display: block; margin: 0.25rem 0; padding: 0.25rem 0.5rem; white-space: normal; }
:root .code { --code-background: #fff; --code-foreground: #24292e; --code-title-background: #f6f8fa; --code-mark: #9ab6ff80; --code-ins: #8ec77d80; --code-del: #ff9c8e80; }
:root .code span[style^='--'] { color: var(--0, inherit); font-style: var(--0fs, inherit); font-weight: var(--0fw, inherit); text-decoration: var(--0td, inherit); }
@media (prefers-color-scheme: dark) {
:root:not([data-theme]) .code { --code-background: #24292e; --code-foreground: #e1e4e8; --code-title-background: #1f2428; --code-mark: #174a9080; --code-ins: #1e571580; --code-del: #862d2780; }
:root:not([data-theme]) .code span[style^='--'] { color: var(--1, inherit); font-style: var(--1fs, inherit); font-weight: var(--1fw, inherit); text-decoration: var(--1td, inherit); }
}
:root[data-theme='dark'] .code { --code-background: #24292e; --code-foreground: #e1e4e8; --code-title-background: #1f2428; --code-mark: #174a9080; --code-ins: #1e571580; --code-del: #862d2780; }
:root[data-theme='dark'] .code span[style^='--'] { color: var(--1, inherit); font-style: var(--1fs, inherit); font-weight: var(--1fw, inherit); text-decoration: var(--1td, inherit); }
