.gh-md-block {
  width: 100%;
  /* Public docs/lab embeds: always allow selecting + copying body text */
  -webkit-user-select: text;
  user-select: text;
}

.gh-md-block,
.gh-md-block * {
  -webkit-user-select: text;
  user-select: text;
}

.gh-md-code {
  position: relative;
  margin: 0.65rem 0;
}

.gh-md-code pre,
.gh-md-block pre {
  overflow-x: auto;
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border-color-strong, var(--border-color, color-mix(in srgb, currentColor 28%, transparent)));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent-gold, #f5b335) 18%, transparent),
    0 1px 2px color-mix(in srgb, #000 8%, transparent);
  background: var(--code-bg, var(--surface-bg-hover, #ebe8e1));
  color: var(--text-primary, #2a2a28);
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  -webkit-user-select: text;
  user-select: text;
}

/* Don't let global .cms-content code { white-space: pre-wrap } fight the fence. */
.gh-md-block pre code,
.cms-content pre code {
  white-space: inherit;
  background: transparent;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.gh-md-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: inherit;
  -webkit-user-select: text;
  user-select: text;
}

.gh-md-block :not(pre) > code {
  padding: 0.1rem 0.38rem;
  border-radius: 0.28rem;
  border: 1px solid var(--border-color-strong, var(--border-color, color-mix(in srgb, currentColor 28%, transparent)));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-gold, #f5b335) 12%, transparent);
  background: var(--code-bg, var(--surface-bg-hover, #ebe8e1));
  color: var(--text-primary, #2a2a28);
}

.gh-md-code-copy {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 1px solid var(--border-color, color-mix(in srgb, currentColor 22%, transparent));
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--surface-bg, #fff) 92%, transparent);
  color: var(--text-muted, var(--text-primary, inherit));
  box-shadow: 0 1px 4px color-mix(in srgb, #000 12%, transparent);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  -webkit-user-select: none;
  user-select: none;
}

.gh-md-code:hover .gh-md-code-copy,
.gh-md-code:focus-within .gh-md-code-copy,
.gh-md-code-copy:focus-visible,
.gh-md-code-copy.is-copied,
.gh-md-code-copy.is-failed {
  opacity: 1;
  pointer-events: auto;
}

.gh-md-code-copy:hover,
.gh-md-code-copy:focus-visible {
  color: var(--text-primary, inherit);
  outline: 2px solid color-mix(in srgb, var(--accent-gold, #f5b335) 70%, transparent);
  outline-offset: 1px;
}

.gh-md-code-copy .gh-md-code-icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.gh-md-code-copy.is-copied {
  border-color: color-mix(in srgb, #3dd68c 55%, transparent);
  color: #2f9e63;
}

.gh-md-code-copy.is-failed {
  border-color: color-mix(in srgb, #f07178 55%, transparent);
  color: #c23b44;
}

@media (hover: none) {
  .gh-md-code-copy {
    opacity: 0.92;
    pointer-events: auto;
  }
}

.gh-md-block table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.gh-md-block th,
.gh-md-block td {
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  padding: 0.4rem 0.65rem;
}

.gh-md-block blockquote {
  margin: 1rem 0;
  padding: 0.35rem 0 0.35rem 1rem;
  border-left: 3px solid var(--wb-accent, #f5b335);
}

/* ─── GitHub-style callout alerts ─── */
.gh-md-block .markdown-alert {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border-left: 4px solid;
}

.gh-md-block .markdown-alert p {
  margin: 0.25rem 0;
}

.gh-md-block .markdown-alert-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.gh-md-block .markdown-alert-icon {
  font-size: 1rem;
}

.gh-md-block .markdown-alert-note {
  border-color: #1f6feb;
  background: rgba(31, 111, 235, 0.08);
}

.gh-md-block .markdown-alert-note .markdown-alert-title {
  color: #1f6feb;
}

.gh-md-block .markdown-alert-tip {
  border-color: #238636;
  background: rgba(35, 134, 54, 0.08);
}

.gh-md-block .markdown-alert-tip .markdown-alert-title {
  color: #238636;
}

.gh-md-block .markdown-alert-important {
  border-color: #8957e5;
  background: rgba(137, 87, 229, 0.08);
}

.gh-md-block .markdown-alert-important .markdown-alert-title {
  color: #8957e5;
}

.gh-md-block .markdown-alert-warning {
  border-color: #d29922;
  background: rgba(210, 153, 34, 0.08);
}

.gh-md-block .markdown-alert-warning .markdown-alert-title {
  color: #d29922;
}

.gh-md-block .markdown-alert-caution {
  border-color: #da3633;
  background: rgba(218, 54, 51, 0.08);
}

.gh-md-block .markdown-alert-caution .markdown-alert-title {
  color: #da3633;
}

/* Visible section / page break (print + screen). Authors may use
   <div style="page-break-before: always"></div>, class="page-break", \pagebreak, or <!-- pagebreak -->. */
.gh-md-block .gh-md-page-break,
.gh-md-block .page-break,
.gh-md-block div[style*="page-break"],
.gh-md-block hr.gh-md-page-break {
  display: block;
  width: 100%;
  height: 0;
  margin: 2.25rem 0;
  border: 0;
  border-top: 2px dashed color-mix(in srgb, var(--border-color-strong, currentColor) 55%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--accent-gold, #f5b335) 28%, transparent);
  break-before: page;
  page-break-before: always;
}

.gh-md-block hr {
  margin: 2.25rem 0;
  height: 0;
  border: 0;
  border-top: 2px solid var(--border-color-strong, var(--border-color, color-mix(in srgb, currentColor 40%, transparent)));
  box-shadow: 0 1px 0 color-mix(in srgb, var(--accent-gold, #f5b335) 42%, transparent);
}

/* Image / text rhythm — Markdig often packs consecutive images into one <p>. */
.gh-md-block img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.15rem 0;
  border-radius: 0.35rem;
}

.gh-md-block p > img + img {
  margin-top: 1.15rem;
}

.gh-md-block p:has(> img) {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

.gh-md-block p > img:only-child {
  margin-top: 1.15rem;
  margin-bottom: 1.15rem;
}

.gh-md-editor {
  min-height: 28rem;
  tab-size: 2;
}

.gh-md-editor--canvas {
  min-height: 22rem;
}

.gh-md-canvas-edit {
  border: 1px dashed color-mix(in srgb, currentColor 25%, transparent);
  border-radius: 0.4rem;
  padding: 0.85rem 1rem 1rem;
  background: color-mix(in srgb, var(--wb-surface, #111) 4%, transparent);
}

.gh-md-preview-pane {
  min-height: 28rem;
  max-height: 70vh;
  overflow: auto;
}

.gh-docs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gh-docs-nav-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.gh-docs-nav-list li {
  margin: 0.35rem 0;
}

.gh-md-block-edit,
.gh-docs-nav-edit {
  border: 1px dashed color-mix(in srgb, currentColor 25%, transparent);
  border-radius: 0.4rem;
  padding: 1rem;
}
