.prose {
  --tw-prose-body: #374151;
  --tw-prose-headings: #111827;
  --tw-prose-links: #111827;
  --tw-prose-bold: #111827;
  --tw-prose-counters: #6b7280;
  --tw-prose-bullets: #d1d5db;
  --tw-prose-quotes: #111827;
  --tw-prose-quote-borders: #e5e7eb;
  --tw-prose-captions: #6b7280;
  --tw-prose-code: #111827;
  --tw-prose-pre-code: #e5e7eb;
  --tw-prose-pre-bg: #1f2937;
  --tw-prose-th-borders: #d1d5db;
  --tw-prose-td-borders: #e5e7eb;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--tw-prose-body);
  max-width: 90ch;
}

.prose-cactus {
  --tw-prose-body: hsl(var(--theme-text) / 1);
  --tw-prose-headings: hsl(var(--theme-accent-2) / 1);
  --tw-prose-links: hsl(var(--theme-text) / 1);
  --tw-prose-bold: hsl(var(--theme-text) / 1);
  --tw-prose-bullets: hsl(var(--theme-text) / 1);
  --tw-prose-quotes: hsl(var(--theme-quote) / 1);
  --tw-prose-code: hsl(var(--theme-text) / 1);
  --tw-prose-th-borders: #666
}

.prose :where(.prose>:first-child) {
  margin-top: 0
}

.prose :where(.prose>:last-child) {
  margin-bottom: 0
}

.prose-sm :where(.prose-sm>:first-child) {
  margin-top: 0
}

.prose-sm :where(.prose-sm>:last-child) {
  margin-bottom: 0
}

.prose :where(p) {
  margin-top: 1.25em;
  margin-bottom: 1.25em
}

.prose :where(a) {
  color: var(--tw-prose-links);
  text-decoration: underline;
  font-weight: 500;
  background-image: linear-gradient(transparent, transparent 5px, hsl(var(--theme-text)) 5px, hsl(var(--theme-text)));
  background-size: 100% 6px;
  background-position: bottom;
  background-repeat: repeat-x
}

.prose :where(a):hover {
  background-image: linear-gradient(transparent, transparent 4px, hsl(var(--theme-link)) 4px, hsl(var(--theme-link)))
}

.prose :where(a) {
  text-decoration-line: none
}

.prose :where(strong) {
  color: var(--tw-prose-bold);
  font-weight: 700
}

.prose :where(a strong) {
  color: inherit
}

.prose :where(img) {
  margin-top: 2em;
  margin-bottom: 2em;
  border-radius: 1rem;
  border: 1px solid hsl(var(--theme-border) / 0.65);
  box-shadow: 0 18px 40px -30px hsl(var(--theme-shadow) / 0.96)
}

/* blockquote */
.prose :where(blockquote strong) {
  color: inherit
}

.prose :where(blockquote) {
  font-weight: 500;
  font-style: italic;
  color: var(--tw-prose-quotes);
  border-left-width: 3px;
  border-left-color: hsl(var(--theme-accent) / 0.6);
  border-radius: 0 0.5rem 0.5rem 0;
  background: hsl(var(--theme-bg-soft) / 0.3);
  quotes: “”” “”” “’” “’”;
  margin-top: 1.6em;
  margin-bottom: 1.6em;
  padding: 0.75em 1em
}

.prose :where(blockquote p:first-of-type):before {
  content: open-quote
}

.prose :where(blockquote p:last-of-type):after {
  content: close-quote
}

.prose :where(blockquote code) {
  color: inherit
}

.prose-sm :where(blockquote) {
  margin-top: 1.3333333em;
  margin-bottom: 1.3333333em;
  padding-left: 1.1111111em
}

/* headings */
.prose :where(h1) {
  color: var(--tw-prose-headings);
  font-weight: 800;
  font-size: 2.25em;
  margin-top: 0;
  margin-bottom: .8888889em;
  line-height: 1.1111111
}

.prose :where(h1 strong) {
  font-weight: 900;
  color: inherit
}

.prose :where(h2) {
  color: var(--tw-prose-headings);
  font-weight: 700;
  font-size: 1.5em;
  margin-top: 2em;
  margin-bottom: 1em;
  line-height: 1.3333333
}

.prose :where(h2 strong) {
  font-weight: 800;
  color: inherit
}

