/* Pair-score results pages: additions on top of results.css and the site header CSS.
   Only results.css variables and colours are used; nothing here restyles existing components. */
.results-viewbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 4px; border-bottom: 1px solid var(--result-line); }
.results-viewbar .results-tabs { border-bottom: 0; margin-bottom: 0; }
.results-viewbar .results-tabs a { margin-bottom: -1px; }
.results-viewbar .results-sort select { min-height: 34px; padding-top: 5px; padding-bottom: 5px; }
.results-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 22px; }
.results-proposed-note { margin: -2px 0 12px !important; padding-left: 12px; border-left: 2px solid var(--result-accent); color: var(--result-muted); font-size: 14px; max-width: 1100px; }
.results-proposed-note a, .results-notice a, .results-methodology a, .pareto-explain a { text-decoration: underline; text-underline-offset: 4px; }
.results-notice { margin: 0 0 6px; font-size: 14px; color: var(--result-muted); }
.results-notice > summary { display: flex; align-items: flex-start; gap: 10px; padding: 4px 0 6px; cursor: pointer; list-style: none; }
.results-notice > summary::-webkit-details-marker { display: none; }
.results-notice > summary svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.results-notice > summary strong { color: var(--result-text); font-weight: 600; }
.results-notice-more { margin-left: auto; padding-left: 16px; white-space: nowrap; text-decoration: underline; text-underline-offset: 4px; }
.results-notice[open] .results-notice-more { color: var(--result-text); }
.results-notice ul { margin: 2px 0 10px 26px; padding: 0; max-width: 1060px; }
.results-notice li { margin: 5px 0; }
.participant-link { display: block; }
.participant-link:hover .participant-name, .participant-link:focus-visible .participant-name { text-decoration: underline; text-underline-offset: 3px; }
td > .participant-link { display: inline; }
td > .participant-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.results-matrix.has-mean col:first-child { width: 26%; }
.matrix-mobile-key { display: none; }
.pareto-guide { stroke: #13c4d2; stroke-opacity: .3; stroke-width: 1; stroke-dasharray: 3 4; }
.pareto-explain { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--result-line); }
.pareto-explain .profile-intro { margin-bottom: 4px; }
.pareto-explain p { color: var(--result-muted); font-size: 15px; max-width: 1040px; margin-top: 10px !important; }
.frontier-table td:nth-child(n+3) { font-family: var(--result-mono); }

