/* ---------- Motion on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition:
      opacity 0.9s var(--ease),
      transform 0.9s var(--ease);
  }
  .js .reveal.seen {
    opacity: 1;
    transform: none;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgb(245 192 74 / 0.24);
  border-radius: 99rem;
  background: rgb(10 14 24 / 0.72);
  font: 500 0.6875rem/1.3 var(--mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--soft);
}
.pill i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--faint);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr));
  border-top: 1px solid var(--line);
}
.stats li {
  border-left: 1px solid var(--line);
}
.stats li:first-child {
  border-left: 0;
}
.stats li:first-child a {
  padding-left: 0;
}
.stats a {
  display: block;
  height: 100%;
  padding: 1.5rem 1.3rem 1.8rem;
}
.stats a:hover strong {
  color: #fff;
}
.stats b {
  display: block;
  font-size: clamp(2rem, 3vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
}
.stats strong {
  display: block;
  margin: 0.5rem 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 650;
  color: #8bdcf7;
}
.stats span {
  display: block;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
@media (min-width: 600px) and (max-width: 1099px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats li:nth-child(3n + 1) {
    border-left: 0;
  }
  .stats li:nth-child(3n + 1) a {
    padding-left: 0;
  }
  .stats li:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 599px) {
  .stats li {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .stats a {
    display: grid;
    grid-template-columns: 5.2rem 1fr;
    column-gap: 1rem;
    padding: 1rem 0;
  }
  .stats b {
    grid-row: span 2;
  }
  .stats strong {
    margin: 0.1rem 0 0;
  }
  .stats a > span {
    grid-column: 2;
  }
}

/* ---------- Chapters and sections ---------- */
.chapter {
  position: relative;
  border-top: 1px solid var(--line);
}
.opener {
  position: relative;
  overflow: clip;
  background: radial-gradient(
    70rem 34rem at 12% 0%,
    color-mix(in srgb, var(--chapter) 9%, transparent),
    transparent 70%
  );
}
.opener > .wrap {
  padding-block: clamp(5rem, 11vw, 9.5rem) clamp(3rem, 6vw, 5rem);
  scroll-margin-top: 2rem;
}
.opener .lede {
  max-width: 43rem;
  margin-top: 1.5rem;
}
.kick.small {
  margin-bottom: 0.9rem;
  color: var(--muted);
}
.kick.small .joint {
  --c: var(--chapter);
}
.kick.small .num {
  color: var(--chapter);
  letter-spacing: 0.04em;
}
.kick.small i {
  width: 1.8rem;
  height: 1px;
  background: var(--line-2);
}
.chapter em.g {
  color: var(--chapter);
}
.opener-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.1rem;
}
.opener-index a {
  display: block;
  padding: 0.5rem 1rem;
  border: 1px solid color-mix(in srgb, var(--chapter) 26%, transparent);
  border-radius: 99rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: color-mix(in srgb, var(--chapter) 30%, #fff);
  transition:
    border-color 0.2s,
    background-color 0.2s;
}
.opener-index a:hover {
  border-color: var(--chapter);
  background: color-mix(in srgb, var(--chapter) 10%, transparent);
}
@media (max-width: 899px) {
  .opener-index {
    display: none;
  }
}
.sec {
  position: relative;
  padding-block: clamp(3rem, 5.6vw, 5.2rem);
  border-top: 1px solid var(--line);
  scroll-margin-top: -1.8rem;
}
/* One left edge: the name of the section, what it is, and then the thing itself. */
.sec-head.wide {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.9rem 3rem;
  margin-bottom: clamp(1.6rem, 3vw, 2.6rem);
}
.sec-head.wide > div {
  flex: 1 1 34rem;
  min-width: 0;
}
.sec-head.wide .kicker {
  margin-top: 1rem;
}
.sec-head.wide .more {
  flex: none;
  margin: 0;
}
.kicker {
  max-width: 46rem;
  font-size: clamp(1.06rem, 1.4vw, 1.26rem);
  line-height: 1.55;
  letter-spacing: -0.011em;
  color: var(--soft);
  text-wrap: pretty;
}
.split-grid {
  display: grid;
  gap: 2rem clamp(2.4rem, 6vw, 6rem);
}
.split .kicker {
  margin-top: 1.1rem;
}
@media (min-width: 1000px) {
  .split-grid {
    grid-template-columns: minmax(0, 4.4fr) minmax(0, 7.6fr);
  }
  .split .sec-head {
    position: sticky;
    top: 7.5rem;
    align-self: start;
  }
}
.sec-body {
  min-width: 0;
}
.sec-body > * + * {
  margin-top: 1.6rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  padding: 0.25rem 0;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: color-mix(in srgb, var(--chapter) 62%, #fff);
  transition: color 0.2s;
}
.more svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.35s var(--ease);
}
.more:hover {
  color: #fff;
}
.more:hover svg {
  transform: translateX(0.25rem);
}

/* ---------- Figures ---------- */
.sec .fig {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 1.4rem;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.022), transparent 14rem), rgb(7 11 20 / 0.86);
  overflow: hidden;
  /* Unlike hidden, clip is not a scroll container, so things inside can stick to the screen. */
  overflow: clip;
}
.sec .fig::before,
.sec .fig::after {
  content: "";
  position: absolute;
  top: 0.65rem;
  width: 0.6rem;
  height: 0.6rem;
  border: solid var(--line-3);
  border-width: 1px 0 0 1px;
  pointer-events: none;
}
.sec .fig::before {
  left: 0.65rem;
}
.sec .fig::after {
  right: 0.65rem;
  transform: scaleX(-1);
}
.fig-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem 1.4rem;
  padding: clamp(1.2rem, 2.4vw, 1.9rem) var(--inset) 0;
}
.todo {
  font-size: clamp(1rem, 1.3vw, 1.14rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #fff;
}
.tagged {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.34rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--chapter) 30%, transparent);
  border-radius: 99rem;
  background: color-mix(in srgb, var(--chapter) 8%, transparent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: color-mix(in srgb, var(--chapter) 55%, #fff);
}
.tagged.live::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--chapter);
  box-shadow: 0 0 10px var(--chapter);
}
.tagged.example {
  border-color: var(--line-2);
  background: none;
  color: var(--soft);
}

.fig-body {
  padding: clamp(1.2rem, 2.4vw, 1.9rem) var(--inset);
  min-width: 0;
}
.fig-body > * + * {
  margin-top: 1.3rem;
}
.js .fig:not([data-ready]) > .fig-body {
  min-height: var(--hp, auto);
}
@media (min-width: 640px) {
  .js .fig:not([data-ready]) > .fig-body {
    min-height: var(--ht, auto);
  }
}
@media (min-width: 1000px) {
  .js .fig:not([data-ready]) > .fig-body {
    min-height: var(--hd, auto);
  }
}
.fig-foot {
  padding: 0.95rem var(--inset) 1.05rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Controls ---------- */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  max-width: 100%;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.28);
}
.seg button {
  min-height: 2.5rem;
  padding: 0.3rem 0.95rem;
  border: 0;
  border-radius: 0.78rem;
  background: none;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--muted);
  transition:
    background-color 0.2s,
    color 0.2s;
}
.seg button:hover {
  color: #fff;
}
.seg button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--chapter) 17%, transparent);
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chapter) 42%, transparent);
}
@media (max-width: 640px) {
  .seg {
    display: flex;
  }
  .seg button {
    flex: 1 1 auto;
    min-height: 2.75rem;
    padding-inline: 0.65rem;
  }
}
.controls {
  display: grid;
  gap: 1rem 1.8rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.controls.stack {
  grid-template-columns: 1fr;
}
.range {
  display: block;
}
.range > span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.86rem;
  color: var(--soft);
}
.range b {
  font-weight: 600;
}
.range output {
  font: 500 0.86rem/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
}
input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 2.2rem;
  margin: 0;
  background: none;
  cursor: pointer;
  touch-action: pan-y;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 9px;
  background: linear-gradient(
    90deg,
    var(--chapter) var(--p, 50%),
    rgb(190 210 240 / 0.15) var(--p, 50%)
  );
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 9px;
  background: linear-gradient(
    90deg,
    var(--chapter) var(--p, 50%),
    rgb(190 210 240 / 0.15) var(--p, 50%)
  );
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: calc(-0.625rem + 2px);
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1.5px var(--chapter);
  transition: transform 0.2s;
}
input[type="range"]::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1.5px var(--chapter);
}
input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.15);
}
.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.6rem;
  padding: 0.3rem 0.95rem 0.3rem 0.75rem;
  border: 1px solid var(--line-2);
  border-radius: 99rem;
  background: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--soft);
  transition:
    border-color 0.2s,
    background-color 0.2s;
}
.toggle i {
  position: relative;
  width: 1.9rem;
  height: 1.1rem;
  border-radius: 99rem;
  background: rgb(190 210 240 / 0.16);
  transition: background-color 0.2s;
}
.toggle i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.1rem - 4px);
  height: calc(1.1rem - 4px);
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s var(--ease);
}
.toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--chapter) 55%, transparent);
  background: color-mix(in srgb, var(--chapter) 9%, transparent);
  color: #fff;
}
.toggle[aria-pressed="true"] i {
  background: var(--chapter);
}
.toggle[aria-pressed="true"] i::after {
  transform: translateX(0.8rem);
}
.btnrow,
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
button.tag {
  background: none;
  min-height: 2.2rem;
}
button.tag:hover,
button.tag[aria-pressed="true"] {
  border-color: var(--chapter);
  color: #fff;
}
.reads {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}
.read {
  padding: 0.85rem 1rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.22);
}
.read small,
.verdicts small {
  display: block;
  font-size: 0.78rem;
  color: var(--faint);
}
.read b {
  display: block;
  margin-top: 0.15rem;
  font: 500 1.3rem/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.read span {
  display: block;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.legend li::before {
  content: "";
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.5rem;
  border-radius: 0.2rem;
  background: var(--k);
}
.k-ok {
  --k: var(--ok);
}
.k-refuse {
  --k: var(--refuse);
}
.k-debit {
  --k: var(--debit);
}
.k-credit {
  --k: var(--credit);
}
.k-known {
  --k: var(--known);
}
.verdicts {
  display: grid;
  gap: 0.1rem;
}
.verdicts p {
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  line-height: 1.4;
}
.verdicts b {
  font-size: 0.96rem;
  font-weight: 650;
  color: var(--k, #fff);
}
.verdicts .main b {
  font-size: 1.15rem;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font: 400 0.78rem/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}
.data th {
  padding: 0.4rem 0.6rem 0.4rem 0;
  text-align: left;
  font-weight: 500;
  color: var(--faint);
  border-bottom: 1px solid var(--line-2);
}
.data td {
  padding: 0.34rem 0.6rem 0.34rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  white-space: nowrap;
}
.plot svg,
svg.chart {
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart text {
  font: 500 11px var(--mono);
  fill: var(--muted);
}
.chart .label {
  font: 600 12.5px var(--sans);
  fill: #fff;
}
.chart .axis {
  stroke: var(--line-2);
  fill: none;
}
.chart .grid {
  stroke: var(--line);
  fill: none;
}
.chart .ten {
  stroke: var(--credit);
  stroke-dasharray: 5 5;
  fill: none;
}

/* ---------- Closing ---------- */
.libcta {
  position: relative;
  overflow: clip;
  border-top: 1px solid var(--line);
  padding-block: clamp(5rem, 11vw, 9rem);
}
.libcta .lede {
  max-width: 44rem;
  margin-top: 1.4rem;
}
.libcta .paths {
  margin-top: clamp(2.4rem, 5vw, 4rem);
}
.noscript {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 0.8rem;
  color: var(--soft);
  font-size: 0.9rem;
}


/* ---------- FrankenAccounting: shared pieces ---------- */
.btn.ghost {
  background: none;
}
@media (max-width: 1099px) {
  .tools .plan {
    display: none;
  }
}
.fig-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
/* Which crate computed what a figure shows. */
.src {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--line-2);
  border-radius: 99rem;
  font: 500 0.72rem/1.2 var(--mono);
  color: var(--soft);
  cursor: help;
}
.src i {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--debit), var(--credit));
}
.tagged.registry {
  border-color: var(--line-2);
  background: none;
  color: var(--soft);
}
/* What runs today and what the plan still has to land. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.12rem 0.55rem;
  border-radius: 0.45rem;
  font: 600 0.7rem/1.5 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 0.12em;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}
.status.today {
  color: var(--ok);
  background: rgb(74 222 128 / 0.1);
}
.status.target {
  color: var(--credit);
  background: rgb(245 192 74 / 0.1);
}
.status.design {
  color: var(--known);
  background: rgb(167 139 250 / 0.12);
}
.chapters .num,
.kick .num {
  font-family: var(--mono);
  color: var(--chapter);
}
.kick .num {
  margin-right: 0.2rem;
}
/* A lattice of ruled ledger lines behind the big moments. */
.lattice {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgb(190 210 240 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(190 210 240 / 0.035) 1px, transparent 1px);
  background-size: 100% 2.2rem, 11rem 100%;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
}
.verdict-main.ok b,
.ok-text {
  color: var(--ok);
}
.verdict-main.no b,
.no-text {
  color: var(--refuse);
}
code.k {
  padding: 0.08rem 0.4rem;
  border-radius: 0.35rem;
  background: rgb(255 255 255 / 0.06);
  color: #fff;
}
.dr-text {
  color: var(--debit);
}
.cr-text {
  color: var(--credit);
}
/* A data card: monospace rows in a dark well. */
.well {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.28);
  padding: 0.9rem 1rem;
  font: 400 0.8rem/1.6 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--soft);
  overflow-x: auto;
}
.fine {
  margin-top: 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- Thesis ---------- */
.thesis {
  position: relative;
  padding-block: clamp(4rem, 8vw, 7rem) clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
}
.thesis .kicker {
  margin-top: 1.2rem;
  max-width: 52rem;
}
.composition {
  display: grid;
  gap: 1.4rem;
}
.comp-art {
  width: 100%;
  height: auto;
  overflow: visible;
}
.comp-art text {
  font: 500 11px var(--mono);
  fill: var(--muted);
}
.comp-art text.nm {
  font: 600 12.5px var(--sans);
  fill: var(--soft);
  transition: fill 0.2s;
}
.comp-art text.nm.on {
  fill: #fff;
}
.comp-art text.sink {
  font: 700 17px var(--sans);
  letter-spacing: -0.02em;
  fill: #fff;
}
.comp-art .dot {
  transition: r 0.2s;
}
.comp-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 0.5rem;
}
.comp-list a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.1rem 0.7rem;
  height: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgb(0 0 0 / 0.2);
  transition:
    border-color 0.2s,
    background-color 0.2s;
}
.comp-list li.on a,
.comp-list a:hover {
  border-color: rgb(245 192 74 / 0.5);
  background: rgb(245 192 74 / 0.06);
}
.comp-list .num {
  grid-row: span 3;
  font-size: 0.78rem;
  color: var(--credit);
  padding-top: 0.15rem;
}
.comp-list b {
  font-size: 0.95rem;
  font-weight: 650;
  color: #fff;
  letter-spacing: -0.01em;
}
.comp-list small {
  font-size: 0.76rem;
  color: var(--faint);
}
.comp-list .gives {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--soft);
}

/* ---------- Closing ---------- */
.install {
  margin-top: 2rem;
  max-width: 52rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.35);
  font: 400 0.84rem/1.75 var(--mono);
  color: #e8eef7;
  overflow-x: auto;
}
.install .c {
  color: var(--faint);
}
.missing {
  padding-block: 10rem 8rem;
}
.missing .lede {
  margin-top: 1.4rem;
  max-width: 36rem;
}

/* ---------- Form fields and JSON wells (shared by every chapter) ---------- */
.field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.field > span {
  font: 600 0.66rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.field input,
.field select,
.field textarea,
.fig select,
.fig input:not([type="range"]) {
  min-height: 2.5rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line-2);
  border-radius: 0.7rem;
  background: rgb(0 0 0 / 0.32);
  color: #fff;
  font: 500 0.86rem/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.fig select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 1.8rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 0.95rem) 55%,
    calc(100% - 0.65rem) 55%;
  background-size:
    0.3rem 0.3rem,
    0.3rem 0.3rem;
  background-repeat: no-repeat;
}
.fig select:focus-visible,
.fig input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--chapter) 70%, transparent);
  outline-offset: 1px;
}
.well .k {
  color: #9fb4d9;
}
.well .s {
  color: #fde68a;
}
.well .n {
  color: var(--debit);
}
.well .b {
  color: var(--known);
}

/* The chapter's number, large and outlined, beside its opener. */
@media (min-width: 1100px) {
  .opener .reveal {
    max-width: calc(100% - min(19vw, 18rem));
  }
  .opener .wrap {
    position: relative;
  }
  .opener .wrap::after {
    content: attr(data-num);
    position: absolute;
    right: var(--gutter);
    top: 50%;
    transform: translateY(-50%);
    font: 800 clamp(10rem, 17vw, 16rem)/0.8 var(--sans);
    letter-spacing: -0.08em;
    color: transparent;
    -webkit-text-stroke: 1.5px color-mix(in srgb, var(--chapter) 45%, transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--chapter) 22%, transparent), transparent 75%);
    -webkit-background-clip: text;
    background-clip: text;
    pointer-events: none;
  }
}

