/* Proof graph of BlowupZoo: the style of the viewer. A white page, one text face (STIX Two Text,
   in vendor/stix with its licence), formulas by KaTeX (vendor/katex). One accent colour (blue);
   orange marks a place where the Lean proof takes another route than the paper, green the original
   route that the library keeps. No gradients and no shadows. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--text); display: flex; flex-direction: column;
  overflow: hidden; -webkit-text-size-adjust: 100%; font-variant-numeric: lining-nums; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: .86em var(--mono); background: var(--soft); padding: 0 .22em; overflow-wrap: anywhere; }
.katex { font-size: 1.06em; }
.katex-display { margin: .5em 0; overflow-x: auto; overflow-y: hidden; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- the head of the page ------------------------------------------------------------------------- */
.bar { display: flex; align-items: center; gap: 14px; padding: 9px 18px; background: var(--surface);
  border-bottom: 1px solid var(--ink); flex: none; }
.bar, .chips, .cap { font-family: var(--ui); }
.brand { font-weight: 700; font-size: 17px; letter-spacing: .01em; white-space: nowrap; }
.brand span { font-weight: 400; font-style: italic; color: var(--ink2); margin-left: 8px; font-size: 15px; }
.bar select { background: var(--surface); border: 1px solid var(--line2); border-radius: 2px; padding: 4px 6px;
  max-width: 38vw; text-overflow: ellipsis; }
.grow { flex: 1; }
.search { position: relative; flex: 0 1 290px; min-width: 120px; }
.search input { width: 100%; background: var(--surface); border: 1px solid var(--line2); border-radius: 2px; padding: 5px 9px; }
.results { position: absolute; z-index: 30; top: calc(100% + 3px); left: 0; right: 0; min-width: 340px; margin: 0;
  padding: 3px; list-style: none; background: var(--surface); border: 1px solid var(--ink); max-height: 62vh; overflow: auto; }
