/* Shared benchmark product vocabulary.
   This sheet is public because /benchmark uses it directly; the owner console
   loads it before its private, owner-gated extension sheet. Every surface is
   scoped under .bench and every visual value comes from the site tokens in
   style.css. There is deliberately no contestant-specific selector. */

.page:has(.bench) {
  max-width: 1280px;
}

.bench {
  min-width: 0;
  color: var(--ink);
  font-size: 13.5px;
}

.bench code,
.bench-digest {
  overflow-wrap: anywhere;
}

/* ---- hierarchy ---- */

.bench-hero {
  margin: 0 0 26px;
}

.bench-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 20px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}

.bench-hero h1,
.bench-heading-row h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -1px;
  line-height: 1.12;
}

.bench-hero h1 {
  margin-bottom: 10px;
}

.bench-lead {
  max-width: 82ch;
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.bench-lead b,
.bench-note b {
  color: var(--ink);
  font-weight: 700;
}

.bench-owner,
.bench-section-meta {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

.bench-section,
.bench section {
  min-width: 0;
  scroll-margin-top: 18px;
}

.bench-section {
  margin: 0 0 34px;
}

.bench-section > h2,
.bench section > h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 32px 0 10px;
  padding: 0 0 7px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  letter-spacing: -0.3px;
}

.bench-section:first-of-type > h2,
.bench section:first-of-type > h2 {
  margin-top: 0;
}

.bench h3 {
  margin: 0 0 8px;
  font-size: 13.5px;
}

.bench-note {
  max-width: 88ch;
  margin: 8px 0 14px;
  color: var(--ink-soft);
  font-size: 12.75px;
  line-height: 1.6;
}

.bench-section > .bench-note {
  margin-top: 0;
}

/* ---- section navigation ---- */

.bench-toc {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 28px;
  padding: 0;
  border: 1px solid var(--line);
  font-size: 12.5px;
}

.bench-toc a {
  padding: 7px 11px;
  border-right: 1px solid var(--line);
  color: var(--ink-soft);
}

.bench-toc a:hover {
  background: var(--paper-dim);
  color: var(--ink);
}

.bench-toc a[aria-current="page"],
.bench-toc a[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
}

.bench-toc a:last-child {
  border-right: 0;
}

.bench-page-tabs {
  display: inline-flex;
  margin-bottom: 18px;
  font-weight: 700;
}

.bench-tabs-enabled [data-bench-panel] > h2 {
  margin-top: 0;
}

/* ---- cards, panels, and empty states ---- */

.bench-card,
.bench-panel {
  min-width: 0;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.bench-card {
  padding: 15px 16px;
}

.bench-card > :last-child {
  margin-bottom: 0;
}

.bench-panel {
  overflow: hidden;
}

.bench-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-dim);
  font-size: 12px;
}

.bench-panel-title {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.15px;
}

.bench-meta {
  color: var(--ink-faint);
  font-size: 12px;
}

.bench-meta b {
  color: var(--ink-soft);
  font-weight: 400;
}

.bench-empty {
  max-width: 88ch;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.bench-empty h3 {
  margin-bottom: 5px;
}

.bench-empty p {
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 12.75px;
  line-height: 1.6;
}

.bench-empty p:last-child {
  margin-bottom: 0;
}

.bench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 14px;
}

/* ---- tables ---- */

.bench-table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.bench-panel > .bench-table-wrap {
  max-height: 78vh;
}

.bench-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.bench-table caption {
  padding: 8px 10px;
  color: var(--ink-faint);
  font-size: 11.75px;
  line-height: 1.55;
  text-align: left;
}

.bench-table th,
.bench-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.bench-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom-color: var(--line);
  background: var(--paper);
  color: var(--ink-faint);
  font-size: 11.25px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bench-table tbody th {
  font-weight: 400;
}

.bench-table tbody tr:hover > * {
  background: var(--paper-dim);
}

.bench-table tbody tr:last-child > * {
  border-bottom: 0;
}

.bench-table .bench-num,
.bench-table th.bench-num,
.bench-table td.bench-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bench-table td.bench-wrap {
  min-width: 168px;
  max-width: 260px;
  white-space: normal;
}

.bench-table a {
  text-decoration: underline;
  text-decoration-color: var(--ink-faint);
  text-underline-offset: 3px;
}

.bench-table a:hover {
  color: var(--orange);
  text-decoration-color: var(--orange);
}

.bench-table--kv {
  width: auto;
  min-width: min(560px, 100%);
}

.bench-table--kv th {
  padding-right: 30px;
  color: var(--ink-soft);
}

