/* MolDraft leaderboard — hand-written port of the reference site's utility classes.
   Spacing unit .25rem; text-xs .75rem/1rem; text-sm .875rem/1.25rem; text-lg 1.125rem/1.75rem.
   Mobile-first, one media block per breakpoint: 640 (nav, hero), 680 (cell padding, model width),
   704 (tagline nowrap), 768 (gutters, card borders, h1), 1280 (rate bar).
   Every corner is square (--radius: 0). All colours are tokens; nothing below :root/.dark is hardcoded. */

/* ---------------------------------------------------------------- tokens */
:root {
  --background: #fff;
  --foreground: #20343b;
  --card: #fff;
  --card-foreground: #20343b;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --muted: #f4f4f5;
  --muted-foreground: #566a75;
  --heading: #174e41;
  --molecule-canvas: #fff;
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  --border: #e4e4e7;
  --sidebar: #fafafa;
  /* Matter Lab greens (MatterLabTemplate_2025.potx): #016846 deep, #009652 mid, #00CC74 bright, #12F98B neon */
  --brand: #009652;
  --brand-strong: #016846;
  --brand-foreground: #fff;
  --brand-hover: #007a45;
  /* pre-mixed per-theme fallbacks, declared on the line before each color-mix() */
  --muted-translucent: rgba(244, 244, 245, .5);      /* muted 50% */
  --secondary-hover: #e8e8e9;                        /* secondary + 5% foreground */
  --radius: 0;

  --font-sans: 'Google Sans Code', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --page-max: 84rem;
  --page-gutter: clamp(1rem, 2vw, 2.5rem);
  --chart-max: 64rem;
  --chart-aspect: 1.655172414;
  --ease: cubic-bezier(.4, 0, .2, 1);
  color-scheme: light;
}

