/* Anvil Serving documentation theme.
   One set of tokens drives every surface: page chrome, prose, tables, code,
   and the generated components (journey steps, benchmark records, recipe
   cards). Components are prefixed `av-`; the older `bench-` classes used by
   hand-written benchmark pages share the same tokens. */

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --av-radius: 10px;
  --av-radius-sm: 6px;
  --av-content-width: 78rem;
  --av-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-md-color-scheme="slate"] {
  --av-bg: #0a0e13;
  --av-surface: #10161d;
  --av-raised: #161e27;
  --av-border: rgba(148, 163, 184, 0.17);
  --av-border-strong: rgba(148, 163, 184, 0.34);
  --av-text: #e9eef3;
  --av-muted: #9dacb9;
  --av-link: #62cfdd;
  --av-brand: #ffb454;
  --av-brand-ink: #1b1204;
  --av-good: #4fd1a1;
  --av-warn: #f5b759;
  --av-bad: #ff8593;
  --av-info: #86b9ff;
  --av-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

  --md-default-bg-color: var(--av-bg);
  --md-default-fg-color: var(--av-text);
  --md-default-fg-color--light: #c3ced8;
  --md-default-fg-color--lighter: rgba(195, 206, 216, 0.42);
  --md-default-fg-color--lightest: rgba(195, 206, 216, 0.12);
  --md-primary-fg-color: var(--av-bg);
  --md-primary-bg-color: var(--av-text);
  --md-primary-bg-color--light: var(--av-muted);
  --md-accent-fg-color: var(--av-brand);
  --md-typeset-a-color: var(--av-link);
  --md-code-bg-color: #0f151c;
  --md-code-fg-color: #dbe4ec;
  --md-footer-bg-color: #070a0e;
  --md-footer-bg-color--dark: #070a0e;
}

[data-md-color-scheme="default"] {
  --av-bg: #ffffff;
  --av-surface: #f6f8fa;
  --av-raised: #eef2f5;
  --av-border: rgba(15, 23, 32, 0.13);
  --av-border-strong: rgba(15, 23, 32, 0.3);
  --av-text: #0f1720;
  --av-muted: #55636f;
  --av-link: #0a6f80;
  --av-brand: #b65a00;
  --av-brand-ink: #ffffff;
  --av-good: #0b7a55;
  --av-warn: #8a5300;
  --av-bad: #b3243a;
  --av-info: #1d5fb8;
  --av-shadow: 0 10px 30px rgba(15, 23, 32, 0.1);

  --md-default-bg-color: var(--av-bg);
  --md-default-fg-color: var(--av-text);
  --md-default-fg-color--light: #3a4752;
  --md-primary-fg-color: #ffffff;
  --md-primary-bg-color: var(--av-text);
  --md-primary-bg-color--light: var(--av-muted);
  --md-accent-fg-color: var(--av-brand);
  --md-typeset-a-color: var(--av-link);
  --md-code-bg-color: #f4f6f8;
  --md-code-fg-color: #1c2630;
  --md-footer-bg-color: #0f1720;
  --md-footer-bg-color--dark: #0a1017;
}

/* ── Page chrome ────────────────────────────────────────────────────── */
.md-header {
  background: color-mix(in srgb, var(--av-bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--av-border);
  box-shadow: none;
  color: var(--av-text);
}

.md-header--shadow {
  box-shadow: none;
}

.md-header__title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.md-header__button.md-logo :is(img, svg) {
  color: var(--av-brand);
  fill: currentColor;
}

.md-tabs {
  background: var(--av-bg);
  border-bottom: 1px solid var(--av-border);
  color: var(--av-text);
}

.md-tabs__link {
  margin-top: 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px solid transparent;
  color: var(--av-muted);
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 1;
}

.md-tabs__item {
  height: auto;
}

.md-tabs__link:is(:hover, :focus) {
  color: var(--av-text);
}

.md-tabs__item--active .md-tabs__link {
  border-bottom-color: var(--av-brand);
  color: var(--av-text);
}

.md-search__form {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-sm);
  background: var(--av-surface);
}

.md-search__form:hover {
  background: var(--av-raised);
}

.md-search__input,
.md-search__input::placeholder {
  color: var(--av-muted);
}

.md-search__icon {
  color: var(--av-muted);
}