/* A wide run table stays scannable while its detail columns move. */
.bench-panel .bench-table thead th:first-child {
  left: 0;
  z-index: 3;
  border-right: 1px solid var(--line);
}

.bench-panel .bench-table tbody th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.bench-panel .bench-table tbody tr:hover th:first-child {
  background: var(--paper-dim);
}

.bench-scroll-hint {
  display: none;
}

@media (max-width: 1240px) {
  .bench-scroll-hint {
    display: inline;
  }
}

/* ---- row content, numbers, and honest unknowns ---- */

.bench-id {
  display: block;
  font-weight: 700;
}

.bench-subline {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 11.25px;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.bench-digest {
  color: var(--ink-faint);
  font-size: 11.25px;
}

.bench-unknown,
.bench-pending {
  color: var(--ink-faint);
  font-style: normal;
  font-weight: 400;
}

.bench-unknown {
  border-bottom: 1px dotted var(--ink-faint);
}

.bench-provisional {
  color: var(--ink-soft);
}

.bench-num,
.bench-metric-value,
.bench-kv dd {
  font-variant-numeric: tabular-nums;
}

/* ---- one status vocabulary: square marker + text, never pill soup ---- */

.bench-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.bench-status::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: var(--ink-faint);
}

.bench-status.is-positive {
  color: var(--ink);
}

.bench-status.is-positive::before {
  background: var(--ink);
}

.bench-status.is-warning {
  color: var(--orange);
}

.bench-status.is-warning::before {
  background: var(--orange);
}

.bench-status.is-critical {
  color: var(--ink);
  font-weight: 700;
}

.bench-status.is-critical::before {
  border: 2px solid var(--orange);
  background: transparent;
}

.bench-status.is-neutral::before {
  background: var(--ink-faint);
}

.bench-status.is-unknown {
  color: var(--ink-faint);
}

.bench-status.is-unknown::before {
  border: 1px solid var(--ink-faint);
  background: transparent;
}

/* ---- true upstream cost vs retail simulation ---- */

.bench-simulation {
  border-left: 1px dashed var(--ink-faint);
  padding-left: 12px;
  color: var(--ink-soft);
}

.bench-table th.bench-simulation,
.bench-table td.bench-simulation {
  border-left: 1px dashed var(--ink-faint);
  padding-left: 12px;
  color: var(--ink-soft);
}

.bench-table thead th em {
  display: block;
  color: var(--ink-faint);
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
}

.bench-simulation-note {
  max-width: 88ch;
  margin: 12px 0 0;
  padding: 9px 11px;
  border: 1px dashed var(--ink-faint);
  border-radius: 4px;
  color: var(--ink-soft);
  font-size: 12.25px;
  line-height: 1.6;
}

.bench-simulation-note b {
  color: var(--ink);
}

/* ---- public evidence cards ---- */

.bench-fact h3 {
  color: var(--ink-faint);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bench-fact ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bench-fact li {
  position: relative;
  margin: 0 0 7px;
  padding-left: 15px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
}

.bench-fact li::before {
  content: "·";
  position: absolute;
  left: 3px;
  color: var(--ink-faint);
}

.bench-fact li:last-child,
.bench-fact p:last-child {
  margin-bottom: 0;
}

.bench-fact li b {
  color: var(--ink);
}

.bench-fact p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
}

.bench-fact ul + p {
  margin-top: 12px;
}

.bench-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.bench-tag-list li {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink-faint);
  font-size: 11.25px;
}

.bench-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}

.bench-downloads a {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
}

.bench-downloads a:hover {
  border-color: var(--ink-faint);
  background: var(--paper-dim);
}

.bench-downloads a span {
  color: var(--ink-faint);
  font-weight: 400;
}

/* ---- live connection state ---- */

.bench-connection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-dim);
  color: var(--ink-soft);
  font-size: 12.25px;
}

.bench-connection-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: var(--ink-faint);
}

.bench-connection[data-conn="live"] .bench-connection-dot {
  background: var(--ink);
}

.bench-connection[data-conn="connecting"] .bench-connection-dot,
.bench-connection[data-conn="stale"] .bench-connection-dot {
  background: var(--orange);
}

.bench-connection[data-conn="stale"] {
  border-color: var(--orange-dim);
  color: var(--ink);
}

.bench-connection-state {
  color: var(--ink);
  font-weight: 700;
}

