:root {
  --code-bg: #f4f7fc;
  --code-head: #eaf0f8;
  --code-line: #cbd6e6;
  --code-fg: #24324a;
  --code-muted: #4c5e75;
  --code-keyword: #6435a4;
  --code-string: #23653b;
  --code-symbol: #15599d;
  --code-number: #9a451a;
  --code-option: #005e67;
  --code-failure: #ae293d;
}

:root[data-theme="dark"] {
  --code-bg: #111a2b;
  --code-head: #18243a;
  --code-line: #3a4c68;
  --code-fg: #e6eefc;
  --code-muted: #a5b5cd;
  --code-keyword: #e1b2ff;
  --code-string: #afe6a5;
  --code-symbol: #a7d3ff;
  --code-number: #ffc38c;
  --code-option: #8fe2e7;
  --code-failure: #ff9eae;
}

pre .syntax-keyword { color: var(--code-keyword); font-weight: 650; }
pre :is(.syntax-string, .syntax-success) { color: var(--code-string); }
pre :is(.syntax-symbol, .syntax-command) { color: var(--code-symbol); font-weight: 600; }
pre .syntax-number { color: var(--code-number); }
pre .syntax-option { color: var(--code-option); }
pre .syntax-comment { color: var(--code-muted); }
pre :is(.syntax-failure, .syntax-reason) { color: var(--code-failure); }

@media (max-width: 680px) {
  pre code:has(> .syntax-line) { white-space: normal; }
  pre code > .syntax-line {
    display: block;
    min-height: 1lh;
    padding-inline-start: calc(min(var(--syntax-indent), 16) * 1ch + 2ch);
    text-indent: -2ch;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  pre .syntax-indent { font-size: 0; }
  pre :is(.syntax-string, .syntax-symbol, .syntax-option) {
    display: inline-block;
    max-width: 100%;
    text-indent: 0;
  }
  pre .syntax-option { white-space: nowrap; }
}
