body {
    /* windows has no built-in serif fonts that look very good :( Sitka, Constantia, Cambria are at least decent */
    font-family: "Source Serif Pro", P052, "Noto Serif", "Abyssinica SIL", C059, "Nimbus Roman", Utopia, Sitka, Constantia, Cambria, Palatino, "Palatino Linotype", "Palatino LT STD", Georgia, serif;
}

/* body::before {
    /* https://stackoverflow.com/a/33091315/10113238 * /
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: -1;

    display: block;
    /* background-image: url('https://i.sm4.ca/justbg.png'); * /
    background-image: url('/justbg2.jpg');
    background-size: cover;
    width: 100%;
    height: 100%;

    filter: opacity(0.1) blur(4px);
} */

#lastmod-info {
    color: rgb(77, 77, 77);
}

#content pre {
    margin-top: 0;
    padding: 0.5rem;
    line-height: 1.4;
    font-size: 0.8rem;
    margin-bottom: 1em;
    text-align: left;
    overflow-x: scroll;
}

h2, h3, h4, h5, h6 {
    margin: 0;
}

#things-i-like h2 {
    margin-left: 1rem;
}

#hi-message {
    font-size: 300%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

p, ul, ol {
    margin: 0;
    padding-bottom: 1rem;
}

.h-card {
    text-align: center;
}

.smitop {
    font-weight: bold;
    color: black;
    text-decoration: none;
}

img {
    display: block;
    margin-bottom: 1rem;
}

figure {
    margin: 0;
}

figure > img {
    margin-bottom: 0.2em;
}

/* Image-first Bayesian network embeds from /bn */
[data-bn-embed] {
    margin-bottom: 1rem;
}

figcaption {
    font-size: 95%;
    font-style: italic;
    text-align: center;
}

/* A footnote reference doesn't make its line taller than the lines around it. */
sup {
    line-height: 0;
}

kbd {
    border: 1px solid #c6cbd1;
    border-radius: 4px;
    box-shadow: 1px 1px 0 #959da5;
    color: #232323;
    display: inline-block;
    font-size: 17px;
    line-height: 17px;
    padding: 3px 5px;
    vertical-align: middle;
}

#content, footer {
    max-width: 45rem;
    line-height: 1.5;
    width: 100%;
}
#content {
    margin-top: 1em;
    text-align: justify;
    font-size: 111%;
}

/* In prose, a long word that doesn't fit breaks with a hyphen, instead of moving whole to the next line and
   spreading out the justified line before it. Only paragraphs and list items are prose: a hyphen added to text a
   post shows as-is, such as the output of one of its demos, would read as part of that text. */
#content :is(p, li) {
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* Likewise for code in prose. */
#content :is(pre, code, kbd, samp) {
    -webkit-hyphens: manual;
    hyphens: manual;
}

/* Long inline code (marked by post/single.html) breaks anywhere instead of moving whole to the next line, which would spread out the justified line before it. */
#content code.long {
    word-break: break-all;
}

/* A link in a post or page, or in the lists on the homepage and stream pages, ends with a mark of where it goes: a
   raised dot for iter.ca (a path here, iter.ca, or kb.iter.ca) and an arrow for any other site. Links within the page
   (#...), such as footnote references, links around an image, mailto links, the generated lists of posts, and the
   headings of the homepage's lists (which look like headings, not links) get none.
   The mark is drawn in the link's own padding, so a line can't break between the link and its mark, and in the link's
   color, visited or not. */
:is(#content, #homepage-content, .stream) a:is([href^="/"]:not([href^="//"]), [href^="https://iter.ca/"], [href="https://iter.ca"], [href^="https://kb.iter.ca/"]):not(:has(img), .reclist a, .home-col h2 a) {
    padding-right: 0.42em;
    background-image: radial-gradient(circle closest-side, currentColor calc(100% - 0.6px), transparent);
    background-repeat: no-repeat;
    background-size: 0.32em 0.32em;
    background-position: right 0.04em top 0.2em;
}

/* The arrow is a line along its top, a line down its right side, and a diagonal into that corner. */
:is(#content, #homepage-content, .stream) a:is([href^="http://"], [href^="https://"]):not([href^="https://iter.ca/"], [href="https://iter.ca"], [href^="https://kb.iter.ca/"], :has(img), .reclist a, .home-col h2 a) {
    padding-right: 0.55em;
    background-image:
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor),
        linear-gradient(-45deg, transparent calc(50% - 0.55px), currentColor calc(50% - 0.55px), currentColor calc(50% + 0.55px), transparent calc(50% + 0.55px));
    background-repeat: no-repeat;
    background-size: 0.3em 1.1px, 1.1px 0.3em, 0.36em 0.36em;
    background-position: right 0.03em top 0.16em;
}

