/*
 * Visual Studio / Dynamics 365 inspired highlighting for X++ and C#.
 *
 * Solid sRGB colors so DarkReader can remap them. Keyword weight stays
 * normal — the old github.css bold #333 keywords read as body text.
 */

.hljs.language-xpp,
.hljs.language-axapta,
.hljs.language-x\+\+,
.hljs.language-csharp,
.hljs.language-cs {
  color: #24292e;
  background: #fbfbfc;
}

/* Keywords: classic VS blue, not bold. */
.hljs.language-xpp .hljs-keyword,
.hljs.language-axapta .hljs-keyword,
.hljs.language-x\+\+ .hljs-keyword,
.hljs.language-csharp .hljs-keyword,
.hljs.language-cs .hljs-keyword {
  color: #0000ff;
  font-weight: normal;
}

/* Primitive types: int, str, real, utcdatetime, boolean, var, void. */
.hljs.language-xpp .hljs-built_in,
.hljs.language-axapta .hljs-built_in,
.hljs.language-x\+\+ .hljs-built_in,
.hljs.language-csharp .hljs-built_in,
.hljs.language-cs .hljs-built_in {
  color: #0070c1;
  font-weight: normal;
}

/* Classes, EDTs, enums, and the type before :: */
.hljs.language-xpp .hljs-type,
.hljs.language-axapta .hljs-type,
.hljs.language-x\+\+ .hljs-type,
.hljs.language-csharp .hljs-type,
.hljs.language-cs .hljs-type,
.hljs.language-xpp .hljs-title.class_,
.hljs.language-axapta .hljs-title.class_,
.hljs.language-x\+\+ .hljs-title.class_,
.hljs.language-csharp .hljs-title,
.hljs.language-cs .hljs-title {
  color: #2b91af;
  font-weight: normal;
}

/* Method declarations and calls. */
.hljs.language-xpp .hljs-title.function_,
.hljs.language-axapta .hljs-title.function_,
.hljs.language-x\+\+ .hljs-title.function_,
.hljs.language-csharp .hljs-function,
.hljs.language-cs .hljs-function,
.hljs.language-csharp .hljs-function .hljs-title,
.hljs.language-cs .hljs-function .hljs-title {
  color: #795e26;
  font-weight: normal;
}

/* Keep C# signature punctuation with the surrounding code; the name stays olive. */
.hljs.language-csharp .hljs-function,
.hljs.language-cs .hljs-function {
  color: #24292e;
}

.hljs.language-csharp .hljs-function .hljs-title,
.hljs.language-cs .hljs-function .hljs-title {
  color: #795e26;
}

/* Intrinsics (classStr, fieldNum) and globals (strFmt, conPeek, info). */
.hljs.language-xpp .hljs-name,
.hljs.language-axapta .hljs-name,
.hljs.language-x\+\+ .hljs-name {
  color: #7a3e9d;
  font-weight: normal;
}

/* Attributes: [ExtensionOf(...)], [SubscribesTo(...)]. */
.hljs.language-xpp .hljs-attribute,
.hljs.language-axapta .hljs-attribute,
.hljs.language-x\+\+ .hljs-attribute {
  color: #6f42c1;
  background: rgba(111, 66, 193, 0.08);
  border-radius: 3px;
  font-weight: normal;
}

.hljs.language-xpp .hljs-attribute .hljs-title,
.hljs.language-axapta .hljs-attribute .hljs-title,
.hljs.language-x\+\+ .hljs-attribute .hljs-title,
.hljs.language-xpp .hljs-attribute .class_,
.hljs.language-axapta .hljs-attribute .class_,
.hljs.language-x\+\+ .hljs-attribute .class_ {
  color: #6f42c1;
  font-weight: normal;
}

.hljs.language-csharp .hljs-meta,
.hljs.language-cs .hljs-meta {
  color: #6f42c1;
  font-weight: normal;
}

/* Strings, and label ids such as @SYS73815 / @MyLabels:MyLabel. */
.hljs.language-xpp .hljs-string,
.hljs.language-axapta .hljs-string,
.hljs.language-x\+\+ .hljs-string,
.hljs.language-csharp .hljs-string,
.hljs.language-cs .hljs-string {
  color: #a31515;
  font-weight: normal;
}

.hljs.language-xpp .hljs-symbol,
.hljs.language-axapta .hljs-symbol,
.hljs.language-x\+\+ .hljs-symbol {
  color: #dd1144;
  font-weight: normal;
}

