.router-theme,
.router-page {
  --router-bg: #080d17;
  --router-panel: #101927;
  --router-panel-soft: #162133;
  --router-ink: #f1f5ff;
  --router-muted: #a6b4cb;
  --router-line: rgba(162, 191, 230, 0.18);
  --router-blue: #88abff;
  --router-accent: #4b82ff;
  --router-glass: rgba(15, 24, 40, 0.92);
  --router-green: #80dbc0;
  --router-max: 1280px;
  --router-radius: 20px;
  --router-header-height: 104px;
  /* The metric "rainbow" — F1 / latency / $ / Reviewer Score cells on the
     benchmarks pages AND the ionwarp.com home + reviewer modules read these
     tokens; a tone class (metric-good / metric-mid / metric-low / metric-neutral)
     arrives on the SERVED row and this is the one place it becomes a colour. */
  --metric-good: #90ddbb;
  --metric-good-bg: #162c2b;
  --metric-mid: #efcf7b;
  --metric-mid-bg: #302b22;
  --metric-low: #f29b9e;
  --metric-low-bg: #30232c;
  --metric-neutral: var(--router-muted);
  color: var(--router-ink);
  font-family: var(--font-geist-sans), Arial, sans-serif;
  color-scheme: dark;
}
.router-v3 {
  --metric-good: #0f7a4f;
  --metric-good-bg: color-mix(in srgb, #1f9d6a 12%, transparent);
  --metric-mid: #8a6400;
  --metric-mid-bg: color-mix(in srgb, #d9a400 14%, transparent);
  --metric-low: #b3313b;
  --metric-low-bg: color-mix(in srgb, #e04c57 12%, transparent);
}
/* Both renderers' metric cells (`.metric-cell` on /benchmarks,
   `.router-metric-cell` on the marketing site). Specificity 0,3,0 so a
   per-surface button reset (0,2,0) can never strip the colour again — that is
   how the home table lost its rainbow (round 3, 2026-09-11). */
:is(.metric-cell, .router-metric-cell).metric-good.metric-good {
  color: var(--metric-good);
  background: var(--metric-good-bg);
}
:is(.metric-cell, .router-metric-cell).metric-mid.metric-mid {
  color: var(--metric-mid);
  background: var(--metric-mid-bg);
}
:is(.metric-cell, .router-metric-cell).metric-low.metric-low {
  color: var(--metric-low);
  background: var(--metric-low-bg);
}
:is(.metric-cell, .router-metric-cell).metric-neutral.metric-neutral {
  color: var(--metric-neutral);
  background: transparent;
}

.router-container {
  width: min(var(--router-max), calc(100% - 96px));
  margin-inline: auto;
}

.router-header {
  position: relative;
  z-index: 5;
  width: min(1540px, calc(100% - 96px));
  margin: auto;
  height: var(--router-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--router-line);
}

.router-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -1px;
  white-space: nowrap;
}

.router-brand img {
  object-fit: contain;
  transform: rotate(-9deg);
}

.router-brand > span {
  font-size: 12px;
  letter-spacing: 0;
  background: var(--router-panel);
  color: var(--router-muted);
  padding: 5px 9px;
  border: 1px solid var(--router-line);
  border-radius: 5px;
  margin-left: 2px;
}

.router-header nav {
  display: flex;
  gap: 34px;
  font-size: 14px;
  color: var(--router-muted);
}

.router-header nav a {
  min-width: 44px;
  padding: 14px 0;
  text-align: center;
}

.router-header a:hover {
  color: var(--router-blue);
}

.router-nav-cta {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 19px;
  border: 1px solid var(--router-line);
  border-radius: 30px;
  font-size: 14px;
  background: var(--router-glass);
}

.router-footer {
  border-top: 1px solid var(--router-line);
  display: flex;
  align-items: center;
  gap: 30px;
  padding-block: 30px;
}

.router-footer > .router-brand {
  min-height: 44px;
  font-size: 22px;
}

.router-footer > div {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  font-size: 12px;
  color: var(--router-muted);
}

.router-footer > div a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
}

@media (max-width: 1150px) {
  .router-header {
    width: calc(100% - 64px);
  }

  .router-container {
    width: calc(100% - 64px);
  }
}

@media (max-width: 900px) {
  .router-header nav {
    gap: 20px;
  }

  .router-brand {
    font-size: 22px;
  }

  .router-brand > span {
    display: none;
  }
}

@media (max-width: 760px) {
  .router-theme,
  .router-page {
    --router-header-height: 112px;
  }
  .router-header {
    width: calc(100% - 40px);
    height: auto;
    min-height: var(--router-header-height);
    display: grid;
    grid-template-columns: 1fr auto;
    padding-top: 12px;
  }

  .router-header nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    font-size: 13px;
  }

  .router-header nav a {
    min-height: 44px;
    padding: 12px 0;
  }

  .router-header .router-nav-cta {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 600px) {
  .router-brand {
    font-size: 23px;
  }

  .router-brand img {
    width: 36px;
  }

  .router-nav-cta {
    font-size: 12px;
    padding: 10px 13px;
    min-height: 44px;
  }

  .router-container {
    width: calc(100% - 36px);
  }

  .router-footer {
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 24px;
  }

  .router-footer > div {
    margin: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 25px;
    font-size: 12px;
  }
}

.router-header a,
.router-footer a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}
.router-header a:focus-visible,
.router-footer a:focus-visible {
  outline: 2px solid var(--router-blue);
  outline-offset: 4px;
}
.router-header nav a[aria-current="page"] {
  color: var(--router-blue);
}
.router-footer {
  padding-block: 32px;
}

