/* Graphs share typography and driver identity; each measurement has its own geometry. */
article:has(.bench-rate, .bench-cost, .bench-lat, .bench-scale, .bench-matrix) {
  --bench-ink: #4841a6;
  --bench-peer: #596c7d;
  --bench-rule: var(--md-default-fg-color--lightest);
}
/* Align figures in charts and tables only: Inter's tabular forms also widen the hyphen,
   which would space out prose such as "single-read". */
article:has(.bench-rate, .bench-cost, .bench-lat, .bench-scale, .bench-matrix)
  :is(.bench-rate, .bench-cost, .bench-lat, .bench-scale, td) {
  font-variant-numeric: tabular-nums;
}
[data-md-color-scheme="slate"]
  article:has(.bench-rate, .bench-cost, .bench-lat, .bench-scale, .bench-matrix) {
  --bench-ink: #b2acff;
  --bench-peer: #b2c3cf;
}
.md-typeset :is(.bench-rate, .bench-cost, .bench-lat, .bench-scale) {
  display: block;
  width: 100%;
  margin: 1rem 0;
  padding: 0.8rem 0;
  border-block: 1px solid var(--bench-rule);
  text-align: start;
}
.md-typeset :is(.bench-rate, .bench-cost, .bench-lat, .bench-scale) figcaption {
  margin: 0 0 0.65rem;
  max-width: none;
  font-size: 0.83rem;
  font-style: normal;
  font-weight: 650;
  text-align: start;
}
.md-typeset .bench-rate ul {
  margin: 0;
  padding: 0;
}
.md-typeset .bench-rate li,
.bench-lat > div {
  display: grid;
  align-items: center;
  column-gap: 0.6rem;
  margin: 0;
  padding: 0.18rem 0;
  font-size: 0.8rem;
}
.md-typeset .bench-rate li {
  grid-template-columns: 3.55rem minmax(1rem, 1fr) 3.55rem;
}
.bench-rate b,
.bench-scale b,
.bench-lat b {
  font-weight: 500;
  text-align: end;
}
.bench-track i,
.bench-lat-track i {
  display: block;
  height: 0.52rem;
  background: var(--bench-peer);
}
.bench-rate li:first-child .bench-track i,
.bench-lat > div:nth-of-type(2) i {
  background: var(--bench-ink);
}
.bench-lat-track {
  display: flex;
  align-items: center;
  color: var(--bench-peer);
}
.bench-lat-track em {
  display: block;
  position: relative;
  border-top: 2px solid;
}
.bench-lat-track em::after {
  content: "";
  position: absolute;
  inset-inline-end: 0;
  top: -0.22rem;
  height: 0.35rem;
  border-right: 2px solid;
}
.bench-lat > div {
  grid-template-columns: 3.75rem 3.4rem minmax(1rem, 1fr) 2.25rem;
}
.bench-lat-head {
  font-weight: 600;
  white-space: nowrap;
}
.bench-lat-head span:not(:first-child) {
  text-align: end;
}
.bench-cost-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}
.bench-cost svg {
  display: block;
  width: 100%;
  max-width: 25rem;
  color: var(--md-default-fg-color);
}
.bench-cost svg text {
  fill: currentColor;
  font: 12px var(--md-text-font-family, sans-serif);
}
.bench-grid {
  fill: none;
  stroke: currentColor;
  opacity: 0.28;
  stroke-width: 1;
}
.bench-point {
  color: var(--bench-peer);
}
.bench-point.gres {
  color: var(--bench-ink);
}
.bench-point path {
  stroke: currentColor;
  stroke-width: 1.3;
  fill: none;
}
.bench-point circle {
  fill: currentColor;
}
.bench-cost .bench-point text {
  font-weight: 700;
}
.md-typeset .bench-cost table:not([class]) {
  border: 0;
  margin: 0;
  min-width: 0;
  display: table;
  width: 100%;
  font-size: 0.75rem;
}
.bench-cost-layout :is(.md-typeset__scrollwrap, .md-typeset__table) {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}
.md-typeset .bench-cost table:not([class]) :is(td, th) {
  padding: 0.4rem 0.25rem;
  min-width: 0;
  vertical-align: middle;
  text-align: end;
}
.md-typeset .bench-cost table:not([class]) th:first-child {
  text-align: start;
  white-space: nowrap;
}
.bench-scales {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: 0 1.2rem;
}
.bench-scale small {
  font-size: 0.75rem;
  font-weight: 400;
}
.md-typeset .bench-col-key {
  display: flex;
  gap: 0.85rem;
  font-size: 0.7rem;
  margin: 0 0 1.2rem;
}
.bench-col-key span::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-inline-end: 0.25rem;
  border: 1.5px solid var(--bench-peer);
  vertical-align: -0.05rem;
}
.bench-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  font-size: 0.75rem;
  text-align: center;
}
.bench-col-area {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 0.25rem;
  height: 6.4rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--bench-peer);
}
.bench-lane {
  display: block;
  position: relative;
  height: 100%;
  width: min(1.7rem, 37%);
}
.bench-col {
  position: absolute;
  inset: auto 6px 0 0;
  display: block;
  border: 1.5px solid var(--bench-peer);
  border-bottom: 0;
}
.bench-col.many {
  background: var(--bench-peer);
  border-color: var(--bench-peer);
}
.bench-col-key span + span::before {
  background: var(--bench-peer);
  border-color: var(--bench-peer);
}
.bench-lane i,
.bench-whisker {
  position: absolute;
  background: currentColor;
  color: var(--md-default-fg-color);
}
.bench-lane i {
  right: 0;
  width: 1px;
  min-height: 1px;
}
.bench-lane i::before,
.bench-lane i::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1px;
  left: -2px;
  background: currentColor;
}
.bench-lane i::before {
  top: 0;
}
.bench-lane i::after {
  bottom: 0;
}
.bench-track {
  position: relative;
  display: block;
  padding-bottom: 7px;
}
.bench-whisker {
  display: block;
  bottom: 2px;
  height: 1px;
}
.bench-whisker::after,
.bench-whisker::before {
  content: "";
  position: absolute;
  width: 1px;
  height: 5px;
  top: -2px;
  background: currentColor;
}
.bench-whisker::before {
  left: 0;
}
.bench-whisker::after {
  right: 0;
}
.bench-lane b {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 0.14rem;
  font-size: 0.68rem;
  white-space: nowrap;
}
.bench-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.bench-scale-head,
.bench-rate li > span:first-child,
.bench-lat > div > span:first-child {
  white-space: nowrap;
}
.md-typeset table.bench-matrix {
  display: table;
  width: 100%;
  border-collapse: collapse;
  margin: 0.9rem 0 1.35rem;
  border-block: 1px solid var(--bench-rule);
  font-size: 0.78rem;
  line-height: 1.35;
}
.md-typeset table.bench-matrix thead th {
  padding: 0.55rem 0.75rem;
  font-size: 0.69rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
  border-bottom: 1px solid var(--bench-rule);
  text-align: start;
  white-space: nowrap;
}
.md-typeset table.bench-matrix thead th:nth-child(2) {
  color: var(--bench-ink);
}
.md-typeset table.bench-matrix tbody tr {
  border-bottom: 1px solid var(--bench-rule);
}
.md-typeset table.bench-matrix tbody tr:last-child {
  border-bottom: 0;
}
.md-typeset table.bench-matrix tbody th,
.md-typeset table.bench-matrix tbody td {
  padding: 0.72rem 0.75rem;
  vertical-align: top;
  min-width: 0;
}
.md-typeset table.bench-matrix thead th:first-child,
.md-typeset table.bench-matrix tbody th {
  padding-inline-start: 0;
}
.md-typeset table.bench-matrix thead th:last-child,
.md-typeset table.bench-matrix tbody td:last-child {
  padding-inline-end: 0;
}
.md-typeset table.bench-matrix tbody th {
  width: 38%;
  font-weight: 400;
  text-align: start;
}
.md-typeset table.bench-matrix tbody td {
  width: 20.66%;
}
.bench-matrix-label {
  display: block;
  font-weight: 620;
  color: var(--md-default-fg-color);
}
.bench-matrix-detail {
  display: block;
  margin-top: 0.14rem;
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
}
.bench-matrix-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.bench-matrix-val {
  font-weight: 500;
  white-space: nowrap;
}
.bench-cell-gres .bench-matrix-val {
  font-weight: 700;
  color: var(--bench-ink);
}
.bench-badge {
  display: inline-block;
  margin-top: 0.38rem;
  padding: 0.08rem 0.44rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.bench-badge.faster {
  color: var(--bench-ink);
  background: color-mix(in srgb, var(--bench-ink) 12%, transparent);
}
.bench-badge.mixed,
.bench-badge.neutral {
  color: var(--md-default-fg-color--light);
  background: color-mix(in srgb, var(--md-default-fg-color) 8%, transparent);
}
.bench-badge.slower {
  color: #b45309;
  background: color-mix(in srgb, #b45309 12%, transparent);
}
[data-md-color-scheme="slate"] .bench-badge.slower {
  color: #fbbf24;
  background: color-mix(in srgb, #fbbf24 14%, transparent);
}
.bench-matrix-track {
  display: block;
  width: 100%;
  height: 0.34rem;
  margin-top: 0.38rem;
  border-radius: 2px;
  background: color-mix(in srgb, var(--md-default-fg-color) 8%, transparent);
  overflow: hidden;
}
.bench-matrix-track i {
  display: block;
  height: 100%;
  border-radius: 2px;
}
.bench-matrix-track i.gres {
  background: var(--bench-ink);
}
.bench-matrix-track i.peer {
  background: var(--bench-peer);
  opacity: 0.72;
}
@media (max-width: 42em) {
  .bench-cost-layout {
    grid-template-columns: 1fr;
  }
  .bench-cost-layout svg {
    margin: auto;
  }
  .md-typeset table.bench-matrix,
  .md-typeset table.bench-matrix tbody {
    display: block;
    width: 100%;
  }
  .md-typeset table.bench-matrix thead {
    display: none;
  }
  .md-typeset table.bench-matrix tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.38rem;
    padding: 0.7rem 0;
  }
  .md-typeset table.bench-matrix tbody th {
    width: auto;
    padding: 0 0 0.15rem;
  }
  .md-typeset table.bench-matrix tbody td {
    display: grid;
    grid-template-columns: 4.2rem minmax(0, 1fr) 4.4rem;
    align-items: center;
    column-gap: 0.55rem;
    width: auto;
    padding: 0;
  }
  .md-typeset table.bench-matrix tbody td::before {
    display: block;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--md-default-fg-color);
  }
  .md-typeset table.bench-matrix tbody td:nth-of-type(1)::before {
    content: "Gres";
    color: var(--bench-ink);
    font-weight: 700;
  }
  .md-typeset table.bench-matrix tbody td:nth-of-type(2)::before {
    content: "asyncpg";
  }
  .md-typeset table.bench-matrix tbody td:nth-of-type(3)::before {
    content: "Psycopg";
  }
  .md-typeset table.bench-matrix tbody td .bench-matrix-track {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }
  .md-typeset table.bench-matrix tbody td .bench-matrix-head {
    grid-column: 3;
    grid-row: 1;
    justify-content: flex-end;
  }
  .md-typeset table.bench-matrix tbody td .bench-badge {
    grid-column: 2 / -1;
    grid-row: 2;
    justify-self: start;
    margin: 0.22rem 0 0.12rem;
  }
}
@media (forced-colors: active) {
  :is(.bench-whisker, .bench-lane i),
  :is(.bench-whisker, .bench-lane i)::before,
  :is(.bench-whisker, .bench-lane i)::after {
    background: CanvasText;
    forced-color-adjust: none;
  }
  .bench-track i,
  .bench-lat-track i {
    border-top: 0.35rem solid CanvasText;
  }
  .bench-matrix-track i {
    background: CanvasText;
    opacity: 1;
    forced-color-adjust: none;
  }
  .bench-point {
    color: CanvasText;
  }
  .bench-col.many {
    background: CanvasText;
    forced-color-adjust: none;
  }
}
