.coin-dataset {
  margin-bottom: 2.75rem;
  margin-top: 1.75rem;
}

.coin-dataset,
.coin-dataset * {
  box-sizing: border-box;
}

.coin-dataset__interactive {
  display: grid;
  gap: 0.7rem;
}

.coin-dataset__rail {
  background: #f5f8f7;
  border: 1px solid #dce5e1;
  display: grid;
  gap: clamp(0.35rem, 0.75vw, 0.7rem);
  grid-template-columns: repeat(7, minmax(88px, 1fr)) 2rem repeat(3, minmax(88px, 1fr));
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0.45rem;
  scroll-snap-type: inline mandatory;
  scrollbar-color: #aab8b2 transparent;
  scrollbar-width: thin;
}

.coin-dataset__ellipsis {
  align-items: center;
  align-self: stretch;
  color: #76827d;
  display: flex;
  font-size: 1.1rem;
  font-weight: 600;
  justify-content: center;
  letter-spacing: 0.08em;
  padding-bottom: 1.15rem;
  user-select: none;
}

.coin-position-button {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  margin: 0;
  min-width: 0;
  padding: 0 0 0.45rem;
  position: relative;
  scroll-snap-align: start;
  transition: opacity 120ms ease;
}

.coin-position-button:hover {
  opacity: 0.82;
}

.coin-position-button[aria-selected="true"] {
  background: transparent;
  box-shadow: none;
  opacity: 1;
}

.coin-position-button[aria-selected="true"]::after {
  background: #648fff;
  bottom: 0;
  content: "";
  height: 2px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 2rem;
}

.coin-position-button:focus-visible {
  outline: 2px solid #648fff;
  outline-offset: 2px;
}

.coin-position-button__label {
  color: #65736e;
  display: block;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 0.4rem 0 0;
  text-align: center;
  white-space: nowrap;
}

.coin-position-button[aria-selected="true"] .coin-position-button__label {
  color: #648fff;
}

.coin-detail {
  background: #fff;
  border: 1px solid #dce3e0;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(28, 46, 39, 0.05);
  min-width: 0;
  padding: 1rem 1.25rem 1.4rem;
}

.coin-detail__header {
  margin-bottom: 0.45rem;
}

.coin-sample__number,
.coin-sample__eyebrow {
  color: #71807b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coin-detail__body {
  align-items: center;
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
  grid-template-columns: minmax(240px, 0.75fr) minmax(420px, 1.25fr);
  padding: 0.2rem clamp(0rem, 2vw, 2rem) 0.35rem;
}

.coin-detail__board {
  justify-self: center;
  max-width: 300px;
  width: 100%;
}

.coin-detail__board,
.coin-sample__estimate {
  min-width: 0;
}

.coin-sample__estimate {
  justify-self: center;
  max-width: 720px;
  width: 100%;
}

.chess-board {
  background: #f1eadc;
  border: 1px solid #51665c;
  border-radius: 3px;
  display: block;
  height: auto;
  width: 100%;
}

.coin-position-button .chess-board {
  border-color: #809188;
  border-radius: 2px;
}