.dark {
  --background: #09090b;
  --foreground: #fafafa;
  --card: #18181b;
  --card-foreground: #fafafa;
  --primary: #e4e4e7;
  --primary-foreground: #18181b;
  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --muted: #27272a;
  --muted-foreground: #9f9fa9;
  --heading: #9de5c7;
  --accent: #27272a;
  --accent-foreground: #fafafa;
  --border: #2e2e2e;
  --sidebar: #18181b;
  --brand: #00cc74;
  --brand-strong: #12f98b;
  --brand-foreground: #09090b;
  --brand-hover: #3dfba2;
  --muted-translucent: rgba(39, 39, 42, .5);
  --secondary-hover: #323234;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- preflight */
*, ::before, ::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: clamp(100%, calc(.875rem + .2vw), 112.5%);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  tab-size: 4;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
}
body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { font-size: inherit; font-weight: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: inherit; }
button {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  border: 0;
  border-radius: var(--radius);
  background-color: transparent;
  background-image: none;
  cursor: pointer;
}
img, svg { display: block; vertical-align: middle; }
img { max-width: 100%; height: auto; }
table { text-indent: 0; border-color: inherit; border-collapse: collapse; }
b, strong { font-weight: bolder; }
code, pre { font-family: inherit; font-size: 1em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-strong); outline-offset: 2px; }
/* inline symbol sprite for the vendor logos: kept in the render tree (not display:none) so <use> resolves everywhere */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- header (sticky h-14 top-0 z-40) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--border);
  background-color: var(--sidebar);
  transition: background-color .15s var(--ease);
}
.header-inner {
  display: flex;
  height: 3.5rem;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  align-items: center;
  padding: 0 var(--page-gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 500;
  letter-spacing: -.025em;
}
.brand-text { white-space: nowrap; }
.nav { display: none; }
.nav-list {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .5rem;
  padding: 0 1.5rem;
}
.nav-item {
  font-size: .875rem;
  line-height: 1.25rem;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .5rem;
  color: var(--muted-foreground);
  transition: color .15s var(--ease);
}
.nav-link:hover { color: var(--foreground); }
.nav-link[aria-current="page"] { color: var(--heading); }
.header-end {
  display: flex;
  flex: 1 1 0%;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: .375rem;
}

/* logo (theme-swapped) */
.logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo img { height: 22px; width: auto; }
.logo-footer img { height: 20px; }
.logo-dark { display: none; }
.dark .logo-light { display: none; }
.dark .logo-dark { display: block; }

/* theme toggle: bordered pill, three 26px buttons, square corners */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .25rem;
  overflow: hidden;
}
.theme-btn {
  display: inline-flex;
  width: 1.625rem;
  height: 1.625rem;
  padding: .375rem;
  color: var(--muted-foreground);
  border-radius: var(--radius);
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.theme-btn svg { width: 100%; height: 100%; }
.theme-btn[aria-pressed="true"] {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

/* ---------------------------------------------------------------- main + hero */
.home-layout {
  display: flex;
  flex: 1 1 0%;
  flex-direction: column;
  scroll-margin-top: 62px;
}
.hero {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: var(--page-max);
  align-self: center;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem var(--page-gutter) 0;
  text-align: center;
}
.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.hero-title {
  color: var(--heading);
  max-width: 100%;
  white-space: nowrap;
  padding: 0 .25rem;
  font-size: clamp(1.25rem, 8.6vw, 2.25rem);
  line-height: 1;
  font-weight: 400;
  letter-spacing: -.05em;
  text-transform: uppercase;
}
/* nowrap only from 704px: the smallest width where the 66-char tagline fits with 16px gutters and a classic scrollbar */
.tagline {
  max-width: none;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 400;
  letter-spacing: -.05em;
  color: var(--muted-foreground);
}
.hero-credits {
  display: grid;
  width: 100%;
  max-width: 66rem;
  gap: .5rem;
}
.author-list, .affiliation-list, .benchmark-contact ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1rem;
}
.author-list {
  color: var(--heading);
  font-weight: 500;
  line-height: 1.6;
}
.hero-credits sup {
  font-size: .7em;
  line-height: 0;
}
.author-list sup { margin-inline-start: .15em; }
.affiliation-list, .benchmark-contact {
  color: var(--muted-foreground);
  font-size: .875rem;
}
.author-note {
  color: var(--muted-foreground);
  font-size: .8125rem;
}
.benchmark-contact { margin-top: .375rem; }
.benchmark-contact a {
  color: var(--heading);
  text-decoration: underline;
  text-underline-offset: .15em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

/* A real benchmark input and verified generated answer, between leaderboard and details. */
.molecule-demo {
  width: calc(100% - 2 * var(--page-gutter));
  max-width: 62rem;
  align-self: center;
  margin: 3rem auto 0;
  border: 1px solid var(--border);
  background: var(--card);
  text-align: left;
}
.demo-intro { padding: 1.25rem 1.5rem 1rem; }
.demo-intro h2 { color: var(--heading); font-size: 1.125rem; font-weight: 500; }
.demo-intro p { margin-top: .25rem; color: var(--muted-foreground); font-size: .8125rem; }
.demo-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem minmax(0, 1fr);
  align-items: center;
  padding: 0 1.5rem 1rem;
}
.demo-panel { min-width: 0; }
.demo-panel h3 { color: var(--heading); font-size: .8125rem; font-weight: 500; }
.demo-number { margin-right: .375rem; color: var(--muted-foreground); font-size: .6875rem; }
.demo-image {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  margin-top: .75rem;
  overflow: hidden;
  background: var(--molecule-canvas);
  border: 1px solid var(--border);
}
.demo-image img { width: 100%; height: 100%; object-fit: contain; }
.demo-panel:first-child img { padding: 1rem; }
.demo-arrow { color: var(--brand-strong); font-size: 1.5rem; text-align: center; }
.demo-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  border-top: 1px solid var(--border);
  padding: .875rem 1.5rem;
  color: var(--muted-foreground);
  font-size: .75rem;
  line-height: 1.75;
}
.demo-status { margin-right: .5rem; color: var(--brand-strong); font-weight: 500; }
.demo-motion {
  flex-shrink: 0;
  border: 1px solid var(--border);
  padding: .375rem .625rem;
  color: var(--heading);
  font-size: .75rem;
}
.demo-motion:hover { background: var(--secondary); }
@media (max-width: 639px) {
  .demo-intro { padding: 1rem; }
  .demo-pair { grid-template-columns: minmax(0, 1fr); gap: .75rem; padding: 0 1rem 1rem; }
  .demo-arrow { transform: rotate(90deg); line-height: 1; }
  .demo-caption { padding: .875rem 1rem; }
}

