/* ---------- 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;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: clamp(6.2rem, 13vh, 8.5rem) 0 clamp(2rem, 4vw, 3.4rem);
}
.hero-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: center;
}
.hero .d1 {
  margin-top: 1.4rem;
  font-size: clamp(2.6rem, 11vw, 4.6rem);
}
.hero .lede {
  max-width: 34rem;
  margin-top: 1.5rem;
}
.hero-stage {
  min-width: 0;
}
@media (min-width: 1100px) {
  .hero {
    min-height: min(100svh, 62rem);
    display: flex;
    align-items: center;
  }
  .hero > .wrap {
    flex: 1;
  }
  .hero-grid {
    grid-template-columns: minmax(0, 4.3fr) minmax(0, 7.7fr);
    gap: clamp(2.5rem, 4vw, 4.5rem);
  }
  .hero .d1 {
    font-size: clamp(3.6rem, 5.3vw, 5.6rem);
  }
}
.pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgb(74 222 128 / 0.22);
  border-radius: 99rem;
  background: rgb(6 20 13 / 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);
}
@media (max-width: 479px) {
  .hero .lede {
    font-size: 1.04rem;
    line-height: 1.55;
  }
  .hero .cta {
    gap: 0.55rem;
  }
  .hero .cta .btn {
    flex: 1 1 auto;
    padding-inline: 0.8rem;
  }
}

/* ---------- Stats ---------- */
.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;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.stats strong {
  display: block;
  margin: 0.5rem 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--life-2);
  transition: color 0.2s;
}
.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 li:first-child {
    border-top: 0;
  }
  .stats a {
    display: grid;
    /* Wide enough for the longest figure, 64,657, to keep clear of its label. */
    grid-template-columns: 7rem 1fr;
    column-gap: 0.9rem;
    padding: 1rem 0;
  }
  .stats b {
    grid-row: span 2;
    font-size: 1.85rem;
  }
  .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: 44rem;
  margin-top: 1.5rem;
}
.kick .num {
  font-family: var(--mono);
  color: var(--chapter);
  letter-spacing: 0.04em;
}
.kick.small {
  margin-bottom: 0.9rem;
  color: var(--muted);
}
.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;
}
.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.24rem);
  line-height: 1.55;
  letter-spacing: -0.011em;
  color: var(--soft);
  text-wrap: pretty;
}
.kicker code,
.opener .lede code,
.libcta .lede code {
  font-size: 0.86em;
  padding: 0.08em 0.34em;
  border-radius: 0.35em;
  background: color-mix(in srgb, var(--chapter) 9%, transparent);
  color: color-mix(in srgb, var(--chapter) 35%, #fff);
}
.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;
  min-height: 2.75rem;
  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);
}

/* ---------- The six cards ---------- */
.bento {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
.bento > li {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.028), transparent 46%), var(--raise);
  transition: border-color 0.3s;
}
.bento > li:hover {
  border-color: color-mix(in srgb, var(--art) 38%, transparent);
}
.bento-art {
  position: relative;
  aspect-ratio: 2 / 1;
  overflow: clip;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(22rem 12rem at 50% 110%, color-mix(in srgb, var(--art) 13%, transparent), transparent 75%), #040906;
}
/* Out of flow: in Safari an SVG's height would otherwise widen the column it sits in. */
.bento-art svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.8s var(--ease);
}
/* One card per row on a phone: a shorter drawing keeps six cards from filling five screens. */
@media (max-width: 699px) {
  .bento-art {
    aspect-ratio: 5 / 2;
  }
}
.bento > li:hover .bento-art svg {
  transform: scale(1.025);
}
.bento-art :is(.a-frame, .a-line, .a-dim, .a-hot, .a-scan, .a-cross, .a-link) {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bento-art .a-frame {
  stroke: color-mix(in srgb, var(--art) 45%, #2a3a32);
  stroke-width: 2;
}
.bento-art .a-dim {
  stroke: rgb(190 240 212 / 0.16);
  stroke-width: 6;
}
.bento-art .a-line {
  stroke: var(--art);
  stroke-width: 3;
}
.bento-art .a-hot {
  stroke: var(--art);
  stroke-width: 2.5;
  fill: color-mix(in srgb, var(--art) 10%, transparent);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--art) 55%, transparent));
}
.bento-art .a-scan {
  stroke: var(--art);
  stroke-width: 2;
  opacity: 0.8;
}
.bento-art .a-cross {
  stroke: #fb7185;
  stroke-width: 3;
}
.bento-art .a-link {
  stroke: var(--art);
  stroke-width: 2;
  stroke-dasharray: 3 5;
}
.bento-art .a-mask {
  fill: var(--art);
  opacity: 0.85;
}
.bento-art .a-hot-dot {
  fill: var(--art);
}
.bento-art text {
  font: 600 13px var(--mono);
  fill: var(--art);
}
@media (prefers-reduced-motion: no-preference) {
  .bento-art .a-scan {
    animation: scan 3.2s var(--ease) infinite;
  }
}
@keyframes scan {
  0% {
    transform: translateY(-38px);
    opacity: 0;
  }
  30%,
  70% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(20px);
    opacity: 0;
  }
}
.bento-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.35rem 1.5rem 1.5rem;
}
.bento-copy .micro {
  color: var(--art);
}
.bento-copy h4 {
  margin-top: 0.5rem;
  font-size: 1.34rem;
  font-weight: 750;
  letter-spacing: -0.034em;
  line-height: 1.15;
  color: #fff;
}
.bento-copy > p:not(.micro, .tags) {
  margin: 0.6rem 0 1.15rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--soft);
  text-wrap: pretty;
}
.bento-copy code {
  font-size: 0.88em;
  color: color-mix(in srgb, var(--art) 40%, #fff);
}
.bento-copy .tags {
  margin-top: auto;
}
.bento-copy .tag {
  color: color-mix(in srgb, var(--art) 55%, #fff);
}
@media (min-width: 700px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .bento {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* ---------- Figures ---------- */
.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(6 14 10 / 0.86);
  /* 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);
}
.fig-foot code {
  font-size: 0.92em;
  color: var(--soft);
}

/* ---------- 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.75rem;
  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));
}
.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 240 212 / 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 240 212 / 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.75rem;
  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 240 212 / 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);
}
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
/* A chip that is a control reads neutral until chosen, then takes its chapter's color; green is for links. */
button.tag {
  background: none;
  min-height: 2.2rem;
  color: var(--soft);
  cursor: pointer;
}
button.tag:hover,
button.tag[aria-pressed="true"] {
  border-color: var(--chapter);
  color: #fff;
}
button.tag[aria-pressed="true"] {
  background: color-mix(in srgb, var(--chapter) 12%, transparent);
}
.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 {
  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);
}
.sev-info {
  --k: var(--info);
}
.sev-warning {
  --k: var(--warning);
}
.sev-critical {
  --k: var(--critical);
}

/* ---------- Terminal panes ---------- */
.term {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: #030806;
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid var(--line);
  font: 500 0.74rem/1 var(--mono);
  color: var(--faint);
}
.term-bar i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--line-2);
}
.term-bar span {
  margin-left: 0.5rem;
}
.term-body {
  flex: 1;
  margin: 0;
  padding: 1rem 1.1rem;
  font: 400 0.86rem/1.6 var(--term);
  color: #cfe5d7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.term .dim,
.steps-term .dim {
  color: var(--faint);
}
.term .ok {
  color: var(--life);
}
.term .bad {
  color: var(--coral);
}
.term .warn {
  color: var(--amber);
}

/* ---------- Stories ---------- */
.storyfig {
  display: grid;
  overflow: hidden;
}
.storyfig > .fig-body {
  display: contents;
}
/* The rail fills the corners, where the frame's brackets would sit on the first tab. */
.sec .storyfig::before,
.sec .storyfig::after {
  display: none;
}
.story-rail {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}
.story-list {
  position: relative;
  display: flex;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-3) transparent;
}
.story-list a {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr);
  gap: 0 0.7rem;
  align-items: baseline;
  min-height: 2.75rem;
  padding: 0.75rem 1.1rem;
  border-left: 2px solid transparent;
  color: var(--soft);
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
}
.story-list a:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.025);
}
.story-list .num {
  font-size: 0.74rem;
  color: var(--muted);
}
.story-list b {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.4;
}
.story-list [aria-current] {
  border-left-color: var(--chapter);
  background: color-mix(in srgb, var(--chapter) 8%, transparent);
  color: #fff;
}
.story-list [aria-current] .num {
  color: var(--chapter);
}
.story-stage {
  position: relative;
  z-index: 0;
  display: grid;
  min-width: 0;
  padding: clamp(1.3rem, 2.6vw, 2.4rem);
}
.story h4 {
  max-width: 20em;
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  text-wrap: balance;
  color: #fff;
}
.ba {
  display: grid;
  gap: 1rem;
  margin-top: 1.6rem;
}
@media (min-width: 760px) {
  .ba {
    grid-template-columns: 1fr 1fr;
  }
}
.ba > div {
  padding: 1.15rem 1.25rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgb(255 255 255 / 0.016);
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.58;
  color: var(--soft);
  text-wrap: pretty;
}
.ba .micro {
  margin-bottom: 0.55rem;
}
.ba .after {
  border-color: rgb(74 222 128 / 0.24);
  background: linear-gradient(150deg, rgb(74 222 128 / 0.07), rgb(74 222 128 / 0.012));
  color: #f0f7f2;
}
.ba .after .micro {
  color: var(--life-2);
}
.ba code {
  font: 0.86em/1.5 var(--term);
  overflow-wrap: anywhere;
  color: #d8f39a;
}
.story .more {
  margin-top: 1.3rem;
}
.story-nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.story-nav .btn {
  width: 2.75rem;
  padding: 0;
}
.story-nav svg {
  width: 1rem;
  height: 1rem;
}
html:not(.js) .story + .story {
  margin-top: 2.6rem;
}
/* Every story takes the same cell, so changing stories never moves what is below. */
.js .story {
  grid-area: 1 / 1;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.35s,
    transform 0.45s var(--ease),
    visibility 0s 0.35s;
}
.js .story.on {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}
.js .story-nav {
  grid-area: 2 / 1;
}
/* The step buttons keep their room before the script arrives, and stay out of the page without one. */
html:not(.js) .story-nav {
  display: none;
}
.js .storyfig:not([data-ready]) .story-nav {
  visibility: hidden;
}
@media (max-width: 999px) {
  .story-list a {
    display: flex;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  .story-list [aria-current] {
    border-bottom-color: var(--chapter);
  }
  /* Only the open story takes room, so a short one leaves no gap under it. */
  .js .story:not(.on) {
    display: none;
  }
}
@media (min-width: 1000px) {
  .storyfig {
    grid-template-columns: 21rem minmax(0, 1fr);
  }
  .story-rail {
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .story-list {
    flex-direction: column;
    height: 100%;
  }
  .story-list li {
    flex: 1;
  }
  .story-list li + li {
    border-top: 1px solid var(--line);
  }
  .story-list a {
    height: 100%;
    align-items: center;
  }
  .story-stage {
    grid-template-rows: 1fr auto;
  }
}

/* ---------- Workflows ---------- */
.flows {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
}
/* In three columns the workflow with the longest rule list takes two, so the last row is full. */
@media (min-width: 1180px) {
  .flows {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: dense;
  }
  .flows li.wide {
    grid-column: span 2;
  }
}
.flows li {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--raise);
}
.flow-name code {
  font: 600 0.92rem/1.3 var(--term);
  color: color-mix(in srgb, var(--chapter) 50%, #fff);
}
.flow-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--soft);
}
.flow-text code {
  font-size: 0.9em;
  color: #fff;
}
.flow-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: auto;
  padding-top: 0.4rem;
}
.flow-rules .tag {
  min-height: 1.5rem;
  font-size: 0.68rem;
  color: var(--muted);
}

