:root {
    /** Typography **/
    /* The font family used for headers, ToC entries, etc */
    --verso-structure-font-family: "Helvetica Neue", "Segoe UI", "Roboto", Arial, sans-serif;
    /* The font family used for body text */
    --verso-text-font-family: "Helvetica Neue", "Segoe UI", "Roboto", Arial, sans-serif;
    /* The font family used for code */
    --verso-code-font-family: monospace;

    /** Text colors **/
    --verso-text-color: black;
    --verso-code-color: black;
    --verso-structure-color: black;

    /** Selected items (e.g. search results) */
    --verso-selected-color: #def;

    /** Tooltips **/
    /*
    These colors are used for the tooltips that display documentation and messages for code,
    and for the equivalent popups that are shown when scripts are unavailable. The
    severity-specific tooltip colors below default to the foreground and background given
    here. The separator color draws the rule between sections of a tooltip's content.
    */
    --verso-tooltip-color: black;
    --verso-tooltip-bg-color: #e5e5e5;
    --verso-tooltip-border-color: black;
    --verso-tooltip-separator-color: #ccc;

    /** Message colors **/
    /*
    These colors are used to render Lean's feedback. Each severity (info, warning, error)
    has four sets of related styles:

    - The affected code itself: foreground and background, both at rest and while hovered,
      plus the indicator color, which draws the wavy underline marking that a message is
      present.
    - The text of the message, via the message color. This color is also used for embedded
      code.
    - The tooltip that displays the message: foreground, background, and border. The border
      color also draws the accent bar next to a message when it is shown without scripts,
      and the background also colors the tooltip's arrow.
    - The marker bar in the margin of output blocks, via the output color.
    */
    --verso-code-info-color: currentcolor;
    --verso-code-info-bg-color: transparent;
    --verso-code-info-hover-color: currentcolor;
    --verso-code-info-hover-bg-color: #4777ff;
    --verso-info-indicator-color: #4777ff;
    --verso-message-info-color: currentcolor;
    --verso-tooltip-info-color: var(--verso-tooltip-color);
    --verso-tooltip-info-bg-color: var(--verso-tooltip-bg-color);
    --verso-tooltip-info-border-color: #4777ff;
    --verso-output-info-color: var(--verso-info-indicator-color);

    --verso-code-warning-color: currentcolor;
    --verso-code-warning-bg-color: transparent;
    --verso-code-warning-hover-color: currentcolor;
    --verso-code-warning-hover-bg-color: #ffd580;
    --verso-warning-indicator-color: #e7a71d; /* 2.11 contrast ratio for white, 9.94 for black */
    --verso-message-warning-color: currentcolor;
    --verso-tooltip-warning-color: var(--verso-tooltip-color);
    --verso-tooltip-warning-bg-color: var(--verso-tooltip-bg-color);
    --verso-tooltip-warning-border-color: #ffd580;
    --verso-output-warning-color: var(--verso-warning-indicator-color);

    --verso-code-error-color: currentcolor;
    --verso-code-error-bg-color: transparent;
    --verso-code-error-hover-color: currentcolor;
    --verso-code-error-hover-bg-color: #ffb3b3;
    --verso-error-indicator-color: #ff0000;
    --verso-message-error-color: #cc0000;
    --verso-tooltip-error-color: var(--verso-tooltip-color);
    --verso-tooltip-error-bg-color: var(--verso-tooltip-bg-color);
    --verso-tooltip-error-border-color: #ffb3b3;
    --verso-output-error-color: var(--verso-error-indicator-color);

    /** Proof states **/
    /*
    These colors are used for the proof state displays that can be expanded inside of proofs
    and shown in tooltips. The toggle colors are used for the control that expands and
    collapses a proof state.
    */
    --verso-tactic-state-color: black;
    --verso-tactic-state-bg-color: white;
    --verso-tactic-state-border-color: #888888;
    --verso-tactic-toggle-color: #bbbbbb;
    --verso-tactic-toggle-checked-color: #999999;

    /** Code Highlighting **/
    /*
    These variables control the rendering of Lean code emitted by Verso. Each category that can be
    highlighted supports the customization of color, weight, style, and family.
    */
    /* Constants (e.g. `List` or `id` or `none`) */
    --verso-code-const-color: var(--verso-code-color);
    --verso-code-const-weight: normal;
    --verso-code-const-style: normal;
    --verso-code-const-font-family: var(--verso-code-font-family);

    /* Keywords/atoms (e.g. `for` or `def` or `induction`) */
    --verso-code-keyword-color: var(--verso-code-color);
    --verso-code-keyword-weight: bold;
    --verso-code-keyword-style: normal;
    --verso-code-keyword-font-family: var(--verso-code-font-family);

    /* Local bindings (e.g. `x` in `let x := 5`) */
    --verso-code-var-color: var(--verso-code-color);
    --verso-code-var-weight: normal;
    --verso-code-var-style: italic;
    --verso-code-var-font-family: var(--verso-code-font-family);

    /* The background of interactive code while hovered (hoverable tokens, occurrences of a
       hovered binding, and the tactics that expand to a proof state) */
    --verso-code-hover-bg-color: #eeeeee;
}


