.ct_code_preview {
    display: grid;
    background: #44546A;
    padding: 1px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 1rem;
    gap: 1px;
}

.ct_code_preview > * {
    margin: 0;
}

.ct_code_preview > details.ct_code_output > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .5em;
    color: #fff;
    padding: 1em;
    font-size: 1em;
    line-height: 1.0;
}

.ct_code_preview > details.ct_code_output > summary:before {
    content: '+';
    display: inline-block;
    width: .75em;
    text-align: center;
}

.ct_code_preview > details.ct_code_output[open]:not(:has(> iframe)) > summary {
    padding-bottom: 0;
    margin-bottom: -.5em;
}

.ct_code_preview > details.ct_code_output[open] {
    height: var(--height);
}

.ct_code_preview > details.ct_code_output[open] > summary:before {
    content: '\2013';
}

.ct_code_preview > .ct_code_output > pre {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 87.5%;
    padding: 1em;
    height: 100%;
    margin: 0;
}

.ct_code_preview > .ct_code_output > pre,
.ct_code_preview > .ct_code_output > pre > samp {
    background: #44546A;
    color: #f2f2f2;
}

.ct_code_preview > .ct_code_output > iframe {
    border: none;
    width: 100%;
    height: 100%;
}

.ct_code_preview.ct_code_preview_stacked > .ct_code_output:not(:has(> pre), :has(> iframe)) {
    padding: 1em;
}

.ct_code_preview > details.ct_code_output:not(:has(> pre), :has(> iframe)) > summary {
    padding: 0;
}

.ct_code_preview > details.ct_code_output[open]:not(:has(> pre), :has(> iframe)) > summary {
    margin-bottom: 1em;
}

.ct_code_preview > details.ct_code_output > iframe {
    height: calc(var(--height) - 3em);
}

.ct_code_preview.ct_code_preview_stacked {
    grid-template-columns: 1fr;
}

.ct_code_preview:not(:has(> pre)) .ct_code_output {
    grid-column: span 2;
}

.darkmode .ct_code_preview,
.darkmode .ct_code_preview > .ct_code_output > pre,
.darkmode .ct_code_preview > .ct_code_output > pre > samp {
    background-color: #111;
}