/* ---------- 00-hero.css ---------- */
/* The hero: copy beside the T-account orbit, the console under both. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: clip;
  padding-top: calc(4.25rem + env(safe-area-inset-top));
  background:
    radial-gradient(60rem 36rem at 78% 18%, rgb(245 192 74 / 0.08), transparent 70%),
    radial-gradient(54rem 40rem at 18% 70%, rgb(76 201 240 / 0.07), transparent 70%),
    var(--ink);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgb(190 210 240 / 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(190 210 240 / 0.03) 1px, transparent 1px);
  background-size: 100% 2.2rem, 9rem 100%;
  mask-image: radial-gradient(ellipse 90% 80% at 60% 40%, #000 25%, transparent 80%);
}
.hero-grid {
  position: relative;
  display: grid;
  gap: 1rem 2rem;
  align-items: center;
  padding-top: clamp(2.2rem, 6vw, 4.5rem);
}
@media (min-width: 1080px) {
  .hero-grid {
    grid-template-columns: minmax(0, 5.1fr) minmax(0, 6.9fr);
  }
}
.hero-copy .lede {
  max-width: 38rem;
  margin-top: 1.6rem;
}
.hero .pill {
  margin-bottom: 1.6rem;
}
.hero .d1 span {
  display: inline-block;
}
.orbit {
  position: relative;
  min-width: 0;
}
.orbit canvas {
  width: 100%;
  height: clamp(400px, 44vw, 580px);
}
@media (max-width: 1079px) {
  .orbit canvas {
    height: clamp(460px, 118vw, 560px);
  }
}
/* The journal, newest first, along the foot of the orbit. */
.orbit-tb {
  position: absolute;
  inset: auto 0 0;
  pointer-events: none;
  mask-image: linear-gradient(90deg, #000 70%, transparent);
}
.orbit-tb .micro {
  margin-bottom: 0.35rem;
  font-size: 0.62rem;
}
.orbit-tb ol {
  display: flex;
  gap: 0.45rem;
  overflow: hidden;
}
.orbit-tb li {
  flex: none;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: rgb(6 10 18 / 0.82);
  font: 500 0.66rem/1.45 var(--mono);
  color: var(--muted);
}
.orbit-tb li:first-child {
  border-color: rgb(245 192 74 / 0.35);
}
.orbit-tb .num {
  color: #fff;
}
.orbit-tb .c {
  color: var(--faint);
}
.orbit-tb .legs {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
}
.orbit-tb i {
  font-style: normal;
}
.orbit-tb i.dr {
  color: #8bdcf7;
}
.orbit-tb i.cr {
  color: #fcd98a;
  padding-left: 1.2em;
}
@media (max-width: 699px) {
  .orbit-tb {
    display: none;
  }
}

.console-wrap {
  position: relative;
  z-index: 3;
  padding-block: 1rem 1.6rem;
}
.console {
  position: relative;
  display: grid;
  gap: 1.2rem 1.6rem;
  padding: 1.15rem 1.25rem 1.3rem;
  border: 1px solid var(--line-2);
  border-radius: 1.4rem;
  background: linear-gradient(180deg, rgb(14 22 38 / 0.85), rgb(6 10 18 / 0.9));
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.06),
    0 30px 80px -30px #000;
}
@media (min-width: 1080px) {
  .console {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.45fr) minmax(0, 0.9fr);
    align-items: start;
  }
}
.console .micro {
  margin-bottom: 0.6rem;
}
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.preset {
  min-height: 2.4rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 0.8rem;
  background: rgb(255 255 255 / 0.025);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--soft);
  transition:
    border-color 0.2s,
    background-color 0.2s,
    color 0.2s;
}
.preset:hover {
  color: #fff;
  border-color: var(--line-3);
}
.preset.on {
  color: #fff;
  border-color: rgb(245 192 74 / 0.6);
  background: rgb(245 192 74 / 0.1);
}
.verdict {
  min-height: 7.5rem;
}
.verdict-main {
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--soft);
}
.verdict-main code {
  padding: 0.05rem 0.4rem;
  border-radius: 0.35rem;
  background: rgb(251 113 133 / 0.12);
  color: #fecdd3;
  font-size: 0.86em;
}
.verdict-why {
  margin-top: 0.45rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}
.verdict-why span {
  display: inline-block;
  min-width: 2.6rem;
  margin-right: 0.4rem;
  font: 600 0.66rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.tally {
  font-size: 0.95rem;
  color: var(--muted);
}
.tally b {
  font: 700 1.9rem/1 var(--sans);
  letter-spacing: -0.04em;
  color: var(--ok);
}
.tally b.r {
  color: var(--refuse);
}
.tally .sep {
  display: inline-block;
  width: 1px;
  height: 1.2rem;
  margin: 0 0.6rem;
  vertical-align: -0.2rem;
  background: var(--line-2);
}
.balance {
  margin-top: 0.7rem;
  font: 400 0.78rem/1.6 var(--mono);
  color: var(--muted);
}
.balance b {
  font-weight: 500;
  color: #fff;
}
.okmark {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0 0.4rem;
  border-radius: 0.3rem;
  background: rgb(74 222 128 / 0.12);
  color: var(--ok);
}
.engine-line {
  margin-top: 0.5rem;
  font: 400 0.7rem/1.5 var(--mono);
  color: var(--faint);
}
@media (max-width: 400px) {
  .hero .pill {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }
}

/* ---------- 01-journal.css ---------- */
/* Chapter 01, the journal: compose, fold, lineage. */

/* ---------- compose ---------- */
.compose {
  display: grid;
  gap: 1.4rem 2rem;
}
@media (min-width: 1000px) {
  .compose {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }
}
.compose-entry > * + * {
  margin-top: 1rem;
}
.compose-meta {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.legs {
  display: grid;
  gap: 0.5rem;
}
.legrow {
  display: grid;
  grid-template-columns: auto minmax(0, 1.5fr) minmax(5.5rem, 1fr) auto auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgb(255 255 255 / 0.018);
  transition: border-color 0.2s;
}
.legrow.bad {
  border-color: rgb(251 113 133 / 0.55);
}
.legrow.bad [data-amount] {
  color: #fecdd3;
}
.legrow [data-amount] {
  text-align: right;
}
.legrow .side {
  display: inline-flex;
  padding: 0.18rem;
  border-radius: 0.7rem;
  background: rgb(0 0 0 / 0.32);
}
.legrow .side button {
  min-width: 2.4rem;
  min-height: 2.1rem;
  border: 0;
  border-radius: 0.55rem;
  background: none;
  font: 600 0.76rem/1 var(--mono);
  color: var(--faint);
}
.legrow .side [data-side="D"][aria-pressed="true"] {
  background: rgb(76 201 240 / 0.18);
  color: var(--debit);
}
.legrow .side [data-side="C"][aria-pressed="true"] {
  background: rgb(245 192 74 / 0.18);
  color: var(--credit);
}
.legrow .x {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 0.6rem;
  background: none;
  color: var(--faint);
}
.legrow .x:hover {
  color: var(--refuse);
  background: rgb(251 113 133 / 0.08);
}
.legrow .x svg {
  width: 0.9rem;
  height: 0.9rem;
}
@media (max-width: 560px) {
  .legrow {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "side account x"
      "amount amount unit";
  }
  .legrow .side {
    grid-area: side;
  }
  .legrow [data-account] {
    grid-area: account;
  }
  .legrow [data-amount] {
    grid-area: amount;
  }
  .legrow [data-unit] {
    grid-area: unit;
  }
  .legrow .x {
    grid-area: x;
  }
}
.compose-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  align-items: center;
  justify-content: space-between;
}
.sums {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font: 500 0.76rem/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.compose-go .btn.go {
  min-width: 9rem;
}
.compose-out .micro {
  margin-bottom: 0.5rem;
}
.compose-out .micro + .attempts,
.compose-out .well + .micro {
  margin-top: 1.2rem;
}
.well.refusal {
  min-height: 13.5rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
}
.well.refusal.ok {
  border-color: rgb(74 222 128 / 0.4);
  box-shadow: 0 0 0 4px rgb(74 222 128 / 0.05);
}
.well.refusal.no {
  border-color: rgb(251 113 133 / 0.45);
  box-shadow: 0 0 0 4px rgb(251 113 133 / 0.05);
}
.attempts {
  display: grid;
  gap: 0.3rem;
  font: 400 0.76rem/1.45 var(--mono);
  color: var(--muted);
}
.attempts li {
  display: flex;
  gap: 0.6rem;
  padding: 0.3rem 0.55rem;
  border-left: 2px solid var(--line-2);
  animation: slidein 0.35s var(--ease);
}
@keyframes slidein {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* ---------- fold ---------- */
.fold {
  display: grid;
  gap: 1.2rem;
  align-items: start;
}
@media (min-width: 960px) {
  .fold {
    grid-template-columns: minmax(0, 1fr) 12.5rem minmax(0, 1fr);
  }
}
.fold-side {
  padding: 1rem 1rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgb(0 0 0 / 0.22);
}
.fold-side.stored {
  border-style: dashed;
}
.fold-side.folded {
  border-color: rgb(76 201 240 / 0.3);
  background: linear-gradient(180deg, rgb(76 201 240 / 0.05), rgb(0 0 0 / 0.22));
}
.fold-side .micro {
  margin-bottom: 0.5rem;
}
.balances td.r,
.balances th.r {
  text-align: right;
}
.balances tr {
  transition: background-color 0.25s;
}
.balances tr.edited td {
  color: #fde68a;
}
.balances tr.mismatch td {
  background: rgb(251 113 133 / 0.1);
  color: #fecdd3;
}
.balances tr.match td:first-child::before {
  content: "✓ ";
  color: var(--ok);
}
.balances tr.mismatch td:first-child::before {
  content: "✗ ";
  color: var(--refuse);
}
.balances [data-explain] {
  cursor: pointer;
}
.balances [data-explain]:hover td,
.balances [data-explain].on td {
  background: rgb(76 201 240 / 0.08);
  color: #fff;
}
.nudge {
  width: 4.2rem;
  text-align: right;
}
.nudge button {
  width: 1.7rem;
  height: 1.5rem;
  margin-left: 0.15rem;
  border: 1px solid var(--line-2);
  border-radius: 0.45rem;
  background: none;
  font: 600 0.8rem/1 var(--mono);
  color: var(--muted);
}
.nudge button:hover {
  color: #fff;
  border-color: var(--line-3);
}
.fold-say {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
.fold-mid {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  align-self: center;
  text-align: center;
}
.fold-mid .btn {
  white-space: nowrap;
}
.fold-mid .micro {
  max-width: 11rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: none;
}
.fold-time {
  display: grid;
  gap: 0.8rem;
}
.fold-journal ol {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
}
.fold-journal li {
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: rgb(0 0 0 / 0.25);
  font: 400 0.66rem/1.5 var(--mono);
  color: var(--muted);
  transition: opacity 0.25s;
}
.fold-journal li.later {
  opacity: 0.28;
  border-style: dashed;
}
.fold-journal li.dim {
  opacity: 0.4;
}
.fold-journal i {
  font-style: normal;
}
.fold-journal i.dr {
  color: #8bdcf7;
}
.fold-journal i.cr {
  color: #fcd98a;
  padding-left: 0.9em;
}
.fold-journal i.hit {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: #fff;
}

/* ---------- lineage ---------- */
.lineage > * + * {
  margin-top: 1.2rem;
}
.lineage-say {
  min-height: 3rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--soft);
}
.lineage-say .fine {
  display: block;
  margin-top: 0.3rem;
}
.lineage-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
}
.lcard {
  flex: 0 1 13rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: 0.9rem;
  background: rgb(0 0 0 / 0.28);
  font: 400 0.72rem/1.5 var(--mono);
  color: var(--muted);
  animation: slidein 0.35s var(--ease);
}
.lcard p + p {
  margin-top: 0.2rem;
}
.lcard .lhead {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--soft);
}
.lcard .lhead b {
  color: #fff;
}
.lcard .ltitle {
  font: 600 0.84rem/1.35 var(--sans);
  color: #fff;
}
.lcard .llegs {
  display: flex;
  flex-direction: column;
}
.lcard i {
  font-style: normal;
}
.lcard i.dr {
  color: #8bdcf7;
}
.lcard i.cr {
  color: #fcd98a;
  padding-left: 0.9em;
}
.lcard .link {
  color: var(--known);
}
.lcard .ldate {
  color: var(--faint);
}
.lcard.reversal {
  border-color: rgb(167 139 250 / 0.5);
  background: rgb(167 139 250 / 0.06);
}
.lcard.right {
  border-color: rgb(74 222 128 / 0.45);
  background: rgb(74 222 128 / 0.05);
}
.lcard.refused {
  border-style: dashed;
  border-color: rgb(251 113 133 / 0.5);
  opacity: 0.75;
}
.lcard.refused .ltitle {
  text-decoration: line-through;
  text-decoration-color: rgb(251 113 133 / 0.6);
}
.lineage-chain .arrow {
  align-self: center;
  width: 1.2rem;
  height: 1px;
  background: var(--line-3);
  position: relative;
}
.lineage-chain .arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -3px;
  border: 3.5px solid transparent;
  border-left-color: var(--line-3);
  border-right: 0;
}
.lineage-views {
  display: grid;
  gap: 1rem 2rem;
  align-items: center;
}
@media (min-width: 900px) {
  .lineage-views {
    grid-template-columns: auto 1fr;
  }
}
.lineage-bars {
  display: grid;
  gap: 0.45rem;
}
.lineage-bars .bar {
  display: grid;
  grid-template-columns: 9.5rem 1fr 6.5rem;
  gap: 0.8rem;
  align-items: center;
  font: 400 0.76rem/1.3 var(--mono);
  color: var(--soft);
}
.lineage-bars .track {
  height: 0.6rem;
  border-radius: 9px;
  background: rgb(255 255 255 / 0.05);
  overflow: hidden;
}
.lineage-bars .fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2a9bc4, var(--debit));
  transition: width 0.6s var(--ease);
}
.lineage-bars .num {
  text-align: right;
  color: #fff;
}
.lineage-bars .track {
  position: relative;
  overflow: visible;
}
.lineage-bars .ghost {
  position: absolute;
  top: -0.3rem;
  bottom: -0.3rem;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: rgb(167 139 250 / 0.85);
  transition: left 0.6s var(--ease);
}
.lineage-bars .bar.moved .num {
  color: var(--known);
}
.lineage-bars .fine {
  margin-top: 0.4rem;
}
.lcard .lhead {
  flex-wrap: wrap;
}
.lcard .lhead b {
  white-space: nowrap;
}

/* ---------- 02-time.css ---------- */
/* Chapter 02, time: as known at, the period law, restatements. */

/* ---------- asknown ---------- */
.ak > * + * {
  margin-top: 1.1rem;
}
.ak-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  align-items: center;
  justify-content: space-between;
}
.ak-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  font: 500 0.72rem/1.4 var(--mono);
  color: var(--muted);
}
.ak-legend .sw {
  display: inline-block;
  width: 1.4rem;
  height: 0;
  margin-left: 0.6rem;
  border-top: 2.5px solid var(--known);
}
.ak-legend .sw:first-child {
  margin-left: 0;
}
.ak-legend .sw.now {
  border-top: 1.5px dashed rgb(232 238 247 / 0.6);
}
.ak-legend .sw.tick {
  width: 0;
  height: 0;
  border: 5px solid transparent;
  border-bottom: 7px solid #fff;
  border-top: 0;
}
.ak-plot {
  padding: 0.4rem 0 0.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.24);
}
.ak-plot canvas {
  display: block;
  width: 100%;
  height: 470px;
  cursor: crosshair;
  touch-action: pan-y;
}
.ak-controls {
  display: grid;
  gap: 0.6rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}
.ak-reads .read b {
  font-size: 1.2rem;
}
.ak-reads .read:first-child b {
  color: #d8ccff;
}
.ak-say {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--soft);
  min-height: 3.2rem;
}
.ak-say b {
  font: 600 0.92em var(--mono);
  color: #d8ccff;
}
.ak-say b.now {
  color: #fff;
}
.ak-say .past {
  color: #ffb39e;
  font-weight: 600;
}