.bench-connection-time {
  margin-left: auto;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.bench-connection button {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.bench-connection button:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
}

/* ---- focus and narrow screens ---- */

.bench :focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .page:has(.bench) {
    padding-left: 16px;
    padding-right: 16px;
  }

  .bench {
    font-size: 13px;
  }

  .bench-heading-row {
    display: block;
  }

  .bench-owner {
    display: block;
    margin-top: 5px;
  }

  .bench-section > h2,
  .bench section > h2 {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .bench-grid {
    grid-template-columns: 1fr;
  }

  .bench-card {
    padding: 13px;
  }

  .bench-connection-time {
    width: 100%;
    margin-left: 17px;
  }

  .bench-table {
    font-size: 12px;
  }
}

/* ---- charts ------------------------------------------------------------
   Inline SVG drawn by the page script from the same payload as the tables.
   Every fill/stroke goes through a token so night mode is automatic. Every
   harness wears the SAME mark hue: identity is the label, and the sponsor
   gets no color emphasis. Contrast was validated, not eyeballed: the orange
   mark is 3.48:1 on the light surface and 5.41:1 on the dark one (marks need
   3:1); the pass green uses a deep step in day because #22c55e is only
   2.28:1 on white. */

:root {
  --bench-mark: var(--orange);
  --bench-pass: #16833f;
  --bench-fail: #ef4444;
}
:root[data-theme="night"] {
  --bench-pass: #22c55e;
}

.bench-chart-wrap { margin: 6px 0 14px; overflow-x: auto; }
.bench-chart { display: block; width: 100%; max-width: 860px; height: auto; }
.bench-chart-h { fill: var(--ink-soft); font-size: 12px; font-weight: 700; }
.bench-chart-grid { stroke: var(--line); stroke-width: 1; }
.bench-chart-tick { fill: var(--ink-faint); font-size: 10.5px; }
.bench-chart-name { fill: var(--ink); font-size: 12.5px; font-weight: 600; }
.bench-chart-aff { fill: var(--ink-faint); font-size: 10px; }
.bench-chart-val { fill: var(--ink-soft); font-size: 11px; font-variant-numeric: tabular-nums; }
.bench-chart-unknown, .bench-chart-inf { fill: var(--ink-faint); font-size: 11px; font-style: italic; }
.bench-mark { fill: var(--bench-mark); }
.bench-dot { fill: var(--bench-mark); stroke: var(--paper); stroke-width: 2; }
.bench-whisker { stroke: var(--ink-soft); stroke-width: 1.4; }
.bench-crow { opacity: 0.92; }
.bench-crow:hover { opacity: 1; }
.bench-crow:hover .bench-mark { filter: brightness(0.92); }

/* ---- live run cards ---------------------------------------------------- */

.bench-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin: 4px 0 14px;
}
.bench-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--paper);
}
.bench-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.bench-card-head > b { font-size: 14px; }
.bench-card-harness { color: var(--ink-soft); font-size: 12.5px; }
.bench-rail { display: flex; gap: 2px; } /* the 2px gap is the mark spacer */
.bench-rail-seg {
  flex: 1;
  height: 8px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: var(--paper-dim);
}
.bench-rail-seg.is-done { background: var(--bench-mark); border-color: var(--bench-mark); }
.bench-rail-seg.is-active {
  background: var(--bench-mark);
  border-color: var(--bench-mark);
  animation: bench-pulse 1.3s ease-in-out infinite;
}
@keyframes bench-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
  .bench-rail-seg.is-active { animation: none; opacity: 0.8; }
}
.bench-card-phase { margin: 6px 0 8px; font-size: 12px; color: var(--ink-soft); }
.bench-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ---- terse method: short facts, full rules behind native disclosure ---- */

.bench-method-facts { list-style: none; margin: 0 0 18px; padding: 0; }
.bench-method-facts li {
  margin: 0 0 8px;
  padding-left: 16px;
  position: relative;
  font-size: 13.5px;
  color: var(--ink-soft);
  max-width: 74ch;
}
.bench-method-facts li::before {
  content: "▪";
  position: absolute;
  left: 0;
  color: var(--orange);
  font-size: 10px;
  top: 3px;
}
.bench-method-facts li b { color: var(--ink); }

details.bench-method { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; }
details.bench-method > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
  list-style: none;
  user-select: none;
}
details.bench-method > summary::-webkit-details-marker { display: none; }
details.bench-method > summary::before {
  content: "▸";
  margin-right: 9px;
  color: var(--ink-faint);
  display: inline-block;
  transition: transform 120ms ease;
}
details.bench-method[open] > summary::before { transform: rotate(90deg); color: var(--orange); }
details.bench-method > summary:hover { color: var(--orange); }
details.bench-method[open] { padding-bottom: 6px; }
details.bench-method .bench-grid { padding: 0 14px; }
details.bench-method .bench-note { padding: 0 14px; }
details.bench-method .bench-tag-list { padding: 0 14px 8px; }
