.outcome-sort {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(2.6rem, 6rem) minmax(0, 1fr);
  max-width: 46rem;
  margin: 0 auto 1.2rem;
  gap: .45rem .45rem;
  text-align: center;
}
.outcome-stock { grid-column: 1 / -1; display: grid; justify-items: center; gap: .3rem; margin-bottom: .55rem; }
.outcome-stock > div { display: flex; gap: .35rem; }
.count-ticket {
  display: inline-grid;
  place-items: center;
  min-width: 2.2rem;
  min-height: 2.2rem;
  border: 2px solid #24231e;
  border-radius: .12rem .48rem .18rem .24rem;
  background: #ffdf69;
  font-weight: 770;
  box-shadow: 1px 2px #24231e;
}
.ticket-b { background: #b9e7d1; }
.ticket-c { background: #f4bdd7; }
.outcome-head { border-block-end: 2px solid #24231e; padding-block-end: .4rem; }
.outcome-head + .outcome-head, .outcome-total:last-child { grid-column: 3; }
.outcome-ordered, .outcome-merged {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(.22rem, 1vw, .6rem);
}
.outcome-ordered span, .outcome-merged span {
  border: 1.5px solid #24231e;
  border-radius: .3rem;
  padding: .15em .48em;
  white-space: nowrap;
  font-weight: 750;
}
.outcome-ordered span { background: #fff0b3; }
.outcome-ordered { flex-direction: column; align-items: end; padding-inline-end: .55rem; gap: .15rem; }
.outcome-merged { justify-content: start; padding-inline-start: .55rem; }
.outcome-merged span { background: #d9f0e3; }
.outcome-join { display: block; width: 100%; height: 3.9rem; align-self: center; stroke: #005650; fill: none; stroke-width: 3.7; stroke-linecap: round; stroke-linejoin: round; }
.outcome-total { border-block-start: 1px solid #b0a38b; margin-top: .35rem; padding-block-start: .4rem; }
.end-slots { max-width: 33rem; margin: 0 auto 1.2rem; }
.end-slots > div { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; margin-block: .55rem; }
.end-slots b { padding: .3rem 0; text-align: center; border: 1.5px dashed #857754; border-radius: .2rem; background: #fff8dd; }
.end-slots > p { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .3rem .7rem; margin: .45rem 0; }
.outcome-probability { display: flex; justify-content: center; flex-wrap: wrap; gap: .65rem 1rem; margin: 0 auto 1.1rem; }
.outcome-probability > div { display: grid; grid-template-columns: auto auto; justify-content: center; gap: .3rem; padding: .55rem .8rem; border: 1px solid #ab9e84; border-radius: .55rem .3rem .48rem .3rem; }
.outcome-probability .has-c { background: #d9f0e3; border: 2px solid #005650; }
.outcome-probability strong { grid-column: 1 / -1; margin-top: .3rem; text-align: center; }
.code-examples, .code-layout { display: grid; gap: .4rem; max-width: 49rem; margin: .7rem auto 1rem; }
.code-examples > div, .code-layout > div { display: grid; align-items: center; text-align: center; gap: .4rem; grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr)) 1.5fr; }
.code-layout > div { grid-template-columns: .7fr repeat(4, minmax(0, 1fr)) 2fr; }
.code-layout > div > span { font-size: .94em; }
.code-examples code, .code-extend code, .code-layout code, .code-tiles code, .code-ends code {
  padding: .25em .36em; border: 1.5px solid var(--ink); border-radius: .18em .48em .26em .36em;
  background: var(--cyan); font-family: var(--mono); font-weight: 740; text-align: center;
}
.code-layout code { display: grid; align-content: center; min-height: 3.5rem; }
.code-layout code small { display: block; font-family: inherit; }
.code-layout .code-added, .code-extend mark, .code-axis mark { background: var(--yellow); color: inherit; }
.code-layout .code-unused { background: transparent; border-color: transparent; }
.code-extend, .code-axis, .code-byte-layout { max-width: 47rem; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .55rem 1.1rem; margin: 1rem auto; text-align: center; }
.code-extend > div, .code-tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: .32rem; }
.code-extend > code, .code-extend > div code { padding: .35em .55em; font-size: 1.25rem; }
.code-extend [data-diagram-arrow], .code-axis [data-diagram-arrow], .code-byte-layout [data-diagram-arrow] { width: 2.3rem; }
.code-extend mark, .code-axis mark { border-radius: .15em; padding: 0 .12em; }
.code-axis section, .code-byte { display: grid; justify-items: center; gap: .36rem; padding: .55rem; background: var(--paper); border: 1.5px solid var(--ink); border-radius: .18rem .58rem .24rem .45rem; }
.code-axis h4, .code-axis p, .code-byte p { margin: 0; }
.code-ends { display: grid; gap: .12rem; }
.code-ends div { display: grid; grid-template-columns: minmax(8.3em, 1fr) 3.7em; align-items: center; gap: .36rem; }
.count-pair { display: inline-flex; gap: .18rem; padding: .14rem; border: 2px solid var(--ink); border-radius: .22rem .5rem .25rem .2rem; background: var(--yellow); }
.count-pair .count-ticket { background: var(--paper); box-shadow: none; }
@media (max-width: 580px) {
  .code-layout > div { grid-template-columns: .8fr repeat(4, minmax(0, 1fr)); }
  .code-layout > div > span { grid-column: 1 / -1; }
}
.spread-dots { display: block; width: 100%; max-width: 53rem; height: auto; margin: 0 auto .8rem; }
.spread-dots text { font-size: 21px; font-weight: 690; text-anchor: middle; fill: #24231e; }
.spread-dots .spread-unit { font-size: 16px; }
.spread-dots .spread-anchor { fill: #005650; font-size: 20px; }
.spread-dots .spread-delta { font-size: 17px; }
.spread-dots path { fill: none; }
.spread-grid { stroke: #c1b49a; stroke-width: 1.5; }
.spread-mean { stroke: #005650; stroke-width: 3.5; stroke-dasharray: 7 5; }
.spread-base { stroke: #24231e; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spread-a, .spread-b, .score-mark { stroke: #24231e; stroke-width: 2; }
.spread-a { fill: #ffdf69; }
.spread-b { fill: #b9e7d1; }
.score-mark { fill: #fff8dd; stroke: #9b2d48; stroke-width: 4; }
.score-unit-a, .score-unit-b { stroke: #a26518; stroke-width: 4; }
.score-unit-b { stroke: #005650; }
.spread-work { max-width: 53rem; margin: 0 auto 1rem; overflow-x: auto; }
.spread-work table { width: 100%; border-collapse: collapse; text-align: center; }
.spread-work th, .spread-work td { padding: .38rem .55rem; border-block-end: 1px solid #b0a38b; }
.spread-work th { background: #fff0b3; }
.estimation-sampling {
  display: grid;
  grid-template-columns: 1fr minmax(5.6rem, 9rem) 1fr;
  align-items: center;
  max-width: 42rem;
  gap: .7rem;
  margin: .15rem auto .8rem;
  text-align: center;
}
.estimation-sampling > div { display: grid; justify-items: center; }
.estimation-sampling img { width: 5.7rem; height: auto; }
.estimation-sampling b { font-size: 1.12rem; }
.estimation-arrow { display: grid; justify-items: center; gap: .35rem; font-weight: 700; }
.estimation-arrow [data-diagram-arrow="right"]::before { width: 2.35rem; height: .95rem; background-color: #005650; }
.estimation-range {
  display: block;
  width: 100%;
  max-width: 52rem;
  margin: .45rem auto;
  background: #fffcf2;
  border: 1px solid #c8bda4;
  border-radius: .6rem;
}
.estimation-range text { fill: #24231e; font-size: 19px; }
.estimation-range .estimation-number { font-weight: 780; }
.estimation-grid { fill: none; stroke: #d6cbaf; stroke-width: 1.5; }
.estimation-axis, .estimation-center {
  fill: none; stroke: #24231e; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.estimation-center { stroke: #857354; stroke-dasharray: 3 5; }
.estimation-point { fill: #ffdf69; stroke: #24231e; stroke-width: 2.5; }
.estimation-band { fill: none; stroke: #005650; stroke-width: 4; stroke-linecap: round; }
.estimation-band.narrow { stroke: #8e3052; }
.estimation-width {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.7rem;
  margin: .75rem auto 0; font-variant-numeric: tabular-nums;
}
.estimation-width span { white-space: nowrap; }

.counting-waypoint { display: grid; grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr); align-items: center; gap: 1.8rem; max-width: 51rem; margin: .65rem auto 1rem; }
.counting-waypoint-grid { position: relative; }
.counting-waypoint-grid svg { display: block; width: 100%; height: auto; }
.counting-waypoint-grid span { position: absolute; font-size: .93rem; font-weight: 700; background: #fff9df; padding-inline: .24rem; }
.counting-waypoint-entry { left: 8%; bottom: 0; }
.counting-waypoint-stop { left: 50%; top: 49%; transform: translate(-50%, .6rem); }
.counting-waypoint-end { right: 3%; top: -.5rem; }
.counting-waypoint-order { display: grid; }
.counting-waypoint-order > div { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .35rem .6rem; padding: .5rem 0; }
.counting-waypoint-order > div + div { border-top: 1px solid var(--line, #a49d90); }
.counting-waypoint-order > div strong { border-radius: .25rem; background: #ffe46d; padding-inline: .4rem; }
.counting-lamp-chart { max-width: 51rem; margin: .65rem auto 1rem; padding: .8rem; }
.counting-lamp-chart > p { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem .8rem; margin: 0 0 .55rem; }
.counting-lamp-chart table { width: 100%; border-collapse: collapse; text-align: center; }
.counting-lamp-chart th, .counting-lamp-chart td { padding: .4rem .32rem; border-bottom: 1px solid var(--line, #a49d90); }
.counting-lamp-chart th:nth-child(2) { width: 58%; }
.counting-lamp-chart td span { display: inline-block; padding: .15rem .35rem; margin: .15rem; border: 1px solid currentColor; border-radius: .32rem; background: #fffbef; color: #005650; letter-spacing: .09em; }
.counting-lamp-chart .counting-lamp-kept { background: #c1edd3; }
@media (max-width: 38rem) {
  .counting-waypoint { grid-template-columns: 1fr; gap: .5rem; }
  .counting-waypoint-grid { width: min(100%, 15rem); margin-inline: auto; }
}
