:root {
  color-scheme: light; --bg: #fff; --text: #000; --muted: #595959; --line: #ccc; --code: #f5f5f5; --error-bg: #eee;
  --syntax-comment: #556b58; --syntax-keyword: #7545a3; --syntax-string: #116b56; --syntax-number: #a34612;
  --syntax-title: #005d9b; --syntax-variable: #884c1d; --syntax-deletion: #a12622;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark; --bg: #000; --text: #fff; --muted: #b3b3b3; --line: #444; --code: #171717; --error-bg: #222;
  --syntax-comment: #98ad9b; --syntax-keyword: #d0a7ed; --syntax-string: #96d7ba; --syntax-number: #f3b77c;
  --syntax-title: #85c9f2; --syntax-variable: #e6c393; --syntax-deletion: #ffaba7;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 17px; line-height: 1.7; }
a { color: var(--text); text-underline-offset: .2em; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; border: 1px solid var(--line); background: var(--bg); border-radius: 4px; padding: .35rem .7rem; cursor: pointer; }
button:hover { border-color: var(--text); }
:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
[hidden] { display: none !important; }
main, footer { margin: auto; padding-left: clamp(20px, 3vw, 48px); padding-right: clamp(20px, 3vw, 48px); }
.reader-controls { position: absolute; top: 16px; right: clamp(20px, 3vw, 48px); display: flex; flex-direction: column; gap: 8px; }
.icon-button { display: inline-grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; padding: 0; font-size: 21px; line-height: 1; }
main { min-height: 70vh; padding-top: 16px; padding-right: calc(clamp(20px, 3vw, 48px) + 48px); padding-bottom: 32px; }
h1, h2, h3, h4 { line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-top: 24px; margin-bottom: 28px; }
h2 { margin-top: 2.2rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); font-size: 1.5rem; }
h3 { margin-top: 1.8rem; font-size: 1.2rem; }
.error, #issues { border-left: 3px solid var(--text); background: var(--error-bg); color: var(--text); padding: 12px 16px; font-size: 14px; overflow-wrap: anywhere; }
#issues p { margin: .25rem 0; }
.markdown-body { min-width: 0; display: flow-root; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body p { overflow-wrap: anywhere; }
.markdown-body img { max-width: 100%; height: auto; }
.markdown-body figure { margin: 24px 0; }
figcaption { color: var(--muted); font-size: 13px; }
.markdown-body .media-sized { --media-width: auto; --media-max-width: 100%; width: var(--media-width); max-width: min(100%, var(--media-max-width)); }
.markdown-body .media-right { float: right; margin: 0 0 1rem 1.5rem; }
.markdown-body .media-left { float: left; margin: 0 1.5rem 1rem 0; }
.markdown-body .media-center { display: block; margin-left: auto; margin-right: auto; text-align: center; }
.markdown-body .media-align-right { text-align: right; }
.markdown-body .media-align-left { text-align: left; }
.media-caption-underline { text-decoration: underline; }
blockquote { border-left: 3px solid var(--text); margin-left: 0; padding-left: 20px; color: var(--muted); }
table { display: block; width: 100%; overflow: auto; border-collapse: collapse; font-size: 14px; margin: 20px 0; }
th, td { padding: 9px 13px; border: 1px solid var(--line); text-align: left; }
th { background: var(--code); }
code, pre { font-family: "Cascadia Code", Consolas, monospace; }
code { background: var(--code); border-radius: 3px; padding: .12em .28em; font-size: .86em; overflow-wrap: anywhere; }
pre { background: var(--code); border: 1px solid var(--line); border-radius: 7px; padding: 18px; overflow: auto; font-size: 13px; line-height: 1.65; tab-size: 4; }
pre code { padding: 0; border: 0; font-size: inherit; white-space: pre; overflow-wrap: normal; }
details { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); margin: 18px 0; padding: 0 18px; min-width: 0; display: flow-root; }
summary { padding: 12px 0; cursor: pointer; font-size: 15px; font-weight: 600; }
details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 16px; }
details > :last-child:not(summary) { margin-bottom: 18px; }
.include-source { font-size: 12px; color: var(--muted); }
.code-source {
  display: inline-grid; place-items: center; min-width: 24px; min-height: 24px; white-space: nowrap;
  font-size: 16px; font-weight: normal;
  color: var(--text); text-decoration: none;
}
.code-source > code { all: revert; letter-spacing: -.12em; }
.code-source:hover { text-decoration: underline; }
summary > .code-source { margin-left: .6em; vertical-align: middle; }
.code-excerpt { position: relative; margin: 1em 0; }
.code-excerpt > pre { margin: 0; }
.code-excerpt > .code-source { position: absolute; top: 8px; right: 0; }
.code-excerpt > .code-source + * { margin-right: 32px; }
.diagram { margin: 20px 0; overflow-x: auto; text-align: center; }
.diagram svg { display: block; max-width: 100%; height: auto; margin: auto; }
.diagram > .error { text-align: left; }
/* The page is monochrome; syntax colors remain distinct in both themes. */
.hljs-comment, .hljs-quote { color: var(--syntax-comment); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-meta { color: var(--syntax-keyword); }
.hljs-string, .hljs-attr, .hljs-regexp, .hljs-addition { color: var(--syntax-string); }
.hljs-number, .hljs-symbol, .hljs-bullet { color: var(--syntax-number); }
.hljs-title, .hljs-built_in, .hljs-type, .hljs-name { color: var(--syntax-title); }
.hljs-variable, .hljs-params, .hljs-template-variable { color: var(--syntax-variable); }
.hljs-deletion { color: var(--syntax-deletion); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
footer { border-top: 1px solid var(--line); padding-top: 12px; padding-bottom: 16px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
footer p { margin: 0; }
@media (max-width: 640px) {
  main, footer { padding-left: 20px; padding-right: 20px; }
  main { padding-right: 68px; }
  body { font-size: 16px; }
  details { padding: 0 12px; }
  pre { padding: 12px; }
  .markdown-body .media-right, .markdown-body .media-left { float: none; display: block; margin: 1rem 0; max-width: 100%; }
  .markdown-body figure.media-right, .markdown-body figure.media-left { width: 100%; }
}
@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light; --bg: white; --text: black; --muted: #595959; --line: #ccc; --code: #f5f5f5; --error-bg: #eee;
    --syntax-comment: #556b58; --syntax-keyword: #7545a3; --syntax-string: #116b56; --syntax-number: #a34612;
    --syntax-title: #005d9b; --syntax-variable: #884c1d; --syntax-deletion: #a12622;
  }
  .reader-controls, footer { display: none; }
  body { background: white; color: black; }
  main { max-width: none; padding: 0; }
}
