.rich-text-content {
  min-width: 0;
  color: #384551;
  font-size: 1.04rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.rich-text-content > :first-child {
  margin-top: 0;
}

.rich-text-content > :last-child {
  margin-bottom: 0;
}

.rich-text-content p {
  margin: 0 0 1rem;
}

.rich-text-content h1,
.rich-text-content h2,
.rich-text-content h3,
.rich-text-content h4 {
  margin: 1.4rem 0 .85rem;
  color: #223243;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.025em;
  scroll-margin-top: 6.5rem;
}

.rich-text-content h1 {
  font-size: clamp(1.9rem, 4vw, 2.35rem);
}

.rich-text-content h2 {
  font-size: clamp(1.65rem, 3vw, 2rem);
}

.rich-text-content h3 {
  font-size: clamp(1.35rem, 2.5vw, 1.55rem);
}

.rich-text-content h4 {
  font-size: 1.2rem;
}

.rich-text-content ul,
.rich-text-content ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.rich-text-content li {
  margin-bottom: .35rem;
  padding-left: .15rem;
}

.rich-text-content li::marker {
  color: var(--front-warm, #c97942);
  font-weight: 700;
}

.rich-text-content li > ul,
.rich-text-content li > ol {
  margin-top: .35rem;
  margin-bottom: .35rem;
}

.rich-text-content ul[data-type="taskList"] {
  list-style: none;
  padding-left: .15rem;
}

.rich-text-content li[data-type="taskItem"] {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin-bottom: .6rem;
  padding-left: 0;
}

.rich-text-content li[data-type="taskItem"] > label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  margin-top: .3rem;
}

.rich-text-content li[data-type="taskItem"] input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  opacity: 1;
  accent-color: var(--front-warm, #c97942);
}

.rich-text-content li[data-type="taskItem"] > div {
  min-width: 0;
  flex: 1 1 auto;
}

.rich-text-content li[data-type="taskItem"] > div > :last-child {
  margin-bottom: 0;
}

.rich-text-content blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--front-warm, #c97942);
  border-radius: 0 1rem 1rem 0;
  background: rgba(201, 121, 66, .08);
  color: #495a6c;
}

.rich-text-content blockquote > :last-child {
  margin-bottom: 0;
}

.rich-text-content hr {
  margin: 1.75rem 0;
  border: 0;
  border-top: 1px solid var(--front-border, rgba(54, 64, 56, .12));
  opacity: 1;
}