#main-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#me-links > div, #me-links > div > ul {
    padding: 0;
    text-align: center;
}
#me-links > div ul {
    display: inline-block;
}
#me-links > div {
    margin-top: 1em;
}

#me-links p {
    text-align: center;
    padding-bottom: 0;
}

#me-links li {
    list-style-type: none;
    display: inline;
}

#me-links li:not(:last-child):after {
    content: " • ";
}

#me-links button {
    position: relative;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: #0000ee;
    color: LinkText;
    text-decoration: underline;
    cursor: pointer;
}

#copy-discord:hover::after,
#copy-discord:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    top: 100%;
    /* Centered under the button, but shifted to stay 4px inside the viewport.
       --x is the button's center, set by the homepage script. */
    transform: translateX(clamp(calc(4px - var(--x, 50vw)), -50%, calc(100vw - 4px - var(--x, 50vw) - 100%)));
    /* A see-through gap that still counts as the button, so the pointer can
       move onto the tooltip without it disappearing. */
    border-top: 0.35em solid transparent;
    background: #222;
    background-clip: padding-box;
    padding: 0.15em 0.4em;
    color: #fff;
    font-size: 0.72em;
    line-height: 1.3;
    white-space: nowrap;
    text-decoration: none;
    z-index: 2;
}

/* Escape hides the tooltip until it next appears. */
#copy-discord.tip-hidden::after {
    display: none;
}

.source-link {
    color: #222;
    display: block;
    text-align: center;
    margin-top: 5rem;
}

h1 {
    margin: 0;
    margin-top: 0.25em;
}

.stream {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.stream.mini {
    display: inline-block;
}

.stream.mini > .stream-item {
    display: block;
    max-width: 15rem;
}

.stream.mini .stream-item-date, .stream.mini h2 {
    display: inline;
}

.stream-item {
    max-width: 20rem;
    border: 2px solid gray;
    border-radius: 0.5rem;
    padding: 0.25rem;
    /* create new context */
    position: relative;
    text-align: center;
    overflow: hidden;
    max-height: 16rem;
    background: rgba(255,255,255,0.65);
}

.stream.mini .stream-item {
    border: none;
    max-width: unset;
    text-align: unset;
    display: list-item;
    list-style-position: inside;
}
.stream.mini .stream-item > div {
    display: inline;
}
.stream.mini .stream-item .stream-item-type {
    display: none;
}
.stream.mini .stream-item h2 {
    font-size: 100%;
    font-weight: 400;
}
.stream.mini .stream-item a {
    font-weight: bold;
}

/* The homepage's lists of stream items (partials/homecols.html). On a wide screen they are a row of columns; on a
   narrower one each is a card, two to a row, or one to a row on a phone. */
.home-cols {
    --home-rule: #c2c2c2;
    --home-card-head: #e7e7e7;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    max-width: 96rem;
}

/* A word too long for its list breaks instead of overflowing it. */
.home-col {
    overflow-wrap: anywhere;
}

.home-col h2 {
    border-bottom: 1px solid var(--home-rule);
    font-size: 1.3em;
}

/* A heading links to where its list's "more..." goes, and looks like a heading. */
.home-col h2 a {
    color: inherit;
    text-decoration: none;
}

.home-col ul {
    list-style: none;
    padding: 0;
}

.home-col li {
    padding: 0.35rem 0;
    line-height: 1.3;
}

.home-col li:not(.home-col-more) a {
    font-weight: bold;
}

.home-col-date {
    display: block;
    color: #555;
    font-size: 85%;
}

@media not all and (min-width: 72rem) {
    .home-col {
        border: 1px solid var(--home-rule);
        border-radius: 0.5rem;
        /* keeps the heading's background inside the rounded corners */
        overflow: hidden;
    }
    .home-col h2 {
        background: var(--home-card-head);
        padding: 0.4rem 0.75rem;
    }
    .home-col ul {
        padding: 0.3rem 0.75rem 0.5rem;
    }
}

@media (min-width: 40rem) {
    .home-cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 72rem) {
    .home-cols {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        gap: 2rem;
    }
    .home-col h2 {
        padding-bottom: 0.2rem;
        margin-bottom: 0.5rem;
    }
}

.stream-item-thumb-wrapper {
    display: flex;
    align-items: center;
    flex-direction: column;
}

.stream-item-type {
    margin: 0;
    padding: 0;
    line-height: 1;
    text-align: center;
    font-family: monospace;
    font-size: 110%;
}

.stream-item h2 {
    margin: 0;
    text-align: center;
    font-size: 1.27rem;
}

.stream-item-date {
    text-align: center;
    margin-bottom: 0.25rem;
}

.stream-item.featured {
    border-color: #939300;
    background: #ffffe4;
}

.fstar {
    display: inline;
    margin: 0;
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
}

li > ul, li > ol {
    padding-bottom: 0;
}

/* The footnote list follows a rule, not a paragraph whose padding would set it apart. */
.footnotes > ol {
    margin-top: 1em;
}

#avatar {
    border-radius: 2rem;
    margin-bottom: 0;
    margin-top: 0.5rem;
}

