.population-stage {
  height: 470px;
  position: relative;
  background: radial-gradient(circle at 50% 45%, rgba(43, 100, 110, .28), transparent 60%), #091e27;
  border: 1px solid #294852;
  border-radius: 16px;
  overflow: hidden
}

.population-canvas {
  position: absolute;
  inset: 0
}

.population-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none
}

.stage-overlay {
  position: absolute;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none
}

.stage-overlay.top {
  top: 17px;
  /* Clear of the orientation gizmo (left) and the camera toolbar (right). */
  left: 122px;
  right: 76px
}

@media (max-width: 760px) {
  .stage-overlay.top { top: 58px; left: 90px; right: 12px; justify-content: flex-end }
  .stage-overlay.top .stage-tag:first-child { display: none }
}

.stage-overlay.bottom {
  bottom: 15px
}

.stage-tag {
  border: 1px solid #35535e;
  background: rgba(9, 28, 36, .82);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em
}

.stage-tag.light {
  color: var(--text);
  letter-spacing: 0;
  font-size: 11px
}

.stage-tip {
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap
}

.legend .ring {
  border: 2px solid white;
  background: transparent
}

.map-caption {
  margin: 12px 2px 0
}

.estimate-layout {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 19px
}

.estimate-chart {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0a2029
}

.estimate-row+.estimate-row {
  margin-top: 16px
}

.estimate-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px
}

.estimate-label strong {
  color: var(--text);
  font: 700 16px 'Space Grotesk', sans-serif
}

.estimate-track {
  height: 17px;
  background: repeating-linear-gradient(90deg, #1a3944 0, #1a3944 calc(25% - 1px), #42616b calc(25% - 1px), #42616b 25%);
  border-radius: 5px;
  overflow: hidden
}

.estimate-fill {
  height: 100%;
  border-radius: 5px;
  transition: width .35s
}

.estimate-fill.pop {
  background: #426e78
}

.estimate-fill.sample {
  background: linear-gradient(90deg, #38bfa3, #84eed0)
}

.estimate-scale {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-size: 9px;
  margin-top: 8px
}

.error-card {
  border: 1px solid rgba(255, 210, 126, .3);
  border-radius: 14px;
  background: radial-gradient(circle at 60% 0, rgba(255, 210, 126, .13), transparent 70%), #162b32;
  padding: 17px;
  display: flex;
  flex-direction: column;
  justify-content: center
}

.error-card span {
  color: var(--amber);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase
}

.error-card strong {
  font: 700 37px 'Space Grotesk', sans-serif;
  letter-spacing: -.06em;
  margin: 5px 0;
  color: var(--text)
}

.error-card small {
  color: var(--muted);
  font-size: 10px
}

.method-list {
  display: grid;
  gap: 8px
}

.method {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px;
  width: 100%;
  border: 1px solid var(--line);
  background: #0d242d;
  border-radius: 12px;
  color: var(--text)
}

.method:hover,
.method.active {
  border-color: rgba(115, 230, 192, .62);
  background: rgba(115, 230, 192, .09)
}

.method-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #1b3a43;
  color: var(--accent);
  font-size: 22px;
  flex: none
}

.method strong {
  display: block;
  font-size: 12px
}

.method small {
  display: block;
  color: var(--faint);
  font-size: 10px;
  margin-top: 3px
}

.draw-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 21px 0 10px
}

.aside-copy {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65
}

.distribution-mini {
  display: flex;
  gap: 7px;
  margin-top: 16px
}

.distribution-mini span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent)
}

.distribution-mini span.other {
  background: var(--pink)
}

@media(max-width:700px) {
  .population-stage {
    height: 360px
  }

  .stage-tip {
    display: none
  }

  .estimate-layout {
    grid-template-columns: 1fr
  }

  .error-card {
    min-height: 110px
  }
}