/* buttons: h-9 gap-1.5 px-2.5 text-sm font-medium, no radius */
.btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  gap: .375rem;
  padding: 0 .625rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background-clip: padding-box;
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 500;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  transition: color .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  pointer-events: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background-color: var(--brand-strong);
  color: var(--brand-foreground);
}
.btn-primary:hover {
  background-color: var(--brand-hover);
}
.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}
.btn-secondary:hover {
  background-color: var(--secondary-hover);
  background-color: color-mix(in oklch, var(--secondary), var(--foreground) 5%);
}

/* ---------------------------------------------------------------- leaderboard: section > card > scroll-viewport > table */
.leaderboard {
  width: 100%;
  min-width: 0;
  max-width: var(--page-max);
  align-self: center;
  scroll-margin-top: 62px;
  padding: 0 var(--page-gutter);
  margin-top: 1.5rem;
}
/* card: full-bleed with no side borders below md, bordered card from md */
.card {
  margin: 0 calc(-1 * var(--page-gutter));
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-left: 0;
  border-right: 0;
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--card-foreground);
}

/* the table scrolls inside the card; scrollbar hidden like the reference, keyboard-scrollable via tabindex */
.scroll-viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.scroll-viewport::-webkit-scrollbar { display: none; }
.scroll-viewport:focus-visible { outline-offset: -2px; }

/* table: text-sm min-w-max w-full */
.table {
  font-size: .875rem;
  line-height: 1.25rem;
  min-width: max-content;
  width: 100%;
}
.table-row {
  border-bottom: 1px solid var(--border);
  transition: color .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease);
}
tbody .table-row:hover {
  background-color: var(--muted-translucent);
  background-color: color-mix(in srgb, var(--muted) 50%, transparent);
}
tbody .table-row:last-child { border-bottom: 0; }

/* th: h-12 px-6 (px-3 below 680) text-left align-middle font-medium uppercase whitespace-nowrap text-foreground */
.table-head {
  height: 3rem;
  padding: 0 .75rem;
  text-align: left;
  vertical-align: middle;
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--foreground);
}
/* td: h-12 px-6 (px-3 below 680) py-2 align-middle whitespace-nowrap */
.table-cell {
  height: 3rem;
  padding: .5rem .75rem;
  vertical-align: middle;
  white-space: nowrap;
}

