.prose {
    font-family: var(--font-sans);
    font-size: var(--fs-16);
    font-weight: var(--fw-regular);
    line-height: var(--lh-text);
    color: var(--text-1);
    overflow-wrap: anywhere;
}

.prose--compact {
    font-size: var(--fs-14);
}

.prose :where(p, ul, ol, blockquote, pre, table, figure, hr) {
    margin: 0 0 1em;
}

.prose :where(h1, h2, h3, h4) {
    margin: 1.5em 0 0.5em;
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--text-1);
}

.prose :where(h1, h2, h3, h4):first-child {
    margin-top: 0;
}

.prose h1 {
    font-size: var(--fs-32);
}

.prose h2 {
    font-size: var(--fs-24);
}

.prose h3 {
    font-size: var(--fs-20);
}

.prose h4 {
    font-size: var(--fs-18);
}

.prose--compact h1 {
    font-size: var(--fs-24);
}

.prose--compact h2 {
    font-size: var(--fs-20);
}

.prose--compact :where(h3, h4) {
    font-size: var(--fs-16);
}

.prose a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose :where(strong, b) {
    font-weight: var(--fw-bold);
}

.prose :where(ul, ol) {
    padding-left: 1.5em;
}

.prose :where(li, th, td, blockquote) :where(p):last-child {
    margin-bottom: 0;
}

.prose li > :where(p, ul, ol) {
    margin-bottom: 0.25em;
}

.prose ul[data-type="taskList"] {
    padding-left: 0;
    list-style: none;
}

.prose ul[data-type="taskList"] li {
    display: flex;
    gap: 0.5em;
}

.prose blockquote {
    padding-left: 1em;
    border-left: 3px solid var(--border-2);
    color: var(--text-2);
}

.prose code {
    padding: 0.1em 0.3em;
    border-radius: var(--radius-s);
    background: var(--bg-3);
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.prose pre {
    padding: 1em 1.25em;
    overflow-x: auto;
    border: 1px solid var(--border-1);
    border-radius: var(--radius-m);
    background: var(--bg-2);
    font-size: var(--fs-14);
    line-height: var(--lh-text);
}

.prose pre code {
    padding: 0;
    background: none;
    font-size: inherit;
}

.prose :where(.hljs-comment, .hljs-quote) {
    color: var(--text-3);
}

.prose :where(.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-type) {
    color: var(--info);
}

.prose :where(.hljs-string, .hljs-attr, .hljs-regexp) {
    color: var(--success);
}

.prose :where(.hljs-number, .hljs-literal, .hljs-symbol) {
    color: var(--warning);
}

.prose :where(.hljs-title, .hljs-section, .hljs-name) {
    color: var(--text-1);
    font-weight: var(--fw-bold);
}

.prose hr {
    height: 0;
    border: 0;
    border-top: 1px solid var(--border-1);
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-m);
}

.prose table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: var(--fs-14);
}

.prose :where(th, td) {
    padding: 0.5em 0.75em;
    border: 1px solid var(--border-1);
    text-align: left;
    vertical-align: top;
    overflow-wrap: break-word;
}

.prose th {
    background: var(--bg-2);
    font-weight: var(--fw-bold);
}

.prose mark {
    padding: 0 0.15em;
    border-radius: var(--radius-s);
    background: var(--warning-soft);
    color: inherit;
}

:root[data-scheme="dark"] .prose mark[style] {
    color: var(--text-inverse);
}

.prose .katex {
    font-size: 1.1em;
}

@media (max-width: 600px) {
    .prose h1 {
        font-size: var(--fs-24);
    }

    .prose h2 {
        font-size: var(--fs-20);
    }

    .prose h3 {
        font-size: var(--fs-18);
    }
}
