/* ─── XML Viewer ─────────────────────────────────────────────────────────────
   Styles for the syntax-highlighted XML tree rendered by renderXML().
   Light theme by default; dark mode via [data-bs-theme=dark] (Bootstrap 5.3).
   Color palette mirrors VS Code's XML highlighting.
─────────────────────────────────────────────────────────────────────────── */

.xml-viewer {
  background-color: var(--bs-tertiary-bg, #f8f8f8);
  border: var(--bs-border-width, 1px) solid var(--bs-border-color, #e0e0e0);
  border-radius: var(--bs-border-radius, 6px);
  overflow-x: auto;
  margin: 0.75rem 0;
}

.xml-viewer pre {
  margin: 0;
  padding: 1rem 1.25rem;
  font-family: var(--bs-font-monospace, 'Consolas', 'Monaco', 'Lucida Console', monospace);
  font-size: 0.875rem;
  line-height: 1.7;
  color: #1e1e1e;
  white-space: pre;
}

/* ── Token colours (light) ──────────────────────────────────────────────── */

.xml-bracket    { color: #808080; }   /* < > </ /> = */
.xml-tag-name   { color: #0070c1; }   /* element names */
.xml-attr-name  { color: #9c4022; }   /* attribute names */
.xml-attr-value { color: #a31515; }   /* attribute values + quotes */
.xml-text       { color: #1e1e1e; }   /* text content between tags */
.xml-comment    { color: #6a9955; font-style: italic; }  /* <!-- --> */
.xml-pi         { color: #795e26; }   /* <?target ..?> */
.xml-pi-target  { color: #267f99; font-weight: 600; }   /* target word in PI */

/* ── Dark mode ──────────────────────────────────────────────────────────── */

[data-bs-theme=dark] .xml-viewer {
  background-color: #1e1e1e;
  border-color: #3c3c3c;
}

[data-bs-theme=dark] .xml-viewer pre { color: #d4d4d4; }

[data-bs-theme=dark] .xml-bracket    { color: #808080; }
[data-bs-theme=dark] .xml-tag-name   { color: #569cd6; }
[data-bs-theme=dark] .xml-attr-name  { color: #9cdcfe; }
[data-bs-theme=dark] .xml-attr-value { color: #ce9178; }
[data-bs-theme=dark] .xml-text       { color: #d4d4d4; }
[data-bs-theme=dark] .xml-comment    { color: #6a9955; }
[data-bs-theme=dark] .xml-pi         { color: #dcdcaa; }
[data-bs-theme=dark] .xml-pi-target  { color: #4ec9b0; font-weight: 600; }