/* ---------- Incidents ---------- */
.incident {
  display: grid;
  gap: 1rem;
}
.bundle {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.bundle > div {
  padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 0.015);
}
.bundle dt {
  font-weight: 650;
  font-size: 0.95rem;
  color: #fff;
}
.bundle dd {
  margin-top: 0.25rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Guarantees and practices ---------- */
.guarantees,
.practices {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}
/* Six guarantees fill two rows of three, never a row of four and a row of two. */
@media (min-width: 1000px) {
  .guarantees {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.guarantees li,
.practices li {
  position: relative;
  padding: 1.2rem 1.3rem 1.3rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--raise);
}
.guarantees li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.3rem;
  width: 2px;
  height: 1.3rem;
  border-radius: 2px;
  background: var(--chapter);
}
.guarantees h4,
.practices h4 {
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.guarantees p,
.practices p {
  margin-top: 0.4rem;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--soft);
  text-wrap: pretty;
}
.guarantees code,
.practices code {
  font-size: 0.88em;
  color: color-mix(in srgb, var(--chapter) 40%, #fff);
}
.numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
  border-block: 1px solid var(--line);
}
.numbers li {
  padding: 1.4rem 1.2rem 1.5rem 0;
}
.numbers b {
  display: block;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.numbers span {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.86rem;
  color: color-mix(in srgb, var(--chapter) 55%, #fff);
}
.practices {
  margin-top: 1.8rem;
}

/* ---------- Install and closing ---------- */
.libcta {
  position: relative;
  isolation: isolate;
  overflow: clip;
  border-top: 1px solid var(--line);
  padding-block: clamp(5rem, 11vw, 9rem);
  scroll-margin-top: 1rem;
}
.libcta .lede {
  max-width: 40rem;
  margin-top: 1.4rem;
}
.install-grid {
  display: grid;
  gap: 2.2rem clamp(2.4rem, 5vw, 5rem);
  align-items: start;
}
@media (min-width: 1000px) {
  .install-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}
.copyline {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.6rem 0.6rem 1.1rem;
  border: 1px solid rgb(74 222 128 / 0.35);
  border-radius: 1rem;
  background: #04100a;
  box-shadow: 0 0 0 4px rgb(74 222 128 / 0.05);
}
/* Wrapped, so the whole command that goes to bash is in view. */
.copyline code {
  flex: 1;
  min-width: 0;
  font: 400 0.86rem/1.6 var(--term);
  overflow-wrap: anywhere;
  color: #e7fbe9;
}
.copyline .btn {
  flex: none;
}
.steps-term {
  margin-top: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #030806;
  font: 400 0.86rem/1.7 var(--term);
  color: #cfe5d7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.libcta .cta {
  margin-top: 1.4rem;
}
.libcta .paths {
  margin-top: clamp(3rem, 6vw, 5rem);
}
@media (min-width: 1100px) {
  .libcta .paths {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.noscript {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 0.8rem;
  color: var(--soft);
  font-size: 0.9rem;
}

/* ---------- Phones ---------- */
@media (max-width: 899px) {
  .sec {
    scroll-margin-top: -2.4rem;
  }
}
@media (max-width: 400px) {
  .hero .pill {
    font-size: min(0.625rem, 2.75vw);
    letter-spacing: 0.06em;
  }
}

/* ---------- claims.css ---------- */
/* The claims ledger: a status filter and one row per claim. */
.claimsfig .claims-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.claimsfig .claims-filter[hidden],
.claimsfig .claims-shown[hidden],
.claimsfig .claims-more[hidden],
.claimsfig .claim[hidden] {
  display: none;
}
/* The opening view is drawn on the server; without scripts every claim is listed and the controls are left out. */
html:not(.js) .claimsfig :is(.claims-filter, .claims-shown, .claims-more),
.js .claimsfig:not([data-ready]) .claim.later {
  display: none;
}
.claims-filter button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.6rem 0.35rem 0.95rem;
  border: 1px solid var(--line-2);
  border-radius: 99rem;
  background: none;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--soft);
  transition:
    border-color 0.2s,
    background-color 0.2s,
    color 0.2s;
}
.claims-filter button:hover {
  border-color: var(--line-3);
  color: #fff;
}
.claims-filter button span {
  min-width: 1.6rem;
  padding: 0.22rem 0.45rem;
  border-radius: 99rem;
  background: rgb(255 255 255 / 0.06);
  font: 500 0.74rem/1 var(--mono);
  text-align: center;
  color: var(--muted);
}
.claims-filter button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--chapter) 60%, transparent);
  background: color-mix(in srgb, var(--chapter) 11%, transparent);
  color: #fff;
}
.claims-filter button[aria-pressed="true"] span {
  background: color-mix(in srgb, var(--chapter) 22%, transparent);
  color: #fff;
}
.claimsfig .dot {
  display: inline-block;
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
}
.claimsfig .dot.ships {
  background: var(--life);
}
.claimsfig .dot.partial {
  background: var(--sky);
}
.claimsfig .dot.bench {
  background: var(--amber);
}
.claimsfig .dot.notyet {
  background: var(--coral);
}
.claims-shown {
  margin-top: 0.9rem !important;
  font-size: 0.82rem;
  color: var(--muted);
}
.claims {
  border-top: 1px solid var(--line);
}
.fig-body > .claims {
  margin-top: 0.7rem;
}
.claims-more {
  margin-top: 1.1rem !important;
}
.claims-more .btn {
  min-height: 2.75rem;
}
.claim {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 1rem;
  padding: 0.9rem 0 0.95rem;
  border-bottom: 1px solid var(--line);
}
.claim-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font: 500 0.74rem/1.4 var(--mono);
  color: var(--soft);
}
.claim-status code {
  font-size: 1em;
}
.claim h4 {
  grid-column: 1 / -1;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.016em;
  line-height: 1.35;
  color: #fff;
}
.claim h4 code,
.claim-evidence code {
  white-space: nowrap;
  font-size: 0.88em;
  color: color-mix(in srgb, var(--chapter) 40%, #fff);
}
.claim-evidence {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  line-height: 1.52;
  color: var(--soft);
  text-wrap: pretty;
}
.claim-link {
  grid-column: 2;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.75rem;
  margin: -0.75rem 0;
  padding: 0 0.15rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--chapter) 60%, #fff);
  transition: color 0.2s;
}
.claim-link svg {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 0.3s var(--ease);
}
.claim-link:hover {
  color: #fff;
}
.claim-link:hover svg {
  transform: translateX(0.2rem);
}
@media (min-width: 900px) {
  .claim {
    grid-template-columns: 12.5rem minmax(0, 15rem) minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0.4rem 1.5rem;
  }
  .claim-status,
  .claim h4,
  .claim-evidence,
  .claim-link {
    grid-column: auto;
    grid-row: auto;
  }
  .claim-status {
    align-items: baseline;
  }
  .claim-status .dot {
    transform: translateY(-0.04em);
  }
  .claim-link {
    margin: -0.8rem 0;
  }
}

/* ---------- delta.css ---------- */
/* The capture loop: a pane's output as a tape, and what each poll stores. */
/* Pragmasevka joins -- into one long dash. Commands here must show both hyphens. The font shorthand
   used below resets this property with more specificity, hence !important. */
#fig-delta,
#fig-delta * {
  font-variant-ligatures: none !important;
}
#fig-delta > .fig-body {
  container-type: inline-size;
}
#fig-delta .dl-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.9rem 1.4rem;
}
#fig-delta .dl-pick {
  min-width: 0;
}
#fig-delta .dl-ask {
  margin: 0 0 0.5rem;
  font-size: 0.84rem;
  color: var(--muted);
}
#fig-delta .dl-buttons {
  display: flex;
  gap: 0.5rem;
}
#fig-delta .dl-buttons .btn {
  min-height: 2.75rem;
}
#fig-delta .btn.ghost {
  border-color: transparent;
  background: none;
  color: var(--muted);
}
#fig-delta .btn.ghost:hover {
  color: #fff;
  border-color: var(--line-2);
}
#fig-delta .dl-view {
  display: grid;
  gap: 1rem;
}
@container (min-width: 720px) {
  #fig-delta .dl-view {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    gap: 1.2rem;
    align-items: start;
  }
}

/* ---------- The tape ---------- */
#fig-delta .dl-pane {
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: #030806;
  overflow: hidden;
}
#fig-delta .dl-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin: 0;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--line);
  font: 500 0.72rem/1.2 var(--mono);
  color: var(--faint);
}
#fig-delta .dl-key {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
#fig-delta .dl-key i {
  width: 3px;
  height: 0.85rem;
  border-radius: 2px;
}
#fig-delta .dl-key i + i,
#fig-delta .dl-key .k-cur {
  margin-left: 0.5rem;
}
#fig-delta .k-prev {
  background: rgb(190 240 212 / 0.4);
}
#fig-delta .k-cur {
  background: var(--life);
}
#fig-delta .dl-tape {
  margin: 0;
  padding: 0.45rem 0;
}
#fig-delta .dl-row {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr) auto;
  align-items: center;
  height: 1.5rem;
  padding-right: 0.7rem;
  font: 400 0.78rem/1 var(--term);
  /* Lines outside both reads: dimmer than the rest, still above 4.5:1. */
  color: var(--faint);
  transition:
    background-color 0.3s,
    color 0.3s;
}
#fig-delta .dl-row.in-prev,
#fig-delta .dl-row.in-cur {
  color: var(--soft);
}
#fig-delta .dl-t {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#fig-delta .dl-g {
  display: flex;
  gap: 3px;
  justify-content: center;
  height: 100%;
}
#fig-delta .dl-g i {
  width: 3px;
  height: 100%;
}
#fig-delta .dl-row.in-prev .dl-g i:first-child {
  background: rgb(190 240 212 / 0.4);
}
#fig-delta .dl-row.in-cur .dl-g i:last-child {
  background: var(--life);
}
#fig-delta .dl-row.snap .dl-g i:last-child {
  background: var(--coral);
}
#fig-delta .dl-row.new {
  background: linear-gradient(90deg, rgb(74 222 128 / 0.17), rgb(74 222 128 / 0.03) 85%);
  color: #fff;
}
#fig-delta .dl-row.snap {
  background: linear-gradient(90deg, rgb(251 113 133 / 0.14), rgb(251 113 133 / 0.02) 85%);
  color: #fff;
}
#fig-delta .dl-row.missed {
  color: color-mix(in srgb, var(--coral) 70%, var(--faint));
}
#fig-delta .dl-row.missed .dl-t {
  text-decoration: line-through;
  text-decoration-color: rgb(251 113 133 / 0.55);
}
#fig-delta .dl-tag {
  padding: 0.18rem 0.42rem;
  border-radius: 0.35rem;
  font: 600 0.6rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#fig-delta .dl-row.new .dl-tag {
  background: rgb(74 222 128 / 0.16);
  color: var(--life-2);
}
#fig-delta .dl-row.missed .dl-tag {
  background: rgb(251 113 133 / 0.14);
  color: #fda4af;
}
#fig-delta .dl-row.clear {
  grid-template-columns: 1.7rem minmax(0, 1fr);
  color: var(--amber);
}
#fig-delta .dl-row.clear .dl-t {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font: 600 0.62rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
#fig-delta .dl-row.clear .dl-t::after {
  content: "";
  flex: 1;
  border-top: 1px dashed rgb(251 191 36 / 0.45);
}

/* ---------- What was stored ---------- */
#fig-delta .dl-side {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
}
#fig-delta .dl-verdict {
  min-height: 8.6rem;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.02);
}
#fig-delta .dl-verdict.content {
  border-color: rgb(74 222 128 / 0.3);
  background: linear-gradient(150deg, rgb(74 222 128 / 0.08), rgb(74 222 128 / 0.01));
}
#fig-delta .dl-verdict.gap {
  border-color: rgb(251 113 133 / 0.34);
  background: linear-gradient(150deg, rgb(251 113 133 / 0.09), rgb(251 113 133 / 0.01));
}
#fig-delta .dl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.7rem;
  margin: 0 0 0.45rem;
}
#fig-delta .dl-head b {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #fff;
}
#fig-delta .dl-head code {
  font: 500 0.76rem/1.2 var(--term);
  color: #fda4af;
}
#fig-delta .dl-verdict > p:last-child {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--soft);
  text-wrap: pretty;
}
#fig-delta .dl-log {
  display: flex;
  flex-direction: column;
  min-height: calc(5 * 2.05rem);
  margin: 0;
}
/* The ledger keeps room for five segments so nothing below it moves; until they arrive, the room says what it is for. */
#fig-delta .dl-log:not(:has(> :nth-child(5)))::after {
  content: "Each poll adds a row here";
  flex: 1;
  display: grid;
  place-items: center;
  margin-top: 0.45rem;
  border: 1px dashed var(--line);
  border-radius: 0.6rem;
  font: 400 0.72rem/1.3 var(--term);
  color: var(--faint);
}
#fig-delta .dl-seg {
  display: grid;
  grid-template-columns: 2.4rem 3.6rem minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  height: 2.05rem;
  border-top: 1px solid var(--line);
  font: 400 0.76rem/1 var(--term);
  color: var(--soft);
}
#fig-delta .dl-seg:first-child {
  border-top: 0;
}
#fig-delta .dl-seq {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
#fig-delta .dl-kind {
  justify-self: start;
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem;
  font: 600 0.6rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgb(190 240 212 / 0.08);
  color: var(--muted);
}
#fig-delta .dl-seg.delta .dl-kind,
#fig-delta .dl-seg.first .dl-kind {
  background: rgb(74 222 128 / 0.14);
  color: var(--life-2);
}
#fig-delta .dl-seg.gap .dl-kind {
  background: rgb(251 113 133 / 0.14);
  color: #fda4af;
}
#fig-delta .dl-what {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#fig-delta .dl-b {
  font-variant-numeric: tabular-nums;
  color: #fff;
}
#fig-delta .dl-sum {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}
#fig-delta .dl-sum p {
  margin: 0;
  padding: 0.7rem 0.85rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgb(0 0 0 / 0.22);
}
#fig-delta .dl-sum small {
  display: block;
  font-size: 0.74rem;
  color: var(--faint);
}
#fig-delta .dl-sum b {
  display: block;
  margin-top: 0.15rem;
  font: 500 1.08rem/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
}
@media (prefers-reduced-motion: no-preference) {
  #fig-delta .dl-row.new,
  #fig-delta .dl-row.snap {
    animation: dl-in 0.6s var(--ease);
  }
}
@keyframes dl-in {
  from {
    background-color: rgb(255 255 255 / 0.08);
  }
}
@container (max-width: 559px) {
  #fig-delta .dl-pick,
  #fig-delta .dl-pick .seg {
    width: 100%;
  }
  #fig-delta .dl-pick .seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
@container (max-width: 479px) {
  #fig-delta .dl-row {
    height: 1.38rem;
    font-size: 0.72rem;
  }
  #fig-delta .dl-seg {
    grid-template-columns: 2.1rem 3.4rem minmax(0, 1fr) auto;
    gap: 0.45rem;
    font-size: 0.72rem;
  }
  #fig-delta .dl-buttons {
    width: 100%;
  }
  #fig-delta .dl-buttons .btn {
    flex: 1;
  }
}