.prose :where(h3) {
  color: var(--tw-prose-headings);
  font-weight: 600;
  font-size: 1.25em;
  margin-top: 1.6em;
  margin-bottom: .6em;
  line-height: 1.6
}

.prose :where(h3 strong) {
  font-weight: 700;
  color: inherit
}

.prose :where(h4) {
  color: var(--tw-prose-headings);
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: .5em;
  line-height: 1.5
}

.prose :where(h4 strong) {
  font-weight: 700;
  color: inherit
}

.prose :where(h2+*) {
  margin-top: 0
}

.prose :where(h3+*) {
  margin-top: 0
}

.prose :where(h4+*) {
  margin-top: 0
}

.prose :where(h1 code) {
  color: inherit
}

.prose :where(h2 code) {
  color: inherit;
  font-size: .875em
}

.prose :where(h3 code) {
  color: inherit;
  font-size: .9em
}

.prose :where(h4 code) {
  color: inherit
}

/* small headings */
.prose-sm :where(h1) {
  font-size: 2.1428571em;
  margin-top: 0;
  margin-bottom: .8em;
  line-height: 1.2
}

.prose-sm :where(h2) {
  font-size: 1.4285714em;
  margin-top: 1.6em;
  margin-bottom: .8em;
  line-height: 1.4
}

.prose-sm :where(h3) {
  font-size: 1.2857143em;
  margin-top: 1.5555556em;
  margin-bottom: .4444444em;
  line-height: 1.5555556
}

.prose-sm :where(h4) {
  margin-top: 1.4285714em;
  margin-bottom: .5714286em;
  line-height: 1.4285714
}

.prose-sm :where(h2 code) {
  font-size: .9em
}

.prose-sm :where(h3 code) {
  font-size: .8888889em
}

.prose-sm :where(h2+*) {
  margin-top: 0
}

.prose-sm :where(h3+*) {
  margin-top: 0
}

.prose-sm :where(h4+*) {
  margin-top: 0
}

/* prose-headings */
.prose-headings\:font-semibold :is(:where(h1, h2, h3, h4, h5, h6, th)) {
  font-weight: 600
}

.prose-headings\:text-accent-2 :is(:where(h1, h2, h3, h4, h5, h6, th)) {
  --tw-text-opacity: 1;
  color: hsl(var(--theme-accent-2) / var(--tw-text-opacity))
}

.prose-headings\:before\:absolute :is(:where(h1, h2, h3, h4, h5, h6, th)):before {
  position: absolute
}

.prose-headings\:before\:-ml-4 :is(:where(h1, h2, h3, h4, h5, h6, th)):before {
  margin-left: -1rem
}

.prose-headings\:before\:-ms-4 :is(:where(h1, h2, h3, h4, h5, h6, th)):before {
  margin-inline-start: -1rem
}

.prose-headings\:before\:text-accent :is(:where(h1, h2, h3, h4, h5, h6, th)):before {
  --tw-text-opacity: 1;
  color: hsl(var(--theme-accent) / var(--tw-text-opacity))
}

/* Heading anchor styling */
.prose :where(h2, h3, h4) {
  position: relative;
  cursor: default;
  scroll-margin-top: 6rem;
}
.prose :where(h2, h3, h4):target {
  color: hsl(var(--theme-accent) / 1);
}
.prose :where(h2, h3, h4):target:before {
  color: hsl(var(--theme-accent) / 1);
}

/* code */
.prose :where(code) {
  color: var(--tw-prose-code);
  font-weight: 600;
  font-size: .875em;
  border: 1px solid hsl(var(--theme-border) / 0.65);
  border-radius: .35rem;
  background: hsl(var(--theme-bg-soft) / 0.55);
  padding: .14rem .38rem
}

.prose :where(code):before {
  content: "`"
}

.prose :where(code):after {
  content: "`"
}

.prose :where(a code) {
  color: inherit
}

.prose :where(pre) {
  position: relative;
  max-width: 100%;
  color: var(--tw-prose-pre-code);
  background:
    linear-gradient(180deg, hsl(var(--theme-bg-elevated) / 0.95), hsl(var(--theme-bg) / 0.92)),
    var(--tw-prose-pre-bg);
  border: 1px solid hsl(var(--theme-border) / 0.65);
  overflow-x: auto;
  font-weight: 400;
  font-size: .875em;
  line-height: 1.7142857;
  margin-top: 1.7142857em;
  margin-bottom: 1.7142857em;
  border-radius: 1rem;
  box-shadow: 0 18px 42px -34px hsl(var(--theme-shadow) / 1);
  padding: 2.75rem 1rem 1rem
}