/* ---------- periods ---------- */
.pm > * + * {
  margin-top: 1.2rem;
}
.pm-machine {
  padding: 0.6rem 0.4rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: radial-gradient(ellipse 70% 90% at 50% 40%, rgb(167 139 250 / 0.07), transparent 70%), rgb(0 0 0 / 0.22);
  overflow-x: auto;
}
.pm-svg {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}
.pm-svg .node {
  cursor: pointer;
  outline: none;
}
.pm-svg .node rect {
  fill: #0a0f1a;
  stroke: rgb(190 210 240 / 0.25);
  stroke-width: 1.2;
  transition:
    stroke 0.2s,
    fill 0.2s;
}
.pm-svg .node:hover rect,
.pm-svg .node:focus-visible rect {
  stroke: rgb(167 139 250 / 0.7);
}
.pm-svg .node.on rect {
  fill: rgb(167 139 250 / 0.16);
  stroke: var(--known);
  stroke-width: 2;
}
.pm-svg .node text {
  text-anchor: middle;
  dominant-baseline: middle;
}
.pm-svg .node .nm {
  font: 650 15px var(--sans);
  letter-spacing: -0.01em;
  fill: #fff;
}
.pm-svg .node .sub {
  font: 500 10px var(--mono);
  fill: var(--muted);
}
.pm-svg .edge {
  cursor: pointer;
  outline: none;
}
.pm-svg .edge .hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
}
.pm-svg .edge .line {
  fill: none;
  stroke: rgb(190 210 240 / 0.35);
  stroke-width: 1.4;
  transition: stroke 0.2s;
}
.pm-svg .edge.back .line {
  stroke: rgb(255 122 89 / 0.45);
  stroke-dasharray: 5 4;
}
.pm-svg .edge.fwd .line {
  stroke: rgb(74 222 128 / 0.5);
}
.pm-svg .edge .lab rect {
  fill: #0a0f1a;
  stroke: rgb(190 210 240 / 0.18);
}
.pm-svg .edge .lab text {
  font: 500 11px var(--mono);
  fill: var(--soft);
  text-anchor: middle;
  dominant-baseline: middle;
}
.pm-svg .edge.case .lab text {
  fill: #ffb39e;
}
.pm-svg .edge:hover .line,
.pm-svg .edge:focus-visible .line,
.pm-svg .edge.on .line {
  stroke: #fff;
  stroke-width: 2.2;
}
.pm-svg .edge:hover .lab rect,
.pm-svg .edge:focus-visible .lab rect,
.pm-svg .edge.on .lab rect {
  stroke: var(--known);
  fill: #160f2b;
}
.pm-grid {
  display: grid;
  gap: 1.2rem 1.8rem;
  align-items: start;
}
@media (min-width: 1000px) {
  .pm-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  }
}
.pm-matrix {
  overflow-x: auto;
}
.pm-table {
  width: 100%;
  min-width: 520px;
  border-collapse: separate;
  border-spacing: 3px;
  font: 500 0.74rem/1.2 var(--mono);
}
.pm-table th {
  padding: 0.2rem 0.4rem;
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.pm-table tbody th {
  font: 600 0.8rem/1.2 var(--sans);
  color: var(--soft);
}
.pm-table thead button {
  width: 100%;
  padding: 0.35rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: none;
  font: 600 0.72rem/1 var(--mono);
  color: var(--soft);
}
.pm-table thead button.col {
  border-color: var(--known);
  background: rgb(167 139 250 / 0.16);
  color: #fff;
}
.pm-table td {
  padding: 0;
}
.pm-table td button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  min-height: 1.95rem;
  padding: 0.15rem 0.3rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  font: 600 0.72rem/1.1 var(--mono);
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.pm-table td.admit button {
  background: rgb(74 222 128 / 0.13);
  color: var(--ok);
}
.pm-table td.with button {
  background: rgb(245 192 74 / 0.13);
  color: #fcd98a;
  font-size: 0.64rem;
}
.pm-table td.with i {
  font-style: normal;
  color: var(--credit);
  opacity: 0.8;
}
.pm-table td.refuse button {
  background: rgb(251 113 133 / 0.06);
  color: rgb(251 113 133 / 0.6);
}
.pm-table td.col button {
  box-shadow: inset 0 0 0 1px rgb(167 139 250 / 0.45);
}
.pm-table td button:hover,
.pm-table td button.on {
  border-color: #fff;
}
.pm-table td button.on {
  transform: scale(1.04);
}
.pm-side .micro {
  margin-bottom: 0.5rem;
}
.pm-out {
  min-height: 15rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.28);
}
.pm-out > * + * {
  margin-top: 0.55rem;
}
.pm-hint,
.pm-note {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}
.pm-q {
  font-size: 0.9rem;
  color: var(--soft);
}
.pm-q b {
  color: #fff;
}
.pm-law {
  font: 500 0.78rem/1.5 var(--mono);
  color: #d8ccff;
}
.pm-verdict {
  font-size: 1.05rem;
  color: var(--soft);
}
.pm-verdict b {
  font-weight: 700;
  color: #fff;
}
.pm-verdict.ok b {
  color: var(--ok);
}
.pm-verdict.no b {
  color: var(--refuse);
}
.pm-cite {
  font: 400 0.76rem/1.5 var(--mono);
  color: var(--muted);
}
.pm-meta {
  font: 400 0.7rem/1.4 var(--mono);
  color: var(--faint);
}
.pm-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.8rem;
  font-size: 0.84rem;
  line-height: 1.45;
}
.pm-list dt {
  font: 600 0.66rem/1.9 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pm-list dd {
  color: var(--soft);
}
.pm-legend {
  margin-top: 0.8rem;
}

/* ---------- restate ---------- */
.rs > * + * {
  margin-top: 1.1rem;
}
.rs-say {
  min-height: 3rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--soft);
}
.rs-say .fine {
  display: block;
  margin-top: 0.3rem;
}
.rs-lanes {
  padding: 0.5rem 0.4rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.22);
  overflow-x: auto;
}
.rs-svg {
  display: block;
  width: 100%;
  min-width: 660px;
  height: auto;
}
.rs-svg text {
  font: 500 10.5px var(--mono);
  fill: var(--muted);
}
.rs-svg .lane-name {
  font: 650 13px var(--sans);
  fill: #fff;
}
.rs-svg .lane-code {
  font-size: 9.5px;
  fill: var(--faint);
}
.rs-svg .band {
  font: 600 9px var(--mono);
  letter-spacing: 0.1em;
  fill: rgb(232 238 247 / 0.55);
}
.rs-svg .tick {
  stroke: rgb(190 210 240 / 0.1);
}
.rs-svg .axis {
  text-anchor: middle;
  fill: var(--faint);
}
.rs-svg .axis-name {
  text-anchor: end;
  font-size: 9.5px;
  fill: var(--faint);
}
.rs-svg .pin line {
  stroke: var(--known);
  stroke-dasharray: 2 3;
}
.rs-svg .pin circle {
  fill: var(--known);
}
.rs-svg .pin text {
  font: 600 9.5px var(--mono);
  letter-spacing: 0.05em;
  fill: #d8ccff;
}
.rs-svg .entry {
  fill: #0a0f1a;
  stroke: var(--debit);
  stroke-width: 2;
}
.rs-svg .entry.err {
  stroke: var(--refuse);
  stroke-width: 2.4;
}
.rs-svg .err-note {
  font-weight: 600;
  fill: #fecdd3;
}
.rs-svg .now {
  stroke: #fff;
  stroke-dasharray: 4 4;
  opacity: 0.6;
}
.rs-svg .now-l {
  text-anchor: middle;
  font: 600 9.5px var(--mono);
  letter-spacing: 0.08em;
  fill: #fff;
}
.rs-svg .try line {
  stroke-width: 1.6;
}
.rs-svg .try.no line {
  stroke: rgb(251 113 133 / 0.7);
}
.rs-svg .try.no path {
  stroke: var(--refuse);
  stroke-width: 2.4;
  stroke-linecap: round;
}
.rs-svg .try.no text {
  font: 600 9.5px var(--mono);
  fill: #fecdd3;
  dominant-baseline: middle;
}
.rs-svg .try.ok line {
  stroke: var(--known);
}
.rs-svg .try.ok circle {
  fill: var(--known);
  stroke: #fff;
  stroke-width: 1.5;
}
.rs-svg .try {
  animation: slidein 0.35s var(--ease);
}
.rs-read {
  display: grid;
  gap: 1.2rem 1.6rem;
  align-items: start;
}
.rs-cols {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
@media (min-width: 1000px) {
  .rs-case {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 0 1.6rem;
    align-items: start;
  }
  .rs-case .micro {
    grid-column: 1 / -1;
  }
  .rs-case .fine {
    margin-top: 0;
  }
}
.rs-col {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.24);
  transition: border-color 0.3s;
}
.rs-col.orig {
  border-color: rgb(167 139 250 / 0.5);
  background: linear-gradient(180deg, rgb(167 139 250 / 0.08), rgb(0 0 0 / 0.24));
}
.rs-col.wrong {
  border-color: rgb(251 113 133 / 0.35);
}
.rs-col.fixed {
  border-color: rgb(74 222 128 / 0.45);
}
.rs-col.case {
  border-style: dashed;
  opacity: 0.85;
}
.rs-h {
  font: 650 0.95rem/1.3 var(--sans);
  color: #fff;
}
.rs-sub {
  min-height: 2.2rem;
  margin-top: 0.15rem;
  font: 500 0.68rem/1.45 var(--mono);
  color: var(--muted);
}
.rs-v {
  margin-top: 0.55rem;
}
.rs-v small {
  display: block;
  font-size: 0.72rem;
  color: var(--faint);
}
.rs-v b {
  display: block;
  font: 500 1.05rem/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.rs-v .rs-bar {
  display: block;
  height: 0.3rem;
  margin-top: 0.25rem;
  border-radius: 9px;
  background: rgb(255 255 255 / 0.05);
  overflow: hidden;
}
.rs-v .rs-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d5bd0, var(--known));
  transition: width 0.6s var(--ease);
}
.rs-col.fixed .rs-v .rs-bar span {
  background: linear-gradient(90deg, #2fa866, var(--ok));
}
.rs-case .micro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.rs-case .well {
  margin: 0;
  white-space: pre;
  font-size: 0.72rem;
}
.rs-case .c {
  color: var(--faint);
}
.rs-case .fine {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.5;
}
.rs-read {
  grid-template-columns: minmax(0, 1fr);
}
.rs-read > *,
.rs-case > * {
  min-width: 0;
}
@media (max-width: 640px) {
  .pm-svg {
    min-width: 600px;
  }
  .rs-svg {
    min-width: 600px;
  }
  .pm-table {
    min-width: 0;
    border-spacing: 2px;
  }
  .pm-table tbody th {
    font-size: 0.7rem;
    white-space: normal;
  }
  .pm-table thead button {
    padding: 0.3rem 0.1rem;
    font-size: 0.56rem;
    letter-spacing: -0.02em;
  }
  .pm-table td button {
    min-height: 1.8rem;
    font-size: 0.62rem;
  }
  .pm-table td.with span {
    display: none;
  }
  .pm-table td.with button::before {
    content: "op";
  }
}
.pm-table .short {
  display: none;
}
@media (max-width: 640px) {
  .pm-table .full {
    display: none;
  }
  .pm-table .short {
    display: inline;
  }
}
@media (max-width: 640px) {
  .pm-table {
    table-layout: fixed;
  }
  .pm-table thead th:first-child {
    width: 23%;
  }
}

/* ---------- 03-exact.css ---------- */
/* Chapter 03, exactness: allocate, fx, canon. */

[data-chapter="exact"] .fig-body > .alloc,
[data-chapter="exact"] .fig-body > .fxfig,
[data-chapter="exact"] .fig-body > .canonfig {
  display: grid;
  gap: 1.3rem;
}
[data-chapter="exact"] .fig input.bad,
[data-chapter="exact"] .fig select.bad {
  border-color: rgb(251 113 133 / 0.7);
  color: #fecdd3;
}
[data-chapter="exact"] .ms {
  display: inline-block;
  margin-left: 0.3rem;
  font: 400 0.7rem/1.4 var(--mono);
  color: var(--faint);
}
[data-chapter="exact"] .stale [data-laws],
[data-chapter="exact"] .stale [data-naive],
[data-chapter="exact"] .stale [data-float] {
  opacity: 0.35;
  filter: saturate(0.4);
  transition: opacity 0.2s;
}
.field.xinline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.field.xinline > span {
  letter-spacing: 0.06em;
  line-height: 1.3;
}
.field.xinline input,
.field.xinline select {
  width: 7.5rem;
}
.xswatch {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.45rem;
  border-radius: 0.2rem;
  background: var(--k);
  box-shadow: 0 0 8px color-mix(in srgb, var(--k) 60%, transparent);
  vertical-align: 0.02rem;
}

/* ---------- allocate ---------- */
.alloc-grid {
  display: grid;
  gap: 1.4rem 2rem;
  align-items: start;
}
.alloc-setup {
  grid-area: setup;
}
.alloc-laws {
  grid-area: laws;
}
.alloc-naive {
  grid-area: naive;
}
.alloc-grid > .xfloat {
  grid-area: float;
}
.alloc-grid {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "setup" "laws" "naive" "float";
}
@media (min-width: 1040px) {
  .alloc-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    grid-template-areas: "setup laws" "float laws" "naive naive";
    grid-template-rows: auto 1fr auto;
  }
  .alloc-grid > .xfloat {
    align-self: start;
  }
}
.alloc-setup > * + * {
  margin-top: 1rem;
}
.alloc-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7rem;
  gap: 0.7rem;
}
.alloc-total [data-total] {
  font-size: 1.15rem;
  text-align: right;
}
table.targets td {
  padding-block: 0.3rem;
  white-space: normal;
}
table.targets th.r,
table.targets td.r {
  text-align: right;
}
.fig table.targets input {
  width: 100%;
  min-height: 2.15rem;
  padding: 0.25rem 0.5rem;
  text-align: right;
  font-size: 0.8rem;
}
.fig table.targets td:first-child {
  display: flex;
  align-items: center;
  min-width: 8.5rem;
}
.fig table.targets input.nm {
  text-align: left;
  font-family: var(--sans);
  font-weight: 600;
}
table.targets td:nth-child(2),
table.targets td:nth-child(3) {
  width: 4.6rem;
}
table.targets td:nth-child(4) {
  width: 7.2rem;
}
table.targets .x {
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  font-size: 1.1rem;
  color: var(--faint);
}
table.targets .x:hover:not(:disabled) {
  color: var(--refuse);
  background: rgb(251 113 133 / 0.08);
}
table.targets .x:disabled {
  opacity: 0.25;
}
.alloc-more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  align-items: center;
}
.alloc-say {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--soft);
}
.alloc-laws {
  display: grid;
  gap: 0.55rem;
}
.xlaw {
  padding: 0.75rem 0.9rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgb(0 0 0 / 0.24);
  animation: slidein 0.35s var(--ease);
}
.xl-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
}
.xl-head b {
  font: 600 0.84rem/1.3 var(--mono);
  color: #fff;
}
.xbadge {
  flex: none;
  padding: 0.08rem 0.5rem;
  border-radius: 0.4rem;
  font: 500 0.7rem/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}
.xbadge.ok {
  background: rgb(74 222 128 / 0.1);
  color: var(--ok);
}
.xbadge.no {
  background: rgb(251 113 133 / 0.12);
  color: var(--refuse);
}
.xlaw .xrule {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}
.xlaw .xbar {
  display: flex;
  gap: 2px;
  height: 0.55rem;
  margin-top: 0.6rem;
  border-radius: 9px;
  overflow: hidden;
  background: rgb(255 255 255 / 0.04);
}
.xlaw .xpart {
  min-width: 2px;
  background: var(--k);
  transition: width 0.45s var(--ease);
}
.xlaw .xpart.neg {
  background: repeating-linear-gradient(135deg, var(--refuse) 0 3px, transparent 3px 6px);
}
.xlaw .xshares {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  margin-top: 0.5rem;
}
.xlaw .xshare {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--k);
  font: 400 0.78rem/1.4 var(--mono);
  font-variant-numeric: tabular-nums;
}
.xlaw .xshare b {
  font-weight: 500;
  color: #fff;
}
.xlaw .xshare.neg b {
  color: var(--refuse);
}
.xlaw .xplus {
  padding: 0 0.3rem;
  border-radius: 0.3rem;
  background: rgb(245 192 74 / 0.14);
  font-style: normal;
  font-size: 0.68rem;
  color: var(--credit);
}
.xlaw .xplus.xminus {
  background: rgb(251 113 133 / 0.14);
  color: var(--refuse);
}
.xlaw.xrefused {
  border-style: dashed;
  border-color: rgb(251 113 133 / 0.5);
  background: rgb(251 113 133 / 0.04);
}
.xl-refusal {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #fecdd3;
}
.alloc-naive {
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.alloc-naive-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.4rem;
}
.alloc-key {
  display: flex;
  gap: 1rem;
  font-size: 0.76rem;
  color: var(--muted);
}
.alloc-key span::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.4rem;
  border-radius: 0.15rem;
}
.alloc-key .lost::before {
  background: var(--refuse);
}
.alloc-key .made::before {
  background: var(--known);
}
.alloc-key .even::before {
  background: var(--ok);
}
.naive-scroll {
  overflow-x: auto;
}
table.naive th {
  white-space: nowrap;
}
table.naive td.r,
table.naive th.r {
  text-align: right;
}
table.naive tr.lost td {
  background: rgb(251 113 133 / 0.045);
}
table.naive tr.made td {
  background: rgb(167 139 250 / 0.05);
}
.xres {
  display: inline-block;
  min-width: 7.5rem;
  padding: 0.05rem 0.45rem;
  border-radius: 0.35rem;
  text-align: right;
}
.xres.lost {
  background: rgb(251 113 133 / 0.14);
  color: #fda4af;
}
.xres.made {
  background: rgb(167 139 250 / 0.16);
  color: #c4b5fd;
}
.xres.even {
  color: var(--ok);
}

/* The browser's float, kept visibly apart from the engine's numbers. */
.xfloat {
  padding: 0.8rem 1rem 0.85rem;
  border: 1px dashed var(--line-3);
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 0.015);
}
.xfloat .micro span {
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line-2);
  border-radius: 0.35rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.xfloat-line {
  margin-top: 0.4rem;
  font-size: 0.84rem;
  line-height: 1.75;
  color: var(--soft);
  overflow-wrap: anywhere;
}
.xfloat-line .xlbl {
  margin-right: 0.3rem;
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--faint);
}
.xfloat-line code {
  padding: 0.05rem 0.35rem;
  border-radius: 0.3rem;
  background: rgb(255 255 255 / 0.05);
  font-size: 0.8rem;
  color: #fff;
}
.xfloat-line code.xdrift {
  background: rgb(251 113 133 / 0.14);
  color: #fecdd3;
}
.xfloat-line .xmuted {
  color: var(--muted);
}

/* ---------- fx ---------- */
.fx-inputs {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 820px) {
  .fx-inputs {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.6fr) minmax(0, 1.2fr) minmax(0, 0.6fr);
  }
}
.fx-inputs [data-amount],
.fx-inputs [data-rate] {
  text-align: right;
}
.fx-exact {
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid rgb(245 192 74 / 0.25);
  border-radius: 1.1rem;
  background: radial-gradient(40rem 12rem at 85% 0%, rgb(245 192 74 / 0.07), transparent 70%), rgb(0 0 0 / 0.25);
}
.fx-sum {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  font: 500 clamp(1.15rem, 2.6vw, 1.75rem)/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.fx-sum small {
  font-size: 0.55em;
  color: var(--muted);
}
.fx-sum .op {
  color: var(--faint);
}
.fx-rate {
  display: inline-grid;
  font-size: 0.62em;
  text-align: center;
  color: var(--credit);
}
.fx-rate span + span {
  border-top: 1.5px solid currentColor;
}
.fx-out .beyond {
  color: var(--faint);
  opacity: 0.75;
}
.fx-sub {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
.numline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin-top: 1.1rem;
}
.numline .end {
  display: grid;
  gap: 0.1rem;
  font: 500 0.86rem/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
}
.numline .end small {
  font-size: 0.7rem;
  color: var(--faint);
}
.numline .end.lo {
  color: var(--debit);
}
.numline .end.hi {
  color: var(--credit);
  text-align: right;
}
.numline .track,
.fx-row .track {
  position: relative;
  display: block;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--debit), var(--line-3) 50%, var(--credit));
}
.numline .at {
  position: absolute;
  top: 50%;
  transform: translateX(-50%);
}
.numline .at i {
  position: absolute;
  left: -1px;
  top: -0.75rem;
  width: 2px;
  height: 1.5rem;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 10px #fff;
}
.numline .at em {
  position: absolute;
  top: 0.95rem;
  left: 50%;
  transform: translateX(-50%);
  font: 500 0.7rem/1 var(--mono);
  font-style: normal;
  white-space: nowrap;
  color: #fff;
}
.numline .at.tie i {
  background: var(--known);
  box-shadow: 0 0 12px var(--known);
}
.numline .at.tie em {
  color: var(--known);
}
.fx-story {
  margin-top: 1.6rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--soft);
}
.fx-fail {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #fecdd3;
}
.fx-table {
  display: grid;
  gap: 0.2rem;
}
.fx-row {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(5rem, 1fr) minmax(6rem, 0.8fr) minmax(6rem, 0.8fr) 3rem;
  gap: 0.9rem;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
}
.fx-row:not(.head):hover {
  background: rgb(255 255 255 / 0.03);
}
.fx-row.head {
  padding-block: 0.2rem;
  border-bottom: 1px solid var(--line-2);
  border-radius: 0;
  font: 500 0.68rem/1.3 var(--mono);
  color: var(--faint);
}
.fx-row .lane-h {
  display: flex;
  justify-content: space-between;
}
.fx-row.head .lane-h span:first-child {
  color: var(--debit);
}
.fx-row.head .lane-h span:last-child {
  color: var(--credit);
}
.fx-row .r {
  text-align: right;
}
.fx-row .c {
  text-align: center;
}
.fx-row .lawname b {
  display: block;
  font: 600 0.8rem/1.3 var(--mono);
  color: #fff;
}
.fx-row .lawname small {
  display: block;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--faint);
}
.fx-row .lane {
  padding-inline: 0.4rem;
}
.fx-row .track {
  background: var(--line-2);
}
.fx-row .at {
  position: absolute;
  top: -0.35rem;
  width: 1px;
  height: calc(0.7rem + 2px);
  margin-left: -0.5px;
  background: rgb(255 255 255 / 0.55);
}
.fx-row .at.tie {
  background: var(--known);
}
.fx-row .dot {
  position: absolute;
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.45s var(--ease);
}
.fx-row.lo .dot {
  background: var(--debit);
  box-shadow: 0 0 10px var(--debit);
}
.fx-row.hi .dot {
  background: var(--credit);
  box-shadow: 0 0 10px var(--credit);
}
.fx-row.lo .v {
  color: var(--debit);
}
.fx-row.hi .v {
  color: var(--credit);
}
.fx-row .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.fx-row .yes {
  color: var(--ok);
}
.fx-row .nope,
.fx-row .err {
  color: var(--refuse);
}
.fx-row .na {
  color: var(--faint);
}
.fx-foot {
  margin-top: 0.4rem;
  padding-inline: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}
