/* fig-results and tab-results: styles for the results section only. */
#fig-results { --fig-text-sm: 12px; }
#fig-results .results-hollow { fill: var(--bg); stroke: var(--c-prior); stroke-width: 2; }
#fig-results .results-link { stroke: var(--c-ref); stroke-width: 2; stroke-linecap: round; opacity: 0.55; }
#fig-results .results-ref { stroke: var(--c-ref); stroke-width: 1.5; stroke-dasharray: 5 3; }
#fig-results .results-ref-dot { stroke-dasharray: 0.1 4; stroke-linecap: round; stroke-width: 2; }
#fig-results .results-band { fill: var(--c-grid); opacity: 0; }
#fig-results .results-band.on { opacity: 1; }
#fig-results .results-num { font-variant-numeric: tabular-nums; }
#fig-results svg.pf-svg:focus { outline: none; }
#fig-results svg.pf-svg:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

/* #tab-results: the AUC table above the plot (built by results.js). Booktabs-like: no grid, a rule under
   the header, one above the baselines and one at the bottom. Overrides the shared per-row rule of .tbl. */
#tab-results .results-tbl { width: 100%; }
#tab-results .results-tbl th, #tab-results .results-tbl td { border-bottom: 0; }
#tab-results .results-tbl thead tr:last-child > * { border-bottom: 1px solid var(--rule); }
#tab-results .results-tbl-corner { vertical-align: bottom; border-bottom: 1px solid var(--rule) !important; }
#tab-results .results-tbl-ds { text-align: center; padding-bottom: 4px;
  background: linear-gradient(var(--rule), var(--rule)) center bottom / calc(100% - 12px) 1px no-repeat; }
#tab-results .results-tbl-ds.results-tbl-gap { background-position: calc(50% + 6px) bottom; background-size: calc(100% - 24px) 1px; }
#tab-results .results-tbl-sub { font-weight: 400; color: var(--muted); }

/* the title line (the table's <caption>, styled by .tbl caption): the span stays in view when the box
   scrolls sideways, like the baselines label */
#tab-results .results-tbl-title > span { position: sticky; left: 0; }

/* each dataset group is prior | arrow | PIFM. The two numbers sit close to the arrow (same padding in the
   header and the body, so the header words and their arrow line up with the digits and theirs); the
   arrow column is as narrow as the arrow and never tinted. */
#tab-results .results-a { padding-right: 7px; }
#tab-results .results-b { padding-left: 9px; }
#tab-results .results-arr { position: relative; width: 1px; padding-left: 2px; padding-right: 2px; text-align: center; color: var(--muted); }   /* relative: keeps the hidden "to" inside the scroll box */
#tab-results .results-arrow { display: inline-block; vertical-align: calc(0.36em - 4px); overflow: visible;
  fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
#tab-results .results-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
#tab-results .results-tbl-gap { padding-left: 24px; }
#tab-results .results-tbl tbody th[scope="row"] { font-weight: 400; }
#tab-results .results-tbl tbody:first-of-type tr:first-child > * { padding-top: 10px; }
#tab-results .results-tbl tbody:first-of-type tr:last-child > * { padding-bottom: 10px; }

/* the key dots in the header: the plot's marks (hollow blue = prior, filled green = PIFM) */
#tab-results .results-key { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; box-sizing: border-box; }
#tab-results .results-key-prior { border: 2px solid var(--c-prior); }
#tab-results .results-key-flow { background: var(--c-flow); }

/* the winner of a pair: bold ink on a faint tint of its meaning colour (never coloured text: the flow
   green is 3.2:1 as text on the light ground). Measured --fg on the tint: see the report / below. */
#tab-results .results-win { font-weight: 700; color: var(--fg); }
#tab-results .results-win-flow { background: color-mix(in oklab, var(--c-flow) 18%, var(--bg)); }
#tab-results .results-win-prior { background: color-mix(in oklab, var(--c-prior) 14%, var(--bg)); }

/* baselines: their own group under a thin rule, grey like the reference lines in the plot (muted text
   is 5.6:1 light, 6.9:1 dark); one value per dataset, centred across the pair it stands against */
#tab-results .results-tbl-base { color: var(--muted); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
#tab-results .results-tbl-group { padding-top: 10px; padding-bottom: 2px; font-weight: 400; font-style: italic; font-size: 0.93em; text-align: left; }
#tab-results .results-tbl-base tr:last-child > * { padding-bottom: 10px; }
#tab-results .results-tbl-span { text-align: center; }

/* phone: the box scrolls sideways on its own (shared .tbl-scroll); the row labels stay in view */
#tab-results .results-tbl tbody th[scope="row"], #tab-results .results-tbl-corner { position: sticky; left: 0; z-index: 1; background: var(--bg); }
#tab-results .results-tbl-over .results-tbl tbody th[scope="row"],
#tab-results .results-tbl-over .results-tbl-corner { padding-right: 12px; box-shadow: inset -1px 0 var(--rule); }
/* the "Baselines without a prior" row spans every column, so it has no label cell to carry the rule: the first
   baseline label draws the rule up through that row (5em is taller than the row, even with its label on two
   lines on a phone; the overshoot lies on the rule of the row above, at the same x) */
#tab-results .results-tbl-over .results-tbl-base tr:nth-child(2) > th[scope="row"]::before {
  content: ""; position: absolute; right: 0; bottom: 100%; width: 1px; height: 5em; background: var(--rule); }
#tab-results .tbl-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the long baseline names: on desktop each stays on one line without widening the label column (the
   table then still fits the 680 px column); the end of "Flow from Gaussian noise" runs into the empty
   left part of the first baseline cell, whose value is centred. On a phone they wrap instead. */
@media (min-width: 601px) {
  #tab-results .results-tbl-name { display: inline-block; width: 0; white-space: nowrap; }
  #tab-results .results-tbl-corner { width: 100%; }   /* the label column takes the spare width; the number columns keep their own */
}
@media (max-width: 600px) {
  #tab-results .results-tbl-base th[scope="row"] { white-space: normal; min-width: 9em; text-wrap: balance; }
  /* the group label wraps inside the label column (9em less its 12 px padding), like the baseline names,
     so the column's rule runs past it instead of through it */
  #tab-results .results-tbl-over .results-tbl-group > span { display: inline-block; max-width: 8.2em; white-space: normal; }
}
#tab-results .results-tbl-group > span { position: sticky; left: 0; }