.highlight > pre {
    margin: 0;
}

/* Override Hugo's inline Monokai comment color for readable contrast. */
.highlight [style*="#75715e"] {
    color: #a6a28c !important;
}

a.playground {
    font-size: 1rem;
    margin: 0;
}

#about {
    max-width: 58rem;
}

#TableOfContents {
    background: rgb(231, 231, 231);
    border: 1px solid gray;
    margin-top: 1em;
    margin-bottom: 1em;
    width: max-content;
    margin-right: 1em;
    padding-right: 1em;
    padding-top: 1em;
    float: left;
}

/* https://stackoverflow.com/questions/4098195/can-ordered-list-produce-result-that-looks-like-1-1-1-2-1-3-instead-of-just-1 */

#TableOfContents ul {
    counter-reset: item;
    padding-inline-start: 1em;
    margin-block-start: 0;
    margin-block-end: 0;
}

#TableOfContents li {
    display: block;
}

#TableOfContents li:before {
    content: counters(item, ".") ". ";
    counter-increment: item;
}

blockquote {
    border-left: 4px solid gray;
    background: #eee;
    margin: 0;
    padding: 0;
    padding-left: 0.5em;
    padding-right: 0.5em;
    margin-bottom: 1em;
}

blockquote > p:last-child {
    padding-bottom: 0;
}

.related-posts .stream-item {
    display: inline-block;
}

#topbar {
    background: #e7e7e7;
    border-bottom: 1px solid #c2c2c2;
    padding: 0.5rem;
    font-family: sans-serif;
    margin: -0.5rem -0.5rem 0 -0.5rem;
    font-size: 1rem;
}

#metop {
    display: flex;
    flex-direction: row;
    font-family: sans-serif;
    max-width: 60em;
    margin-bottom: 2em;
    gap: 2em;
}

#metop-left {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#metop-right {
    font-size: 1.3em;
}

#me-links {
    margin-top: 1em;
}

#avatar {
    box-shadow: 0px 0px 20px 0px black;
    display: inline;
}

/* on the homepage, the spinning octahedron (/avatar/oct.js) replaces the avatar when the "oct" class is set. The hidden
   avatar's link keeps its place in the layout, so nothing around it moves, and the picture isn't rendered, so (being
   loading="lazy") it isn't downloaded unless the gem goes away; the gem is --oct big (oct.js reads it), centered on the
   avatar's spot, and overflows it */
#oct-box {
    --oct: 224px;
    display: inline-block;
    position: relative;
    margin-top: 0.5rem;
}

#oct-box #avatar {
    display: block;
    margin-top: 0;
}

#oct, #oct-still, #oct-hit, #sparks {
    display: none;
}

.oct #oct-box > a {
    display: block;
    width: 160px;
    height: 160px;
    visibility: hidden;
}

.oct #oct-box #avatar {
    display: none;
}

/* nudged (which moves nothing else) so the gem clears the top bar and the window's left edge */
.oct #oct-box {
    left: 16px;
    top: 16px;
}

/* a soft haze in the gem's colors behind it, under the page's text */
.oct #oct-box::before {
    content: "";
    position: absolute;
    left: calc(50% - var(--oct) / 2);
    top: calc(50% - var(--oct) / 2);
    width: var(--oct);
    height: var(--oct);
    border-radius: 50%;
    background: conic-gradient(#e700ce, #a400e8, #4500e7, #00e7e7, #2fe700, #e7cf00, #e700ce);
    filter: blur(30px);
    opacity: 0.38;
    pointer-events: none;
    z-index: -1;
}