.prose :where(pre code) {
  background-color: transparent;
  border-width: 0;
  border-radius: 0;
  padding: 0;
  font-weight: inherit;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  line-height: inherit;
  display: block;
  min-width: 100%
}

.prose :where(pre code):before {
  content: none
}

.prose :where(pre code):after {
  content: none
}

.prose-sm :where(code) {
  font-size: .875rem;
  font-weight: 400
}

.prose-sm :where(pre) {
  font-size: .8571429em;
  line-height: 1.6666667;
  margin-top: 1.6666667em;
  margin-bottom: 1.6666667em;
  border-radius: 1rem;
  padding: 2.65rem .95rem .95rem
}

.prose :where(figure[data-rehype-pretty-code-figure]) {
  margin-top: 1.75em;
  margin-bottom: 1.75em
}

.prose :where(figure[data-rehype-pretty-code-figure] pre) {
  margin-top: 0;
  margin-bottom: 0
}

.prose :where(pre[data-language]):before {
  content: attr(data-language);
  position: absolute;
  top: .85rem;
  right: 1rem;
  border: 1px solid hsl(var(--theme-border) / 0.7);
  border-radius: 999px;
  padding: .2rem .55rem;
  background: hsl(var(--theme-bg-soft) / 0.8);
  color: hsl(var(--theme-text-muted) / 1);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase
}

.prose :where(pre code [data-line]) {
  display: block;
  min-height: 1.5em;
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 1rem;
  padding-right: 1rem
}

.prose :where(pre code [data-highlighted-line]) {
  background: linear-gradient(90deg, hsl(var(--theme-link) / 0.14), hsl(var(--theme-accent) / 0.08));
  border-left: 2px solid hsl(var(--theme-link-soft) / 1)
}

.prose :where(pre code [data-highlighted-chars]) {
  border-radius: .25rem;
  background: hsl(var(--theme-bg-soft) / 0.92);
  box-shadow: 0 0 0 1px hsl(var(--theme-border) / 0.55)
}

.prose :where(pre code [data-line] span) {
  font-style: normal
}

/* lists */
.prose :where(ol) {
  list-style-type: decimal;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.625em
}

.prose :where(ol[type=A]) {
  list-style-type: upper-alpha
}

.prose :where(ol[type=a]) {
  list-style-type: lower-alpha
}

.prose :where(ol[type=A s]) {
  list-style-type: upper-alpha
}

.prose :where(ol[type=a s]) {
  list-style-type: lower-alpha
}

.prose :where(ol[type=I]) {
  list-style-type: upper-roman
}

.prose :where(ol[type=i]) {
  list-style-type: lower-roman
}

.prose :where(ol[type=I s]) {
  list-style-type: upper-roman
}

.prose :where(ol[type=i s]) {
  list-style-type: lower-roman
}

.prose :where(ol[type="1"]) {
  list-style-type: decimal
}

.prose :where(ul) {
  list-style-type: disc;
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.625em
}

.prose :where(ol>li)::marker {
  font-weight: 400;
  color: var(--tw-prose-counters)
}

.prose :where(ul>li)::marker {
  color: var(--tw-prose-bullets)
}

.prose :where(li) {
  margin-top: .5em;
  margin-bottom: .5em
}

.prose :where(ol>li) {
  padding-left: .375em
}

.prose :where(ul>li) {
  padding-left: .375em
}

.prose :where(.prose>ul>li p) {
  margin-top: .75em;
  margin-bottom: .75em
}

.prose :where(.prose>ul>li>*:first-child) {
  margin-top: 1.25em
}

.prose :where(.prose>ul>li>*:last-child) {
  margin-bottom: 1.25em
}

.prose :where(.prose>ol>li>*:first-child) {
  margin-top: 1.25em
}

.prose :where(.prose>ol>li>*:last-child) {
  margin-bottom: 1.25em
}

.prose :where(ul ul, ul ol, ol ul, ol ol) {
  margin-top: .75em;
  margin-bottom: .75em
}