/* ---------- envelope.css ---------- */
/* The operating envelope: five sources, the planner's ordered checks, and the plan it prints. */
#fig-envelope {
  --t-green: #4ade80;
  --t-yellow: #fbbf24;
  --t-orange: #fb923c;
  --t-red: #f87171;
  --t-black: #e4e4e7;
}
#fig-envelope [data-tier="green"] {
  --k: var(--t-green);
}
#fig-envelope [data-tier="yellow"] {
  --k: var(--t-yellow);
}
#fig-envelope [data-tier="orange"] {
  --k: var(--t-orange);
}
#fig-envelope [data-tier="red"] {
  --k: var(--t-red);
}
#fig-envelope [data-tier="black"] {
  --k: var(--t-black);
}
#fig-envelope .ev-grid {
  display: grid;
  gap: 1.6rem;
  align-items: start;
}
@media (min-width: 1000px) {
  #fig-envelope .ev-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  #fig-envelope .ev-controls {
    grid-row: span 2;
  }
}
@media (min-width: 1240px) {
  #fig-envelope .ev-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.82fr) minmax(0, 1.1fr);
  }
  #fig-envelope .ev-controls {
    grid-row: auto;
  }
}
/* On a tall enough desktop window the plan stays beside the controls while they scroll. */
@media (min-width: 1240px) and (min-height: 760px) {
  #fig-envelope .ev-verdict {
    position: sticky;
    top: 6rem;
  }
}

/* ---------- Sources ---------- */
#fig-envelope .ev-controls {
  display: grid;
  gap: 0.9rem;
  min-width: 0;
}
#fig-envelope .presets {
  margin-bottom: 0.3rem;
}
#fig-envelope .presets .tag {
  min-height: 2.75rem;
  padding-inline: 0.8rem;
  font: 600 0.8rem/1.2 var(--sans);
}
#fig-envelope .ev-src {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
  margin: 0;
  padding: 0.85rem 0.9rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.015);
}
#fig-envelope .ev-src legend {
  display: contents;
}
#fig-envelope .ev-src legend b {
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #fff;
}
#fig-envelope .ev-src legend code {
  display: block;
  margin-top: -0.45rem;
  font: 400 0.72rem/1.4 var(--term);
  font-variant-ligatures: none;
  color: var(--faint);
  overflow-wrap: anywhere;
}
#fig-envelope .ev-cap {
  display: grid;
  gap: 0.6rem;
  transition: opacity 0.25s;
}
#fig-envelope .ev-cap.ev-off {
  opacity: 0.35;
}
#fig-envelope .ev-row {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
#fig-envelope .ev-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
#fig-envelope .seg {
  display: flex;
}
#fig-envelope .seg button {
  flex: 1 1 auto;
  min-height: 2.75rem;
  padding-inline: 0.6rem;
  font-size: 0.82rem;
}
#fig-envelope .toggles .toggle {
  min-height: 2.75rem;
  font-size: 0.82rem;
}
/* Five tiers in one row on a phone. */
@media (max-width: 640px) {
  #fig-envelope [data-seg="ev-pressure"] {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  #fig-envelope [data-seg="ev-pressure"] button {
    padding-inline: 0.15rem;
    font-size: 0.74rem;
  }
}
/* With a mouse, the controls can sit tighter, each label beside its control. */
@media (min-width: 1240px) and (pointer: fine) {
  #fig-envelope .ev-row {
    grid-template-columns: 6.2rem minmax(0, 1fr);
    align-items: center;
    gap: 0.7rem;
  }
  #fig-envelope .seg button {
    min-height: 2.3rem;
    padding-inline: 0.45rem;
    font-size: 0.8rem;
  }
  #fig-envelope .toggles .toggle {
    min-height: 2.4rem;
  }
  #fig-envelope .presets .tag {
    min-height: 2.4rem;
  }
}

/* On a phone the verdict follows the controls down the screen. */
#fig-envelope .ev-strip {
  position: sticky;
  bottom: calc(var(--dock) + 0.75rem);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.9rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--k);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--k) 12%, #0a0507);
  box-shadow: 0 12px 30px -10px rgb(0 0 0 / 0.8);
  font: 600 0.8rem/1.35 var(--mono);
  color: #fff;
  overflow-wrap: anywhere;
}
#fig-envelope .ev-strip i,
#fig-envelope .ev-outcome i {
  flex: none;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--k);
  box-shadow: 0 0 10px var(--k);
}
#fig-envelope [data-tier="black"] .ev-outcome i,
#fig-envelope .ev-strip[data-tier="black"] i {
  background: #000;
  box-shadow: 0 0 0 2px var(--k);
}
@media (min-width: 1000px) {
  #fig-envelope .ev-strip {
    display: none;
  }
}

/* ---------- The checks ---------- */
#fig-envelope .ev-checks {
  min-width: 0;
}
#fig-envelope .ev-checks ol {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.6rem;
}
#fig-envelope .ev-checks li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  min-height: 2.05rem;
  padding: 0.2rem 0.6rem 0.2rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--soft);
  transition:
    border-color 0.3s,
    background-color 0.3s,
    opacity 0.3s;
}
#fig-envelope .ev-checks .n {
  font: 500 0.7rem/1 var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--faint);
}
#fig-envelope .ev-checks .out {
  font: 500 0.7rem/1 var(--mono);
  color: var(--faint);
}
#fig-envelope .ev-checks li[data-fixed] .lb {
  font-style: italic;
}
#fig-envelope .ev-checks li[data-s="skip"] {
  opacity: 0.38;
}
#fig-envelope .ev-checks li[data-s="also"] {
  opacity: 0.6;
}
#fig-envelope .ev-checks li[data-s="also"] .lb::after {
  content: "also true";
  margin-left: 0.5rem;
  font: 500 0.66rem/1 var(--mono);
  color: var(--muted);
}
#fig-envelope .ev-checks li[data-s="fired"] {
  border-color: color-mix(in srgb, var(--k) 60%, transparent);
  background: color-mix(in srgb, var(--k) 11%, transparent);
  color: #fff;
  font-weight: 600;
}
#fig-envelope .ev-checks li[data-s="fired"] .out {
  padding: 0.25rem 0.45rem;
  border-radius: 0.4rem;
  background: var(--k);
  color: #0a0507;
  font-weight: 700;
}

/* ---------- The plan ---------- */
#fig-envelope .ev-verdict {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid color-mix(in srgb, var(--k) 45%, transparent);
  border-radius: 1.1rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--k) 10%, transparent), transparent 60%), #050809;
  transition: border-color 0.35s;
}
@media (min-width: 1000px) and (max-width: 1239px) {
  #fig-envelope .ev-verdict {
    grid-column: 2;
  }
}
#fig-envelope .ev-outcome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
}
#fig-envelope .ev-outcome b {
  font-size: clamp(1.6rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #fff;
}
#fig-envelope .ev-outcome span {
  padding: 0.2rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--k) 45%, transparent);
  border-radius: 99rem;
  font: 500 0.72rem/1.3 var(--mono);
  color: color-mix(in srgb, var(--k) 55%, #fff);
}
#fig-envelope .ev-say {
  min-height: 3em;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--soft);
}
#fig-envelope .ev-reads {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 0.6rem;
}
#fig-envelope .ev-reads > div {
  min-width: 0;
  padding: 0.6rem 0.75rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgb(0 0 0 / 0.25);
}
#fig-envelope .ev-reads small {
  display: block;
  font-size: 0.72rem;
  color: var(--faint);
  white-space: nowrap;
}
#fig-envelope .ev-reads b {
  display: block;
  margin-top: 0.1rem;
  font: 500 1.15rem/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
  overflow-wrap: anywhere;
}
#fig-envelope [data-read="next"] b {
  font-size: 0.84rem;
  line-height: 1.75;
}
#fig-envelope .ev-term .term-body {
  min-height: 12.4em;
  font-size: 0.76rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-variant-ligatures: none;
}
#fig-envelope .ev-term .ev-t {
  font-weight: 600;
  color: color-mix(in srgb, var(--k) 80%, #fff);
}
@media (prefers-reduced-motion: reduce) {
  #fig-envelope .ev-checks li,
  #fig-envelope .ev-verdict,
  #fig-envelope .ev-cap {
    transition: none;
  }
}

/* ---------- fleet.css ---------- */
/* The hero's wall of agent panes. Sizes follow the figure's own width, so the wall reads the same in any column. */
/* Pragmasevka joins -- into one long dash. Commands here must show both hyphens. The font shorthand
   used below resets this property with more specificity, hence !important. */
#fig-fleet,
#fig-fleet * {
  font-variant-ligatures: none !important;
}
#fig-fleet {
  border-color: rgb(190 240 212 / 0.15);
  border-radius: 1.25rem;
  background:
    radial-gradient(40rem 18rem at 70% -10%, rgb(74 222 128 / 0.08), transparent 70%),
    linear-gradient(180deg, rgb(9 20 15 / 0.94), rgb(3 8 6 / 0.97));
  box-shadow:
    0 50px 120px -50px rgb(0 0 0 / 0.9),
    0 0 0 1px rgb(74 222 128 / 0.04) inset;
}
#fig-fleet > .fig-body {
  padding: 0;
  container-type: inline-size;
}
#fig-fleet .ft-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#fig-fleet .fl-win {
  --sev: var(--line-2);
}
#fig-fleet .fig-body > .fl-win {
  margin-top: 0;
}

/* ---------- Title bar ---------- */
#fig-fleet .fl-bar {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
}
#fig-fleet .fl-bar i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: rgb(190 240 212 / 0.16);
}
#fig-fleet .fl-bar code {
  margin-left: 0.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 500 0.75rem/1 var(--term);
  color: var(--soft);
}
#fig-fleet .fl-bar code::before {
  content: "$ ";
  color: var(--life);
}
#fig-fleet .fl-count {
  flex: none;
  margin-left: auto;
  font: 500 0.7rem/1 var(--mono);
  color: var(--faint);
}
#fig-fleet .fl-count b {
  font-weight: 600;
  color: var(--soft);
}

/* ---------- Panes ---------- */
#fig-fleet .fl-wall {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.7rem;
}
#fig-fleet .fl-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 8.6rem;
  border: 1px solid rgb(190 240 212 / 0.12);
  border-radius: 0.75rem;
  background: #030906;
  overflow: hidden;
  transition:
    border-color 0.5s,
    box-shadow 0.5s;
}
#fig-fleet .fl-pane[data-sev="info"] {
  --sev: var(--info);
}
#fig-fleet .fl-pane[data-sev="warning"] {
  --sev: var(--warning);
}
#fig-fleet .fl-pane[data-sev="critical"] {
  --sev: var(--critical);
}
#fig-fleet .fl-pane[data-sev] {
  border-color: var(--sev);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--sev) 55%, transparent),
    0 0 28px -8px var(--sev);
}
#fig-fleet .fl-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.65rem 0.35rem;
  font: 500 0.66rem/1 var(--term);
  color: var(--faint);
  white-space: nowrap;
}
#fig-fleet .fl-head i {
  flex: none;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: rgb(190 240 212 / 0.22);
  transition:
    background-color 0.3s,
    box-shadow 0.3s;
}
#fig-fleet .fl-pane.on .fl-head i {
  background: var(--life);
  box-shadow: 0 0 7px var(--life);
}
#fig-fleet .fl-pane[data-sev] .fl-head i {
  background: var(--sev);
  box-shadow: 0 0 7px var(--sev);
}
#fig-fleet .fl-head b {
  font-weight: 700;
  color: var(--soft);
}
#fig-fleet .fl-out {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
  margin: 0;
  padding: 0 0.65rem 0.6rem;
  overflow: hidden;
  font: 400 0.71rem/1.48 var(--term);
  color: #b4cdbd;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  /* Lines that have scrolled past the top fade out instead of being cut in half. */
  mask-image: linear-gradient(to bottom, transparent, #000 1.1rem);
  transition: padding-bottom 0.45s var(--ease);
}
#fig-fleet .fl-out .ln {
  display: block;
  flex: none;
}
#fig-fleet .fl-pane:not(.on) .fl-out {
  color: #93ac9d;
}
#fig-fleet .fl-pane.on .ln:last-child::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 1.05em;
  margin-left: 0.2em;
  vertical-align: -0.18em;
  background: var(--life);
  opacity: 0.85;
}
#fig-fleet .fl-pane[data-sev] .fl-out {
  padding-bottom: 2.15rem;
}
#fig-fleet mark {
  border-radius: 0.2em;
  color: #fff;
  background: color-mix(in srgb, var(--m) 24%, transparent);
  box-shadow: inset 0 -1px var(--m);
  transition:
    background-color 0.8s,
    color 0.8s;
}
#fig-fleet mark.s-info {
  --m: var(--info);
}
#fig-fleet mark.s-warning {
  --m: var(--warning);
}
#fig-fleet mark.s-critical {
  --m: var(--critical);
}
#fig-fleet .fl-pane:not([data-sev]) mark {
  color: inherit;
  background: transparent;
  box-shadow: inset 0 -1px color-mix(in srgb, var(--m) 45%, transparent);
}
#fig-fleet .fl-chip {
  position: absolute;
  left: 0.55rem;
  bottom: 0.5rem;
  max-width: calc(100% - 1.1rem);
  margin: 0;
  padding: 0.22rem 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--sev) 55%, transparent);
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--sev) 20%, #040a07);
  font: 600 0.64rem/1.3 var(--term);
  color: #fff;
  transition:
    opacity 0.5s,
    transform 0.5s var(--ease);
}
#fig-fleet .fl-chip.gone {
  opacity: 0;
  transform: translateY(5px);
}

