@property --retention-span {
  syntax: "<number>";
  inherits: false;
  initial-value: 1;
}
@property --retention-charge {
  syntax: "<number>";
  inherits: false;
  initial-value: 1;
}

/* Shared rows align the rates, drawings and examples without fixed copy heights. */
.rates {
  row-gap: 24px;
}
.rate {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
}
/* Rates sit in pairs; separate the second pair from the first one's examples. */
@media (min-width: 1001px) {
  .rate:nth-child(n + 3) {
    margin-top: 28px;
  }
}
.rate-copy > p:not(.price, .price-unit) {
  margin: 0;
  text-wrap: pretty;
}
.rate-copy sup {
  line-height: 0;
}
.rate-figure {
  margin: 0;
  min-width: 0;
  max-width: 400px;
}
.rate-diagram {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.rate-diagram text {
  fill: rgb(var(--mh-eraser));
  font: 14px var(--mh-font-ui);
}
.rate-diagram rect,
.rate-diagram path {
  fill: none;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.rate-diagram .diagram-ghost {
  stroke: rgb(var(--mh-graphite) / 0.6);
  stroke-dasharray: 3 5;
}
.rate-diagram .diagram-rule {
  stroke: rgb(var(--mh-eraser));
}
.rate-diagram .diagram-accent {
  stroke: rgb(var(--mh-blueprint));
}
.rate-diagram .diagram-wash {
  fill: rgb(var(--mh-blueprint) / 0.14);
}
.read-first-fill,
.read-second-fill,
.read-second-unit,
.model-base,
.model-addon,
.model-extra,
.model-extra-label,
.transfer-sent {
  transition:
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 250ms ease-out;
}
.read-first-fill {
  stroke: rgb(var(--mh-blueprint));
  transform-origin: 20px 44px;
  /* 400 copies × 1,276,315 plain-text bytes / 512 MiB. */
  transform: scaleX(0.950929);
}
.read-second-fill {
  stroke: rgb(var(--mh-blueprint));
  transform-origin: 176px 44px;
  transform: scaleX(0);
}
.read-second-unit {
  opacity: 0;
}
.read-large-label {
  display: none;
}
.rate:has(#read-large:checked) .read-first-fill,
.rate:has(#read-large:checked) .read-second-fill {
  transform: scaleX(1);
}
.rate:has(#read-large:checked) .read-second-unit {
  opacity: 1;
}
.rate:has(#read-large:checked) .read-small-label {
  display: none;
}
.rate:has(#read-large:checked) .read-large-label {
  display: block;
}
.retention-area {
  transform-origin: 60px 112px;
  /* Derive height from area / width, keeping equal-price morphs equal-area. */
  transform: scale(
    var(--retention-span),
    calc(var(--retention-charge) / var(--retention-span))
  );
  transition:
    --retention-span 600ms cubic-bezier(0.16, 1, 0.3, 1),
    --retention-charge 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.rate:has(#keep-shorter:checked) .retention-area {
  --retention-span: 0.5;
  --retention-charge: 0.5;
}
.rate:has(#keep-less:checked) .retention-area {
  --retention-charge: 0.5;
}
.retention-wikipedia-scale,
#wikipedia-retention-note {
  display: none;
}
.rate:has(#keep-wikipedia:checked) .retention-standard-scale {
  display: none;
}
.rate:has(#keep-wikipedia:checked) .retention-wikipedia-scale,
.rate:has(#keep-wikipedia:checked) #wikipedia-retention-note {
  display: block;
}
.model-base,
.model-extra {
  transform-origin: 20px 44px;
  transform: scaleX(0.25);
}
.model-addon {
  transform: translateX(60px);
}
.model-extra-label {
  transform: translateX(15px);
}
.rate-diagram .model-extra-label {
  fill: rgb(var(--mh-blueprint));
}
.transfer-sent {
  transform-origin: 20px 112px;
  /* 1,000 result bytes / 2^30. */
  transform: scaleX(0.00000093);
}
.rate:has(#transfer-chart:checked) .transfer-sent {
  /* 10,000 views × 50,000 bytes / 2^30. */
  transform: scaleX(0.465661);
}
.rate:has(#transfer-export:checked) .transfer-sent {
  transform: scaleX(1);
}
.transfer-export-read,
.transfer-chart-sent,
.transfer-export-sent {
  display: none;
}
.rate:has(#transfer-chart:checked) .transfer-query-sent,
.rate:has(#transfer-export:checked) .transfer-small-read,
.rate:has(#transfer-export:checked) .transfer-query-sent {
  display: none;
}
.rate:has(#transfer-chart:checked) .transfer-chart-sent,
.rate:has(#transfer-export:checked) .transfer-export-read,
.rate:has(#transfer-export:checked) .transfer-export-sent {
  display: block;
}
.rate-diagram .model-base,
.rate-diagram .transfer-read {
  stroke: rgb(var(--mh-vellum));
  fill: rgb(var(--mh-vellum) / 0.08);
}
.rate:has(#model-large:checked) .model-base,
.rate:has(#model-large:checked) .model-extra {
  transform: scaleX(1);
}
.rate:has(#model-large:checked) .model-addon {
  transform: translateX(240px);
}
.rate:has(#model-large:checked) .model-extra-label {
  transform: translateX(60px);
}
.rate-example {
  min-width: 0;
  margin: 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid rgb(var(--mh-graphite) / 0.35);
}
.rate-example legend {
  padding: 0 12px 0 0;
  color: rgb(var(--mh-eraser));
  font-size: 13px;
}
.rate-example label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  color: rgb(var(--mh-vellum));
}
.rate-example label:has(:checked) {
  color: rgb(var(--mh-moon));
}
.rate-example label > span {
  display: flex;
  flex-wrap: wrap;
  flex: 1;
  justify-content: space-between;
  column-gap: 10px;
  padding-block: 10px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.rate-example label:hover > span {
  text-decoration: underline;
  text-decoration-color: rgb(var(--mh-blueprint));
  text-underline-offset: 4px;
}
.rate-example label:has(:focus-visible) {
  outline: 2px solid rgb(var(--mh-blueprint));
  outline-offset: 3px;
}
.rate-example input {
  margin: 0;
  width: 14px;
  height: 14px;
  flex: none;
  accent-color: rgb(var(--mh-blueprint));
}
.rate-example input:focus-visible {
  outline: none;
}
.rate-example strong {
  font-weight: 500;
}
.example-copy small {
  display: block;
  margin-top: 2px;
  color: rgb(var(--mh-eraser));
  font-size: 13px;
  line-height: 1.5;
}
.example-note {
  margin: 12px 0 0;
  color: rgb(var(--mh-eraser));
  font-size: 13px;
  line-height: 1.6;
  text-wrap: pretty;
}
@media (min-width: 701px) and (max-width: 1000px) {
  .rates {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .rate {
    grid-row: auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 40px;
    row-gap: 20px;
  }
  .rate-copy {
    grid-row: span 2;
  }
  .rate-figure,
  .rate-example {
    grid-column: 2;
  }
}
@media (max-width: 700px) {
  .rate {
    grid-row: auto;
    grid-template-rows: auto auto auto;
    gap: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rate-diagram * {
    transition: none;
  }
}
