/* Shared reading rhythm; source Markdown and outer card design stay intact. */
.source-markdown, .original-body.source-markdown {
  color: var(--body); font-size: 16px; font-weight: 400; line-height: 1.8;
  white-space: normal; overflow-wrap: anywhere;
}
.source-markdown :where(p, ul, ol, blockquote, pre, table, hr, h1, h2, h3, h4, h5, h6) {
  margin: 0; padding-block: 0; border-top: 0;
}
.source-markdown :where(p, li) { font-size: inherit; line-height: inherit; color: inherit; }
.source-markdown p { white-space: pre-wrap; }
.source-markdown :is(p, ul, ol, blockquote, pre, table, hr, h1, h2, h3, h4, h5, h6) + :is(p, ul, ol, blockquote, pre, table, hr) { margin-top: 16px; }
.reader-card .source-markdown p + p { margin-top: 16px; padding-top: 0; border-top: 0; }
.source-markdown :is(h1, h2, h3, h4, h5, h6) {
  margin: 24px 0 0; color: var(--ink); font-weight: 600; line-height: 1.45;
}
.source-markdown :is(h1, h2) { font-size: 22px; }
.source-markdown h3 { font-size: 19px; }
.source-markdown :is(h4, h5, h6) { font-size: 16px; }
.source-markdown > :first-child { margin-top: 0; }
.source-markdown > :last-child { margin-bottom: 0; }
.source-markdown ul { list-style: disc; padding-left: 1.4em; }
.source-markdown ol { list-style: decimal; padding-left: 1.4em; }
.source-markdown li + li { margin-top: 8px; }
.source-markdown li > :is(ul, ol), .source-markdown li > p + p { margin-top: 8px; }
.source-markdown li > :first-child { margin-top: 0; }
.source-markdown blockquote { padding-left: 16px; border-left: 2px solid var(--border); }
.source-markdown blockquote > :first-child { margin-top: 0; }
.source-markdown pre { max-width: 100%; overflow: auto; white-space: pre; }
.source-markdown code { font-size: 1em; }
.source-markdown table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.source-markdown th, .source-markdown td { padding: 6px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.source-markdown a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.source-markdown .material-source, .source-markdown .material-preview { text-decoration: none; }
.source-markdown .material-card { font-size: 16px; font-weight: 400; line-height: 1.8; white-space: normal; }
.source-markdown .source-image { display: block; max-width: 100%; height: auto; margin: 16px 0; }
.source-markdown .source-file { display: grid; gap: 30px; margin: 30px 0; padding: 26px; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: transparent; }
.source-file video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.source-file audio { display: block; width: 100%; }
.source-file .source-image { margin: 0; }
.source-pdf { display: block; width: 100%; height: 600px; max-height: 70dvh; border: 0; }
.source-diagram { display: block; position: relative; white-space: pre-wrap; }
.source-diagram iframe { display: block; width: 100%; border: 0; }
.source-markdown .katex-display { max-width: 100%; overflow: auto hidden; margin: 24px 0; }
.original-body :is(img.is-context, .source-file.is-context, .is-context .source-diagram) { opacity: .45; }
@media (max-width: 520px) { .source-markdown .source-file { padding: 18px; } }