/* ---------- Events ---------- */
#fig-fleet .fl-rail {
  padding: 0.6rem 0.95rem 0.75rem;
  border-top: 1px solid var(--line);
  background: rgb(0 0 0 / 0.22);
}
#fig-fleet .fl-cols,
#fig-fleet .fl-ev {
  display: grid;
  grid-template-columns: 2.9rem 2.5rem minmax(0, 1.55fr) 4.3rem minmax(0, 1.3fr);
  gap: 0.7rem;
  align-items: center;
}
#fig-fleet .fl-cols {
  margin: 0 0 0.3rem;
  font: 600 0.6rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  color: var(--faint);
}
#fig-fleet .fl-events {
  height: calc(4 * 1.6rem);
  overflow: hidden;
}
#fig-fleet .fl-ev {
  height: 1.6rem;
  border-top: 1px solid rgb(190 240 212 / 0.05);
  font: 400 0.7rem/1 var(--term);
  color: var(--soft);
}
#fig-fleet .fl-ev[data-sev="info"] {
  --sev: var(--info);
}
#fig-fleet .fl-ev[data-sev="warning"] {
  --sev: var(--warning);
}
#fig-fleet .fl-ev[data-sev="critical"] {
  --sev: var(--critical);
}
#fig-fleet .fl-ev > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#fig-fleet .fl-ev .fl-id,
#fig-fleet .fl-ev .fl-pn {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
#fig-fleet .fl-ev .fl-rule {
  color: #eef8f1;
}
#fig-fleet .fl-ev .fl-sev {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--sev);
}
#fig-fleet .fl-ev .fl-sev::before {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--sev);
}
#fig-fleet .fl-ev .fl-wf {
  color: var(--life-2);
}
#fig-fleet .fl-ev .fl-wf:not(.none)::before {
  content: "→ ";
  color: var(--faint);
}
#fig-fleet .fl-ev .fl-wf.none {
  color: var(--faint);
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  #fig-fleet .fl-pane.on .ln:last-child::after {
    animation: fl-blink 1.1s steps(1, end) infinite;
  }
  #fig-fleet .fl-pane.fl-flash {
    animation: fl-flash 1.1s var(--ease);
  }
  #fig-fleet .fl-ev.new {
    animation: fl-in 0.7s var(--ease);
  }
  #fig-fleet .fl-out .ln:last-child {
    animation: fl-line 0.35s ease-out;
  }
}
@keyframes fl-blink {
  50% {
    opacity: 0;
  }
}
@keyframes fl-flash {
  from {
    box-shadow:
      0 0 0 5px color-mix(in srgb, var(--sev) 40%, transparent),
      0 0 44px -4px var(--sev);
  }
}
@keyframes fl-in {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
    background: color-mix(in srgb, var(--sev) 16%, transparent);
  }
}
@keyframes fl-line {
  from {
    opacity: 0.2;
  }
}

/* ---------- Narrow columns ---------- */
@container (max-width: 759px) {
  #fig-fleet .fl-pane {
    height: 7.9rem;
  }
  #fig-fleet .fl-out {
    font-size: 0.66rem;
  }
}
@container (max-width: 559px) {
  #fig-fleet .fl-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0.55rem;
  }
  #fig-fleet .fl-pane:nth-child(n + 7) {
    display: none;
  }
  #fig-fleet .fl-pane {
    height: 7.6rem;
    border-radius: 0.6rem;
  }
  #fig-fleet .fl-head {
    padding: 0.45rem 0.55rem 0.3rem;
    font-size: 0.62rem;
  }
  #fig-fleet .fl-out {
    padding-inline: 0.55rem;
    font-size: 0.625rem;
    line-height: 1.45;
  }
  #fig-fleet .fl-pane[data-sev] .fl-out {
    padding-bottom: 1.95rem;
  }
  #fig-fleet .fl-chip {
    left: 0.45rem;
    bottom: 0.42rem;
    max-width: calc(100% - 0.9rem);
    padding: 0.2rem 0.4rem;
    font-size: 0.58rem;
  }
  #fig-fleet .fl-bar {
    padding-inline: 0.8rem;
  }
  #fig-fleet .fl-rail {
    padding: 0.45rem 0.8rem 0.6rem;
  }
  #fig-fleet .fl-cols {
    display: none;
  }
  #fig-fleet .fl-events {
    height: calc(3 * 2.55rem);
  }
  #fig-fleet .fl-ev {
    grid-template-columns: 3.4rem minmax(0, 1fr) auto;
    grid-template-areas:
      "pn rule sev"
      "pn wf wf";
    gap: 0.2rem 0.6rem;
    height: 2.55rem;
    align-content: center;
    font-size: 0.66rem;
  }
  #fig-fleet .fl-ev .fl-id {
    display: none;
  }
  #fig-fleet .fl-ev .fl-pn {
    grid-area: pn;
    align-self: start;
    padding-top: 0.05rem;
  }
  #fig-fleet .fl-ev .fl-pn::before {
    content: "pane ";
  }
  #fig-fleet .fl-ev .fl-rule {
    grid-area: rule;
  }
  #fig-fleet .fl-ev .fl-sev {
    grid-area: sev;
  }
  #fig-fleet .fl-ev .fl-wf {
    grid-area: wf;
    font-size: 0.62rem;
  }
}

/* ---------- gate.css ---------- */
/* The policy gate: controls, the checks lighting in order, and the decision ft returns. */
#fig-gate .gate-grid {
  display: grid;
  gap: 1.6rem;
  align-items: start;
}
@media (min-width: 1000px) {
  #fig-gate .gate-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  #fig-gate .gate-controls {
    grid-row: span 2;
  }
}
@media (min-width: 1240px) {
  #fig-gate .gate-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.8fr) minmax(0, 1.15fr);
  }
  #fig-gate .gate-controls {
    grid-row: auto;
  }
}
/* On a tall enough desktop window the decision stays beside the controls while they scroll. */
@media (min-width: 1240px) and (min-height: 760px) {
  #fig-gate .gate-decision {
    position: sticky;
    top: 6rem;
  }
}

/* ---------- Controls ---------- */
#fig-gate .gate-controls {
  display: grid;
  gap: 1.3rem;
  min-width: 0;
}
#fig-gate .gc-group {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}
#fig-gate .gc-row {
  display: grid;
  gap: 0.35rem;
}
#fig-gate .gc-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
#fig-gate .seg {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
}
#fig-gate [data-seg="gate-actor"],
#fig-gate [data-seg="gate-text"] {
  --cols: 2;
}
#fig-gate .seg button {
  min-height: 2.75rem;
  padding-inline: 0.55rem;
  line-height: 1.25;
  white-space: normal;
}
#fig-gate [data-seg="gate-text"] button {
  font: 500 0.8rem/1.3 var(--term);
}
#fig-gate .gc-trust {
  min-height: 2.9em;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}
#fig-gate .toggles .toggle {
  min-height: 2.75rem;
}

/* On a phone the verdict follows the controls down the screen. */
#fig-gate .gate-strip {
  position: sticky;
  bottom: calc(var(--dock) + 0.75rem);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.9rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--k);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--k) 12%, #04100a);
  box-shadow: 0 12px 30px -10px rgb(0 0 0 / 0.8);
  font: 600 0.82rem/1.35 var(--mono);
  color: #fff;
  overflow-wrap: anywhere;
  --k: var(--life);
}
#fig-gate .gate-strip i {
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--k);
  box-shadow: 0 0 10px var(--k);
}
@media (min-width: 1000px) {
  #fig-gate .gate-strip {
    display: none;
  }
}

/* ---------- The checks ---------- */
#fig-gate .gate-steps {
  min-width: 0;
}
#fig-gate .gate-steps ol {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.6rem;
  counter-reset: none;
}
#fig-gate .gs {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) 1.7rem;
  gap: 0.7rem;
  align-items: center;
  min-height: 3.1rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgb(255 255 255 / 0.015);
  transition:
    border-color 0.3s,
    background-color 0.3s,
    opacity 0.3s;
  --k: var(--life);
}
#fig-gate .gs-n {
  font: 500 0.74rem/1 var(--mono);
  color: var(--faint);
  text-align: center;
}
#fig-gate .gs-main {
  display: grid;
  min-width: 0;
}
#fig-gate .gs-main b {
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #fff;
}
#fig-gate .gs-note {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#fig-gate .gs-mark {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
}
#fig-gate .gs-mark svg {
  display: none;
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: var(--k);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#fig-gate .gs[data-status="pass"] .i-pass,
#fig-gate .gs[data-status="deny"] .i-deny,
#fig-gate .gs[data-status="approve"] .i-approve {
  display: block;
}
#fig-gate .gs[data-status="pass"] .gs-mark {
  border-color: color-mix(in srgb, var(--life) 45%, transparent);
  background: rgb(74 222 128 / 0.08);
}
#fig-gate .gs[data-status="deny"],
#fig-gate .gs[data-status="approve"] {
  border-color: var(--k);
  background: color-mix(in srgb, var(--k) 9%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--k) 30%, transparent);
}
#fig-gate .gs[data-status="deny"] {
  --k: var(--critical);
}
#fig-gate .gs[data-status="approve"] {
  --k: var(--warning);
}
#fig-gate .gs[data-status="deny"] .gs-mark,
#fig-gate .gs[data-status="approve"] .gs-mark {
  border-color: var(--k);
}
#fig-gate .gs[data-status="deny"] .gs-note,
#fig-gate .gs[data-status="approve"] .gs-note {
  font-family: var(--term);
  color: color-mix(in srgb, var(--k) 45%, #fff);
}
#fig-gate .gs[data-status="idle"] {
  opacity: 0.45;
}
#fig-gate .gs[data-status="idle"] .gs-mark {
  border-style: dashed;
}

/* ---------- The decision ---------- */
#fig-gate .gate-decision {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid color-mix(in srgb, var(--k) 45%, transparent);
  border-radius: 1.1rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--k) 10%, transparent), transparent 60%), #030806;
  transition:
    border-color 0.35s,
    background-color 0.35s;
  --k: var(--life);
}
@media (min-width: 1000px) and (max-width: 1239px) {
  #fig-gate .gate-decision {
    grid-column: 2;
  }
}
#fig-gate .gd-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: #fff;
}
#fig-gate .gd-label i {
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--k);
  box-shadow: 0 0 14px var(--k);
}
#fig-gate .gd-say {
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--soft);
}
/* One line of JSON per block, so a long value wraps under itself and not back to the margin. */
#fig-gate .gd-json .ln {
  display: block;
  padding-left: calc((var(--i, 0) + 2) * 1ch);
  text-indent: -2ch;
}
#fig-gate .gd-json,
#fig-gate .gd-cli {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgb(0 0 0 / 0.35);
  font: 400 0.78rem/1.6 var(--term);
  color: #cfe5d7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#fig-gate .gd-json .key {
  color: #93c5fd;
}
#fig-gate .gd-json .s {
  color: #bef264;
}
#fig-gate .gd-json .n {
  color: #fbbf24;
}
#fig-gate .gd-json .code .s {
  padding: 0.05em 0.3em;
  border-radius: 0.3em;
  background: color-mix(in srgb, var(--warning) 22%, transparent);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
}
#fig-gate .gd-next {
  display: grid;
  gap: 0.45rem;
}
#fig-gate .gd-next[hidden] {
  display: none;
}
#fig-gate .gd-cli {
  color: #e7fbe9;
}
#fig-gate .gd-cli .ps {
  color: var(--warning);
}
#fig-gate .gd-cli .dim {
  color: var(--faint);
}

/* Last, so that the verdict outranks each element's own default. */
#fig-gate [data-verdict="deny"] {
  --k: var(--critical);
}
#fig-gate [data-verdict="approve"] {
  --k: var(--warning);
}

/* Pragmasevka draws "--" as one long dash, which would misprint every flag.
   Last, because the font shorthands above reset both properties. */
#fig-gate .gd-json,
#fig-gate .gd-cli,
#fig-gate .gs-note,
#fig-gate [data-seg="gate-text"] button {
  font-variant-ligatures: none;
  font-feature-settings: "calt" 0, "liga" 0;
}

