/* Styles for the paper figures island (src/islands/figures/).
   Extracted from the old styles/base.css: only the rules the ten diagrams actually use.
   The old markup wrapped each diagram in .publication-figure / .publication-figure-<id>;
   the island uses <figure data-figure="<id>"> and the selectors were rewritten to match. */

/* <figure> carries a browser margin that the old <div> wrapper did not; the page decides
   the spacing around a diagram, so it is cleared here. */
figure[data-figure] {
  margin: 0;
}

/* ---------------------------------------------------------------------------
   figure container, loading and error states
   --------------------------------------------------------------------------- */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 0.78rem;
}

.loading-dots {
  display: flex;
  gap: 12px;
  color: var(--ink);
}

.loading-label {
  color: var(--muted);
}

.loading-dots span {
  width: 11px;
  height: 11px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.3;
  animation: works-dot-bounce 0.9s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.12s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.24s;
}

figure[data-figure].is-loading {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ---------------------------------------------------------------------------
   shared figure primitives (arrows, nodes, lines, labels)
   --------------------------------------------------------------------------- */

figure[data-figure] {
  min-height: clamp(230px, 42vw, 430px);
}

figure[data-figure] {
  --paper-ink: #1f2721;
  --paper-ink-strong: #24312a;
  --paper-ink-soft: rgba(31, 39, 33, 0.72);
  --paper-line: rgba(43, 52, 43, 0.22);
  --paper-line-strong: rgba(43, 52, 43, 0.42);
  --paper-surface: var(--paper);
  --paper-surface-soft: var(--bg);
  --paper-surface-tint: #fbf7ef;
  --paper-teal: #1f8a78;
  --paper-teal-rgb: 31, 138, 120;
  --paper-teal-deep: #176b5f;
  --paper-teal-soft: #e3f2ee;
  --paper-green: #4b8062;
  --paper-green-rgb: 75, 128, 98;
  --paper-green-soft: #e8f1e9;
  --paper-orange: #cf6a2f;
  --paper-orange-rgb: 207, 106, 47;
  --paper-orange-deep: #a4522c;
  --paper-orange-soft: #f5e3d4;
  --paper-blue: #3f7398;
  --paper-blue-rgb: 63, 115, 152;
  --paper-blue-deep: #315b78;
  --paper-blue-soft: #e5edf3;
  --paper-red: #bf4f43;
  --paper-red-rgb: 191, 79, 67;
  --paper-red-soft: #f4e1dc;
  --paper-purple: #7765a6;
  --paper-purple-rgb: 119, 101, 166;
  --paper-purple-soft: #ece8f3;
  --paper-gray: #747872;
  --paper-gray-rgb: 116, 120, 114;
  --paper-gray-soft: #e7e7e2;
  --paper-figure-bg: linear-gradient(180deg, var(--paper-surface) 0%, var(--paper-surface-tint) 56%, var(--paper-surface-soft) 100%);
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  border: 1px solid rgba(43, 52, 43, 0.14);
  border-radius: 8px;
  background: var(--paper-surface-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  color: var(--paper-ink);
  text-decoration: none;
}


/* ---------------------------------------------------------------------------
   quotient-toposes - height and period of a discrete dynamical system
   --------------------------------------------------------------------------- */

figure[data-figure="quotient-toposes"] {
  aspect-ratio: 19 / 10;
}


/* ---------------------------------------------------------------------------
   shared figure primitives (arrows, nodes, lines, labels)
   --------------------------------------------------------------------------- */

figure[data-figure] svg {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--paper-figure-bg);
}


/* ---------------------------------------------------------------------------
   TeX labels drawn over a figure
   --------------------------------------------------------------------------- */

.figure-tex-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.figure-tex-label {
  position: absolute;
  left: var(--figure-tex-x, 0);
  top: var(--figure-tex-y, 0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--paper-ink);
  line-height: 1;
  text-align: center;
  transform: translate(-50%, -50%);
  transform-origin: center;
  white-space: nowrap;
}


/* ---------------------------------------------------------------------------
   lawvere-first - image factorization of a power set expression
   --------------------------------------------------------------------------- */

.figure-tex-label-tensor-left {
  color: var(--tensor-map, var(--paper-teal, #1f8a78));
}

.figure-tex-label-tensor-right {
  color: var(--tensor-subset, var(--paper-orange, #cf6a2f));
}

.figure-tex-label-tensor-product {
  color: rgba(67, 72, 64, 0.82);
}


/* ---------------------------------------------------------------------------
   normalization - D4 on a square and its subgroup lattices
   --------------------------------------------------------------------------- */

.figure-tex-label-normalization-object {
  color: rgba(31, 39, 33, 0.86);
  font-weight: 650;
}

.figure-tex-label-normalization-morphism {
  color: rgba(31, 39, 33, 0.78);
  font-weight: 650;
}


/* ---------------------------------------------------------------------------
   internal-parameterizations - the local state classifier
   --------------------------------------------------------------------------- */

.figure-tex-label-internal-symbol {
  color: #1f2721;
  font-weight: 400;
}


/* ---------------------------------------------------------------------------
   shared figure primitives (arrows, nodes, lines, labels)
   --------------------------------------------------------------------------- */

figure[data-figure="games-integral-calculus"] {
  aspect-ratio: 760 / 410;
}


/* ---------------------------------------------------------------------------
   automata-cantor-morphism - Cantor space over the prefix poset
   --------------------------------------------------------------------------- */

figure[data-figure="automata-cantor-morphism"] {
  aspect-ratio: 16 / 9;
}


/* ---------------------------------------------------------------------------
   games-integral-calculus - the Rota-Baxter nim-sum table
   --------------------------------------------------------------------------- */

.games-rb-table-figure {
  --games-rb-cycle: 12s;
  --games-rb-green: var(--paper-green, #4b8062);
  --games-rb-green-rgb: var(--paper-green-rgb, 75, 128, 98);
  --games-rb-orange: var(--paper-orange, #cf6a2f);
  --games-rb-orange-rgb: var(--paper-orange-rgb, 207, 106, 47);
  --games-rb-blue: var(--paper-blue, #3f7398);
  --games-rb-blue-rgb: var(--paper-blue-rgb, 63, 115, 152);
  --games-rb-purple: var(--paper-purple, #7765a6);
  --games-rb-purple-rgb: var(--paper-purple-rgb, 119, 101, 166);
  --games-rb-red: var(--paper-red, #bf4f43);
  --games-rb-red-rgb: var(--paper-red-rgb, 191, 79, 67);
  --games-rb-ink: var(--paper-ink-strong, #24312a);
  color: var(--games-rb-ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.games-rb-table-figure marker path {
  fill: var(--games-rb-green);
}

.games-rb-table-figure #games-rb-mex-arrow-orange path {
  fill: var(--games-rb-orange);
}

.games-rb-table-figure #games-rb-mex-arrow-red path {
  fill: var(--games-rb-red);
}

.games-rb-table-figure #games-rb-arrow-blue path {
  fill: var(--games-rb-blue);
}

.games-rb-table-figure #games-rb-arrow-red path {
  fill: var(--games-rb-red);
}

.games-rb-cell-text {
  letter-spacing: 0;
}

.games-rb-table-bg {
  fill: rgba(255, 253, 248, 0.92);
  stroke: rgba(43, 52, 43, 0.18);
  stroke-width: 1.2;
}

.games-rb-table-head-row,
.games-rb-table-head-col {
  fill: transparent;
}

.games-rb-table-lines {
  fill: none;
  stroke: rgba(43, 52, 43, 0.22);
  stroke-linecap: square;
  stroke-width: 1;
}

.games-rb-table-lines.is-major {
  stroke: rgba(43, 52, 43, 0.34);
  stroke-width: 1.35;
}

.games-rb-table-lines.is-input-output {
  stroke: rgba(31, 39, 33, 0.68);
  stroke-width: 2.2;
}

.games-rb-cell-text {
  fill: var(--games-rb-ink);
  font-size: 13px;
  font-weight: 850;
}

.games-rb-cell-text.is-head {
  fill: rgba(36, 49, 42, 0.78);
  font-weight: 900;
}

.games-rb-cell-text.is-s-entry {
  fill: var(--games-rb-green);
}

.games-rb-cell-text.is-t-entry {
  fill: var(--games-rb-blue);
}

.games-rb-table-tex {
  color: #24312a;
  font-size: 0.58rem;
  line-height: 1;
}

.games-rb-dual-table {
  color: var(--games-rb-ink);
}

.games-rb-dual-table .games-rb-table-bg,
.games-rb-dual-table .games-rb-table-lines.is-major {
  stroke: none;
}

.games-rb-dual-table .games-rb-cell-text {
  font-size: 12.8px;
}

.games-rb-set-highlight {
  stroke: none;
}

.games-rb-set-highlight.is-s-entry {
  fill: #dfe8ff;
}

.games-rb-set-highlight.is-t-entry {
  fill: #f8dddd;
}

.games-rb-hit-target {
  cursor: pointer;
  fill: transparent;
  pointer-events: all;
  stroke: transparent;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.games-rb-hit-target:hover,
.games-rb-hit-target:focus-visible,
.games-rb-hit-target.is-keyboard-active {
  stroke: rgba(31, 39, 33, 0.34);
}

.games-rb-hit-target.is-s-target:hover,
.games-rb-hit-target.is-s-target:focus-visible,
.games-rb-hit-target.is-s-target.is-keyboard-active {
  stroke: rgba(var(--games-rb-blue-rgb, 63, 115, 152), 0.56);
}

.games-rb-hit-target.is-t-target:hover,
.games-rb-hit-target.is-t-target:focus-visible,
.games-rb-hit-target.is-t-target.is-keyboard-active {
  stroke: rgba(var(--games-rb-red-rgb, 191, 79, 67), 0.54);
}

.games-rb-mobile-controls {
  display: none;
}


/* ---------------------------------------------------------------------------
   responsive overrides
   --------------------------------------------------------------------------- */

@media (max-width: 520px) {
  .games-rb-mobile-controls {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(43, 52, 43, 0.14);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.82);
  }

  .games-rb-mobile-set {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .games-rb-mobile-set legend {
    margin-bottom: 6px;
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.78rem;
    font-weight: 900;
  }

  .games-rb-mobile-choice-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    gap: 6px;
  }

  .games-rb-mobile-toggle {
    display: inline-grid;
    min-width: 44px;
    min-height: 44px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(43, 52, 43, 0.24);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    font: 850 0.82rem/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    touch-action: manipulation;
  }

  .games-rb-mobile-toggle:focus-visible {
    outline: 2px solid rgba(44, 111, 99, 0.58);
    outline-offset: 2px;
  }
}


/* ---------------------------------------------------------------------------
   games-integral-calculus - the Rota-Baxter nim-sum table
   --------------------------------------------------------------------------- */

.games-rb-limit-toast {
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(var(--games-rb-purple-rgb, 119, 101, 166), 0.32);
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(31, 39, 33, 0.14);
  color: var(--games-rb-purple);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  font-weight: 850;
  left: 50%;
  line-height: 1;
  opacity: 0;
  padding: 0.42rem 0.62rem;
  pointer-events: none;
  position: absolute;
  top: 8.6%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  z-index: 4;
}

.games-rb-limit-toast.is-visible {
  opacity: 1;
}

.games-rb-set-axis-label {
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(255, 253, 248, 0.95);
  stroke-linejoin: round;
  stroke-width: 4px;
}

.games-rb-set-axis-label.is-s-label {
  fill: var(--games-rb-blue);
}

.games-rb-set-axis-label.is-t-label {
  fill: var(--games-rb-red);
}

.games-rb-mex-cell-ring {
  opacity: 0;
  animation: games-rb-mex-entry var(--games-rb-cycle) steps(1, end) infinite;
}

.games-rb-mex-cell-ring {
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.games-rb-mex-cell-ring.is-mex-s-ring {
  fill: none;
  stroke: rgba(var(--games-rb-blue-rgb, 63, 115, 152), 0.54);
}

.games-rb-mex-cell-ring.is-mex-t-ring {
  fill: none;
  stroke: rgba(var(--games-rb-red-rgb, 191, 79, 67), 0.5);
}

.games-rb-mex-axis-tex {
  color: var(--games-rb-ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11.2px;
  font-weight: 950;
  line-height: 1;
  overflow: visible;
  pointer-events: none;
}

.games-rb-mex-axis-tex > div {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  white-space: nowrap;
}

.games-rb-union-highlight {
  stroke: none;
}

.games-rb-union-highlight.is-mex-s-plus-t {
  fill: #f8dddd;
}

.games-rb-union-highlight.is-s-plus-mex-t {
  fill: #dfe8ff;
}

.games-rb-union-highlight.is-both-union-terms {
  fill: url("#games-rb-union-both");
}

.games-rb-product-highlight {
  fill: none;
  stroke: rgba(var(--games-rb-purple-rgb, 119, 101, 166), 0.58);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.games-rb-product-arrow {
  display: none;
  fill: none;
  stroke-linecap: round;
  stroke-width: 2.1;
  vector-effect: non-scaling-stroke;
}

.games-rb-product-arrow.is-from-mex-s {
  marker-end: url("#games-rb-arrow-blue");
  stroke: rgba(var(--games-rb-blue-rgb, 63, 115, 152), 0.66);
}

.games-rb-product-arrow.is-from-mex-t {
  marker-end: url("#games-rb-arrow-red");
  stroke: rgba(var(--games-rb-red-rgb, 191, 79, 67), 0.62);
}

.games-rb-dual-figure[data-games-rb-interactive] .games-rb-mex-cell-ring {
  animation: none;
  opacity: 1;
}

.games-rb-expanded-mex-readout {
  align-items: center;
  display: inline-flex;
  left: 31%;
  top: 91.2%;
  width: 42%;
  color: #24312a;
  font-size: 1.04rem;
  font-weight: 950;
  line-height: 1;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.games-rb-expanded-mex-readout .games-rb-highlighted-term {
  align-items: center;
  display: inline-flex;
  line-height: 1;
}

.games-rb-highlighted-term {
  border-radius: 4px;
  background: rgba(var(--games-rb-purple-rgb, 119, 101, 166), 0.18);
  padding: 0.08em 0.12em;
}

.games-rb-highlighted-term.is-left {
  background: #f8dddd;
}

.games-rb-highlighted-term.is-right {
  background: #dfe8ff;
}

.games-rb-bottom-result {
  left: 61%;
  top: 91.2%;
  width: 7%;
  color: #24312a;
  font-size: 1.12rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.games-rb-expanded-mex-rhs {
  left: 83%;
  top: 91.2%;
  width: 31%;
  color: #24312a;
  font-size: 1.04rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.games-rb-integral-left,
.games-rb-integral-right {
  color: #24312a;
  font-size: 1.24rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.games-rb-integral-left {
  left: 31%;
  top: 17.2%;
  width: 34%;
}

.games-rb-integral-right {
  left: 76.8%;
  top: 17.2%;
  width: 34%;
}


/* ---------------------------------------------------------------------------
   responsive overrides
   --------------------------------------------------------------------------- */

@media (max-width: 520px) {
  .games-rb-expanded-mex-readout,
  .games-rb-bottom-result,
  .games-rb-expanded-mex-rhs,
  .games-rb-integral-left,
  .games-rb-integral-right {
    font-size: 0.82rem;
  }
}

@media (max-width: 430px) {
  .games-rb-expanded-mex-readout,
  .games-rb-bottom-result,
  .games-rb-expanded-mex-rhs,
  .games-rb-integral-left,
  .games-rb-integral-right {
    font-size: 0.62rem;
  }
}

@media (max-width: 520px) {
  .games-rb-integral-left,
  .games-rb-integral-right {
    display: none;
  }

  .games-rb-expanded-mex-readout {
    left: 29%;
    width: 42%;
  }

  .games-rb-bottom-result {
    left: 56%;
  }

  .games-rb-expanded-mex-rhs {
    left: 80.4%;
    width: 30%;
  }
}


/* ---------------------------------------------------------------------------
   games-coalgebras - Grundy numbers of an impartial game
   --------------------------------------------------------------------------- */

.grundy-figure {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper-figure-bg, linear-gradient(180deg, var(--paper) 0%, var(--bg) 100%));
  color: var(--paper-ink, var(--ink));
}

figure[data-figure] .grundy-figure {
  pointer-events: none;
}

.grundy-title,
.grundy-node text {
  fill: var(--paper-ink-strong, #25342d);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.grundy-title {
  font-size: 22px;
  font-weight: 850;
}

.grundy-game-frame {
  fill: rgba(255, 253, 248, 0.62);
  stroke: var(--paper-line, rgba(43, 52, 43, 0.12));
  stroke-width: 1.5;
}

.grundy-edge {
  fill: none;
  color: var(--paper-ink, #1f2721);
  stroke: var(--paper-line, rgba(31, 39, 33, 0.26));
  stroke-linecap: round;
  stroke-width: 1.45;
  opacity: 0.24;
  transition: opacity 220ms ease, stroke 220ms ease, stroke-width 220ms ease;
}

.grundy-edge.is-computed {
  stroke: rgba(31, 39, 33, 0.34);
  opacity: 0.36;
}

.grundy-edge.is-active {
  stroke: var(--paper-ink, #1f2721);
  stroke-width: 3.2;
  opacity: 1;
}

.grundy-figure svg marker path {
  fill: var(--paper-ink, #1f2721);
}

.grundy-node {
  cursor: pointer;
}

figure[data-figure] .grundy-node {
  cursor: zoom-in;
}

.grundy-node-shell {
  fill: var(--paper-surface, var(--paper));
  stroke: var(--paper-line-strong, rgba(43, 52, 43, 0.42));
  stroke-width: 2;
  transition: fill 220ms ease, stroke 220ms ease, stroke-width 220ms ease, transform 220ms ease;
}

.grundy-node.is-known .grundy-node-shell {
  fill: var(--paper-green-soft, #edf5f1);
  stroke: rgba(var(--paper-green-rgb, 75, 128, 98), 0.66);
}

.grundy-node.is-active .grundy-node-shell {
  fill: var(--paper-orange-soft, #fff0df);
  stroke: var(--paper-orange, #cf6a2f);
  stroke-width: 3;
}

.grundy-node.is-active {
  filter: drop-shadow(0 10px 14px rgba(166, 91, 44, 0.16));
}

.grundy-node.is-p-state .grundy-node-shell {
  fill: var(--paper-blue-soft, #e5edf3);
  stroke: var(--paper-blue, #3f7398);
}

.grundy-node.is-n-state .grundy-node-shell {
  fill: var(--paper-red-soft, #f4e1dc);
  stroke: var(--paper-red, #bf4f43);
}

.grundy-node.is-active.is-p-state .grundy-node-shell,
.grundy-node.is-active.is-n-state .grundy-node-shell {
  stroke-width: 3.2;
}

.grundy-node.is-active.is-p-state {
  filter: drop-shadow(0 10px 14px rgba(49, 92, 168, 0.16));
}

.grundy-node.is-active.is-n-state {
  filter: drop-shadow(0 10px 14px rgba(182, 74, 61, 0.16));
}

.grundy-node.is-referenced {
  filter: drop-shadow(0 8px 13px rgba(31, 39, 33, 0.18));
}

.grundy-node.is-referenced .grundy-node-shell {
  stroke: #1f2721;
  stroke-width: 3;
}

.grundy-node text {
  pointer-events: none;
  text-anchor: middle;
}

.grundy-value-label {
  font-size: 17px;
  font-weight: 900;
}

.grundy-node.is-active .grundy-value-label {
  font-weight: 900;
}

.grundy-node.is-p-state .grundy-value-label {
  fill: var(--paper-blue-deep, #315b78);
}

.grundy-node.is-n-state .grundy-value-label {
  fill: var(--paper-red, #bf4f43);
}

.grundy-node.is-receiving .grundy-node-shell {
  transform-box: fill-box;
  transform-origin: center;
  animation: grundy-node-receive 520ms cubic-bezier(0.16, 0.84, 0.22, 1) both;
}

.grundy-node.is-receiving .grundy-value-label {
  transform-box: fill-box;
  transform-origin: center;
  animation: grundy-value-receive 520ms cubic-bezier(0.16, 0.84, 0.22, 1) both;
}

.grundy-transfer-ball {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  display: grid;
  width: var(--grundy-transfer-size, 36px);
  height: var(--grundy-transfer-size, 36px);
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: calc(var(--grundy-transfer-size, 36px) * 0.48);
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(var(--from-x), var(--from-y)) translate(-50%, -50%) scale(0.84);
  will-change: transform, opacity;
}

.grundy-transfer-ball.is-css-flight {
  animation: grundy-transfer-flight 560ms cubic-bezier(0.2, 0.78, 0.18, 1) both;
}

.grundy-algebra-panel {
  --grundy-panel-pad-x: 20px;
  --grundy-panel-pad-y: 18px;
  position: absolute;
  top: 78px;
  right: clamp(72px, 16%, 170px);
  bottom: 34px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(24%, 190px);
  padding: 18px 20px;
  border: 1px solid rgba(43, 52, 43, 0.13);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.84);
  box-shadow: 0 10px 28px rgba(43, 52, 43, 0.08);
  overflow: hidden;
}

.grundy-natural-line {
  --grundy-axis-pad: 32px;
  --grundy-mex-water-height: 0px;
  --grundy-valve-width: 260px;
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  align-self: stretch;
  width: calc(100% + (var(--grundy-panel-pad-x) * 2));
  min-height: 100%;
  margin-inline: calc(var(--grundy-panel-pad-x) * -1);
  padding: 8px 0;
}

.grundy-natural-line::before {
  position: absolute;
  top: 28px;
  bottom: 28px;
  left: 50%;
  z-index: 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(
  to top,
  rgba(43, 52, 43, 0.16),
  rgba(43, 52, 43, 0.08)
  );
  content: "";
  transform: translateX(-50%);
}

.grundy-natural-number {
  position: relative;
  z-index: 2;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #171b18;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.22rem;
  font-weight: 900;
  transition: color 220ms ease, opacity 220ms ease, transform 220ms ease;
}

.grundy-natural-core {
  position: relative;
  z-index: 2;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 2px solid #171b18;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--paper), #f4f3ee);
  box-shadow:
  0 0 0 3px rgba(20, 25, 22, 0.12),
  0 7px 13px rgba(20, 25, 22, 0.12);
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.grundy-natural-number::after {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: var(--grundy-valve-width);
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(12, 15, 13, 0.96), rgba(34, 40, 36, 0.92), rgba(12, 15, 13, 0.96));
  box-shadow: 0 2px 9px rgba(20, 25, 22, 0.28);
  content: "";
  opacity: 0.94;
  transform: translate(-50%, -50%);
}

.grundy-natural-number.is-excluded {
  color: rgba(37, 52, 45, 0.42);
}

.grundy-natural-number.is-excluded .grundy-natural-core {
  border-color: rgba(var(--paper-teal-rgb, 31, 138, 120), 0.22);
  background: var(--paper-teal-soft, #e3f2ee);
  box-shadow: none;
}

.grundy-natural-number.is-excluded::after {
  position: absolute;
  top: 50%;
  bottom: auto;
  left: 9px;
  right: 9px;
  z-index: 3;
  width: auto;
  height: 3px;
  border-radius: 999px;
  background: var(--paper-orange, #cf6a2f);
  box-shadow: none;
  content: "";
  opacity: 1;
  transform: translateY(-50%) rotate(-18deg);
  transform-origin: center;
  animation: grundy-cross-number 260ms ease both;
}

.grundy-natural-number.is-mex {
  z-index: 3;
  color: var(--paper-red, #bf4f43);
  transform: scale(1.12);
  animation: grundy-mex-pop 300ms ease both;
}

.grundy-natural-number.is-mex .grundy-natural-core {
  border-color: var(--paper-red, #bf4f43);
  background: var(--paper-red-soft, #f4e1dc);
  box-shadow:
  0 7px 0 rgba(var(--paper-red-rgb, 191, 79, 67), 0.2),
  0 11px 20px rgba(var(--paper-red-rgb, 191, 79, 67), 0.14);
}

.grundy-natural-number.is-mex::before {
  position: absolute;
  z-index: 1;
  inset: -8px;
  border: 2px solid rgba(var(--paper-red-rgb, 191, 79, 67), 0.26);
  border-radius: 999px;
  content: "";
  animation: grundy-mex-ring 760ms ease-out both;
}

.grundy-natural-number.is-mex::after {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: var(--grundy-valve-width);
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--paper-red, #bf4f43), rgba(var(--paper-red-rgb, 191, 79, 67), 0.88), var(--paper-red, #bf4f43));
  box-shadow: 0 2px 10px rgba(var(--paper-red-rgb, 191, 79, 67), 0.24);
  content: "";
  opacity: 1;
  transform: translate(-50%, -50%);
}

.grundy-natural-number.is-mex[data-grundy-natural="0"] {
  color: var(--paper-blue-deep, #315b78);
}

.grundy-natural-number.is-mex[data-grundy-natural="0"] .grundy-natural-core {
  border-color: var(--paper-blue, #3f7398);
  background: var(--paper-blue-soft, #e5edf3);
  box-shadow:
  0 7px 0 rgba(var(--paper-blue-rgb, 63, 115, 152), 0.18),
  0 11px 20px rgba(var(--paper-blue-rgb, 63, 115, 152), 0.13);
}

.grundy-natural-number.is-mex[data-grundy-natural="0"]::before {
  border-color: rgba(var(--paper-blue-rgb, 63, 115, 152), 0.26);
}

.grundy-natural-number.is-mex[data-grundy-natural="0"]::after {
  background: linear-gradient(90deg, var(--paper-blue-deep, #315b78), rgba(var(--paper-blue-rgb, 63, 115, 152), 0.88), var(--paper-blue-deep, #315b78));
  box-shadow: 0 2px 10px rgba(var(--paper-blue-rgb, 63, 115, 152), 0.22);
}

.grundy-natural-number.is-after-mex {
  opacity: 1;
}

.grundy-mex-water {
  position: absolute;
  right: 0;
  bottom: calc(var(--grundy-panel-pad-y) * -1);
  left: 0;
  z-index: 1;
  width: auto;
  height: calc(var(--grundy-mex-water-height) + var(--grundy-panel-pad-y));
  opacity: 0;
  overflow: visible;
  border-radius: 0 0 8px 8px;
  background:
  linear-gradient(180deg, rgba(var(--paper-blue-rgb, 63, 115, 152), 0.22), rgba(var(--paper-teal-rgb, 31, 138, 120), 0.28)),
  repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0 8px, rgba(255, 255, 255, 0) 8px 18px);
  box-shadow: 0 -10px 26px rgba(var(--paper-blue-rgb, 63, 115, 152), 0.18);
  transform: none;
  transition:
  height 780ms cubic-bezier(0.18, 0.8, 0.14, 1),
  opacity 180ms ease;
  pointer-events: none;
}

.grundy-mex-water::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 38% 62%, rgba(var(--paper-teal-rgb, 31, 138, 120), 0.1));
  content: "";
}

.grundy-mex-water::after {
  position: absolute;
  top: -3px;
  right: 0;
  left: 0;
  height: 6px;
  border-radius: 1px;
  background: linear-gradient(90deg, rgba(var(--paper-blue-rgb, 63, 115, 152), 0.48), rgba(255, 253, 248, 0.78), rgba(var(--paper-teal-rgb, 31, 138, 120), 0.48));
  box-shadow: 0 1px 8px rgba(var(--paper-blue-rgb, 63, 115, 152), 0.18);
  content: "";
}

.grundy-mex-water.is-ready {
  opacity: 0.88;
}

.grundy-panel {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 0.55fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 0.6fr);
  gap: 6px 12px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid rgba(43, 52, 43, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 10px 28px rgba(43, 52, 43, 0.1);
  color: #25342d;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.74rem;
  line-height: 1.25;
}

.grundy-panel-label {
  color: var(--accent-2);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.grundy-panel strong {
  font-weight: 900;
}

figure[data-figure] .grundy-panel {
  display: none;
}

figure[data-figure] .grundy-algebra-panel {
  --grundy-panel-pad-x: 12px;
  --grundy-panel-pad-y: 10px;
  top: 64px;
  right: clamp(96px, 18%, 230px);
  bottom: 46px;
  width: 128px;
  padding: 10px 12px;
}

figure[data-figure] .grundy-natural-line {
  --grundy-axis-pad: 26px;
  --grundy-valve-width: 172px;
  gap: 10px;
  min-height: 100%;
}

figure[data-figure] .grundy-natural-line::before {
  top: 20px;
  bottom: 20px;
}

figure[data-figure] .grundy-natural-number {
  width: 36px;
  height: 36px;
  font-size: 0.96rem;
}

figure[data-figure] .grundy-natural-number::after {
  height: 3px;
}

figure[data-figure] .grundy-natural-number.is-excluded::after {
  top: 50%;
  bottom: auto;
  left: 7px;
  right: 7px;
  height: 2px;
}

figure[data-figure] .grundy-natural-number.is-mex::after {
  height: 5px;
}


/* ---------------------------------------------------------------------------
   responsive overrides
   --------------------------------------------------------------------------- */

@media (max-width: 640px) {
  figure[data-figure="games-coalgebras"] .grundy-title {
    font-size: 28px;
  }

  figure[data-figure="games-coalgebras"] .grundy-value-label {
    font-size: 19px;
  }

  figure[data-figure="games-coalgebras"] .grundy-algebra-panel {
    --grundy-panel-pad-x: clamp(4px, 1.8vw, 8px);
    --grundy-panel-pad-y: clamp(4px, 1.8vw, 8px);
    top: 13.8%;
    right: clamp(18px, 6.5%, 46px);
    bottom: 9.8%;
    width: clamp(64px, 24%, 120px);
    padding: var(--grundy-panel-pad-y) var(--grundy-panel-pad-x);
    border-radius: 6px;
  }

  figure[data-figure="games-coalgebras"] .grundy-natural-line {
    --grundy-axis-pad: clamp(12px, 5vw, 20px);
    --grundy-valve-width: calc(clamp(64px, 24vw, 120px) + (var(--grundy-panel-pad-x) * 2));
    gap: clamp(1px, 0.8vw, 5px);
    padding: clamp(3px, 1vw, 6px) 0;
  }

  figure[data-figure="games-coalgebras"] .grundy-natural-line::before {
    top: clamp(10px, 3.4vw, 18px);
    bottom: clamp(10px, 3.4vw, 18px);
    width: 2px;
  }

  figure[data-figure="games-coalgebras"] .grundy-natural-number {
    width: clamp(20px, 6.5vw, 30px);
    height: clamp(20px, 6.5vw, 30px);
    font-size: 0.78rem;
  }

  figure[data-figure="games-coalgebras"] .grundy-natural-core {
    border-width: 1.5px;
    box-shadow:
    0 0 0 2px rgba(20, 25, 22, 0.1),
    0 5px 9px rgba(20, 25, 22, 0.1);
  }

  figure[data-figure="games-coalgebras"] .grundy-natural-number::after {
    height: 2px;
  }

  figure[data-figure="games-coalgebras"] .grundy-natural-number.is-excluded::after {
    left: 5px;
    right: 5px;
    height: 2px;
  }

  figure[data-figure="games-coalgebras"] .grundy-natural-number.is-mex {
    transform: scale(1.07);
  }

  figure[data-figure="games-coalgebras"] .grundy-natural-number.is-mex::before {
    inset: -4px;
    border-width: 1.5px;
  }

  figure[data-figure="games-coalgebras"] .grundy-natural-number.is-mex::after {
    height: 4px;
  }

  figure[data-figure="games-coalgebras"] .grundy-transfer-ball {
    --grundy-transfer-size: clamp(20px, 6.6vw, 28px) !important;
    border-width: 1.5px;
  }
}


/* ---------------------------------------------------------------------------
   lawvere-fourth - skeletality and coskeletality
   --------------------------------------------------------------------------- */

.lawvere-pullback-figure {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--paper-figure-bg, linear-gradient(180deg, var(--paper) 0%, var(--bg) 100%));
  color: var(--paper-ink, var(--ink));
}

figure[data-figure] .lawvere-pullback-figure {
  pointer-events: none;
}

.lawvere-pullback-figure svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lawvere-panel-divider {
  fill: none;
  stroke: var(--paper-line, rgba(43, 52, 43, 0.12));
  stroke-linecap: round;
  stroke-width: 1.5;
}

.lawvere-panel-label {
  fill: var(--paper-ink-soft, rgba(37, 52, 45, 0.72));
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lawvere-graph-frame {
  fill: rgba(255, 253, 248, 0.72);
  stroke: var(--paper-line, rgba(43, 52, 43, 0.28));
  stroke-width: 2.2;
}

.lawvere-graph-frame.small {
  stroke: rgba(var(--paper-teal-rgb, 31, 138, 120), 0.28);
}

.lawvere-alpha-arrow {
  stroke: var(--paper-teal, #1f8a78);
  stroke-width: 2.8;
}

.lawvere-y-edge,
.lawvere-x-edge {
  fill: none;
  stroke-linecap: round;
  stroke-width: 2.6;
  transition: opacity 260ms ease, stroke-width 260ms ease, filter 260ms ease;
}

.lawvere-x-edge {
  opacity: 0.9;
}

.lawvere-y-edge {
  opacity: 0.95;
}

.lawvere-pullback-figure.is-animated .lawvere-x-edge,
.lawvere-pullback-figure.is-animated .lawvere-y-edge {
  opacity: 0.13;
}

.lawvere-pullback-figure.is-animated .lawvere-x-edge.is-complete,
.lawvere-pullback-figure.is-animated .lawvere-y-edge.is-complete {
  opacity: 0.5;
}

.lawvere-pullback-figure.is-animated .lawvere-x-edge.is-active,
.lawvere-pullback-figure.is-animated .lawvere-y-edge.is-active {
  opacity: 1;
  stroke-width: 4.2;
  filter: drop-shadow(0 0 9px rgba(43, 52, 43, 0.2));
}

.lawvere-pullback-figure.is-complete .lawvere-x-edge,
.lawvere-pullback-figure.is-complete .lawvere-y-edge {
  opacity: 0.92;
}

.lawvere-y-edge,
.lawvere-x-edge {
  stroke: var(--paper-ink, #2b342b);
}

.lawvere-x-vertices circle,
.lawvere-y-vertices circle {
  stroke: var(--paper-surface, var(--paper));
  stroke-width: 2.3;
}

.lawvere-coskel-frame,
.lawvere-coskel-core-frame {
  fill: rgba(255, 253, 248, 0.62);
  stroke: var(--paper-line, rgba(43, 52, 43, 0.2));
  stroke-width: 1.4;
}

.lawvere-coskel-core-frame {
  fill: rgba(255, 253, 248, 0.74);
  stroke: rgba(var(--paper-teal-rgb, 31, 138, 120), 0.24);
  stroke-width: 2;
  transition: opacity 260ms ease;
}

.lawvere-coskel-edge {
  fill: none;
  stroke: var(--paper-ink, #2b342b);
  stroke-linecap: round;
  stroke-width: 2.1;
  transition: opacity 260ms ease, stroke-width 260ms ease, filter 260ms ease;
}

.lawvere-coskel-edge.boundary {
  stroke: rgba(43, 52, 43, 0.56);
  stroke-width: 1.2;
}

.lawvere-coskel-edge.core {
  stroke: var(--paper-ink, #2b342b);
}

.lawvere-coskel-vertex {
  stroke: var(--paper-surface, var(--paper));
  stroke-width: 1.8;
  transition: opacity 260ms ease, filter 260ms ease;
}

.lawvere-coskel-boundary .lawvere-coskel-vertex {
  stroke-width: 1;
}

.lawvere-coskel-deleted path {
  fill: none;
  stroke: var(--paper-blue, #3f7398);
  stroke-linecap: round;
  stroke-width: 2.3;
}

.lawvere-coskel-boundary {
  transition: opacity 420ms ease, filter 420ms ease, transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-box: view-box;
}

.lawvere-pullback-figure.is-animated .lawvere-coskel-boundary,
.lawvere-pullback-figure.is-animated .lawvere-coskel-edge[data-coskel-core-edge],
.lawvere-pullback-figure.is-animated .lawvere-coskel-vertex[data-coskel-vertex] {
  opacity: 0.16;
}

.lawvere-pullback-figure.is-coskel-building .lawvere-coskel-core-frame {
  opacity: 0.42;
}

.lawvere-pullback-figure.is-animated .lawvere-coskel-boundary.is-active {
  opacity: 0.92;
  filter: drop-shadow(0 0 14px rgba(47, 114, 189, 0.32));
  transform: translate(0, 0) scale(1);
}

.lawvere-pullback-figure.is-animated .lawvere-coskel-boundary.is-glued {
  opacity: 0;
  transform: translate(0, 0) scale(1);
}

.lawvere-pullback-figure.is-animated .lawvere-coskel-edge[data-coskel-core-edge].is-gluing {
  opacity: 0.9;
  stroke-width: 2.9;
  filter: drop-shadow(0 0 7px rgba(43, 52, 43, 0.2));
}

.lawvere-pullback-figure.is-animated .lawvere-coskel-vertex[data-coskel-vertex].is-gluing {
  opacity: 1;
}

.lawvere-pullback-figure.is-complete .lawvere-coskel-boundary {
  opacity: 0.62;
}

.lawvere-pullback-figure.is-complete .lawvere-coskel-edge[data-coskel-core-edge],
.lawvere-pullback-figure.is-complete .lawvere-coskel-vertex[data-coskel-vertex] {
  opacity: 0.94;
}


/* ---------------------------------------------------------------------------
   games-coalgebras - Grundy numbers of an impartial game
   --------------------------------------------------------------------------- */

.grundy-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  max-width: min(440px, calc(100% - 28px));
  padding: 8px;
  border: 1px solid rgba(43, 52, 43, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 10px 28px rgba(43, 52, 43, 0.1);
}

.grundy-control {
  appearance: none;
  border: 1px solid rgba(44, 111, 99, 0.28);
  border-radius: 6px;
  background: var(--paper);
  color: var(--accent-2);
  cursor: pointer;
  font: 850 0.72rem/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 7px 9px;
}

.grundy-control:hover,
.grundy-control:focus-visible {
  border-color: rgba(44, 111, 99, 0.52);
  background: #edf5f1;
}

.grundy-slider {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font: 800 0.72rem/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.grundy-slider input {
  width: 112px;
  accent-color: var(--accent);
}


/* ---------------------------------------------------------------------------
   shared figure primitives (arrows, nodes, lines, labels)
   --------------------------------------------------------------------------- */

figure[data-figure]:hover,
figure[data-figure]:focus-within {
  border-color: rgba(44, 111, 99, 0.4);
}

.figure-math {
  position: absolute;
  z-index: 2;
  color: var(--paper-ink, #1f2721);
  line-height: 1;
  pointer-events: auto;
  text-align: center;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.figure-math.large {
  font-size: 1.12rem;
}

.figure-math.small {
  font-size: 0.88rem;
}

.figure-math.tiny {
  font-size: 0.72rem;
}

.figure-node {
  fill: var(--paper-surface, var(--paper));
  stroke: var(--paper-ink, #1f2721);
  stroke-width: 2.4;
}

.figure-node.soft {
  fill: var(--paper-green-soft, #e8f0ea);
  stroke: var(--paper-green, #4b8062);
}

.figure-node.pale {
  fill: var(--paper-blue-soft, #e5edf3);
  stroke: var(--paper-blue, #3f7398);
}

.figure-node.warm {
  fill: var(--paper-orange-soft, #f4e6d7);
  stroke: var(--paper-orange-deep, #a4522c);
}

.figure-line {
  fill: none;
  stroke: var(--paper-ink, #1f2721);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.figure-line.dashed,
.figure-arrow.dashed {
  stroke-dasharray: 8 9;
}

.figure-arrow {
  fill: none;
  stroke: var(--paper-ink, #1f2721);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

figure[data-figure] svg marker path {
  fill: var(--paper-ink, #1f2721);
}


/* ---------------------------------------------------------------------------
   internal-parameterizations - the local state classifier
   --------------------------------------------------------------------------- */

.internal-parameterization-figure marker path {
  fill: var(--paper-ink, #1f2721);
}

.internal-parameterization-figure .internal-marker-n path {
  fill: var(--paper-teal, #1f8a78);
}

.internal-parameterization-figure .internal-marker-l path {
  fill: var(--paper-orange, #cf6a2f);
}


/* ---------------------------------------------------------------------------
   normalization - D4 on a square and its subgroup lattices
   --------------------------------------------------------------------------- */

.normalization-figure marker path {
  fill: var(--paper-teal, #1f8a78);
}


/* ---------------------------------------------------------------------------
   completely-connected - rooted trees and rooted forests
   --------------------------------------------------------------------------- */

figure[data-figure] svg marker.connected-marker-a path,
.connected-marker-a path {
  fill: var(--paper-teal, #1f8a78);
}

figure[data-figure] svg marker.connected-marker-b path,
.connected-marker-b path {
  fill: var(--paper-blue, #3f7398);
}

figure[data-figure] svg marker.connected-marker-c path,
.connected-marker-c path {
  fill: var(--paper-orange-deep, #a4522c);
}


/* ---------------------------------------------------------------------------
   shared figure primitives (arrows, nodes, lines, labels)
   --------------------------------------------------------------------------- */

.figure-small {
  fill: var(--paper-ink, #1f2721);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-anchor: middle;
}

.figure-small {
  font-size: 16px;
  font-weight: 650;
}


/* ---------------------------------------------------------------------------
   automata-cantor-morphism - Cantor space over the prefix poset
   --------------------------------------------------------------------------- */

figure[data-figure="topoi-automata"],
.automata-cantor-figure,
.automata-cover-figure {
  --cantor-cover-cycle: 12s;
  --cantor-ink: var(--paper-ink, #1f2721);
  --cantor-muted: var(--paper-gray, #747872);
  --cantor-muted-rgb: var(--paper-gray-rgb, 116, 120, 114);
  --cantor-green: var(--paper-teal-deep, #176b5f);
  --cantor-green-rgb: var(--paper-teal-rgb, 31, 138, 120);
  --cantor-red: var(--paper-red, #bf4f43);
  --cantor-red-rgb: var(--paper-red-rgb, 191, 79, 67);
  --cantor-blue: var(--paper-blue, #3f7398);
  --cantor-blue-rgb: var(--paper-blue-rgb, 63, 115, 152);
  --cantor-purple: var(--paper-purple, #7765a6);
  --cantor-purple-rgb: var(--paper-purple-rgb, 119, 101, 166);
  --cantor-orange: var(--paper-orange-deep, #a4522c);
  --cantor-orange-rgb: var(--paper-orange-rgb, 207, 106, 47);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.automata-cantor-paper {
  fill: var(--paper-surface, var(--paper));
}

.automata-cantor-main-arrow {
  stroke: var(--cantor-muted);
  stroke-width: 2.1;
}


/* ---------------------------------------------------------------------------
   topoi-automata - an automaton as a covering of the bouquet
   --------------------------------------------------------------------------- */

.automata-etale-arrow,
.automata-etale-label {
  opacity: 0;
  animation: automata-etale-stage var(--cantor-cover-cycle) ease-in-out infinite;
}

.automata-sublocale-arrow,
.automata-sublocale-label {
  opacity: 0;
  animation: automata-sublocale-stage var(--cantor-cover-cycle) ease-in-out infinite;
}


/* ---------------------------------------------------------------------------
   automata-cantor-morphism - Cantor space over the prefix poset
   --------------------------------------------------------------------------- */

.automata-cantor-arrow-label {
  fill: var(--cantor-muted);
  font-size: 13px;
  font-weight: 820;
  text-anchor: middle;
}

.automata-cantor-arrow-label.large {
  fill: var(--cantor-ink);
  font-size: 18px;
  font-weight: 800;
}


/* ---------------------------------------------------------------------------
   topoi-automata - an automaton as a covering of the bouquet
   --------------------------------------------------------------------------- */

.automata-topos-label {
  opacity: 1;
  overflow: visible;
  pointer-events: none;
}

.automata-topos-tex {
  align-items: center;
  color: var(--cantor-ink);
  display: flex;
  font-size: 20px;
  height: 100%;
  justify-content: center;
  line-height: 1;
  width: 100%;
}


/* ---------------------------------------------------------------------------
   automata-cantor-morphism - Cantor space over the prefix poset
   --------------------------------------------------------------------------- */

.automata-cantor-interval {
  fill: none;
  opacity: 0;
  stroke: var(--cantor-purple);
  stroke-linecap: butt;
  stroke-width: 7;
  vector-effect: non-scaling-stroke;
}

.automata-cantor-interval.stage-0 {
  animation: automata-cantor-stage-0 var(--cantor-cover-cycle) ease-in-out infinite;
}

.automata-cantor-interval.stage-1 {
  animation: automata-cantor-stage-1 var(--cantor-cover-cycle) ease-in-out infinite;
}

.automata-cantor-interval.stage-2 {
  animation: automata-cantor-stage-2 var(--cantor-cover-cycle) ease-in-out infinite;
}

.automata-cantor-interval.stage-3 {
  animation: automata-cantor-stage-3 var(--cantor-cover-cycle) ease-in-out infinite;
}

.automata-cantor-interval.stage-4 {
  animation: automata-cantor-stage-4 var(--cantor-cover-cycle) ease-in-out infinite;
  stroke-width: 3;
}

.automata-cantor-connector {
  fill: none;
  opacity: 0;
  stroke: rgba(var(--cantor-purple-rgb), 0.24);
  stroke-linecap: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.automata-cantor-connector.cantor-stage-1 {
  animation: automata-cantor-connector-stage-1 var(--cantor-cover-cycle) ease-in-out infinite;
}

.automata-cantor-connector.cantor-stage-2 {
  animation: automata-cantor-connector-stage-2 var(--cantor-cover-cycle) ease-in-out infinite;
}

.automata-cantor-connector.cantor-stage-3 {
  animation: automata-cantor-connector-stage-3 var(--cantor-cover-cycle) ease-in-out infinite;
}

.automata-cantor-connector.cantor-stage-4 {
  animation: automata-cantor-connector-stage-4 var(--cantor-cover-cycle) ease-in-out infinite;
}

.automata-cantor-tree-edge,
.automata-cantor-bouquet-loop {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.automata-cantor-tree-edge,
.automata-cantor-bouquet-loop {
  stroke-width: 4.6;
}

.automata-prefix-poset .automata-cantor-tree-edge {
  opacity: 1;
}

.automata-cantor-bouquet-loop {
  animation: automata-bouquet-loop-unfold var(--cantor-cover-cycle) ease-in-out infinite;
}


/* ---------------------------------------------------------------------------
   topoi-automata - an automaton as a covering of the bouquet
   --------------------------------------------------------------------------- */

.automata-cover-unfolding {
  pointer-events: none;
}

.automata-rolling-bouquet {
  pointer-events: none;
}

.automata-rolling-bouquet-loop {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.8;
  vector-effect: non-scaling-stroke;
}

.automata-rolling-bouquet-loop.blue {
  stroke: var(--cantor-blue);
}

.automata-rolling-bouquet-loop.red {
  stroke: var(--cantor-red);
}

.automata-rolling-bouquet-node {
  fill: var(--cantor-ink);
  stroke: var(--paper-surface, var(--paper));
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}


/* ---------------------------------------------------------------------------
   automata-cantor-morphism - Cantor space over the prefix poset
   --------------------------------------------------------------------------- */

.automata-cantor-tree-edge.red,
.automata-cantor-bouquet-loop.red {
  stroke: var(--cantor-red);
}

.automata-cantor-tree-edge.blue,
.automata-cantor-bouquet-loop.blue {
  stroke: var(--cantor-blue);
}

.automata-cantor-node {
  fill: var(--cantor-ink);
  stroke: var(--paper-surface, var(--paper));
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.automata-prefix-poset .automata-cantor-node {
  opacity: 1;
}

.automata-cantor-node.small {
  stroke-width: 1;
}

.automata-cantor-node.tiny {
  stroke-width: 0.9;
}

.automata-cantor-node.micro {
  stroke-width: 0.75;
}

.automata-cantor-node.large {
  stroke-width: 2;
}

figure[data-figure] svg .automata-cantor-marker-neutral path,
.automata-cantor-marker-neutral path {
  fill: var(--cantor-muted);
}

figure[data-figure] svg .automata-cantor-marker-red path,
.automata-cantor-marker-red path {
  fill: var(--cantor-red);
}

figure[data-figure] svg .automata-cantor-marker-blue path,
.automata-cantor-marker-blue path {
  fill: var(--cantor-blue);
}

figure[data-figure] svg .automata-cantor-marker-purple path,
.automata-cantor-marker-purple path {
  fill: var(--cantor-purple);
}


/* ---------------------------------------------------------------------------
   topoi-automata - an automaton as a covering of the bouquet
   --------------------------------------------------------------------------- */

.automata-cover-figure .automata-edge {
  stroke-width: 2.8;
}

.automata-cover-figure .automata-edge-a {
  stroke: var(--cantor-red);
}

.automata-cover-figure .automata-edge-b {
  stroke: var(--cantor-blue);
}

.automata-cover-figure .automata-marker-a path {
  fill: var(--cantor-red);
}

.automata-cover-figure .automata-marker-b path {
  fill: var(--cantor-blue);
}

.automata-cover-figure .automata-marker-neutral path {
  fill: var(--cantor-muted);
}

.automata-state-mark {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.7;
}

.automata-state-check {
  stroke: var(--cantor-green);
}

.automata-state-cross {
  stroke: var(--cantor-red);
}

.automata-dot-links {
  pointer-events: none;
}

.automata-dot-link {
  fill: none;
  stroke: rgba(var(--cantor-muted-rgb), 0.58);
  stroke-dasharray: 5 7;
  stroke-linecap: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.automata-input-start-link {
  display: none;
  fill: none;
  stroke: rgba(var(--cantor-muted-rgb), 0.24);
  stroke-linecap: round;
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.automata-input-panel {
  fill: none;
  stroke: none;
  stroke-width: 1.5;
}

.automata-input-heading {
  fill: var(--cantor-muted);
  font-size: 16px;
  font-weight: 860;
  text-anchor: start;
}

.automata-input-word {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: 0;
  text-anchor: start;
}

.automata-word-a {
  fill: var(--cantor-red);
}

.automata-word-b {
  fill: var(--cantor-blue);
}

.automata-consume-effects {
  display: none;
  pointer-events: none;
}

.automata-consume-effect {
  opacity: 0;
}

.automata-consume-effect circle {
  stroke-width: 4.2;
  vector-effect: non-scaling-stroke;
}

.automata-consume-effect path {
  fill: none;
  stroke-linecap: round;
  stroke-width: 7.5;
  vector-effect: non-scaling-stroke;
}

.automata-consume-effect-a circle,
.automata-consume-effect-a path {
  stroke: rgba(var(--cantor-red-rgb), 0.92);
}

.automata-consume-effect-a circle {
  fill: rgba(var(--cantor-red-rgb), 0.12);
}

.automata-consume-effect-b circle,
.automata-consume-effect-b path {
  stroke: rgba(var(--cantor-blue-rgb), 0.92);
}

.automata-consume-effect-b circle {
  fill: rgba(var(--cantor-blue-rgb), 0.12);
}

.automata-edge-highlights {
  display: none;
  pointer-events: none;
}

.automata-edge-highlight {
  fill: none;
  opacity: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
  vector-effect: non-scaling-stroke;
}

.automata-edge-highlight-a {
  stroke: rgba(var(--cantor-red-rgb), 0.82);
}

.automata-edge-highlight-b {
  stroke: rgba(var(--cantor-blue-rgb), 0.82);
}

.automata-output-panel-bg {
  fill: none;
  stroke: none;
  stroke-width: 1.5;
}

.automata-output-heading {
  fill: var(--cantor-muted);
  font-size: 13px;
  font-weight: 860;
  text-anchor: start;
}

.automata-current-output-block {
  fill: rgba(var(--cantor-red-rgb), 0.12);
  stroke: rgba(var(--cantor-red-rgb), 0.32);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.automata-output-panel.is-accept .automata-current-output-block {
  fill: rgba(var(--cantor-green-rgb), 0.15);
  stroke: rgba(var(--cantor-green-rgb), 0.36);
}

.automata-output-panel.is-reject .automata-current-output-block {
  fill: rgba(var(--cantor-red-rgb), 0.13);
  stroke: rgba(var(--cantor-red-rgb), 0.34);
}

.automata-output-cell rect {
  stroke-width: 1.5;
}

.automata-output-token {
  pointer-events: none;
}

.automata-output-token rect {
  fill: var(--paper-surface, var(--paper));
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.automata-output-token text {
  font-size: 13px;
  font-weight: 880;
  text-anchor: middle;
}

.automata-word-a {
  fill: var(--cantor-red);
}

.automata-word-b {
  fill: var(--cantor-blue);
}

.automata-output-token-accept rect {
  stroke: rgba(var(--cantor-green-rgb), 0.42);
}

.automata-output-token-accept text {
  fill: var(--cantor-green);
}

.automata-output-token-reject rect {
  stroke: rgba(var(--cantor-red-rgb), 0.4);
}

.automata-output-token-reject text {
  fill: var(--cantor-red);
}

.automata-consuming-letters {
  display: none;
  pointer-events: none;
}

.automata-consumed-letter {
  opacity: 0;
}

.automata-consumed-letter text {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 900;
  paint-order: stroke;
  stroke: var(--paper-surface, var(--paper));
  stroke-linejoin: round;
  stroke-width: 3.6px;
  text-anchor: middle;
}

.automata-consumed-letter-a text {
  fill: var(--cantor-red);
}

.automata-consumed-letter-b text {
  fill: var(--cantor-blue);
}

.automata-moving-word {
  pointer-events: none;
}

.automata-moving-word text {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(255, 253, 248, 0.9);
  stroke-linejoin: round;
  stroke-width: 4px;
  text-anchor: start;
}

.automata-moving-word .automata-word-a {
  stroke: rgba(var(--cantor-red-rgb), 0.58);
  stroke-width: 2.4px;
}

.automata-moving-word .automata-word-b {
  stroke: rgba(var(--cantor-blue-rgb), 0.58);
  stroke-width: 2.4px;
}

.automata-language-accept {
  fill: var(--cantor-green);
}

.automata-language-reject {
  fill: var(--cantor-orange);
}

.automata-result-output {
  opacity: 0;
  pointer-events: none;
}

.automata-moving-dot {
  pointer-events: none;
}

.automata-moving-dot-halo {
  display: none;
}

.automata-moving-dot-core {
  fill: rgba(var(--cantor-muted-rgb), 0.56);
  stroke: none;
}

.is-interactive-automaton .automata-input-word[display="none"],
.is-interactive-automaton .automata-moving-dot[display="none"],
.is-interactive-automaton .automata-moving-word[display="none"],
.is-interactive-automaton .automata-result-output[display="none"] {
  display: none;
}

.is-interactive-automaton .automata-dot-links {
  display: none;
}

.automata-live-word {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(255, 253, 248, 0.72);
  stroke-linejoin: round;
  stroke-width: 2px;
  text-anchor: start;
}

.automata-live-word-near-dot {
  font-size: 14px;
}

.automata-consume-letter-flash {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(255, 253, 248, 0.78);
  stroke-linejoin: round;
  stroke-width: 2.5px;
  text-anchor: start;
  transform-box: fill-box;
  transform-origin: center;
}

.automata-interactive-result {
  font-size: 28px;
  font-weight: 950;
  text-anchor: middle;
}

.automata-output-panel.is-accept .automata-interactive-result {
  fill: var(--cantor-green);
}

.automata-output-panel.is-reject .automata-interactive-result {
  fill: var(--cantor-red);
}

.automata-interactive-controls {
  align-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 0;
  position: absolute;
  transform: translateX(-50%);
  z-index: 2;
}

.automata-interactive-controls-input {
  left: 27.5%;
  top: 12%;
}

.automata-button {
  appearance: none;
  background: var(--paper-surface, var(--paper));
  border: 1.5px solid var(--paper-line, rgba(43, 52, 43, 0.18));
  border-radius: 7px;
  color: var(--paper-ink, var(--ink));
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  min-width: 42px;
  padding: 7px 11px;
}

.automata-button:hover,
.automata-button:focus-visible {
  border-color: rgba(var(--cantor-green-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--cantor-green-rgb), 0.12);
  outline: none;
}

.automata-interactive-controls-input .automata-button {
  font-size: 16px;
  min-width: 56px;
  padding: 10px 15px;
}


/* ---------------------------------------------------------------------------
   responsive overrides
   --------------------------------------------------------------------------- */

@media (max-width: 430px) {
  .automata-interactive-controls {
    gap: 5px;
  }

  .automata-interactive-controls-input {
    left: 41%;
  }

  .automata-interactive-controls-input .automata-button {
    font-size: 14px;
    min-width: 46px;
    padding: 8px 11px;
  }
}

@media (max-width: 340px) {
  .automata-interactive-controls-input {
    left: 42%;
    transform: translateX(-50%) scale(0.9);
    transform-origin: top center;
  }
}


/* ---------------------------------------------------------------------------
   topoi-automata - an automaton as a covering of the bouquet
   --------------------------------------------------------------------------- */

.automata-button-a {
  background: rgba(var(--cantor-red-rgb), 0.09);
  border-color: rgba(var(--cantor-red-rgb), 0.24);
  color: var(--cantor-red);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.automata-button-b {
  background: rgba(var(--cantor-blue-rgb), 0.09);
  border-color: rgba(var(--cantor-blue-rgb), 0.24);
  color: var(--cantor-blue);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.automata-button-a:hover,
.automata-button-a:focus-visible {
  border-color: rgba(var(--cantor-red-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--cantor-red-rgb), 0.12);
}

.automata-button-b:hover,
.automata-button-b:focus-visible {
  border-color: rgba(var(--cantor-blue-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--cantor-blue-rgb), 0.12);
}


/* ---------------------------------------------------------------------------
   shared figure primitives (arrows, nodes, lines, labels)
   --------------------------------------------------------------------------- */

.figure-math-label {
  fill: var(--paper-ink, #1f2721);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  text-anchor: middle;
  dominant-baseline: middle;
}

.figure-math-label.large {
  font-size: 26px;
}

.figure-math-label.small {
  font-size: 19px;
}

.figure-math-label.tiny {
  font-size: 15px;
}


/* ---------------------------------------------------------------------------
   normalization - D4 on a square and its subgroup lattices
   --------------------------------------------------------------------------- */

.normalization-subgroup .figure-math-label.large {
  font-size: 18px;
}

.normalization-subgroup .figure-math-label.small {
  font-size: 14.5px;
}

.normalization-subgroup .figure-math-label.tiny {
  font-size: 11.2px;
}

.normalization-subgroup .figure-math-label {
  opacity: 0;
}

.normalization-object-arrow {
  fill: none;
  stroke: rgba(31, 39, 33, 0.5);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  vector-effect: non-scaling-stroke;
}

.normalization-tex-object,
.normalization-tex-morphism {
  overflow: visible;
  pointer-events: none;
}

.normalization-tex-label {
  align-items: center;
  color: rgba(31, 39, 33, 0.86);
  display: flex;
  height: 100%;
  justify-content: center;
  line-height: 1;
  text-align: center;
  width: 100%;
}

.normalization-tex-object .normalization-tex-label {
  font-size: 22px;
  font-weight: 650;
}

.normalization-tex-morphism .normalization-tex-label {
  color: rgba(31, 39, 33, 0.78);
  font-size: 17px;
  font-weight: 650;
}

.normalization-arrow-caption {
  fill: rgba(31, 39, 33, 0.66);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  letter-spacing: 0;
  text-anchor: middle;
}

.normalization-hasse-edge {
  stroke: var(--paper-line, rgba(93, 97, 92, 0.28));
  stroke-width: 2;
}

.normalization-operator-link {
  stroke: rgba(var(--paper-teal-rgb, 31, 138, 120), 0.3);
  stroke-width: 2.55;
}

.normalization-operator-link {
  fill: none;
  marker-mid: url("#normalization-link-arrow-d4");
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.normalization-operator-link[data-normalization-operator-source="d4"] {
  stroke: rgba(var(--paper-gray-rgb, 116, 120, 114), 0.58);
}

.normalization-operator-link[data-normalization-operator-source="ref0"] {
  marker-mid: url("#normalization-link-arrow-ref0");
  stroke: rgba(var(--paper-blue-rgb, 63, 115, 152), 0.74);
}

.normalization-operator-link[data-normalization-operator-source="ref2"] {
  marker-mid: url("#normalization-link-arrow-ref2");
  stroke: rgba(var(--paper-red-rgb, 191, 79, 67), 0.7);
}

.normalization-operator-link[data-normalization-operator-source="ref1"] {
  marker-mid: url("#normalization-link-arrow-ref1");
  stroke: rgba(var(--paper-green-rgb, 75, 128, 98), 0.72);
}

.normalization-operator-link[data-normalization-operator-source="ref3"] {
  marker-mid: url("#normalization-link-arrow-ref3");
  stroke: rgba(var(--paper-purple-rgb, 119, 101, 166), 0.72);
}

.normalization-figure #normalization-link-arrow-d4 path,
.normalization-figure #normalization-link-arrow-ref0 path,
.normalization-figure #normalization-link-arrow-ref2 path,
.normalization-figure #normalization-link-arrow-ref1 path,
.normalization-figure #normalization-link-arrow-ref3 path {
  fill: context-stroke;
  fill-opacity: 1;
}

.normalization-stabilizer-links,
.normalization-operator-links {
  pointer-events: none;
}

.normalization-stabilizer-link {
  fill: none;
  marker-mid: url("#normalization-link-arrow-d4");
  stroke: rgba(var(--paper-gray-rgb, 116, 120, 114), 0.46);
  stroke-width: 2.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.normalization-stabilizer-link[data-normalization-link-subgroup="ref0"] {
  marker-mid: url("#normalization-link-arrow-ref0");
  stroke: rgba(var(--paper-blue-rgb, 63, 115, 152), 0.72);
}

.normalization-stabilizer-link[data-normalization-link-subgroup="ref2"] {
  marker-mid: url("#normalization-link-arrow-ref2");
  stroke: rgba(var(--paper-red-rgb, 191, 79, 67), 0.7);
}

.normalization-stabilizer-link[data-normalization-link-subgroup="ref1"] {
  marker-mid: url("#normalization-link-arrow-ref1");
  stroke: rgba(var(--paper-green-rgb, 75, 128, 98), 0.72);
}

.normalization-stabilizer-link[data-normalization-link-subgroup="ref3"] {
  marker-mid: url("#normalization-link-arrow-ref3");
  stroke: rgba(var(--paper-purple-rgb, 119, 101, 166), 0.72);
}

.normalization-stabilizer-link[data-normalization-link-subgroup="d4"] {
  stroke: rgba(var(--paper-gray-rgb, 116, 120, 114), 0.58);
}

.normalization-figure.is-transporting .normalization-stabilizer-link {
  stroke-width: 2.65;
  opacity: 1;
}

.normalization-subgroup {
  outline: none;
  transition: opacity 180ms ease, filter 180ms ease;
}

.normalization-subgroup[data-normalization-face-colors="blue"] {
  --normalization-subgroup-fill: var(--paper-blue-soft, #e4edf4);
  --normalization-subgroup-stroke: rgba(var(--paper-blue-rgb, 63, 115, 152), 0.56);
  --normalization-subgroup-highlight-fill: var(--paper-blue-soft, #dcebf5);
  --normalization-subgroup-highlight-stroke: var(--paper-blue, #3f7398);
}

.normalization-subgroup[data-normalization-face-colors="red"] {
  --normalization-subgroup-fill: var(--paper-red-soft, #f3e3dc);
  --normalization-subgroup-stroke: rgba(var(--paper-red-rgb, 191, 79, 67), 0.52);
  --normalization-subgroup-highlight-fill: var(--paper-red-soft, #f4ded4);
  --normalization-subgroup-highlight-stroke: var(--paper-red, #bf4f43);
}

.normalization-subgroup[data-normalization-edge-colors="green"] {
  --normalization-subgroup-fill: var(--paper-green-soft, #e6efdf);
  --normalization-subgroup-stroke: rgba(var(--paper-green-rgb, 75, 128, 98), 0.52);
  --normalization-subgroup-highlight-fill: var(--paper-green-soft, #dcebd2);
  --normalization-subgroup-highlight-stroke: var(--paper-green, #4b8062);
}

.normalization-subgroup[data-normalization-edge-colors="purple"] {
  --normalization-subgroup-fill: var(--paper-purple-soft, #e9e4f2);
  --normalization-subgroup-stroke: rgba(var(--paper-purple-rgb, 119, 101, 166), 0.52);
  --normalization-subgroup-highlight-fill: var(--paper-purple-soft, #dfd7ee);
  --normalization-subgroup-highlight-stroke: var(--paper-purple, #7765a6);
}

.normalization-subgroup:not([data-normalization-face-colors]):not([data-normalization-edge-colors]) {
  --normalization-subgroup-fill: var(--paper-gray-soft, #e7e7e2);
  --normalization-subgroup-stroke: var(--paper-gray, #747872);
  --normalization-subgroup-highlight-fill: var(--paper-gray-soft, #e7e7e2);
  --normalization-subgroup-highlight-stroke: var(--paper-gray, #747872);
}

.normalization-subgroup[data-normalization-subgroup="d4"] {
  --normalization-subgroup-fill: var(--paper-gray-soft, #e7e7e2);
  --normalization-subgroup-stroke: var(--paper-gray, #747872);
  --normalization-subgroup-highlight-fill: var(--paper-gray-soft, #e7e7e2);
  --normalization-subgroup-highlight-stroke: var(--paper-gray, #747872);
}

.normalization-figure.is-interactive .normalization-element-control {
  cursor: pointer;
}

.normalization-subgroup .figure-node {
  fill: var(--normalization-subgroup-fill, rgba(255, 253, 248, 0.96));
  stroke: var(--normalization-subgroup-stroke, rgba(43, 52, 43, 0.72));
  transition: fill 180ms ease, stroke 180ms ease, stroke-width 180ms ease;
}

.normalization-subgroup.is-muted {
  opacity: 1;
}

.normalization-subgroup.is-muted .figure-node {
  fill: var(--paper-surface-tint, #f8f7f2);
  stroke: var(--paper-line, rgba(43, 52, 43, 0.22));
  stroke-width: 2.1;
}

.normalization-subgroup.is-muted .figure-math-label {
  fill: rgba(43, 52, 43, 0.42);
}

.normalization-subgroup.is-highlighted .figure-node {
  fill: var(--normalization-subgroup-highlight-fill, #f4f1e8);
  stroke: var(--normalization-subgroup-highlight-stroke, rgba(43, 52, 43, 0.76));
  stroke-width: 2.8;
}

.normalization-subgroup.is-selected .figure-node {
  fill: var(--normalization-subgroup-highlight-fill, #f0eadc);
  stroke: var(--normalization-subgroup-highlight-stroke, var(--paper-ink, #2b342b));
  stroke-width: 3.4;
}

.normalization-subgroup:focus-visible .figure-node {
  stroke: var(--paper-teal-deep, #1f5c54);
  stroke-width: 3.6;
}

.normalization-action {
  transition: opacity 180ms ease, filter 180ms ease;
}

.normalization-action.is-dimmed {
  opacity: 0.18;
  filter: grayscale(0.55);
}

.normalization-action-atlas {
  color: #1f2721;
}

.normalization-action-stage-bg {
  fill: none;
  stroke: none;
}

.normalization-square-shadow {
  fill: none;
  stroke: none;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.normalization-square-frame {
  stroke: rgba(31, 39, 33, 0.48);
  stroke-width: 2.1;
}

.normalization-square-edge-segment {
  transition: opacity 180ms ease, stroke 180ms ease, stroke-width 180ms ease;
}

.normalization-square-edge-hit {
  fill: none;
  pointer-events: stroke;
  stroke: transparent;
  stroke-linecap: round;
  stroke-width: 8;
}

.normalization-action-line {
  fill: none;
  stroke: rgba(var(--paper-blue-rgb, 63, 115, 152), 0.58);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.normalization-action-dot {
  fill: var(--paper-surface, var(--paper));
  stroke: var(--paper-teal, #1f8a78);
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
}

.normalization-vertex-point {
  filter: drop-shadow(0 2px 3px rgba(31, 39, 33, 0.14));
}

.normalization-edge-point {
  opacity: 0.88;
}

.normalization-action-dot.normalization-edge-point[data-normalization-place-stabilizer="ref1"] {
  --normalization-token-fill: var(--paper-green-soft, #e6efdf);
  --normalization-token-stroke: rgba(var(--paper-green-rgb, 75, 128, 98), 0.6);
}

.normalization-action-dot.normalization-edge-point[data-normalization-place-stabilizer="ref3"] {
  --normalization-token-fill: var(--paper-purple-soft, #e9e4f2);
  --normalization-token-stroke: rgba(var(--paper-purple-rgb, 119, 101, 166), 0.6);
}

.normalization-action-place[data-normalization-token="a"] {
  --normalization-token-fill: var(--paper-blue-soft, #e4edf4);
  --normalization-token-stroke: rgba(var(--paper-blue-rgb, 63, 115, 152), 0.58);
}

.normalization-action-place[data-normalization-token="b"] {
  --normalization-token-fill: var(--paper-red-soft, #f3e3dc);
  --normalization-token-stroke: rgba(var(--paper-red-rgb, 191, 79, 67), 0.54);
}

.normalization-action-place[data-normalization-token="c"] {
  --normalization-token-fill: var(--paper-blue-soft, #e4edf4);
  --normalization-token-stroke: rgba(var(--paper-blue-rgb, 63, 115, 152), 0.58);
}

.normalization-action-place[data-normalization-token="d"] {
  --normalization-token-fill: var(--paper-red-soft, #f3e3dc);
  --normalization-token-stroke: rgba(var(--paper-red-rgb, 191, 79, 67), 0.54);
}

.normalization-action-place[data-normalization-token="e"] {
  --normalization-token-fill: var(--paper-orange-soft, #f1e7d8);
  --normalization-token-stroke: rgba(var(--paper-orange-rgb, 207, 106, 47), 0.56);
}

.normalization-action-place[data-normalization-token="f"] {
  --normalization-token-fill: var(--paper-blue-soft, #e2eef2);
  --normalization-token-stroke: rgba(var(--paper-blue-rgb, 63, 115, 152), 0.5);
}

.normalization-action-place[data-normalization-token="g"] {
  --normalization-token-fill: var(--paper-orange-soft, #eee5d7);
  --normalization-token-stroke: rgba(var(--paper-orange-rgb, 207, 106, 47), 0.48);
}

.normalization-action-place[data-normalization-token="h"] {
  --normalization-token-fill: var(--paper-green-soft, #e6eddf);
  --normalization-token-stroke: rgba(var(--paper-green-rgb, 75, 128, 98), 0.5);
}

.normalization-action-line.normalization-action-place {
  stroke: var(--normalization-token-stroke, rgba(var(--paper-blue-rgb, 63, 115, 152), 0.58));
}

.normalization-element-control text {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.normalization-element-button {
  fill: rgba(255, 253, 248, 0.96);
  stroke: rgba(43, 52, 43, 0.2);
  stroke-width: 1.3;
  transition: fill 180ms ease, stroke 180ms ease, stroke-width 180ms ease;
}

.normalization-element-control {
  transition: opacity 180ms ease;
}

.normalization-element-control text {
  fill: var(--paper-ink, #1f2721);
  font-size: 16.5px;
  font-weight: 850;
  letter-spacing: 0;
  pointer-events: none;
  text-anchor: middle;
}

.normalization-element-control.is-acted .normalization-element-button {
  fill: var(--paper-orange-soft, #f4e6d7);
  stroke: var(--paper-orange, #cf6a2f);
  stroke-width: 2;
}

.normalization-element-control:focus-visible .normalization-element-button {
  stroke: var(--paper-teal-deep, #1f5c54);
  stroke-width: 2.2;
}


/* ---------------------------------------------------------------------------
   shared figure primitives (arrows, nodes, lines, labels)
   --------------------------------------------------------------------------- */

.figure-dot {
  fill: var(--paper-ink, #1f2721);
}


/* ---------------------------------------------------------------------------
   quotient-toposes - height and period of a discrete dynamical system
   --------------------------------------------------------------------------- */

.quotient-toposes-figure .figure-line,
.quotient-toposes-figure .figure-arrow {
  stroke: rgba(31, 39, 33, 0.54);
}

.quotient-toposes-figure .quotient-guide,
.quotient-toposes-figure .quotient-infinite-continuation,
.quotient-toposes-figure .quotient-infinite-height-continuation {
  display: none;
}

.quotient-toposes-figure .quotient-edge-height,
.quotient-toposes-figure .quotient-edge-period,
.quotient-toposes-figure .quotient-edge-infinite {
  stroke-width: 2.45;
}

.quotient-toposes-figure .quotient-edge-height {
  stroke: var(--paper-teal, #1f8a78);
}

.quotient-toposes-figure .quotient-edge-period {
  stroke: var(--paper-orange, #cf6a2f);
}

.quotient-toposes-figure .quotient-edge-infinite,
.quotient-toposes-figure .quotient-infinite-continuation {
  stroke: var(--paper-orange, #cf6a2f);
}

.quotient-toposes-figure .quotient-infinite-height-continuation {
  stroke: var(--paper-teal, #1f8a78);
}

.quotient-toposes-figure .quotient-infinite-continuation {
  stroke-dasharray: 7 9;
  stroke-width: 2;
  opacity: 0.32;
}

.quotient-toposes-figure .quotient-infinite-height-continuation {
  stroke-dasharray: 7 9;
  stroke-width: 2;
  opacity: 0.32;
}

.quotient-toposes-figure .quotient-marker-height path {
  fill: var(--paper-teal, #1f8a78);
}

.quotient-toposes-figure .quotient-marker-period path {
  fill: var(--paper-orange, #cf6a2f);
}

.quotient-toposes-figure .quotient-marker-infinite path {
  fill: var(--paper-orange, #cf6a2f);
}

.quotient-state-height {
  fill: var(--paper-teal-soft, #e3f2ee);
  stroke: var(--paper-teal, #1f8a78);
  stroke-width: 2.25;
}

.quotient-state-period {
  fill: var(--paper-orange-soft, #f5e3d4);
  stroke: var(--paper-orange, #cf6a2f);
  stroke-width: 2.25;
}

.quotient-state-infinite {
  fill: var(--paper-orange-soft, #f5e3d4);
  stroke: var(--paper-orange, #cf6a2f);
  stroke-width: 2.25;
}

.quotient-ellipsis {
  fill: rgba(31, 39, 33, 0.72);
  font-weight: 800;
  letter-spacing: 0;
}

.quotient-ellipsis {
  font-size: 18px;
  text-anchor: middle;
}

.quotient-legend .quotient-label {
  font-size: 11.5px;
}

.quotient-guide {
  pointer-events: none;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 6.4;
  opacity: 0.28;
}

.quotient-height-guide {
  animation: quotient-guide-pulse 2.7s ease-in-out infinite;
  stroke: var(--paper-teal, #1f8a78);
  stroke-dasharray: 2 10;
}

.quotient-period-guide {
  animation: quotient-guide-pulse 2.7s ease-in-out infinite;
  stroke: var(--paper-orange, #cf6a2f);
  stroke-dasharray: 4 9;
}

.quotient-infinite-guide {
  animation: quotient-guide-pulse 2.7s ease-in-out infinite;
  stroke-dasharray: 3 10;
}

.quotient-infinite-guide {
  stroke: var(--paper-orange, #cf6a2f);
}

.quotient-moving-light {
  opacity: 0;
  pointer-events: none;
  filter: none;
}

.quotient-flow-light {
  opacity: 1;
}

.quotient-moving-light-period {
  filter: none;
}

.quotient-light-halo {
  display: none;
}

.quotient-light-core {
  fill: var(--paper-teal, #1f8a78);
  stroke: none;
}

.quotient-light-core-orange {
  fill: var(--paper-orange, #cf6a2f);
}

.quotient-label {
  fill: rgba(31, 39, 33, 0.74);
  font-size: 12px;
  font-weight: 850;
  text-anchor: start;
}

.quotient-height-label {
  fill: var(--paper-teal-deep, #176b5f);
}

.quotient-period-label {
  fill: var(--paper-orange-deep, #a4522c);
}

.quotient-infinite-label {
  fill: var(--paper-orange-deep, #a4522c);
}


/* ---------------------------------------------------------------------------
   internal-parameterizations - the local state classifier
   --------------------------------------------------------------------------- */

.internal-parameterization-figure .internal-panel-bg {
  fill: rgba(255, 253, 248, 0.72);
  stroke: rgba(43, 52, 43, 0.13);
  stroke-width: 1.3;
}

.internal-figure-heading {
  fill: #1f2721;
  font-size: 17px;
  font-weight: 850;
}

.internal-graph-node,
.internal-classifier-node {
  fill: var(--paper);
  stroke: #1f2721;
  stroke-width: 2;
}

.internal-classifier-node {
  fill: var(--paper-blue-soft, #e5edf3);
  stroke: var(--paper-blue, #3f7398);
}

.internal-edge-base,
.internal-classifier-loop {
  stroke: rgba(44, 49, 45, 0.5);
  stroke-width: 2.2;
}

.internal-source-graph {
  opacity: 0;
}

.internal-loop-l {
  stroke: var(--paper-orange, #cf6a2f);
}

.internal-loop-n {
  stroke: var(--paper-teal, #1f8a78);
}

.internal-classifier-edge-label {
  font-size: 12px;
  font-weight: 850;
  text-anchor: middle;
}

.internal-classifier-caption-loop {
  fill: var(--paper-orange, #cf6a2f);
}

.internal-classifier-caption-nonloop {
  fill: var(--paper-teal, #1f8a78);
}

.internal-classifier-symbol-box {
  overflow: visible;
}

.internal-classifier-symbol {
  align-items: center;
  color: #1f2721;
  display: flex;
  font-size: 21px;
  font-weight: 400;
  height: 30px;
  justify-content: center;
  line-height: 1;
  width: 38px;
}

.internal-piece {
  filter: none;
}

.internal-piece-dot {
  fill: var(--paper);
  stroke: #1f2721;
  stroke-width: 2;
}

.internal-piece-arrow {
  stroke: var(--paper-ink, #1f2721);
  stroke-width: 2.2;
}


/* ---------------------------------------------------------------------------
   completely-connected - rooted trees and rooted forests
   --------------------------------------------------------------------------- */

.connected-figure {
  position: relative;
  width: 100%;
  height: 100%;
}

.connected-pattern {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.connected-pattern.is-visible {
  opacity: 1;
}

.connected-match,
.connected-match .figure-line,
.connected-match .figure-node,
.connected-correspondence-arrow,
.connected-top-edge,
.connected-top-root {
  transition:
  opacity 180ms ease,
  fill 180ms ease,
  stroke 180ms ease,
  stroke-width 180ms ease,
  transform 180ms ease;
}

.connected-match {
  opacity: 0.78;
}

.connected-figure.is-complete .connected-match,
.connected-match.is-complete {
  opacity: 1;
}

.connected-match.is-active {
  opacity: 1;
}

.connected-top-edge,
.connected-top-root {
  opacity: 1;
}

.connected-figure.is-complete .connected-top-edge,
.connected-figure.is-complete .connected-top-root {
  opacity: 1;
}

.connected-top-edge {
  stroke-width: 2.6;
}

.connected-top-root {
  fill: #d8d8d2;
  stroke: #1f2721;
  stroke-width: 2.8;
}

.connected-divider {
  opacity: 0.58;
}

.connected-category-svg-label {
  fill: #1f2721;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 800;
  pointer-events: none;
  text-anchor: middle;
}

.connected-correspondence-arrow {
  opacity: 0;
  stroke-width: 3;
}

.connected-correspondence-arrow.is-complete {
  opacity: 0.34;
}

.connected-correspondence-arrow.is-active {
  opacity: 0.96;
  stroke-dasharray: 12 9;
  stroke-width: 4;
  animation: connected-arrow-flow 720ms linear infinite;
}

.connected-match.is-active .figure-line {
  stroke-width: 3.2;
}

.connected-match.is-active .figure-node {
  stroke-width: 3.4;
}

.connected-match .figure-node {
  fill: var(--paper);
  stroke: #1f2721;
}

.connected-match[data-connected-left="a"].is-complete .figure-line,
.connected-match[data-connected-right="a"].is-complete .figure-line,
.connected-match[data-connected-left="a"].is-active .figure-line,
.connected-match[data-connected-right="a"].is-active .figure-line,
.connected-correspondence-arrow[data-connected-arrow="a"] {
  stroke: var(--paper-teal, #1f8a78);
}

.connected-match[data-connected-left="a"].is-complete .figure-node,
.connected-match[data-connected-right="a"].is-complete .figure-node,
.connected-match[data-connected-left="a"].is-active .figure-node,
.connected-match[data-connected-right="a"].is-active .figure-node {
  fill: var(--paper-teal-soft, #e3f2ee);
  stroke: var(--paper-teal, #1f8a78);
}

.connected-match[data-connected-left="b"].is-complete .figure-line,
.connected-match[data-connected-right="b"].is-complete .figure-line,
.connected-match[data-connected-left="b"].is-active .figure-line,
.connected-match[data-connected-right="b"].is-active .figure-line,
.connected-correspondence-arrow[data-connected-arrow="b"] {
  stroke: var(--paper-blue, #3f7398);
}

.connected-match[data-connected-left="b"].is-complete .figure-node,
.connected-match[data-connected-right="b"].is-complete .figure-node,
.connected-match[data-connected-left="b"].is-active .figure-node,
.connected-match[data-connected-right="b"].is-active .figure-node {
  fill: var(--paper-blue-soft, #e5edf3);
  stroke: var(--paper-blue, #3f7398);
}

.connected-match[data-connected-left="c"].is-complete .figure-line,
.connected-match[data-connected-right="c"].is-complete .figure-line,
.connected-match[data-connected-left="c"].is-active .figure-line,
.connected-match[data-connected-right="c"].is-active .figure-line,
.connected-correspondence-arrow[data-connected-arrow="c"] {
  stroke: var(--paper-orange, #cf6a2f);
}

.connected-match[data-connected-left="c"].is-complete .figure-node,
.connected-match[data-connected-right="c"].is-complete .figure-node,
.connected-match[data-connected-left="c"].is-active .figure-node,
.connected-match[data-connected-right="c"].is-active .figure-node {
  fill: var(--paper-orange-soft, #f5e3d4);
  stroke: var(--paper-orange, #cf6a2f);
}


/* ---------------------------------------------------------------------------
   lawvere-first - image factorization of a power set expression
   --------------------------------------------------------------------------- */

.tensor-left-a-node text,
.tensor-right-a-node text,
.tensor-s-node text,
.tensor-x-node text {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-anchor: middle;
}

.tensor-factorization-figure .tensor-tex-object {
  overflow: visible;
  pointer-events: none;
}

.tensor-factorization-figure .tensor-tex-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(67, 72, 64, 0.82);
  font-size: 21px;
  line-height: 1;
  text-align: center;
}

.tensor-factorization-figure .tensor-tex-object-left .tensor-tex-label {
  color: var(--tensor-map);
}

.tensor-factorization-figure .tensor-tex-object-right .tensor-tex-label {
  color: var(--tensor-subset);
}

.tensor-factorization-figure .tensor-edge-direction {
  pointer-events: none;
  opacity: 0.95;
}

.tensor-factorization-figure .tensor-edge-direction-map {
  fill: var(--tensor-map);
}

.tensor-factorization-figure .tensor-edge-direction-subset {
  fill: var(--tensor-subset);
}

.tensor-left-a-node text,
.tensor-right-a-node text,
.tensor-s-node text,
.tensor-x-node text {
  fill: #24312a;
  font-size: 15px;
  font-weight: 900;
}

.tensor-left-a-node text,
.tensor-right-a-node text,
.tensor-s-node text,
.tensor-x-node text {
  font-size: 22px;
}

.tensor-factorization-figure .tensor-left-a-node text,
.tensor-factorization-figure .tensor-right-a-node text,
.tensor-factorization-figure .tensor-s-node text,
.tensor-factorization-figure .tensor-x-node text,
.tensor-factorization-figure .tensor-s-new-node text {
  display: none;
}

.tensor-x-node circle {
  fill: rgba(255, 253, 248, 0.96);
  stroke: rgba(43, 52, 43, 0.28);
  stroke-width: 2;
}

.tensor-x-node.selected circle {
  fill: var(--paper-orange-soft, #f5e3d4);
  stroke: var(--paper-orange, #cf6a2f);
  stroke-width: 2.6;
}

.tensor-x-node.green circle {
  fill: var(--paper-teal-soft, #e3f2ee);
  stroke: var(--paper-teal, #1f8a78);
}

.tensor-factorization-figure {
  --tensor-cycle: 12.4s;
  --tensor-map: var(--paper-teal, #1f8a78);
  --tensor-map-fill: var(--paper-teal-soft, #e3f2ee);
  --tensor-subset: var(--paper-orange, #cf6a2f);
  --tensor-subset-fill: var(--paper-orange-soft, #f5e3d4);
  --tensor-neutral: var(--paper-gray, #747872);
  --tensor-neutral-fill: var(--paper-gray-soft, #e7e7e2);
}

.tensor-factorization-figure .tensor-step1-block {
  fill: rgba(255, 253, 248, 0.18);
  stroke: rgba(102, 106, 100, 0.38);
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.tensor-factorization-figure .tensor-step1-block-left {
  fill: rgba(223, 238, 229, 0.28);
  stroke: rgba(44, 111, 99, 0.38);
}

.tensor-factorization-figure .tensor-step1-block-middle {
  fill: rgba(237, 237, 223, 0.18);
  stroke: rgba(102, 106, 100, 0.46);
}

.tensor-factorization-figure .tensor-step1-block-subset {
  fill: rgba(245, 220, 198, 0.28);
  stroke: rgba(182, 103, 55, 0.48);
}

.tensor-factorization-figure .tensor-left-map-cord {
  fill: none;
  stroke: var(--tensor-map);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8;
  opacity: 0.82;
  vector-effect: non-scaling-stroke;
}

.tensor-factorization-figure .tensor-subset-link {
  fill: none;
  stroke: var(--tensor-subset);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.4;
  opacity: 0.92;
  vector-effect: non-scaling-stroke;
}

.tensor-factorization-figure .tensor-neutral-link {
  fill: none;
  stroke: var(--tensor-neutral);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
  opacity: 0;
  vector-effect: non-scaling-stroke;
}

.tensor-factorization-figure .tensor-a-copy-link {
  fill: none;
  stroke: var(--tensor-neutral);
  stroke-dasharray: 5 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  opacity: 0.55;
  vector-effect: non-scaling-stroke;
}

.tensor-factorization-figure .tensor-s-new-node {
  opacity: 0;
  animation: tensor-s-new-node-stage var(--tensor-cycle) ease-in-out infinite;
}

.tensor-factorization-figure .tensor-s-new-node circle {
  fill: var(--tensor-neutral-fill);
  stroke: var(--tensor-neutral);
  stroke-width: 2.6;
}

.tensor-factorization-figure .tensor-s-new-node text {
  fill: var(--tensor-neutral);
  font-size: 22px;
  font-weight: 900;
  text-anchor: middle;
}

.tensor-factorization-figure .tensor-f-arrow-head-green {
  fill: var(--tensor-map);
  stroke: rgba(255, 253, 248, 0.96);
  stroke-linejoin: round;
  stroke-width: 0.9;
}

.tensor-factorization-figure .tensor-left-a-node circle {
  fill: rgba(255, 253, 248, 0.95);
  stroke: rgba(44, 111, 99, 0.34);
  stroke-width: 2;
}

.tensor-factorization-figure .tensor-left-a-node.selected circle {
  fill: var(--tensor-map-fill);
  stroke: var(--tensor-map);
  stroke-width: 2.6;
}

.tensor-factorization-figure .tensor-left-a-node.selected.green circle {
  fill: var(--tensor-map-fill);
  stroke: var(--tensor-map);
}

.tensor-factorization-figure .tensor-right-a-node {
  opacity: 1;
}

.tensor-factorization-figure .tensor-right-a-node circle {
  fill: rgba(255, 253, 248, 0.94);
  stroke: rgba(67, 72, 64, 0.3);
  stroke-width: 2;
}

.tensor-factorization-figure .tensor-right-a-node text {
  fill: rgba(36, 49, 42, 0.68);
}

.tensor-factorization-figure .tensor-neutral-node circle {
  fill: var(--tensor-neutral-fill);
  stroke: var(--tensor-neutral);
  stroke-width: 2.6;
}

.tensor-factorization-figure .tensor-neutral-node text {
  fill: var(--tensor-neutral);
}

.tensor-factorization-figure .tensor-s-node {
  opacity: 1;
}

.tensor-factorization-figure .tensor-s-duplicate-node {
  opacity: 1;
}

.tensor-factorization-figure .tensor-s-node.tensor-s-duplicate-node circle {
  fill: var(--tensor-neutral-fill);
  stroke: var(--tensor-neutral);
  stroke-width: 2.6;
}

.tensor-factorization-figure .tensor-s-node.tensor-s-duplicate-node text {
  fill: var(--tensor-neutral);
}

.tensor-factorization-figure .tensor-s-node circle {
  fill: var(--tensor-subset-fill);
  stroke: var(--tensor-subset);
  stroke-width: 2.8;
}

.tensor-factorization-figure .tensor-s-node text {
  fill: #24312a;
}

.tensor-factorization-figure .tensor-x-node.selected circle {
  fill: var(--tensor-map-fill);
  stroke: var(--tensor-map);
}

.tensor-factorization-figure .tensor-s-duplicate-node,
.tensor-factorization-figure .tensor-s-new-node {
  animation-iteration-count: infinite;
}

.tensor-factorization-figure .tensor-step2-absorbed-node {
  animation: tensor-step2-absorbed-node-stage var(--tensor-cycle) ease-in-out infinite;
}

.tensor-factorization-figure .tensor-step2-late-absorbed-node {
  animation: tensor-step2-late-absorbed-node-stage var(--tensor-cycle) ease-in-out infinite;
}


/* ---------------------------------------------------------------------------
   shared figure primitives (arrows, nodes, lines, labels)
   --------------------------------------------------------------------------- */

.c-red {
  fill: var(--paper-red, #bf4f43);
}

.c-blue {
  fill: var(--paper-blue, #3f7398);
}

.c-green {
  fill: var(--paper-green, #4b8062);
}

.c-orange {
  fill: var(--paper-orange, #cf6a2f);
}

figure[data-figure] .c-red {
  fill: var(--paper-red, #bf4f43);
}

figure[data-figure] .c-blue {
  fill: var(--paper-blue, #3f7398);
}

figure[data-figure] .c-green {
  fill: var(--paper-green, #4b8062);
}

figure[data-figure] .c-orange {
  fill: var(--paper-orange, #cf6a2f);
}


/* ---------------------------------------------------------------------------
   completely-connected - rooted trees and rooted forests
   --------------------------------------------------------------------------- */

figure[data-figure] .connected-top-root {
  fill: var(--paper-gray-soft, #e7e7e2);
  stroke: var(--paper-ink, #1f2721);
}

figure[data-figure] .connected-category-svg-label {
  fill: var(--paper-ink, #1f2721);
}

figure[data-figure] .connected-match .figure-node {
  fill: var(--paper-surface, var(--paper));
  stroke: var(--paper-ink, #1f2721);
}

figure[data-figure] .connected-match[data-connected-left="a"].is-complete .figure-line,
figure[data-figure] .connected-match[data-connected-right="a"].is-complete .figure-line,
figure[data-figure] .connected-match[data-connected-left="a"].is-active .figure-line,
figure[data-figure] .connected-match[data-connected-right="a"].is-active .figure-line,
figure[data-figure] .connected-correspondence-arrow[data-connected-arrow="a"] {
  stroke: var(--paper-teal, #1f8a78);
}

figure[data-figure] .connected-match[data-connected-left="a"].is-complete .figure-node,
figure[data-figure] .connected-match[data-connected-right="a"].is-complete .figure-node,
figure[data-figure] .connected-match[data-connected-left="a"].is-active .figure-node,
figure[data-figure] .connected-match[data-connected-right="a"].is-active .figure-node {
  fill: var(--paper-teal-soft, #e3f2ee);
  stroke: var(--paper-teal, #1f8a78);
}

figure[data-figure] .connected-match[data-connected-left="b"].is-complete .figure-line,
figure[data-figure] .connected-match[data-connected-right="b"].is-complete .figure-line,
figure[data-figure] .connected-match[data-connected-left="b"].is-active .figure-line,
figure[data-figure] .connected-match[data-connected-right="b"].is-active .figure-line,
figure[data-figure] .connected-correspondence-arrow[data-connected-arrow="b"] {
  stroke: var(--paper-blue, #3f7398);
}

figure[data-figure] .connected-match[data-connected-left="b"].is-complete .figure-node,
figure[data-figure] .connected-match[data-connected-right="b"].is-complete .figure-node,
figure[data-figure] .connected-match[data-connected-left="b"].is-active .figure-node,
figure[data-figure] .connected-match[data-connected-right="b"].is-active .figure-node {
  fill: var(--paper-blue-soft, #e5edf3);
  stroke: var(--paper-blue, #3f7398);
}

figure[data-figure] .connected-match[data-connected-left="c"].is-complete .figure-line,
figure[data-figure] .connected-match[data-connected-right="c"].is-complete .figure-line,
figure[data-figure] .connected-match[data-connected-left="c"].is-active .figure-line,
figure[data-figure] .connected-match[data-connected-right="c"].is-active .figure-line,
figure[data-figure] .connected-correspondence-arrow[data-connected-arrow="c"] {
  stroke: var(--paper-orange, #cf6a2f);
}

figure[data-figure] .connected-match[data-connected-left="c"].is-complete .figure-node,
figure[data-figure] .connected-match[data-connected-right="c"].is-complete .figure-node,
figure[data-figure] .connected-match[data-connected-left="c"].is-active .figure-node,
figure[data-figure] .connected-match[data-connected-right="c"].is-active .figure-node {
  fill: var(--paper-orange-soft, #f5e3d4);
  stroke: var(--paper-orange, #cf6a2f);
}


/* ---------------------------------------------------------------------------
   internal-parameterizations - the local state classifier
   --------------------------------------------------------------------------- */

figure[data-figure] .internal-figure-heading,
figure[data-figure] .internal-classifier-symbol {
  color: var(--paper-ink, #1f2721);
  fill: var(--paper-ink, #1f2721);
}

figure[data-figure] .internal-panel-bg {
  fill: rgba(255, 253, 248, 0.72);
  stroke: var(--paper-line, rgba(43, 52, 43, 0.22));
}

figure[data-figure] .internal-graph-node,
figure[data-figure] .internal-piece-dot {
  fill: var(--paper-surface, var(--paper));
  stroke: var(--paper-ink, #1f2721);
}

figure[data-figure] .internal-classifier-node {
  fill: var(--paper-blue-soft, #e5edf3);
  stroke: var(--paper-blue, #3f7398);
}

figure[data-figure] .internal-edge-base,
figure[data-figure] .internal-piece-arrow,
figure[data-figure] .internal-classifier-loop {
  stroke: rgba(31, 39, 33, 0.52);
}

figure[data-figure] .internal-loop-n {
  fill: none;
  stroke: var(--paper-teal, #1f8a78);
}

figure[data-figure] .internal-classifier-caption-nonloop {
  fill: var(--paper-teal, #1f8a78);
  stroke: none;
}

figure[data-figure] .internal-loop-l {
  fill: none;
  stroke: var(--paper-orange, #cf6a2f);
}

figure[data-figure] .internal-classifier-caption-loop {
  fill: var(--paper-orange, #cf6a2f);
  stroke: none;
}


/* ---------------------------------------------------------------------------
   lawvere-first - image factorization of a power set expression
   --------------------------------------------------------------------------- */

figure[data-figure] .tensor-factorization-figure {
  --tensor-map: var(--paper-teal, #1f8a78);
  --tensor-map-fill: var(--paper-teal-soft, #e3f2ee);
  --tensor-subset: var(--paper-orange, #cf6a2f);
  --tensor-subset-fill: var(--paper-orange-soft, #f5e3d4);
  --tensor-neutral: var(--paper-gray, #747872);
  --tensor-neutral-fill: var(--paper-gray-soft, #e7e7e2);
}

figure[data-figure] .tensor-left-a-node text,
figure[data-figure] .tensor-right-a-node text,
figure[data-figure] .tensor-s-node text,
figure[data-figure] .tensor-x-node text {
  fill: var(--paper-ink-strong, #24312a);
}


/* ---------------------------------------------------------------------------
   figure container, loading and error states
   --------------------------------------------------------------------------- */

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}


/* ---------------------------------------------------------------------------
   responsive overrides
   --------------------------------------------------------------------------- */

@media (max-width: 760px) {
  .grundy-controls {
    right: 12px;
    left: 12px;
    justify-content: flex-start;
    max-width: none;
  }

  .grundy-slider input {
    width: min(144px, 32vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .connected-pattern,
  .connected-match,
  .connected-match .figure-line,
  .connected-match .figure-node,
  .connected-correspondence-arrow,
  .connected-top-edge,
  .connected-top-root,
  .grundy-natural-number,
  .grundy-transfer-ball,
  .grundy-mex-water {
    transition: none;
  }

  .connected-correspondence-arrow.is-active,
  .internal-source-graph,
  .internal-classifier-node,
  .internal-piece-dot-vertex,
  .internal-piece-arrow-n,
  .internal-piece-arrow-l,
  .internal-marker-piece-n path,
  .internal-marker-piece-l path,
  .automata-consumed-letter,
  .automata-moving-dot,
  .quotient-guide,
  .quotient-moving-light,
  .grundy-natural-number.is-excluded::after,
  .grundy-natural-number.is-mex,
  .grundy-natural-number.is-mex::before,
  .grundy-natural-number.is-mex::after,
  .grundy-transfer-ball,
  .grundy-node.is-receiving .grundy-node-shell,
  .grundy-node.is-receiving .grundy-value-label,
  .tensor-factorization-figure .tensor-s-new-node,
  .automata-cantor-bouquet-loop,
  .automata-etale-arrow,
  .automata-etale-label,
  .automata-sublocale-arrow,
  .automata-sublocale-label,
  .automata-prefix-poset .automata-cantor-tree-edge,
  .automata-prefix-poset .automata-cantor-node,
  .automata-topos-label,
  .automata-cantor-interval,
  .automata-cantor-connector {
    animation: none;
  }

  .internal-piece {
    display: none;
  }

  .internal-source-graph {
    opacity: 1;
  }

  .internal-classifier-node {
    fill: rgba(47, 95, 145, 0.12);
    stroke: #2f5f91;
  }

  .automata-moving-dot {
    display: none;
  }

  .automata-rolling-bouquet {
    display: none;
  }

  .automata-cantor-bouquet-loop,
  .automata-etale-arrow,
  .automata-etale-label,
  .automata-sublocale-arrow,
  .automata-sublocale-label,
  .automata-prefix-poset .automata-cantor-tree-edge,
  .automata-prefix-poset .automata-cantor-node,
  .automata-topos-label,
  .automata-cantor-interval,
  .automata-cantor-connector {
    opacity: 1;
  }

  .quotient-moving-light {
    display: none;
  }

  .quotient-guide {
    opacity: 0.24;
  }

  .tensor-factorization-figure .tensor-right-a-node,
  .tensor-factorization-figure .tensor-s-new-node,
  .tensor-factorization-figure .tensor-s-node {
    opacity: 1;
  }

  .automata-input-word tspan {
    opacity: 1 !important;
  }

  .automata-consuming-letters {
    display: none;
  }
}


/* ---------------------------------------------------------------------------
   keyframes used by the figures above
   --------------------------------------------------------------------------- */

@keyframes works-dot-bounce {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0) scale(0.86);
  }

  40% {
    opacity: 0.95;
    transform: translateY(-8px) scale(1);
  }
}

@keyframes games-rb-mex-entry {
  0%,
  38% {
    opacity: 0;
  }

  42%,
  100% {
    opacity: 1;
  }
}

@keyframes grundy-transfer-flight {
  0% {
    opacity: 0;
    transform: translate(var(--from-x), var(--from-y)) translate(-50%, -50%) scale(0.72);
  }

  12% {
    opacity: 1;
    transform: translate(var(--from-x), var(--from-y)) translate(-50%, -50%) scale(0.9);
  }

  58% {
    opacity: 1;
    transform: translate(var(--mid-x), var(--mid-y)) translate(-50%, -50%) scale(0.98);
  }

  88% {
    opacity: 1;
    transform: translate(var(--to-x), var(--to-y)) translate(-50%, -50%) scale(0.8);
  }

  100% {
    opacity: 0;
    transform: translate(var(--to-x), var(--to-y)) translate(-50%, -50%) scale(0.68);
  }
}

@keyframes grundy-node-receive {
  0%,
  55% {
    transform: scale(1);
  }

  78% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes grundy-value-receive {
  0%,
  55% {
    opacity: 0.72;
    transform: scale(0.86);
  }

  78% {
    opacity: 1;
    transform: scale(1.18);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes grundy-cross-number {
  from {
    opacity: 0;
    transform: translateY(-50%) scaleX(0.2) rotate(-18deg);
  }

  to {
    opacity: 1;
    transform: translateY(-50%) scaleX(1) rotate(-18deg);
  }
}

@keyframes grundy-mex-pop {
  0% {
    transform: scale(0.96);
  }

  100% {
    transform: scale(1.12);
  }
}

@keyframes grundy-mex-ring {
  from {
    opacity: 0.58;
    transform: scale(0.82);
  }

  to {
    opacity: 0;
    transform: scale(1.34);
  }
}

@keyframes automata-bouquet-loop-unfold {
  0%,
  100% {
    opacity: 1;
    stroke-width: 4.6;
  }

  8%,
  28% {
    opacity: 1;
    stroke-width: 5.9;
  }

  42%,
  50% {
    opacity: 0.68;
    stroke-width: 3.7;
  }

  58% {
    opacity: 1;
    stroke-width: 4.6;
  }
}

@keyframes automata-etale-stage {
  0%,
  10% {
    opacity: 0;
  }

  18%,
  100% {
    opacity: 1;
  }
}

@keyframes automata-sublocale-stage {
  0%,
  52% {
    opacity: 0;
  }

  62%,
  100% {
    opacity: 1;
  }
}

@keyframes automata-cantor-stage-0 {
  0%,
  13% {
    opacity: 0;
  }

  17%,
  100% {
    opacity: 0.58;
  }
}

@keyframes automata-cantor-stage-1 {
  0%,
  23% {
    opacity: 0;
  }

  27%,
  100% {
    opacity: 0.74;
  }
}

@keyframes automata-cantor-stage-2 {
  0%,
  34% {
    opacity: 0;
  }

  38%,
  100% {
    opacity: 0.95;
  }
}

@keyframes automata-cantor-stage-3 {
  0%,
  45% {
    opacity: 0;
  }

  50%,
  100% {
    opacity: 0.95;
  }
}

@keyframes automata-cantor-stage-4 {
  0%,
  55% {
    opacity: 0;
  }

  59%,
  100% {
    opacity: 0.95;
  }
}

@keyframes automata-cantor-connector-stage-1 {
  0%,
  23% {
    opacity: 0;
  }

  27%,
  100% {
    opacity: 1;
  }
}

@keyframes automata-cantor-connector-stage-2 {
  0%,
  34% {
    opacity: 0;
  }

  38%,
  100% {
    opacity: 1;
  }
}

@keyframes automata-cantor-connector-stage-3 {
  0%,
  45% {
    opacity: 0;
  }

  50%,
  100% {
    opacity: 1;
  }
}

@keyframes automata-cantor-connector-stage-4 {
  0%,
  55% {
    opacity: 0;
  }

  59%,
  100% {
    opacity: 1;
  }
}

@keyframes quotient-guide-pulse {
  0%,
  100% {
    opacity: 0.22;
    stroke-width: 5.8;
  }

  38%,
  70% {
    opacity: 0.42;
    stroke-width: 7;
  }
}

@keyframes connected-arrow-flow {
  from {
    stroke-dashoffset: 21;
  }

  to {
    stroke-dashoffset: 0;
  }
}

@keyframes tensor-step2-absorbed-node-stage {
  0%,
  54.03% {
    opacity: 1;
  }

  62.2%,
  100% {
    opacity: 0;
  }
}

@keyframes tensor-step2-late-absorbed-node-stage {
  0%,
  79% {
    opacity: 1;
  }

  79.84%,
  100% {
    opacity: 0;
  }
}

@keyframes tensor-s-new-node-stage {
  0%,
  20.16% {
    opacity: 0;
  }

  25.81%,
  100% {
    opacity: 1;
  }
}
