/* Crea con BitPull: colours in the File tab's code (codeview.js). The textarea stays on top for typing, its text
   transparent; the coloured copy is drawn underneath with the same font, padding and wrapping. Colours follow
   VS Code's default Light+ and Dark+ themes. */
.cv {
  --cv-c: #008000; --cv-k: #0000ff; --cv-kc: #af00db; --cv-s: #a31515; --cv-n: #098658; --cv-i: #001080; --cv-p: #001080;
  --cv-f: #795e26; --cv-ty: #267f99; --cv-v: #0070c1; --cv-r: #811f3f; --cv-t: #800000; --cv-tb: #800000; --cv-a: #e50000;
  --cv-av: #0000ff; --cv-e: #ee0000; --cv-sel: #800000; --cv-cp: #e50000; --cv-cv: #0451a5; --cv-at: #af00db; --cv-jk: #0451a5;
  --cv-h: #800000; --cv-m: #6e7781; --cv-l: #0451a5; --cv-gut: #8a93a6; --cv-selbg: #add6ff99;
  flex: 1; min-height: 0; display: flex; position: relative; background: var(--surface, #fff); overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .cv {
    --cv-c: #6a9955; --cv-k: #569cd6; --cv-kc: #c586c0; --cv-s: #ce9178; --cv-n: #b5cea8; --cv-i: #9cdcfe; --cv-p: #9cdcfe;
    --cv-f: #dcdcaa; --cv-ty: #4ec9b0; --cv-v: #4fc1ff; --cv-r: #d16969; --cv-t: #569cd6; --cv-tb: #808080; --cv-a: #9cdcfe;
    --cv-av: #ce9178; --cv-e: #569cd6; --cv-sel: #d7ba7d; --cv-cp: #9cdcfe; --cv-cv: #ce9178; --cv-at: #c586c0; --cv-jk: #9cdcfe;
    --cv-h: #569cd6; --cv-m: #808080; --cv-l: #4fc1ff; --cv-gut: #6b7590; --cv-selbg: #264f78cc;
  }
}
:root[data-theme=dark] .cv {
  --cv-c: #6a9955; --cv-k: #569cd6; --cv-kc: #c586c0; --cv-s: #ce9178; --cv-n: #b5cea8; --cv-i: #9cdcfe; --cv-p: #9cdcfe;
  --cv-f: #dcdcaa; --cv-ty: #4ec9b0; --cv-v: #4fc1ff; --cv-r: #d16969; --cv-t: #569cd6; --cv-tb: #808080; --cv-a: #9cdcfe;
  --cv-av: #ce9178; --cv-e: #569cd6; --cv-sel: #d7ba7d; --cv-cp: #9cdcfe; --cv-cv: #ce9178; --cv-at: #c586c0; --cv-jk: #9cdcfe;
  --cv-h: #569cd6; --cv-m: #808080; --cv-l: #4fc1ff; --cv-gut: #6b7590; --cv-selbg: #264f78cc;
}

/* Line numbers. Without wrapping: one per line in a column; with wrapping: each at the top of its line. */
.cv-gut { flex: none; position: relative; overflow: hidden; box-sizing: border-box; color: var(--cv-gut); font-family: var(--mono, ui-monospace, monospace); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; -webkit-user-select: none; user-select: none; border-right: 1px solid var(--line, #0001); }
.cv-gut-in { position: absolute; top: 0; left: 0; right: 8px; white-space: pre; will-change: transform; }
.cv-wrap .cv-gut-in > div { position: absolute; right: 0; }
.cv-area { flex: 1; min-width: 0; position: relative; display: flex; }

/* The coloured copy under the textarea. */
.cv-hl { position: absolute; left: 0; top: 0; margin: 0; box-sizing: border-box; overflow: hidden; pointer-events: none; background: transparent; color: var(--ink, #111); border: 0; }
.cv-hl code { display: block; position: relative; font: inherit; white-space: inherit; word-break: inherit; overflow-wrap: inherit; tab-size: inherit; will-change: transform; }

/* The textarea itself (":not(#cv-x)" weighs like an id, so these win over the page's own #fl-text rules).
   Whole-pixel line height: fractional ones drift apart between textarea and copy after thousands of lines. */
.cv textarea.cv-ta:not(#cv-x) { position: relative; z-index: 1; flex: 1; min-width: 0; height: auto; background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--ink, #111); line-height: 22px; padding-left: 10px; }
.cv textarea.cv-ta::selection { background: var(--cv-selbg); color: transparent; -webkit-text-fill-color: transparent; }
/* While a big file waits to be coloured again, and for very big files: the textarea's own plain text. */
.cv.cv-stale textarea.cv-ta:not(#cv-x), .cv.cv-plain textarea.cv-ta:not(#cv-x) { color: var(--ink, #111); -webkit-text-fill-color: var(--ink, #111); }
.cv.cv-stale .cv-hl, .cv.cv-plain .cv-hl { visibility: hidden; }
.cv.cv-plain.cv-wrap .cv-gut { display: none; }

.cv-hl .h-c { color: var(--cv-c); }
.cv-hl .h-k { color: var(--cv-k); }
.cv-hl .h-kc { color: var(--cv-kc); }
.cv-hl .h-s { color: var(--cv-s); }
.cv-hl .h-n { color: var(--cv-n); }
.cv-hl .h-i { color: var(--cv-i); }
.cv-hl .h-p { color: var(--cv-p); }
.cv-hl .h-f { color: var(--cv-f); }
.cv-hl .h-ty { color: var(--cv-ty); }
.cv-hl .h-v { color: var(--cv-v); }
.cv-hl .h-r { color: var(--cv-r); }
.cv-hl .h-t { color: var(--cv-t); }
.cv-hl .h-tb { color: var(--cv-tb); }
.cv-hl .h-a { color: var(--cv-a); }
.cv-hl .h-av { color: var(--cv-av); }
.cv-hl .h-e { color: var(--cv-e); }
.cv-hl .h-sel { color: var(--cv-sel); }
.cv-hl .h-cp { color: var(--cv-cp); }
.cv-hl .h-cv { color: var(--cv-cv); }
.cv-hl .h-at { color: var(--cv-at); }
.cv-hl .h-jk { color: var(--cv-jk); }
.cv-hl .h-h { color: var(--cv-h); }
.cv-hl .h-m { color: var(--cv-m); }
.cv-hl .h-l { color: var(--cv-l); }
/* No bold or italic: a different weight could change a letter's width and the copy would drift from the caret. */
.cv-hl .h-b, .cv-hl .h-em { color: var(--cv-f); }