/* ---------- incident.css ---------- */
/* The incident section: the commands that rebuild what happened to a pane, and what the exported bundle holds. */
.inc {
  gap: 1.1rem;
}
.inc-term .term-body {
  font-size: 0.82rem;
  font-variant-ligatures: none;
  overflow-wrap: anywhere;
}
.inc-bundle {
  counter-reset: inc;
  gap: 0.55rem;
}
@media (min-width: 640px) {
  .inc-bundle {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.inc-bundle > div {
  position: relative;
  padding: 0.85rem 1rem 0.95rem 2.7rem;
  background: rgb(255 255 255 / 0.018);
}
.inc-bundle > div::before {
  counter-increment: inc;
  content: counter(inc, decimal-leading-zero);
  position: absolute;
  left: 0.95rem;
  top: 0.95rem;
  font: 500 0.7rem/1.4 var(--mono);
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--chapter) 70%, #fff);
}
.inc-bundle dt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.6rem;
}
.inc-bundle dd code {
  font-size: 0.9em;
  color: var(--soft);
}
.inc-bundle .opt {
  border-style: dashed;
  border-color: var(--line-2);
}
.inc-flag {
  font: 500 0.68rem/1.3 var(--mono);
  color: var(--faint);
}
.inc-flag code {
  color: color-mix(in srgb, var(--chapter) 45%, #fff);
}
.inc-not {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1rem 0.9rem;
  border-left: 2px solid var(--line-2);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}
.inc-not b {
  font: 500 0.6875rem/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- mac.css ---------- */
/* FrankenTerm.app, drawn: a window with three panes, and the facts beside it. */
.mac {
  display: grid;
  gap: 1.6rem;
}
@media (min-width: 1000px) {
  .mac {
    grid-template-columns: minmax(0, 7.3fr) minmax(0, 4.7fr);
    align-items: center;
    gap: clamp(2rem, 3.4vw, 3.2rem);
  }
}
.mac-shot {
  margin: 0;
  min-width: 0;
}
.mac-window {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 0.95rem;
  background: #0a0e0c;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.03) inset,
    0 44px 90px -36px rgb(0 0 0 / 0.85),
    0 0 90px -30px color-mix(in srgb, var(--chapter) 30%, transparent);
}
.mac-chrome {
  display: flex;
  align-items: stretch;
  gap: 0.9rem;
  height: 2.35rem;
  padding: 0 0.85rem;
  background: #191e1c;
  border-bottom: 1px solid #050706;
}
.mac-lights {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}
.mac-lights i {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  background: #ff5f57;
}
.mac-lights i:nth-child(2) {
  background: #febc2e;
}
.mac-lights i:nth-child(3) {
  background: #28c840;
}
.mac-tabs {
  display: flex;
  align-items: flex-end;
  gap: 0.15rem;
  min-width: 0;
  font: 600 0.74rem/1 var(--sans);
  letter-spacing: -0.005em;
}
.mac-tabs b {
  display: flex;
  align-items: center;
  height: 1.85rem;
  padding: 0 0.95rem;
  border-radius: 0.5rem 0.5rem 0 0;
  color: #8f9a94;
  white-space: nowrap;
}
.mac-tabs b.on {
  background: #0a0e0c;
  color: #eef5f0;
}
.mac-tabs b.add {
  padding: 0 0.55rem;
  font-weight: 400;
  font-size: 1rem;
  color: #66726c;
}
.mac-panes {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1px;
  background: #262c29;
}
.mac-pane {
  min-width: 0;
  background: #0a0e0c;
}
.mac-pane.claude {
  grid-row: span 2;
}
.mac-title {
  padding: 0.7rem 0.9rem 0;
  font: 500 0.64rem/1.2 var(--mono);
  letter-spacing: 0.02em;
  color: #6f8279;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mac-pane pre {
  margin: 0;
  padding: 0.5rem 0.9rem 0.95rem;
  font: 400 clamp(0.7rem, 0.62rem + 0.25vw, 0.8rem) / 1.6 var(--term);
  /* Pragmasevka draws -- as one long dash, which would misprint flags. */
  font-variant-ligatures: none;
  font-feature-settings: "calt" 0, "liga" 0;
  color: #d6e3dc;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mac-pane .g {
  color: #4ade80;
}
.mac-pane .d {
  color: #71857b;
}
.mac-pane .u {
  color: #fff;
}
.mac-pane .o {
  color: #e9945f;
}
.mac-pane .r {
  color: #fb7185;
}
.mac .cursor,
.ph .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  margin-left: 0.15em;
  vertical-align: text-bottom;
  background: #d6e3dc;
}
@media (prefers-reduced-motion: no-preference) {
  .mac .cursor,
  .ph .cursor {
    animation: mac-blink 1.1s steps(1, end) infinite;
  }
}
@keyframes mac-blink {
  50% {
    opacity: 0;
  }
}
.mac-shot figcaption {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}
.mac-facts {
  display: grid;
  gap: 0 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
@media (min-width: 1000px) {
  .mac-facts {
    grid-template-columns: 1fr;
  }
}
.mac-facts li {
  position: relative;
  padding: 0.95rem 0 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.mac-facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.12rem;
  width: 2px;
  height: 1.05rem;
  border-radius: 2px;
  background: var(--chapter);
}
.mac-facts h4 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.mac-facts p {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--soft);
  text-wrap: pretty;
}
.mac-facts code {
  font-size: 0.86em;
  white-space: nowrap;
  color: color-mix(in srgb, var(--chapter) 45%, #fff);
}
@media (max-width: 599px) {
  .mac-panes {
    grid-template-columns: minmax(0, 1fr);
  }
  .mac-pane.claude {
    grid-row: auto;
  }
  .mac-pane.codex {
    display: none;
  }
  .mac-pane pre {
    font-size: 0.7rem;
  }
  .mac-tabs b {
    padding: 0 0.7rem;
  }
}

/* ---------- mcp.css ---------- */
/* The MCP tools, by area, with how to start the server. */
.mcp {
  display: grid;
  gap: 1.2rem;
}
.mcp-start {
  display: grid;
  gap: 1rem;
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--line-2);
  border-radius: 1.1rem;
  background: rgb(6 14 10 / 0.86);
}
@media (min-width: 900px) {
  .mcp-start {
    grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr);
    align-items: end;
  }
}
.mcp-step {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}
.mcp-cli {
  margin: 0;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #030806;
  font: 400 0.82rem/1.6 var(--term);
  color: #e7fbe9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mcp-cli .ps {
  color: var(--chapter);
}
.mcp-cli .key {
  color: #93c5fd;
}
.mcp-cli .s {
  color: #bef264;
}
/* Columns, not a grid, so that the short areas stack under the long ones without gaps. */
.mcp-areas {
  columns: 22rem 3;
  column-gap: 1rem;
  margin-bottom: -1rem;
}
.mcp-area {
  break-inside: avoid;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--raise);
}
/* Each group folds from its heading. All start open; on a phone the script closes all but the first. */
.mcp-area summary {
  list-style: none;
  cursor: pointer;
  border-radius: 0.5rem;
}
.mcp-area summary::-webkit-details-marker {
  display: none;
}
.mcp-area:not([open]) h4 {
  padding-bottom: 0;
  border-bottom-color: transparent;
}
.mcp-area h4::after {
  content: "";
  flex: none;
  width: 0.42rem;
  height: 0.42rem;
  margin: 0 0.15rem 0.15rem 0;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-135deg);
  transition: transform 0.2s;
}
.mcp-area:not([open]) h4::after {
  transform: rotate(45deg);
}
.mcp-area summary:hover h4::after {
  border-color: #fff;
}
.mcp-area h4 {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #fff;
}
.mcp-area h4 span {
  margin-left: auto;
  font: 500 0.74rem/1 var(--mono);
  color: var(--chapter);
}
.mcp-area ul {
  display: grid;
  gap: 0.15rem;
  margin-top: 0.55rem;
}
.mcp-area li {
  display: grid;
  gap: 0.1rem;
  padding: 0.35rem 0;
}
.mcp-area li + li {
  border-top: 1px dashed var(--line);
}
.mcp-area code {
  font: 600 0.8rem/1.4 var(--term);
  color: color-mix(in srgb, var(--chapter) 55%, #fff);
}
.mcp-area li span {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
  text-wrap: pretty;
}

/* Pragmasevka draws "--" as one long dash, which would misprint every flag.
   Last, because the font shorthands above reset both properties. */
.mcp-cli,
.mcp-area code {
  font-variant-ligatures: none;
  font-feature-settings: "calt" 0, "liga" 0;
}
@media (max-width: 699px) {
  .mcp-area summary h4 {
    min-height: 2.75rem;
  }
}

/* ---------- phone.css ---------- */
/* The iPhone app, drawn: a pane attached from a Mac in front, Fleet Overview behind. */
.ph {
  display: grid;
  gap: 2rem;
  align-items: center;
}
@media (min-width: 1000px) {
  .ph {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2.4rem, 4vw, 4rem);
  }
}
.ph-devices {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0.5rem 0 1.5rem;
}
.ph-device {
  flex: none;
  width: 15rem;
  aspect-ratio: 9 / 19.2;
  padding: 0.5rem;
  border-radius: 2.6rem;
  background: linear-gradient(150deg, #323936, #0c100e 60%);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.09) inset,
    0 44px 80px -34px rgb(0 0 0 / 0.95);
}
.ph-device.back {
  margin-right: -2.6rem;
  transform: translateY(2rem) rotate(-6deg);
  filter: saturate(0.85) brightness(0.9);
}
.ph-device.front {
  position: relative;
  z-index: 1;
  transform: rotate(2.5deg);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.09) inset,
    0 44px 80px -34px rgb(0 0 0 / 0.95),
    0 0 70px -24px color-mix(in srgb, var(--chapter) 45%, transparent);
}
.ph-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 0.55rem 0.7rem 0.8rem;
  border-radius: 2.15rem;
  background: #050807;
  color: #e9f2ec;
  font-family: var(--sans);
}
.ph-screen::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  left: 50%;
  width: 4.6rem;
  height: 1.3rem;
  border-radius: 99rem;
  background: #000;
  transform: translateX(-50%);
}
.ph-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 1.35rem;
  padding: 0 0.6rem 0 0.75rem;
  font-size: 0.66rem;
}
.ph-status i {
  width: 1.1rem;
  height: 0.5rem;
  border: 1px solid #cfd8d3;
  border-radius: 0.18rem;
  background: linear-gradient(90deg, #cfd8d3 72%, transparent 72%) content-box;
  padding: 1px;
}
.ph-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 0.7rem;
  font-size: 0.72rem;
}
.ph-nav span {
  color: var(--chapter);
}
.ph-nav b {
  font-weight: 650;
}
.ph-nav .ph-more {
  justify-self: end;
  letter-spacing: 0.08em;
}
.ph-strip {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.6rem;
}
.ph-strip b {
  padding: 0.22rem 0.55rem;
  border-radius: 99rem;
  background: rgb(255 255 255 / 0.07);
  font: 500 0.58rem/1.2 var(--mono);
  color: #a9b8b0;
}
.ph-strip b.on {
  background: color-mix(in srgb, var(--chapter) 22%, transparent);
  color: #fff;
}
.ph-term {
  flex: 1;
  margin: 0.55rem 0 0;
  padding: 0.6rem 0.55rem;
  border-radius: 0.7rem;
  background: #0a0f0c;
  font: 400 0.62rem/1.55 var(--term);
  font-variant-ligatures: none;
  font-feature-settings: "calt" 0, "liga" 0;
  color: #d6e3dc;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ph-term .d {
  color: #71857b;
}
.ph-term .r {
  color: #fb7185;
}
.ph-term .g {
  color: #4ade80;
}
.ph-term .u {
  color: #fff;
}
.ph-search {
  margin-top: 0.65rem;
  padding: 0.38rem 0.6rem;
  border-radius: 0.55rem;
  background: rgb(255 255 255 / 0.07);
  font-size: 0.6rem;
  color: #7f8c86;
}
.ph-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0.5rem;
  padding: 0.12rem;
  border-radius: 0.5rem;
  background: rgb(255 255 255 / 0.07);
  font-size: 0.58rem;
  text-align: center;
}
.ph-seg b {
  padding: 0.22rem 0;
  border-radius: 0.4rem;
  font-weight: 500;
  color: #b7c4bd;
}
.ph-seg b.on {
  background: #3a423e;
  color: #fff;
}
.ph-meta {
  margin-top: 0.5rem;
  font-size: 0.56rem;
  color: #7f8c86;
}
.ph-rows {
  margin-top: 0.35rem;
  border-radius: 0.6rem;
  background: #0c1210;
}
.ph-rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 0.4rem;
  padding: 0.42rem 0.55rem;
  border-top: 1px solid rgb(255 255 255 / 0.06);
}
.ph-rows li:first-child {
  border-top: 0;
}
.ph-rows small {
  flex-basis: 100%;
  font-size: 0.52rem;
  color: #7f8c86;
}
.ph-rows b {
  flex-basis: 100%;
  font-size: 0.68rem;
  font-weight: 600;
}
.ph-rows .st {
  font-size: 0.52rem;
  color: #95a39c;
}
.ph-rows .st::before {
  content: "";
  display: inline-block;
  width: 0.36rem;
  height: 0.36rem;
  margin-right: 0.25rem;
  border-radius: 50%;
  background: #6b7771;
}
.ph-rows .st.live::before {
  background: var(--life);
}
.ph-rows .st.off::before {
  background: transparent;
  box-shadow: inset 0 0 0 1px #6b7771;
}
.ph-rows .flag {
  font-size: 0.52rem;
  color: var(--chapter);
}
.ph-copy {
  min-width: 0;
}
.ph-facts {
  display: grid;
  gap: 0.25rem;
}
.ph-facts li {
  padding: 0.85rem 0 0.95rem;
  border-bottom: 1px solid var(--line);
}
.ph-facts li:first-child {
  padding-top: 0;
}
.ph-facts h4 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.ph-facts p {
  margin-top: 0.25rem;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--soft);
  text-wrap: pretty;
}
.ph-avail {
  margin-top: 1.3rem;
  padding: 1.05rem 1.15rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--chapter) 28%, transparent);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--chapter) 5%, transparent);
}
.ph-avail .micro {
  color: color-mix(in srgb, var(--chapter) 60%, #fff);
}
.ph-avail p:not(.micro, .ph-links) {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--soft);
}
.ph-avail code {
  font-size: 0.88em;
  color: #fff;
}
.ph-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.ph-links .btn {
  min-height: 2.75rem;
}
@media (max-width: 599px) {
  .ph-device.back {
    display: none;
  }
  .ph-device.front {
    width: 14.5rem;
    transform: none;
  }
  .ph-devices {
    padding-bottom: 0.5rem;
  }
}