:is(.router-modules, .router-subpage) .iw-cta {
  background: var(--router-ink);
  color: var(--router-bg);
  border: 0;
  border-radius: 30px;
  padding: 15px 23px;
  gap: 15px;
  min-height: 50px;
  font-size: 13px;
}
:is(.router-modules, .router-subpage) .iw-cta-orb {
  background: none;
  color: inherit;
  box-shadow: none;
  width: 18px;
  height: 18px;
  border: 0;
}

.router-skip {
  position: fixed;
  top: 12px;
  left: 12px;
  transform: translateY(-200%);
  z-index: 100;
  background: var(--router-panel);
  padding: 14px 20px;
  border: 1px solid var(--router-blue);
  border-radius: 8px;
}
.router-skip:focus {
  transform: none;
}

/* ── The ONE benchmark table (packages/marketing-ui/src/benchmark-table.ts) ──
   Rendered by the /benchmarks/<family> page and the ionwarp.com home and
   reviewer modules from the same module, so it is styled ONCE, here. Until
   2026-09-12 each surface carried its own copy of these rules under its own
   class names (`.router-table` / `.model-table`, `.router-explain` /
   `.explain`) and they drifted. */
.sr-only,
.router-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.benchmark-table :is(th, td) {
  padding: 4px 12px;
  border-top: 1px solid var(--router-line);
  vertical-align: middle;
  transition: background-color 0.15s;
}
.benchmark-table :is(th, td):first-child {
  padding-left: 22px;
}
.benchmark-table :is(th, td):last-child {
  padding-right: 18px;
}
.benchmark-table :is(th, td).num {
  text-align: right;
}
.benchmark-table th {
  font-weight: 400;
}
.benchmark-table thead {
  background: var(--router-panel-soft);
  color: var(--router-muted);
  font-size: 11px;
}
.benchmark-table thead th {
  padding-top: 0;
  padding-bottom: 0;
  white-space: nowrap;
}
.benchmark-table thead th.num .sort-button {
  margin-left: auto;
}
.benchmark-table .sort-button,
.benchmark-table .column-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.benchmark-table .column-heading {
  cursor: default;
}
.benchmark-table .sort-button span:last-child {
  opacity: 0.55;
}
.benchmark-table .col-short {
  display: none;
}
.benchmark-table th[aria-sort="ascending"],
.benchmark-table th[aria-sort="descending"] {
  color: var(--router-ink);
}
.benchmark-table th[aria-sort="ascending"] .sort-button span:last-child,
.benchmark-table th[aria-sort="descending"] .sort-button span:last-child {
  opacity: 1;
}
.benchmark-table tbody :is(th, td):hover,
.benchmark-table tbody :is(th, td):focus-within {
  background: color-mix(in srgb, var(--router-accent) 9%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .benchmark-table :is(th, td) {
    transition: none;
  }
}
.benchmark-table .empty {
  padding: 18px 22px;
  color: var(--router-muted);
}
/* The name cell: served brand mark + served label (the Skills rows on the
   benchmarks page reuse the mark, the identity and the metric pill). */
.reviewer-name {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  color: var(--router-ink);
  font-weight: 450;
  text-decoration: none;
}
a.reviewer-name:hover .model-label {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.model-mark {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid var(--router-line);
  border-radius: 8px;
  background: var(--router-panel);
  font-size: 14px;
}
.model-mark img {
  width: 24px;
  height: 22px;
  object-fit: contain;
}
.benchmark-table .model-mark {
  width: 32px;
  height: 32px;
}
.benchmark-table .model-mark img {
  height: 24px;
}
.model-mark img.brand-mono {
  filter: brightness(0) invert(1);
}
.router-v3 .model-mark img.brand-mono {
  filter: none;
}
.model-identity {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.model-identity small {
  font-size: 10px;
  color: var(--router-muted);
}
/* Metric cells: a button reset only — never a colour or background; those are
   the served tone's (above). The pill keeps the numbers scannable. */
.metric-cell {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--router-muted);
  cursor: pointer;
}
.metric-cell:focus-visible,
.tier-chip:focus-visible,
.benchmark-table .sort-button:focus-visible {
  outline: 2px solid var(--router-blue);
  outline-offset: 2px;
}
.benchmark-table .metric-cell {
  min-width: 44px;
  min-height: 40px;
  padding: 6px 9px;
}
.coverage-link {
  font-size: 12px;
  font-weight: 400;
}
/* A row not measured on the whole cohort says so in its PRs cell (served `full_cohort`). */
.coverage-partial {
  font-size: 10px;
  color: var(--router-muted, inherit);
  white-space: nowrap;
}
/* Tiers: pro = the pin IonWarp runs today (product colour), max = the best F1 (gold). */
.benchmark-table .tier-row-pro {
  background: color-mix(in srgb, var(--router-accent) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--router-accent);
}
.benchmark-table .tier-row-max {
  background: color-mix(in srgb, #f3d37a 8%, transparent);
  box-shadow: inset 3px 0 0 #f3d37a;
}
.benchmark-table .routing-cell {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}
.benchmark-table :is(th, td):nth-last-child(2) {
  width: 1%;
}
.tier-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid;
  background: transparent;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.tier-pro {
  color: color-mix(in srgb, var(--router-blue) 90%, var(--router-ink));
  border-color: color-mix(in srgb, var(--router-blue) 60%, transparent);
}
.tier-max {
  color: var(--metric-mid);
  border-color: color-mix(in srgb, var(--metric-mid) 60%, transparent);
}
.benchmark-table .route-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  border: 1px solid color-mix(in srgb, var(--router-green) 40%, transparent);
  background: color-mix(in srgb, var(--router-green) 12%, transparent);
  color: var(--router-green);
  border-radius: 20px;
  font: inherit;
  font-size: 10px;
  padding: 4px 8px;
  white-space: nowrap;
  cursor: pointer;
}
@media (max-width: 1150px) {
  .benchmark-table :is(th, td) {
    padding-inline: 8px;
  }
  .benchmark-table :is(th, td):first-child {
    padding-left: 16px;
  }
  .benchmark-table .metric-cell {
    padding-inline: 7px;
  }
}
@media (max-width: 750px) {
  /* Keep the primary comparison readable on a phone: name, F1, $/run, Score,
     tier; the full benchmark has every column. The name column stays put
     while the rest scrolls. */
  .benchmark-table :is(th, td):is(.col-latency, .col-prs) {
    display: none;
  }
  .benchmark-table :is(th, td):first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--router-glass);
    padding-left: 14px;
    min-width: 150px;
    max-width: 48vw;
  }
  /* The name wraps at its spaces only — `overflow-wrap: anywhere` broke
     "IonWarp Code · GLM" one letter per line in a 100 px column (staging
     pass, round 2). */
  .benchmark-table .model-identity {
    overflow-wrap: normal;
    word-break: normal;
    font-size: 12px;
    line-height: 1.3;
  }
  .benchmark-table .reviewer-name {
    gap: 8px;
  }
  /* The family page heading already names the family: at phone width the row
     keeps the model only, so a row stays two lines (≤ 56 px). */
  .benchmark-table .model-family {
    display: none;
  }
  .benchmark-table .model-mark {
    width: 26px;
    height: 26px;
  }
  .benchmark-table .model-mark img {
    width: 20px;
    height: 20px;
  }
  .benchmark-table :is(th, td).num {
    padding-inline: 3px;
  }
  .benchmark-table .metric-cell {
    padding-inline: 5px;
    font-size: 12px;
  }
  .benchmark-table :is(th, td):last-child {
    padding-inline: 4px;
  }
}
@media (max-width: 480px) {
  /* The narrowest phones keep the two figures the owner reads first — F1 and
     the Reviewer Score — beside the name and tier; $/run is one tap away in
     the Score popup and on the full benchmark. */
  .benchmark-table :is(th, td).col-cost {
    display: none;
  }
  .benchmark-table :is(th, td):first-child {
    min-width: 116px;
    max-width: 44vw;
  }
  .benchmark-table .col-full {
    display: none;
  }
  .benchmark-table .col-short {
    display: inline;
  }
  .benchmark-table .tier-chip {
    min-width: 0;
    padding-inline: 7px;
  }
  .benchmark-table .metric-cell {
    min-width: 40px;
  }
}

