/* Chroma syntax highlighting mapped strictly to ZAIXIAN VI 4-category code palette.
   Only keywords/types, strings, numbers/constants, and comments receive distinct colors;
   identifiers, functions, properties, and punctuation stay in --zx-code-text for calm legibility
   and verified color-vision-deficiency separation. */

.chroma {
  background-color: var(--zx-code-bg);
  color: var(--zx-code-text);
}

.chroma .hl {
  display: block;
  width: 100%;
  background-color: var(--zx-surface);
}

.chroma .lnt,
.chroma .ln {
  color: var(--zx-text-2);
  padding-right: var(--zx-space-3);
  user-select: none;
  font-variant-numeric: tabular-nums;
}

/* 1. Keywords & Types: bold + --zx-code-keyword */
.chroma .k,
.chroma .kd,
.chroma .kn,
.chroma .kp,
.chroma .kr,
.chroma .kt,
.chroma .ow {
  color: var(--zx-code-keyword);
  font-weight: var(--zx-weight-bold);
}

/* 2. Strings: --zx-code-string */
.chroma .s,
.chroma .sa,
.chroma .sb,
.chroma .sc,
.chroma .dl,
.chroma .sd,
.chroma .s2,
.chroma .se,
.chroma .sh,
.chroma .si,
.chroma .sx,
.chroma .sr,
.chroma .s1,
.chroma .ss {
  color: var(--zx-code-string);
}

/* 3. Numbers, Booleans, Constants: --zx-code-constant */
.chroma .kc,
.chroma .no,
.chroma .m,
.chroma .mb,
.chroma .mf,
.chroma .mh,
.chroma .mi,
.chroma .il,
.chroma .mo {
  color: var(--zx-code-constant);
  font-weight: var(--zx-weight-regular);
}

/* 4. Comments: italic + --zx-code-comment */
.chroma .c,
.chroma .ch,
.chroma .cm,
.chroma .c1,
.chroma .cs,
.chroma .cp,
.chroma .cpf {
  color: var(--zx-code-comment);
  font-style: italic;
}

.chroma code {
  display: inline-block;
  min-width: 100%;
}

.chroma .line {
  display: flex;
}

.chroma .cl {
  width: 100%;
}

/* Diff lines: preserve +/- prefix and highlight full line background */
.chroma .gi {
  display: block;
  width: 100%;
  background-color: var(--zx-code-inserted-bg);
  color: var(--zx-code-text);
}

.chroma .gd {
  display: block;
  width: 100%;
  background-color: var(--zx-code-deleted-bg);
  color: var(--zx-code-text);
}

.chroma .gu {
  color: var(--zx-text-2);
  font-weight: var(--zx-weight-bold);
}

/* Shell prompts: rendered via CSS ::before so neither prompt nor trailing space
   enters the DOM text selection or clipboard (even on triple-click). */
.chroma .gp,
.chroma .cmd-prompt {
  color: var(--zx-text-2);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.chroma .gp::before {
  content: attr(data-prompt);
}

.chroma .cmd-prompt::before {
  content: "$ ";
}

.chroma .ge {
  font-weight: var(--zx-weight-bold);
}

.chroma .gs {
  font-weight: var(--zx-weight-bold);
}