.rich-text-content a {
  border-radius: .2rem;
  color: #86532f;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

.rich-text-content a:hover {
  color: #60391f;
}

.rich-text-content a:focus-visible,
.rich-code-copy:focus-visible,
.rich-table-scroll:focus-visible,
.rich-text-content pre:focus-visible {
  outline: 3px solid rgba(201, 121, 66, .4);
  outline-offset: 3px;
}

.rich-text-content code {
  padding: .15rem .4rem;
  border-radius: .45rem;
  background: rgba(15, 23, 42, .08);
  color: #b42362;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .92em;
}

.rich-text-content pre {
  position: relative;
  max-width: 100%;
  margin: 1.25rem 0;
  padding: 3.1rem 1.25rem 1rem;
  border-radius: 1rem;
  background: #121826;
  color: #e2e8f0;
  overflow: auto;
  tab-size: 2;
  white-space: pre;
}

.rich-text-content pre::before {
  content: attr(data-language-label);
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  height: 2.45rem;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  border-radius: 1rem 1rem 0 0;
  background: linear-gradient(180deg, #1c2a45 0%, #111c31 100%);
  color: #dbe7ff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rich-text-content pre code,
.rich-text-content pre code.hljs {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: .94rem;
  line-height: 1.7;
  overflow: visible;
}

.rich-code-block {
  margin: 1.25rem 0;
  border-radius: 1rem;
  background: #121826;
  box-shadow: 0 14px 35px rgba(18, 24, 38, .16);
  overflow: hidden;
}

.rich-code-header {
  display: flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem .65rem .45rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  background: linear-gradient(180deg, #1c2a45 0%, #111c31 100%);
}

.rich-code-language {
  min-width: 0;
  color: #dbe7ff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.rich-code-copy {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  padding: .35rem .75rem;
  border: 1px solid rgba(219, 231, 255, .2);
  border-radius: .6rem;
  color: #edf4ff;
  background: rgba(255, 255, 255, .07);
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease;
}

.rich-code-copy:hover {
  border-color: rgba(219, 231, 255, .38);
  background: rgba(255, 255, 255, .13);
}

.rich-code-copy[data-copy-state="success"] {
  border-color: rgba(134, 239, 172, .45);
  color: #bbf7d0;
}

.rich-code-copy[data-copy-state="error"] {
  border-color: rgba(253, 164, 175, .45);
  color: #fecdd3;
}

.rich-code-block > pre {
  margin: 0;
  padding: 1.15rem 1.25rem 1.25rem;
  border-radius: 0;
  box-shadow: none;
}

.rich-code-block > pre::before {
  display: none;
}

.rich-text-content .hljs-comment,
.rich-text-content .hljs-quote {
  color: #94a3b8;
}

.rich-text-content .hljs-keyword,
.rich-text-content .hljs-selector-tag,
.rich-text-content .hljs-literal,
.rich-text-content .hljs-section,
.rich-text-content .hljs-link {
  color: #c4b5fd;
}

.rich-text-content .hljs-string,
.rich-text-content .hljs-title,
.rich-text-content .hljs-name,
.rich-text-content .hljs-type,
.rich-text-content .hljs-attribute,
.rich-text-content .hljs-symbol,
.rich-text-content .hljs-bullet,
.rich-text-content .hljs-addition,
.rich-text-content .hljs-variable,
.rich-text-content .hljs-template-tag,
.rich-text-content .hljs-template-variable {
  color: #86efac;
}

.rich-text-content .hljs-number,
.rich-text-content .hljs-meta,
.rich-text-content .hljs-built_in,
.rich-text-content .hljs-builtin-name,
.rich-text-content .hljs-params {
  color: #7dd3fc;
}

.rich-text-content .hljs-deletion {
  color: #fda4af;
}

.rich-text-content figure {
  max-width: 100%;
  margin: 1.5rem 0;
}

.rich-text-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem auto;
  border-radius: .95rem;
  box-shadow: 0 14px 35px rgba(30, 36, 31, .1);
}

.rich-text-content figcaption {
  margin-top: .65rem;
  color: var(--front-muted, #677168);
  font-size: .88rem;
  text-align: center;
}

.rich-table-scroll {
  max-width: 100%;
  margin: 1.25rem 0;
  border: 1px solid var(--front-border, rgba(54, 64, 56, .12));
  border-radius: .9rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rich-text-content table {
  width: 100%;
  min-width: 36rem;
  margin: 1.25rem 0;
  border-collapse: collapse;
  color: inherit;
}

.rich-table-scroll > table {
  margin: 0;
}

.rich-text-content th,
.rich-text-content td {
  min-width: 8rem;
  padding: .7rem .8rem;
  border: 1px solid var(--front-border, rgba(54, 64, 56, .12));
  vertical-align: top;
}

.rich-text-content th {
  background: rgba(201, 121, 66, .1);
  color: #223243;
  font-weight: 800;
  text-align: left;
}

.rich-text-content tbody tr:nth-child(even) td {
  background: rgba(246, 242, 235, .45);
}

@media (max-width: 575.98px) {
  .rich-text-content {
    font-size: 1rem;
  }

  .rich-code-header {
    padding-left: .8rem;
  }

  .rich-code-block > pre,
  .rich-text-content pre {
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rich-code-copy {
    transition: none;
  }
}
