/* Agent Discoverability Benchmark page.
   Wide layout (overrides the demo's 44rem column), token-driven (light/dark),
   sticky table header via a bounded scroll container. */

/* ---- Wide layout: widen the chrome for this subpage only ---- */
body.bench header.site,
body.bench footer.site,
body.bench main {
  max-width: min(1500px, 100% - 2rem);
}
body.bench main { padding-top: 1rem; }

/* ---- Intro ---- */
.bench-intro { margin: .5rem 0 1rem; }
.bench-intro .eyebrow { font-family: var(--mono); font-size: .8rem; color: var(--accent); letter-spacing: .03em; }
.bench-intro h1 { margin: .2rem 0 .4rem; }
.bench-intro .lead { color: var(--muted); }

/* ---- Segment tabs ---- */
.bench-tabs { display: flex; gap: .5rem; margin: 1rem 0 1.25rem; flex-wrap: wrap; }
.bench-tabs a {
  padding: .5rem 1.1rem; border: 1px solid var(--border); border-radius: 999px;
  text-decoration: none; color: var(--fg); font-weight: 600; font-size: .92rem; line-height: 1;
}
.bench-tabs a:hover { border-color: var(--accent); }
.bench-tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Summary sentence ---- */
.bench-summary { font-size: 1.1rem; line-height: 1.5; margin: 0 0 1.25rem; }
.bench-summary strong { font-variant-numeric: tabular-nums; }
.bench-summary strong.bad { color: #dc2626; }
.bench-summary .muted { color: var(--muted); font-size: .95rem; }

/* ---- Filter bar (surface chips | domain + score), single line ---- */
.bench-filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem;
  padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--code-bg); margin: 0 0 1rem;
}
.fb-surfaces { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }
.fb-label, .fb-lookups::before {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.fb-lookups { display: flex; gap: .5rem; align-items: center; padding-left: 1rem; border-left: 1px solid var(--border); }
.fb-lookups input, .fb-lookups select {
  padding: .4rem .55rem; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .88rem; background: var(--bg); color: var(--fg);
}
.fb-lookups input { min-width: 13rem; }

.bench-filters { display: flex; gap: .35rem; flex-wrap: wrap; }
.bench-filters button {
  font-size: .76rem; padding: .3rem .55rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); color: var(--fg); cursor: pointer; line-height: 1;
}
.bench-filters button:hover { border-color: var(--accent); }
.bench-filters button.pass { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.bench-filters button.fail { border-color: #f59e0b; color: #b45309; font-weight: 600; }

/* ---- Table ---- */
.bench-table-wrap { max-height: 72vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
table.bench { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .9rem; }
table.bench th, table.bench td { padding: .5rem .7rem; border-bottom: 1px solid var(--border); text-align: left; }
table.bench thead th {
  position: sticky; top: 0; z-index: 3; background: var(--code-bg);
  cursor: pointer; user-select: none; font-size: .76rem; text-transform: uppercase; letter-spacing: .02em;
  white-space: nowrap; border-bottom: 2px solid var(--border);
}
table.bench thead th:hover { color: var(--accent); }
table.bench thead th .arrow { color: var(--accent); margin-left: .15rem; }
table.bench th.num, table.bench td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.bench th.check { text-align: center; font-size: .68rem; white-space: normal; min-width: 4.6rem; max-width: 5.4rem; line-height: 1.15; color: var(--muted); }
table.bench td.glyph { text-align: center; }

/* Pin the domain column (first) when scrolling horizontally */
table.bench th.c-domain, table.bench td.c-domain { position: sticky; left: 0; z-index: 2; background: var(--bg); min-width: 14rem; }
table.bench thead th.c-domain { z-index: 4; background: var(--code-bg); }

table.bench tbody tr:hover td { background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
table.bench tbody tr.row { cursor: pointer; }

.glyph .pass { color: var(--accent); font-weight: 700; }
.glyph .fail { color: var(--border); }
.glyph .err  { color: #f59e0b; }

.score-cell { display: inline-flex; align-items: center; gap: .5rem; justify-content: flex-end; }
.score-bar { display: inline-block; height: .45rem; width: 3rem; background: var(--code-bg); border-radius: 3px; overflow: hidden; }
.score-bar > i { display: block; height: 100%; background: var(--accent); }

.badge { font-size: .66rem; padding: .12rem .4rem; border-radius: 4px; background: var(--code-bg); color: var(--muted); margin-left: .4rem; white-space: nowrap; }
.badge.unreach { background: #fef2f2; color: #b91c1c; }

/* Row detail */
tr.detail td { background: var(--code-bg); white-space: normal; font-size: .82rem; color: var(--muted); }
tr.detail .dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .25rem 1rem; }
tr.detail code { font-size: .78rem; color: var(--code-fg); }

.bench-tablecount { color: var(--muted); font-size: .82rem; padding: .5rem .2rem; }

/* Legend */
.bench-legend { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; align-items: center; font-size: .8rem; color: var(--muted); margin: 0 0 .6rem; }
.bench-legend .g { font-weight: 700; margin-right: .15rem; }
.bench-legend .g.pass { color: var(--accent); }
.bench-legend .g.fail { color: var(--muted); }
.bench-legend .g.err { color: #f59e0b; }
.bench-legend .hint { margin-left: auto; font-style: italic; }

/* Visit icon (next to a domain, and next to a passing surface in the detail) */
a.visit { display: inline-flex; align-items: center; color: var(--muted); margin-left: .35rem; vertical-align: middle; }
a.visit:hover { color: var(--accent); }
.c-domain .dom { cursor: pointer; }

/* ---- Examples box ("what good looks like") ---- */
.bench-examples { margin-top: 2rem; }
.bench-examples h2 { margin-bottom: .2rem; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .9rem; margin-top: .75rem; }
.ex-card { border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1rem; background: var(--bg); }
.ex-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.ex-head a { font-weight: 600; }
.ex-score { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }
.ex-note { color: var(--muted); font-size: .82rem; margin: .3rem 0 .6rem; }
.ex-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.ex-chips .chip { font-size: .72rem; padding: .2rem .5rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--bg)); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---- Methodology (full width) ---- */
.bench-method { margin-top: 2.5rem; }
.bench-method table { border-collapse: collapse; font-size: .85rem; margin: .75rem 0; width: 100%; max-width: 60rem; }
.bench-method th, .bench-method td { padding: .4rem .6rem; border: 1px solid var(--border); text-align: left; }
.bench-method .muted { color: var(--muted); font-size: .85rem; }

@media (max-width: 700px) {
  table.bench th.c-domain, table.bench td.c-domain { position: static; min-width: 10rem; }
  .fb-lookups { padding-left: 0; border-left: 0; }
  .fb-lookups input { min-width: 9rem; }
}