@media (max-width: 720px) {
  .fx-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(3.5rem, 0.8fr) minmax(4.5rem, 0.9fr) 1.6rem;
    gap: 0.6rem;
    padding-inline: 0.3rem;
  }
  .fx-row > :nth-child(4) {
    display: none;
  }
  .fx-row .lawname small {
    display: none;
  }
  .fx-row .lawname b {
    font-size: 0.72rem;
    overflow-wrap: anywhere;
  }
}

/* ---------- canon ---------- */
.canon-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem 2rem;
  align-items: start;
}
@media (min-width: 1040px) {
  .canon-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  }
}
.canon-left > * + * {
  margin-top: 1rem;
}
.xeditor {
  --pad: 0.85rem;
  --lh: 1.65em;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: rgb(2 4 9 / 0.75);
  font: 400 0.8rem/1.65 var(--mono);
  overflow: hidden;
}
.xeditor:focus-within {
  border-color: rgb(245 192 74 / 0.45);
}
.xgutter {
  padding: var(--pad) 0.6rem var(--pad) 0.8rem;
  border-right: 1px solid var(--line);
  text-align: right;
  color: var(--faint);
  user-select: none;
}
.xgutter span {
  display: block;
  height: var(--lh);
}
.xgutter span.bad {
  color: var(--refuse);
  font-weight: 700;
}
.xeditor .code {
  overflow-x: auto;
}
.code-in {
  position: relative;
  width: max-content;
  min-width: 100%;
}
.xeditor pre.xhl,
.xeditor textarea {
  margin: 0;
  padding: var(--pad);
  font: inherit;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
}
.xeditor pre.xhl {
  color: var(--soft);
  pointer-events: none;
}
.fig .xeditor textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: #fff;
}
.xeditor textarea::selection {
  background: rgb(76 201 240 / 0.3);
  -webkit-text-fill-color: transparent;
}
.xhl .k {
  color: #c4b5fd;
}
.xhl .s {
  color: #fde68a;
}
.xhl .l {
  color: var(--teal);
  font-weight: 600;
}
.xhl .n {
  color: var(--debit);
}
.xhl .c {
  color: var(--faint);
  font-style: italic;
}
.xerr {
  position: absolute;
  top: calc(var(--pad) + var(--line) * var(--lh));
  left: calc(var(--pad) + var(--col) * 1ch);
  width: 1.2ch;
  height: var(--lh);
  border-bottom: 2px solid var(--refuse);
  background: rgb(251 113 133 / 0.22);
  pointer-events: none;
  animation: blink 1.2s ease-in-out infinite alternate;
}
@keyframes blink {
  to {
    background: rgb(251 113 133 / 0.06);
  }
}
.canon-event-row {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.6fr) minmax(0, 1fr);
}
.canon-event-row [data-net] {
  text-align: right;
}
.canon-event .micro {
  margin-bottom: 0.5rem;
}
.canon-right > * + * {
  margin-top: 1rem;
}
.canon-right > .micro + * {
  margin-top: 0.5rem;
}
.xcv {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.25);
  animation: slidein 0.3s var(--ease);
}
.xcv.ok {
  border-color: rgb(74 222 128 / 0.45);
  box-shadow: 0 0 0 4px rgb(74 222 128 / 0.05);
}
.xcv.no {
  border-color: rgb(251 113 133 / 0.5);
  box-shadow: 0 0 0 4px rgb(251 113 133 / 0.05);
}
.xcv.warn {
  border-color: rgb(245 192 74 / 0.5);
  box-shadow: 0 0 0 4px rgb(245 192 74 / 0.05);
}
.xcv-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.3rem 1rem;
}
.xcv-head b {
  font-size: 1rem;
}
.xcv.ok .xcv-head b {
  color: var(--ok);
}
.xcv.no .xcv-head b {
  color: var(--refuse);
}
.xcv.warn .xcv-head b {
  color: var(--credit);
}
.xcv-head span {
  font: 500 0.76rem/1.6 var(--mono);
  color: var(--muted);
}
.xcv-msg {
  overflow-wrap: anywhere;
  margin-top: 0.45rem;
  font: 400 0.8rem/1.55 var(--mono);
  color: #fff;
}
.xcv-then {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
.canon-say {
  margin-top: 0.8rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--soft);
}
table.canon-legs td.r,
table.canon-legs th.r {
  text-align: right;
}
table.canon-legs tr.dr td:first-child {
  color: var(--debit);
}
table.canon-legs tr.cr td:first-child {
  color: var(--credit);
}
table.canon-legs td code {
  font-size: 0.72rem;
  color: var(--teal);
}
table.canon-legs tfoot td {
  padding-top: 0.5rem;
  border-bottom: 0;
  color: var(--muted);
}
.canon-digests {
  display: grid;
  gap: 0.45rem;
}
.xdg {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0 0.8rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgb(0 0 0 / 0.2);
  transition: border-color 0.3s;
}
.xdg small {
  grid-row: span 2;
  font: 500 0.68rem/1.5 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.xdg code {
  font-size: 0.76rem;
  color: #fff;
  overflow-wrap: anywhere;
}
.xdg span {
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--muted);
}
.xdg.xchanged {
  border-color: rgb(245 192 74 / 0.55);
  animation: slidein 0.35s var(--ease);
}
.xdg.xchanged small {
  color: var(--credit);
}
@media (max-width: 560px) {
  .fig table.targets td {
    padding-inline: 0.15rem;
  }
  .fig table.targets th {
    padding-inline: 0.2rem;
  }
  .fig table.targets td:first-child {
    min-width: 0;
  }
  .fig table.targets input {
    padding-inline: 0.35rem;
    font-size: 0.74rem;
  }
  table.targets td:nth-child(2),
  table.targets td:nth-child(3) {
    width: 2.9rem;
  }
  table.targets td:nth-child(4) {
    width: 5rem;
  }
  table.targets .x {
    width: 1.4rem;
  }
  .xswatch {
    margin-right: 0.3rem;
  }
  table.canon-legs {
    display: block;
    overflow-x: auto;
  }
  .fx-row.head .lane-h {
    flex-direction: column;
    gap: 0.1rem;
  }
  .fx-row.head .lane-h span:last-child {
    text-align: right;
  }
  .canon-event-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
  }
  .canon-event-row label:last-child {
    grid-column: 1 / -1;
  }
  .xdg {
    grid-template-columns: 1fr;
  }
  .xdg small {
    grid-row: auto;
  }
  .field.xinline {
    flex-wrap: wrap;
  }
}

/* ---------- 04-proof.css ---------- */
/* Chapter 04, proof: the accumulator, fa-verify in the tab, and replay. */

[data-chapter="proof"] .btn.danger {
  border-color: rgb(251 113 133 / 0.45);
  color: #fecdd3;
}
[data-chapter="proof"] .btn.danger:hover {
  border-color: rgb(251 113 133 / 0.8);
  background: rgb(251 113 133 / 0.08);
}
[data-chapter="proof"] code {
  font-family: var(--mono);
}

