/* zmime.com — AI models: directory, model pages and comparisons.
   Builds on the tokens and components in style.css (paper, ink, hairlines,
   Instrument Serif display, mono labels). Loaded only on /ai-models/ pages. */

.am { padding-bottom: clamp(2rem, 6vw, 4rem); }
.am .section-head { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.am .section-head h2 { max-width: 28ch; }
.am-section { padding-top: clamp(3.5rem, 8vw, 6.5rem); scroll-margin-top: calc(var(--bar) + 1rem); }
.am-section--tight { padding-top: 1.5rem; }
.am .num { text-align: right; font-variant-numeric: tabular-nums; }
.am-na { color: var(--faint); }
.am-note { margin: 1rem 0 0; color: var(--muted); font-size: .8438rem; line-height: 1.55; }
.am-note a { color: var(--accent-ink); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.am-empty-note { color: var(--muted); }
.am code { font-size: .8125em; }

/* ------------------------------------------------------------------ heads */
.am-head { padding-block: clamp(1.5rem, 5vw, 3rem) 0; }
.am-head h1 { max-width: 15ch; margin: 1.25rem 0 1.4rem; }
.am-head .lead { max-width: 60ch; margin: 0; }
.am--missing .am-head h1 { max-width: 20ch; font-size: clamp(2.3rem, 7vw, 4.5rem); overflow-wrap: anywhere; }

.am-hero { padding-block: clamp(1.5rem, 5vw, 3rem) 0; display: grid; gap: clamp(2rem, 5vw, 3rem); }
.am-hero h1 { font-size: clamp(2.5rem, 7.5vw, 5rem); margin: 1.1rem 0 1.25rem; max-width: 16ch; }
.am-hero .lead { max-width: 58ch; margin: 0 0 1.5rem; }
.am-hero .tags { margin: 0; }
.am-hero--compare { display: block; }
.am-hero--compare h1 { max-width: none; font-size: clamp(2.1rem, 6vw, 4.25rem); text-wrap: balance; }
.am-hero--compare h1 em { font-size: .62em; color: var(--faint); padding: 0 .12em; vertical-align: .08em; }
.am-hero--compare .lead { max-width: 64ch; }

/* ---------------------------------------------------------------- figures */
.am-stats,
.am-figures {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.am-stats li,
.am-figures > div { margin: 0; padding: 1rem 1rem 1rem 0; border-bottom: 1px solid var(--line); min-width: 0; }
.am-stats li:nth-child(even),
.am-figures > div:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--line); }
.am-stats b,
.am-figures dd {
  display: block;
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.am-stats span,
.am-figures dt,
.am-figures small {
  display: block;
  font-family: var(--mono);
  font-size: .625rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.am-stats span { margin-top: .45rem; }
.am-figures dt { margin-bottom: .55rem; }
.am-figures small { margin-top: .5rem; font-size: .5938rem; color: var(--faint); letter-spacing: .1em; }
.am-stats { margin-top: clamp(1.5rem, 4vw, 2.5rem); }

/* ---------------------------------------------------------------- builder */
.am-builder { margin-top: clamp(2rem, 5vw, 3rem); }
.am-builder__card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(1.25rem, 3.5vw, 2.25rem);
  box-shadow: 0 1px 0 rgba(16, 15, 13, .02), 0 30px 60px -45px rgba(16, 15, 13, .35);
}
.am-builder__head { display: grid; gap: .35rem; margin-bottom: 1.4rem; }
.am-builder__head h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.am-builder__head p { margin: 0; color: var(--muted); font-size: .9375rem; }
.am-builder--compact { margin-top: 2rem; max-width: 40rem; }
.am-builder--compact .am-form { margin-bottom: 1.25rem; }

.am-form { display: grid; gap: .9rem; align-items: end; }
.am-form .btn { width: 100%; min-height: 54px; }
.am-form__error { grid-column: 1 / -1; margin: 0; color: #a3431f; font-size: .875rem; }

.am-slot { min-width: 0; }
.am-slot__label {
  display: block;
  margin-bottom: .5rem;
  font-family: var(--mono);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.am-combo { position: relative; }
.am-combo__input {
  width: 100%;
  min-height: 54px;
  padding: .8rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.am-combo__input::placeholder { color: var(--faint); }
.am-combo__input:hover { border-color: var(--muted); }
.am-combo__input:focus { outline: 0; background: var(--card); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.am-combo__input[data-slug] { border-color: var(--ink); background: var(--card); }
.am-combo__list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 20rem;
  overflow-y: auto;
  margin: 0;
  padding: .35rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  box-shadow: 0 22px 50px -24px rgba(16, 15, 13, .4);
}
.am-combo__opt {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  margin: 0;
  padding: .6rem .75rem;
  border-radius: 6px;
  cursor: pointer;
}
.am-combo__opt[aria-selected="true"],
.am-combo__opt:hover { background: var(--accent-wash); }
.am-combo__name { font-weight: 520; font-size: .9375rem; color: var(--ink); }
.am-combo__meta { font-family: var(--mono); font-size: .625rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.am-combo__empty { margin: 0; padding: .75rem; color: var(--muted); font-size: .875rem; }

/* ------------------------------------------------------------------ pairs */
.am-pairs {
  list-style: none;
  display: grid;
  gap: .75rem;
  margin: 0;
  padding: 0;
}
.am-pairs li { margin: 0; }
.am-pair {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
  min-height: 9.5rem;
  padding: 1.25rem 3rem 1.15rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.am-pair:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 18px 40px -30px rgba(16, 15, 13, .45); }
.am-pair__names { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .45rem; font-family: var(--serif); font-size: 1.45rem; line-height: 1.1; letter-spacing: -.015em; }
.am-pair__names em { font-size: .85em; color: var(--faint); }
.am-pair__meta { display: grid; gap: .2rem; font-family: var(--mono); font-size: .5938rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.am-pair__go { position: absolute; top: 1.1rem; right: 1.15rem; font-size: 1rem; transition: transform .3s var(--ease); }
.am-pair:hover .am-pair__go { transform: translate(3px, -3px); color: var(--accent); }

.am-trio {
  display: grid;
  gap: .6rem;
  margin-top: .75rem;
  padding: 1.35rem 1.4rem;
  border-radius: 10px;
  background: var(--accent-wash);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  transition: border-color .25s var(--ease);
}
.am-trio:hover { border-color: var(--accent); }
.am-trio .label { color: var(--accent-ink); }
.am-trio__names { font-family: var(--serif); font-size: clamp(1.4rem, 3.6vw, 2rem); line-height: 1.1; letter-spacing: -.015em; }
.am-trio__names em { font-size: .8em; color: color-mix(in srgb, var(--accent-ink) 55%, var(--paper)); }
.am-trio__go { font-size: .9375rem; font-weight: 520; color: var(--accent-ink); }

/* ---------------------------------------------------------------- filters */
.am-filters {
  display: grid;
  gap: .9rem;
  padding: 1rem 0 1.1rem;
  border-top: 1px solid var(--ink);
}
.am-filters[hidden] { display: none; }
.am-field { display: grid; gap: .45rem; min-width: 0; }
.am-field__label { font-family: var(--mono); font-size: .625rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.am-field input,
.am-field select {
  width: 100%;
  min-height: 46px;
  padding: .6rem .85rem;
  font: inherit;
  font-size: .9375rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 8px;
}
.am-field select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.am-field input:focus,
.am-field select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }

.am-toggles { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.am-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 38px;
  padding: .4rem .85rem .4rem .7rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  font-size: .8438rem;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.am-check input { margin: 0; width: 15px; height: 15px; accent-color: var(--ink); }
.am-check:hover { border-color: var(--ink); }
.am-check:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.am-check:has(input:checked) input { accent-color: var(--paper); }
.am-check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.am-count { margin: 0 0 .75rem; font-family: var(--mono); font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.am-empty { padding: 2rem 0; color: var(--muted); text-align: center; }
.am-more { display: flex; margin: 1.5rem auto 0; }
.am-more[hidden] { display: none; }

/* -------------------------------------------------------- directory table */
/* position: relative keeps visually-hidden (absolutely positioned) cell text inside the scroller */
.am-table-wrap { position: relative; max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.am-verdict__grid > *,
.am-calc__grid > *,
.am-method__grid > * { min-width: 0; }
.am-table { width: 100%; border-collapse: collapse; font-size: .9063rem; }
.am-table thead th { padding: .7rem .75rem .7rem 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.am-table thead abbr { text-decoration: none; }
.am-table tbody th,
.am-table tbody td { padding: .85rem .75rem .85rem 0; vertical-align: middle; border-bottom: 1px solid var(--line); }
.am-table tbody tr { transition: background .2s var(--ease); }
.am-table tbody tr:hover th,
.am-table tbody tr:hover td { background: transparent; }
.am-table tbody tr:hover { background: color-mix(in srgb, var(--paper-2) 75%, transparent); }
.am-table tbody tr.is-picked { background: var(--accent-wash); }
.am-table tbody tr[hidden] { display: none; }
.am-table td:first-of-type { white-space: nowrap; color: var(--muted); }
.am-table td.num b { font-weight: 600; color: var(--ink); }

.am-model { display: inline-grid; gap: .15rem; }
.am-model__name { font-weight: 560; color: var(--ink); letter-spacing: -.005em; transition: color .2s var(--ease); }
.am-model:hover .am-model__name { color: var(--accent); }
.am-model__lab { font-family: var(--mono); font-size: .5938rem; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.am-rank { font-family: var(--mono); font-size: .625rem; color: var(--faint); }
.am-ins { color: var(--muted); font-size: .8125rem; }

.am-badge {
  display: inline-block;
  margin-left: .5rem;
  padding: .12rem .45rem;
  vertical-align: .15em;
  font-family: var(--mono);
  font-size: .5313rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 999px;
}
.am-badge--warn { color: #94591c; border-color: #e6c9a1; background: #fbf3e6; }

.am-add-cell { width: 1%; white-space: nowrap; text-align: right; }
.am-add {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 34px;
  padding: .35rem .8rem .35rem .6rem;
  font: 500 .75rem/1 var(--sans);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.am-add:hover { border-color: var(--ink); }
.am-add__icon { position: relative; width: 10px; height: 10px; }
.am-add__icon::before,
.am-add__icon::after { content: ""; position: absolute; left: 0; right: 0; top: 4.5px; height: 1.5px; background: currentColor; transition: transform .25s var(--ease); }
.am-add__icon::after { transform: rotate(90deg); }
.am-add[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.am-add[aria-pressed="true"] .am-add__icon::before { transform: translate(-1px, 1px) rotate(45deg) scaleX(.55); }
.am-add[aria-pressed="true"] .am-add__icon::after { transform: translate(2px, 0) rotate(-45deg); }

/* ------------------------------------------------------------------- tray */
.am-tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-top: 1px solid var(--line-2);
  box-shadow: 0 -18px 40px -30px rgba(16, 15, 13, .45);
}
.am-tray[hidden] { display: none; }
.am-tray__inner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding-block: .75rem; }
.am-tray__label { margin: 0; font-family: var(--mono); font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.am-tray__label b { color: var(--ink); font-weight: 600; }
.am-tray__label[data-note]::after { content: " · " attr(data-note); color: #a3431f; }
.am-tray__list { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; flex: 1 1 18rem; min-width: 0; }
.am-tray__list li { display: inline-flex; align-items: center; gap: .25rem; margin: 0; padding: .3rem .35rem .3rem .75rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); font-size: .8438rem; }
.am-tray__x { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer; }
.am-tray__x:hover { background: var(--paper-3); color: var(--ink); }
.am-tray__actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.am-tray__clear { min-height: 40px; padding: 0 .8rem; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .875rem; cursor: pointer; }
.am-tray__clear:hover { color: var(--ink); }
.am-tray [aria-disabled="true"] { opacity: .45; }
.am-tray.is-full { animation: am-nudge .4s var(--ease); }
body.am-tray-open { padding-bottom: 76px; }
body.am-tray-open .to-top { bottom: 88px; }
@keyframes am-nudge { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ----------------------------------------------------------------- method */
.am-method__grid { display: grid; gap: 2.5rem; }
.am-weights { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.am-weights li { display: grid; grid-template-columns: 3.5rem 1fr; gap: .4rem 1rem; margin: 0; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.am-weights__pct { grid-row: span 2; font-family: var(--serif); font-size: 2rem; line-height: 1; letter-spacing: -.02em; }
.am-weights__bar { display: block; height: 4px; margin-top: .55rem; background: var(--paper-3); border-radius: 99px; overflow: hidden; }
.am-weights__bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.am-weights__text { color: var(--muted); font-size: .9063rem; }
.am-weights__text b { color: var(--ink); font-weight: 560; }
.am-method__notes p { color: var(--ink-2); font-size: .9688rem; max-width: 60ch; }
.am-method__notes a { color: var(--accent-ink); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---------------------------------------------------------- detail layout */
.am-detail { display: grid; gap: clamp(2.5rem, 6vw, 4rem); padding-top: clamp(2.5rem, 6vw, 4rem); }
.am-detail__main { min-width: 0; }
.am-detail__side { display: grid; gap: 1rem; align-content: start; min-width: 0; }

.am-block { padding-bottom: clamp(2.5rem, 6vw, 3.5rem); margin-bottom: clamp(2.5rem, 6vw, 3.5rem); border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--bar) + 1rem); }
.am-block:last-child { border-bottom: 0; margin-bottom: 0; }
.am-block__head { margin-bottom: 1.5rem; }
.am-block__head h2 { margin: .7rem 0 0; font-size: clamp(1.8rem, 4.5vw, 2.5rem); }
.am-block__head p { margin: .6rem 0 0; color: var(--muted); max-width: 56ch; font-size: .9375rem; }
.am-subhead { margin: 2rem 0 .75rem; font-family: var(--mono); font-size: .625rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.am-spec { margin: 0; border-top: 1px solid var(--line); }
.am-spec > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: .25rem 1.25rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.am-spec dt { color: var(--muted); font-size: .9063rem; }
.am-spec dd { margin: 0; color: var(--ink); font-weight: 520; font-size: .9375rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.am-spec dd a { color: var(--accent-ink); }
.am-spec__note { display: block; margin-top: .15rem; color: var(--muted); font-weight: 400; font-size: .8125rem; }

.am-costs,
.am-reported { width: 100%; border-collapse: collapse; font-size: .9063rem; }
.am-costs th small,
.am-reported th small,
.am-sxs th small,
.am-breakdown th small { display: block; margin-top: .15rem; color: var(--faint); font-family: var(--mono); font-size: .5938rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; }
.am-costs td { font-weight: 560; color: var(--ink); }
.am-reported td:nth-child(3) { color: var(--muted); font-size: .8125rem; }
.am-reported a { color: var(--accent-ink); white-space: nowrap; }

/* eci meter */
.am-eci { margin-bottom: 2rem; }
.am-eci__top { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.am-eci__top b { font-family: var(--serif); font-weight: 400; font-size: clamp(3.5rem, 10vw, 5rem); line-height: .8; letter-spacing: -.035em; }
.am-eci__top span { font-family: var(--mono); font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); line-height: 1.6; }
.am-meter { position: relative; height: 10px; background: var(--paper-3); border-radius: 99px; }
.am-meter__range { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 99px; }
.am-meter__dot { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--paper); }
.am-meter__median { position: absolute; top: -5px; bottom: -5px; width: 1px; background: var(--muted); }
.am-meter__scale { display: flex; justify-content: space-between; margin-top: .55rem; font-family: var(--mono); font-size: .5938rem; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }

/* bars */
.am-bars { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.am-bars li { display: grid; grid-template-columns: minmax(0, 1fr) 4rem; gap: .5rem 1rem; align-items: center; margin: 0; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.am-bars__name { font-weight: 520; font-size: .9375rem; }
.am-bars__name small { display: block; margin-top: .1rem; color: var(--muted); font-weight: 400; font-size: .8125rem; }
.am-bars__track { grid-column: 1 / -1; grid-row: 2; height: 6px; background: var(--paper-3); border-radius: 99px; overflow: hidden; }
.am-bars__track i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.am-bars__val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* side cards */
.am-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; }
.am-card__title { margin: 0 0 1rem; font-size: 1.6rem; }
.am-card__sub { margin: 1.5rem 0 .4rem; font-family: var(--mono); font-size: .625rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.am-card .am-form .btn { min-height: 48px; }

.am-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.am-links li { margin: 0; border-bottom: 1px solid var(--line); }
.am-links a { position: relative; display: grid; gap: .1rem; padding: .75rem 1.5rem .75rem 0; transition: color .2s var(--ease); }
.am-links a::after { content: "\2197"; position: absolute; right: .1rem; top: 50%; transform: translateY(-50%); font-size: .875rem; color: var(--faint); transition: transform .25s var(--ease), color .2s var(--ease); }
.am-links a:hover { color: var(--accent); }
.am-links a:hover::after { color: var(--accent); transform: translate(2px, -60%); }
.am-links span { font-weight: 520; font-size: .9375rem; }
.am-links small { font-family: var(--mono); font-size: .5938rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.am-links--grid { display: grid; gap: 0 2rem; }

/* ------------------------------------------------------------ comparisons */
.am-cols { list-style: none; display: grid; gap: .75rem; margin: clamp(2rem, 5vw, 3rem) 0 0; padding: 0; counter-reset: col; }
.am-col {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 1.35rem;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.am-col--pick { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), 0 28px 60px -42px rgba(16, 15, 13, .5); }
.am-col__badge {
  position: absolute;
  top: -.7rem;
  left: 1.35rem;
  padding: .3rem .65rem;
  font-family: var(--mono);
  font-size: .5938rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
}
.am-col__lab { margin: 0 0 .5rem; font-family: var(--mono); font-size: .625rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.am-col__name { margin: 0 0 .3rem; font-size: clamp(1.6rem, 3.6vw, 2.1rem); line-height: 1.05; }
.am-col__name a:hover { color: var(--accent); }
.am-col__meta { margin: 0 0 1.25rem; color: var(--muted); font-size: .8438rem; }
.am-col__score { display: flex; align-items: baseline; gap: .3rem; }
.am-col__score b { font-family: var(--serif); font-weight: 400; font-size: 3.5rem; line-height: .9; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.am-col__score span { font-family: var(--mono); font-size: .6875rem; color: var(--muted); }
.am-col .am-bar { margin: .7rem 0 1.25rem; }
.am-col--pick .am-bar i { background: var(--accent); }
.am-col__facts { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 1.25rem; padding: .9rem 0 0; border-top: 1px solid var(--line); }
.am-col__facts li { margin: 0; min-width: 0; padding-right: .5rem; }
.am-col__facts li + li { padding-left: .6rem; border-left: 1px solid var(--line); }
.am-col__facts span { display: block; font-family: var(--mono); font-size: .5625rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.am-col__facts b { display: block; margin-top: .3rem; font-size: .8438rem; font-weight: 560; font-variant-numeric: tabular-nums; white-space: nowrap; }
.am-col__facts { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr) minmax(0, .8fr); }
.am-col__links { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: auto; }
.am-col__links .tlink { min-height: 40px; padding-bottom: .3rem; font-size: .875rem; }
.am-col__remove { color: var(--muted); font-size: .8125rem; border-bottom: 1px solid transparent; }
.am-col__remove:hover { color: #a3431f; border-bottom-color: currentColor; }
.am-col--add { justify-content: flex-start; background: transparent; border-style: dashed; border-color: var(--line-2); }
.am-col__hint { margin: 0 0 1.25rem; color: var(--muted); font-size: .9063rem; }

.am-bar { display: block; height: 6px; background: var(--paper-3); border-radius: 99px; overflow: hidden; }
.am-bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .4s var(--ease); }
.am-bar--sm { height: 4px; margin-bottom: .4rem; }

/* verdict */
.am-verdict .section-head p { color: var(--ink-2); max-width: 70ch; }
.am-verdict__grid { display: grid; gap: 2rem; }
.am-bestfor { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.am-bestfor li { display: grid; gap: .2rem; margin: 0; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.am-bestfor__label { font-family: var(--mono); font-size: .625rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.am-bestfor b { font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.15; letter-spacing: -.01em; }
.am-bestfor small { color: var(--muted); font-size: .8125rem; line-height: 1.5; }

.am-breakdown { width: 100%; border-collapse: collapse; font-size: .9063rem; }
.am-breakdown caption { padding: 0 0 .75rem; text-align: left; font-family: var(--mono); font-size: .625rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.am-breakdown thead th { border-bottom-color: var(--ink); }
.am-breakdown td { min-width: 7rem; vertical-align: bottom; }
.am-breakdown td b { font-variant-numeric: tabular-nums; font-weight: 560; color: var(--ink); }
.am-breakdown td.is-best .am-bar i { background: var(--accent); }
.am-breakdown td.is-best b { color: var(--accent-ink); }
.am-breakdown__total th,
.am-breakdown__total td { border-bottom: 0; padding-top: 1rem; }
.am-breakdown__total td b { font-family: var(--serif); font-weight: 400; font-size: 1.75rem; }
.am-breakdown__total td span { margin-left: .2rem; font-family: var(--mono); font-size: .625rem; color: var(--muted); }

/* side by side */
.am-sxs { width: 100%; min-width: 34rem; border-collapse: separate; border-spacing: 0; font-size: .9063rem; }
.am-sxs--3 { min-width: 44rem; }
.am-sxs thead th { position: relative; padding: 0 1rem 1rem 0; border-bottom: 1px solid var(--ink); vertical-align: bottom; text-transform: none; letter-spacing: -.01em; font-family: var(--serif); font-size: 1.35rem; font-weight: 400; color: var(--ink); white-space: normal; }
.am-sxs thead th a:hover { color: var(--accent); }
.am-sxs thead th small { font-family: var(--mono); }
.am-sxs tbody th { width: 28%; padding: .8rem 1rem .8rem 0; color: var(--ink-2); font-weight: 500; }
.am-sxs td { padding: .8rem 1rem .8rem 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.am-sxs td small { display: block; margin-top: .1rem; color: var(--muted); font-size: .75rem; }
.am-sxs td.is-best { color: var(--accent-ink); font-weight: 600; }
.am-sxs td.is-best::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: .45rem; vertical-align: .12em; border-radius: 50%; background: var(--accent); }
.am-sxs__group th { padding: 1.6rem 0 .6rem; border-bottom: 1px solid var(--line-2); font-family: var(--mono); font-size: .625rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); background: transparent; }
.am-sxs tbody tr:hover th,
.am-sxs tbody tr:hover td { background: color-mix(in srgb, var(--paper-2) 70%, transparent); }
.am-sxs tbody tr.am-sxs__group:hover th { background: transparent; }
.am-yes { font-weight: 560; }
.am-yes::before { content: "\2713"; margin-right: .35rem; color: var(--accent); font-weight: 700; }
.am-no { color: var(--faint); }

/* calculator */
.am-calc__grid { display: grid; gap: 2rem; }
.am-calc__inputs { display: grid; gap: 1rem; align-content: start; }
.am-calc__presets { display: flex; flex-wrap: wrap; gap: .45rem; }
.am-chip {
  min-height: 36px;
  padding: .35rem .85rem;
  font: inherit;
  font-size: .8125rem;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
}
.am-chip:hover { border-color: var(--ink); color: var(--ink); }
.am-calc__out { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.am-calc__out li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem 1rem; align-items: baseline; margin: 0; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.am-calc__name { font-weight: 520; }
.am-calc__out b { font-family: var(--serif); font-weight: 400; font-size: 2rem; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.am-calc__out .am-bar { grid-column: 1 / -1; }

/* related */
.am-related__list { list-style: none; display: grid; gap: 0 2rem; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.am-related__list li { margin: 0; border-bottom: 1px solid var(--line); }
.am-related__list a { position: relative; display: grid; gap: .15rem; padding: 1rem 1.75rem 1rem 0; }
.am-related__list a::after { content: "\2197"; position: absolute; right: .1rem; top: 1.1rem; color: var(--faint); transition: transform .25s var(--ease), color .2s var(--ease); }
.am-related__list a:hover { color: var(--accent); }
.am-related__list a:hover::after { color: var(--accent); transform: translate(2px, -2px); }
.am-related__list span { font-family: var(--serif); font-size: 1.3rem; line-height: 1.15; letter-spacing: -.01em; }
.am-related__list em { color: var(--faint); font-size: .85em; }
.am-related__list small { font-family: var(--mono); font-size: .5938rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* sources */
.am-sources { margin-top: clamp(3rem, 7vw, 5rem); padding-top: 1.25rem; border-top: 1px solid var(--line); }
.am-sources p { margin: 0; max-width: 90ch; color: var(--muted); font-size: .8125rem; line-height: 1.65; }
.am-sources a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.am-sources a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------ phones only */
@media (max-width: 759px) {
  .am-table { font-size: .875rem; }
  .am-table thead { display: none; }
  .am-table,
  .am-table tbody { display: block; }
  .am-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .65rem .75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
  }
  .am-table tbody tr[hidden] { display: none; }
  .am-table tbody th,
  .am-table tbody td { display: block; padding: 0; border: 0; text-align: left; white-space: normal; }
  .am-table tbody th { grid-column: 1 / -1; padding-right: 7rem; }
  .am-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .2rem;
    font-family: var(--mono);
    font-size: .5625rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .am-table td.am-ins { grid-column: span 2; }
  .am .am-table tbody td.num { text-align: left; }
  .am-table td.am-add-cell { position: absolute; top: .9rem; right: 0; width: auto; }
  .am-table td.am-add-cell::before { display: none; }
  .am-sxs tbody th { position: sticky; left: 0; z-index: 1; background: var(--paper); min-width: 9rem; }
  .am-sxs thead th:first-child { position: sticky; left: 0; z-index: 2; background: var(--paper); }
  .am-sxs__group th { position: static; }
  .am-tray__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem .75rem; padding-block: .6rem; }
  .am-tray__label { grid-column: 1 / -1; }
  .am-tray__list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: none; }
  .am-tray__list::-webkit-scrollbar { display: none; }
  .am-tray__list li { flex: none; }
  .am-tray__actions { margin-left: 0; }
  .am-tray__clear { padding: 0 .4rem; }
  body.am-tray-open { padding-bottom: 104px; }
  body.am-tray-open .to-top { bottom: 116px; }
  .am-pair { min-height: 0; gap: 1.25rem; }
}

/* ---------------------------------------------------------------- 760px+ */
@media (min-width: 760px) {
  .am-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .am-stats li:nth-child(n) { padding-left: 1rem; border-left: 1px solid var(--line); }
  .am-stats li:first-child { padding-left: 0; border-left: 0; }
  .am-figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .am-figures > div:nth-child(n) { padding-left: 1rem; border-left: 1px solid var(--line); }
  .am-figures > div:first-child { padding-left: 0; border-left: 0; }
  .am-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-filters { grid-template-columns: minmax(14rem, 2fr) minmax(10rem, 1fr) minmax(10rem, 1fr); align-items: end; }
  .am-toggles { grid-column: 1 / -1; }
  .am-form--wide { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
  .am-form--wide .btn { width: auto; padding-inline: 1.75rem; }
  .am-cols--2,
  .am-cols--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-cols--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-links--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-related__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-calc__grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 3rem; }
  .am-spec > div { grid-template-columns: 13rem minmax(0, 1fr); }
  .am-method__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; }
}

/* --------------------------------------------------------------- 1100px+ */
@media (min-width: 1100px) {
  .am-pairs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .am-hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: end; }
  .am-hero--compare { grid-template-columns: 1fr; }
  .am--detail .am-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am--detail .am-figures > div:nth-child(n) { padding-left: 1rem; border-left: 1px solid var(--line); }
  .am--detail .am-figures > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .am-detail { grid-template-columns: minmax(0, 1fr) 21rem; gap: 4.5rem; }
  .am-detail__side > .am-card {
    position: sticky;
    top: calc(var(--bar) + 1.5rem);
    max-height: calc(100vh - var(--bar) - 3rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .am-cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .am-cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-cols--3.am-cols--add,
  .am-cols--3:has(.am-col--add) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr); }
  .am-verdict__grid { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 4rem; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  .am-tray.is-full { animation: none; }
  .am-pair:hover { transform: none; }
}

@media print {
  .am-tray, .am-builder, .am-filters, .am-add-cell, .am-form, .am-calc, .am-col__links { display: none !important; }
  .am-table tbody tr[hidden] { display: table-row !important; }
}

/* -------------------------------------------------------------- lab logos */
/* Monochrome lab logos from assets/img/labs/, or the lab initial in a disc. */
.am-logo { display: inline-block; flex: none; width: 1.125rem; height: 1.125rem; object-fit: contain; vertical-align: -.2em; }
.am-logo--text {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font: 600 .5625rem/1 var(--mono);
  letter-spacing: 0;
  text-transform: uppercase;
}
.am-logo--lg { width: 1.5rem; height: 1.5rem; }
.am-logo--lg.am-logo--text { font-size: .6875rem; }

/* directory table: logo beside the name and lab */
.am-model { display: inline-flex; align-items: center; gap: .7rem; }
.am-model__text { display: inline-grid; gap: .15rem; min-width: 0; }
.am-model__logo { width: 1.5rem; height: 1.5rem; }

/* row of logo chips: pair and three-way cards, comparison hero, related list */
.am-pair__logos { display: flex; align-items: center; gap: .35rem; font-size: 1rem; line-height: 1; }
.am-pair__logos .am-logo {
  box-sizing: border-box;
  width: 2rem;
  height: 2rem;
  padding: .35rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 50%;
}
.am-pair__logos .am-logo--text { padding: 0; background: var(--ink); border-color: var(--ink); font-size: .6875rem; }
.am-hero__logos { margin-top: 1.25rem; }
.am-hero__logos .am-logo { width: 2.75rem; height: 2.75rem; padding: .5rem; }
.am-hero--compare .am-hero__logos + h1 { margin-top: .9rem; }
.am-related__list .am-pair__logos { margin-bottom: .4rem; }
.am-related__list .am-pair__logos .am-logo { width: 1.75rem; height: 1.75rem; padding: .3rem; }

/* model detail hero, comparison columns, link lists, side-by-side and calculator */
.am-hero__lab { display: inline-flex; align-items: center; gap: .6rem; }
.am-col__lab { display: flex; align-items: center; gap: .55rem; }
.am-links span { display: inline-flex; align-items: center; gap: .55rem; }
.am-sxs thead .am-sxs__logo { display: block; width: 1.75rem; height: 1.75rem; margin-bottom: .6rem; }
.am-sxs thead .am-sxs__logo.am-logo--text { display: grid; }
.am-calc__name { display: inline-flex; align-items: center; gap: .55rem; }
