/* Shared by every public page and embedded unchanged in the offline edition.
   Change these tokens to tune code typography and spacing in both editions. */
:root {
  --code-font-size: 12px;
  --code-line-height: 1.4;
  --code-font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  --code-space-before: 10px;
  --code-space-after: 14px;
  --code-padding-top: 8px;
  --code-padding-bottom: 10px;
  --code-gutter-width: 40px;
  --code-gutter-gap: 10px;
  --code-gutter-padding: 8px;
}

code.inline-code { padding: 2px 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--raised, var(--bg-elevated)); color: var(--warning); font: .92em var(--code-font-family); overflow-wrap: anywhere; }
.code-card { margin: var(--code-space-before) 0 var(--code-space-after); overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--code, var(--bg-code)); }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--surface, var(--bg-surface)); color: var(--muted); font: 11px var(--code-font-family); }
.copy-button { flex: none; min-height: 24px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--raised, var(--bg-elevated)); color: var(--secondary, var(--text-secondary)); cursor: pointer; font: 12px system-ui, sans-serif; }
.copy-button:hover { background: var(--sidebar, var(--bg-sidebar)); color: var(--text); }
.copy-status:not(.sr-only) { color: var(--muted); font: 12px system-ui, sans-serif; }
pre { margin: 0; padding: var(--code-padding-top) 0 var(--code-padding-bottom); overflow: auto; tab-size: 4; font: var(--code-font-size)/var(--code-line-height) var(--code-font-family); }
pre code { display: block; color: var(--text); white-space: pre; font: inherit; counter-reset: line; }
/* Preserve indentation inside each line without adding rows between line spans. */
.code-card pre code { white-space: normal; }
.line { display: block; min-height: calc(var(--code-font-size) * var(--code-line-height)); padding-right: 16px; white-space: pre; counter-increment: line; }
.line::before { display: inline-block; width: var(--code-gutter-width); margin-right: var(--code-gutter-gap); padding-right: var(--code-gutter-padding); border-right: 1px solid var(--border); color: var(--muted); content: counter(line); text-align: right; user-select: none; }
.tok-keyword { color: var(--keyword, var(--code-keyword)); }
.tok-type { color: var(--type, var(--code-type)); }
.tok-string { color: var(--string, var(--code-string)); }
.tok-comment { color: var(--comment, var(--code-comment)); font-style: italic; }
.tok-number, .tok-literal { color: var(--number, var(--code-number)); }
.tok-attribute, .tok-directive { color: var(--attribute, var(--code-attribute)); }
.tok-function { color: var(--function, var(--code-function)); }
.tok-operator { color: var(--operator, var(--code-operator)); }