/* ---------- accumulator ---------- */
.acc > * + * {
  margin-top: 1.1rem;
}
.acc-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  align-items: center;
  justify-content: space-between;
}
.acc-root {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.7rem;
  font: 500 0.78rem/1.4 var(--mono);
}
.acc-root .micro {
  margin: 0;
}
.acc-root code {
  color: #bbf7d0;
  letter-spacing: 0.02em;
}
.acc-root .ms {
  color: var(--faint);
}
.acc-stage {
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background:
    radial-gradient(40rem 16rem at 50% 0%, rgb(74 222 128 / 0.07), transparent 70%),
    rgb(0 0 0 / 0.22);
  padding: 0.6rem 0.4rem 0.2rem;
  overflow-x: auto;
}
.acc-tree {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}
.acc-tree .edge {
  fill: none;
  stroke: rgb(190 210 240 / 0.2);
  stroke-width: 1.3;
  transition: stroke 0.3s;
}
.acc-tree .edge.on {
  stroke: var(--ok);
  stroke-width: 2;
}
.acc-tree .edge.bad {
  stroke: var(--refuse);
  stroke-dasharray: 4 3;
}
.acc-tree .nd rect {
  fill: #08101b;
  stroke: rgb(190 210 240 / 0.28);
  stroke-width: 1.2;
  transition:
    fill 0.3s,
    stroke 0.3s;
}
.acc-tree .nd text {
  font: 500 11px var(--mono);
  fill: var(--soft);
  text-anchor: middle;
  pointer-events: none;
}
.acc-tree .nd text.idx {
  font-size: 10.5px;
  fill: var(--faint);
}
.acc-tree .nd.leaf {
  cursor: pointer;
}
.acc-tree .nd.leaf rect {
  stroke: rgb(76 201 240 / 0.45);
}
.acc-tree .nd.leaf:hover rect,
.acc-tree .nd.leaf:focus-visible rect {
  stroke: #fff;
}
.acc-tree .nd:focus {
  outline: none;
}
.acc-tree .nd.root rect {
  fill: rgb(74 222 128 / 0.12);
  stroke: var(--ok);
  stroke-width: 1.8;
}
.acc-tree .nd.root text {
  fill: #fff;
  font-weight: 600;
}
.acc-tree .nd.path rect {
  stroke: var(--ok);
  fill: rgb(74 222 128 / 0.1);
}
.acc-tree .nd.path text {
  fill: #fff;
}
.acc-tree .nd.sel text.idx {
  fill: var(--ok);
  font-weight: 700;
}
.acc-tree .nd.sib rect {
  stroke: var(--credit);
  fill: rgb(245 192 74 / 0.14);
  stroke-dasharray: none;
}
.acc-tree .nd.sib text {
  fill: #fde68a;
}
.acc-tree .nd.cons rect {
  stroke: var(--known);
  stroke-width: 2;
}
.acc-tree .nd.bad rect {
  stroke: var(--refuse);
  fill: rgb(251 113 133 / 0.16);
}
.acc-tree .nd.bad text {
  fill: #fecdd3;
}
.acc-tree .nd.new {
  animation: acc-pop 0.55s var(--ease) both;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes acc-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.85);
  }
}
.acc-panels {
  display: grid;
  gap: 1rem 1.4rem;
}
@media (min-width: 900px) {
  .acc-panels {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.acc-panels .micro {
  margin-bottom: 0.5rem;
}
.acc-proof p + p {
  margin-top: 0.3rem;
}
.acc-proof .pf-entry {
  font: 500 0.78rem/1.5 var(--mono);
  color: #fff;
}
.acc-proof .pf-entry b {
  color: var(--ok);
}
.acc-proof .pf-row {
  display: grid;
  grid-template-columns: 6.6rem 1fr;
  gap: 0.6rem;
  align-items: baseline;
}
.acc-proof .pf-row > span:first-child {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.acc-proof .pf-path {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.acc-proof .sibc {
  padding: 0 0.35rem;
  border-radius: 0.35rem;
  background: rgb(245 192 74 / 0.12);
  color: #fde68a;
}
.acc-proof .pf-verdict {
  margin-top: 0.6rem !important;
  font: 500 0.84rem/1.5 var(--sans);
}
.acc-cps {
  display: grid;
  gap: 0.45rem;
}
.acc-cps li {
  display: grid;
  grid-template-columns: 1.8rem 1fr;
  gap: 0.15rem 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: 0.8rem;
  background: rgb(0 0 0 / 0.22);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  cursor: pointer;
  animation: slidein 0.35s var(--ease);
}
.acc-cps li.on {
  border-color: rgb(167 139 250 / 0.55);
  border-left-color: var(--known);
}
.acc-cps li.broken {
  border-left-color: var(--refuse);
  background: rgb(251 113 133 / 0.06);
}
.acc-cps li.empty {
  display: block;
  border-left-color: var(--line-2);
  cursor: default;
}
.acc-cps b {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgb(74 222 128 / 0.14);
  font: 600 0.75rem/1 var(--mono);
  color: var(--ok);
}
.acc-cps li.broken b {
  background: rgb(251 113 133 / 0.14);
  color: var(--refuse);
}
.acc-cps .cp-main {
  font: 500 0.76rem/1.4 var(--mono);
  color: #fff;
}
.acc-cps li.broken .cp-say {
  color: #fecdd3;
}
.acc-legend .k-leaf {
  --k: var(--debit);
}
.acc-legend .k-path {
  --k: var(--ok);
}
.acc-legend .k-sib {
  --k: var(--credit);
}
.acc-legend .k-bad {
  --k: var(--refuse);
}

/* ---------- verifier ---------- */
.vf > * + * {
  margin-top: 1.1rem;
}
.vf-files {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.vf-file {
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgb(0 0 0 / 0.22);
  transition: border-color 0.3s;
}
.vf-file.ok {
  border-color: rgb(74 222 128 / 0.35);
}
.vf-file.bad {
  border-color: rgb(251 113 133 / 0.5);
}
.vf-name {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font: 500 0.8rem/1.4 var(--mono);
}
.vf-name b {
  color: #fff;
  font-weight: 600;
}
.vf-name .num {
  color: var(--faint);
}
.vf-what {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}
.vf-sha {
  margin-top: 0.45rem;
  font: 400 0.68rem/1.4 var(--mono);
  color: var(--faint);
}
.vf-file.ok .vf-sha {
  color: var(--ok);
}
.vf-cmd {
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #03060b;
  font: 400 0.76rem/1.6 var(--mono);
  color: var(--soft);
  white-space: pre-wrap;
  word-break: break-all;
}
.vf-cmd .c {
  color: var(--ok);
  margin-right: 0.3rem;
}
.vf-cmd .h {
  color: #fde68a;
}
.vf-go {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}
.vf-cost {
  font-size: 0.82rem;
  color: var(--faint);
}
.vf-main {
  display: grid;
  gap: 1.2rem 1.6rem;
}
@media (min-width: 1000px) {
  .vf-main {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }
}
.vf-gridwrap {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgb(0 0 0 / 0.22);
}
.vf-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: flex-start;
  min-height: 9rem;
}
.vf-empty {
  align-self: center;
  margin: auto;
  font-size: 0.86rem;
  color: var(--faint);
  text-align: center;
}
.vt {
  border: 1px solid var(--line-2);
  background: rgb(255 255 255 / 0.03);
  color: var(--soft);
  transition:
    opacity 0.25s,
    transform 0.25s,
    background-color 0.25s,
    border-color 0.25s;
}
.vt.wait {
  opacity: 0.08;
  transform: scale(0.7);
}
.vt.named {
  min-height: 2.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.65rem;
  font: 600 0.74rem/1.25 var(--sans);
  text-align: left;
}
.vt.pass {
  border-color: rgb(74 222 128 / 0.45);
  background: rgb(74 222 128 / 0.12);
  color: #dcfce7;
}
.vt.fail {
  border-color: var(--refuse);
  background: rgb(251 113 133 / 0.22);
  color: #fff;
  box-shadow: 0 0 0 4px rgb(251 113 133 / 0.12);
}
.vt.on {
  outline: 2px solid #fff;
  outline-offset: 1px;
}
.vt.ghost {
  display: grid;
  place-items: center;
  min-height: 2.4rem;
  padding: 0.35rem 0.75rem;
  border-style: dashed;
  border-radius: 0.65rem;
  font: 500 0.74rem/1.25 var(--sans);
  color: var(--faint);
}
.vt-rows {
  flex: 1 1 100%;
}
.vt-rows .micro {
  margin: 0.2rem 0 0.4rem;
}
.vt-sq {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(0.95rem, 1fr));
  gap: 3px;
}
.vt.row {
  aspect-ratio: 1;
  border-radius: 3px;
  padding: 0;
}
.vf-kinds {
  margin-top: 0.9rem;
}
.vf-result {
  display: grid;
  gap: 0.8rem;
  align-content: start;
}
.vf-verdict {
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgb(0 0 0 / 0.22);
}
.vf-verdict.good {
  border-color: rgb(74 222 128 / 0.45);
  box-shadow: 0 0 0 4px rgb(74 222 128 / 0.05);
}
.vf-verdict.bad {
  border-color: rgb(251 113 133 / 0.5);
  box-shadow: 0 0 0 4px rgb(251 113 133 / 0.05);
}
.vf-big {
  margin-top: 0.2rem;
  font: 700 1.9rem/1.1 var(--sans);
  letter-spacing: -0.03em;
  color: #fff;
}
.vf-reads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.2rem;
  margin-top: 0.5rem;
  font-size: 0.84rem;
  color: var(--muted);
}
.vf-reads b {
  font: 600 0.95rem/1 var(--mono);
  color: #fff;
}
.vf-say {
  margin-top: 0.6rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--soft);
}
.vf-say code {
  color: #bbf7d0;
  font-size: 0.8rem;
}
.vf-detail {
  max-height: 19rem;
  margin: 0;
  overflow: auto;
  white-space: pre;
  font-size: 0.72rem;
}
.vf-detail .c {
  color: var(--faint);
}
.vf-tamper {
  padding: 0.95rem 1.1rem 1rem;
  border: 1px dashed rgb(251 113 133 / 0.35);
  border-radius: 1.1rem;
  background: rgb(251 113 133 / 0.03);
}
.vf-tamper .micro {
  margin-bottom: 0.6rem;
}
.vf-tamper-row {
  display: grid;
  gap: 0.9rem 1.4rem;
  align-items: center;
}
@media (min-width: 1100px) {
  .vf-tamper-row {
    grid-template-columns: auto minmax(12rem, 1fr) auto;
  }
}
.vf-tamper-row .range.off {
  visibility: hidden;
}
@media (max-width: 1099px) {
  .vf-tamper-row .range.off {
    display: none;
  }
}
.vf-scope {
  display: grid;
  gap: 0.55rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  font-size: 0.84rem;
  line-height: 1.5;
}
.vf-scope > div {
  display: grid;
  gap: 0.15rem 1rem;
}
@media (min-width: 760px) {
  .vf-scope > div {
    grid-template-columns: 6.5rem 1fr;
  }
}
.vf-scope dt {
  font: 600 0.66rem/1.9 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.vf-scope dd {
  color: var(--muted);
}

/* ---------- replay ---------- */
.rp {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}
@media (min-width: 1000px) {
  .rp {
    grid-template-columns: minmax(0, 1fr) 11.5rem minmax(0, 1fr);
  }
}
.rp-side {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgb(0 0 0 / 0.22);
  transition: opacity 0.2s;
}
.rp-side.busy {
  opacity: 0.6;
}
.rp-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.rp-top .micro {
  margin: 0;
}
.rp-ms {
  font: 400 0.72rem/1 var(--mono);
  color: var(--faint);
}
.rp-inputs {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: minmax(0, 1fr) 6.5rem;
  align-items: end;
}
.rp-inputs .seg {
  grid-column: 1 / -1;
  justify-self: start;
}
.rp-inputs .seg button {
  min-height: 2.1rem;
  padding-inline: 0.75rem;
}
.rp-seed input.bad {
  border-color: var(--refuse);
}
.rp-strip {
  width: 100%;
  height: 5.2rem;
  border-radius: 0.7rem;
  background: rgb(255 255 255 / 0.02);
}
.rp-strip line.base {
  stroke: rgb(190 210 240 / 0.18);
}
.rp-strip line.entry {
  stroke: var(--ok);
  stroke-width: 2.2;
  stroke-opacity: 0.75;
}
.rp-strip line.planted {
  stroke: var(--coral);
  stroke-width: 2.6;
}
.rp-facts {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
.rp-facts b {
  font-family: var(--mono);
  color: #fff;
}
.rp-title {
  font-weight: 600;
  color: var(--soft);
}
.rp-digest {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 2px;
  min-height: 6.4rem;
}
.rp-digest .nb {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ok) calc(var(--v) * 4% + 6%), #04070d);
  font: 600 0.7rem/1 var(--mono);
  color: rgb(255 255 255 / 0.85);
  transition:
    background-color 0.3s,
    box-shadow 0.3s;
}
.rp-digest .nb.diff {
  background: color-mix(in srgb, var(--refuse) calc(var(--v) * 3% + 14%), #04070d);
  box-shadow: inset 0 0 0 1px rgb(251 113 133 / 0.7);
}
.rp-mid {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.9rem;
  text-align: center;
}
.rp-verdict {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}
.rp-verdict b {
  display: block;
  font: 700 1.25rem/1.3 var(--sans);
  letter-spacing: -0.02em;
}
.rp-verdict.same b {
  color: var(--ok);
}
.rp-verdict.diff b {
  color: var(--refuse);
}
.rp-cli {
  display: grid;
  gap: 0.45rem;
  margin-top: 1.1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #03060b;
}
.rp-cli .micro {
  margin: 0;
}
.rp-cli code.k {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--soft);
  word-break: break-all;
}
.rp-native {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.8rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.rp-native code {
  font-size: 0.78rem;
  color: #bbf7d0;
}
.rp-native.same b {
  color: var(--ok);
  font-weight: 600;
}
.rp-native.diff b {
  color: var(--refuse);
}
@media (max-width: 560px) {
  .rp-digest .nb {
    font-size: 0.58rem;
  }
}
.vf-gridwrap {
  align-self: start;
}
.vf-hint {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: var(--faint);
}
.rp-legend {
  margin-top: 1rem;
}
.rp-legend .k-coral {
  --k: var(--coral);
}
.rp-legend .k-diff {
  --k: var(--refuse);
}
.rp-side,
.rp-inputs .field {
  grid-template-columns: minmax(0, 1fr);
}
.rp-inputs {
  grid-template-columns: minmax(0, 1fr) 6.5rem;
}
.rp-inputs select,
.rp-inputs input {
  width: 100%;
}
@media (max-width: 640px) {
  .acc-tree {
    min-width: 600px;
  }
  .acc-tree .nd text {
    font-size: 15px;
  }
  .acc-tree .nd text.idx {
    font-size: 14px;
  }
}

/* ---------- 05-forensics.css ---------- */
/* Chapter 05, forensics: casebook, trace, procedures. */

/* ---------- casebook ---------- */
.case > * + * {
  margin-top: 1.2rem;
}
.case-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  align-items: end;
  justify-content: space-between;
}
.case-knobs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
}
.case-seed input {
  width: 7.5rem;
}
.case-head {
  min-height: 6.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(90deg, rgb(255 122 89 / 0.07), transparent 60%), rgb(0 0 0 / 0.2);
}
.case-title {
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: #fff;
}
.synthetic {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.12rem 0.45rem;
  border: 1px solid rgb(255 122 89 / 0.45);
  border-radius: 0.4rem;
  font: 600 0.62rem/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 0.15rem;
  color: #ffb39e;
}
.case-summary {
  margin-top: 0.3rem;
  max-width: 62rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}
.case-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  margin-top: 0.6rem;
  font: 400 0.74rem/1.5 var(--mono);
  color: var(--faint);
}
.case-stats b {
  font-weight: 600;
  color: #fff;
}
.case-stats code {
  color: var(--soft);
}
.case-matrix {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.24);
  padding: 0.6rem 0.4rem 0.2rem;
  transition: opacity 0.2s;
}
.fig.busy .case-matrix,
[data-fig="casebook"].busy .case-matrix {
  opacity: 0.55;
}
.case-svg {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}
.case-svg .rowbg {
  fill: transparent;
}
.case-svg .rowbg:nth-of-type(odd) {
  fill: rgb(255 255 255 / 0.012);
}
.case-svg .rowbg.on {
  fill: rgb(255 122 89 / 0.06);
}
.case-svg .plabel {
  font: 500 11px var(--mono);
  fill: var(--faint);
}
.case-svg .plabel.hit {
  fill: var(--soft);
}
.case-svg .pcount {
  font: 600 11px var(--mono);
  fill: var(--faint);
  opacity: 0.6;
}
.case-svg .pcount.hit {
  fill: var(--coral);
  opacity: 1;
}
.case-svg .amt {
  fill: rgb(190 210 240 / 0.2);
}
.case-svg .amt.hit {
  fill: var(--coral);
}
.case-svg .cell {
  fill: var(--coral);
  filter: drop-shadow(0 0 3px rgb(255 122 89 / 0.6));
}
.case-svg .plant {
  fill: rgb(245 192 74 / 0.07);
  stroke: rgb(245 192 74 / 0.75);
  stroke-width: 1.2;
  stroke-dasharray: 3 2;
}
.case-svg .pin {
  fill: rgb(255 255 255 / 0.05);
  stroke: rgb(255 255 255 / 0.55);
  stroke-width: 1;
}
.case-svg .hover {
  fill: rgb(255 255 255 / 0.07);
  pointer-events: none;
}
.case-svg .axis {
  font: 500 10px var(--mono);
  fill: var(--faint);
}
.case-svg .tick {
  stroke: var(--line-3);
}
.case-lower {
  display: grid;
  gap: 1rem;
}
@media (min-width: 960px) {
  .case-lower {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
}
.case-entry,
.case-benford {
  min-height: 15.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.22);
}
.case-entry > * + *,
.case-benford > * + * {
  margin-top: 0.45rem;
}
.case-hint,
.case-entry .quiet {
  font-size: 0.86rem;
  color: var(--faint);
}
.case-desc {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}
.case-meta {
  font: 400 0.74rem/1.5 var(--mono);
  color: var(--muted);
}
.case-proc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--soft);
}
.case-legs td.r {
  text-align: right;
}
.case-legs td:first-child {
  width: 2rem;
}
.case-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.case-flags span {
  padding: 0.1rem 0.45rem;
  border-radius: 0.4rem;
  background: rgb(255 122 89 / 0.1);
  font: 500 0.7rem/1.5 var(--mono);
  color: #ffb39e;
}
.case-by {
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--muted);
}
.case-by code.k {
  font-size: 0.74rem;
  background: rgb(255 122 89 / 0.12);
  color: #ffc9b8;
}
.case-fact {
  font: 600 0.76rem/1.5 var(--mono);
  color: var(--credit);
}
.benford-svg {
  display: block;
  width: 100%;
  height: auto;
}
.benford-svg .obs {
  fill: rgb(255 122 89 / 0.75);
}
.benford-svg .exp {
  fill: none;
  stroke: var(--credit);
  stroke-width: 1.6;
}
.benford-svg .expd {
  fill: var(--ink);
  stroke: var(--credit);
  stroke-width: 1.6;
}
.benford-svg .axis {
  font: 500 10px var(--mono);
  fill: var(--faint);
}
.case-legend {
  display: flex;
  gap: 1rem;
  font: 400 0.7rem/1.4 var(--mono);
  color: var(--faint);
}
.case-legend i {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.35rem;
  border-radius: 0.2rem;
  vertical-align: -0.1rem;
}
.lg-obs {
  background: rgb(255 122 89 / 0.75);
}
.lg-exp {
  border: 1.6px solid var(--credit);
  border-radius: 50% !important;
}
.case-mad {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
}
.case-mad b {
  font-family: var(--mono);
  font-weight: 600;
  color: #fff;
}
.case-mad .nc {
  display: block;
  margin-top: 0.2rem;
  color: var(--credit);
}
.case-key > .btn[aria-expanded="true"] {
  border-color: rgb(245 192 74 / 0.6);
  color: #fff;
}
.case-facts {
  margin-top: 1rem;
}
.case-facts[hidden] {
  display: none;
}
.case-score {
  font-size: 0.95rem;
  color: var(--soft);
}
.case-score b {
  color: #fff;
}
.case-facts ol {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
@media (min-width: 900px) {
  .case-facts ol {
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  }
}
.case-facts li {
  padding: 0.85rem 1rem;
  border: 1px solid rgb(245 192 74 / 0.3);
  border-radius: 0.9rem;
  background: rgb(245 192 74 / 0.04);
  animation: slidein 0.35s var(--ease);
}
.case-facts li > * + * {
  margin-top: 0.4rem;
}
.fhead {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  align-items: baseline;
  font: 500 0.74rem/1.4 var(--mono);
  color: var(--muted);
}
.fhead b {
  color: var(--credit);
}
.fhead em {
  margin-left: auto;
  font-style: normal;
  font-weight: 600;
  color: var(--ok);
}
.case-facts li.no .fhead em {
  color: var(--refuse);
}
.frat {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--soft);
}
.fby {
  line-height: 1.9;
}
.fby code.k {
  font-size: 0.72rem;
  color: var(--muted);
}
.fby code.k.lit {
  background: rgb(255 122 89 / 0.12);
  color: #ffc9b8;
}
.fent button {
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--line-2);
  border-radius: 0.4rem;
  background: none;
  font: 500 0.72rem/1.5 var(--mono);
  color: var(--soft);
}
.fent button:hover {
  color: #fff;
  border-color: var(--line-3);
}
.case-gaps {
  margin-top: 0.8rem;
  font-size: 0.86rem;
  color: var(--muted);
}

/* ---------- trace ---------- */
.trace {
  display: grid;
  gap: 1.4rem 2rem;
  grid-template-areas:
    "edit"
    "chart"
    "laws";
}
@media (min-width: 1040px) {
  .trace {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    grid-template-areas:
      "edit chart"
      "laws laws";
    align-items: start;
  }
}
.trace-edit {
  grid-area: edit;
}
.trace-edit > * + * {
  margin-top: 0.9rem;
}
.trace-chart {
  grid-area: chart;
  padding: 0.6rem 0.4rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.24);
  transition: opacity 0.2s;
}
.trace-chart.stale {
  opacity: 0.4;
}
.trace-laws {
  grid-area: laws;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.trace-say {
  min-height: 2.8rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}
.moves {
  display: grid;
  gap: 0.4rem;
}
.move {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1.15fr) auto minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 0.018);
}
.move.mine {
  border-color: rgb(245 192 74 / 0.55);
  background: rgb(245 192 74 / 0.05);
}
.move.bad {
  border-color: rgb(251 113 133 / 0.55);
}
.move [data-f="amount"] {
  text-align: right;
}
.claimant {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 0.35rem;
  font: 500 0.7rem/1 var(--mono);
  color: var(--faint);
  cursor: pointer;
}
.move.mine .claimant {
  color: var(--credit);
}
.claimant input {
  appearance: none;
  -webkit-appearance: none;
  width: 1rem;
  height: 1rem;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  border: 1.5px solid var(--line-3) !important;
  border-radius: 50% !important;
  background: none !important;
}
.claimant input:checked {
  border-color: var(--credit) !important;
  background: radial-gradient(circle, var(--credit) 45%, transparent 50%) !important;
}
.claimant input:disabled {
  opacity: 0.25;
}
.move .side {
  display: inline-flex;
  padding: 0.18rem;
  border-radius: 0.7rem;
  background: rgb(0 0 0 / 0.32);
}
.move .side button {
  min-width: 2.6rem;
  min-height: 2.1rem;
  border: 0;
  border-radius: 0.55rem;
  background: none;
  font: 600 0.74rem/1 var(--mono);
  color: var(--faint);
}
.move .side [data-side="in"][aria-pressed="true"] {
  background: rgb(74 222 128 / 0.15);
  color: var(--ok);
}
.move .side [data-side="out"][aria-pressed="true"] {
  background: rgb(251 113 133 / 0.15);
  color: var(--refuse);
}
.move .x {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 0;
  border-radius: 0.6rem;
  background: none;
  color: var(--faint);
}
.move .x:hover {
  color: var(--refuse);
  background: rgb(251 113 133 / 0.08);
}
.move .x svg {
  width: 0.9rem;
  height: 0.9rem;
}
@media (max-width: 560px) {
  .move {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "who date x"
      "side amount amount";
  }
  .move .claimant {
    grid-area: who;
  }
  .move [data-f="date"] {
    grid-area: date;
  }
  .move .side {
    grid-area: side;
  }
  .move [data-f="amount"] {
    grid-area: amount;
  }
  .move .x {
    grid-area: x;
  }
}
.trace-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  align-items: end;
  justify-content: space-between;
}
.trace-claim input {
  width: 9.5rem;
}
.trace-claim input.bad {
  border-color: rgb(251 113 133 / 0.6);
}
.trace-order .micro {
  margin-bottom: 0.45rem;
}
.trace-svg {
  display: block;
  width: 100%;
  height: auto;
}
.trace-svg .grid {
  stroke: var(--line);
}
.trace-svg .axis {
  font: 500 10px var(--mono);
  fill: var(--faint);
}
.trace-svg .bal {
  fill: rgb(190 210 240 / 0.06);
}
.trace-svg .bal-line {
  fill: none;
  stroke: rgb(190 210 240 / 0.35);
  stroke-width: 1.2;
}
.trace-svg .mv {
  stroke-width: 2;
  stroke-linecap: round;
}
.trace-svg .mv.in {
  stroke: var(--ok);
}
.trace-svg .mv.out {
  stroke: var(--refuse);
}
.trace-svg .mv.dep {
  stroke: var(--credit);
  stroke-width: 3.5;
}
.trace-svg .claim {
  stroke: rgb(255 255 255 / 0.4);
  stroke-dasharray: 3 4;
}
.trace-svg .claim-t {
  fill: var(--soft);
}
.trace-svg .law {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
  transition: opacity 0.2s;
}
.trace-svg .end {
  font: 600 10.5px var(--mono);
  transition: opacity 0.2s;
}
.trace-svg .dim {
  opacity: 0.12;
}
.tlaw {
  position: relative;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--law) 8%, transparent), rgb(0 0 0 / 0.22) 55%);
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.tlaw::before {
  content: "";
  position: absolute;
  inset: 0 1rem auto;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--law);
}
.tlaw.on {
  border-color: color-mix(in srgb, var(--law) 60%, transparent);
}
.tlaw > * + * {
  margin-top: 0.35rem;
}
.tkey {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  font: 500 0.72rem/1.3 var(--mono);
  color: var(--muted);
}
.tkey b {
  color: var(--law);
  letter-spacing: 0.04em;
}
.tval {
  font: 700 1.75rem/1.1 var(--sans);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.tpct {
  font: 400 0.74rem/1.4 var(--mono);
  color: var(--law);
}
.trule {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--soft);
}
.tcite {
  font-size: 0.74rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--faint);
}
.tout {
  font: 400 0.72rem/1.45 var(--mono);
  color: var(--muted);
}
.tproc code {
  font-size: 0.7rem;
  color: var(--faint);
}
.trace-error {
  padding: 0.9rem 1rem;
  border: 1px dashed rgb(251 113 133 / 0.5);
  border-radius: 0.9rem;
  font-size: 0.9rem;
  color: #fecdd3;
}