/* ── The ONE popover: a native popover anchored to the active trigger ── */
.explain {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 16px 18px;
  background: var(--router-glass);
  color: var(--router-ink);
  border: 1px solid var(--router-line);
  border-radius: 12px;
  box-shadow: 0 16px 50px #0008;
  z-index: 100;
  font-size: 12px;
  line-height: 1.6;
  overscroll-behavior: contain;
}
@supports (position-anchor: --explain) {
  .explain {
    position-anchor: --explain;
    position-area: bottom;
    position-try-fallbacks: flip-block, flip-inline;
    margin: 8px 0;
  }
}
.explain h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--router-ink);
}
.explain p {
  margin: 6px 0 0;
}
.explain code {
  font-size: 11px;
}
.explain .capture {
  display: block;
  width: 100%;
  height: auto;
  /* A tall review capture must never grow the panel over its own trigger. */
  max-height: 50vh;
  object-fit: contain;
  object-position: top;
  margin-top: 10px;
  border-radius: 8px;
}
.explain-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--router-muted);
}
.explain-stats b {
  display: block;
  color: var(--router-ink);
  font-size: 16px;
  margin-top: 3px;
}
.explain-value {
  color: var(--router-ink);
  font-size: 14px;
}
.explain-value small,
.explain-value span,
.explain-foot,
.explain-tier span {
  color: var(--router-muted);
  font-size: 11px;
}
.explain-prs {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-size: 11px;
}
.explain-prs li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 4px 0;
  border-top: 1px solid var(--router-line);
}
.explain-prs li span {
  color: var(--router-muted);
  white-space: nowrap;
}
.explain-prs a {
  color: var(--router-blue);
}
.explain-prs .explain-more {
  grid-template-columns: 1fr;
  color: var(--router-muted);
}
.explain-tier {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.explain-tier code {
  text-transform: uppercase;
  color: var(--router-ink);
}
.explain-tier span {
  margin-left: auto;
}
@media (max-width: 750px) {
  /* A phone reads the sentence and the figures; the PR list is capped by the
     renderer and the rest is one tap away on the full benchmark. */
  .explain {
    width: calc(100vw - 24px);
    max-height: 55vh;
    padding: 14px;
    font-size: 11px;
    line-height: 1.5;
  }
  .explain h3 {
    font-size: 13px;
  }
  .explain-stats b {
    font-size: 14px;
  }
}
