.reveal code.hl.lean.block {
    box-sizing: border-box;
    display: block;
    text-align: left;
    font-size: 0.55em;
    line-height: 1.45;
    border-radius: 6px;
    padding: 0.6em 0.8em;
    margin: 0.5em auto;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15);
    width: 95%;
    max-width: 95%;
    overflow-x: auto;
}
.reveal code.hl.lean.inline {
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
    padding: 0.1em 0.3em;
}
/* Tooltip styling — use viewport-relative sizing so tooltips
   scale with the presentation window like slide content does. */
.tippy-box {
    font-size: 1.8vw;
    line-height: 1.4;
    max-width: 50vw !important;
}
.tippy-box .tippy-content {
    max-height: 50vh;
    overflow-y: auto;
}
.tippy-box code,
.hl.lean .hover-info code {
    font-family: monospace;
    font-size: inherit;
}
.tippy-box .hl.lean {
    font-size: inherit;
}
.hl.lean div.docstring,
.hl.lean div.docstring * {
    max-width: none;
    width: auto;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
/* Lean comment styling (regular and doc comments) */
.hl.lean .lean-comment,
.hl.lean .doc-comment {
    color: var(--verso-code-comment-color);
    font-style: italic;
}
/* Verso token colors — purple/blue/teal, colorblind-safe.
   Literals and unknown tokens inherit the slide text color. */
.hl.lean .literal,
.hl.lean .unknown {
    color: inherit;
}
/* Dark slides (default) */
.reveal {
    --verso-code-keyword-color: #c678dd;
    --verso-code-const-color: #61afef;
    --verso-code-var-color: #56d4c0;
    --verso-code-comment-color: #7f848e;
}
/* Light slides — set per-section by code-block-bg.js */
.reveal section.slide-light-bg {
    --verso-code-keyword-color: #8839a0;
    --verso-code-const-color: #1a5fb4;
    --verso-code-var-color: #1a7a6a;
    --verso-code-comment-color: #a0a1a7;
}
/* Adapt hover/binding highlight colors to the reveal.js theme */
.reveal .hl.lean .token.binding-hl,
.reveal .hl.lean .literal.string:hover,
.reveal .hl.lean .token.typed:hover {
    background-color: rgba(128, 128, 128, 0.2);
}
.reveal .hl.lean .has-info.error:hover {
    background-color: rgba(255, 80, 80, 0.25);
}
.reveal .hl.lean .has-info.warning:hover {
    background-color: rgba(255, 200, 50, 0.25);
}
.reveal .hl.lean .has-info.information:hover {
    background-color: rgba(70, 120, 255, 0.25);
}
/* Scale wavy underlines with the code font size */
.reveal .hl.lean .has-info .token:not(.tactic-state):not(.tactic-state *),
.reveal .hl.lean .has-info .inter-text:not(.tactic-state):not(.tactic-state *) {
    text-decoration-thickness: 0.1em;
    text-underline-offset: 0.15em;
}
/* Suppress Verso's tactic toggle and hover popup inside slide code */
.hl.lean .tactic-toggle {
    display: none;
}
.hl.lean .tactic > label {
    display: contents;
}
.hl.lean .hover-container {
    display: none;
}
/* Fragment effects on code: transform requires inline-block for spans */
.reveal .hl.lean span.fragment {
    display: inline-block;
}

/* Fragment color effects: force descendant tokens to inherit the
   fragment's color so highlight-red etc. override token colors. */
.reveal .fragment.highlight-red.visible .token,
.reveal .fragment.highlight-red.visible .keyword,
.reveal .fragment.highlight-red.visible .literal,
.reveal .fragment.highlight-red.visible .unknown,
.reveal .fragment.highlight-red.visible .lean-comment,
.reveal .fragment.highlight-green.visible .token,
.reveal .fragment.highlight-green.visible .keyword,
.reveal .fragment.highlight-green.visible .literal,
.reveal .fragment.highlight-green.visible .unknown,
.reveal .fragment.highlight-green.visible .lean-comment,
.reveal .fragment.highlight-blue.visible .token,
.reveal .fragment.highlight-blue.visible .keyword,
.reveal .fragment.highlight-blue.visible .literal,
.reveal .fragment.highlight-blue.visible .unknown,
.reveal .fragment.highlight-blue.visible .lean-comment,
.reveal .fragment.highlight-current-red.current-fragment .token,
.reveal .fragment.highlight-current-red.current-fragment .keyword,
.reveal .fragment.highlight-current-red.current-fragment .literal,
.reveal .fragment.highlight-current-red.current-fragment .unknown,
.reveal .fragment.highlight-current-red.current-fragment .lean-comment,
.reveal .fragment.highlight-current-green.current-fragment .token,
.reveal .fragment.highlight-current-green.current-fragment .keyword,
.reveal .fragment.highlight-current-green.current-fragment .literal,
.reveal .fragment.highlight-current-green.current-fragment .unknown,
.reveal .fragment.highlight-current-green.current-fragment .lean-comment,
.reveal .fragment.highlight-current-blue.current-fragment .token,
.reveal .fragment.highlight-current-blue.current-fragment .keyword,
.reveal .fragment.highlight-current-blue.current-fragment .literal,
.reveal .fragment.highlight-current-blue.current-fragment .unknown,
.reveal .fragment.highlight-current-blue.current-fragment .lean-comment {
    color: inherit;
}

/* ── Non-Lean code blocks (with or without language tag) ── */
/* Match the same box styling as Lean code blocks */
.reveal pre:not(.code-with-panel pre) {
    box-sizing: border-box;
    margin: 0.5em auto;
    width: 95%;
    max-width: 95%;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    font-size: 0.55em;
    line-height: 1.45;
    text-align: left;
    padding: 0.6em 0.8em;
    overflow-x: auto;
}
.reveal pre > code[class*="language-"] {
    display: block;
    font-size: inherit;
    padding: 0;
}
/* Override monokai: transparent background so slide bg shows through */
.reveal pre > code.hljs {
    background: none;
}
/* ── highlight.js token colors — match Verso palette (dark slides) ── */
.reveal .hljs-keyword,
.reveal .hljs-selector-tag,
.reveal .hljs-literal {
    color: var(--verso-code-keyword-color);
    font-weight: normal;
}
.reveal .hljs-built_in,
.reveal .hljs-type,
.reveal .hljs-title,
.reveal .hljs-section,
.reveal .hljs-selector-id {
    color: var(--verso-code-const-color);
    font-weight: normal;
}
.reveal .hljs-variable,
.reveal .hljs-template-variable,
.reveal .hljs-attr,
.reveal .hljs-params,
.reveal .hljs-name,
.reveal .hljs-tag {
    color: var(--verso-code-var-color);
    font-weight: normal;
}
.reveal .hljs-string,
.reveal .hljs-bullet,
.reveal .hljs-subst,
.reveal .hljs-addition {
    color: #98c379;
}
.reveal .hljs-number {
    color: #d19a66;
}
.reveal .hljs-comment,
.reveal .hljs-quote,
.reveal .hljs-deletion,
.reveal .hljs-meta {
    color: #7f848e;
}
.reveal .hljs-symbol,
.reveal .hljs-regexp,
.reveal .hljs-link {
    color: #56b6c2;
}
.reveal .hljs-emphasis {
    font-style: italic;
}
.reveal .hljs-strong {
    font-weight: bold;
}
/* Light-slide overrides for highlight.js tokens */
.reveal section.slide-light-bg .hljs-string,
.reveal section.slide-light-bg .hljs-bullet,
.reveal section.slide-light-bg .hljs-subst,
.reveal section.slide-light-bg .hljs-addition {
    color: #50a14f;
}
.reveal section.slide-light-bg .hljs-number {
    color: #986801;
}
.reveal section.slide-light-bg .hljs-comment,
.reveal section.slide-light-bg .hljs-quote,
.reveal section.slide-light-bg .hljs-deletion,
.reveal section.slide-light-bg .hljs-meta {
    color: #a0a1a7;
}
.reveal section.slide-light-bg .hljs-symbol,
.reveal section.slide-light-bg .hljs-regexp,
.reveal section.slide-light-bg .hljs-link {
    color: #0184bc;
}

/* slide-click-only: always visible, but participates in fragment ordering */
.reveal .fragment.slide-click-only {
    opacity: 1;
    visibility: inherit;
}
.reveal .fragment.slide-click-only.visible {
    opacity: 1;
    visibility: inherit;
}
