.examples { container-type: inline-size; }
.example-jumps { display:flex; flex-wrap:wrap; gap:.4em 1.2em; margin:1.1rem 0 2rem; }
.example-jumps a { font-size: .97rem; color: var(--blue); }
.examples .worked { padding:0; margin:0; }
.examples .worked + .worked { margin-top:2.5rem; border-top:1px solid var(--line); padding-top:1.4rem; }
.examples .worked h3 { margin:0 0 .8rem; }
.examples .io-example { margin:1.2rem 0 1.35rem; border-left:3px solid var(--blue); padding:.65rem .8rem; background:#f0f2fb; }
.io-example table { width:100%; border-spacing:.3rem; table-layout:fixed; text-align:center; }
.io-example th { font:600 .83rem/1.35 var(--sans); color:#3d4863; }
.io-example th[scope=row], .io-example th:first-child { text-align:left; }
.io-example th[scope=row] { width:4.95rem; }
.io-example td { background:var(--paper); border-radius:3px; padding:.3em .08em; font:500 1rem/1.35 var(--mono); }
.io-example thead td { background:transparent; color:#536077; font-size:.87rem; }
.io-example td.token-focus, .witness .sequence b { background:#283fc3; color:white; }
.examples .example-math { background:#eef1fc; border-radius:3px; margin:1rem 0; padding:.9rem 1rem; color:#24337d; font:400 clamp(1.08rem,2.7cqi,1.45rem)/1.5 var(--serif); overflow-wrap:anywhere; }
.example-math span { display:block; }
.example-math span + span { margin-top:.3rem; }
.example-math sub { font-size:.7em; }
.examples .example-plot { margin:1.1rem 0 1.4rem; padding:1rem; border:1px solid #d8dde3; border-radius:4px; background:#fff; }
.example-plot img { display:block; width:100%; max-width:580px; height:auto; margin:0 auto; }
.example-plot figcaption { margin:.7rem auto 0; font:400 .94rem/1.5 var(--sans); color:#46505c; }
.example-plot .plot-grid { display:grid; gap:.8rem; align-items:start; grid-template-columns:repeat(2,minmax(0,1fr)); }
.example-plot .plot-grid img { max-width:450px; }
@container (max-width:610px) {
  .example-plot .plot-grid { grid-template-columns:minmax(0,1fr); }
}
@container (max-width:410px) {
  .examples .example-plot { padding:.55rem .35rem .65rem; }
  .example-plot figcaption { padding:0 .35rem; }
  .examples .io-example { padding:.5rem .35rem; }
  .io-example th[scope=row], #ex-reversal thead th:first-child { width:4rem; }
  .io-example td { font-size:.9rem; }
  .example-math { padding:.75rem; }
}

.examples .worked h4 { font:600 1.05rem/1.4 var(--sans); margin:1.3rem 0 .2rem; }
.sequence-example figcaption { margin:0 0 .45rem; color:#43506a; font:500 .9rem/1.4 var(--sans); }
.rv-tables { display:grid; gap:.8rem; grid-template-columns:repeat(2,minmax(0,1fr)); }
.sequence-scroll table { border-spacing: .14rem; font-variant-numeric: tabular-nums; }
.sequence-scroll tr > :first-child { width: 4.2rem; }
.sequence-scroll th, .sequence-scroll td { padding: .25rem 0; text-align: center; }
.sequence-scroll td { font-size: .89rem; }
.rv-matrices { display: flex; align-items: start; gap: clamp(.65rem, 2.4cqi, 1.35rem); margin: .8rem 0; padding: .12rem .1rem .45rem; overflow-x: auto; }
.rv-matrices:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.rv-matrix { display: grid; justify-items: center; align-content: start; flex: none; gap: .36rem; }
.rv-matrix i { color:#263774; font:italic 1.1rem var(--serif); white-space:nowrap; }
.rv-matrix table { border-inline:2px solid #7887a2; border-radius:4px; border-spacing:.36rem .12rem; }
.rv-matrix td, .rv-readout td { text-align:right; font:400 .86rem/1.45 var(--mono); color:#293653; }
#ex-reversal .rv-caption, .rv-readout p { font:400 .94rem/1.48 var(--sans); color:#41506a; margin:.35rem 0 .7rem; }
.rv-readout { margin:.8rem 0; border-block:1px solid #d3dae4; padding:.5rem 0; }
.rv-readout summary { cursor:pointer; font:550 .94rem/1.45 var(--sans); color:#314a7e; }
.rv-readout .rv-tables table { width:100%; border-collapse:collapse; }
.rv-readout th { font:500 .83rem var(--sans); text-align:right; color:#46566c; }
.rv-readout .rv-tables th, .rv-readout .rv-tables td { border-bottom:1px solid #d8dfea; padding:.2rem .35rem; }
.rv-readout th:first-child { text-align:left; }
.rv-eq { background:#edf1fb; color:#243570; padding:.65rem 1rem; border-radius:4px; font:italic 1.14rem/1.6 var(--serif); }
.rv-eq sub, .rv-eq sup { font-size:.7em; line-height:0; }
.rv-name { font-style:normal; }
@container (max-width:650px) { .rv-tables { grid-template-columns:minmax(0,1fr); } }
@container (max-width:400px) { .rv-eq { font-size:1.05rem; padding:.6rem .7rem; } }

.rv-eq { margin: .65rem 0 .8rem; }
.poly-expansion > div + div { padding-inline-start: 1rem; }
@container (max-width: 545px) {
  .sequence-scroll table { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-rows: repeat(17, auto); gap: 2px; }
  #ex-histogram .sequence-scroll table { grid-template-rows: repeat(5, auto); }
  .sequence-scroll :is(thead, tbody, tr) { display: contents; }
  .sequence-scroll table tr > :first-child { width: auto; font-weight: 650; text-align: center; }
  .sequence-scroll th, .sequence-scroll td { align-content: center; padding: .12rem; line-height: 1.35; }
  .sequence-scroll th { font-size: .77rem; }
}

.sequence-scroll .row-var {
  display: block;
  font: italic .9rem/1.15 var(--serif);
  color: #465574;
}
.row-var sup { font-size: .7em; }
.examples .sequence-key {
  margin: .55rem 0 0;
  color: #43506a;
  font: 400 .88rem/1.45 var(--sans);
}
.wiring-map { margin: 1rem 0 1.2rem; }
.wiring-map figcaption {
  margin-bottom: .5rem;
  font: 600 .95rem/1.4 var(--sans);
  color: #34425a;
}
.wiring-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17.5rem), 1fr));
  gap: .65rem;
}
.wiring-head {
  min-width: 0;
  padding: .65rem .8rem .7rem;
  border: 1px solid #d6dce8;
  border-radius: 4px;
  background: white;
}
.wiring-head:only-child { max-width: 24rem; }
.wiring-head h5 {
  margin: 0 0 .25rem;
  font: 600 .9rem/1.3 var(--sans);
  color: #34425a;
}
.wiring-head svg { display: block; width: 100%; max-width: 21rem; height: auto; margin: auto; }
.wiring-head text { fill: #263449; font: 550 14px var(--sans); }
.wiring-head .wiring-basis { fill: #43516a; font: 400 13px var(--sans); }
.wiring-head .position { --wire: #316fa0; --tint: #e7f2fd; }
.wiring-head .content { --wire: #94601a; --tint: #fff2db; }
.wiring-head .rank { --wire: #694c9a; --tint: #f1eafa; }
.wiring-head .intermediate { --wire: #16735f; --tint: #e4f4ee; }
.wiring-source rect { fill: var(--tint); stroke: var(--wire); }
.wiring-line { stroke: var(--wire); stroke-width: 1.7; fill: none; }
.wiring-source circle, .wiring-port { fill: var(--wire); }
.wiring-unit { fill: #f6f7fa; stroke: #8b97ab; }

.wiring-head { position: relative; }
.wiring-source[tabindex] { cursor: help; }
.wiring-source[tabindex]:is(:hover, :focus-visible) rect { stroke-width: 2; }
.wiring-source[tabindex]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.lift-tooltip {
  position: absolute;
  z-index: 2;
  max-width: min(21rem, calc(100vw - 1rem));
  width: max-content;
  padding: .45rem .65rem;
  border-radius: 4px;
  background: #25324b;
  color: #fff;
  box-shadow: 0 2px 6px #17243d24;
  font: 400 .98rem/1.45 var(--serif);
}

.examples .mod-decoder picture { display: block; }
.examples .mod-decoder picture + picture { margin-top: 1.4rem; }
.examples .mod-decoder img { max-width: none; }
.examples .operand-plot img { max-width: 29rem; }

.hist-score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
}
.hist-score-grid img { width: 100%; height: auto; }
@container (max-width: 560px) {
  .hist-score-grid { grid-template-columns: minmax(0, 1fr); }
  .hist-score-grid img { max-width: 26rem; }
}
.hist-head-formulas h5 {
  font: inherit;
  font-weight: 700;
  margin: 1.2em 0 .35em;
}
.hist-head-formulas p { margin: .4em 0 1em; }
.hist-coefficient-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 1.1rem 0;
}
.hist-coefficient-scroll table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: .81rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.hist-coefficient-scroll :is(td, th) {
  padding: .22em .55em;
  white-space: nowrap;
}
.hist-coefficient-scroll tbody tr { border-top: 1px solid #d9deea; }
.hist-coefficient-scroll caption {
  padding: 0 .3em .4em;
  color: #24365d;
  font-weight: 650;
  text-align: left;
}
.hist-interpretation {
  margin: 1rem 0 1.5rem;
  border-block: 1px solid #cbd2df;
}
.hist-interpretation > summary {
  padding: .85rem .25rem;
  color: #30477a;
  cursor: pointer;
  font: 600 1rem/1.45 var(--sans);
}
.hist-interpretation > summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.hist-term { white-space: nowrap; }
.hist-scalar-score { font-size: 1.06rem; }
.hist-scalar-score > div + div { margin-top: .45rem; }
