html:has(main.performance) {
  scrollbar-gutter: stable;
}

.performance {
  margin-top: 1.5rem;
}

.performance [hidden] {
  display: none;
}

.performance-scenarios,
.performance-toolbar,
.performance-views,
.performance-release {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.performance-scenarios {
  gap: 0 1.25rem;
  border-bottom: 1px solid var(--border);
}

.performance-scenarios a,
.performance-views a {
  text-decoration: none;
}

.performance-scenarios a {
  margin-bottom: -1px;
  padding: 0.55rem 0.125rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
}

.performance-scenarios a[aria-current] {
  border-bottom-color: var(--link);
  color: var(--link);
  font-weight: 600;
}

.performance-scenarios a:hover,
.performance-views a:hover {
  text-decoration: underline;
}

.performance-context {
  margin: 0.55rem 0 1.25rem;
  color: var(--muted);
}

.performance-toolbar {
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.performance-views a,
.performance-release select {
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input-bg);
  color: var(--fg);
}

.performance-views a:first-child {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.performance-views a:last-child {
  margin-inline-start: -1px;
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.performance-views a[aria-current] {
  background: var(--btn-active-bg);
  font-weight: 600;
}

.performance-release {
  gap: 0.45rem 0.65rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.performance-release select {
  max-width: 100%;
  font: inherit;
}

.performance-results {
  min-width: 0;
  padding: clamp(0.85rem, 3vw, 1.25rem);
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
}

.performance-results h2 {
  margin: 0;
}

.performance-results h2,
.performance-chart figcaption {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: normal;
}

.performance-results p {
  margin: 0.55rem 0 0;
}

#benchmark-status {
  color: var(--muted);
}

#benchmark-status:empty {
  margin: 0;
}

.performance-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.performance-run-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
}

.performance-results .performance-measured {
  margin: 0;
  color: var(--muted);
}

.performance-table-wrap {
  margin-top: 0.75rem;
  overflow-x: auto;
}

.performance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.performance-table caption {
  padding-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: start;
}

.performance-table th,
.performance-table td {
  padding: 0.55rem 0.5rem;
  border-top: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

.performance-results .performance-table thead th {
  font-weight: 600;
}

.performance-table th[scope="row"] {
  font-weight: 400;
}

.performance-load-matrix td,
.performance-load-matrix thead th[scope="col"]:not(:first-child),
.performance-quorum-matrix thead tr + tr th {
  text-align: end;
}

.performance-load-matrix td,
.performance-load-matrix tbody th,
.performance-history-matrix td {
  white-space: nowrap;
}

.performance-quorum-matrix th[scope="colgroup"] {
  text-align: center;
}

.performance-quorum-matrix th[scope="colgroup"] + th[scope="colgroup"],
.performance-quorum-matrix thead tr + tr th:nth-child(2n + 3),
.performance-quorum-matrix tbody td:nth-child(2n + 4) {
  border-inline-start: 1px solid var(--border);
}

.performance-results .performance-quorum-matrix thead tr + tr th {
  padding-top: 0;
  border-top: 0;
  color: var(--muted);
  font-size: 0.875em;
  font-weight: 400;
}

.performance-history-matrix td,
.performance-history-matrix thead th:not(:first-child) {
  text-align: end;
}

.performance-load-unit,
.performance-system-version,
.performance-history-date {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.performance-load-unit,
.performance-system-version,
.performance-history-date {
  display: block;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .performance-load-matrix .performance-table,
  .performance-history-matrix .performance-table {
    font-size: 0.8125rem;
  }

  .performance-load-matrix th,
  .performance-load-matrix td,
  .performance-history-matrix th,
  .performance-history-matrix td {
    padding-inline: 0.3rem;
  }

  .performance-load-unit,
  .performance-system-version,
  .performance-history-date {
    font-size: 0.75rem;
  }
}

@media (max-width: 350px) {
  .performance-load-matrix .performance-table {
    font-size: 0.75rem;
  }

  .performance-load-matrix th,
  .performance-load-matrix td {
    padding-inline: 0.2rem;
  }

  .performance-load-unit,
  .performance-system-version {
    font-size: 0.6875rem;
  }
}

.performance-table tr > :first-child {
  padding-inline-start: 0;
}

.performance-table tr > :last-child {
  padding-inline-end: 0;
}

.performance-series-heading {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

.performance-series-heading:first-child {
  margin-top: 0.4rem;
}

.performance-series-heading + .performance-table-wrap {
  margin-top: 0.55rem;
}

.performance-chart {
  min-width: 0;
  margin: 0;
}

.performance-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.25rem;
}

@media (max-width: 720px) {
  .performance-chart + .performance-chart {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
  }
}

.performance-chart figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.8rem;
  margin-bottom: 0.35rem;
}

.performance-chart-scale {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
}

.performance-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.performance-chart svg line {
  stroke: var(--border);
}

.performance-chart svg text {
  fill: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.performance-chart polyline {
  fill: none;
  stroke: var(--series-color);
  stroke-width: 3.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--series-dash, none);
}

.performance-chart-point {
  fill: var(--series-color);
  stroke: var(--input-bg);
  stroke-width: 1.5;
}

.performance-chart-connector {
  fill: none;
  stroke: var(--series-color);
  stroke-width: 1.5;
}

.performance-chart svg .performance-chart-label {
  fill: var(--series-color);
  font-size: 14px;
  font-weight: 700;
}

.performance-line-0 { --series-color: light-dark(#005bb5, #79baff); }
.performance-line-1 { --series-color: light-dark(#8c3b00, #ffb365); --series-dash: 10 6; }
.performance-line-2 { --series-color: light-dark(#006b3f, #54dfa3); --series-dash: 2 6; }
.performance-line-3 { --series-color: light-dark(#a30f43, #ff88aa); --series-dash: 13 5 2 5; }

.performance-methodology {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.performance-methodology h2 {
  margin: 0;
}

.performance-methodology p {
  margin: 0.45rem 0 0;
  max-width: 68ch;
  color: var(--muted);
}

.performance-run-details {
  margin-top: 0.9rem;
}

.performance-run-details h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.performance-run-details ul {
  margin: 0 0 0.85rem;
  padding-inline-start: 1.15rem;
}

@media (pointer: coarse) {
  .performance-scenarios a,
  .performance-views a,
  .performance-release select {
    min-height: 44px;
  }
}