/* ---------- procedures ---------- */
.procs > * + * {
  margin-top: 1.1rem;
}
.procs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  align-items: end;
  justify-content: space-between;
}
.procs-find input {
  width: 15rem;
  max-width: 100%;
}
.procs-body {
  display: grid;
  gap: 1.2rem;
  align-items: start;
}
@media (min-width: 1040px) {
  .procs-body {
    grid-template-columns: minmax(0, 1fr) 21rem;
  }
}
.procs-grid {
  columns: 3 15rem;
  column-gap: 0.8rem;
}
.pfam {
  break-inside: avoid;
  margin-bottom: 0.8rem;
  padding: 0.75rem 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.95rem;
  background: rgb(0 0 0 / 0.2);
  transition: opacity 0.2s;
}
.pfam.off {
  opacity: 0.35;
}
.pfam h4 {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font: 600 0.78rem/1.3 var(--sans);
  letter-spacing: -0.005em;
  color: #fff;
}
.pfam h4 b {
  font: 600 0.72rem/1.3 var(--mono);
  color: var(--faint);
}
.pfam ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.ptile {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  max-width: 100%;
  padding: 0.28rem 0.55rem 0.28rem 0.45rem;
  border: 1px solid var(--line-2);
  border-radius: 0.55rem;
  background: rgb(255 255 255 / 0.02);
  font: 500 0.7rem/1.3 var(--mono);
  color: var(--muted);
  text-align: left;
  transition:
    opacity 0.2s,
    border-color 0.2s,
    color 0.2s,
    background-color 0.2s;
}
.ptile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ptile i {
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border: 1.2px solid var(--faint);
  border-radius: 50%;
}
.ptile.cal {
  border-color: rgb(255 122 89 / 0.45);
  background: rgb(255 122 89 / 0.07);
  color: #ffd2c4;
}
.ptile.cal i {
  border-color: var(--coral);
  background: var(--coral);
  box-shadow: 0 0 6px var(--coral);
}
.ptile.inv i {
  border-radius: 1px;
  transform: rotate(45deg);
  border-color: var(--known);
}
.ptile.here {
  box-shadow: inset 0 -2px 0 rgb(245 192 74 / 0.75);
}
.ptile:hover,
.ptile:focus-visible,
.ptile.pinned {
  border-color: rgb(255 255 255 / 0.5);
  color: #fff;
}
.ptile.pinned {
  background: rgb(255 255 255 / 0.08);
}
.ptile.off {
  opacity: 0.16;
}
.procs-detail {
  min-height: 22rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid rgb(255 122 89 / 0.3);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgb(255 122 89 / 0.06), rgb(0 0 0 / 0.24) 40%);
}
@media (min-width: 1040px) {
  .procs-detail {
    position: sticky;
    top: 6rem;
  }
}
.procs-detail > * + * {
  margin-top: 0.6rem;
}
.pd-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem 0.6rem;
  margin-top: 0.8rem !important;
}
.pd-stats p {
  display: grid;
  font-size: 0.74rem;
  color: var(--muted);
}
.pd-stats b {
  font: 700 1.65rem/1.1 var(--sans);
  letter-spacing: -0.03em;
  color: #fff;
}
.pd-stats p:nth-child(3) b {
  color: var(--coral);
}
.pd-hint {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}
.pd-id code {
  font-size: 0.95rem;
  color: #fff;
  word-break: break-all;
}
.pd-sum {
  max-height: 15rem;
  overflow-y: auto;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--soft);
}
.pd-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font: 400 0.74rem/1.4 var(--mono);
}
.pd-facts dt {
  color: var(--faint);
}
.pd-facts dd {
  color: #fff;
}
.pd-cal {
  padding: 0.6rem 0.75rem;
  border-radius: 0.7rem;
  background: rgb(255 255 255 / 0.04);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
.pd-cal.ok {
  background: rgb(255 122 89 / 0.09);
  color: #ffd2c4;
}
.pd-cal b {
  color: #fff;
}
.pd-run code {
  display: block;
  overflow-x: auto;
  padding: 0.5rem 0.65rem;
  border-radius: 0.6rem;
  background: rgb(0 0 0 / 0.35);
  font-size: 0.72rem;
  white-space: nowrap;
  color: var(--soft);
}
.procs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  font: 400 0.72rem/1.4 var(--mono);
  color: var(--faint);
}
.procs-legend .lg {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.4rem;
  border: 1.2px solid var(--faint);
  border-radius: 50%;
  vertical-align: 0;
}
.procs-legend .lg.cal {
  border-color: var(--coral);
  background: var(--coral);
}
.procs-legend .lg.inv {
  border-color: var(--known);
  border-radius: 1px;
  transform: rotate(45deg);
}
.procs-legend .lg.here {
  border: 0;
  border-radius: 0;
  height: 2px;
  width: 0.8rem;
  background: var(--credit);
  vertical-align: 0.2rem;
}
.trace-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  padding: 0.2rem 0.6rem 0.5rem;
  font: 400 0.7rem/1.4 var(--mono);
  color: var(--faint);
}
.trace-legend i {
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: 0.1rem;
}
.trace-legend i.lg-bal {
  width: 0.8rem;
  height: 0.55rem;
  border-top: 1.2px solid rgb(190 210 240 / 0.45);
  background: rgb(190 210 240 / 0.08);
}
.trace-legend i.lg-mv {
  width: 2.5px;
  height: 0.65rem;
  border-radius: 2px;
  vertical-align: -0.05rem;
}
.trace-legend i.lg-mv.dep {
  width: 3.5px;
  background: var(--credit);
}
.trace-legend i.lg-mv.in {
  background: var(--ok);
}
.trace-legend i.lg-mv.out {
  background: var(--refuse);
}
.trace-legend i.lg-ln {
  width: 0.9rem;
  height: 2.5px;
  border-radius: 2px;
}
.case-lower > *,
.trace > *,
.procs-body > * {
  min-width: 0;
}
.case-legs td {
  white-space: normal;
}
.case-legs td.r {
  white-space: nowrap;
}
.case-meta,
.case-by {
  overflow-wrap: anywhere;
}
.case-swipe {
  display: none;
}
@media (max-width: 820px) {
  .case-swipe {
    display: block;
    margin-top: 0.5rem !important;
    font: 400 0.7rem/1.4 var(--mono);
    color: var(--faint);
  }
}

/* ---------- 06-world.css ---------- */
/* Chapter 06, the world: consolidate, who, records. */

/* ---------- consolidate: the group ---------- */
.group > * + * {
  margin-top: 1.6rem;
}
.group-top {
  display: grid;
  gap: 1.4rem 2rem;
  align-items: start;
}
@media (min-width: 1040px) {
  .group-top {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}
.group-graph > * + * {
  margin-top: 0.6rem;
}
.owngraph {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.owngraph .book {
  fill: rgb(45 212 191 / 0.045);
  stroke: rgb(45 212 191 / 0.45);
  stroke-dasharray: 5 5;
}
.owngraph .book-label {
  font: 600 9.5px var(--mono);
  letter-spacing: 0.12em;
  fill: rgb(45 212 191 / 0.85);
}
.owngraph .edge {
  fill: none;
  stroke: rgb(190 210 240 / 0.28);
  transition: stroke-width 0.5s var(--ease);
}
.owngraph .edge.cross {
  stroke: rgb(245 192 74 / 0.35);
  stroke-dasharray: 2 4;
  stroke-linecap: round;
}
.owngraph .elabel {
  font: 600 10.5px var(--mono);
  fill: var(--soft);
  paint-order: stroke;
  stroke: var(--ink);
  stroke-width: 4px;
}
.owngraph .node rect {
  fill: #0a111d;
  stroke: var(--c);
  stroke-opacity: 0.55;
  stroke-width: 1.3;
  transition:
    stroke-opacity 0.2s,
    fill 0.2s;
}
.owngraph .node.same rect {
  fill: #08161a;
}
.owngraph .node.pick {
  cursor: pointer;
  outline: none;
}
.owngraph .node.pick:hover rect,
.owngraph .node.pick:focus-visible rect {
  stroke-opacity: 1;
}
.owngraph .node.sel rect {
  stroke-opacity: 1;
  stroke-width: 2.2;
  fill: color-mix(in srgb, var(--c) 12%, #0a111d);
}
.owngraph .nname {
  font: 650 11.5px var(--sans);
  letter-spacing: -0.01em;
  fill: #fff;
}
.owngraph .nmeta {
  font: 500 8.5px var(--mono);
  letter-spacing: 0.06em;
  fill: var(--faint);
}
.owngraph .npct {
  font: 600 11px var(--mono);
  fill: var(--chapter);
}
.group-event {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-height: 2.8rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--faint);
}
.group-event .now {
  color: #fff;
}
.group-event .now::before {
  content: "● ";
  color: var(--chapter);
}
.group-own .micro {
  margin-bottom: 0.5rem;
}
.group-own [data-oms] {
  color: var(--faint);
  letter-spacing: 0.04em;
  text-transform: none;
}
.owntable td.r,
.owntable th.r,
.enttable td.r,
.enttable th.r,
.trtable td.r,
.trtable th.r {
  text-align: right;
}
.owntable tbody tr {
  transition: background-color 0.3s;
}
.owntable tr[data-sub] {
  cursor: pointer;
}
.owntable tr[data-sub]:hover td {
  color: #fff;
}
.owntable tr.on td {
  background: rgb(45 212 191 / 0.08);
  color: #fff;
}
.owntable tr.changed td {
  animation: flash 1.2s var(--ease);
}
.owntable tr.changed td.num {
  color: #fde68a;
}
@keyframes flash {
  from {
    background: rgb(245 192 74 / 0.22);
  }
}
.owntable .dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.5rem;
  border-radius: 50%;
}
.owntable .why {
  display: block;
  padding-left: 1rem;
  font-size: 0.66rem;
  color: var(--chapter);
  white-space: normal;
}

.group-bottom {
  display: grid;
  gap: 1.2rem;
  align-items: start;
}
.gp-grid {
  display: grid;
  gap: 1.1rem 1.8rem;
  align-items: start;
}
.gp-grid > div > * + * {
  margin-top: 0.9rem;
}
@media (min-width: 1000px) {
  .gp-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
  .gp-side {
    padding-left: 1.6rem;
    border-left: 1px solid var(--line);
  }
}
.gp-side .ent-tries {
  flex-direction: column;
  align-items: stretch;
}
.gp-side .ent-tries .btn {
  justify-content: flex-start;
}
.gpanel {
  min-width: 0;
  padding: 1.05rem 1.1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgb(0 0 0 / 0.22);
}
.gpanel > * + * {
  margin-top: 0.9rem;
}
.gpanel header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}
.gpanel h4 {
  margin-right: auto;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: #fff;
}
.gp-say {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}
.ent-scroll,
.tr-scroll,
.pm-scroll {
  overflow-x: auto;
}
.enttable small,
.trtable small {
  color: var(--faint);
  font-size: 0.66rem;
}
.enttable td.dr {
  color: #8bdcf7;
}
.enttable td.cr {
  color: #fcd98a;
}
.enttable td.book {
  color: #fff;
}
.enttable .z {
  color: var(--faint);
}
.enttable tr.ic td {
  background: rgb(45 212 191 / 0.06);
}
.ictag {
  margin-left: 0.4rem;
  padding: 0 0.3rem;
  border-radius: 0.3rem;
  background: rgb(45 212 191 / 0.14);
  font-size: 0.6rem;
  color: var(--chapter);
}
.enttable tfoot td {
  padding-top: 0.5rem;
  border-bottom: 0;
  color: var(--muted);
}
.enttable tfoot .okc {
  color: var(--ok);
}
.enttable tfoot .bad {
  color: var(--refuse);
}
.enttable .icrow td {
  white-space: normal;
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.45;
}
.ent-verdict {
  min-height: 4.2rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--soft);
}
.ent-verdict .fine {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
}
.ms {
  font: 400 0.7rem/1.4 var(--mono);
  color: var(--faint);
}

.trtable td.rate {
  white-space: nowrap;
  color: var(--muted);
}
.rk {
  display: inline-block;
  min-width: 5.6rem;
  margin-right: 0.45rem;
  padding: 0 0.35rem;
  border-radius: 0.3rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}
.rk.closing {
  background: rgb(45 212 191 / 0.14);
  color: var(--chapter);
}
.rk.average {
  background: rgb(76 201 240 / 0.14);
  color: var(--debit);
}
.rk.historical,
.rk.on {
  background: rgb(167 139 250 / 0.14);
  color: var(--known);
}
.cta-panel {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.cta-figs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.cta-figs > div {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}
.cta-figs small {
  display: block;
  font-size: 0.72rem;
  color: var(--faint);
}
.cta-figs b {
  display: block;
  font: 500 0.92rem/1.35 var(--mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.cta-figs span {
  display: block;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--muted);
}
.cta-figs .big {
  grid-column: 1 / -1;
  border-color: rgb(45 212 191 / 0.4);
  background: linear-gradient(120deg, rgb(45 212 191 / 0.08), transparent 70%);
}
.cta-figs .big.loss {
  border-color: rgb(251 113 133 / 0.4);
  background: linear-gradient(120deg, rgb(251 113 133 / 0.08), transparent 70%);
}
.cta-figs .big b {
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}
.cta-curve {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.cta-curve path {
  fill: none;
  stroke: var(--chapter);
  stroke-width: 2;
}
.cta-curve .zero {
  stroke: rgb(190 210 240 / 0.2);
  stroke-dasharray: 3 3;
}
.cta-curve text {
  font: 500 7.5px var(--mono);
  fill: var(--faint);
}
.cta-curve circle {
  fill: #fff;
  stroke: var(--chapter);
  stroke-width: 2;
}
.cta-check {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.45;
}

/* ---------- who: the persona matrix ---------- */
.personas > * + * {
  margin-top: 1.4rem;
}
.pmatrix {
  width: 100%;
  min-width: 52rem;
  border-collapse: separate;
  border-spacing: 3px;
  font: 500 0.72rem/1.3 var(--mono);
}
.pmatrix thead th {
  height: 8.2rem;
  padding: 0 0 0.4rem;
  vertical-align: bottom;
  font-weight: 500;
  color: var(--faint);
}
.pmatrix thead th span {
  display: inline-block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}
.pmatrix thead th.never {
  position: relative;
}
.pmatrix thead th.never::before {
  content: "";
  position: absolute;
  top: 0.1rem;
  left: 50%;
  width: 0.4rem;
  height: 0.4rem;
  margin-left: -0.2rem;
  border-radius: 50%;
  background: var(--refuse);
  box-shadow: 0 0 8px rgb(251 113 133 / 0.6);
}
.pmatrix thead th.corner {
  text-align: left;
  vertical-align: bottom;
}
.pmatrix tbody th {
  width: 14rem;
  padding: 0.45rem 0.8rem 0.45rem 0.65rem;
  border-radius: 0.6rem 0 0 0.6rem;
  text-align: left;
  font-weight: 400;
}
.pmatrix tbody th b {
  display: block;
  font: 650 0.86rem/1.25 var(--sans);
  color: var(--soft);
}
.pmatrix tbody th small {
  font-size: 0.66rem;
  color: var(--faint);
}
.pmatrix tbody tr {
  cursor: pointer;
  outline: none;
}
.pmatrix tbody tr:hover th b,
.pmatrix tbody tr:focus-visible th b {
  color: #fff;
}
.pmatrix tbody tr.sel th {
  background: rgb(45 212 191 / 0.1);
  box-shadow: inset 3px 0 0 var(--chapter);
}
.pmatrix tbody tr.sel th b {
  color: #fff;
}
.pmatrix td {
  height: 2.5rem;
  min-width: 1.7rem;
  border-radius: 0.35rem;
  background: rgb(255 255 255 / 0.025);
  text-align: center;
}
.pmatrix td i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 0.15rem;
  background: rgb(190 210 240 / 0.08);
  transition: transform 0.2s;
}
.pmatrix td.on {
  background: rgb(45 212 191 / 0.1);
}
.pmatrix td.on i {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 0.2rem;
  background: var(--chapter);
  box-shadow: 0 0 10px rgb(45 212 191 / 0.45);
}
.pmatrix tr.sel td.on {
  background: rgb(45 212 191 / 0.2);
}
.pmatrix tr.sel td.on i {
  transform: scale(1.15);
}
.pmatrix .col {
  background: rgb(255 255 255 / 0.06);
}
.pmatrix thead th.col {
  background: none;
  color: #fff;
}
.pmatrix td.count,
.pmatrix th.count {
  min-width: 2.6rem;
  background: none;
  color: var(--muted);
  font-size: 0.8rem;
}
.pcard {
  display: grid;
  gap: 1.2rem 2.2rem;
  padding: 1.3rem 1.35rem;
  border: 1px solid rgb(45 212 191 / 0.3);
  border-radius: 1.2rem;
  background: linear-gradient(135deg, rgb(45 212 191 / 0.07), rgb(0 0 0 / 0.2) 55%);
  animation: cardin 0.4s var(--ease);
}
.pcard[hidden] {
  display: none;
}
@keyframes cardin {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@media (min-width: 960px) {
  .pcard {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }
}
.pcard h4 {
  margin-top: 0.25rem;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}
.pcard blockquote {
  margin-top: 0.7rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--chapter);
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  line-height: 1.45;
  color: #fff;
}
.pc-gets {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
}
.pc-gets li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--soft);
}
.pc-gets li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.55rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 0.12rem;
  background: var(--chapter);
}
.pc-state {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}
.pc-side .micro {
  margin: 0.9rem 0 0.4rem;
}
.pc-side .micro:first-child {
  margin-top: 0;
}
.pc-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pc-profile b {
  font: 600 1.05rem/1.2 var(--mono);
  color: var(--chapter);
}
.pc-profile .ext {
  padding: 0 0.4rem;
  border: 1px solid var(--line-2);
  border-radius: 0.35rem;
  font: 500 0.66rem/1.6 var(--mono);
  color: var(--muted);
}
.pc-summary {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}
.pc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.pc-chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 0.5rem;
  background: rgb(0 0 0 / 0.25);
  font: 500 0.74rem/1.4 var(--mono);
  color: #fff;
}
.pc-chips .w {
  padding: 0 0.25rem;
  border-radius: 0.25rem;
  background: rgb(245 192 74 / 0.16);
  font-style: normal;
  font-size: 0.6rem;
  color: var(--credit);
}
.pc-chips.mcp li {
  border-color: rgb(244 114 182 / 0.3);
}
.pc-chips small {
  color: var(--faint);
}
.pc-see {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  font-size: 0.84rem;
}
.pc-see svg {
  width: 0.75rem;
  height: 0.75rem;
  margin-left: 0.2rem;
}

/* ---------- records: the wall ---------- */
.records > * + * {
  margin-top: 1.2rem;
}
.rcaveat {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 0.9rem;
  background: rgb(0 0 0 / 0.22);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}