/* ---------- proof.css ---------- */
/* The engineering numbers and practices, in the Proof chapter's amber. */
[data-chapter="proof"] .numbers {
  gap: 0 1.2rem;
}
[data-chapter="proof"] .numbers li {
  position: relative;
}
[data-chapter="proof"] .numbers li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1.6rem;
  height: 2px;
  background: var(--chapter);
  opacity: 0.8;
}
[data-chapter="proof"] .practices li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.3rem;
  width: 2px;
  height: 1.3rem;
  border-radius: 2px;
  background: var(--chapter);
}
[data-chapter="proof"] .practices h4 {
  font-size: 1.04rem;
}
@media (min-width: 1100px) {
  [data-chapter="proof"] .practices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- qr.css ---------- */
/* The camera transfer: the exporter's screen, frames in flight, and the phone rebuilding the page. */
.qr-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(1rem, 0.5fr) minmax(0, 0.85fr);
  align-items: center;
}
.qr-mac {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.qr-monitor {
  width: 100%;
  max-width: 22rem;
  padding: 0.65rem 0.75rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 0.95rem;
  background: linear-gradient(180deg, #151b18, #0c110f);
  box-shadow: 0 30px 70px -36px rgb(0 0 0 / 0.9);
}
.qr-app {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  font: 600 0.68rem/1 var(--sans);
  color: var(--muted);
}
.qr-app i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #39423e;
}
.qr-app span {
  margin-left: 0.45rem;
}
.qr-card {
  width: min(100%, 13.5rem);
  margin: 0 auto;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #eef6f1;
}
.qr-code,
.qr-mini {
  display: block;
  width: 100%;
  height: 100%;
}
.qr-seq {
  margin-top: 0.7rem;
  text-align: center;
  font: 500 0.72rem/1.3 var(--mono);
  color: var(--muted);
}
.qr-seq b {
  color: #fff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.qr-stand {
  width: 24%;
  height: 1rem;
  background: linear-gradient(#1a201d, #0d1210);
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
}
.qr-beam {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.qr-phone {
  grid-column: 3;
  justify-self: center;
  width: 100%;
  max-width: 12rem;
  min-width: 0;
}
.qr-phone-screen {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.35rem 0.7rem 0.85rem;
  border: 0.38rem solid #1d2421;
  border-radius: 1.8rem;
  background: #050807;
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.07),
    0 30px 70px -36px rgb(0 0 0 / 0.95);
}
.qr-phone-title {
  font: 700 0.8rem/1.2 var(--sans);
  text-align: center;
  color: #fff;
}
.qr-view {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0.65rem;
  background:
    linear-gradient(var(--chapter), var(--chapter)) top left / 1.1rem 2px no-repeat,
    linear-gradient(var(--chapter), var(--chapter)) top left / 2px 1.1rem no-repeat,
    linear-gradient(var(--chapter), var(--chapter)) top right / 1.1rem 2px no-repeat,
    linear-gradient(var(--chapter), var(--chapter)) top right / 2px 1.1rem no-repeat,
    linear-gradient(var(--chapter), var(--chapter)) bottom left / 1.1rem 2px no-repeat,
    linear-gradient(var(--chapter), var(--chapter)) bottom left / 2px 1.1rem no-repeat,
    linear-gradient(var(--chapter), var(--chapter)) bottom right / 1.1rem 2px no-repeat,
    linear-gradient(var(--chapter), var(--chapter)) bottom right / 2px 1.1rem no-repeat,
    #0b1310;
}
.qr-mini {
  position: absolute;
  inset: 12%;
  width: 76%;
  height: 76%;
  border-radius: 0.2rem;
  opacity: 0.9;
}
.qr-view::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 2px;
  background: color-mix(in srgb, var(--chapter) 80%, transparent);
  box-shadow: 0 0 12px var(--chapter);
  opacity: 0.7;
}
@media (prefers-reduced-motion: no-preference) {
  .qr-view::after {
    animation: qr-scan 2.4s ease-in-out infinite alternate;
  }
  .qr-view.flash {
    animation: qr-flash 0.4s ease-out;
  }
}
@keyframes qr-scan {
  from {
    top: 14%;
  }
  to {
    top: 86%;
  }
}
@keyframes qr-flash {
  from {
    box-shadow: inset 0 0 0 2px var(--chapter);
  }
}
.qr-bar {
  height: 0.3rem;
  overflow: hidden;
  border-radius: 9px;
  background: rgb(190 240 212 / 0.12);
}
.qr-bar i {
  display: block;
  height: 100%;
  background: var(--chapter);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.qr-count {
  text-align: center;
  font: 500 0.68rem/1.2 var(--mono);
  color: var(--soft);
}
.qr-count b {
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.qr-cells {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.22rem;
}
.qr-cells li {
  aspect-ratio: 1;
  border-radius: 0.2rem;
  background: rgb(190 240 212 / 0.1);
  transition:
    background-color 0.3s,
    box-shadow 0.3s,
    transform 0.3s var(--ease);
}
.qr-cells li.on {
  background: var(--chapter);
  box-shadow: 0 0 8px color-mix(in srgb, var(--chapter) 60%, transparent);
}
.qr-phone.complete .qr-cells li,
.qr-phone.complete .qr-bar i {
  background: var(--life);
}
.qr-phone.complete .qr-count {
  color: var(--life-2);
}
.qrfig .qr-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
}
.qrfig .qr-restart {
  min-height: 2.75rem;
}
@media (min-width: 600px) {
  .qrfig .reads {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.qr-announce {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.qr-facts {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  margin-top: 1.3rem;
}
.qr-facts li {
  padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--raise);
}
.qr-facts h4 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.qr-facts p {
  margin-top: 0.35rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--soft);
  text-wrap: pretty;
}
@media (max-width: 599px) {
  .qr-stage {
    grid-template-columns: minmax(0, 1.2fr) 1.8rem minmax(0, 1fr);
  }
  .qr-monitor {
    padding: 0.5rem 0.5rem 0.65rem;
  }
  .qr-app {
    margin-bottom: 0.5rem;
    font-size: 0.6rem;
  }
  .qr-app span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .qr-seq {
    font-size: 0.64rem;
  }
  .qr-phone-screen {
    gap: 0.4rem;
    padding: 1rem 0.45rem 0.6rem;
    border-width: 0.28rem;
    border-radius: 1.3rem;
  }
  .qr-phone-title {
    font-size: 0.66rem;
  }
  .qr-count {
    font-size: 0.58rem;
  }
  .qr-cells {
    gap: 0.15rem;
  }
  /* Four short numbers sit two by two on a phone instead of stacking one per row. */
  .qrfig .reads {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .qrfig .read {
    padding: 0.75rem 0.8rem 0.8rem;
  }
}

/* ---------- redact.css ---------- */
/* The redactor: text as a pane printed it, the same text as ft keeps it, and which patterns fired. */
#fig-redact .rd-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.2rem;
}
#fig-redact .presets .tag {
  min-height: 2.75rem;
  padding-inline: 0.85rem;
  font: 600 0.82rem/1.2 var(--sans);
}
#fig-redact .toggle {
  min-height: 2.75rem;
}
#fig-redact .rd-panes {
  display: grid;
  gap: 0.9rem;
}
@media (min-width: 900px) {
  #fig-redact .rd-panes {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
#fig-redact .term-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#fig-redact .term-bar em {
  flex: none;
  margin-left: auto;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 99rem;
  font-style: normal;
  font-size: 0.66rem;
  color: var(--muted);
}
#fig-redact .rd-in,
#fig-redact .rd-out {
  transition: border-color 0.2s;
}
#fig-redact .rd-in:focus-within {
  border-color: color-mix(in srgb, var(--chapter) 60%, transparent);
}
#fig-redact .rd-out {
  border-color: color-mix(in srgb, var(--chapter) 30%, var(--line-2));
}
#fig-redact .term-bar {
  min-height: 2.6rem;
  padding-block: 0.4rem;
}
#fig-redact .rd-in .term-body,
#fig-redact .rd-out .term-body {
  /* A set height, not the flex share .term-body takes: a textarea's own height is two rows. */
  flex: none;
  box-sizing: border-box;
  width: 100%;
  height: 14rem;
  overflow: auto;
  overscroll-behavior: contain;
  font-size: 0.8rem;
  line-height: 1.6;
  font-variant-ligatures: none;
}
@media (min-width: 900px) {
  #fig-redact .rd-in .term-body,
  #fig-redact .rd-out .term-body {
    height: 15.5rem;
  }
}
#fig-redact textarea.term-body {
  display: block;
  border: 0;
  outline: 0;
  resize: none;
  background: none;
}
#fig-redact textarea.term-body::placeholder {
  color: var(--faint);
}
#fig-redact .rd-out mark {
  padding: 0.05em 0.2em;
  border-radius: 0.3em;
  background: color-mix(in srgb, var(--chapter) 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chapter) 45%, transparent);
  color: #fff;
}
#fig-redact .rd-say {
  min-height: 1.5em;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--soft);
}

/* ---------- The catalog ---------- */
#fig-redact .rd-cat {
  display: grid;
  gap: 0.7rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}
#fig-redact .rd-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
#fig-redact .rd-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.8rem;
  padding: 0.15rem 0.55rem 0.15rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  font: 500 0.7rem/1.2 var(--mono);
  color: var(--faint);
  transition:
    border-color 0.25s,
    background-color 0.25s,
    color 0.25s;
}
#fig-redact .rd-list .n {
  min-width: 1.1rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  opacity: 0.7;
}
#fig-redact .rd-list code {
  font: inherit;
}
#fig-redact .rd-list b {
  font-weight: 600;
  color: #fff;
}
#fig-redact .rd-list b:empty {
  display: none;
}
#fig-redact .rd-list li.on {
  border-color: color-mix(in srgb, var(--chapter) 55%, transparent);
  background: color-mix(in srgb, var(--chapter) 12%, transparent);
  color: #fff;
}
@media (max-width: 640px) {
  #fig-redact .rd-top .presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  #fig-redact .rd-list li {
    font-size: 0.66rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  #fig-redact .rd-list li {
    transition: none;
  }
}

/* ---------- robot.css ---------- */
/* Robot Mode: a command's response in JSON or TOON, and what --stats says about the two. */
#fig-robot .rb-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.6rem;
  align-items: end;
}
#fig-robot .rb-ctl {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}
#fig-robot .rb-ctl:first-child {
  flex: 1 1 32rem;
}
#fig-robot .seg button {
  min-height: 2.75rem;
}
#fig-robot [data-seg="rb-cmd"] button {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
}
#fig-robot .rb-grid {
  display: grid;
  gap: 1.2rem;
}
@media (min-width: 1000px) {
  #fig-robot .rb-grid {
    grid-template-columns: minmax(0, 1fr) 20rem;
  }
}

/* The terminal: the command, the stats line on stderr, then the response. */
/* The terminal keeps one height; the response takes what the command line leaves. */
#fig-robot .rb-term {
  display: flex;
  flex-direction: column;
  height: 33rem;
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: #030806;
  overflow: hidden;
}
#fig-robot .rb-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid var(--line);
  font: 500 0.72rem/1 var(--mono);
  color: var(--faint);
}
#fig-robot .rb-bar i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--line-2);
}
#fig-robot .rb-bar span {
  margin-left: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#fig-robot .rb-head {
  padding: 0.85rem 1.1rem 0.7rem;
  border-bottom: 1px dashed var(--line);
}
#fig-robot .rb-line {
  font: 400 0.84rem/1.55 var(--term);
  color: #e7fbe9;
  overflow-wrap: anywhere;
}
#fig-robot .rb-ps {
  color: var(--chapter);
}
#fig-robot .rb-err {
  margin-top: 0.25rem;
  color: var(--amber);
}
#fig-robot .rb-out {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  padding: 0.9rem 1.1rem 1.1rem;
  overflow: auto;
  overscroll-behavior: contain;
  font: 400 0.84rem/1.6 var(--term);
  color: #cfe5d7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
  scrollbar-color: var(--line-3) transparent;
}
/* While there is more below, the last visible lines fade out; at the end of the response, and for one too short to
   scroll, nothing fades. */
@property --rb-fade {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@keyframes rb-fade {
  0%,
  92% {
    --rb-fade: 2.6rem;
  }
  100% {
    --rb-fade: 0px;
  }
}
@supports (animation-timeline: scroll()) {
  #fig-robot .rb-out {
    mask-image: linear-gradient(to bottom, #000 calc(100% - var(--rb-fade)), transparent);
    animation: rb-fade linear both;
    animation-timeline: scroll(self);
  }
}
/* One line per block, so a long value wraps under itself and not back to the margin. */
#fig-robot .rb-out .ln {
  display: block;
  min-height: 1lh;
  padding-left: calc((var(--i, 0) + 2) * 1ch);
  text-indent: -2ch;
}
/* A fade at the foot while there is more to scroll. */
#fig-robot .rb-out.rb-more {
  mask-image: linear-gradient(#000 calc(100% - 3rem), transparent);
}
#fig-robot .rb-out:focus-visible {
  outline: 2px solid var(--chapter);
  outline-offset: -2px;
}
/* Beside the side column, the terminal stretches to its height. */
@media (min-width: 1000px) {
  #fig-robot .rb-term {
    height: auto;
    min-height: 34rem;
  }
  #fig-robot .rb-badge {
    white-space: nowrap;
  }
}
#fig-robot .rb-out .e {
  color: var(--chapter);
  font-weight: 700;
}
#fig-robot .rb-out .key {
  color: #93c5fd;
}
#fig-robot .rb-out .s {
  color: #bef264;
}
#fig-robot .rb-out .n {
  color: #fbbf24;
}
#fig-robot .rb-out .k {
  color: #f0abfc;
}
#fig-robot .rb-out .h {
  color: var(--faint);
}
#fig-robot .rb-out .p {
  color: var(--faint);
}

/* What the response is, and what its two sizes are. */
#fig-robot .rb-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
#fig-robot .rb-badge {
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.34rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--life) 40%, transparent);
  border-radius: 99rem;
  background: rgb(74 222 128 / 0.08);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--life-2);
}
#fig-robot .rb-badge::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--life);
}
#fig-robot .rb-badge.rb-example {
  border-color: var(--line-2);
  background: none;
  color: var(--soft);
}
#fig-robot .rb-badge.rb-example::before {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--muted);
}
/* Room for the longest note and verdict, so that switching commands does not move what is below. */
#fig-robot .rb-note {
  min-height: 3lh;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--soft);
  text-wrap: pretty;
}
#fig-robot .rb-reads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
#fig-robot .rb-reads .read {
  padding: 0.7rem 0.8rem 0.75rem;
}
#fig-robot .rb-reads .read b {
  font-size: 1.2rem;
}
#fig-robot [data-read="saved"] b {
  color: var(--chapter);
}
#fig-robot .rb-verdict {
  min-height: 3lh;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}
#fig-robot .rb-env {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
#fig-robot .rb-env dl {
  display: grid;
  gap: 0.3rem 1rem;
  margin-top: 0.6rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
}
#fig-robot .rb-env div {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  min-width: 0;
}
#fig-robot .rb-env dt {
  flex: none;
  font: 600 0.78rem/1.5 var(--term);
  color: var(--chapter);
}
#fig-robot .rb-env dd {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
}
@media (min-width: 1000px) {
  #fig-robot .rb-env dl {
    grid-template-columns: 1fr;
  }
}

/* Pragmasevka draws "--" as one long dash, which would misprint every flag.
   Last, because the font shorthands above reset both properties. */
#fig-robot .rb-line,
#fig-robot .rb-out,
#fig-robot [data-seg="rb-cmd"] button {
  font-variant-ligatures: none;
  font-feature-settings: "calt" 0, "liga" 0;
}

