/* Minimal custom styles for Remark.js presentation */

body {
  font-family: 'Computer Modern Serif', serif;
}

.remark-slide-content {
  font-size: 22px;
  padding: 0em 2em;
}

.remark-slide-content p {
  margin: 0.8em;
}

.remark-slide-content h1 {
  font-size: 40px;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

.remark-slide-content h2 {
  font-size: 36px;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Ensure KaTeX math renders at a comfortable size */
.katex {
  font-size: 1.1em;
}

/* Display math gets a bit of spacing */
.katex-display {
  margin: 0.4em 0;
}

/* Links styling */
a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Small text for subtle notes */
.small {
  font-size: 0.7em;
  color: #666;
  margin-top: 0em;
}

/* Utility: center text */
.centered {
  text-align: center;
}

/* Utility: clear floats */
.clear {
  clear: both;
}

/* Float with text wrap */
.float-right {
  float: right;
  margin-left: 1em;
  margin-bottom: 0.5em;
}

.float-left {
  float: left;
  margin-right: 1em;
  margin-bottom: 0.5em;
}

/* Image sizes */
.img-sm {
  width: 200px;
}

.img-md {
  width: 280px;
}

.img-lg {
  width: 350px;
}

/* ---- Knuth's railway model ---- */
.taocp-railway-figure {
  width: 92%;
  max-width: 1000px;
  box-sizing: border-box;
  margin: 0.8em auto 0;
  padding: 12px 12px 8px;
  background: #fff;
  border: 1px solid #d7e2ec;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(35, 62, 86, 0.16);
}

.taocp-railway-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
}

.taocp-railway-figure figcaption {
  margin-top: 0.4em;
  color: #666;
  font-size: 0.62em;
  line-height: 1.2;
  text-align: right;
}

/* ---- Stack-sorting algorithm ---- */
.algorithm-rules {
  width: 80%;
  margin: 2.4em auto 0;
}

.algorithm-rule {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: baseline;
  padding: 0.75em 0;
  border-bottom: 1px solid #d7e2ec;
}

.algorithm-action {
  color: #0066cc;
  font-size: 1.25em;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.algorithm-stop {
  margin-top: 0.8em;
  color: #53697b;
  text-align: center;
}

.algorithm-takeaway {
  width: 84%;
  margin: 2.2em auto 0;
  padding-top: 0.9em;
  border-top: 3px solid #0066cc;
  font-size: 1.18em;
  text-align: center;
}

/* ---- Stack-word bijection ---- */
.stack-word-bijection {
  width: 84%;
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  align-items: center;
  margin: 1em auto 1.15em;
  text-align: center;
}

.stack-word-side {
  font-size: 1.15em;
  line-height: 1.25;
}

.stack-word-side span {
  display: block;
  margin-top: 0.2em;
  color: #53697b;
  font-size: 0.88em;
}

.stack-word-arrow {
  color: #0066cc;
  font-size: 2em;
  line-height: 1;
}

/* ---- One-stack historical excerpt ---- */
.pattern-slide {
  box-sizing: border-box;
  padding-bottom: 285px;
}

.taocp-figure {
  position: absolute;
  right: 2em;
  bottom: 2.2em;
  left: 2em;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px 8px;
  background: #fff;
  border: 1px solid #d7e2ec;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(35, 62, 86, 0.17);
}

.taocp-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
}

.taocp-figure figcaption {
  margin-top: 0.35em;
  color: #666;
  font-size: 0.62em;
  line-height: 1.2;
  text-align: right;
}

/* ---- Stack-sorting animation ---- */
.machine-slide > p {
  margin: 0.25em 0 0.45em;
  text-align: center;
}

.stack-anim {
  width: 1040px;
  max-width: 100%;
  margin: 0.65em auto 0;
}

.sa-stage {
  position: relative;
  width: 1040px;
  height: 330px;
  margin: 0 auto;
  overflow: hidden;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.98)),
    repeating-linear-gradient(90deg, transparent 0, transparent 74px, rgba(0, 77, 144, 0.025) 75px);
  border: 1px solid #d7e2ec;
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(35, 62, 86, 0.12);
}