/* RANK: w-12 text-right, muted tabular number */
.th-rank, .td-rank {
  width: 3rem;
  text-align: right;
}
.rank {
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

/* MODEL: min-w-[233px] from 680px, xl:w-px */
.model {
  display: inline-flex;
  align-items: baseline;
  gap: .25rem;
}
.hover-underline:hover { text-decoration-line: underline; text-decoration-color: var(--brand); }
.org-logo {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  align-self: center;
  margin-right: .25rem;
  color: var(--foreground);
}
.effort {
  font-size: .75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
}

/* SUCCESS RATE: 4rem number box + 12px bar, shown at every width; no error bar by request */
.td-date { min-width: 9rem; }
.td-rate {
  min-width: 14rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.rate {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.rate-num {
  width: 4rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.bar {
  position: relative;
  display: block;
  height: .75rem;
  min-width: 0;
  max-width: 30vw;
  flex: 1 1 0%;
  border-radius: var(--radius);
  background-color: var(--muted);
}
.bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background-color: var(--brand);
}

/* sortable header button */
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-weight: 500;
  text-transform: uppercase;
  transition: color .15s var(--ease);
}
.sort-btn:hover { color: var(--foreground); }
.sort-icon {
  width: .875rem;
  height: .875rem;
  color: var(--muted-foreground);
}

/* empty / noscript state */
.table-empty {
  display: flex;
  min-height: 6rem;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  text-align: center;
  font-size: .875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}
.td-empty {
  height: 6rem;
  text-align: center;
  color: var(--muted-foreground);
}

/* card footer: flex min-h-12 items-center justify-center border-t px-6 py-2 text-center text-sm */
.card-footer {
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border);
  padding: .5rem 1.5rem;
  text-align: center;
  font-size: .875rem;
  line-height: 1.25rem;
  color: var(--muted-foreground);
}

/* ---------------------------------------------------------------- about (880px of content plus the page gutters) */
.about {
  width: 100%;
  max-width: calc(55rem + 2 * var(--page-gutter));
  margin: 3rem auto;
  padding: 0 var(--page-gutter);
  scroll-margin-top: 62px;
  font-size: .875rem;
  line-height: 1.6;
  color: var(--muted-foreground);
}
.about h3 {
  margin-top: 1.5rem;
  margin-bottom: .5rem;
  font-size: .875rem;
  line-height: 1.25rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--heading);
}
.about h3:first-of-type { margin-top: 0; }
.about p + p { margin-top: .5rem; }
.about ul, .about ol { margin: .25rem 0 0; }
.about ul { list-style: none; padding: 0; }
.about ol { list-style: decimal; padding-left: 1.25rem; }
.about li + li { margin-top: .125rem; }
.about ol + p, .about ul + p { margin-top: .5rem; }
.about pre {
  margin-top: .5rem;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  background-color: var(--muted);
  color: var(--foreground);
  font-size: .75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-x: auto;
}
.about code { color: var(--foreground); }
.about a { color: var(--heading); text-decoration: underline; text-underline-offset: .15em; }
.about a code { color: inherit; }
.about [data-fill]:empty { display: none; }

/* ---------------------------------------------------------------- page footer */
.page-footer {
  margin-top: 1rem;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem var(--page-gutter) 2rem;
  font-size: .75rem;
  line-height: 1rem;
  color: var(--muted-foreground);
}
/* ---------------------------------------------------------------- 2D gallery */
.gallery {
  flex: 1;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: 3rem var(--page-gutter);
  scroll-margin-top: 4.5rem;
}
.gallery-intro h1 {
  color: var(--heading);
  font-size: clamp(1.85rem, 5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -.04em;
}
.gallery-intro p {
  max-width: 68ch;
  margin-top: .75rem;
  font-size: 1rem;
  color: var(--muted-foreground);
}
.gallery-intro p a { color: var(--heading); text-decoration: underline; }
.gallery-jump {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.25rem;
}
.gallery-jump a {
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  color: var(--heading);
  font-size: .875rem;
}
.gallery-jump a:hover { background: var(--secondary); }
.gallery-group {
  margin-top: 2.5rem;
  scroll-margin-top: 4.5rem;
}
.gallery-group h2 {
  margin-bottom: .875rem;
  color: var(--heading);
  font-size: 1.25rem;
}
.gallery-group h2 span { color: var(--muted-foreground); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, clamp(9rem, 14vw, 13rem)), 1fr));
  gap: .75rem;
}
.gallery-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
}
.gallery-card:hover { border-color: var(--brand-strong); }
.gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--molecule-canvas);
  padding: .5rem;
}
.gallery-card span {
  display: block;
  padding: .4rem .625rem;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: .875rem;
}
.gallery-sources {
  padding: .4rem .625rem;
  border: 1px solid var(--border);
  border-top: 0;
  color: var(--muted-foreground);
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.gallery-sources summary { color: var(--heading); cursor: pointer; }
.gallery-sources dt { margin-top: .45rem; font-weight: 500; }
.gallery-sources a { color: var(--heading); text-decoration: underline; }

/* ---------------------------------------------------------------- breakpoints */
@media (max-width: 767px) {
  .nav-gallery { display: none; }
}
@media (min-width: 640px) {
  .nav { display: block; }
  .hero { gap: 2rem; padding-top: 3rem; }
  .hero-title { font-size: 3rem; }
}
@media (min-width: 680px) {
  .table-head { padding: 0 1.5rem; }
  .table-cell { padding: .5rem 1.5rem; }
  .td-model { min-width: 233px; }
}
@media (min-width: 704px) {
  .tagline { white-space: nowrap; }
}
@media (min-width: 768px) {
  .mobile-gallery { display: none; }
  .header-inner { padding: 0 var(--page-gutter); }
  .hero-title { font-size: 4.5rem; }
  .leaderboard { padding: 0 var(--page-gutter); }
  .card {
    margin: 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
  .about { padding: 0 var(--page-gutter); }
  .page-footer { padding: 1.5rem var(--page-gutter) 2rem; }
}
@media (min-width: 1280px) {
  .td-model { width: 1px; }
  .td-num { width: 1px; }
  .rate { min-width: 13rem; }
}

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, ::before, ::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .btn:active { transform: none; }
}

/* COST/MOLECULE / TOKENS: right-aligned values, sortable like tbench */
.th-num, .td-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 7rem;
}
.th-num .sort-btn { margin-left: auto; }