.rcaveat .status {
  margin-right: 0.4rem;
}
.rcaveat b {
  color: #fff;
  font-weight: 600;
}
.rwall {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
}
.rtile {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.1rem 1.15rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.025), rgb(0 0 0 / 0.2));
  transition: border-color 0.25s;
}
.rtile:hover {
  border-color: rgb(45 212 191 / 0.4);
}
.rbig {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  margin-top: 0.35rem;
}
.rbig b {
  font: 750 clamp(2rem, 3.4vw, 2.6rem)/1 var(--sans);
  letter-spacing: -0.045em;
  background: linear-gradient(100deg, #fff 30%, var(--chapter));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rbig span {
  font: 500 0.78rem/1.3 var(--mono);
  color: var(--chapter);
}
.rtile h4 {
  margin-top: 0.35rem;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #fff;
}
.rart {
  min-height: 7.2rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgb(0 0 0 / 0.28);
}
.rran {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--soft);
}
.rnot {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}
.rnot span {
  margin-right: 0.4rem;
  padding: 0 0.35rem;
  border-radius: 0.3rem;
  background: rgb(251 113 133 / 0.12);
  font: 600 0.62rem/1.6 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--refuse);
}
.rlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin-top: auto;
  font-size: 0.82rem;
}
.rlinks a,
.pc-see a {
  display: inline-flex;
  align-items: center;
}
.rlinks svg {
  width: 0.75rem;
  height: 0.75rem;
  margin-left: 0.2rem;
}
.funnel {
  display: grid;
  gap: 0.45rem;
}
.funnel li {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  gap: 0 0.6rem;
  align-items: center;
  font-size: 0.74rem;
  line-height: 1.3;
  color: var(--muted);
}
.funnel .fbar {
  grid-column: 1 / -1;
  height: 0.38rem;
  margin-bottom: 0.2rem;
  width: var(--w);
  border-radius: 9px;
  background: linear-gradient(90deg, rgb(45 212 191 / 0.35), var(--chapter));
}
.funnel b {
  font: 500 0.82rem/1.3 var(--mono);
  color: #fff;
}
.agree {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}
.agree div {
  padding: 0.5rem 0.55rem;
  border: 1px solid rgb(74 222 128 / 0.35);
  border-radius: 0.6rem;
  background: rgb(74 222 128 / 0.05);
}
.agree b {
  display: block;
  font-size: 0.74rem;
  font-weight: 650;
  color: #fff;
}
.agree span {
  font: 500 0.7rem/1.4 var(--mono);
  color: var(--ok);
}
.agree span::before {
  content: "✓ ";
}
.agree p {
  grid-column: 1 / -1;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--muted);
}
.dots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(0.62rem, 1fr));
  gap: 0.22rem;
}
.dots i {
  aspect-ratio: 1;
  border-radius: 0.15rem;
  background: var(--ok);
  opacity: 0.75;
}
.dots i:nth-child(7n + 3) {
  opacity: 0.55;
}
.waterfall .micro {
  margin-bottom: 0.5rem;
  font-size: 0.6rem;
}
.wf-rows {
  display: grid;
  gap: 0.3rem;
}
.wf {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.5rem;
  align-items: center;
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 0.4s,
    transform 0.4s var(--ease);
}
.wf.in {
  opacity: 1;
  transform: none;
}
.wt {
  position: relative;
  height: 0.55rem;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.03);
}
.wt i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 2px;
}
.wf.up i {
  background: var(--chapter);
}
.wf.down i {
  background: var(--coral);
}
.wf.total i {
  background: linear-gradient(90deg, var(--refuse), #fda4af);
}
.wt em {
  position: absolute;
  top: -0.2rem;
  bottom: -0.2rem;
  width: 1px;
  background: rgb(190 210 240 / 0.35);
}
.wv {
  font: 500 0.7rem/1.3 var(--mono);
  text-align: right;
  color: #fff;
}
.wf.total {
  margin-top: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.wf.total .wl,
.wf.total .wv {
  color: #fff;
  font-weight: 600;
}
.wf-check {
  margin-top: 0.4rem;
  font-size: 0.7rem;
  line-height: 1.4;
}
.wf .wl {
  grid-area: 1 / 1;
}
.wf .wv {
  grid-area: 1 / 2;
}
.wf .wt {
  grid-area: 2 / 1 / 3 / 3;
}

@media (max-width: 560px) {
  .cta-figs {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- narrow screens ---------- */
.group-top > *,
.group-bottom > *,
.gp-grid > *,
.pcard > *,
.personas > * {
  min-width: 0;
}
.own-scroll,
.graph-scroll {
  overflow-x: auto;
}
.pcard code.k {
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .owngraph {
    min-width: 560px;
  }
  .pmatrix {
    min-width: 46rem;
  }
  .pmatrix tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 9.5rem;
    background: #0b1220;
  }
  .pmatrix tbody tr.sel th {
    background: #0c2228;
  }
  .pmatrix thead th.corner {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #0b1220;
  }
  .pcard {
    padding: 1.05rem 1rem;
  }
  .gpanel {
    padding: 0.9rem 0.85rem 1rem;
  }
}
.pc-state .status {
  white-space: normal;
}

/* ---------- 07-agents.css ---------- */
/* Chapter 07, agents: session, capabilities, surface. */

/* ---------- session ---------- */
.ag-session {
  display: grid;
  gap: 1.2rem;
  align-items: stretch;
}
@media (min-width: 1040px) {
  .ag-session {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
}
.ag-term {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: 1.1rem;
  background: #03060b;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.03);
  overflow: hidden;
}
.ag-term-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 0.02);
  font: 500 0.7rem/1.3 var(--mono);
  color: var(--faint);
}
.ag-term-bar .dots {
  display: flex;
  gap: 0.35rem;
}
.ag-term-bar .dots i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.1);
}
.ag-term-bar .dots i:first-child {
  background: rgb(244 114 182 / 0.55);
}
.ag-term-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-term-state {
  color: var(--chapter);
  white-space: nowrap;
}
.ag-term-lines {
  flex: 1 1 auto;
  height: 35rem;
  min-height: 0;
  overflow-y: auto;
  padding: 0.8rem 0.95rem 1.2rem;
  font: 400 0.72rem/1.55 var(--mono);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.ag-term-lines:empty::before {
  content: "Press play. agent-7 is about to be issued a token.";
  color: var(--faint);
}
.ag-term-lines li + li {
  margin-top: 0.85rem;
}
.ag-term-lines li.new {
  animation: slidein 0.35s var(--ease);
}
.ag-term-lines .cmd {
  color: #f8fafc;
  word-break: break-word;
}
.ag-term-lines .pr {
  font-weight: 600;
}
.ag-term-lines .who-agent .pr {
  color: var(--pink);
}
.ag-term-lines .who-controller .pr {
  color: var(--debit);
}
.ag-term-lines .who-approver .pr {
  color: var(--credit);
}
.ag-term-lines .fl {
  color: #9fb4d9;
}
.ag-term-lines .res {
  margin: 0.3rem 0 0;
  padding-left: 0.8rem;
  border-left: 2px solid var(--line-2);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--muted);
}
.ag-term-lines .res:has(.s) {
  color: var(--soft);
}
.ag-term-lines .res:has(.c) {
  border-left-color: rgb(244 114 182 / 0.35);
}
.ag-term .k {
  color: #9fb4d9;
}
.ag-term .s {
  color: #fde68a;
}
.ag-term .n {
  color: var(--debit);
}
.ag-term .b {
  color: var(--known);
}
.ag-term .el,
.ag-term .c {
  color: var(--faint);
}
.ag-term .c {
  font-style: italic;
}

.ag-gate {
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
}
.ag-lanes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  min-height: 12.8rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgb(0 0 0 / 0.25);
}
.ag-lane {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.55rem;
  border-radius: 0.8rem;
  background: rgb(255 255 255 / 0.02);
  transition:
    background-color 0.3s,
    box-shadow 0.3s;
}
.ag-lane b {
  font: 600 0.76rem/1.3 var(--sans);
  color: #fff;
}
.ag-lane small {
  font: 400 0.64rem/1.35 var(--mono);
  color: var(--faint);
}
.ag-lane[data-lane="0"] b {
  color: var(--pink);
}
.ag-lane[data-lane="3"] {
  background: rgb(74 222 128 / 0.04);
}
.ag-lane[data-lane="3"] b {
  color: var(--ok);
}
.ag-lane + .ag-lane::before {
  content: "";
  position: absolute;
  left: -0.25rem;
  top: 0.9rem;
  bottom: 0.9rem;
  border-left: 1px dashed var(--line-2);
}
.ag-lane.active {
  background: rgb(244 114 182 / 0.06);
}
.ag-lane.flash {
  background: rgb(251 113 133 / 0.12);
  box-shadow: inset 0 0 0 1px rgb(251 113 133 / 0.55);
  animation: gateflash 0.9s var(--ease);
}
.ag-lane.flash::after {
  content: attr(data-code);
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.55rem;
  padding: 0.2rem 0.35rem;
  border-radius: 0.4rem;
  background: rgb(251 113 133 / 0.18);
  font: 600 0.62rem/1.2 var(--mono);
  color: #fecdd3;
  text-align: center;
}
@keyframes gateflash {
  0% {
    box-shadow: inset 0 0 0 1px rgb(251 113 133 / 0.9), 0 0 24px rgb(251 113 133 / 0.35);
  }
}
.ag-tokens {
  position: absolute;
  inset: 3.3rem 0.35rem 2.2rem;
  pointer-events: none;
}
.ag-tok {
  --step: calc((100% - 1.05rem) / 4 + 0.35rem);
  position: absolute;
  left: calc(var(--lane) * var(--step) + 0.3rem);
  width: calc((100% - 1.05rem) / 4 - 0.6rem);
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line-3);
  border-radius: 0.6rem;
  background: #0b1220;
  font: 500 0.6rem/1.3 var(--mono);
  color: var(--soft);
  transition:
    left 0.7s var(--ease),
    border-color 0.3s,
    background-color 0.3s;
  animation: slidein 0.35s var(--ease);
}
.ag-tok[hidden] {
  display: none;
}
.ag-tok.t-acc {
  top: 0;
}
.ag-tok.t-jan {
  top: 3.7rem;
}
.ag-tok b {
  font: 600 0.72rem/1.25 var(--sans);
  color: #fff;
}
.ag-tok small {
  color: var(--muted);
}
.ag-tok b,
.ag-tok small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-tok span {
  font-weight: 600;
  color: var(--faint);
}
.ag-tok.ok {
  border-color: rgb(74 222 128 / 0.5);
}
.ag-tok.ok span {
  color: var(--ok);
}
.ag-tok.no {
  border-color: rgb(251 113 133 / 0.6);
  background: #1a0d14;
}
.ag-tok.no span {
  color: var(--refuse);
}
.ag-tok.wait {
  border-style: dashed;
}
.ag-tally {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.ag-tally p {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgb(0 0 0 / 0.22);
}
.ag-tally b {
  display: block;
  font: 600 1.45rem/1.15 var(--mono);
  color: var(--pink);
}
.ag-tally b.ok {
  color: var(--ok);
}
.ag-tally b.no {
  color: var(--refuse);
}
.ag-tally span {
  display: block;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
}
.ag-steps {
  display: grid;
  gap: 0.1rem;
  max-height: 25rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.ag-steps button {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  width: 100%;
  padding: 0.26rem 0.5rem;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0 0.5rem 0.5rem 0;
  background: none;
  font: 400 0.78rem/1.35 var(--sans);
  color: var(--faint);
  text-align: left;
  transition:
    color 0.2s,
    background-color 0.2s;
}
.ag-steps button:hover {
  color: var(--soft);
  background: rgb(255 255 255 / 0.03);
}
.ag-steps button .num {
  font: 500 0.68rem/1 var(--mono);
  color: var(--faint);
}
.ag-steps button.done {
  color: var(--muted);
}
.ag-steps button.on {
  border-left-color: var(--pink);
  background: rgb(244 114 182 / 0.07);
  color: #fff;
}
.ag-steps button.who-controller.on,
.ag-steps button.who-approver.on {
  border-left-color: var(--debit);
  background: rgb(76 201 240 / 0.07);
}
.ag-steps .live,
.caps .live {
  margin-left: auto;
  padding: 0.05rem 0.35rem;
  border-radius: 0.35rem;
  background: rgb(74 222 128 / 0.1);
  font: 600 0.58rem/1.4 var(--mono);
  font-style: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ok);
}
.session-controls {
  margin-top: 1rem;
}
.session-controls .i-play,
.session-controls .i-pause {
  display: contents;
}
.session-controls .btn.on .i-play,
.session-controls .btn:not(.on) .i-pause {
  display: none;
}
@media (max-width: 640px) {
  .ag-term-lines {
    height: 24rem;
    font-size: 0.66rem;
  }
  .ag-lanes {
    min-height: 11.5rem;
  }
  .ag-lane small {
    display: none;
  }
  .ag-tokens {
    inset: 2.6rem 0.35rem 2.1rem;
  }
  .ag-tok {
    font-size: 0.54rem;
    padding: 0.3rem;
  }
  .ag-tok b {
    white-space: normal;
  }
  .ag-tally b {
    font-size: 1.15rem;
  }
  .ag-steps {
    max-height: 14rem;
  }
}

/* ---------- capabilities ---------- */
.caps {
  display: grid;
  gap: 1.2rem;
  align-items: start;
}
@media (min-width: 1100px) {
  .caps {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
}
.caps-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.caps-matrix {
  border-collapse: separate;
  border-spacing: 2px;
  font: 400 0.7rem/1.2 var(--mono);
}
.caps-matrix thead th {
  height: 7.4rem;
  padding: 0 0 0.3rem;
  vertical-align: bottom;
  font-weight: 500;
  color: var(--faint);
}
.caps-matrix thead th:not(.corner) span {
  display: inline-block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}
.caps-matrix thead th .af {
  display: block;
  width: 0.4rem;
  height: 0.4rem;
  margin: 0.3rem auto 0;
  border-radius: 50%;
  background: var(--refuse);
}
.caps-matrix thead th.corner {
  text-align: left;
  vertical-align: bottom;
}
.caps-matrix tbody th {
  padding: 0;
  text-align: left;
}
.caps-matrix tbody th button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  min-width: 7.2rem;
  padding: 0.2rem 0.55rem;
  border: 0;
  border-radius: 0.45rem;
  background: none;
  font: 600 0.74rem/1.2 var(--sans);
  color: var(--soft);
  text-align: left;
}
.caps-matrix tbody th small {
  font: 400 0.58rem/1.2 var(--mono);
  color: var(--faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.caps-matrix tbody th button:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.04);
}
.caps-matrix td {
  width: 1.35rem;
  height: 1.7rem;
  padding: 0;
  border-radius: 0.3rem;
  background: rgb(255 255 255 / 0.03);
  text-align: center;
  transition: background-color 0.2s;
}
.caps-matrix td i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 0.18rem;
}
.caps-matrix td.has i {
  background: color-mix(in srgb, var(--debit) 65%, transparent);
}
.caps-matrix td.never {
  background: rgb(251 113 133 / 0.07);
}
.caps-matrix td.never i {
  width: 0.7rem;
  height: 1px;
  border-radius: 0;
  background: rgb(251 113 133 / 0.65);
  transform: rotate(-45deg);
}
.caps-matrix td.n {
  width: auto;
  padding: 0 0.4rem;
  background: none;
  color: var(--faint);
  text-align: right;
}
.caps-matrix tr.on th button {
  background: rgb(244 114 182 / 0.12);
  color: #fff;
}
.caps-matrix tr.on td {
  background: rgb(244 114 182 / 0.06);
}
.caps-matrix tr.on td.has i {
  background: var(--pink);
}
.caps-matrix tr.on td.n {
  background: none;
  color: var(--pink);
}
.caps-panel {
  padding: 1rem 1.05rem;
  border: 1px solid var(--line-2);
  border-radius: 1.1rem;
  background: rgb(0 0 0 / 0.25);
}
.caps-head h4 {
  margin: 0.15rem 0 0.25rem;
  font: 650 1.35rem/1.2 var(--sans);
  color: #fff;
}
.caps-head .sum {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}
.caps-head .score {
  margin-top: 0.5rem;
  font: 500 0.74rem/1.4 var(--mono);
  color: var(--faint);
}
.gate-text {
  color: var(--credit);
}
.caps-acts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem 0.35rem;
  margin-top: 0.8rem;
}
.caps-acts button {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: baseline;
  width: 100%;
  padding: 0.32rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  background: rgb(255 255 255 / 0.02);
  text-align: left;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}
.caps-acts .v {
  font: 700 0.74rem/1 var(--mono);
}
.caps-acts .what {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 500 0.75rem/1.35 var(--sans);
  color: var(--soft);
}
.caps-acts .code {
  font: 500 0.6rem/1 var(--mono);
  color: var(--faint);
}
.caps-acts .ok .v {
  color: var(--ok);
}
.caps-acts .no .v,
.caps-acts .no .code {
  color: rgb(251 113 133 / 0.8);
}
.caps-acts .ag-gate .v,
.caps-acts .ag-gate .code {
  color: var(--credit);
}
.caps-acts .no .what {
  color: var(--faint);
}
.caps-acts li.on button,
.caps-acts button:hover {
  border-color: var(--line-2);
  background: rgb(244 114 182 / 0.07);
}
.caps-acts li.on .what {
  color: #fff;
}
.caps-why {
  min-height: 9.5rem;
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.caps-why .vline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.3rem 0;
  font: 650 0.95rem/1.3 var(--mono);
}
.caps-why .vline.ok {
  color: var(--ok);
}
.caps-why .vline.no {
  color: var(--refuse);
}
.caps-why .vline.gate {
  color: var(--credit);
}
.caps-why .long {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}
.caps-why code {
  font-size: 0.72rem;
  color: var(--soft);
}
.caps-why .never {
  font-weight: 500;
  color: #fecdd3;
}
.caps-why .live {
  margin-left: 0;
}
@media (max-width: 560px) {
  .caps-acts {
    grid-template-columns: 1fr;
  }
}

