/* Engine Bench. Builds on /static/css/te.css: same tokens, nav, buttons, tiles and footer.
   White only. Nothing here reads data-theme, so the page looks the same whatever theme.js picks.
   Element ids, classes and data attributes used by /static/bench/js/main.js are kept as they were. */

.bench-page {
  --field-line: #86868b;            /* 3.6:1 on white, 3.3:1 on #f5f5f7: inputs stay visible */
  --focus: #0071e3;
  --focus-ring: 0 0 0 3px rgba(0, 113, 227, .28);
  --tile-pad: clamp(22px, 3vw, 32px);
}
html { scroll-behavior: smooth; }
.bench-page [hidden] { display: none !important; }
html:not(.js) #goal-loading, html:not(.js) .bench-loading-text { display: none; }
html:not(.js) .b-setup .agents, html:not(.js) .b-setup .keys, html:not(.js) .b-setup .limits, html:not(.js) .b-setup .go,
.bench-unavailable .b-setup .agents, .bench-unavailable .b-setup .keys, .bench-unavailable .b-setup .limits, .bench-unavailable .b-setup .go { display: none; }
.bench-fallback { padding: var(--tile-pad); border-radius: var(--radius); background: var(--bg-2); }

/* ---------- shared bits ---------- */
.sec-head { max-width: 780px; margin-bottom: clamp(36px, 5vw, 56px); }
.sec-head .lead { margin-top: 16px; }
.note { font-size: 14px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.note a, .open-note a, .faq a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.note a:hover, .open-note a:hover, .faq a:hover { text-decoration-thickness: 2px; }
.msg { flex-basis: 100%; margin-top: 12px; font-size: 15px; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.msg:empty { margin-top: 0; }
#start-msg { color: var(--accent-ink); font-weight: 550; }

.tag { flex: none; display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 650; line-height: 1; letter-spacing: 0; }
[data-agent="B"] .tag, #breakdown thead th:nth-child(3) .tag { background: var(--ink); }

.btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; }
.btn-soft { background: var(--bg-2); color: var(--ink); }
.btn-soft:hover { background: #e8e8ed; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: default; }
.btn-soft:disabled:hover { background: var(--bg-2); }
.btn-dark:disabled:hover { background: var(--accent-soft); }
.btn:disabled:active { transform: none; }

/* Text buttons the script also creates ("Check", "Forget my keys"). The ::after widens the tap area. */
.link { position: relative; display: inline; padding: 0; border: 0; background: none; font: inherit; color: var(--accent-ink); cursor: pointer; letter-spacing: inherit; }
.link::after { content: ""; position: absolute; inset: -11px 0; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- form controls ---------- */
.bench-page label { display: grid; gap: 8px; min-width: 0; font-size: 14px; font-weight: 550; line-height: 1.3; color: var(--ink); letter-spacing: -0.008em; }
.bench-page select,
.bench-page input:not([type="checkbox"]):not([type="file"]),
.bench-page textarea {
  width: 100%; min-width: 0; min-height: 48px; margin: 0; padding: 0 14px;
  font: 400 17px/1.3 var(--font); letter-spacing: -0.012em; color: var(--ink);
  background-color: #fff; border: 1px solid var(--field-line); border-radius: 12px;
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.bench-page input::placeholder, .bench-page textarea::placeholder { color: var(--ink-2); opacity: 1; }
.bench-page select {
  padding-right: 42px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231d1d1f' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
}
.bench-page textarea { min-height: 176px; padding: 12px 14px; font-size: 16px; line-height: 1.5; resize: vertical; }
.bench-page select:focus, .bench-page input:not([type="checkbox"]):not([type="file"]):focus, .bench-page textarea:focus { border-color: var(--focus); box-shadow: var(--focus-ring); }
/* An opaque keyboard outline remains distinct from the soft pointer-focus halo. */
.bench-page select:focus-visible, .bench-page input:not([type="checkbox"]):not([type="file"]):focus-visible, .bench-page textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.bench-page input[type="checkbox"] { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.bench-page input:disabled { opacity: .5; cursor: default; }

/* ---------- hero ---------- */
.b-hero { padding: calc(var(--nav-h) + clamp(40px, 7vw, 88px)) 0 clamp(64px, 8vw, 104px); background: #fff; }
.b-hero-grid { display: grid; gap: clamp(44px, 6vw, 64px); align-items: center; }
.b-hero-copy { min-width: 0; }
.b-hero-title { font-size: clamp(44px, 13.2vw, 76px); line-height: 1.02; letter-spacing: -0.047em; font-weight: 650; }
.b-hero .lead { margin-top: 22px; max-width: 34em; font-size: clamp(18px, 1.7vw, 21px); line-height: 1.48; }
.b-hero-cta { margin-top: 32px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 12px 28px; margin-top: 34px; }
.facts span { position: relative; padding-left: 26px; font-size: 15.5px; line-height: 1.4; color: var(--ink); }
.facts span::before { content: ""; position: absolute; left: 2px; top: .38em; width: 11px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

.goal { margin: 0; min-width: 0; }
.goal-frame { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); background: var(--bg-2); overflow: hidden; isolation: isolate; }
/* The viewer turns on drag. pan-y keeps a vertical swipe scrolling the page on touch screens. */
.goal-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y !important; }
.goal-frame canvas:active { cursor: grabbing; }
.loading { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; font-size: 15px; color: var(--ink-2); pointer-events: none; }
.loading span { min-width: 3.2em; font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); text-align: left; }
.goal figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 16px; padding-inline: 4px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.goal figcaption b { color: var(--ink); font-weight: 600; }

/* ---------- set up ---------- */
.b-setup { padding: clamp(72px, 10vw, 136px) 0 clamp(80px, 10vw, 136px); }
.agents { display: grid; gap: 12px; }
.agent-card { min-width: 0; margin: 0; padding: clamp(22px, 2.3vw, 30px); border: 0; border-radius: var(--radius); background: var(--bg-2); display: grid; gap: 16px; align-content: start; }
.agent-card legend { float: left; width: 100%; padding: 0; margin: 0 0 4px; display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 650; letter-spacing: -0.026em; line-height: 1.2; }
.agent-card legend + * { clear: both; }
.vs { justify-self: center; align-self: center; font-size: 13px; font-weight: 650; letter-spacing: .06em; color: var(--ink-2); padding: 2px 0; }
.model-note { margin-top: -8px; min-height: 1.45em; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); overflow-wrap: anywhere; }
.model-note:empty { display: none; }

.price summary { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: -4px 0; cursor: pointer; list-style: none; font-size: 15px; font-weight: 600; color: var(--ink); border-radius: 10px; }
.price summary::-webkit-details-marker { display: none; }
.price summary::before {
  content: ""; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(var(--ink), var(--ink)) center / 10px 1.7px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 1.7px 10px no-repeat, #fff;
}
.price[open] summary::before { background: linear-gradient(var(--ink), var(--ink)) center / 10px 1.7px no-repeat, #fff; }
.price summary span { min-width: 0; font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.price-grid label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.bench-page .price-grid input { min-height: 44px; padding: 0 12px; font-size: 16px; font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.price .note { margin-top: 12px; font-size: 13px; }

.keys { margin-top: 16px; padding: var(--tile-pad); border-radius: var(--radius); background: var(--bg-2); }
.keys h3 { font-size: 22px; letter-spacing: -0.026em; line-height: 1.2; }
#one-key { margin-top: 10px; color: var(--ink); }
.key-row { display: grid; gap: 16px; margin-top: 20px; }
.key-row:empty { display: none; }
/* "Get a key" sits beside the key's label, not inside it, so the field's name is only the label. The wrapper
   repeats the label's grid and type, so the link keeps its place and size 8px under the field. */
.key-field { display: grid; gap: 8px; min-width: 0; font-size: 14px; line-height: 1.3; letter-spacing: -0.008em; }
.key-link { justify-self: start; font-size: 14px; font-weight: 500; color: var(--accent-ink); padding: 2px 0; }
.key-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.key-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; margin-top: 14px; }
.bench-page label.check { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; font-size: 15px; font-weight: 450; color: var(--ink); cursor: pointer; }
.key-opts .link { font-size: 15px; }
.keys > .note:last-child { margin-top: 10px; max-width: 760px; }

.limits { display: grid; gap: 12px; margin-top: 36px; }
.limits label { max-width: 360px; }
.limits .note { max-width: 560px; }

.go { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 26px; margin-top: 36px; }
.btn-go { min-height: 56px; padding: 0 36px; font-size: 18px; font-weight: 600; }
.go .btn:disabled { opacity: .5; cursor: progress; }
.fp { font-size: 14px; color: var(--ink-2); }
.fp code { margin-left: 6px; padding: 4px 9px; border-radius: 8px; background: var(--bg-2); font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- live race ---------- */
.b-arena { padding: clamp(36px, 5vw, 56px) 0 clamp(36px, 5vw, 64px); }
.arena-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 22px; }
.arena-head .kicker { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 12px; border-radius: 999px; background: var(--bg-2); font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.arena-head .kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: te-pulse 1.6s var(--ease) infinite; }
.clock { margin-right: auto; font: 600 clamp(28px, 3.2vw, 38px)/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
/* Once the result is in, the race is over: the dot rests and the stop button goes. */
.b-arena:has(~ .b-results:not([hidden])) .kicker::before { animation: none; background: var(--ink-3); }
.b-arena:has(~ .b-results:not([hidden])) #stop { display: none; }

.panes { display: grid; gap: 48px; }
.panes:has(.pane[hidden]) { grid-template-columns: minmax(0, 1fr); }
.b-arena:has(.pane[hidden]) .wrap-wide { width: min(var(--wrap), 100% - 2 * var(--gutter)); }
.panes:has(.pane[hidden]) .view { aspect-ratio: 16 / 9; }
.pane { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.pane > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .model { min-width: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.022em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .prov { min-width: 0; flex: 0 1 auto; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px; border-radius: 999px; background: var(--bg-2); font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pane[data-state="thinking"] .state, .pane[data-state="building"] .state, .pane[data-state="writing"] .state, .pane[data-state="looking"] .state { color: var(--accent-ink); }
.pane[data-state="thinking"] .state::before, .pane[data-state="building"] .state::before, .pane[data-state="writing"] .state::before, .pane[data-state="looking"] .state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: te-pulse 1.4s var(--ease) infinite; }
.pane[data-state="done"] .state { color: var(--ink); }
.pane[data-state="error"] .state { background: var(--accent); color: #fff; }

.view { position: relative; aspect-ratio: 16 / 11; border-radius: var(--radius-m); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line-2); overflow: hidden; isolation: isolate; container-type: inline-size; transition: box-shadow .4s var(--ease); }
.view canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y !important; }
.view canvas:active { cursor: grabbing; }
.view-tools { position: absolute; top: 12px; right: 12px; z-index: 1; display: flex; gap: 8px; }
.view-tools button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--ink); font-size: 13px; font-weight: 550; letter-spacing: -0.01em; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background-color .2s, color .2s; }
.view-tools button:hover { background: #fff; }
.view-tools button[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.view-tools button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.match { position: absolute; left: 20px; bottom: 16px; z-index: 1; display: flex; align-items: baseline; gap: 6px; pointer-events: none; }
.match b { font-size: clamp(46px, 9.5cqi, 76px); font-weight: 650; line-height: 1; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.match span { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.pane.won .match b { color: var(--accent-ink); }
.pane.won .view { box-shadow: inset 0 0 0 1.5px rgba(208, 23, 42, .58); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; margin: 4px 0 0; padding: 0 6px; }
.stats div { min-width: 0; }
.stats div:nth-child(2) { order: 4; grid-column: span 2; }
.stats div:nth-child(5) { order: 5; }
.stats dt { font-size: 13px; line-height: 1.35; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats dd { margin: 4px 0 0; font: 500 17px/1.25 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.feed { list-style: none; height: 252px; margin: 0; padding: 12px; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; border-radius: var(--radius-m); background: var(--bg-2); font-size: 14px; line-height: 1.5; scrollbar-width: thin; }
.feed:empty::before { content: ""; margin: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.feed > li { flex: none; padding: 10px 14px; border-radius: 12px; overflow-wrap: anywhere; }
.feed > .say { background: #fff; color: var(--ink); }
.feed > .think { color: var(--ink-2); font-style: italic; font-size: 13.5px; max-height: 5.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.feed > .call { position: relative; padding-left: 38px; color: var(--ink-2); background: rgba(255, 255, 255, .55); }
.feed > .call::before { position: absolute; left: 14px; top: 10px; width: 12px; text-align: center; font-weight: 700; color: var(--ink-2); }
.feed > .add::before { content: "+"; color: var(--accent-ink); }
.feed > .remove::before { content: "\2212"; }
.feed > .look::before { content: "\25CE"; font-weight: 400; }
.feed > .done::before { content: "\2713"; color: var(--ink); }
.feed > .err::before { content: "!"; color: var(--accent-ink); }
.feed > .call b { color: var(--ink); font-weight: 600; }
.feed > .call .err { display: block; margin-top: 3px; color: var(--accent-ink); }
.feed > .call img { display: block; width: 100%; max-width: 280px; height: auto; aspect-ratio: 4 / 3; object-fit: contain; margin-top: 8px; border-radius: 10px; background: #fff; }

/* ---------- result ---------- */
.b-results { padding: clamp(56px, 8vw, 104px) 0 clamp(72px, 9vw, 120px); }
#verdict { max-width: 18em; }
#result-verification:not(:empty) { margin-top: 16px; color: var(--ink-2); }
#breakdown { margin-top: clamp(32px, 4vw, 48px); overflow-x: auto; scrollbar-width: thin; }
.breakdown table { width: 100%; border-collapse: collapse; font-size: 15px; }
.breakdown th, .breakdown td { padding: 13px 18px 13px 0; text-align: left; vertical-align: baseline; border-bottom: 1px solid var(--line-2); }
.breakdown th:last-child, .breakdown td:last-child { padding-right: 0; }
#breakdown thead th { padding-bottom: 16px; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); border-bottom-color: var(--line); vertical-align: top; min-width: 9em; }
#breakdown thead th:first-child { min-width: 0; }
#breakdown thead .tag { margin-right: 10px; vertical-align: 2px; }
#breakdown tbody th { width: 40%; min-width: 9.5em; font-weight: 400; color: var(--ink-2); line-height: 1.4; }
#breakdown td { font: 500 15.5px/1.4 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--ink); white-space: nowrap; }
#breakdown tbody tr:first-child > * { padding-block: 18px; }
#breakdown tbody tr:first-child td { font-size: clamp(26px, 2.8vw, 34px); font-weight: 600; line-height: 1.1; letter-spacing: -0.05em; }
#breakdown tbody tr:last-child > * { border-bottom: 0; }
/* The last three rows (cost source, effort, how it ended) are words, not numbers. */
#breakdown tbody tr:nth-last-child(-n+3) td { font-family: var(--font); font-size: 15px; letter-spacing: -0.012em; }

.export { display: grid; gap: 36px; margin-top: clamp(56px, 7vw, 88px); align-items: start; }
.card-preview { border-radius: var(--radius-m); overflow: hidden; background: var(--bg-2); }
.card-preview canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.export-side { min-width: 0; }
.export-side h3 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.15; letter-spacing: -0.03em; }
.export-side .sub { margin-top: 10px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.export-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.export-actions .btn { display: inline-flex; align-items: center; justify-content: center; flex: 0 1 auto; min-height: 44px; white-space: nowrap; }
.post-label { margin-top: 28px; margin-bottom: 8px; }
#export-msg:not(:empty) { color: var(--ink-2); }

/* ---------- leaderboard ---------- */
.b-leaderboard { padding: clamp(80px, 10vw, 136px) 0 clamp(72px, 9vw, 120px); }
#leaderboard-table { overflow-x: auto; overscroll-behavior-x: contain; scroll-padding-inline: 12px; scroll-margin-top: calc(var(--nav-h) + 16px); scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
#leaderboard-table:focus-visible, #leaderboard-table:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
/* Scroll shadows: a soft edge appears on whichever side has more columns to scroll to. */
#leaderboard-table:has(table), #breakdown {
  background:
    linear-gradient(to right, #fff 40%, rgba(255, 255, 255, 0)) left center / 36px 100% no-repeat local,
    linear-gradient(to left, #fff 40%, rgba(255, 255, 255, 0)) right center / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .1), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .1), transparent) right center / 12px 100% no-repeat scroll;
}
/* Loading and empty states: a quiet tile. */
#leaderboard-table:not(:has(table)) {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  min-height: 184px; padding: 32px 24px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2);
  text-align: center; font-size: clamp(19px, 2vw, 24px); font-weight: 600; letter-spacing: -0.022em; line-height: 1.25; color: var(--ink);
}
#leaderboard-table:not(:has(table))::before {
  content: ""; width: 44px; height: 32px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='32' viewBox='0 0 44 32'%3E%3Crect x='0' y='13' width='10' height='19' rx='3' fill='%23d3dbe7'/%3E%3Crect x='17' y='0' width='10' height='32' rx='3' fill='%23245eb5'/%3E%3Crect x='34' y='7' width='10' height='25' rx='3' fill='%23d3dbe7'/%3E%3C/svg%3E") center / contain no-repeat;
}
#leaderboard-table table { width: max-content; min-width: 100%; border-collapse: collapse; }
#leaderboard-table th { padding: 0 16px 12px 0; text-align: left; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); }
#leaderboard-table td { padding: 16px 16px 16px 0; white-space: nowrap; vertical-align: baseline; border-bottom: 1px solid var(--line-2); font: 500 15px/1.3 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; color: var(--ink-2); }
#leaderboard-table td:first-child { font-size: 20px; font-weight: 600; color: var(--ink-3); }
#leaderboard-table td:nth-child(2) { font-family: var(--font); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
#leaderboard-table td:nth-child(3) { font-size: 26px; font-weight: 600; letter-spacing: -0.04em; color: var(--ink); }
#leaderboard-table tbody tr:first-child td:first-child, #leaderboard-table tbody tr:first-child td:nth-child(3) { color: var(--accent-ink); }
#leaderboard-table td:last-child { padding-right: 0; font-family: var(--font); font-size: 15px; letter-spacing: -0.01em; }
#leaderboard-table td:last-child a { color: var(--accent-ink); }
#leaderboard-table td:last-child a:hover { text-decoration: underline; text-underline-offset: 3px; }
#leaderboard-table tbody tr:last-child td { border-bottom: 0; }
.board-share { display: grid; gap: 24px; margin-top: 16px; align-items: center; }
.board-side { min-width: 0; }
.board-side .export-actions { margin-top: 0; }
.board-note { margin-top: 18px; font-size: 15px; }

.board-more { display: grid; gap: 16px; margin-top: clamp(48px, 6vw, 72px); }
.calibration, .record-check { min-width: 0; padding: var(--tile-pad); border-radius: var(--radius); background: var(--bg-2); }
.calibration h3 { font-size: 22px; letter-spacing: -0.026em; line-height: 1.2; }
.calibration > .note { margin-top: 8px; }
#calibration { list-style: none; margin-top: 18px; }
#calibration li { padding: 15px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.55; color: var(--ink-2); font-variant-numeric: tabular-nums; }
#calibration li:last-child { padding-bottom: 0; }
#calibration li > a { color: var(--ink); font-weight: 600; letter-spacing: -0.012em; }
#calibration li > a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bench-page .record-check label { gap: 14px; font-size: 22px; font-weight: 650; letter-spacing: -0.026em; line-height: 1.2; }
.record-check input[type="file"] { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 44px; margin: 0; padding: 0; font: 400 15px/1.4 var(--font); letter-spacing: -0.01em; color: var(--ink-2); cursor: pointer; }
.record-check input[type="file"]::file-selector-button { min-height: 44px; margin-right: 14px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 550 15px/1 var(--font); letter-spacing: -0.012em; cursor: pointer; transition: background-color .2s; }
.record-check input[type="file"]:hover::file-selector-button { background: var(--accent-hover); }
.record-check input[type="file"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.record-check input[type="file"]:disabled { opacity: .5; cursor: default; }
.record-check .note { margin-top: 14px; }
#verify-msg:not(:empty) { margin-top: 14px; color: var(--ink); }

/* ---------- rules ---------- */
.b-rules { padding: clamp(80px, 10vw, 136px) 0 clamp(96px, 12vw, 152px); }
.rules-grid { display: grid; gap: 16px; }
.rule { min-width: 0; padding: var(--tile-pad); border-radius: var(--radius); background: var(--bg-2); }
.rule h3 { font-size: 21px; line-height: 1.2; letter-spacing: -0.024em; }
.rule p { margin-top: 10px; font-size: 16px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.docs { margin-top: clamp(48px, 6vw, 72px); }
.open-note { max-width: 780px; font-size: 17px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.open-note + .open-note { margin-top: 10px; }
.faq { margin-top: 36px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; padding: 18px 0; cursor: pointer; list-style: none; font-size: clamp(17px, 1.6vw, 20px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 16px; height: 16px;
  background: linear-gradient(var(--ink), var(--ink)) center / 14px 1.7px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 1.7px 14px no-repeat;
  transition: transform .35s var(--ease-out);
}
.faq details[open] > summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent-ink); }
.faq details > :not(summary) { max-width: 820px; }
.faq details > :last-child { margin-bottom: 26px; }
.faq pre { margin: 2px 0 0; max-height: 480px; overflow: auto; padding: 18px 20px; border-radius: var(--radius-s); background: var(--bg-2); white-space: pre-wrap; overflow-wrap: anywhere; font: 400 13px/1.65 var(--mono); color: var(--ink); scrollbar-width: thin; }
.faq details p, .faq details li { font-size: 16px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.faq details p + p { margin-top: 12px; }
.faq details ul { display: grid; gap: 10px; margin-top: 14px; padding-left: 20px; }
.faq details li::marker { color: var(--ink-3); }
.faq details li b { color: var(--ink); font-weight: 600; }

/* ---------- footer ---------- */
.foot-legal .foot-bench { flex-basis: 100%; max-width: 760px; }

/* ---------- larger screens ---------- */
@media (min-width: 600px) {
  .goal-frame { aspect-ratio: 16 / 10; }
  .price-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats { grid-template-columns: minmax(0, .8fr) minmax(0, 1.55fr) minmax(0, .9fr) minmax(0, .7fr) minmax(0, .7fr); gap: 16px; }
  .stats div:nth-child(2), .stats div:nth-child(5) { order: 0; grid-column: auto; }
  .key-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 760px) {
  .agents { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; }
  .vs { width: 36px; text-align: center; }
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .limits { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: end; gap: 28px; }
  .limits .note { margin-bottom: 12px; }
}
@media (min-width: 860px) {
  .board-more { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
}
@media (min-width: 960px) {
  .panes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .price-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .b-hero { padding-top: calc(var(--nav-h) + clamp(48px, 6vw, 80px)); }
  .b-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); gap: clamp(40px, 4.4vw, 64px); }
  .b-hero-title { font-size: clamp(56px, 5.6vw, 80px); }
  .goal-frame { aspect-ratio: 1 / 1; }
  .export { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; }
  .board-share { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; }
  .board-side .export-actions { flex-direction: column; align-items: stretch; max-width: 300px; }
  .rules-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- small phones ---------- */
@media (max-width: 599px) {
  .btn-go { width: 100%; }
  .go { gap: 14px; }
  .fp { width: 100%; text-align: center; }
  .view-tools { top: 10px; right: 10px; gap: 6px; }
  .view-tools button { padding: 0 12px; }
  .match { left: 16px; bottom: 12px; }
  .feed { height: 224px; }
  .feed > .call img { max-width: 200px; }
  .pane > header { align-items: flex-start; }
  .who { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 1px; align-items: center; }
  .who .tag { grid-row: 1 / span 2; align-self: start; margin-top: 1px; }
  .who .model { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: 17px; line-height: 1.3; white-space: normal; }
  .who .prov { font-size: 13px; }
  .state { margin-top: -1px; }
  #breakdown thead .tag { display: flex; width: fit-content; margin: 0 0 8px; }
  .export-actions .btn { flex: 1 1 auto; padding-inline: 16px; }
  #breakdown thead th { min-width: 7.5em; font-size: 15px; }
  #breakdown tbody th { min-width: 8.5em; font-size: 14px; }
  #breakdown th, #breakdown td { padding-right: 12px; }
}
@media (pointer: coarse) {
  .view-tools button { min-height: 44px; }
  .btn-sm { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .arena-head .kicker::before, .state::before { animation: none; }
}

/* 2026-10-12: hide the model-grid exports until there are runs (BRIEF-2 visual fix 2); stack the hero facts on phones */
.export-actions [data-leader-export^="grid"][disabled] { display: none; }
@media (max-width: 420px) { .facts { grid-template-columns: minmax(0, 1fr); gap: 10px; } }

/* While there are no model runs (and while the board loads), hide the empty chart preview and its
   image button; the note on how to add a result stays. */
.b-leaderboard:not(:has(#leaderboard-table table)) .board-chart,
.b-leaderboard:not(:has(#leaderboard-table table)) [data-leader-export="chart"] { display: none; }
.b-leaderboard:not(:has(#leaderboard-table table)) .board-share { grid-template-columns: minmax(0, 1fr); margin-top: 20px; }
.b-leaderboard:not(:has(#leaderboard-table table)) .board-note { text-align: center; }

@media (max-width: 820px), (pointer: coarse) {
  .bench-page .link { min-height: 44px; display: inline-flex; align-items: center; }
  .bench-page label.check { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; }
  .bench-page label.check input[type="checkbox"] { width: 24px; height: 24px; }
}