/* ---------- rules.css ---------- */
/* The rule catalogue. */
/* Pragmasevka joins -- into one long dash. Commands here must show both hyphens. The font shorthand
   used below resets this property with more specificity, hence !important. */
#fig-rules,
#fig-rules * {
  font-variant-ligatures: none !important;
}
#fig-rules > .fig-body {
  container-type: inline-size;
}
#fig-rules .rl-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
#fig-rules .seg b,
#fig-rules .rl-sv b {
  margin-left: 0.25rem;
  font: 500 0.72rem/1 var(--mono);
  color: var(--faint);
}
#fig-rules .seg button[aria-pressed="true"] b {
  color: color-mix(in srgb, var(--chapter) 60%, #fff);
}
#fig-rules .rl-sevs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
#fig-rules .rl-sv {
  --sev: var(--info);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 99rem;
  background: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--soft);
  text-transform: capitalize;
  transition:
    border-color 0.2s,
    background-color 0.2s,
    opacity 0.2s;
}
#fig-rules .rl-sv[data-sev="warning"] {
  --sev: var(--warning);
}
#fig-rules .rl-sv[data-sev="critical"] {
  --sev: var(--critical);
}
#fig-rules .rl-sv i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--sev);
}
#fig-rules .rl-sv[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--sev) 50%, transparent);
  background: color-mix(in srgb, var(--sev) 9%, transparent);
  color: #fff;
}
#fig-rules .rl-sv[aria-pressed="false"] {
  opacity: 0.55;
}
#fig-rules .rl-sv[aria-pressed="false"] i {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--sev);
}
#fig-rules .rl-count {
  margin: 1rem 0 0.6rem;
  font-size: 0.84rem;
  color: var(--muted);
}
#fig-rules .fig-body > .rl-count {
  margin-top: 1rem;
}
#fig-rules .fig-body > .rl-scroll {
  margin-top: 0;
}
#fig-rules .rl-scroll {
  max-height: 38rem;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.22);
  scrollbar-width: thin;
  scrollbar-color: var(--line-3) transparent;
}
#fig-rules .rl-scroll:focus-visible {
  outline: 2px solid var(--chapter);
  outline-offset: 2px;
}
#fig-rules .rl-list {
  margin: 0;
}
#fig-rules .rl-row {
  --sev: var(--info);
  display: grid;
  gap: 0.7rem 1.3rem;
  padding: 0.95rem 1.1rem;
  border-top: 1px solid var(--line);
}
#fig-rules .rl-row:first-child {
  border-top: 0;
}
#fig-rules .rl-row[data-sev="warning"] {
  --sev: var(--warning);
}
#fig-rules .rl-row[data-sev="critical"] {
  --sev: var(--critical);
}
#fig-rules .rl-row[hidden] {
  display: none;
}
@container (min-width: 820px) {
  #fig-rules .rl-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 14rem;
    align-items: center;
  }
}
#fig-rules .rl-main,
#fig-rules .rl-anchors,
#fig-rules .rl-side {
  min-width: 0;
}
#fig-rules .rl-id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.55rem;
  margin: 0;
}
#fig-rules .rl-dot {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--sev);
  box-shadow: 0 0 8px color-mix(in srgb, var(--sev) 60%, transparent);
}
#fig-rules .rl-id code {
  font: 600 0.86rem/1.3 var(--term);
  color: #fff;
  overflow-wrap: anywhere;
}
#fig-rules .rl-sev {
  font: 600 0.6rem/1 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sev);
}
#fig-rules .rl-desc {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}
#fig-rules .rl-anchors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
#fig-rules .rl-k {
  font: 600 0.58rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
#fig-rules .rl-k:first-child {
  margin-right: 0.15rem;
}
#fig-rules .rl-k:last-child {
  margin-left: 0.2rem;
}
#fig-rules .rl-a {
  max-width: 100%;
  padding: 0.14rem 0.42rem;
  border: 1px solid var(--line-2);
  border-radius: 0.4rem;
  font: 400 0.72rem/1.35 var(--term);
  color: var(--soft);
  overflow-wrap: anywhere;
}
#fig-rules .rl-more {
  font: 500 0.7rem/1 var(--mono);
  color: var(--faint);
}
#fig-rules .rl-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
}
@container (min-width: 820px) {
  #fig-rules .rl-side {
    justify-content: flex-end;
    text-align: right;
  }
}
#fig-rules .rl-wf {
  margin: 0;
  font: 500 0.76rem/1.3 var(--term);
}
#fig-rules .rl-wf code {
  font: inherit;
  color: var(--life-2);
}
#fig-rules .rl-wf span,
#fig-rules .rl-nofix {
  margin: 0;
  font: 400 0.74rem/1.3 var(--term);
  color: var(--faint);
}
#fig-rules .rl-try {
  min-height: 2.4rem;
  padding-inline: 0.85rem;
}
#fig-rules .rl-n {
  flex-basis: 100%;
  margin: 0;
  font: 400 0.7rem/1 var(--mono);
  color: var(--faint);
}
@container (max-width: 559px) {
  #fig-rules .seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  #fig-rules .seg button:first-child {
    grid-column: span 2;
  }
  #fig-rules .rl-sevs {
    width: 100%;
  }
  #fig-rules .rl-sv {
    flex: 1;
    justify-content: center;
    min-height: 2.75rem;
    padding-inline: 0.5rem;
  }
  #fig-rules .rl-scroll {
    max-height: 32rem;
  }
  #fig-rules .rl-row {
    padding: 0.85rem 0.9rem;
  }
  #fig-rules .rl-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "wf try"
      "n try";
    gap: 0.3rem 0.8rem;
  }
  #fig-rules .rl-wf,
  #fig-rules .rl-nofix {
    grid-area: wf;
  }
  #fig-rules .rl-n {
    grid-area: n;
  }
  #fig-rules .rl-try {
    grid-area: try;
    min-height: 2.75rem;
  }
}

/* A phone does not get a scroll box inside the page: the list runs at full length, opening with six rules. */
#fig-rules .rl-more {
  display: none;
  margin-top: 0.9rem;
}
@container (max-width: 559px) {
  #fig-rules .rl-scroll {
    max-height: none;
    overflow: visible;
  }
  .js #fig-rules .rl-row.later {
    display: none;
  }
  .js #fig-rules .rl-more:not([hidden]) {
    display: block;
  }
}

/* ---------- search.css ---------- */
/* ft search over a sample: the query, the mode, and the ranked segments with where each came from. */
#fig-search .sr-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
#fig-search .sr-field {
  flex: 1 1 18rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0 1rem;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.34);
  transition: border-color 0.2s, box-shadow 0.2s;
}
#fig-search .sr-field:focus-within {
  border-color: color-mix(in srgb, var(--chapter) 70%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--chapter) 16%, transparent);
}
#fig-search .sr-field svg {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--chapter);
}
/* Named for screen readers; the field and its icon say it to everyone else. */
#fig-search .sr-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#fig-search .sr-q {
  flex: 1;
  min-width: 0;
  min-height: 3rem;
  border: 0;
  outline: 0;
  background: none;
  font: 500 1rem/1.3 var(--term);
  color: #fff;
}
#fig-search .sr-q::-webkit-search-cancel-button {
  filter: grayscale(1) brightness(1.6);
  cursor: pointer;
}
#fig-search .sr-try {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
}
#fig-search .sr-try .micro {
  flex: none;
}
#fig-search .presets .tag {
  min-height: 2.75rem;
  font-family: var(--term);
}
#fig-search .sr-status {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.2rem;
}
#fig-search .sr-cmd {
  font: 400 0.8rem/1.5 var(--term);
  color: var(--soft);
  overflow-wrap: anywhere;
}
#fig-search .sr-cmd::before {
  content: "$ ";
  color: var(--faint);
}
#fig-search .sr-sum {
  min-height: 1.5em;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- Results ---------- */
#fig-search .sr-results {
  /* Room for six rows whatever the query returns, so that the page below holds still. */
  min-height: calc(6 * 4.15rem);
  border-top: 1px solid var(--line);
  counter-reset: none;
}
#fig-search .sr-row {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: 0.35rem 0.8rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
#fig-search .sr-rank {
  grid-row: span 2;
  padding-top: 0.1rem;
  font: 500 0.8rem/1.4 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}
#fig-search .sr-main {
  min-width: 0;
}
#fig-search .sr-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.65rem;
  font-size: 0.75rem;
  color: var(--faint);
}
#fig-search .sr-pane {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: 600 0.74rem/1.4 var(--mono);
  color: var(--soft);
}
#fig-search .sr-pane::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--a);
}
#fig-search .sr-meta time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
#fig-search .sr-text {
  margin-top: 0.2rem;
  font: 400 0.88rem/1.55 var(--term);
  color: #d6e8dc;
  overflow-wrap: anywhere;
}
#fig-search .sr-text mark {
  padding: 0 0.12em;
  border-radius: 0.25em;
  background: color-mix(in srgb, var(--chapter) 26%, transparent);
  color: #fff;
}
#fig-search .sr-score {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
  min-width: 0;
}
#fig-search .sr-chips {
  display: flex;
  gap: 0.35rem;
}
#fig-search .sr-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.5rem;
  padding: 0 0.5rem;
  border: 1px solid color-mix(in srgb, var(--chapter) 38%, transparent);
  border-radius: 99rem;
  background: color-mix(in srgb, var(--chapter) 9%, transparent);
  font: 500 0.7rem/1 var(--mono);
  color: var(--soft);
  white-space: nowrap;
}
#fig-search .sr-chip b {
  font-weight: 600;
  color: #fff;
}
#fig-search .sr-chip.off {
  border: 1px dashed var(--line-2);
  background: none;
  color: var(--faint);
}
#fig-search .sr-chip.off b {
  color: var(--faint);
}
#fig-search .sr-val {
  font: 500 0.76rem/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}
#fig-search .sr-val b {
  font-weight: 600;
  color: #fff;
}
#fig-search .sr-bar {
  flex: 1 1 4rem;
  max-width: 8rem;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
#fig-search .sr-bar i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: var(--chapter);
}
#fig-search .sr-none {
  padding: 1.6rem 0;
  max-width: 34rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}
@media (max-width: 640px) {
  #fig-search .sr-form .seg {
    flex: 1 1 100%;
  }
}
@media (min-width: 760px) {
  #fig-search .sr-row {
    grid-template-columns: 1.4rem minmax(0, 1fr) 15.5rem;
    align-items: center;
  }
  #fig-search .sr-rank {
    grid-row: auto;
    align-self: start;
    padding-top: 0.15rem;
  }
  #fig-search .sr-score {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
  }
  #fig-search .sr-bar {
    flex: none;
    width: 8rem;
  }
  #fig-search .sr-status {
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 1.2rem;
  }
  #fig-search .sr-sum {
    text-align: right;
  }
}
/* No ligatures in commands and captured text: the terminal font would draw "--mode" with a long dash. Last, after the font shorthands. */
#fig-search .sr-cmd,
#fig-search .sr-text,
#fig-search .sr-q {
  font-variant-ligatures: none;
}

/* ---------- surfaces.css ---------- */
/* Where it runs: one card per surface, with the README's status lines. */
.surfaces {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
@media (min-width: 1100px) {
  .surfaces {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.surface {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  min-width: 0;
  padding: 1.25rem 1.3rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.025), transparent 40%), var(--raise);
}
.surface-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.surface-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--chapter) 12%, transparent);
  color: var(--chapter);
}
.surface-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}
.surface h4 {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.2;
  color: #fff;
}
.surface-status {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.8rem;
  background: rgb(0 0 0 / 0.25);
}
.surface-status li {
  position: relative;
  padding-left: 1.05rem;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
}
.surface-status li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--life);
  box-shadow: 0 0 8px rgb(74 222 128 / 0.5);
}
.surface-status li.preview::before {
  background: var(--sky);
  box-shadow: 0 0 8px rgb(108 200 247 / 0.5);
}
.surface-status code {
  white-space: nowrap;
  font-size: 0.84em;
  font-weight: 500;
  color: var(--soft);
}
.surface-facts {
  display: grid;
  gap: 0.55rem;
}
.surface-facts li {
  font-size: 0.89rem;
  line-height: 1.52;
  color: var(--soft);
  text-wrap: pretty;
}
.surface-facts code {
  white-space: nowrap;
  font-size: 0.88em;
  color: #fff;
}
.surface-run {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.2rem;
}
.surface-run code {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 0.5rem;
  font: 500 0.72rem/1.3 var(--mono);
  color: color-mix(in srgb, var(--chapter) 55%, #fff);
}

/* ---------- tester.css ---------- */
/* "Try the rules": samples and a text box on one side, the engine's three stages on the other. */
/* Pragmasevka joins -- into one long dash. Commands here must show both hyphens. The font shorthand
   used below resets this property with more specificity, hence !important. */
#fig-tester,
#fig-tester * {
  font-variant-ligatures: none !important;
}
#fig-tester > .fig-body {
  container-type: inline-size;
}
#fig-tester .tt-grid {
  display: grid;
  gap: 1.2rem;
}
@container (min-width: 860px) {
  #fig-tester .tt-grid {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 1.5rem;
    align-items: start;
  }
}
#fig-tester .tt-in {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  min-width: 0;
}
#fig-tester .tt-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
#fig-tester .tt-picks .tag {
  min-height: 2.35rem;
  padding-inline: 0.75rem;
  font-size: 0.74rem;
  color: var(--soft);
}
#fig-tester .tt-picks .tag:disabled {
  cursor: progress;
  opacity: 0.6;
}
#fig-tester .tt-select,
#fig-tester .tt-box {
  display: block;
}
#fig-tester .tt-select > span,
#fig-tester .tt-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}
#fig-tester select {
  appearance: none;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 2.4rem 0.5rem 0.9rem;
  border: 1px solid var(--line-2);
  border-radius: 0.75rem;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398aba1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E")
      right 0.75rem center / 1.1rem no-repeat,
    #030806;
  font: 400 0.84rem/1.3 var(--term);
  color: var(--text);
  cursor: pointer;
}
#fig-tester select:disabled {
  cursor: progress;
  opacity: 0.6;
}
#fig-tester textarea {
  display: block;
  width: 100%;
  min-height: 10.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 0.9rem;
  background: #030806;
  font: 400 0.84rem/1.6 var(--term);
  color: #e6f3ea;
  resize: vertical;
  transition: border-color 0.2s;
}
#fig-tester textarea:focus-visible,
#fig-tester select:focus-visible {
  outline: 2px solid var(--chapter);
  outline-offset: 2px;
  border-color: transparent;
}
#fig-tester .tt-expect {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}
#fig-tester .tt-expect code {
  font: 500 0.8rem var(--term);
  color: var(--soft);
}
#fig-tester .tt-expect.same::before,
#fig-tester .tt-expect.differs::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: rgb(74 222 128 / 0.16);
  font-size: 0.7rem;
  color: var(--life);
  vertical-align: 0.05em;
}
#fig-tester .tt-expect.differs::before {
  content: "!";
  background: rgb(251 191 36 / 0.16);
  color: var(--amber);
}