/* Agent page */
.agent-strips { margin-bottom: 8px; }
.agent-strip { display: grid; grid-template-columns: 200px minmax(0, 1fr) 70px; gap: 18px; align-items: center; min-height: 54px; border-bottom: 1px solid var(--result-line); }
.agent-strip:first-child { border-top: 1px solid var(--result-line); }
.agent-strip svg { display: block; width: 100%; height: 44px; }
.agent-strip-label { font-size: 15px; }
.agent-strip-label small { display: block; color: var(--result-muted); font-size: 13px !important; }
.agent-strip-other { stroke: #858d92; stroke-width: 1.5; opacity: .8; }
.agent-strip-mine { stroke: #1dd3df; stroke-width: 3; }
.agent-strip-value { font: 16px/1 var(--result-mono); text-align: right; }
.agent-strip-axis { min-height: 30px; border-bottom: 0; }
.agent-strip-axis div { display: flex; justify-content: space-between; font: 13px var(--result-mono); color: var(--result-muted); }
.results-method code, .results-methodology code { font-family: var(--result-mono); font-size: 14px; overflow-wrap: anywhere; }

/* Methodology page */
.results-methodology { max-width: 1100px; }
.results-methodology section { padding: 24px 0 26px; border-top: 1px solid var(--result-line); scroll-margin-top: 16px; }
.results-methodology section:first-child { border-top: 0; padding-top: 8px; }
.results-methodology p, .results-methodology li { color: var(--result-muted); font-size: 15px; max-width: 1000px; }
.results-methodology p { margin-top: 12px !important; }
.results-methodology ul { margin: 12px 0 0; padding-left: 20px; }
.results-methodology li { margin: 7px 0; }
.results-methodology strong { color: var(--result-text); font-weight: 600; }
.results-methodology .results-table-scroll { margin-top: 16px; }
.score-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 18px; }
.score-options h3 { margin-bottom: 4px !important; }

@media (max-width: 850px) {
  .results-controls { justify-content: flex-start; }
  .score-options { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .agent-strip { grid-template-columns: 120px minmax(0, 1fr) 56px; gap: 10px; }
}
@media (max-width: 600px) {
  .results-controls { width: 100%; }
  .results-notice-more { display: none; }
  .matrix-mobile-key { display: block; color: var(--result-muted); font-size: 13px; margin: 6px 0 0 !important; }
  .results-table-scroll { overflow: visible; }
  .results-matrix { min-width: 0 !important; }
  .results-matrix colgroup, .results-matrix thead { display: none; }
  .results-matrix, .results-matrix tbody { display: block; }
  .results-matrix tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .results-matrix.has-mean tr { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .results-matrix tbody th { grid-column: 1 / -1; position: static; padding: 10px 12px 7px; }
  .results-matrix tbody td { height: auto; border-top: 0; }
  .results-matrix tbody td:nth-child(2) { border-left: 0; }
  .results-matrix td a { min-height: 44px; flex-direction: column; gap: 3px; font-size: 15px; }
  .results-matrix td a::before { content: attr(data-label); font-size: 11px; opacity: .72; }
  .agent-strip { grid-template-columns: 92px minmax(0, 1fr) 48px; }
  .agent-strip-label { font-size: 13px; }
}

/* Centred heat legend, profile overlay */
.heat-scale-centred { position: relative; }
.heat-scale-centred i { position: absolute; left: calc(50% - 1px); top: -3px; bottom: -3px; width: 2px; background: #eef0ec; }
.overlay-key { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 0 0 6px; font-size: 14px; color: var(--result-muted); }
.overlay-key span { display: inline-flex; align-items: center; gap: 8px; }
.overlay-key i { display: inline-block; width: 22px; height: 2px; }
.overlay-swatch { display: inline-block; width: 14px; height: 2px; margin-right: 7px; vertical-align: middle; }
.overlay-label { pointer-events: none; }
#overlay-chart .chart-frame svg { cursor: crosshair; }
.pareto-configurations .pareto-value a { text-decoration: underline; text-underline-offset: 3px; }
.results-methodology .formula { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--result-line); background: var(--result-surface); font: 14px/1.7 var(--result-mono); overflow-x: auto; color: var(--result-text); }
.results-methodology em { font-style: italic; color: var(--result-text); }

/* Log-ratio profile on agent pages */
.logratio-legend .series-key { cursor: default; }
.logratio-legend .series-key i { display: inline-block; width: 14px; height: 10px; }
.logratio-zero { stroke: #c8cdc9; stroke-width: 1.2; }
.logratio-side { fill: #eef0ec; font: 13px var(--result-mono); paint-order: stroke; stroke: var(--result-bg); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.results-page .logratio-legend { gap: 4px 18px; margin-bottom: 10px; }
.results-page .logratio-legend .series-key { min-height: 0; padding: 2px 0; font-size: 13px; }

/* Profiles page (focus + context, field band, fitted axes, overview) */
.results-page .profile-figure .chart-grid, .profile-mini .chart-grid { stroke: #2a2d30; }
.results-page .profile-figure .chart-grid.vertical { stroke: #222528; stroke-dasharray: 2 5; }
.results-page .profile-grid.floor { stroke: #3d4144; }
.profile-band { fill: #7ddfd4; fill-opacity: .09; }
.profile-median { fill: none; stroke: #c8cdc9; stroke-width: 1.3; stroke-opacity: .85; stroke-dasharray: 5 3; }
.profile-line { fill: none; stroke-linejoin: round; stroke-linecap: round; transition: stroke-opacity .15s ease; }
.profile-line.ctx { stroke-width: 1; stroke-opacity: .3; }
.profile-line.all { stroke-width: 1.2; stroke-opacity: .62; }
.profile-line.top, .profile-line.selected { stroke-width: 2.4; }
.profile-line.top.mini { stroke-width: 2; }
.has-hover .profile-line.all, .has-select .profile-line.all { stroke-opacity: .2; }
.has-hover .profile-line.ctx { stroke-opacity: .18; }
.has-hover .profile-line.top:not(.is-hover), .has-select .profile-line.top:not(.is-on) { stroke-opacity: .5; }
.profile-hover { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.profile-crop { stroke: #6b7377; stroke-width: 1; stroke-dasharray: 2 4; }
.profile-crop-note { fill: #8f989c; font: 11px var(--result-mono); paint-order: stroke; stroke: var(--result-bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.profile-label { font: 12px var(--result-mono); paint-order: stroke; stroke: var(--result-bg); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.profile-label-sub { fill: #8f9a9e; font-size: 10.5px; }
.profile-leader { fill: none; stroke-width: 1; stroke-opacity: .75; stroke-linejoin: round; stroke-linecap: round; }
.profile-end { transition: opacity .15s ease; }
.has-hover .profile-end:not(.is-on):not(.median) { opacity: .45; }
.profile-cross { stroke: #9ea7a4; stroke-dasharray: 3 4; pointer-events: none; }
.profile-figure .chart-frame svg { cursor: crosshair; }
.profile-tooltip .profile-tip-strong { font-weight: 600; }
.profile-key { margin-bottom: 4px; }
.profile-key i.key-band { height: 10px; background: rgba(125, 223, 212, .2); }
.profile-key i.key-median { height: 2px; background: repeating-linear-gradient(90deg, #c8cdc9 0 5px, transparent 5px 8px); }
.profile-key i.key-context { height: 1px; background: #86a0a1; opacity: .7; }
.profile-key i.key-top { height: 3px; }
.profile-overview { margin: 2px 0 30px; }
.profile-overview-head h2 { font-size: 20px; font-weight: 500; margin: 0; }
.profile-overview-head p { color: var(--result-muted); font-size: 14px; margin-top: 6px !important; max-width: 1100px; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin-top: 14px; }
.profile-card { display: block; padding: 12px 14px; border: 1px solid var(--result-line); border-radius: 3px; color: inherit; text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.profile-card:hover, .profile-card:focus-visible { border-color: #62686d; background: var(--result-surface); }
.profile-card.is-current { border-color: #91bfb9; background: var(--result-surface); }
.profile-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.profile-card-head strong { font-weight: 500; }
.profile-card-head small { color: var(--result-muted); font-size: 12px; white-space: nowrap; }
.profile-card.is-current .profile-card-head small { color: var(--result-accent); }
.profile-mini { display: block; margin: 6px 0 4px; min-height: 132px; }
.profile-mini svg { display: block; overflow: visible; }
.results-page .chart-tick.mini { font-size: 11px; }
.profile-card-top { display: grid; gap: 1px; font-size: 12.5px; color: var(--result-muted); }
.profile-card-top > span { display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; }
.profile-card-top i { flex: none; width: 12px; height: 3px; }
.profile-card-top small { color: #7e8b90; font-size: 11px; }
.profile-card-top em { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-style: normal; }
.profile-card-top b { margin-left: auto; padding-left: 8px; font: 12px var(--result-mono); color: var(--result-text); font-weight: 400; }
.profile-key b.profile-key-text { font-weight: inherit; }
.profile-key em { font-style: normal; }
.profile-key .narrow-only { display: none; }
.results-page .profile-viewbar { margin: 14px 0 14px; }
.profile-main-intro h2 { scroll-margin-top: 12px; }
.profile-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.profile-panel h3 { margin: 6px 0 0; font-size: 16px; font-weight: 500; }
.profile-panel h3 small { color: var(--result-muted); font-size: 13px; font-weight: 400; margin-left: 6px; }
.results-page .profile-axis-controls { justify-content: flex-start; align-items: flex-start; flex-wrap: nowrap; margin-top: 2px; }
.profile-axis-controls .pareto-log-control { flex: none; white-space: nowrap; }
.profile-axis-controls .pareto-axis-direction { padding-top: 4px; max-width: 980px; }
.profile-ranked { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--result-line); }
.profile-ranked li { display: grid; grid-template-columns: 14px 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--result-line); font-size: 14px; }
.profile-ranked i { width: 14px; height: 3px; }
.profile-ranked li.median i { height: 2px; background: repeating-linear-gradient(90deg, #c8cdc9 0 5px, transparent 5px 8px); }
.profile-ranked li.selected i { background: #eef0ec; }
.profile-ranked-rank { font: 12px var(--result-mono); color: var(--result-muted); }
.profile-ranked strong { display: block; font-weight: 500; }
.profile-ranked small { display: block; color: var(--result-muted); font-size: 12px; }
.profile-ranked-score { font: 14px var(--result-mono); }
@media (max-width: 1000px) { .profile-panels { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .profile-grid { gap: 10px; }
  .profile-card { padding: 8px 9px; }
  .profile-card-head { font-size: 13px; }
  .profile-card-head small, .profile-card-top small { display: none; }
  .profile-card-top { font-size: 11.5px; }
  .profile-card-top em { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-style: normal; }
.profile-card-top b { font-size: 11px; }
  .results-page .profile-axis-controls { flex-wrap: wrap; }
  .profile-key .wide-only { display: none; }
  .profile-key .narrow-only { display: inline; }
}