/* the canvas is bigger than the gem, so a popped or charged gem has room to grow. Until the gem is first hovered or
   touched, a picture of the canvas's first frame (oct-still.webp, see oct.js) sits in its place */
.oct #oct, .oct #oct-still {
    display: block;
    position: absolute;
    left: calc(50% - var(--oct) * 0.75);
    top: calc(50% - var(--oct) * 0.75);
    width: calc(var(--oct) * 1.5);
    height: calc(var(--oct) * 1.5);
    pointer-events: none;
    z-index: 1;
}

.oct #oct-hit {
    display: block;
    position: absolute;
    left: calc(50% - var(--oct) * 0.4);
    top: calc(50% - var(--oct) * 0.4);
    width: calc(var(--oct) * 0.8);
    height: calc(var(--oct) * 0.8);
    border-radius: 50%;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    z-index: 2;
}

#oct-hit.drag {
    cursor: grabbing;
}

/* the gem's sparks fly over the page, under the gem */
.oct #sparks {
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    image-rendering: pixelated;
    z-index: 0;
}

#me-links {
    line-height: 1.8;
}

#about-summary {
    font-family: sans-serif;
    font-size: 150%;
}

.byline-avatar {
    display: inline;
    margin: 0;
    vertical-align: top;
}

.dia {
    display: flex;
    line-height: 1;
    gap: 0.5em;
    margin-bottom: 1em;
}

.dia > img.dia-img {
    display: inline;
    height: 4em;
    margin: 0;
}

.dia-text {
    display: inline-block;
    line-height: 1.5;
    background: rgb(224, 224, 224);
    border: 2px solid gray;
    padding: 0.5em;
    height: min-content;
    border-radius: 0.75em;
}

dl {
    margin-top: 0;
}

.rel-list {
    list-style: none;
    padding: 0;
}

#meta {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
}

#meta a, #ai-info a {
    text-decoration: none;
}

#meta a:hover {
    text-decoration: underline;
}

#meta > .meta-other {
    text-align: right;
}

.meta-other > #license-info {
    margin-top: 1rem;
}

#ai-info {
    margin-top: 1em;
    color: #121212;
}

#comments h2 {
    margin-bottom: 0.5em;
}

.comment {
    margin-bottom: 1em;
    border-left: 1px dashed black;
    padding: 0.25em;
    padding-left: 0.5em;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4em;
}

.comment-avatar {
    width: 1.5em;
    height: 1.5em;
    border-radius: 50%;
    /* Without the margin every img gets, which would raise the avatar above the name next to it. */
    margin-bottom: 0;
}

.comment-author {
    font-weight: bold;
}

.comment-meta a {
    text-decoration: none;
}

.comment-meta a:hover {
    text-decoration: underline;
}

.comment-author-badge {
    background: #1d3557;
    color: #fff;
    border-radius: 4px;
    padding: 0.05em 0.4em;
    font-size: 80%;
}

.comment-date {
    color: #555;
    font-size: 90%;
}