/* ---------- The engine's stages ---------- */
#fig-tester .tt-out {
  min-width: 0;
  min-height: 25rem;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.22);
}
#fig-tester .tt-sum {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.012em;
  color: #fff;
  overflow-wrap: anywhere;
}
#fig-tester .tt-stages {
  margin: 0;
}
#fig-tester .tt-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: 0.8rem;
  padding-bottom: 1.05rem;
}
#fig-tester .tt-stage:last-child {
  padding-bottom: 0;
}
#fig-tester .tt-stage:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(0.875rem - 0.5px);
  top: 1.9rem;
  bottom: 0.15rem;
  width: 1px;
  background: var(--line-2);
}
#fig-tester .tt-n {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font: 600 0.74rem/1 var(--mono);
  color: var(--muted);
}
#fig-tester .tt-stage.pass .tt-n {
  border-color: rgb(74 222 128 / 0.5);
  background: rgb(74 222 128 / 0.14);
  color: var(--life-2);
}
#fig-tester .tt-stage.stop .tt-n {
  border-color: rgb(251 191 36 / 0.5);
  background: rgb(251 191 36 / 0.12);
  color: var(--amber);
}
#fig-tester .tt-stage.off {
  opacity: 0.5;
}
#fig-tester .tt-stage h4 {
  margin: 0.2rem 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.012em;
  color: #fff;
}
#fig-tester .tt-stage p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--soft);
  text-wrap: pretty;
}
#fig-tester q {
  quotes: "“" "”";
  font: 400 0.82rem var(--term);
  color: #e6f3ea;
}
#fig-tester .tt-skip {
  color: var(--faint) !important;
}
#fig-tester .tt-cands {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.6rem;
}
#fig-tester .tt-cand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.7rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  font: 400 0.76rem/1.4 var(--term);
}
#fig-tester .tt-cand code {
  font: inherit;
  color: #fff;
}
#fig-tester .tt-anchor {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}
#fig-tester .tt-anchor q {
  font-size: inherit;
  color: var(--soft);
}
#fig-tester .tt-re {
  margin-left: auto;
  font: 600 0.62rem/1.4 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#fig-tester .tt-cand.match .tt-re {
  color: var(--life);
}
#fig-tester .tt-cand.miss {
  border-style: dashed;
}
#fig-tester .tt-cand.miss .tt-re {
  color: var(--coral);
}
#fig-tester .tt-cand.none .tt-re,
#fig-tester .tt-cand.skipped .tt-re {
  color: var(--sky);
}
#fig-tester .tt-dets {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.15rem;
}
#fig-tester .tt-det {
  --sev: var(--info);
  padding: 0.8rem 0.9rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--sev) 45%, transparent);
  border-radius: 0.85rem;
  background: linear-gradient(150deg, color-mix(in srgb, var(--sev) 9%, transparent), transparent 70%);
}
#fig-tester .tt-det[data-sev="warning"] {
  --sev: var(--warning);
}
#fig-tester .tt-det[data-sev="critical"] {
  --sev: var(--critical);
}
#fig-tester .tt-det-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
}
#fig-tester .tt-det-head code {
  font: 600 0.84rem/1.3 var(--term);
  color: #fff;
  overflow-wrap: anywhere;
}
#fig-tester .tt-sev {
  padding: 0.16rem 0.45rem;
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--sev) 18%, transparent);
  font: 600 0.62rem/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sev);
}
#fig-tester .tt-det .tt-desc {
  margin-top: 0.3rem;
  font-size: 0.86rem;
  color: var(--muted);
}
#fig-tester .tt-kv {
  display: grid;
  gap: 0.2rem;
  margin: 0.6rem 0 0;
}
#fig-tester .tt-kv > div {
  display: grid;
  grid-template-columns: minmax(5.5rem, max-content) minmax(0, 1fr);
  gap: 0.8rem;
  font: 400 0.78rem/1.45 var(--term);
}
#fig-tester .tt-kv dt {
  color: var(--faint);
}
#fig-tester .tt-kv dd {
  margin: 0;
  color: #eaf6ee;
  overflow-wrap: anywhere;
}
#fig-tester .tt-wf {
  margin-top: 0.55rem !important;
  font-size: 0.82rem !important;
  color: var(--muted) !important;
}
#fig-tester .tt-wf code {
  font: 500 0.78rem var(--term);
  color: var(--life-2);
}
#fig-tester .tt-ctl {
  padding: 0 0.2em;
  border-radius: 0.2em;
  background: rgb(251 191 36 / 0.16);
  font-size: 0.85em;
  color: var(--amber);
}
@container (max-width: 559px) {
  #fig-tester .tt-picks .tag {
    min-height: 2.75rem;
  }
  #fig-tester textarea {
    min-height: 7.5rem;
  }
  #fig-tester .tt-out {
    min-height: 0;
    padding: 0.95rem 0.9rem 1rem;
  }
  #fig-tester .tt-kv > div {
    grid-template-columns: 1fr;
    gap: 0;
  }
  #fig-tester .tt-kv > div + div {
    margin-top: 0.25rem;
  }
}

/* ---------- tx.css ---------- */
/* A transaction across four panes: the phases, each step and its undo, the events and the ledger. */
#fig-tx {
  --ok: var(--life);
  --bad: var(--critical);
  --warn: var(--warning);
}
#fig-tx .tx-top {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.8rem 1.2rem;
}
#fig-tx .tx-pick {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}
#fig-tx .seg button {
  min-height: 2.75rem;
}
#fig-tx .tx-replay {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.3rem 1rem 0.3rem 0.85rem;
  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, color 0.2s;
}
#fig-tx .tx-replay:hover {
  border-color: var(--chapter);
  color: #fff;
}
#fig-tx .tx-replay svg {
  width: 1rem;
  height: 1rem;
}
#fig-tx .tx-cmd {
  font: 400 0.8rem/1.5 var(--term);
  color: var(--soft);
  overflow-wrap: anywhere;
}
#fig-tx .tx-cmd .dim {
  color: var(--faint);
}
#fig-tx .tx-grid {
  display: grid;
  gap: 1.3rem;
  align-items: start;
}
@media (min-width: 1000px) {
  #fig-tx .tx-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 1.6rem;
  }
}
#fig-tx .tx-left,
#fig-tx .tx-right {
  display: grid;
  gap: 0.9rem;
  min-width: 0;
}

/* ---------- Phases ---------- */
#fig-tx .tx-phases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}
#fig-tx .tx-phases li {
  position: relative;
  padding: 0.55rem 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  font: 500 0.74rem/1.2 var(--mono);
  text-align: center;
  color: var(--faint);
  transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}
#fig-tx .tx-phases li[data-on="past"] {
  color: var(--soft);
  border-color: var(--line-2);
}
#fig-tx .tx-phases li[data-on="now"] {
  border-color: color-mix(in srgb, var(--chapter) 60%, transparent);
  background: color-mix(in srgb, var(--chapter) 12%, transparent);
  color: #fff;
}
#fig-tx .tx-state {
  font-size: 0.84rem;
  color: var(--muted);
}
#fig-tx .tx-state b {
  margin-left: 0.4rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 0.45rem;
  font: 600 0.78rem/1.4 var(--mono);
  color: #fff;
}

/* ---------- Steps ---------- */
#fig-tx .tx-steps {
  display: grid;
  gap: 0.4rem;
}
#fig-tx .tx-steps li {
  display: grid;
  grid-template-columns: 1.3rem minmax(0, 1fr) 6.2rem;
  gap: 0.7rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgb(255 255 255 / 0.015);
  transition: border-color 0.3s, background-color 0.3s;
  --k: var(--faint);
}
#fig-tx .tx-n {
  font: 500 0.72rem/1 var(--mono);
  color: var(--faint);
  text-align: right;
}
#fig-tx .tx-act {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
#fig-tx .tx-act small {
  font: 500 0.7rem/1.3 var(--mono);
  color: var(--faint);
}
#fig-tx .tx-act code {
  font: 400 0.8rem/1.45 var(--term);
  color: #d6e8dc;
  overflow-wrap: anywhere;
}
#fig-tx .tx-act .tx-undo {
  font-size: 0.74rem;
  color: var(--faint);
  transition: color 0.3s;
}
#fig-tx .tx-st {
  justify-self: end;
  padding: 0.25rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--k) 50%, transparent);
  border-radius: 0.45rem;
  font: 600 0.7rem/1.2 var(--mono);
  color: var(--k);
  white-space: nowrap;
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}
#fig-tx .tx-steps li[data-st="ready"] {
  --k: var(--soft);
}
#fig-tx .tx-steps li[data-st="committed"] {
  --k: var(--ok);
}
#fig-tx .tx-steps li[data-st="failed"] {
  --k: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 55%, transparent);
  background: color-mix(in srgb, var(--bad) 8%, transparent);
}
#fig-tx .tx-steps li[data-st="skipped"] {
  --k: var(--warn);
  opacity: 0.7;
}
#fig-tx .tx-steps li[data-st="skipped"] .tx-act code:first-of-type {
  text-decoration: line-through;
  text-decoration-color: var(--faint);
}
#fig-tx .tx-steps li[data-st="compensated"] {
  --k: var(--chapter);
  border-color: color-mix(in srgb, var(--chapter) 45%, transparent);
}
#fig-tx .tx-steps li[data-undone] .tx-undo {
  color: color-mix(in srgb, var(--chapter) 60%, #fff);
}
#fig-tx .tx-steps li[data-st="compensated"] .tx-st {
  background: color-mix(in srgb, var(--chapter) 14%, transparent);
}

/* ---------- Events and ledger ---------- */
#fig-tx .tx-log {
  display: block;
  /* .term-body grows with flex: 1, whose zero basis would override this height. */
  flex: none;
  height: 15.5rem;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  font-size: 0.76rem;
  line-height: 1.55;
}
#fig-tx .tx-log li {
  padding: 0.12rem 0;
}
#fig-tx .tx-log li b {
  font-weight: 500;
  color: #e7fbe9;
}
#fig-tx .tx-log li span {
  color: var(--faint);
}
#fig-tx .tx-log li.ok b {
  color: var(--ok);
}
#fig-tx .tx-log li.bad b,
#fig-tx .tx-log li.bad span {
  color: var(--bad);
}
#fig-tx .tx-log li.warn b {
  color: var(--warn);
}
#fig-tx .tx-log li.dim b {
  color: var(--soft);
}
#fig-tx .tx-led {
  display: grid;
  gap: 0.5rem;
}
/* A set height that scrolls, so that records arriving never move the page. */
#fig-tx .tx-ledger {
  display: grid;
  align-content: start;
  gap: 0.25rem;
  height: 12.5rem;
  overflow: auto;
  overscroll-behavior: contain;
}
@media (max-width: 640px) {
  #fig-tx .tx-pick {
    flex: 1 1 100%;
  }
  #fig-tx [data-seg="tx-fail"] {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  #fig-tx [data-seg="tx-fail"] button {
    padding-inline: 0.2rem;
    font-size: 0.8rem;
  }
}
#fig-tx .tx-ledger li {
  display: grid;
  grid-template-columns: 1.2rem auto minmax(0, 1fr) auto;
  gap: 0.15rem 0.6rem;
  align-items: baseline;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  font: 500 0.72rem/1.35 var(--mono);
  color: var(--soft);
}
#fig-tx .tx-ledger code {
  font: inherit;
  color: #e7fbe9;
}
#fig-tx .tx-ledger .tx-prev {
  grid-column: 2 / -1;
  color: var(--faint);
}
#fig-tx .tx-o {
  color: var(--ok);
}
#fig-tx .tx-o[data-o="failed"] {
  color: var(--bad);
}
#fig-tx .tx-o[data-o="compensated"] {
  color: color-mix(in srgb, var(--chapter) 60%, #fff);
}
#fig-tx .tx-ledger .tx-empty {
  display: block;
  border-style: dashed;
  color: var(--faint);
}
@media (max-width: 520px) {
  #fig-tx .tx-ledger li {
    grid-template-columns: 1.2rem minmax(0, 1fr) auto;
  }
  #fig-tx .tx-ledger li > span:nth-of-type(2) {
    grid-column: 2;
  }
  #fig-tx .tx-steps li {
    grid-template-columns: 1.1rem minmax(0, 1fr);
  }
  #fig-tx .tx-st {
    grid-column: 2;
    justify-self: start;
  }
}
@media (prefers-reduced-motion: reduce) {
  #fig-tx .tx-steps li,
  #fig-tx .tx-st,
  #fig-tx .tx-phases li,
  #fig-tx .tx-undo {
    transition: none;
  }
}
