/* Markdown editor: the preview's typography. Also inlined into "Download HTML", so it styles .md-doc on its own
   (no app.css variables needed; dark colours only inside the app). */
.md-doc { --d-ink: #1c1e21; --d-ink2: #3b3f45; --d-muted: #6b7078; --d-line: #e6e6e2; --d-soft: #f5f5f3; --d-code: #f3f3f0; --d-link: #1f4fd1; --d-mark: #fff3bf;
  max-width: 72ch; margin: 0 auto; color: var(--d-ink); font: 16px/1.7 ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word; contain: layout paint; -webkit-font-smoothing: antialiased }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .md-app .md-doc { --d-ink: #e9e8e4; --d-ink2: #c9c7c1; --d-muted: #9b9a94; --d-line: #2c2f33; --d-soft: #1c1e21; --d-code: #222428; --d-link: #8fb0ff; --d-mark: #5c4a0a } }
:root[data-theme="dark"] .md-app .md-doc { --d-ink: #e9e8e4; --d-ink2: #c9c7c1; --d-muted: #9b9a94; --d-line: #2c2f33; --d-soft: #1c1e21; --d-code: #222428; --d-link: #8fb0ff; --d-mark: #5c4a0a }

.md-doc > :first-child { margin-top: 0 }
.md-doc :is(h1, h2, h3, h4, h5, h6, [role="heading"]) { margin: 1.6em 0 .55em; color: var(--d-ink); font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif; line-height: 1.22; text-wrap: balance }
.md-doc :is(h1, [data-h="1"]) { font-size: 2.05em; font-weight: 750; letter-spacing: -.026em }
.md-doc :is(h2, [data-h="2"]) { font-size: 1.5em; font-weight: 700; letter-spacing: -.018em; padding-bottom: .3em; border-bottom: 1px solid var(--d-line) }
.md-doc :is(h3, [data-h="3"]) { font-size: 1.2em; font-weight: 680; letter-spacing: -.01em }
.md-doc :is(h4, [data-h="4"]) { font-size: 1.02em; font-weight: 680 }
.md-doc :is(h5, [data-h="5"]) { font-size: .92em; font-weight: 680 }
.md-doc :is(h6, [data-h="6"]) { font-size: .86em; font-weight: 680; color: var(--d-muted) }
.md-doc :is(p, ul, ol, blockquote, pre, table, details, dl, .math-display, .mermaid) { margin: 0 0 1.05em }
.md-doc a { color: var(--d-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em }
.md-doc a:hover { text-decoration-thickness: 2px }
.md-doc strong { font-weight: 680 }
.md-doc mark { background: var(--d-mark); color: inherit; border-radius: 3px; padding: 0 .15em }
.md-doc :is(ul, ol) { padding-left: 1.6em }
.md-doc li { margin: .25em 0 }
.md-doc li > :is(ul, ol) { margin: .25em 0 0 }
.md-doc li > p { margin: 0 0 .5em }
.md-doc ::marker { color: var(--d-muted) }
.md-doc .task-list { padding-left: .2em; list-style: none }
.md-doc .task-item > :is(ul, ol) { padding-left: 1.6em }
.md-doc .task { width: 1.05em; height: 1.05em; margin: 0 .55em 0 0; vertical-align: -.15em; accent-color: var(--d-link); cursor: pointer }
.md-doc .task-item:has(> .task:checked) { color: var(--d-muted) }
.md-doc blockquote { padding: .15em 0 .15em 1.1em; border-left: 3px solid var(--d-line); color: var(--d-ink2) }
.md-doc blockquote > :last-child { margin-bottom: 0 }
.md-doc hr { height: 0; margin: 2em 0; border: 0; border-top: 1px solid var(--d-line) }
.md-doc img { max-width: 100%; height: auto; border-radius: 8px }
.md-doc :not(pre) > code { padding: .14em .38em; border-radius: 5px; background: var(--d-code); font: .86em/1 ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace }
.md-doc pre { overflow: auto; padding: 14px 16px; border-radius: 10px; background: var(--d-soft); font: 13.5px/1.6 ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; tab-size: 2 }
.md-doc pre code { font: inherit; background: none; padding: 0; white-space: pre }
.md-doc table { display: block; width: max-content; max-width: 100%; overflow: auto; border-collapse: collapse; font-size: .94em; font-variant-numeric: tabular-nums }
.md-doc :is(th, td) { padding: 7px 12px; border: 1px solid var(--d-line) }
.md-doc th { font-weight: 650; text-align: left; background: var(--d-soft) }
.md-doc kbd { padding: .1em .45em; border: 1px solid var(--d-line); border-bottom-width: 2px; border-radius: 5px; font: .82em ui-monospace, Menlo, Consolas, monospace }
.md-doc details { padding: .6em .9em; border: 1px solid var(--d-line); border-radius: 10px }
.md-doc summary { font-weight: 600; cursor: pointer }
.md-doc details[open] summary { margin-bottom: .5em }
.md-doc .footnotes { margin-top: 2.5em; color: var(--d-muted); font-size: .88em }
.md-doc .footnotes-sep { margin: 2.5em 0 1em }
.md-doc .footnote-ref a, .md-doc .footnote-backref { text-decoration: none }
.md-doc .math-display { overflow-x: auto; overflow-y: hidden; text-align: center }
.md-doc .math:not([data-tex]) { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--d-muted) }
.md-doc .mermaid { display: flex; justify-content: center; overflow-x: auto }
.md-doc .mermaid:not([data-done]) { white-space: pre; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--d-muted); justify-content: flex-start }
.md-doc .mermaid svg { max-width: 100%; height: auto }
.md-doc .mermaid-error { width: 100%; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, #dc2626 8%, transparent); color: #b91c1c; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap }
@media print { .md-doc { max-width: none; contain: none; font-size: 11pt } .md-doc pre, .md-doc table, .md-doc img, .md-doc .mermaid { break-inside: avoid } .md-doc :is(h1, h2, h3, [data-h="1"], [data-h="2"], [data-h="3"]) { break-after: avoid } }