/* u2u.ch theme for the engine docs (Verso output). Appended to docs/verso-vars.css at deploy. */
:root {
  --bg: #f6f3ec; --ink: #1b1a17; --muted: #68645a; --line: #d8d3c6;
  --accent: #b8381a; --panel: #fffdf8; --code-bg: #efeadf;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --verso-structure-font-family: var(--sans);
  --verso-text-font-family: var(--sans);
  --verso-code-font-family: var(--mono);
  --verso-text-color: var(--ink);
  --verso-code-color: var(--ink);
  --verso-structure-color: var(--ink);
  --verso-toc-background-color: var(--bg);
  --verso-toc-border-color: var(--line);
  --verso-selected-color: var(--code-bg);
  --verso-tooltip-color: var(--ink);
  --verso-tooltip-bg-color: var(--panel);
  --verso-tooltip-border-color: var(--line);
  --verso-content-max-width: 44rem;
  --verso-font-size: 17px;
  --verso-header-height: 3.25rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412; --ink: #ece8df; --muted: #9c978b; --line: #34312b;
    --accent: #ec7a5a; --panel: #1d1b18; --code-bg: #22201c;
    --verso-burger-toc-hidden-color: var(--ink);
    --verso-burger-toc-visible-shadow-color: transparent;
    --verso-burger-toc-hidden-shadow-color: transparent;
  }
}

html, body { background: var(--bg); color: var(--ink); }
body { line-height: 1.65; -webkit-text-size-adjust: 100%; }
a, a:visited { color: var(--accent); }

/* header */
header { background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: none; }
.header-title h1 { font: 700 1.15rem/1 var(--mono); letter-spacing: .02em; }

/* table of contents */
#toc { background: var(--bg); border-right: 1px solid var(--line); }
#toc a, #toc a:visited { color: var(--ink); text-decoration: none; }
#toc a:hover { color: var(--accent); }
#toc .split-toc table, #toc .split-toc td { border: 0; background: transparent; }
#toc .split-toc td { padding: .2rem .35rem; }
#toc .split-toc td.num { color: var(--muted); font-family: var(--mono); font-size: .85em; }
#toc .split-toc .current td:not(.num), #toc .split-toc .title .current { color: var(--accent); font-weight: 600; }
.toc-title h1, #toc .split-toc .title { font: 600 .8rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* headings */
main h1 { font-size: 2.1rem; line-height: 1.15; margin: 1.5rem 0 1.25rem; }
main h2 { font-size: 1.35rem; margin-top: 2.75rem; padding-top: .9rem; border-top: 1px solid var(--line); }
main h3 { font-size: 1.1rem; margin-top: 2rem; }
main .section-toc a, main .section-toc a:visited { color: var(--ink); }
main .section-toc a:hover { color: var(--accent); }