.sa-tile {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-family: 'Computer Modern Serif', serif;
  font-size: 25px;
  font-weight: 700;
  color: #17324d;
  background: linear-gradient(180deg, #ffffff, #f5f8fb);
  border: 2px solid #315a7c;
  border-radius: 9px;
  box-shadow:
    inset 0 0 0 40px rgba(0, 86, 166, 0),
    0 5px 10px rgba(28, 55, 80, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    color 700ms ease-out,
    border-color 700ms ease-out,
    box-shadow 700ms ease-out;
  will-change: transform;
}

.sa-tile.is-next {
  border-color: #0066cc;
  box-shadow:
    0 0 0 4px rgba(0, 102, 204, 0.13),
    0 7px 13px rgba(28, 55, 80, 0.15);
}

.sa-tile.is-stack {
  color: #0b4f8c;
  background: linear-gradient(180deg, #f8fbff, #e4f0fb);
  border-color: #0872ce;
}

.sa-tile.is-moving {
  z-index: 8;
  color: #fff;
  border-color: #004d95;
  box-shadow:
    inset 0 0 0 40px rgba(0, 86, 166, 1),
    0 14px 22px rgba(0, 79, 153, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition-duration: 140ms;
  transition-timing-function: ease-in;
}

.sa-well {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  background: linear-gradient(90deg, rgba(0, 102, 204, 0.045), rgba(0, 102, 204, 0.09));
  border: 3px solid #315a7c;
  border-top: none;
  border-radius: 0 0 11px 11px;
  box-shadow: inset 0 -10px 18px rgba(28, 62, 91, 0.07);
}

.sa-zone-label {
  position: absolute;
  z-index: 3;
  font-size: 17px;
  text-align: center;
  color: #53697b;
}

.sa-platform {
  position: absolute;
  z-index: 2;
  height: 13px;
  box-sizing: border-box;
  border-top: 3px solid #6d8497;
  border-right: 2px solid #9aabba;
  border-left: 2px solid #9aabba;
  border-radius: 4px 4px 0 0;
}

.sa-output-platform {
  border-top-color: #4c8d68;
}

/* ---- Two-stack sorting animation ---- */
.two-stack-anim {
  width: 1040px;
  max-width: 100%;
  margin: 0.65em auto 0;
}

.tsa-stage {
  position: relative;
  width: 1040px;
  height: 330px;
  margin: 0 auto;
  overflow: hidden;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.98)),
    repeating-linear-gradient(90deg, transparent 0, transparent 74px, rgba(0, 77, 144, 0.025) 75px);
  border: 1px solid #d7e2ec;
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(35, 62, 86, 0.12);
}

.tsa-tile {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-family: 'Computer Modern Serif', serif;
  font-size: 23px;
  font-weight: 700;
  color: #17324d;
  background: linear-gradient(180deg, #ffffff, #f5f8fb);
  border: 2px solid #315a7c;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 36px rgba(0, 86, 166, 0),
    0 5px 10px rgba(28, 55, 80, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    color 700ms ease-out,
    border-color 700ms ease-out,
    box-shadow 700ms ease-out;
  will-change: transform;
}

.tsa-tile.is-next {
  border-color: #0066cc;
  box-shadow:
    0 0 0 4px rgba(0, 102, 204, 0.13),
    0 7px 13px rgba(28, 55, 80, 0.15);
}

.tsa-tile.is-stack-1 {
  color: #8f2633;
  background: linear-gradient(180deg, #fffafa, #f7e5e8);
  border-color: #c23d4d;
}

.tsa-tile.is-stack-2 {
  color: #0b4f8c;
  background: linear-gradient(180deg, #f8fbff, #e4f0fb);
  border-color: #0872ce;
}

.tsa-tile.is-moving {
  z-index: 8;
  color: #fff;
  border-color: #004d95;
  box-shadow:
    inset 0 0 0 36px rgba(0, 86, 166, 1),
    0 14px 22px rgba(0, 79, 153, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition-duration: 140ms;
  transition-timing-function: ease-in;
}

.tsa-well {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  background: linear-gradient(90deg, rgba(0, 102, 204, 0.045), rgba(0, 102, 204, 0.09));
  border: 3px solid #315a7c;
  border-top: none;
  border-radius: 0 0 11px 11px;
  box-shadow: inset 0 -10px 18px rgba(28, 62, 91, 0.07);
}

.tsa-stack-2-well {
  background: linear-gradient(90deg, rgba(0, 102, 204, 0.045), rgba(0, 102, 204, 0.09));
  border-color: #315a7c;
}

.tsa-stack-1-well {
  background: linear-gradient(90deg, rgba(194, 61, 77, 0.04), rgba(194, 61, 77, 0.1));
  border-color: #9f3440;
}

.tsa-zone-label {
  position: absolute;
  z-index: 3;
  color: #53697b;
  font-size: 17px;
  text-align: center;
}

.tsa-zone-label-l,
.tsa-zone-label-r {
  font-size: 19px;
  font-style: italic;
  font-weight: 700;
}

.tsa-zone-label-l {
  color: #1268bd;
}

.tsa-zone-label-r {
  color: #b52f40;
}

.tsa-platform {
  position: absolute;
  z-index: 2;
  height: 13px;
  box-sizing: border-box;
  border-top: 3px solid #6d8497;
  border-right: 2px solid #9aabba;
  border-left: 2px solid #9aabba;
  border-radius: 4px 4px 0 0;
}

.tsa-output-platform {
  border-top-color: #4c8d68;
}

/* ---- Murphy's basis figures ---- */
.basis-theorem {
  width: 94%;
  margin: 0.45em auto 0.6em !important;
  font-size: 26px;
  line-height: 1.35;
}

.basis-figure-pair {
  width: 94%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 24px;
  margin: 0.25em auto 0;
}

.basis-infinite-figure,
.basis-list-figure {
  box-sizing: border-box;
  margin: 0;
  padding: 10px 12px 8px;
  background: #fff;
  border: 1px solid #d7e2ec;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(35, 62, 86, 0.17);
}

.basis-infinite-figure img {
  width: 100%;
  height: 370px;
  display: block;
  object-fit: contain;
}

.basis-infinite-figure figcaption,
.basis-list-figure figcaption {
  margin-top: 0.35em;
  color: #666;
  font-size: 0.58em;
  line-height: 1.2;
  text-align: right;
}

.basis-list-figure {
  width: 620px;
  max-width: 80%;
  margin: 1.1em auto 0;
}

.basis-list-figure img {
  width: auto;
  max-width: 100%;
  height: 575px;
  display: block;
  margin: 0 auto;
  border-radius: 5px;
}

.murphy-citation-details {
  white-space: nowrap;
}

/* ---- Elder–Waton wager ---- */
.wager-slide h1 {
  margin-bottom: 0.15em;
}

.wager-figure {
  width: 92%;
  max-width: 1000px;
  box-sizing: border-box;
  margin: 0.75em auto 0.65em;
  padding: 10px 12px 8px;
  background: #fff;
  border: 1px solid #d7e2ec;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(35, 62, 86, 0.17);
}

.wager-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
}

.wager-figure figcaption {
  margin-top: 0.35em;
  color: #666;
  font-size: 0.58em;
  line-height: 1.2;
  text-align: right;
}

.wager-citation-details {
  white-space: nowrap;
}

.wager-slide > p {
  margin-top: 0.45em;
  margin-bottom: 0.2em;
}

.wager-slide > ul {
  margin-top: 0.2em;
  margin-bottom: 0;
}

/* ---- Three-stack search and obstruction ---- */
.search-slide h1,
.obstruction-slide h1,
.bet-results-slide h1 {
  margin-bottom: 0.2em;
}

.search-theorem {
  width: 94%;
  margin: 0.35em auto 0.9em !important;
  font-size: 27px;
  line-height: 1.4;
}

.search-attribution {
  width: 90%;
  margin: 1.15em auto 0.4em !important;
  font-size: 25px;
}

.search-directions {
  width: 86%;
  margin: 0.35em auto 0;
  font-size: 27px;
  line-height: 1.45;
}

.search-directions li {
  margin: 0.95em 0;
}

.obstruction-result {
  width: 92%;
  margin: 0.3em auto 0.15em !important;
  font-size: 23px;
  line-height: 1.35;
  text-align: left;
}

.obstruction-plot-wrap {
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.obstruction-plot {
  width: 420px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  overflow: visible;
}

.obstruction-grid line {
  stroke: #d8e2eb;
  stroke-width: 0.9;
}

.obstruction-points circle {
  fill: #17324d;
  stroke: #fff;
  stroke-width: 2;
}

.obstruction-permutation {
  width: 96%;
  margin: 0.05em auto 0 !important;
  color: #24394c;
  font-size: 22px;
  text-align: center;
  white-space: nowrap;
}

.bet-results-question {
  width: 92%;
  margin: 0.45em auto 0 !important;
  font-size: 25px;
  line-height: 1.3;
  text-align: center;
}

.bet-results-slide > ul {
  width: 88%;
  margin: 0.6em auto 0;
  font-size: 28px;
  line-height: 1.4;
}

.bet-results-slide > ul li {
  margin: 0.85em 0;
}

.bet-results-verdict {
  width: 88%;
  margin: 0.45em auto 0 !important;
  padding-top: 0.45em;
  border-top: 3px solid #d1dde7;
  color: #17324d;
  font-size: 29px;
  text-align: center;
}

.remaining-lengths {
  width: 88%;
  margin: 0.8em auto 0;
  padding-top: 0.75em;
  border-top: 3px solid #d1dde7;
  text-align: center;
}

.remaining-lengths p {
  margin: 0.25em 0 !important;
  font-size: 23px;
}

.remaining-lengths > div {
  margin: 0.2em 0;
  color: #17324d;
  font-size: 32px;
}

/* ---- Knuth interlude ---- */
.interlude-slide h1 {
  margin: 0.45em 0 0.1em;
}

.interlude-slide > .small {
  display: block;
  margin-top: 0.1em;
}

.knuth-open-problem-figure {
  width: 88%;
  max-width: 920px;
  box-sizing: border-box;
  margin: 1em auto 0;
  padding: 12px 12px 8px;
  background: #fff;
  border: 1px solid #d7e2ec;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(35, 62, 86, 0.16);
}

.knuth-open-problem-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
}

.knuth-open-problem-figure figcaption {
  margin-top: 0.4em;
  color: #666;
  font-size: 0.62em;
  line-height: 1.2;
  text-align: right;
}

.interlude-bound {
  width: 90%;
  margin: 0.85em auto 0 !important;
  color: #17324d;
  font-size: 27px;
  text-align: center;
}

.interlude-question {
  margin: 0.25em auto 0 !important;
  color: #17324d;
  font-size: 30px;
  font-style: italic;
  text-align: center;
}

.thank-you-reveal {
  margin: 1.35em auto 0;
  color: #17324d;
  font-size: 42px;
  font-weight: 700;
  text-align: center;
}

.bet-results-slide .thank-you-reveal {
  margin-top: 0.55em;
  font-size: 38px;
}

/* ---- Three-stack sorting animation ---- */
.three-stack-slide h1 {
  margin-bottom: 0.25em;
}

.three-stack-anim {
  width: 1040px;
  max-width: 100%;
  margin: 0.65em auto 0;
}

.thsa-stage {
  position: relative;
  width: 1040px;
  height: 330px;
  margin: 0 auto;
  overflow: hidden;
  box-sizing: border-box;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.98)),
    repeating-linear-gradient(90deg, transparent 0, transparent 74px, rgba(0, 77, 144, 0.025) 75px);
  border: 1px solid #d7e2ec;
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(35, 62, 86, 0.12);
}

.thsa-tile {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-family: 'Computer Modern Serif', serif;
  font-size: 23px;
  font-weight: 700;
  color: #17324d;
  background: linear-gradient(180deg, #ffffff, #f5f8fb);
  border: 2px solid #315a7c;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 36px rgba(0, 86, 166, 0),
    0 5px 10px rgba(28, 55, 80, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    color 700ms ease-out,
    border-color 700ms ease-out,
    box-shadow 700ms ease-out;
  will-change: transform;
}

.thsa-tile.is-next {
  border-color: #0066cc;
  box-shadow:
    0 0 0 4px rgba(0, 102, 204, 0.13),
    0 7px 13px rgba(28, 55, 80, 0.15);
}

.thsa-tile.is-stack-1 {
  color: #0b4f8c;
  background: linear-gradient(180deg, #f8fbff, #e4f0fb);
  border-color: #0872ce;
}

.thsa-tile.is-stack-2 {
  color: #5f4384;
  background: linear-gradient(180deg, #fdfaff, #eee7f7);
  border-color: #8060ad;
}

.thsa-tile.is-stack-3 {
  color: #8f2633;
  background: linear-gradient(180deg, #fffafa, #f7e5e8);
  border-color: #c23d4d;
}

.thsa-tile.is-moving {
  z-index: 8;
  color: #fff;
  border-color: #004d95;
  box-shadow:
    inset 0 0 0 36px rgba(0, 86, 166, 1),
    0 14px 22px rgba(0, 79, 153, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition-duration: 140ms;
  transition-timing-function: ease-in;
}

.thsa-well {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  border: 3px solid #315a7c;
  border-top: none;
  border-radius: 0 0 11px 11px;
  box-shadow: inset 0 -10px 18px rgba(28, 62, 91, 0.07);
}

.thsa-stack-1-well {
  background: linear-gradient(90deg, rgba(0, 102, 204, 0.045), rgba(0, 102, 204, 0.09));
  border-color: #315a7c;
}

.thsa-stack-2-well {
  background: linear-gradient(90deg, rgba(128, 96, 173, 0.04), rgba(128, 96, 173, 0.1));
  border-color: #6e5494;
}

.thsa-stack-3-well {
  background: linear-gradient(90deg, rgba(194, 61, 77, 0.04), rgba(194, 61, 77, 0.1));
  border-color: #9f3440;
}

.thsa-zone-label {
  position: absolute;
  z-index: 3;
  color: #53697b;
  font-size: 17px;
  text-align: center;
}

.thsa-stack-label {
  font-size: 19px;
  font-weight: 700;
}

.thsa-stack-label-1 {
  color: #1268bd;
}

.thsa-stack-label-2 {
  color: #6e5494;
}

.thsa-stack-label-3 {
  color: #b52f40;
}

.thsa-platform {
  position: absolute;
  z-index: 2;
  height: 13px;
  box-sizing: border-box;
  border-top: 3px solid #6d8497;
  border-right: 2px solid #9aabba;
  border-left: 2px solid #9aabba;
  border-radius: 4px 4px 0 0;
}

.thsa-output-platform {
  border-top-color: #4c8d68;
}

/* ---- Live cohabitation graphs ---- */
.boolean-encoding-slide h1 {
  margin-top: 0.25em;
  margin-bottom: 0.2em;
}

.two-stack-encoding-anim {
  margin-top: 0;
}

.relation-definitions {
  width: 1040px;
  max-width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 auto 0.35em;
  color: #43596b;
  font-size: 24px;
  line-height: 1.25;
  text-align: center;
}

.relation-symbol {
  font-size: 1.08em;
  font-weight: 700;
}

.relation-definition-l .relation-symbol {
  color: #1268bd;
}

.relation-definition-r .relation-symbol {
  color: #b52f40;
}

/* ---- Murphy's constraint families ---- */
.constraint-system {
  width: 1000px;
  max-width: 100%;
  margin: 0.9em auto 0;
  border-top: 3px solid #d1dde7;
  border-bottom: 3px solid #d1dde7;
}

.constraint-row {
  display: grid;
  grid-template-columns: 205px 1fr;
  align-items: center;
  min-height: 118px;
  padding: 12px 0;
  border-top: 1px solid #dbe4ec;
}

.constraint-row:first-child {
  border-top: 0;
}

.constraint-heading {
  color: #17324d;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.constraint-cnf {
  display: block;
  margin-top: 0.35em;
  color: #6a7d8e;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.constraint-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 34px;
}

.constraint-form {
  color: #24394c;
  font-size: 23px;
  text-align: center;
}

.constraint-domain {
  display: block;
  margin-bottom: 0.35em;
  color: #697b8b;
  font-size: 17px;
}

.constraint-math {
  display: block;
  color: #24394c;
  white-space: nowrap;
}

.constraint-paired-forms {
  grid-template-columns: 1fr;
  gap: 12px;
}

.constraint-paired-forms .constraint-form {
  display: grid;
  grid-template-columns: 230px 1fr;
  align-items: center;
}

.constraint-paired-forms .constraint-domain {
  margin-bottom: 0;
  padding-right: 18px;
  text-align: right;
  white-space: nowrap;
}

.constraint-paired-forms .constraint-math {
  text-align: center;
}

.constraint-consequence {
  margin: 0.75em auto 0;
  color: #24394c;
  font-size: 23px;
  text-align: center;
}

/* ---- Murphy's exact formula and conjecture ---- */
.murphy-formula-slide > p {
  width: 90%;
  margin: 0.55em auto;
  text-align: left;
}

.murphy-quote-figure {
  width: 800px;
  max-width: 80%;
  box-sizing: border-box;
  margin: 1.1em auto 0;
  padding: 10px 12px 8px;
  background: #fff;
  border: 1px solid #d7e2ec;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(35, 62, 86, 0.17);
}

.murphy-quote-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
}

.murphy-quote-figure figcaption {
  margin-top: 0.35em;
  color: #666;
  font-size: 0.58em;
  line-height: 1.2;
  text-align: right;
}

/* ---- Murphy counterexamples ---- */
.counterexample-result {
  width: 92%;
  margin: 0.55em auto 0.8em !important;
  font-size: 25px;
  text-align: left;
}

.counterexample-table {
  width: 94%;
  margin: 0 auto;
  border-collapse: collapse;
  border-top: 3px solid #d1dde7;
  border-bottom: 3px solid #d1dde7;
  color: #24394c;
  font-size: 23px;
}

.counterexample-table tr + tr {
  border-top: 1px solid #dbe4ec;
}

.counterexample-table td {
  padding: 10px 6px;
  text-align: center;
  white-space: nowrap;
}

.counterexample-table td:first-child,
.counterexample-table td:last-child {
  width: 50%;
}

.counterexample-conclusion {
  width: 92%;
  margin: 0.8em auto 0 !important;
  color: #24394c;
  font-size: 23px;
  text-align: center;
}

/* ---- The exact ending-in-one case ---- */
.ending-one-theorem {
  width: 88%;
  margin: 2.5em auto 0 !important;
  font-size: 28px;
  line-height: 1.45;
}

.ending-one-work {
  width: 88%;
  box-sizing: border-box;
  margin: 2.7em auto 0;
  padding-top: 1em;
  border-top: 3px solid #d1dde7;
  font-size: 27px;
  line-height: 1.4;
}

.ending-one-work strong {
  color: #17324d;
}

.tsa-stage.has-graphs {
  height: 425px;
}

.two-stack-encoding-anim .sa-controls {
  margin-top: 10px;
}

.tsa-graph-row {
  position: absolute;
  top: 4px;
  right: 0;
  left: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  box-sizing: border-box;
  padding: 0 45px;
}

.tsa-graph {
  width: 280px;
}

.tsa-graph-title {
  height: 20px;
  font-family: 'Computer Modern Serif', serif;
  font-size: 20px;
  font-style: italic;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.tsa-graph-l .tsa-graph-title {
  color: #1268bd;
}

.tsa-graph-r .tsa-graph-title {
  color: #b52f40;
}

.tsa-graph-svg {
  display: block;
  width: 280px;
  height: 280px;
  margin: 0 auto;
  overflow: visible;
}

.tsa-grid-line {
  stroke: #d8e2eb;
  stroke-width: 0.7;
}

.tsa-axis-label {
  fill: #6a7d8e;
  font-family: 'Computer Modern Serif', serif;
  font-size: 10px;
}

.tsa-graph-edge {
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  transition: stroke-dashoffset 240ms ease-out, opacity 120ms ease-out;
}

.tsa-graph-edge.is-visible {
  stroke-dashoffset: 0;
  opacity: 0.78;
}

.tsa-graph-l .tsa-graph-edge {
  stroke: #1474cf;
}

.tsa-graph-r .tsa-graph-edge {
  stroke: #c43c4c;
}

.tsa-graph-point {
  fill: #24394c;
  stroke: #fff;
  stroke-width: 1.4;
}

.sa-live-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sa-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  text-align: center;
}

.sa-button {
  position: relative;
  width: 42px;
  height: 42px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Symbol", sans-serif;
  font-size: 20px;
  line-height: 1;
  padding: 0;
  border: 1.5px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.sa-button-play.is-pause::before,
.sa-button-play.is-pause::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 4px;
  height: 14px;
  background: currentColor;
  transform: translateY(-50%);
}

.sa-button-play.is-pause::before {
  left: 15px;
}

.sa-button-play.is-pause::after {
  right: 15px;
}

.sa-button-play {
  color: #fff;
  background: #0066cc;
  border-color: #0066cc;
  box-shadow: 0 4px 10px rgba(0, 102, 204, 0.18);
}

.sa-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.sa-button-play:hover:not(:disabled) {
  background: #0056ad;
  box-shadow: 0 6px 14px rgba(0, 102, 204, 0.24);
}

.sa-button:focus-visible {
  outline: 3px solid rgba(0, 102, 204, 0.25);
  outline-offset: 2px;
}

.sa-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.sa-error {
  margin: 2em auto;
  color: #a02d2d;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .sa-button {
    transition: none;
  }
}
