/* ── Markdown content container ─────────────────────────────────────────── */
.md-content {
    font-size: 0.875rem;
    line-height: 1.7;
    color: #24292f;
}
html.dark .md-content {
    color: #e6edf3;
}

/* ── Headings ───────────────────────────────────────────────────────────── */
.md-content h1, .md-content h2, .md-content h3,
.md-content h4, .md-content h5, .md-content h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}
.md-content h1 { font-size: 1.75em; border-bottom: 1px solid #d0d7de; padding-bottom: 0.25em; }
.md-content h2 { font-size: 1.4em;  border-bottom: 1px solid #d0d7de; padding-bottom: 0.2em; }
.md-content h3 { font-size: 1.15em; }
.md-content h4 { font-size: 1em; }
.md-content h5 { font-size: 0.9em; }
.md-content h6 { font-size: 0.85em; color: #57606a; }

html.dark .md-content h1,
html.dark .md-content h2 { border-bottom-color: #30363d; }
html.dark .md-content h6 { color: #8b949e; }

/* ── Paragraphs & text ──────────────────────────────────────────────────── */
.md-content p { margin-top: 0; margin-bottom: 1em; }
.md-content strong { font-weight: 600; }
.md-content em { font-style: italic; }

/* ── Links ──────────────────────────────────────────────────────────────── */
.md-content a { color: #0969da; text-decoration: underline; }
.md-content a:hover { color: #0550ae; }
html.dark .md-content a { color: #58a6ff; }
html.dark .md-content a:hover { color: #79c0ff; }

/* ── Lists ──────────────────────────────────────────────────────────────── */
.md-content ul, .md-content ol {
    margin-top: 0;
    margin-bottom: 1em;
    padding-left: 2em;
}
.md-content ul { list-style-type: disc; }
.md-content ol { list-style-type: decimal; }
.md-content li { margin-bottom: 0.25em; }
.md-content li > ul, .md-content li > ol { margin-bottom: 0; }

/* ── Blockquote ─────────────────────────────────────────────────────────── */
.md-content blockquote {
    border-left: 4px solid #d0d7de;
    margin: 1em 0;
    padding: 0.25em 1em;
    color: #57606a;
}
html.dark .md-content blockquote {
    border-left-color: #3d444d;
    color: #8b949e;
}

/* ── Horizontal rule ────────────────────────────────────────────────────── */
.md-content hr {
    border: none;
    border-top: 1px solid #d0d7de;
    margin: 1.5em 0;
}
html.dark .md-content hr { border-top-color: #30363d; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.md-content table {
    border-collapse: collapse;
    margin-bottom: 1em;
    width: 100%;
    overflow-x: auto;
    display: block;
}
.md-content th, .md-content td {
    border: 1px solid #d0d7de;
    padding: 0.4em 0.8em;
    text-align: left;
}
.md-content th {
    background: #f6f8fa;
    font-weight: 600;
}
html.dark .md-content th { background: #161b22; }
html.dark .md-content th,
html.dark .md-content td { border-color: #30363d; }

/* ── Inline code ────────────────────────────────────────────────────────── */
.md-content code {
    font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;
    font-size: 0.85em;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    padding: 0.1em 0.35em;
}
html.dark .md-content code {
    background: #161b22;
    border-color: #30363d;
}

/* ── Code blocks ────────────────────────────────────────────────────────── */
.md-content pre.md-code {
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 1em 1.25em;
    overflow-x: auto;
    margin-bottom: 1em;
    line-height: 1.5;
}
html.dark .md-content pre.md-code {
    background: #161b22;
    border-color: #30363d;
}
.md-content pre.md-code code {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.85em;
}

/* ── Syntax token classes (Light — GitHub Light palette) ────────────────── */
.tm-keyword  { color: #cf222e; }
.tm-string   { color: #0a3069; }
.tm-comment  { color: #6e7781; font-style: italic; }
.tm-constant { color: #0550ae; }
.tm-entity   { color: #8250df; }
.tm-storage  { color: #cf222e; }
.tm-support  { color: #0550ae; }
.tm-variable { color: #953800; }
.tm-punctuation { color: #24292f; }
.tm-invalid  { color: #82071e; text-decoration: underline; }

/* ── Syntax token classes (Dark — GitHub Dark palette) ─────────────────── */
html.dark .tm-keyword  { color: #ff7b72; }
html.dark .tm-string   { color: #a5d6ff; }
html.dark .tm-comment  { color: #8b949e; font-style: italic; }
html.dark .tm-constant { color: #79c0ff; }
html.dark .tm-entity   { color: #d2a8ff; }
html.dark .tm-storage  { color: #ff7b72; }
html.dark .tm-support  { color: #79c0ff; }
html.dark .tm-variable { color: #ffa657; }
html.dark .tm-punctuation { color: #e6edf3; }
html.dark .tm-invalid  { color: #ffa198; text-decoration: underline; }
