/* Score controls, charts and comparisons shared by the leaderboard and task pages. */
.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.seg button { border: 0; background: none; padding: 3px 11px; border-radius: 999px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

.scrub { -webkit-appearance: none; appearance: none; display: block; height: 22px; margin: 4px 0 0; background: none; cursor: pointer; touch-action: pan-y; }
.scrub::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--accent) var(--p, 100%), var(--line) var(--p, 100%)); border-radius: 2px; }
.scrub::-moz-range-track { height: 2px; background: linear-gradient(90deg, var(--accent) var(--p, 100%), var(--line) var(--p, 100%)); border-radius: 2px; }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -7px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); }
.scrub::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent); }

.track { position: relative; height: 8px; background: var(--soft); border-radius: 1px; }
.fill { position: absolute; inset: 0 auto 0 0; background: var(--c); border-radius: 1px; transition: width 0.12s linear; }
.tk { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 1px dashed var(--refline); }
.tk.baseline { border-left-style: dotted; }

.mini-scrub { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.mini-scrub .scrub { width: 170px; margin: 0; }
.where { white-space: nowrap; font-variant-numeric: tabular-nums; }

.v { display: inline-flex; align-items: center; gap: 5px; }
.v::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

.plot { position: relative; display: block; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plot .line { fill: none; stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.plot .cur { position: absolute; top: 0; bottom: 0; left: calc(var(--f, 1) * 100%); border-left: 1px solid var(--accent); opacity: 0.55; }
.plot .dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--c); }

.facts { display: grid; grid-template-columns: 70px 1fr; gap: 6px 12px; margin-top: 16px; font-size: 13px; }
.facts dt { color: var(--muted); }
.score-head, .group summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }
:is(.panel, .task-results) h4 { font-size: 13.5px; font-weight: 600; }
:is(.panel, .task-results) h4 span { color: var(--faint); font-weight: 400; margin-left: 2px; }
.score-head em, .group summary em { font-style: normal; font-size: 12px; color: var(--muted); }
.score { position: relative; margin: 14px 0 0 28px; }
.yticks { position: absolute; left: -28px; top: 0; bottom: 0; width: 22px; font-size: 10.5px; color: var(--muted); }
.yticks span { position: absolute; right: 0; transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.score-plot { height: 150px; border-bottom: 1px solid var(--rule); cursor: ew-resize; touch-action: pan-y; }
.reflab { position: absolute; right: 0; font-size: 11px; color: var(--labelink); white-space: nowrap; background: color-mix(in srgb, var(--card) 80%, transparent); }
.reflab.over { transform: translateY(-115%); }
.reflab.under { transform: translateY(15%); }
.score-rows { margin-top: 12px; display: grid; gap: 2px; }
.score-row { display: grid; grid-template-columns: 15px minmax(0, 1fr) minmax(0, 1.25fr) 52px; align-items: center; gap: 10px; min-height: 38px; font-size: 13px; }
.score-row .who { display: flex; flex-direction: column; line-height: 1.2; }
.score-row b { font-weight: 550; }
.score-row small { color: var(--muted); font-size: 11px; }
.score-row .track { height: 7px; }
.score-row .tk { top: -4px; bottom: -4px; }
.score-row .v { justify-content: flex-end; font-variant-numeric: tabular-nums; font-size: 15px; }
.score-row .v::before { display: none; }
.score-row.field { min-height: 32px; font-size: 12.5px; }
.score-row.field:first-of-type, .score-row[data-agent] + .score-row.field { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.score-row.field .sw { width: 11px; height: 11px; margin-left: 2px; border-radius: 2px; background: var(--c); }
.score-row.field .nm { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--labelink); }
.score-row.field .v { font-size: 13px; color: var(--muted); }
.score-row.frontier { --c: var(--front); }
.score-row.frontier .nm { color: var(--ink); }
.score-row.other { --c: var(--other); }
.score-row.baseline .sw, .score-row.baseline .fill { background: none; border: 1px solid var(--start); }
.score-row.baseline .fill { border-left: 0; }
.group summary { cursor: pointer; list-style: none; }
.group summary::-webkit-details-marker { display: none; }
.group summary h4::before { content: "▸"; display: inline-block; width: 14px; color: var(--faint); transition: transform 0.2s; }
.group[open] summary h4::before { transform: rotate(90deg); }
.minis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; margin-top: 12px; }
.mini figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 12px; }
.mini-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.way { color: var(--muted); font-size: 11px; }
.mini-vals { width: 100%; display: flex; gap: 10px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-plot { height: 48px; margin-top: 4px; border-bottom: 1px solid var(--line); }
.mini .ref { stroke: var(--refline); opacity: 0.8; }

.tip { position: absolute; z-index: 40; max-width: 280px; padding: 8px 10px; border-radius: 4px; background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1.4; pointer-events: none; }

.wash { fill-opacity: 0.07; }
.ref { stroke: var(--refline); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ref.frontier { stroke-dasharray: 5 4; }
.ref.baseline { stroke-dasharray: 1.5 3; }
.chart .label { fill: var(--labelink); font-size: 11.5px; }

.refs-head { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }
.refs { margin-top: 8px; display: grid; gap: 8px; font-size: 12.5px; }
.refs a { text-decoration: none; }
.refs a:hover { text-decoration: underline; }
.venue { color: var(--muted); margin-left: 6px; }
.role { margin-left: 6px; padding: 0 5px; border-radius: 3px; background: var(--chip); color: var(--muted); font-size: 10.5px; }