.chess-square--light { fill: #f1eadc; }
.chess-square--dark { fill: #769382; }

.chess-piece {
  dominant-baseline: middle;
  font-family: "Apple Symbols", "Noto Sans Symbols 2", "DejaVu Sans", serif;
  font-size: 8.4px;
  paint-order: stroke fill;
  pointer-events: none;
  stroke-linejoin: round;
  text-anchor: middle;
}

.chess-piece--white {
  fill: #fffdf4;
  stroke: #17221e;
  stroke-width: 0.48px;
}

.chess-piece--black {
  fill: #17221e;
  stroke: #f7f2e8;
  stroke-width: 0.12px;
}

.coin-sample__odds {
  color: #33423d;
  display: flex;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.coin-sample__odds span:first-child { color: #fe6100; }
.coin-sample__odds span:last-child { color: #fe6100; }

.coin-sample__odds-bar {
  background: rgba(254, 97, 0, 0.38);
  border-radius: 999px;
  display: flex;
  height: 7px;
  margin: 0.25rem 0 0.6rem;
  overflow: hidden;
}

.coin-sample__odds-bar span {
  background: #fe6100;
  display: block;
  height: 100%;
}

.coin-sample__model {
  color: #53615c;
  font-size: 0.72rem;
  line-height: 1.45;
  margin: 0;
}

.coin-sample__model strong { color: #648fff; }

.coin-detail .coin-sample__odds {
  font-size: 0.9rem;
}

.coin-detail .coin-sample__model {
  font-size: 0.78rem;
}

.coin-detail .beta-plot {
  margin: 0.1rem auto 0;
  max-width: 430px;
}

/* Float-based side figures, compatible with Distill's v1 layout names. */
d-article figure.side {
  box-sizing: border-box;
  margin: 0 0 1em;
  padding: 0;
  width: 100%;
}

@media (min-width: 768px) {
  d-article figure.side {
    float: right;
    margin-left: 1.5em;
    position: relative;
  }

  d-article figure.l-body.side {
    width: 50%;
  }

  /* Direct article children stay in Distill's grid. */
  d-article > figure.l-body.side {
    grid-column: text;
    justify-self: end;
    margin-right: 0;
    width: 50%;
  }
}

.beta-plot {
  display: block;
  height: auto;
  margin-top: 0.25rem;
  overflow: visible;
  width: 100%;
}

.beta-axis {
  stroke: #aeb9b5;
  stroke-width: 1;
}

.beta-area { fill: rgba(100, 143, 255, 0.14); }

.beta-curve {
  fill: none;
  stroke: #648fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.beta-marker { stroke-width: 1.4; }

.beta-marker--target {
  stroke: #fe6100;
}

.beta-marker--mean { stroke: #648fff; }

.beta-tick,
.beta-axis-label {
  fill: #75817d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9px;
  text-anchor: middle;
}

.beta-axis-label {
  font-size: 9.5px;
  font-weight: 600;
}

.coin-sample__key {
  align-items: center;
  color: #707d78;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.84rem;
  gap: 0.8rem 1.5rem;
  justify-content: center;
  margin-top: 0.35rem;
}

.coin-sample__key > span {
  align-items: center;
  display: inline-flex;
}

.coin-sample__key-swatch {
  flex: 0 0 auto;
  height: 30px;
  margin-right: 0.45rem;
  overflow: visible;
  width: 44px;
}

.coin-sample__key-density-area {
  fill: rgba(100, 143, 255, 0.14);
}

.coin-sample__key-density-curve {
  fill: none;
  stroke: #648fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.coin-sample__key-marker {
  stroke-width: 3;
}

.coin-sample__key-marker--target { stroke: #fe6100; }
.coin-sample__key-marker--mean { stroke: #648fff; }

.coin-formula {
  letter-spacing: normal;
  text-transform: none;
}

.coin-dataset figcaption {
  margin-top: 0.8rem;
}

.outcome-distribution-comparison {
  margin-bottom: 2.5rem;
  margin-top: 1.75rem;
}

.outcome-distribution-comparison,
.outcome-distribution-comparison * {
  box-sizing: border-box;
}

.outcome-distribution-comparison__plots {
  display: grid;
  gap: clamp(1.25rem, 4vw, 3rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.outcome-distribution-panel {
  min-width: 0;
}

.outcome-distribution-panel svg {
  display: block;
  height: auto;
  overflow: visible;
  width: 100%;
}

.outcome-plot__title,
.outcome-plot__tick,
.outcome-plot__axis-label,
.outcome-plot__vertex-label,
.outcome-plot__annotation {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-anchor: middle;
}

.outcome-plot__title {
  fill: #33423d;
  font-size: 21px;
  font-weight: 650;
}

.outcome-plot__axis {
  stroke: #aeb9b5;
  stroke-width: 1.25;
}

.outcome-plot__area {
  fill: url("#outcome-beta-gradient");
  fill-opacity: 0.55;
}

.outcome-plot__curve {
  fill: none;
  stroke: url("#outcome-beta-gradient");
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.outcome-plot__contour {
  fill: none;
  stroke: #785ef0;
  stroke-opacity: 0.45;
  stroke-width: 0.8;
}

.outcome-plot__simplex {
  fill: none;
  stroke: #7e9189;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.outcome-plot__mean-line {
  stroke: #dc267f;
  stroke-width: 1.8;
}

.outcome-plot__mean-dot {
  fill: #ffffff;
  stroke: #dc267f;
  stroke-width: 2.5;
}

.outcome-plot__tick,
.outcome-plot__ternary-tick,
.outcome-plot__axis-label,
.outcome-plot__vertex-label,
.outcome-plot__annotation {
  fill: #75817d;
}

.outcome-plot__tick {
  font-size: 13px;
}

.outcome-plot__ternary-tick {
  font-size: 11px;
}

.outcome-plot__axis-label,
.outcome-plot__vertex-label {
  font-size: 14px;
  font-weight: 600;
}

.outcome-plot__annotation {
  font-size: 13px;
}

.outcome-plot__mean-label {
  fill: #33423d;
  font-weight: 650;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-linejoin: round;
  stroke-width: 3px;
}

.outcome-distribution-comparison figcaption {
  margin-top: 0.85rem;
}

@media (max-width: 860px) {
  .coin-detail__body {
    grid-template-columns: 1fr;
    padding-inline: 0;
  }

  .coin-detail__board {
    max-width: 250px;
  }
}

@media (max-width: 460px) {
  .coin-dataset__rail {
    grid-template-columns: repeat(7, 78px) 1.5rem repeat(3, 78px);
  }

}

@media (max-width: 620px) {
  .outcome-distribution-comparison__plots {
    gap: 1.75rem;
    grid-template-columns: 1fr;
  }

  .outcome-distribution-panel {
    margin-inline: auto;
    max-width: 440px;
    width: 100%;
  }
}
