/* Staged E4M3 rewrite: one vertical circuit layer per solution step. */

.reveal .e4m3-rewrite-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.44fr) minmax(0, 0.56fr);
  gap: 0.8em;
  align-items: center;
  width: 100%;
}

.reveal .e4m3-diagram-panel,
.reveal .e4m3-rewrite-copy {
  min-width: 0;
}

.reveal .e4m3-vertical-stack {
  display: grid;
  place-items: center;
  width: 100%;
  height: 19em;
  margin: 0 auto;
}

.reveal .e4m3-vertical-stack > p {
  display: contents;
}

.reveal .e4m3-vertical-stack img {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.reveal .e4m3-rewrite-copy > :first-child {
  margin-top: 0;
}

.reveal .e4m3-rewrite-copy > :last-child {
  margin-bottom: 0;
}

.reveal .e4m3-rewrite-copy p,
.reveal .e4m3-rewrite-copy li {
  font-size: 0.68em;
}

.reveal .e4m3-stage-cue {
  color: var(--stage-color, #263640);
  font-size: 0.76em;
  font-weight: 800;
  margin: 0 0 0.32em;
}

.reveal .e4m3-recap-panel {
  position: relative;
}

.reveal .e4m3-recap-caption {
  position: absolute;
  top: -1.45em;
  left: 0.1em;
  z-index: 2;
  color: #52616b;
  font-size: 0.48em;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.reveal .e4m3-stage-code {
  --stage-color: #be123c;
  --stage-tint: rgb(190 18 60 / 7%);
  margin-top: 0.45em;
  padding: 0.32em 0.36em 0.36em;
  border-left: 0.13em solid var(--stage-color);
  background: var(--stage-tint);
}

.reveal .e4m3-stage-code strong {
  color: var(--stage-color);
  font-size: 0.65em;
}

.reveal .e4m3-stage-code div.sourceCode {
  margin: 0.2em 0 0;
  height: auto !important;
  border-color: color-mix(in srgb, var(--stage-color) 45%, white);
  box-shadow: none;
}

.reveal .e4m3-function-recap div.sourceCode,
.reveal .e4m3-function-recap pre,
.reveal .e4m3-function-recap pre code,
.reveal .e4m3-stage-code pre,
.reveal .e4m3-stage-code pre code {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.reveal .e4m3-stage-code pre code {
  font-size: 0.68em;
  line-height: 1.2;
  padding: 0.52em 0.62em;
}

.reveal .stage-sign {
  --stage-color: #7c3aed;
  --stage-tint: rgb(124 58 237 / 7%);
}

.reveal .stage-significand {
  --stage-color: #0f766e;
  --stage-tint: rgb(15 118 110 / 7%);
}

.reveal .stage-normalize {
  --stage-color: #b7791f;
  --stage-tint: rgb(183 121 31 / 8%);
}

.reveal .stage-exponent {
  --stage-color: #2563eb;
  --stage-tint: rgb(37 99 235 / 7%);
}

.reveal .stage-pack {
  --stage-color: #be185d;
  --stage-tint: rgb(190 24 93 / 7%);
}

.reveal .e4m3-stage-math {
  color: var(--stage-color, #263640);
  font-size: 0.76em;
  text-align: center;
  margin: 0.3em 0 0.4em;
}

.reveal .e4m3-rewrite-copy .e4m3-stage-math p {
  font-size: 1em;
  margin: 0;
}

.reveal .e4m3-stage-math .math.display,
.reveal .e4m3-stage-math .MathJax_Display {
  margin: 0 !important;
}

.reveal .e4m3-stage-math.stage-normalize th,
.reveal .e4m3-stage-math.stage-normalize td {
  white-space: nowrap;
}

.reveal .e4m3-stage-math.stage-normalize table code {
  white-space: nowrap;
}

.reveal .e4m3-normal-table {
  font-size: 0.68em;
}

.reveal .e4m3-normal-table th,
.reveal .e4m3-normal-table td {
  padding: 0.34em 0.48em;
}