.results li { padding: 5px 8px; cursor: pointer; }
.results li[aria-selected="true"], .results li:hover { background: var(--accent-wash); }
.results .r1 { display: block; }
.results .r2 { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { background: var(--surface); border: 1px solid var(--line2); border-radius: 2px; padding: 4px 11px; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.bar .cw-open { border: 0; background: transparent; padding: 0; min-height: 30px; font: inherit; color: var(--accent-ink); }
.bar .cw-open:is(:hover, [aria-expanded="true"]) { text-decoration: underline; text-underline-offset: .2em; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn:disabled { color: var(--muted); border-color: var(--line); cursor: default; }
.no { font-variant-numeric: lining-nums tabular-nums; color: var(--muted); margin-right: .45em; white-space: nowrap; }

/* --- the chips ------------------------------------------------------------------------------------ */
.chips { display: flex; align-items: center; gap: 7px; padding: 6px 18px; background: var(--surface);
  border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; scrollbar-width: thin; }
.chips .lab { color: var(--muted); font-style: italic; white-space: nowrap; }
.chip { border: 1px solid var(--line2); background: transparent; border-radius: 2px; padding: 2px 10px;
  font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.r1 { border-color: var(--other); }
.chip.r1[aria-pressed="true"] { background: var(--other); border-color: var(--other); color: #fff; }
.chip.r2 { border-color: var(--orig); border-style: dashed; }
.chip.r2[aria-pressed="true"] { background: var(--orig); border-color: var(--orig); border-style: solid; color: #fff; }
.chip .mk { font-size: 11px; }
.sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; flex: none; }

/* --- the figure: the graph and its caption ---------------------------------------------------------- */
main { flex: 1; display: flex; min-height: 0; position: relative; }
.fig { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; position: relative; overflow: hidden; touch-action: none; cursor: grab; outline: none; background: var(--bg); }
.view.drag { cursor: grabbing; }
.cap { flex: none; border-top: 1px solid var(--line); padding: 7px 18px 8px; font-size: 13.5px; line-height: 1.45; color: var(--ink2);
  display: flex; gap: 18px; align-items: baseline; justify-content: flex-end; }
.cap #caption { flex: 1; min-width: 0; }
.cap #caption:empty { display: none; }
.cap i.sw { display: inline-block; width: 16px; height: 10px; border: 1px solid var(--line2); background: var(--surface);
  vertical-align: baseline; margin: 0 3px 0 2px; }
.cap i.sw.r1 { border-color: var(--other); border-left-width: 4px; background: var(--other-wash); }
.cap i.sw.r2 { border-color: var(--orig); border-style: dashed; background: var(--orig-wash); }
.cap i.sw.e1 { background: var(--l1); border-color: var(--l1); } .cap i.sw.e2 { background: var(--l2); border-color: var(--l2); }
.cap i.sw.e3 { background: var(--l3); border-color: var(--l3); } .cap i.sw.e4 { background: var(--l4); border-color: var(--l4); }
.cap i.sw.e5 { background: var(--l5); border-color: var(--l5); } .cap i.sw.ebad { background: #c22f2f; border-color: #c22f2f; }
.cap .tools { flex: none; display: flex; gap: 12px; white-space: nowrap; }
.cap .tools button { border: 0; background: none; padding: 0; color: var(--accent-ink); }
.cap .tools button:hover { text-decoration: underline; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.edges path { fill: none; stroke: var(--line2); stroke-width: 1; }
/* the frame of an open step, the links between the steps, the label of a link under the pointer */
.edges path.frames { fill: var(--soft); stroke: var(--line2); }
.edges path.link { stroke: var(--ink2); stroke-width: 1.3; }

.edges g.on path.link, .edges g.over path.link { stroke: var(--accent); stroke-width: 2.2; }
.edges g.cw-link path.link { stroke: var(--accent-ink); stroke-width: 2.5; }
/* dotted: a use that the proof in words draws and that its named Lean results do not show */
.edges path.link.fig, .edges g.on path.link.fig, .edges g.over path.link.fig { stroke-dasharray: 1 5; stroke-linecap: round; stroke-width: 1.7; }
.edges path.hit { stroke: transparent; stroke-width: 14; pointer-events: stroke; }
.tip { position: absolute; z-index: 9; max-width: 340px; padding: 5px 9px; background: var(--ink); color: var(--bg);
  font-size: 13px; line-height: 1.35; pointer-events: none; }
.node { position: absolute; left: 0; top: 0; background: var(--surface); border: 1px solid var(--line2);
  border-radius: 2px; padding: 7px 11px 7px 11px; cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background-color .35s, border-color .2s, color .35s; will-change: transform, opacity; }
.node:hover { border-color: var(--ink); }
.node .t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; overflow-wrap: anywhere;
  font-size: 14px; line-height: 1.36; }
.node .b { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.3; color: var(--muted); font-style: italic;
  font-variant-numeric: lining-nums tabular-nums; }
.node.k-root { padding: 14px 18px; border: 1.5px solid var(--ink); text-align: center; }
.node.k-root .t { font-weight: 700; font-size: 19px; line-height: 1.28; }
.node.k-stage { padding: 9px 11px; border-color: var(--ink2); }
.node.k-stage .t { font-weight: 600; font-size: 15px; line-height: 1.3; }
.node.k-step .t { font-size: 14.5px; }
.node.k-decl .t, .node.k-ext .t, .node.k-claim .t { -webkit-line-clamp: 3; }
.node.bg { border-style: dashed; }
/* a box that can be opened shows a small sign at its right edge */
.node.can::after { content: "+"; position: absolute; right: 6px; bottom: 3px; font: 400 14px/1 var(--text); color: var(--muted); }
.node.open::after { content: "\2212"; }
.node.can { padding-right: 21px; }
.node.k-root.can { padding-right: 18px; }
.node.sel { border-color: var(--ink); outline: 1.5px solid var(--ink); z-index: 3; }
/* the routes: a mark in the corner and a colour, never the colour alone */
.node .mk { position: absolute; top: -8px; right: 9px; font-size: 10.5px; line-height: 1; padding: 1px 4px 2px;
  background: var(--surface); border: 1px solid var(--line2); color: var(--ink2); font-variant-numeric: lining-nums; }
.node.rt1 { border-color: var(--other); border-left-width: 4px; background: var(--other-wash); padding-left: 8px; }
.node.rt1 .mk, .node.rin .mk { border-color: var(--other); color: var(--other-ink); }
.node.rt2 { border-color: var(--orig); border-style: dashed; background: var(--orig-wash); }
.node.rt2 .mk { border-color: var(--orig); color: var(--orig-ink); }

/* a highlight asked for by a chip: the marked boxes in the accent, a bar on top of a box that holds some */
.view.hl .node:not(.h1):not(.h2):not(.sel) { filter: opacity(.42); }
.view.hl .node.h1 { border-color: var(--accent); outline: 1.5px solid var(--accent); background: var(--accent-wash); }
.view.hl .node.h1.rt1 { border-color: var(--other); outline-color: var(--other); background: var(--other-wash); }
.view.hl .node.h1.rt2 { border-color: var(--orig); outline-color: var(--orig); background: var(--orig-wash); }
.view.hl .node.h2 { border-top: 3px solid var(--accent); }
.view.hl.r1 .node.h2 { border-top-color: var(--other); }
.view.hl.r2 .node.h2 { border-top-color: var(--orig); }
/* a thought experiment: the level on a sequential scale, a status as a word */
.view.ex .node { background: var(--surface); border-color: var(--line2); border-left-width: 1px; border-style: solid; padding-left: 11px; }
.view.ex .node .mk { display: none; }
.view.ex .node .em { position: absolute; top: -9px; left: 9px; font-size: 11px; line-height: 1; padding: 2px 5px;
  background: var(--surface); border: 1px solid var(--ink2); color: var(--ink); font-variant-numeric: lining-nums; }
.view.ex .node.e1 { background: var(--l1); color: var(--l1-ink); border-color: var(--l1); }
.view.ex .node.e2 { background: var(--l2); color: var(--l2-ink); border-color: var(--l2); }
.view.ex .node.e3 { background: var(--l3); color: var(--l3-ink); border-color: var(--l3); }
.view.ex .node.e4 { background: var(--l4); color: var(--l4-ink); border-color: var(--l4); }
.view.ex .node.e5 { background: var(--l5); color: var(--l5-ink); border-color: var(--l5); }
.view.ex .node.ebad { background: #c22f2f; color: #fff; border-color: #c22f2f; }
.view.ex .node.e1 .b, .view.ex .node.e2 .b, .view.ex .node.e3 .b, .view.ex .node.e4 .b, .view.ex .node.e5 .b, .view.ex .node.ebad .b,
.view.ex .node.e1 .no, .view.ex .node.e2 .no, .view.ex .node.e3 .no, .view.ex .node.e4 .no, .view.ex .node.e5 .no, .view.ex .node.ebad .no,
.view.ex .node.e1::after, .view.ex .node.e2::after, .view.ex .node.e3::after, .view.ex .node.e4::after, .view.ex .node.e5::after,
.view.ex .node.ebad::after { color: inherit; opacity: .85; }
.view.ex .node.ebad .em { border-color: var(--crit); color: var(--crit); }
.view.ex .node.eobs { border: 2px solid var(--crit); }
.view.ex .node.eobs .em { border-color: var(--crit); color: var(--crit); }
.view.ex .node.eok .em { border-color: var(--good); color: var(--good); }
.view.ex .node.eunk { border-style: dashed; }
/* a box that only inherits the entry of a box above it: a bar in the colour of the level, no fill */
.view.ex .node.einh { background: var(--surface); color: var(--ink); border-color: var(--line2); border-left-width: 4px; padding-left: 8px; }
.view.ex .node.einh.e1 { border-left-color: var(--l1); } .view.ex .node.einh.e2 { border-left-color: var(--l2); }
.view.ex .node.einh.e3 { border-left-color: var(--l3); } .view.ex .node.einh.e4 { border-left-color: var(--l4); }
.view.ex .node.einh.e5 { border-left-color: var(--l5); }
.view.ex .node.einh.ebad, .view.ex .node.einh.eobs { border-left-color: var(--crit); border-width: 1px 1px 1px 4px; }
.view.ex .node.einh .b, .view.ex .node.einh .no, .view.ex .node.einh::after { color: var(--muted); opacity: 1; }
.view.ex .node.sel { outline: 1.5px solid var(--ink); }
.node[data-constant-state="input"] { border-color: var(--warn); }
.node[data-constant-state="changed"] { border-color: var(--accent); background: var(--accent-wash); }
.node[data-constant-state="failed"] { border-color: var(--crit); background: color-mix(in srgb, var(--crit) 10%, var(--surface)); }
.node[data-constant-state="dependent"] { border-top: 3px solid var(--accent); padding-top: 5px; }
.node.cw-proof-file { border-style: dashed; }
.node .cw-proof-badge { position: absolute; top: -9px; left: 9px; padding: 1px 5px; border: 1px solid var(--line2);
  background: var(--surface); color: var(--ink); font-size: 11px; line-height: 1.15; white-space: nowrap; }
.node[data-constant-state="input"] .cw-proof-badge { border-color: var(--warn); }
.node[data-constant-state="changed"] .cw-proof-badge { border-color: var(--accent); }
.node[data-constant-state="failed"] .cw-proof-badge { border-color: var(--crit); color: var(--crit); }

/* --- the tour ----------------------------------------------------------------------------------------- */
.tour { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 8; width: min(740px, calc(100% - 28px));
  background: var(--surface); border: 1px solid var(--ink); padding: 11px 14px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; }
.tour h2 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; grid-column: 1; }
.tour p { margin: 0; grid-column: 1; line-height: 1.5; color: var(--ink2); }
.tour .nav { grid-column: 2; grid-row: 1 / span 3; display: flex; gap: 6px; align-items: center; }

/* --- the thought experiments: a dock under the graph, or beside it on a wide screen ----------------------- */
.exp { flex: none; background: var(--surface); border-top: 1px solid var(--ink); padding: 10px 18px 12px; display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(300px, 1fr) minmax(240px, 370px); gap: 4px 28px; max-height: 298px; overflow: hidden; }
.exp .exl, .exp .ctl, .exp .aff { max-height: 274px; overflow: auto; min-width: 0; }
.exp h2 { margin: 0 0 2px; font-size: 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.exp .note { margin: 2px 0 6px; }
.exp .ill { display: inline-block; font-size: 12px; letter-spacing: .05em; font-variant-caps: all-small-caps; border: 1px solid var(--warn);
  color: var(--warn); padding: 1px 5px; margin: 4px 0; }
.exp ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.exp li button { width: 100%; text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 2px; padding: 2px 9px; }
.exp li button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); }
.exp li .q { color: var(--muted); font-size: 12px; margin-right: 7px; font-variant-numeric: lining-nums; }
.exp .ctl p { margin: 0 0 8px; color: var(--ink2); line-height: 1.5; }
.exp .ctl label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.exp .ctl label.sw { font-size: 15px; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line2); border-radius: 2px; padding: 5px 12px; }
.exp .ctl label.sw input { width: 16px; height: 16px; accent-color: var(--accent); }
.exp .ctl select { background: var(--surface); border: 1px solid var(--line2); border-radius: 2px; padding: 4px 6px; max-width: 100%; }
.exp .val { font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.exp input[type=range] { width: 100%; accent-color: var(--accent); }
.exp .marks { position: relative; height: 32px; font-size: 11px; color: var(--muted); }
.exp .marks button { position: absolute; top: 0; transform: translateX(-50%); background: none; border: 0; padding: 0 2px;
  color: inherit; font: inherit; white-space: nowrap; text-align: center; line-height: 1.15; }
.exp .marks button::before { content: ""; display: block; width: 1px; height: 6px; background: var(--line2); margin: 0 auto 1px; }
.exp .marks button:hover { color: var(--accent-ink); }
.exp .aff { font-size: 13.5px; }
.exp .aff label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 2px; font-style: italic; }
.exp .aff a { display: flex; gap: 8px; padding: 1px 0; color: inherit; align-items: baseline; }
.exp .aff .lv { flex: none; width: 84px; font-variant-numeric: lining-nums tabular-nums; color: var(--muted); font-style: italic; }

/* --- the panel ---------------------------------------------------------------------------------------- */
.panel { flex: none; width: 410px; background: var(--surface); border-left: 1px solid var(--ink); overflow: auto; padding: 14px 20px 30px; position: relative; }
.crumbs { font-size: 12.5px; color: var(--muted); margin: 0 54px 9px 0; line-height: 1.6; }
.crumbs a { color: inherit; display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs b { color: var(--ink2); font-weight: 400; }
.panel .x { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; padding: 0; color: var(--accent-ink); font-size: 13.5px; }
.panel .x:hover { text-decoration: underline; }
.panel .k { font-size: 13px; letter-spacing: .06em; font-variant-caps: all-small-caps; color: var(--muted); }
.panel .pg-constants { margin: .2em 0 .8em; padding-left: 1.2em; }
.panel .pg-constants li { margin: 0 0 .3em; }
.panel .pg-note { color: var(--muted); }
.panel h1 { margin: 1px 0 8px; font-size: 21px; font-weight: 700; line-height: 1.26; }
.panel h1 .no { color: var(--ink); margin-right: .35em; }
.panel h1.long { font-size: 17px; line-height: 1.32; }
.panel h2 a { color: inherit; }

.panel p.size { margin: 18px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-variant-numeric: lining-nums; }
.panel a.mono { font: .86em var(--mono); overflow-wrap: anywhere; }
.panel h2 { margin: 18px 0 5px; font-size: 13.5px; font-weight: 600; letter-spacing: .06em; font-variant-caps: all-small-caps; color: var(--ink2);
  border-top: 1px solid var(--line); padding-top: 7px; }
.panel p { margin: 0 0 9px; font-size: 15.5px; line-height: 1.55; }
.panel p.s { font-size: 14px; line-height: 1.5; color: var(--ink2); overflow-wrap: anywhere; }
.panel a { overflow-wrap: anywhere; }
.panel .lean, .panel .lean a { font: 12px/1.5 var(--mono); }
.panel .lean { margin: 0 0 8px; color: var(--ink2); overflow-wrap: anywhere; }
.panel .lean code { background: none; padding: 0; font-size: 1em; }
.panel .badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); border-radius: 2px;
  padding: 1px 8px; font-size: 13px; margin: 0 6px 6px 0; background: transparent; }
.panel .badge.r1 { border-color: var(--other); color: var(--other-ink); background: var(--other-wash); }
.panel .badge.r2 { border-color: var(--orig); color: var(--orig-ink); background: var(--orig-wash); border-style: dashed; }
.panel .badge.tag { cursor: pointer; }
.panel .badge.tag:hover { border-color: var(--accent); }
.panel pre { margin: 0 0 9px; padding: 8px 10px; background: var(--soft); font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.panel ul { margin: 0 0 9px; padding: 0; list-style: none; }
.panel li { padding: 2px 0; font-size: 14.5px; line-height: 1.4; }
.panel li small { color: var(--muted); font: 11.5px var(--mono); }
.panel .row { border-left: 1px solid var(--line2); padding: 2px 0 2px 11px; margin: 0 0 12px; }
.panel .row.r1 { border-left: 4px solid var(--other); }
.panel .row h3 { margin: 0 0 3px; font-size: 15px; font-weight: 600; line-height: 1.35; }
.panel .row p { font-size: 14.5px; line-height: 1.5; margin: 0 0 4px; }
.panel .row .w { font-size: 12px; letter-spacing: .06em; font-variant-caps: all-small-caps; color: var(--muted); display: block; margin-top: 4px; }
.panel dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 9px; font-size: 14.5px; }
.panel dt { color: var(--muted); } .panel dd { margin: 0; font-variant-numeric: lining-nums tabular-nums; }
.panel .lv { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.panel .meter { flex: 1; height: 7px; background: var(--line); overflow: hidden; }
.panel .meter i { display: block; height: 100%; background: var(--accent); }
.panel .meter.bad i { background: #c22f2f; }
.note { color: var(--muted); font-size: 13.5px; }
.msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; color: var(--ink2); font-size: 17px; font-style: italic; }

/* --- wide screens: the dock of the thought experiments stands beside the graph, which keeps its height ---- */
@media (min-width: 1180px) {
  body { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto minmax(0, 1fr); }
  .bar, .chips { grid-column: 1 / -1; }
  main { grid-column: 1; grid-row: 3; }
  .exp { grid-column: 2; grid-row: 3; width: 470px; box-sizing: border-box; grid-template-columns: minmax(0, 1fr); align-content: start;
    gap: 14px; max-height: none; overflow: auto; border-top: 0; border-left: 1px solid var(--ink); padding: 14px 18px 24px; }
  .exp .exl, .exp .ctl, .exp .aff { max-height: none; overflow: visible; }
}

/* --- narrow screens: the panel is a sheet at the bottom ----------------------------------------------- */
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; gap: 7px 10px; padding: 8px 10px; }
  .brand span { display: none; }
  .bar select { max-width: 52vw; }
  .search { flex: 1 1 100%; order: 5; }
  .chips { padding: 6px 10px; }
  main { flex-direction: column; }
  .panel { width: auto; border-left: 0; border-top: 1px solid var(--ink); max-height: 46%; padding: 11px 14px 20px; }
  .cap { padding: 6px 10px; flex-direction: column; gap: 3px; font-size: 12.5px; }
  .cap .tools { flex-wrap: wrap; gap: 5px 12px; }
  .cap #caption { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
  .tour { grid-template-columns: 1fr; }
  .tour .nav { grid-column: 1; grid-row: auto; }
  .exp { grid-template-columns: 1fr; max-height: 44%; padding: 8px 12px; overflow: auto; }
  .exp .exl, .exp .ctl, .exp .aff { max-height: none; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .node { transition: none; } }

/* The proof graph and its two reading panels share the original white canvas. */
.brand { color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.overview { white-space: nowrap; }
main .exp {
  width: min(470px, 38vw);
  display: block;
  overflow: auto;
  overscroll-behavior-y: contain;
  border: 0;
  border-left: 1px solid var(--ink);
  padding: 14px 20px 26px;
}
.exp select {
  width: 100%;
  margin: 9px 0 10px;
  padding: 5px 8px;
  border: 1px solid var(--line2);
  background: var(--surface);
}
.experiment-content p { margin: .6em 0; }
.pg-question { font-style: italic; }
.pg-question b { font-style: normal; }
.experiment-cases { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0; }
.experiment-cases .btn { white-space: normal; text-align: left; }
.experiment-evidence:empty { display: none; }
.experiment-evidence, .pg-more { border-top: 1px solid var(--line); padding-top: 9px; margin: 10px 0; }
.pg-more summary { color: var(--accent-ink); cursor: pointer; }
.pg-basis { display: inline-block; padding: 0 .4em; margin-inline: .2em; border: 1px solid var(--line2); font-size: .8em; }
.pg-case { font-weight: 600; }
.pg-place { font-weight: 600; }
.pg-word { font-weight: 400; color: var(--muted); }
.pg-source { display: block; overflow-wrap: anywhere; }
.pg-meta { color: var(--ink2); font-size: .9em !important; }
.tex { font-family: var(--math); font-variant-numeric: lining-nums; }
.tex sup, .tex sub { line-height: 0; }
.radicand, .overline { border-top: 1px solid currentColor; }
.radicand { white-space: nowrap; }
.fraction { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1.25; margin: 0 2px; }
.fraction .numerator { border-bottom: 1px solid currentColor; padding: 0 1px; }
.fraction .denominator { padding: 1px 3px 0; }
.fraction .slash { display: none; }
.equation { overflow-x: auto; text-align: center; }
.route-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 2px 2px 0;
  color: var(--ink);
  white-space: nowrap;
  cursor: pointer;
}
.route-switch input {
  appearance: none;
  width: 31px;
  height: 17px;
  margin: 0;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--soft);
  cursor: pointer;
  position: relative;
}
.route-switch input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--muted);
}
.route-switch input:checked { border-color: var(--other-ink); background: var(--other-ink); }
.route-switch input:checked::before { left: 16px; background: var(--bg); }
.route-summary { color: var(--muted); font-size: 13px; white-space: nowrap; margin-right: 5px; }
.route-switch:has(input:checked) + .route-summary { color: var(--other-ink); }
.view .node.k-comparison { transition: none; }
.view[data-route="lean"]:not(.ex) .node.k-comparison:not(.statement-bridge) {
  background: var(--other-wash);
  border-color: var(--other);
  border-left-width: 3px;
}
.view[data-route="paper"] .node.rt1 {
  border-color: var(--line2);
  border-left-width: 1px;
  background: var(--surface);
}
.view[data-route="paper"] .node .mk { display: none; }
.panel > .btn { margin: 0 0 8px; }

@media (max-width: 760px) {
  .overview { font-size: 13px; }
  .cap .tools { flex-wrap: wrap; gap: 3px 10px; }
  main .exp { width: auto; max-height: 56%; border-left: 0; border-top: 1px solid var(--ink); padding: 12px 14px; }
}

body[data-proof] { display: flex; }
body[data-proof] .bar { border-bottom-color: var(--line); }

.graph-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