/* ---------- surface ---------- */
.sf > * + * {
  margin-top: 1.2rem;
}
.surface-stats {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.surface-stats .read b {
  color: var(--chapter);
}
.surface-main {
  display: grid;
  gap: 1.2rem;
  align-items: start;
}
@media (min-width: 1000px) {
  .surface-main {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  }
}
.surface-map {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}
.surface-search input {
  width: 100%;
}
.sf-treemap {
  position: relative;
  border-radius: 0.9rem;
  overflow: hidden;
}
.sf-tile {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.4rem 0.5rem;
  border: 2px solid var(--ink);
  border-radius: 0.65rem;
  background: rgb(129 140 248 / 0.12);
  font: 500 0.72rem/1.2 var(--mono);
  color: var(--soft);
  text-align: left;
  overflow: hidden;
  transition:
    background-color 0.2s,
    opacity 0.25s,
    color 0.2s;
}
.sf-tile.dflt {
  background: rgb(244 114 182 / 0.2);
  color: #fff;
}
.sf-tile b {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sf-tile .num {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--chapter);
}
.sf-tile.dflt .num {
  color: var(--pink);
}
.sf-tile.small {
  padding: 0.2rem 0.3rem;
  font-size: 0.6rem;
}
.sf-tile.small .num {
  font-size: 0.75rem;
}
.sf-tile:hover,
.sf-tile.on {
  background: rgb(129 140 248 / 0.34);
  color: #fff;
}
.sf-tile.dflt:hover,
.sf-tile.dflt.on {
  background: rgb(244 114 182 / 0.38);
}
.sf-tile.dim {
  opacity: 0.18;
}
.sf .legend .k-default {
  --k: rgb(244 114 182 / 0.7);
}
.sf .legend .k-ondemand {
  --k: rgb(129 140 248 / 0.6);
}
.surface-detail {
  min-height: 22rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line-2);
  border-radius: 1.1rem;
  background: rgb(0 0 0 / 0.25);
}
.surface-detail h4 {
  margin: 0.15rem 0 0.35rem;
  font: 650 1.2rem/1.25 var(--mono);
  color: #fff;
}
.surface-detail h4 .num {
  margin-left: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--chapter);
}
.surface-detail .doc {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}
.surface-detail .doc + .doc {
  margin-top: 0.6rem;
}
.surface-detail .sf-tools,
.surface-detail .sf-verbs {
  display: grid;
  margin-top: 0.7rem;
}
.surface-detail .sf-tools li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
}
.surface-detail code.mcp {
  color: #fff;
  word-break: break-all;
}
.surface-detail code.cli {
  color: var(--debit);
  word-break: break-word;
}
.surface-detail .w {
  padding: 0.05rem 0.35rem;
  border-radius: 0.35rem;
  background: rgb(245 192 74 / 0.12);
  font: 600 0.58rem/1.4 var(--mono);
  font-style: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--credit);
}
.surface-detail .sf-verbs li {
  display: grid;
  gap: 0.1rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
}
.surface-detail .sf-verbs code {
  color: var(--debit);
}
.sf-envelope {
  display: grid;
  gap: 1rem 1.4rem;
  align-items: start;
}
@media (min-width: 1000px) {
  .sf-envelope {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}
.sf-envelope .micro {
  margin-bottom: 0.5rem;
}
.env-json {
  margin: 0;
  white-space: pre;
  font-size: 0.72rem;
}
.env-json .k.kt {
  border-radius: 0.25rem;
  transition:
    background-color 0.2s,
    color 0.2s;
  cursor: help;
}
.env-json .k.kt.on {
  background: rgb(244 114 182 / 0.18);
  color: #fff;
}
.env-keys {
  display: grid;
  margin-top: 1.6rem;
}
.env-keys li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.38rem 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  transition: background-color 0.2s;
}
.env-keys li > code {
  color: #9fb4d9;
}
.env-keys li.on {
  background: rgb(244 114 182 / 0.08);
  color: var(--soft);
}
.env-keys li.on > code {
  color: #fff;
}
@media (max-width: 560px) {
  .surface-detail .sf-tools li {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .surface-detail code.cli {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .env-keys li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

/* ---------- capabilities: legend and fix ---------- */
.caps-left {
  min-width: 0;
}
.caps-legend {
  margin-top: 0.9rem;
}
.caps-legend .k-has {
  --k: color-mix(in srgb, var(--debit) 65%, transparent);
}
.caps-legend .k-af {
  --k: var(--refuse);
}
.caps-legend .k-af::before {
  border-radius: 50%;
  transform: scale(0.7);
}
.caps-legend .k-never {
  --k: linear-gradient(135deg, transparent 45%, rgb(251 113 133 / 0.8) 45% 55%, transparent 55%), rgb(251 113 133 / 0.12);
}
.caps-legend .k-never::before {
  background: var(--k);
}
.caps-why .fix {
  display: block;
  margin-top: 0.55rem;
  padding: 0.5rem 0.65rem;
  border-left: 2px solid var(--line-3);
  border-radius: 0 0.5rem 0.5rem 0;
  background: rgb(255 255 255 / 0.025);
  color: var(--soft);
}
.caps-why .fix b {
  margin-right: 0.5rem;
  font: 600 0.62rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.caps-matrix td {
  width: 1.5rem;
  height: 1.85rem;
}
.sf-props {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0 0.9rem;
}
.sf-props li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 0.6rem;
  font-size: 0.78rem;
  color: var(--soft);
}
.sf-props b {
  font: 600 0.82rem/1.2 var(--mono);
  color: #fff;
}
.sf-props small {
  color: var(--faint);
  font-weight: 400;
}
.sf-props i {
  grid-column: 1 / -1;
  height: 0.45rem;
  border-radius: 9px;
  background:
    linear-gradient(90deg, var(--pink), #818cf8) no-repeat left / var(--w) 100%,
    rgb(255 255 255 / 0.06);
}
.surface-detail .hint {
  color: var(--faint);
}
.sf-envelope {
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1000px) {
  .sf-envelope {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}
.sf-envelope > * {
  min-width: 0;
}
@media (max-width: 640px) {
  .ag-lane {
    padding: 0.5rem 0.4rem;
  }
  .ag-lane b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
  }
  .ag-lane.flash::after {
    left: 0.25rem;
    right: 0.25rem;
    font-size: 0.56rem;
  }
}

/* ---------- 08-engine.css ---------- */
/* Chapter 08, the engine: architecture, invariants, compare. */

/* ---------- architecture ---------- */
.arch {
  display: grid;
  gap: 1.2rem;
  align-items: start;
}
@media (min-width: 1080px) {
  .arch {
    grid-template-columns: minmax(0, 1fr) 19rem;
  }
}
.arch-graph {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.arch-svg {
  display: block;
  width: 100%;
  min-width: 46rem;
  height: auto;
}
.arch-svg .lab {
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  fill: var(--faint);
}
.arch-svg .rule {
  stroke: var(--line-2);
  stroke-dasharray: 3 5;
}
.arch-svg .edges path,
.arch-svg .ext-edges path {
  fill: none;
  stroke: rgb(129 140 248 / 0.16);
  stroke-width: 1;
  transition:
    stroke 0.2s,
    opacity 0.2s;
}
.arch-svg .ext-edges path {
  stroke: rgb(190 210 240 / 0.08);
  stroke-dasharray: 2 4;
}
.arch-svg.focus path {
  opacity: 0.25;
}
.arch-svg.focus path.hit {
  opacity: 1;
  stroke: var(--debit);
  stroke-width: 1.6;
}
.arch-svg.focus path.hit.down {
  stroke: var(--chapter);
}
.arch-svg .node {
  cursor: pointer;
  outline: none;
  transition: opacity 0.2s;
}
.arch-svg .node rect:first-child {
  fill: color-mix(in srgb, var(--c, #818cf8) 13%, #070b14);
  stroke: color-mix(in srgb, var(--c, #818cf8) 55%, transparent);
  stroke-width: 1;
  transition:
    fill 0.2s,
    stroke 0.2s;
}
.arch-svg .node .lb {
  fill: var(--c, #818cf8);
  opacity: 0.7;
}
.arch-svg .node text {
  font: 500 11.5px/1 var(--mono);
  fill: #e8eef7;
  pointer-events: none;
}
.arch-svg .node.fam rect:first-child {
  fill: rgb(255 255 255 / 0.03);
  stroke: var(--line-3);
  stroke-dasharray: 3 3;
}
.arch-svg .node.fam text {
  fill: var(--muted);
  font-size: 10px;
}
.arch-svg.focus .node {
  opacity: 0.3;
}
.arch-svg.focus .node.near {
  opacity: 1;
}
.arch-svg .node:hover rect:first-child,
.arch-svg .node:focus-visible rect:first-child,
.arch-svg .node.on rect:first-child {
  fill: color-mix(in srgb, var(--c, #818cf8) 32%, #070b14);
  stroke: var(--c, #818cf8);
  stroke-width: 1.5;
}
.arch-side {
  min-height: 26rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line-2);
  border-radius: 1.1rem;
  background: rgb(0 0 0 / 0.25);
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}
.arch-side h4 {
  margin: 0.15rem 0 0.4rem;
  font: 650 1.15rem/1.25 var(--mono);
  color: #fff;
}
.arch-side p + p {
  margin-top: 0.55rem;
}
.arch-side .desc {
  font-size: 0.8rem;
}
.arch-side .nums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.8rem 0;
}
.arch-side .nums p {
  margin: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}
.arch-side .nums b {
  display: block;
  font: 600 1rem/1.2 var(--mono);
  color: #fff;
}
.arch-side .nums b.ok-text {
  color: var(--ok);
}
.arch-side .nums span {
  font-size: 0.68rem;
  color: var(--faint);
}
.arch-side .k {
  margin-top: 0.7rem;
  font: 500 0.64rem/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.arch-side .names {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}
.arch-side .names code {
  padding: 0.05rem 0.35rem;
  border-radius: 0.35rem;
  background: rgb(129 140 248 / 0.1);
  font-size: 0.7rem;
  color: var(--soft);
}
.arch-side .none {
  font-size: 0.75rem;
  color: var(--faint);
}
.arch-side .legend {
  margin-top: 0.8rem;
}
.arch-stats {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  margin-top: 1.2rem;
}
.arch-stats .read b {
  color: var(--chapter);
}

/* ---------- invariants ---------- */
.inv-fig {
  display: grid;
  gap: 1.2rem;
  align-items: start;
}
@media (min-width: 1080px) {
  .inv-fig {
    grid-template-columns: minmax(0, 1fr) 22rem;
  }
}
.inv-grid {
  display: grid;
  gap: 0.15rem;
}
.inv-row {
  display: grid;
  grid-template-columns: minmax(10rem, 15rem) minmax(0, 1fr) 3rem;
  gap: 0.8rem;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.6rem;
  transition: background-color 0.2s;
}
.inv-row:hover,
.inv-row.on {
  background: rgb(129 140 248 / 0.06);
}
.inv-name {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  min-width: 0;
  font: 500 0.82rem/1.3 var(--sans);
  color: var(--soft);
}
.inv-name .num {
  font: 500 0.68rem/1 var(--mono);
  color: var(--chapter);
}
.inv-row .cl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.inv-count {
  font: 500 0.7rem/1 var(--mono);
  color: var(--faint);
  text-align: right;
}
/* One clause: a chip in the colour of its strongest checker; hollow and dashed while dormant. */
.inv-fig .c {
  --s: var(--chapter);
  display: block;
  height: 1.45rem;
  padding: 0 0.45rem;
  border: 1px solid color-mix(in srgb, var(--s) 60%, transparent);
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--s) 20%, transparent);
  font: 500 0.64rem/1 var(--mono);
  color: color-mix(in srgb, var(--s) 45%, #fff);
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.inv-fig .c.dormant {
  background: none;
  border-style: dashed;
  color: var(--faint);
}
.inv-fig .c:hover,
.inv-fig .c.on {
  border-color: var(--s);
  background: color-mix(in srgb, var(--s) 42%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--s) 18%, transparent);
  color: #fff;
}
:is(.inv-fig, .inv-legend) .s-differential {
  --s: #818cf8;
}
:is(.inv-fig, .inv-legend) .s-negative_fixture {
  --s: var(--refuse);
}
:is(.inv-fig, .inv-legend) .s-unit {
  --s: var(--debit);
}
:is(.inv-fig, .inv-legend) .s-exhaustive {
  --s: var(--ok);
}
:is(.inv-fig, .inv-legend) .s-model,
:is(.inv-fig, .inv-legend) .s-property {
  --s: var(--credit);
}
:is(.inv-fig, .inv-legend) .s-none {
  --s: var(--faint);
}
.inv-legend {
  margin-top: 1rem;
}
.inv-legend li {
  --k: color-mix(in srgb, var(--s) 70%, transparent);
}
.inv-legend .s-none {
  --k: transparent;
}
.inv-legend .s-none::before {
  border: 1px dashed var(--faint);
}
.inv-detail {
  min-height: 27rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line-2);
  border-radius: 1.1rem;
  background: rgb(0 0 0 / 0.25);
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}
.inv-detail h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.15rem 0 0.45rem;
  font: 650 1.15rem/1.25 var(--sans);
  color: #fff;
}
.inv-detail h4 code {
  font-size: 1.05rem;
}
.inv-detail .chip {
  padding: 0.08rem 0.45rem;
  border-radius: 0.4rem;
  font: 600 0.62rem/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.inv-detail .chip.live {
  background: rgb(74 222 128 / 0.12);
  color: var(--ok);
}
.inv-detail .chip.dormant {
  background: rgb(255 255 255 / 0.06);
  color: var(--faint);
}
.inv-detail .stmt {
  color: var(--soft);
}
.inv-detail .facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.8rem 0 0.3rem;
}
.inv-detail .facts p {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}
.inv-detail .facts small {
  display: block;
  font-size: 0.66rem;
  color: var(--faint);
}
.inv-detail .facts b {
  font: 600 0.78rem/1.3 var(--mono);
  color: var(--s, #fff);
  word-break: break-word;
}
.inv-detail .k {
  margin-top: 0.75rem;
  font: 500 0.64rem/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.inv-detail .tests {
  display: grid;
  margin-top: 0.25rem;
}
.inv-detail .tests li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.74rem;
  line-height: 1.4;
}
.inv-detail .tests .crate {
  font-size: 0.66rem;
  color: #a5b4fc;
}
.inv-detail .tests.neg .crate {
  color: #fda4af;
}
.inv-detail .tests .inv-more {
  display: block;
  color: var(--faint);
}
.inv-detail .hint {
  margin-top: 0.8rem;
  font-size: 0.78rem;
  color: var(--faint);
}
.inv-bars {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.6rem;
}
.inv-bars li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 2rem;
  grid-template-rows: auto auto;
  gap: 0 0.6rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--soft);
}
.inv-bars i {
  height: 0.55rem;
  border-radius: 9px;
  background: linear-gradient(90deg, var(--s), var(--s)) no-repeat left / var(--w) 100%, rgb(255 255 255 / 0.05);
}
.inv-bars li.s-none i {
  background: repeating-linear-gradient(90deg, var(--faint) 0 3px, transparent 3px 6px) no-repeat left / var(--w) 100%, rgb(255 255 255 / 0.05);
}
.inv-bars b {
  font: 600 0.8rem/1 var(--mono);
  color: #fff;
  text-align: right;
}
.inv-bars small {
  grid-column: 2 / -1;
  font-size: 0.68rem;
  color: var(--faint);
}
.inv-detail .gates {
  display: flex;
  gap: 1rem;
  margin-top: 0.3rem;
  font: 400 0.78rem/1.3 var(--mono);
  color: var(--muted);
}
.inv-detail .gates b {
  color: #fff;
}
@media (max-width: 640px) {
  .inv-row {
    grid-template-columns: minmax(0, 1fr) 2.4rem;
    gap: 0.35rem 0.5rem;
    padding: 0.4rem 0.3rem;
  }
  .inv-row .cl {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .inv-fig .c {
    height: 1.7rem;
  }
  .inv-detail .facts {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- compare ---------- */
.cmp-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.cmp-status {
  font: 400 0.76rem/1.5 var(--mono);
  color: var(--muted);
}
.status.red {
  color: var(--refuse);
  background: rgb(251 113 133 / 0.12);
}
.cmp-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.cmp {
  width: 100%;
  min-width: 56rem;
  border-collapse: collapse;
  font-size: 0.78rem;
  line-height: 1.45;
}
.cmp thead th {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line-2);
  font: 600 0.72rem/1.3 var(--sans);
  color: var(--soft);
  text-align: left;
  vertical-align: bottom;
}
.cmp thead th.fa {
  color: var(--chapter);
}
.cmp tbody tr[data-row] {
  cursor: pointer;
  transition: background-color 0.2s;
}
.cmp tbody tr[data-row]:hover,
.cmp tbody tr[data-row].open {
  background: rgb(129 140 248 / 0.05);
}
.cmp tbody tr[data-row]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--chapter) 70%, transparent);
  outline-offset: -2px;
}
.cmp tbody th {
  width: 12rem;
  padding: 0.6rem;
  border-top: 1px solid var(--line);
  font: 600 0.8rem/1.35 var(--sans);
  color: #fff;
  text-align: left;
  vertical-align: top;
}
.cmp tbody th::before {
  content: "+";
  display: inline-block;
  width: 1rem;
  font: 500 0.8rem/1 var(--mono);
  color: var(--faint);
}
.cmp tbody tr.open th::before {
  content: "−";
  color: var(--chapter);
}
.cmp td {
  padding: 0.6rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
  color: var(--muted);
}
.cmp td.fa {
  background: rgb(129 140 248 / 0.07);
  color: var(--soft);
}
.cmp td code {
  font-size: 0.7rem;
  color: var(--soft);
}
.cmp .m {
  display: inline-grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  margin-right: 0.45rem;
  border-radius: 0.35rem;
  font: 700 0.68rem/1 var(--mono);
  vertical-align: 0.05em;
}
.cmp .m.yes {
  background: rgb(74 222 128 / 0.14);
  color: var(--ok);
}
.cmp .m.part {
  background: rgb(245 192 74 / 0.12);
  color: var(--credit);
}
.cmp .m.no {
  background: rgb(251 113 133 / 0.12);
  color: var(--refuse);
}
.cmp .m.na {
  background: rgb(255 255 255 / 0.05);
  color: var(--faint);
}
.cmp tr.why {
  display: none;
}
.cmp tr.why.open {
  display: table-row;
}
.cmp tr.why td {
  padding: 0 0.6rem 0.7rem 1.6rem;
  border-top: 0;
  font-size: 0.74rem;
  font-style: italic;
  color: var(--faint);
  animation: slidein 0.3s var(--ease);
}
.cmp-not {
  margin-top: 1rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}
.cmp-not b {
  color: #fff;
}
.cmp thead .strip {
  display: flex;
  gap: 3px;
  margin-top: 0.45rem;
}
.cmp thead .strip i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.08);
}
.cmp thead .strip i.yes {
  background: var(--ok);
}
.cmp thead .strip i.part {
  background: color-mix(in srgb, var(--credit) 75%, transparent);
}
.cmp thead .strip i.no {
  background: color-mix(in srgb, var(--refuse) 70%, transparent);
}
/* Phones: each row becomes a card, each cell labelled with its category. */
@media (max-width: 720px) {
  .cmp-scroll {
    overflow: visible;
  }
  .cmp,
  .cmp tbody,
  .cmp tr,
  .cmp tbody th,
  .cmp td {
    display: block;
  }
  .cmp {
    min-width: 0;
  }
  .cmp thead {
    display: none;
  }
  .cmp tbody tr[data-row] {
    padding: 0.5rem 0 0.6rem;
    border-top: 1px solid var(--line-2);
  }
  .cmp tbody th {
    width: auto;
    padding: 0.2rem 0.4rem 0.4rem;
    border-top: 0;
  }
  .cmp td {
    position: relative;
    padding: 0.3rem 0.4rem 0.3rem 7rem;
    border-top: 0;
  }
  .cmp td::before {
    content: attr(data-cat);
    position: absolute;
    left: 0.4rem;
    top: 0.42rem;
    width: 6.2rem;
    font: 500 0.62rem/1.3 var(--mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .cmp td.fa {
    border-radius: 0.5rem;
  }
  .cmp td.fa::before {
    color: var(--chapter);
  }
  .cmp tr.why.open {
    display: block;
  }
  .cmp tr.why td {
    padding: 0.2rem 0.4rem 0.7rem;
  }
  .cmp tr.why td::before {
    content: none;
  }
}