/* code: statements and examples */
pre, code { font-family: var(--mono); }
:not(pre) > code { background: var(--code-bg); padding: .08em .3em; border-radius: 3px; font-size: .92em; }
.hl.lean.block, main pre {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 0; padding: .9rem 1rem; margin: 1.25rem 0; font-size: .88rem; line-height: 1.55;
  overflow-x: auto; white-space: pre-wrap;
}
.hl.lean .keyword.token { color: var(--accent); font-weight: 600; }
.hl.lean .const.token { color: var(--ink); }
.hl.lean .var.token { color: var(--muted); font-style: italic; }
.hl.lean .literal.token { color: #2f6f4f; }
@media (prefers-color-scheme: dark) { .hl.lean .literal.token { color: #8cc7a1; } }

/* reading / explanation / direction boxes */
.note {
  background: transparent; border: 0; border-left: 2px solid var(--line);
  padding: .1rem 0 .1rem 1rem; margin: -.4rem 0 1.5rem; color: var(--ink);
}
.note .note-label {
  font: 600 .72rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin: 0 0 .25rem;
}
.note p { margin: .3rem 0; }

/* docstrings and tables */
.namedocs, .docstring-section { background: var(--panel); border: 1px solid var(--line); border-radius: 0; }
.namedocs .label { color: var(--muted); font-family: var(--mono); }
table { border-collapse: collapse; }
main table th, main table td { border-bottom: 1px solid var(--line); padding: .45rem .6rem; text-align: left; vertical-align: top; }
main table th { font: 600 .78rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* prev / next */
.prev-next-buttons { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2.5rem; }
.prev-next-buttons a, .prev-next-buttons a:visited { color: var(--ink); text-decoration: none; }
.prev-next-buttons a:hover { color: var(--accent); }

/* tooltips (hover on names) */
.tippy-box { background: var(--panel) !important; color: var(--ink) !important; border: 1px solid var(--line); border-radius: 0 !important; box-shadow: 0 6px 24px rgba(0,0,0,.12); }

@media screen and (max-width: 700px) {
  main h1 { font-size: 1.7rem; }
  .hl.lean.block, main pre { font-size: .82rem; padding: .75rem; }
}

/* nested code inside docstrings: no second frame */
.namedocs pre, .namedocs .hl.lean.block, .docstring-section pre, .constructor pre {
  border: 0; border-left: 0; background: transparent; padding: .25rem 0; margin: .25rem 0;
}
.note { background: var(--panel); }
header input, #search-wrapper input, .search-box input { background: var(--panel); color: var(--ink); border-color: var(--line); }

/* boxes (reading / explanation / direction): beat the inline style from Ext.lean */
:root { --box-bg: #ece6d8; --box-line: #c9bfa9; }
@media (prefers-color-scheme: dark) { :root { --box-bg: #262320; --box-line: #4a453c; } }
main .note {
  background: var(--box-bg); color: var(--ink);
  border: 0; border-left: 3px solid var(--box-line); border-radius: 0;
  padding: .7rem 1rem; margin: .25rem 0 1.5rem; font-size: .95rem; line-height: 1.6;
}
main .note .note-label {
  font: 600 .7rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin: 0 0 .3rem;
}
main .note p { margin: .3rem 0; color: var(--ink); }
main .note code { background: rgba(0,0,0,.06); }
@media (prefers-color-scheme: dark) { main .note code { background: rgba(255,255,255,.08); } }

/* search box uses --verso-background-color */
:root { --verso-background-color: var(--bg); }

/* inline styles from Ext.lean: override with higher specificity */
main pre.textfile {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-left: 4px solid var(--muted); padding: .9rem 1rem; margin: 1.25rem 0;
  font-size: .88rem; line-height: 1.55; overflow-x: auto;
}
main pre.textfile code { background: transparent; padding: 0; color: var(--ink); }
main table td, main table th { border: 0; border-bottom: 1px solid var(--line); }
main details.fold > summary, main .thm-src { color: var(--muted); }
main a.claim, main a.claim:visited { color: inherit; text-decoration: underline dotted var(--muted); text-underline-offset: 3px; }
main a.claim:hover { color: var(--accent); text-decoration: underline; }

/* example captions: constant · checked against the spec · claims */
main .example-caption {
  font: .8rem/1.5 var(--sans); color: var(--muted);
  margin: -.9rem 0 1.5rem; padding: .45rem 1rem;
  border: 1px solid var(--line); border-top: 0; background: var(--bg);
}
main .example-caption code { background: transparent; color: var(--ink); padding: 0; }
main .example-caption a.claim, main .example-caption a.claim:visited { color: var(--ink); }
main pre.textfile:has(+ .example-caption) { margin-bottom: 0; }
main pre.textfile + .example-caption { margin-top: 0; }