.md-nav {
  font-size: 0.7rem;
}

.md-nav__title {
  color: var(--av-text);
}

.md-nav__link {
  border-radius: var(--av-radius-sm);
  overflow-wrap: anywhere;
}

.md-nav__link:is(:hover, :focus) {
  color: var(--av-text);
}

.md-nav__item .md-nav__link--active,
.md-nav__link--active {
  color: var(--av-link);
  font-weight: 650;
}

.md-nav__item--section > .md-nav__link {
  color: var(--av-muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.md-path {
  font-size: 0.66rem;
}

.md-footer {
  border-top: 1px solid var(--av-border);
}

.md-typeset :target {
  scroll-margin-top: 5.5rem;
}

:is(.md-typeset a, .md-button, .md-nav__link, .md-search__input, .av-card, summary):focus-visible {
  outline: 2px solid var(--av-brand);
  outline-offset: 2px;
}

/* ── Prose ──────────────────────────────────────────────────────────── */
.md-grid {
  max-width: var(--av-content-width);
}

.md-typeset {
  font-size: 0.78rem;
  line-height: 1.68;
  overflow-wrap: break-word;
}

.md-typeset h1 {
  margin-bottom: 0.9rem;
  color: var(--av-text);
  font-size: 2rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.md-typeset h2 {
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--av-border);
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.md-typeset h1 + h2,
.md-typeset h2:first-child {
  border-top: 0;
  padding-top: 0;
}

.md-typeset h3 {
  margin-top: 1.8rem;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.md-typeset h4 {
  color: var(--av-muted);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.md-typeset a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--av-link) 38%, transparent);
  text-underline-offset: 0.18em;
}

.md-typeset a:hover {
  color: var(--av-link);
  text-decoration-color: currentColor;
}

.md-typeset :is(.headerlink, .md-button, .av-card, .md-content__button) {
  text-decoration: none;
}

.md-typeset > ol,
.md-typeset > ul {
  margin-block: 0.9rem 1.2rem;
}

.md-typeset hr {
  border-bottom-color: var(--av-border);
}

/* Code */
.md-typeset :not(pre) > code {
  padding: 0.08em 0.36em;
  border: 1px solid var(--av-border);
  border-radius: 5px;
  background: var(--av-raised);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.md-typeset :is(pre, code, kbd) {
  font-family: var(--av-mono);
  font-feature-settings: "calt" 0;
}

.md-typeset .highlight,
.md-typeset pre:not(.mermaid) {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  overflow: hidden;
}

.md-typeset .highlight pre {
  border: 0;
  border-radius: 0;
}

.md-typeset pre > code {
  padding: 0.85rem 1rem;
  font-size: 0.72rem;
  line-height: 1.6;
}

/* Tables */
.md-typeset__table {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.md-typeset table:not([class]) {
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  box-shadow: none;
  font-size: 0.7rem;
  line-height: 1.5;
}

.md-typeset table:not([class]) th {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--av-border-strong);
  background: var(--av-surface);
  color: var(--av-muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.md-typeset table:not([class]) td {
  padding: 0.6rem 0.8rem;
  border-top: 1px solid var(--av-border);
  vertical-align: top;
}

.md-typeset table:not([class]) tbody tr:hover {
  background: var(--av-surface);
  box-shadow: none;
}

/* Generated record table */
.md-typeset table.av-table {
  display: table;
  width: 100%;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  font-size: 0.7rem;
  line-height: 1.45;
}

.md-typeset .av-table th {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--av-border-strong);
  background: var(--av-surface);
  color: var(--av-muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.md-typeset .av-table td {
  min-width: 7.5rem;
  max-width: 18rem;
  padding: 0.6rem 0.8rem;
  border-top: 1px solid var(--av-border);
  vertical-align: top;
  overflow-wrap: break-word;
}

.md-typeset .av-table td:nth-child(2) {
  min-width: 17rem;
  max-width: 24rem;
  font-weight: 600;
}

.md-typeset .av-table td:first-child {
  min-width: 0;
  color: var(--av-muted);
  font-family: var(--av-mono);
  font-size: 0.66rem;
  white-space: nowrap;
}

.av-table td.is-gap {
  color: var(--av-muted);
  font-style: italic;
}

.av-table .av-badge {
  margin: 0 0.2rem 0.2rem 0;
}

.av-table tbody tr:hover {
  background: var(--av-surface);
}

.av-filter {
  width: min(100%, 26rem);
  margin: 0.4rem 0 0.8rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--av-border-strong);
  border-radius: var(--av-radius-sm);
  background: var(--av-surface);
  color: var(--av-text);
  font: inherit;
}

/* Admonitions and details */
.md-typeset :is(.admonition, details) {
  border: 1px solid var(--av-border);
  border-left-width: 3px;
  border-radius: var(--av-radius-sm);
  background: var(--av-surface);
  box-shadow: none;
  font-size: 0.74rem;
}

.md-typeset :is(.admonition-title, summary) {
  font-weight: 650;
}

/* Buttons */
.md-typeset .md-button {
  padding: 0.55em 1.1em;
  border: 1px solid var(--av-border-strong);
  border-radius: 8px;
  color: var(--av-text);
  font-size: 0.74rem;
  font-weight: 650;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.md-typeset .md-button:is(:hover, :focus) {
  border-color: var(--av-text);
  background: var(--av-raised);
  color: var(--av-text);
}

.md-typeset .md-button--primary {
  border-color: var(--av-brand);
  background: var(--av-brand);
  color: var(--av-brand-ink);
}

.md-typeset .md-button--primary:is(:hover, :focus) {
  border-color: var(--av-brand);
  background: color-mix(in srgb, var(--av-brand) 86%, var(--av-text));
  color: var(--av-brand-ink);
}

/* ── Components ─────────────────────────────────────────────────────── */
.av-lead {
  max-width: 46rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.92rem;
  line-height: 1.6;
}

.av-kicker {
  margin: 0 0 0.5rem;
  color: var(--av-brand);
  font-family: var(--av-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Card grids */
.av-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 0.8rem;
  margin: 1.1rem 0 1.6rem;
}

.av-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
}

.md-typeset .av-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  padding: 1rem 1.05rem;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  background: var(--av-surface);
  color: var(--av-text);
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}

.md-typeset a.av-card:is(:hover, :focus) {
  border-color: var(--av-border-strong);
  background: var(--av-raised);
  color: var(--av-text);
  transform: translateY(-1px);
}

.av-card__kicker {
  color: var(--av-muted);
  font-family: var(--av-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.av-card__title {
  font-size: 0.86rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.av-card__body {
  color: var(--av-muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.av-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.av-card__go {
  margin-top: auto;
  color: var(--av-link);
  font-size: 0.7rem;
  font-weight: 650;
}

/* Badges: decision and evidence labels */
.av-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.16rem 0.5rem;
  border: 1px solid color-mix(in srgb, currentColor 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 9%, transparent);
  color: var(--av-muted);
  font-family: var(--av-mono);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.av-badge--good,
.bench-status--current {
  color: var(--av-good);
}

.av-badge--warn,
.bench-status--rollback,
.bench-status--no-promotion {
  color: var(--av-warn);
}

.av-badge--info,
.bench-status--challenger {
  color: var(--av-info);
}

.av-badge--bad,
.bench-status--rejected {
  color: var(--av-bad);
}

[class*="bench-status--"] {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.5rem;
  border: 1px solid color-mix(in srgb, currentColor 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 9%, transparent);
  font-family: var(--av-mono);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Journey steps */
.av-steps {
  margin: 1.2rem 0 2rem;
}

.av-step {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  column-gap: 0.9rem;
  position: relative;
  padding-bottom: 1.5rem;
}

.av-step::before {
  content: "";
  position: absolute;
  top: 2.3rem;
  bottom: 0.2rem;
  left: 1.02rem;
  width: 1px;
  background: var(--av-border-strong);
}

.av-step:last-child {
  padding-bottom: 0;
}

.av-step:last-child::before {
  display: none;
}

.av-step__num {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--av-border-strong);
  border-radius: 50%;
  background: var(--av-surface);
  color: var(--av-brand);
  font-family: var(--av-mono);
  font-size: 0.74rem;
  font-weight: 700;
}

.md-typeset .av-step__body > h3 {
  margin: 0.32rem 0 0.3rem;
}

.md-typeset .av-step__body > p {
  margin: 0.3rem 0 0.6rem;
}

.md-typeset .av-step__body .highlight {
  margin: 0.5rem 0;
}

.md-typeset .av-step__result {
  color: var(--av-muted);
  font-size: 0.72rem;
}

.av-step__result strong {
  color: var(--av-good);
  font-family: var(--av-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Benchmark record header on every finding */
.av-record {
  margin: 1rem 0 1.8rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  background: var(--av-surface);
}

.av-record__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.av-record__date {
  margin-right: 0.3rem;
  color: var(--av-muted);
  font-family: var(--av-mono);
  font-size: 0.66rem;
}

.md-typeset .av-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.7rem 1.2rem;
  margin: 0;
}

.av-facts > div {
  min-width: 0;
}

.md-typeset .av-facts dt {
  margin: 0;
  color: var(--av-muted);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.md-typeset .av-facts dd {
  margin: 0.1rem 0 0;
  font-size: 0.74rem;
  font-weight: 550;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.av-facts dd.is-gap {
  color: var(--av-muted);
  font-style: italic;
  font-weight: 400;
}

.md-typeset .av-record__metrics {
  margin: 0.9rem 0 0;
  padding: 0.8rem 0 0;
  border-top: 1px solid var(--av-border);
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.5rem 1.2rem;
}

.md-typeset .av-record__metrics li {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
}

.av-record__metrics b {
  font-family: var(--av-mono);
  font-weight: 650;
}

.av-record__metrics span {
  display: block;
  color: var(--av-muted);
  font-size: 0.68rem;
}

.md-typeset .av-record__note {
  margin: 0.8rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--av-border);
  color: var(--av-muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.av-record__note strong {
  color: var(--av-text);
}

/* Journey cheat sheet */
.av-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr));
  gap: 0.9rem;
  margin: 1.2rem 0 2rem;
}

.av-sheet__family {
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  background: var(--av-surface);
}

.md-typeset .av-sheet__family > h3 {
  margin: 0 0 0.6rem;
}

.md-typeset .av-sheet__family ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sheet;
}

.md-typeset .av-sheet__family li {
  margin: 0 0 0.6rem;
  counter-increment: sheet;
}

.av-sheet__family li > span {
  display: block;
  color: var(--av-muted);
  font-size: 0.68rem;
}

.av-sheet__family li > span::before {
  content: counter(sheet) ". ";
  color: var(--av-brand);
  font-family: var(--av-mono);
}

.md-typeset .av-sheet__family li > code {
  display: block;
  margin-top: 0.15rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.66rem;
  white-space: pre-wrap;
}

/* ── Home ───────────────────────────────────────────────────────────── */
body:has(.av-home) .md-content__inner {
  margin: 0 1rem;
  padding: 0 0 3rem;
}

body:has(.av-home) .md-content__inner::before,
body:has(.av-home) .md-content__button,
body:has(.av-home) .md-path {
  display: none;
}

.av-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 2.5rem;
  padding: 3.6rem 0 3rem;
}

.md-typeset .av-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 4.6vw, 3.3rem);
  font-weight: 780;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.av-hero h1 em {
  color: var(--av-brand);
  font-style: normal;
}

.md-typeset .av-hero__lead {
  max-width: 34rem;
  margin: 0 0 1.5rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.av-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.av-terminal {
  min-width: 0;
  border: 1px solid var(--av-border-strong);
  border-radius: 12px;
  background: var(--md-code-bg-color);
  box-shadow: var(--av-shadow);
  overflow: hidden;
}

.av-terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--av-border);
  color: var(--av-muted);
  font-family: var(--av-mono);
  font-size: 0.62rem;
}

.av-terminal__bar i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--av-border-strong);
}

.av-terminal__bar span {
  margin-left: 0.4rem;
}

.md-typeset .av-terminal pre {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.md-typeset .av-terminal pre > code {
  padding: 1rem 1.1rem 1.15rem;
  font-size: 0.7rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.av-terminal .c {
  color: var(--av-muted);
}

.av-terminal .p {
  color: var(--av-brand);
  user-select: none;
}

.av-section {
  padding: 2.4rem 0 0.4rem;
  border-top: 1px solid var(--av-border);
}

.md-typeset .av-section > h2 {
  margin: 0 0 0.4rem;
  padding: 0;
  border: 0;
  font-size: 1.5rem;
}

.md-typeset .av-section > p {
  max-width: 44rem;
  margin: 0 0 0.4rem;
  color: var(--av-muted);
}

.av-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 1.2rem 0 1.6rem;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  background: var(--av-surface);
  counter-reset: flow;
}

.av-flow > div {
  padding: 1rem 1.1rem;
  border-left: 1px solid var(--av-border);
  counter-increment: flow;
}

.av-flow > div:first-child {
  border-left: 0;
}

.av-flow strong {
  display: block;
  font-size: 0.86rem;
}

.av-flow strong::before {
  content: "0" counter(flow);
  display: block;
  margin-bottom: 0.25rem;
  color: var(--av-brand);
  font-family: var(--av-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
}

.av-flow span {
  color: var(--av-muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

/* ── Hand-written benchmark surfaces (shared tokens) ────────────────── */
.bench-paths {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.8rem;
  margin: 1.1rem 0 1.8rem;
}

.bench-path,
.bench-recipe,
.bench-history {
  min-width: 0;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius);
  background: var(--av-surface);
}

.bench-path,
.bench-recipe {
  padding: 1rem 1.05rem;
}

.bench-path > :first-child,
.bench-recipe > :first-child {
  margin-top: 0;
}

.bench-path > :last-child,
.bench-recipe > :last-child {
  margin-bottom: 0;
}

.bench-history {
  margin: 1rem 0 1.5rem;
}

.md-typeset .bench-history > summary {
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-weight: 650;
}

.bench-history > div {
  padding: 0 1rem 1rem;
}

.bench-recipes {
  display: grid;
  gap: 0.9rem;
  margin: 1.1rem 0 2rem;
}

.md-typeset .bench-recipe__eyebrow {
  margin: 0 0 0.3rem;
  color: var(--av-muted);
  font-family: var(--av-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.md-typeset :is(.bench-recipe__title, .bench-recipe > h3) {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
}

.md-typeset .bench-recipe__meta {
  margin: 0.2rem 0;
  color: var(--av-muted);
  font-size: 0.7rem;
}

.md-typeset .bench-recipe__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.bench-recipe__metric {
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-sm);
  background: var(--av-bg);
}

.md-typeset .bench-recipe__metric dt {
  margin: 0;
  color: var(--av-muted);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.md-typeset .bench-recipe__metric dd {
  margin: 0.15rem 0 0;
  font-family: var(--av-mono);
  font-size: 0.8rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.bench-recipe__limitations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.4rem 1.4rem;
}

.md-typeset :is(.bench-recipe__strengths, .bench-recipe__limitations) h3 {
  margin: 0.6rem 0 0.2rem;
  color: var(--av-muted);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.md-typeset .bench-recipe__strengths h3 {
  color: var(--av-good);
}

.md-typeset .bench-recipe__limitations ul,
.md-typeset .bench-recipe__strengths ul {
  margin: 0;
  font-size: 0.72rem;
}

.bench-recipe__actions {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--av-border);
  font-size: 0.72rem;
}

/* Benchmark explorer controls */
#benchmark-explorer :is(select, input[type="text"]) {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--av-border-strong);
  border-radius: var(--av-radius-sm);
  background: var(--av-surface);
  color: var(--av-text);
  font: inherit;
}

/* ── Responsive and motion ──────────────────────────────────────────── */
@media screen and (max-width: 60rem) {
  .av-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
    padding: 2.2rem 0 2rem;
  }

  .av-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .av-flow > div:nth-child(3) {
    border-left: 0;
  }

  .av-flow > div:nth-child(n + 3) {
    border-top: 1px solid var(--av-border);
  }

  .av-sheet,
  .av-grid--wide {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen and (max-width: 37.5rem) {
  .md-typeset h1 {
    font-size: 1.6rem;
  }

  .av-flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .av-flow > div {
    border-left: 0;
    border-top: 1px solid var(--av-border);
  }

  .av-flow > div:first-child {
    border-top: 0;
  }

  .av-actions .md-button {
    flex: 1 1 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .md-typeset .av-card,
  .md-typeset .md-button {
    transition: none;
  }

  .md-typeset a.av-card:is(:hover, :focus) {
    transform: none;
  }
}

@media print {
  .av-sheet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .av-sheet__family {
    break-inside: avoid;
  }
}
