.rich-content {
  color: var(--text);
  font-family: Inter, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  font-size: 19px;
  line-height: 1.9;
}

.rich-content p {
  margin: 0;
}

.rich-content p:not(:has(> br:only-child)) + p:not(:has(> br:only-child)) {
  margin-top: 0.72em;
}

.rich-content .align-left {
  text-align: left;
}

.rich-content .align-center {
  text-align: center;
}

.rich-content .align-right {
  text-align: right;
}

.rich-content a {
  color: var(--accent) !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 62%, transparent);
  text-underline-offset: 0.2em;
}

.rich-content a:hover {
  text-decoration-thickness: 2px;
}

.rich-content .content-break {
  height: 1.9em;
}

.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content blockquote {
  margin-top: 0;
}

.rich-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.rich-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 18px;
  color: var(--muted);
}

.rich-content table {
  width: 100%;
  margin: 18px 0 24px;
  border: 1px solid var(--line);
  border-collapse: collapse;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--text);
  font-family: Inter, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.rich-content th,
.rich-content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.rich-content th {
  background: color-mix(in srgb, var(--panel-soft) 70%, var(--accent) 8%);
  color: var(--accent);
  font-weight: 700;
}

.rich-content tr:last-child td {
  border-bottom: 0;
}

.rich-content th:first-child,
.rich-content td:first-child {
  width: 22%;
  white-space: nowrap;
}

.rich-content th:nth-child(2),
.rich-content td:nth-child(2) {
  width: 36%;
}

.rich-content td code {
  font-size: 0.92em;
}

/* Keep technical terms readable in prose; only code blocks use a monospace face. */
.rich-content :not(pre) > code {
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
}

.rich-content pre {
  overflow: auto;
  border-radius: 6px;
  background: var(--panel-soft, var(--panel));
  padding: 16px;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 14px;
}

.rich-content pre.copyable-code {
  position: relative;
  padding-top: 48px;
}

.code-copy-button {
  position: absolute;
  top: 9px;
  right: 9px;
  min-width: 58px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--muted);
  font-family: Inter, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
}

.code-copy-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.code-copy-button:disabled {
  cursor: default;
}

.rich-content pre code {
  font-family: inherit;
  font-size: inherit;
}

@media (max-width: 680px) {
  .rich-content {
    font-size: 17px;
  }

  .rich-content table {
    font-size: 13px;
  }

  .rich-content th,
  .rich-content td {
    padding: 8px 9px;
  }
}