.comment-text {
    margin-top: 0.2em;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.comment-html {
    margin-top: 0.2em;
    overflow-wrap: break-word;
}

.comment-html > :last-child {
    padding-bottom: 0;
    margin-bottom: 0;
}

/* LessWrong footnotes: keep the note on the same line as its ^ back-link. */
.comment-html li > div,
.comment-html li > div > p:first-child {
    display: inline;
}

.comment-html li > div {
    margin-left: 0.3em;
}

.comment-html img {
    max-width: 100%;
    height: auto;
}

.comment-html :is(h1, h2, h3, h4, h5, h6) {
    font-size: 1em;
}

.comment-html summary > * {
    display: inline;
}

/* Wide tables scroll inside the comment instead of widening the page. */
.comment-html table {
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.comment-html :is(td, th) {
    border: 1px solid #ccc;
    padding: 0.2em 0.4em;
}

.comment-html :is(td, th) > p {
    padding-bottom: 0;
}

.list-entry {
    display: flex;
    text-align: left;
}

.list-entry > a {
    min-width: 0;
    overflow-wrap: anywhere;
}

.list-date {
    flex: 0 0 11em;
    display: block;
}

details {
    border: 1px solid rgb(70, 70, 70);
    background: rgb(241, 241, 241);
    padding: 0.5em;
    margin-bottom: 1em;
}

details > summary {
    cursor: pointer;
}

details:not([open]) > summary::after {
    content: "(click to expand)";
    font-size: 0.85em;
    opacity: 0.5;
    margin-left: 0.4em;
}

.sidenote {
    border: 1px solid rgb(70, 70, 70);
    background: rgb(241, 241, 241);
    padding: 1em 0.75em 0;
    margin: 1em 0;
    position: relative;
}

.sidenote > :last-child {
    margin-bottom: 0;
}

.sidenote-label {
    position: absolute;
    top: -0.7em;
    left: 0.75em;
    background: rgb(241, 241, 241);
    padding: 0 0.4em;
    font-style: italic;
    font-size: 0.9em;
    color: rgb(70, 70, 70);
}

.post-cta {
    border: 1px solid rgb(50, 100, 140);
    background: rgb(234, 243, 250);
    padding: 1em 0.75em 0.75em;
    margin: 0.75em 0 1em;
    position: relative;
}

.post-cta-label {
    position: absolute;
    top: -0.7em;
    left: 0.75em;
    background: rgb(234, 243, 250);
    padding: 0 0.4em;
    font-weight: bold;
    font-size: 0.9em;
    color: rgb(50, 100, 140);
}

.post-cta > p:last-of-type {
    margin-bottom: 0;
}

.post-cta-lastmod {
    margin-top: 0.5em;
    font-size: 0.8em;
    color: rgb(100, 120, 140);
    font-style: italic;
}

/* Clicking it swaps in the newsletter form, so it looks like a button, with the form's border. */
#newsletter-open {
    display: inline-block;
    margin: 0.25em 0;
    padding: 0.3em 0.8em;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f8f8f8;
    color: inherit;
    text-decoration: none;
}

#newsletter-open:hover {
    border-color: #999;
    background: #eeeeee;
}

ol.spec-list {
    margin-top: 0;
    counter-reset: item;
    list-style-type: none;
}

ol.spec-list > li:before {
    content: attr(data-prefix) '.' counter(item, decimal) '. ';
    counter-increment: item;
}

#blog-posts > summary {
    cursor: pointer;
}

#blog-posts[open] {
    cursor: unset;
    background: white;
}

summary h2 {
    display: inline;
}

/* #verbose-slider[value="-1"] ~ .stream > .stream-item[data-verbose="0"],
#verbose-slider[value="-1"] ~ .stream > .stream-item[data-verbose="1"],
#verbose-slider[value="0"]  ~ .stream > .stream-item[data-verbose="1"] 
{
    display: none;
} */

.cw {
    background-color: rgb(253, 255, 243);
    border: 1.5px solid rgb(184, 120, 0);
    padding: 0.5em;
    margin-bottom: 1em;
}

/* Footnotes copied into the right margin, next to their references (see post/single.html). Shown only on screens
   whose margin can fit a 12rem column: the post is 45rem wide and centered, and the column leaves 2rem on each side.
   A printout, however wide its paper, has just the footnotes at the bottom. */
.margin-notes {
    display: none;
}

@media screen and (min-width: 77rem) {
    #content {
        position: relative;
    }
    .margin-notes {
        display: block;
        position: absolute;
        top: 0;
        left: calc(100% + 2rem);
        width: min(18rem, calc((100vw - 45rem) / 2 - 4rem));
    }
    /* Only where its margin note is shown. */
    .footnote-ref-hover {
        background: #fff8d4;
        box-shadow: 0 0 0 0.15em #fff8d4;
    }
}

.margin-note {
    position: absolute;
    left: 0;
    right: 0;
    font-size: 0.8em;
    line-height: 1.4;
    text-align: left;
    color: #1a1a1a;
}

/* The shadow widens the highlight past the note's edges without moving its text. */
.margin-note-hover {
    background: #fff8d4;
    box-shadow: 0 0 0 0.4em #fff8d4;
}

.margin-note p {
    padding-bottom: 0.5em;
}

.margin-note > :last-child {
    padding-bottom: 0;
}

.margin-note-num {
    font-weight: bold;
    margin-right: 0.4em;
}

@media (max-width: 900px) {
    #metop {
        flex-direction: column;
        margin-bottom: 1em;
        gap: 0;
    }
    #metop-left {
        display: block;
    }
    #me-links, #me-links > div {
        margin-top: 0;
    }
    #me-links p {
        margin-top: 0.5em;
    }
    #me-links > div, #me-links > div > ul, #me-links p, .h-card {
        text-align: left;
    }
    #on-this-site {
        display: none;
    }
}

/* On a phone, where the homepage's lists are one card wide (see .home-cols), the gem, the greeting, and the links are
   centered over them. */