/* small lists */
.prose-sm :where(ol) {
  margin-top: 1.1428571em;
  margin-bottom: 1.1428571em;
  padding-left: 1.5714286em
}

.prose-sm :where(ul) {
  margin-top: 1.1428571em;
  margin-bottom: 1.1428571em;
  padding-left: 1.5714286em
}

.prose-sm :where(li) {
  margin-top: .2857143em;
  margin-bottom: .2857143em
}

.prose-sm :where(ol>li) {
  padding-left: .4285714em
}

.prose-sm :where(ul>li) {
  padding-left: .4285714em
}

.prose-sm :where(.prose-sm>ul>li p) {
  margin-top: .5714286em;
  margin-bottom: .5714286em
}

.prose-sm :where(.prose-sm>ul>li>*:first-child) {
  margin-top: 1.1428571em
}

.prose-sm :where(.prose-sm>ul>li>*:last-child) {
  margin-bottom: 1.1428571em
}

.prose-sm :where(.prose-sm>ol>li>*:first-child) {
  margin-top: 1.1428571em
}

.prose-sm :where(.prose-sm>ol>li>*:last-child) {
  margin-bottom: 1.1428571em
}

.prose-sm :where(ul ul, ul ol, ol ul, ol ol) {
  margin-top: .5714286em;
  margin-bottom: .5714286em
}

/* table stuff */
.prose :where(thead th strong) {
  color: inherit
}

.prose :where(thead th code) {
  color: inherit
}

.prose :where(table) {
  display: block;
  width: 100%;
  table-layout: auto;
  text-align: left;
  margin-top: 2em;
  margin-bottom: 2em;
  font-size: .875em;
  line-height: 1.7142857;
  overflow-x: auto;
  white-space: nowrap
}

.prose :where(thead) {
  border-bottom-width: none;
  border-bottom-color: var(--tw-prose-th-borders)
}

.prose :where(thead th) {
  color: var(--tw-prose-headings);
  font-weight: 700;
  vertical-align: bottom;
  padding-right: .5714286em;
  padding-bottom: .5714286em;
  padding-left: .5714286em;
  border-bottom: 1px dashed #666
}

.prose-th\:before\:content-none :is(:where(th)):before {
  --tw-content: none;
  content: var(--tw-content)
}

.prose :where(tbody tr) {
  border-bottom-width: none;
  border-bottom-color: var(--tw-prose-td-borders)
}

.prose :where(tbody tr:last-child) {
  border-bottom-width: 0
}

.prose :where(tbody td) {
  vertical-align: baseline
}

.prose :where(tfoot) {
  border-top-width: 1px;
  border-top-color: var(--tw-prose-th-borders);
  border-top: 1px dashed #666
}

.prose :where(tfoot td) {
  vertical-align: top
}

.prose :where(thead th:first-child) {
  padding-left: 0
}

.prose :where(thead th:last-child) {
  padding-right: 0
}

.prose :where(tbody td, tfoot td) {
  padding: .5714286em
}

.prose :where(tbody td:first-child, tfoot td:first-child) {
  padding-left: 0
}

.prose :where(tbody td:last-child, tfoot td:last-child) {
  padding-right: 0
}

.prose-sm :where(table) {
  font-size: .8571429em;
  line-height: 1.5
}

.prose-sm :where(thead th) {
  padding-right: 1em;
  padding-bottom: .6666667em;
  padding-left: 1em
}

.prose-sm :where(thead th:first-child) {
  padding-left: 0
}

.prose-sm :where(thead th:last-child) {
  padding-right: 0
}

.prose-sm :where(tbody td, tfoot td) {
  padding: .6666667em 1em
}

.prose-sm :where(tbody td:first-child, tfoot td:first-child) {
  padding-left: 0
}

.prose-sm :where(tbody td:last-child, tfoot td:last-child) {
  padding-right: 0
}

/* Mobile: allow table text to wrap */
@media (max-width: 767px) {
  .prose :where(table) { white-space: normal; font-size: 0.8em; }
  .prose :where(table td:first-child) { white-space: nowrap; }
}

/* Mobile: hide heading markers where negative margin clips */
@media (max-width: 639px) {
  .prose-headings\:before\:-ms-4 :is(:where(h1,h2,h3,h4,h5,h6,th)):before { display: none; }
}