/* Numbers and enum / static literal values (NoYes::Yes, Exception::Error). */
.hljs.language-xpp .hljs-number,
.hljs.language-axapta .hljs-number,
.hljs.language-x\+\+ .hljs-number,
.hljs.language-xpp .hljs-literal,
.hljs.language-axapta .hljs-literal,
.hljs.language-x\+\+ .hljs-literal,
.hljs.language-csharp .hljs-number,
.hljs.language-cs .hljs-number {
  color: #098658;
  font-weight: normal;
}

.hljs.language-csharp .hljs-literal,
.hljs.language-cs .hljs-literal {
  color: #0000ff;
  font-weight: normal;
}

/* Comments and XML doc comments. */
.hljs.language-xpp .hljs-comment,
.hljs.language-axapta .hljs-comment,
.hljs.language-x\+\+ .hljs-comment,
.hljs.language-csharp .hljs-comment,
.hljs.language-cs .hljs-comment {
  color: #008000;
  font-style: italic;
  font-weight: normal;
}

.hljs.language-xpp .hljs-doctag,
.hljs.language-axapta .hljs-doctag,
.hljs.language-x\+\+ .hljs-doctag,
.hljs.language-csharp .hljs-doctag,
.hljs.language-cs .hljs-doctag {
  color: #6a737d;
  font-style: normal;
  font-weight: 600;
}

.hljs.language-xpp .hljs-attr,
.hljs.language-axapta .hljs-attr,
.hljs.language-x\+\+ .hljs-attr {
  color: #2b91af;
  font-weight: normal;
}

/* #define, #localmacro, #endmacro, #macrolib, and #Macro references. */
.hljs.language-xpp .hljs-meta,
.hljs.language-axapta .hljs-meta,
.hljs.language-x\+\+ .hljs-meta {
  color: #af00db;
  font-weight: normal;
}

.hljs.language-xpp .hljs-meta .hljs-keyword,
.hljs.language-axapta .hljs-meta .hljs-keyword,
.hljs.language-x\+\+ .hljs-meta .hljs-keyword,
.hljs.language-xpp .hljs-meta .hljs-type,
.hljs.language-axapta .hljs-meta .hljs-type,
.hljs.language-x\+\+ .hljs-meta .hljs-type {
  color: #af00db;
}

.hljs.language-xpp .hljs-meta .hljs-string,
.hljs.language-axapta .hljs-meta .hljs-string,
.hljs.language-x\+\+ .hljs-meta .hljs-string {
  color: #a31515;
}

.hljs.language-xpp .hljs-meta .hljs-number,
.hljs.language-axapta .hljs-meta .hljs-number,
.hljs.language-x\+\+ .hljs-meta .hljs-number {
  color: #098658;
}

/* Code block container. :has() drops the minima double border. */
pre:has(> code.hljs) {
  padding: 0;
  overflow: auto;
  border: 1px solid #d8dee4;
  border-radius: 8px;
  background: #fbfbfc;
  margin-top: 0.35em;
  margin-bottom: 1.15em;
}

pre > code.hljs {
  display: block;
  padding: 0.95em 1.05em;
  border: 0;
  border-radius: 8px;
  background: transparent;
  line-height: 1.55;
  tab-size: 4;
  font-family: Consolas, "Cascadia Mono", "Segoe UI Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

pre:has(> code.hljs.language-tsql) {
  background: #fff;
}

.copy-code-button {
  display: block;
  width: fit-content;
  margin: 0.85em 0 0 auto;
  padding: 0.18em 0.7em;
  font-family: inherit;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #24292f;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  cursor: pointer;
}

.copy-code-button:hover {
  background: #eef1f4;
  border-color: #afb8c1;
}

.copy-code-button:focus-visible {
  outline: 2px solid #0969da;
  outline-offset: 1px;
}

/* Header added around the block by copy-code-button.js.
   Solid light colors so DarkReader can invert them with the rest of the page. */
.code-block-wrapper {
  margin: 0.35em 0 1.15em;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  overflow: hidden;
  background: #f6f8fa;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.28rem 0.65rem;
  background: #f6f8fa;
  color: #57606a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  border-bottom: 1px solid #d0d7de;
}

.code-block-wrapper pre:has(> code.hljs) {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fbfbfc;
}

.code-block-header .copy-code-button {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: 0.08rem 0.45rem;
  color: #24292f;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
}

.code-block-header .copy-code-button:hover,
.code-block-header .copy-code-button:focus-visible {
  background: #eef1f4;
  border-color: #0969da;
  color: #0969da;
}

.code-block-header .copy-code-button.is-copied {
  border-color: #1a7f37;
  color: #1a7f37;
  background: #f6f8fa;
}