@media not all and (min-width: 40rem) {
    #me-links > div, #me-links > div > ul, #me-links p, #metop .h-card {
        text-align: center;
    }
    /* centered, the gem needs no nudge to clear the window's left edge */
    .oct #oct-box {
        left: 0;
    }
}

/* Centered, the gem's canvas (1.5 × --oct wide, see .oct #oct) has to fit in the window, or it sticks out of the right
   edge and the page scrolls sideways. On a screen narrower than it, the gem is smaller. */
@media not all and (min-width: 336px) {
    #oct-box {
        --oct: 200px;
    }
}

@media (max-width: 47rem) {
    #main-section {
        /* don't try to center, causes some text to go off screen */
        display: block;
    }
    #meta {
        display: block;
    }
    /* A column this narrow has too few words on a line to justify without wide gaps. */
    #content {
        text-align: left;
    }
    #content img {
        position: relative;
        left: -8px; /* body margin */
        width: calc(100% + 8px * 2);
    }
}

@media (max-width: 470px) {
    .list-entry {
        display: block;
    }
    .stream {
        display: block;
    }
    .stream-item {
        width: 100%;
        max-width: unset;
        margin-bottom: 1rem;
        box-sizing: border-box;
        height: unset;
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0;
    }
    .stream-item h2 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    .stream-item img:not(.fstar) {
        margin-bottom: 0;
        width: 100%;
        height: 100%;
    }
    .stream.mini .stream-item {
        list-style-position: unset;
        display: block;
        margin-bottom: 0.25em;
    }
    .stream.mini .stream-item h2 {
        padding: 0;
        margin: 0;
    }
}

/* Dark mode, for visitors whose system asks for it. Everything above is the light theme; this only swaps its colors.
   color-scheme also gives links, form controls, and scrollbars the browser's dark colors. */
:root {
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    body {
        background: #111111;
        color: #ffffff;
    }

    /* Many charts and diagrams in posts are transparent, with black lines and text drawn for a white page. The color is for
       the alt text of an image that fails to load. Give an image drawn for any background class="keep-transparent". */
    #content img:not(.keep-transparent) {
        background: white;
        color: #111111;
    }

    #lastmod-info {
        color: #b0b0b0;
    }

    kbd {
        border-color: #5c6168;
        box-shadow: 1px 1px 0 #3d4147;
        color: #ffffff;
    }

    #copy-discord:hover::after,
    #copy-discord:focus-visible::after {
        background: #ffffff;
        background-clip: padding-box;
        color: #111111;
    }

    .source-link {
        color: #cccccc;
    }

    .stream-item {
        background: none;
    }

    .stream-item.featured {
        background: #26260f;
    }

    .home-cols {
        --home-rule: #383838;
        --home-card-head: #1e1e1e;
    }

    .home-col-date {
        color: #aaaaaa;
    }

    #TableOfContents {
        background: #1e1e1e;
    }

    blockquote {
        background: #222222;
    }

    #topbar {
        background: #1e1e1e;
        border-bottom-color: #383838;
    }

    .dia-text {
        background: #2a2a2a;
    }

    #ai-info {
        color: #d8d8d8;
    }

    .comment {
        border-left-color: #888888;
    }

    .comment-date {
        color: #aaaaaa;
    }

    .comment-html :is(td, th) {
        border-color: #444444;
    }

    details, .sidenote {
        border-color: #666666;
        background: #1c1c1c;
    }

    .sidenote-label {
        background: #1c1c1c;
        color: #aaaaaa;
    }

    .post-cta {
        border-color: rgb(90, 140, 185);
        background: rgb(20, 32, 44);
    }

    .post-cta-label {
        background: rgb(20, 32, 44);
        color: rgb(125, 175, 215);
    }

    .post-cta-lastmod {
        color: rgb(140, 160, 180);
    }

    #newsletter-open {
        border-color: #555555;
        background: #1c1c1c;
    }

    #newsletter-open:hover {
        border-color: #888888;
        background: #2a2a2a;
    }

    .cw {
        background: rgb(38, 33, 18);
    }

    .margin-note {
        color: #d0d0d0;
    }

    .margin-note-hover {
        background: #3a3520;
        box-shadow: 0 0 0 0.4em #3a3520;
    }
}

@media screen and (min-width: 77rem) and (prefers-color-scheme: dark) {
    .footnote-ref-hover {
        background: #3a3520;
        box-shadow: 0 0 0 0.15em #3a3520;
    }
}