/* ===== charts: tbench-style view toggle (TABLE | COST | TOKENS) and the pareto cards ===== */
.view-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: .375rem;
}
/* tbench HomeViewToggle: inline-flex h-8 border, ghost segments with a right divider, pressed = bg muted */
.view-toggle {
  display: inline-flex;
  height: 2rem;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
}
.view-btn {
  height: 2rem;
  padding: 0 .75rem;
  border: 0;
  border-right: 1px solid var(--border);
  background: none;
  color: var(--muted-foreground);
  font: inherit;
  font-size: .875rem;
  line-height: 1.25rem;
  cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.view-btn:last-child { border-right: 0; }
.view-btn:hover { color: var(--foreground); }
.view-btn[aria-pressed="true"] {
  background-color: var(--muted);
  color: var(--foreground);
}
.view[hidden] { display: none; }
/* chart card header: flex h-12 items-center border-b px-6 uppercase text-sm */
.chart-head {
  display: flex;
  min-height: 3rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  font-size: .875rem;
  line-height: 1.25rem;
  text-transform: uppercase;
}
.chart-body {
  padding: .5rem .5rem 0;
  overflow-x: auto;
}
.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 40rem;
  max-width: var(--chart-max);
  max-width: min(var(--chart-max), calc((100vh - 18rem) * var(--chart-aspect)));
  max-width: min(var(--chart-max), calc((100svh - 18rem) * var(--chart-aspect)));
  margin-inline: auto;
}
.chart-svg rect.pt, .chart-svg rect.bin-bar { cursor: default; outline: none; }
.chart-svg rect.pt:hover, .chart-svg rect.pt:focus-visible, .chart-svg rect.bin-bar:hover, .chart-svg rect.bin-bar:focus-visible { stroke: var(--foreground); }
.chart-notes {
  margin: 0;
  padding: .5rem 1.5rem .75rem 2.5rem;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  line-height: 1.125rem;
  color: var(--muted-foreground);
}
.chart-notes li { margin: .125rem 0; }
.chart-tip {
  position: fixed;
  z-index: 50;
  max-width: 22rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--card-foreground);
  font-size: .75rem;
  line-height: 1.125rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  pointer-events: none;
}
.chart-tip[hidden] { display: none; }
.chart-tip-head { font-weight: 500; margin-bottom: .125rem; }
.chart-tip-row { display: flex; justify-content: space-between; gap: 1rem; }
.chart-tip-row span:first-child { color: var(--muted-foreground); }
.chart-tip-row.muted { color: var(--muted-foreground); }

/* atoms view: model chips under the chart (tbench Badge outline look), one pre-rendered SVG per mode */
.atoms-mode[hidden] { display: none; }
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  padding: .5rem 1.5rem .75rem;
  border-top: 1px solid var(--border);
}
.chip {
  height: 1.75rem;
  padding: 0 .625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
  color: var(--muted-foreground);
  font: inherit;
  font-size: .75rem;
  line-height: 1rem;
  text-transform: uppercase;
  cursor: pointer;
}
.chip:hover { color: var(--foreground); }
.chip[aria-pressed="true"] {
  background-color: var(--foreground);
  border-color: var(--foreground);
  color: var(--background);
}
