/* SWE-sweep research pages: figures, chips, tables, readouts and the tasks table.
   Loaded after paper.css (the shared Benchmark Research frame); it overrides only the size of code (below).
   Type scale: serif 17px (reading), 15.3px (small), 13.6px (foot: every chart label, value, legend, chip, caption,
   control and table); mono 12px everywhere (code blocks included) except inline code in 17px prose.
   Run-in labels are small caps; bold is for table header cells and <strong> only.
   One encoding throughout (spec 2.1):
     grey track = bugs in the task; solid Burgundy = passed and counted;
     hatched Burgundy = passed their hidden tests, but the task scored 0; dashed outline = did not build;
     hollow grey dot = as released; solid Burgundy dot = with the fix. */

html.paper {
  --b-mid: oklch(0.58 0.15 20);
  --b-light: oklch(0.78 0.08 20);
  --b-wash: oklch(0.96 0.015 20);
  --g-track: #ebebeb;
  --g-mid: #9a9a9a;
  --hatch: repeating-linear-gradient(135deg, var(--burgundy) 0 1.4px, transparent 1.4px 5px);
  --fig-wide: var(--text-width);   /* locked to the text column: nothing extends past the h1's rule */
}

/* ------------------------------------------------------------------ utilities */
html.paper .num, html.paper .tnum { font-variant-numeric: lining-nums tabular-nums; }
html.paper .mono, html.paper .tid { font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
/* Code: the frame's 0.82em (13.94px) inside 17px prose, 12px inside anything smaller (captions, tables, readouts, cards). */
html.paper code { font-size: clamp(12px, (1em - 16px) * 100, 0.82em); }
html.paper .muted { color: var(--muted); }
html.paper .sc { font-size: inherit; }
html.paper .nowrap { white-space: nowrap; }
html.paper .z0 { color: var(--burgundy); font-style: italic; }           /* the red-pen 0 */
/* One strikethrough for "as released → with our fixes" values: muted text, Burgundy line. */
html.paper s.struck, html.paper .hscore s, html.paper .vl s, html.paper .dval s, html.paper .step-trace s, html.paper .booktabs s {
  color: var(--muted); text-decoration: line-through; text-decoration-color: var(--burgundy); text-decoration-thickness: 1.5px; }
html.paper .dag { color: var(--muted); margin-left: 1px; }
/* Footnote markers are Unicode superscript digits already: print them at the size of their text. */
html.paper sup.fn, html.paper sup.mk-n, html.paper sup.pv-mk, html.paper .table-note sup { font-size: inherit; vertical-align: baseline; line-height: 0; }
html.paper [hidden] { display: none !important; }
html.paper :focus-visible { outline: 1px solid var(--burgundy); outline-offset: 2px; }
html.paper .copy figure, html.paper .fig-wide { position: relative; }
html.paper .noscript { margin: 0 0 18px; padding: 8px 12px; border-left: 2px solid var(--line); font-size: var(--type-foot); color: var(--muted); }

/* ------------------------------------------------------------------ widths: everything, .fig-wide included, is the 620 text column */
html.paper .fig-wide { width: var(--fig-wide); max-width: none; margin-left: calc((100% - var(--fig-wide)) / 2); margin-right: calc((100% - var(--fig-wide)) / 2); }
html.paper .fig-wide > figcaption, html.paper .fig-wide > .fig-cap { max-width: var(--text-width); }

/* ------------------------------------------------------------------ figure chrome */
html.paper .fig-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; padding-bottom: 8px; border-bottom: 0.6px solid var(--ink); }
html.paper .fig-title { margin: 0; font-size: var(--type-small); font-weight: 400; font-variant-caps: all-small-caps; letter-spacing: 0.06em; text-transform: lowercase; color: var(--ink); }
html.paper .group-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 4px; padding-bottom: 3px; border-bottom: 0.6px solid var(--line); font-size: var(--type-foot); color: var(--muted); }
html.paper .group-h > :first-child { color: var(--ink); font-variant-caps: all-small-caps; letter-spacing: 0.06em; text-transform: lowercase; }
html.paper .group-h > :last-child { font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------------ legend and swatches */
html.paper .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 4px; padding: 0; list-style: none; font-size: var(--type-foot); color: var(--muted); line-height: 1.3; }
html.paper .legend > * { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
html.paper .sw { display: inline-block; flex: none; width: 18px; height: 10px; vertical-align: -1px; }
html.paper .sw-solid { background: var(--burgundy); }
html.paper .sw-hatch { background: var(--hatch); box-shadow: inset 0 0 0 1px var(--burgundy); }
html.paper .sw-dash { border: 1px dashed var(--muted); }
html.paper .sw-track { background: var(--g-track); }
html.paper .sw-light { background: var(--b-light); }
html.paper .mk-key { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
html.paper .mk-key.before, html.paper .mk-key.ring-grey { background: var(--paper); box-shadow: inset 0 0 0 2px var(--g-mid); }
html.paper .mk-key.after, html.paper .mk-key.name { background: var(--burgundy); }
html.paper .mk-key.unreliable { background: var(--paper); box-shadow: inset 0 0 0 2px var(--burgundy); }
html.paper .mk-key.changes { background: var(--b-light); box-shadow: inset 0 0 0 1px var(--burgundy); }
html.paper .mk-key.breaks { background: var(--muted); border-radius: 1px; }
html.paper .sq-key { display: inline-block; flex: none; width: 10px; height: 10px; }
html.paper .sq-key.on { background: var(--burgundy); }
html.paper .sq-key.off { box-shadow: inset 0 0 0 1px var(--muted); }

/* ------------------------------------------------------------------ row charts (one layout for every row chart)
   <div class="hrow"> <span class="hname"><span class="hid">numpy</span><span class="hsub">131 bugs</span></span>
                     <span class="hbar">…marks…</span> <span class="hscore">…value…</span> </div>
   Desktop: label | plot | value. Phone (<= 560px): label and value on line 1, plot full width on line 2. */
html.paper .rows { position: relative; }
html.paper .hrow { display: grid; grid-template-columns: var(--lw, 132px) minmax(0, 1fr) var(--vw, 112px); grid-template-areas: "name bar score"; align-items: center; column-gap: 12px; min-height: 26px; padding: 2px 4px; outline: none; }
html.paper .hrow[role="button"] { cursor: pointer; }
html.paper .hrow:hover, html.paper .hrow:focus-visible, html.paper .hrow[aria-expanded="true"] { background: var(--b-wash); }
html.paper .hrow:focus-visible { box-shadow: inset 2px 0 0 var(--burgundy); }
html.paper .hname { grid-area: name; min-width: 0; text-align: right; line-height: 1.15; }
html.paper .hid { display: block; font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; color: var(--ink); }
html.paper .hsub { display: block; font-size: var(--type-foot); color: var(--muted); }
html.paper .hbar { grid-area: bar; position: relative; height: 14px; min-width: 0; }
html.paper .hscore { grid-area: score; display: flex; align-items: baseline; gap: 5px; min-width: 0; font-size: var(--type-foot); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
html.paper .hscore .sc-p { min-width: 3ch; text-align: right; }
html.paper .hscore .of { color: var(--muted); }

/* hero encoding inside .hbar */
html.paper .htrack, html.paper .hfill { position: absolute; left: 0; top: 0; bottom: 0; }
html.paper .htrack { background: var(--g-track); }
html.paper .htrack.dashed { background: transparent; border: 1px dashed var(--muted); }
html.paper .hfill { background: var(--burgundy); }
html.paper .hfill.zeroed { background: var(--hatch); box-shadow: inset 0 0 0 1px var(--burgundy); }
html.paper .hfill.none { width: 0 !important; }
html.paper .hrow.total { border-top: 0.6px solid var(--ink); margin-top: 6px; padding-top: 6px; }
html.paper .hrow.total .hid { font-family: var(--font-body); font-size: var(--type-foot); }

/* inline readout (accordion, directly under its row; one open at a time) */
html.paper .readout { margin: 2px 0 8px; padding: 12px 4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: var(--type-small); line-height: 1.4; }
html.paper .readout p { margin: 0 0 6px; text-align: left; hyphens: manual; }
html.paper .readout p:last-child { margin-bottom: 0; }
html.paper .readout .r-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-family: var(--font-mono); font-size: 12px; }
html.paper .readout .r-src, html.paper .readout .r-foot { font-size: var(--type-foot); color: var(--muted); }
html.paper .readout b { font-weight: 400; font-variant-caps: all-small-caps; letter-spacing: 0.06em; text-transform: lowercase; }   /* run-in label */

/* ------------------------------------------------------------------ axes, rules */
html.paper .axis { position: relative; height: 20px; margin: 2px 4px 0 calc(var(--lw, 132px) + 16px); margin-right: calc(var(--vw, 112px) + 16px); border-top: 1px solid #bfbfbf; font-size: var(--type-foot); color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
html.paper .axis span { position: absolute; top: 3px; transform: translateX(-50%); white-space: nowrap; }
html.paper .axis span.first { transform: none; }
html.paper .axis span.last { transform: translateX(-100%); }
html.paper .axis-top { border-top: 0; border-bottom: 1px solid #bfbfbf; margin-top: 0; margin-bottom: 2px; }
html.paper .gridline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid #f0f0f0; pointer-events: none; }

/* ------------------------------------------------------------------ marks on a line (dumbbells) */
html.paper .dumbbell .hrow { min-height: 34px; }
html.paper .dumbbell .hbar { height: 22px; }
html.paper .hbar .rule { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--g-track); }
html.paper .mk { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--paper); }
html.paper .mk.after { background: var(--burgundy); }
html.paper .mk.before { background: var(--paper); box-shadow: inset 0 0 0 2px var(--g-mid), 0 0 0 2px var(--paper); }
html.paper .mk.none { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--muted); }
html.paper .db-line { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--b-light); }
html.paper .empty-lane { position: absolute; left: 0; top: 0; bottom: 0; width: 36px; background: #f6f6f6; border-right: 1px solid var(--line); }
html.paper .dumbbell .hscore s { margin-right: 2px; }
html.paper .dumbbell .hscore b, html.paper .dval b { font-weight: 400; color: var(--burgundy); }

/* ------------------------------------------------------------------ squares (one per grading) and unit grids */
html.paper .runs .sqs { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
html.paper .runs .sq { display: inline-block; width: 10px; height: 10px; flex: none; }
html.paper .sq.on { background: var(--burgundy); }
html.paper .sq.off { box-shadow: inset 0 0 0 1px var(--muted); }
html.paper .units .ugrid { display: flex; flex-wrap: wrap; gap: 2px; margin: 8px 0; }
html.paper .units .u { display: inline-block; width: 12px; height: 12px; flex: none; background: var(--g-track); }
html.paper .units .u.on, html.paper .u.solid { background: var(--burgundy); }
html.paper .u.light { background: var(--b-light); }
html.paper .u.muted { background: var(--muted); }
html.paper .u.outline { background: var(--paper); box-shadow: inset 0 0 0 1px var(--muted); }
html.paper .unit-block { padding: 12px 0 14px; border-bottom: 0.6px solid var(--line); }
html.paper .unit-block:last-child { border-bottom: 0; }
html.paper .unit-block h3, html.paper .unit-h { margin: 0; font-family: var(--font-mono); font-size: 12px; font-weight: 400; font-style: normal; }
html.paper .unit-big { font-size: var(--type-reading); line-height: 1.3; font-variant-numeric: lining-nums tabular-nums; }
html.paper .unit-big small { font-size: inherit; color: var(--muted); }
html.paper .unit-where { margin: 0; font-size: var(--type-foot); line-height: 1.35; color: var(--muted); }

/* ------------------------------------------------------------------ grading steps (Overview Figure 1): the grader's action, then
   matplotlib's trace under it, then the fixes that act at the step; compact, so the figure fits the first screen */
html.paper .steps { list-style: none; margin: 0; padding: 0; border-top: 0.6px solid var(--ink); border-bottom: 0.6px solid var(--ink); }
html.paper .steps > li { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 8px; margin: 0; padding: 5px 6px 6px; text-align: left; }
html.paper .steps > li + li { border-top: 0.6px solid var(--line); }
html.paper .steps > li.gate { background: var(--b-wash); }
html.paper .step-n { grid-row: span 3; font-size: var(--type-reading); line-height: 1.3; color: var(--burgundy); font-variant-numeric: lining-nums; }
html.paper .step-t { font-size: var(--type-reading); line-height: 1.3; }
html.paper .step-trace { margin-top: 1px; font-size: var(--type-foot); line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
html.paper .step-chips { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; font-size: var(--type-foot); color: var(--muted); }

/* ------------------------------------------------------------------ chips (Fix 1 ▼ …) */
html.paper .chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: var(--type-foot); line-height: 1.2; white-space: nowrap; font-variant-caps: all-small-caps; letter-spacing: 0.04em; font-variant-numeric: lining-nums; }
html.paper .chip .gl { font-variant-caps: normal; color: var(--burgundy); }
html.paper a.chip:hover { border-color: var(--burgundy); text-decoration: none; }
html.paper .chip-why { color: var(--muted); }
html.paper .chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }

html.paper .mc-l, html.paper .mc-n { font-variant-caps: all-small-caps; letter-spacing: 0.06em; text-transform: lowercase; }   /* run-in labels in change lists (Method, Tasks) */

/* ------------------------------------------------------------------ tables */
html.paper .booktabs .hide-s { }
html.paper .show-s { display: none; }   /* phone-only label (<= 560px, below) */
html.paper .booktabs tr.is-ours th, html.paper .booktabs tr.is-ours td { color: var(--burgundy); }
html.paper .booktabs tr.total th, html.paper .booktabs tr.total td { border-top: 0.6px solid var(--ink); }
html.paper .booktabs td.wrap, html.paper .booktabs th.wrap { white-space: normal; overflow-wrap: anywhere; }
html.paper .table-note { margin: 6px 0 0; font-size: var(--type-foot); color: var(--muted); }
html.paper .table-figure figcaption.above { margin: 0 0 8px; }

/* validation cell: mini-bar in the hero encoding plus "p/t · r failures · score 0" */
html.paper .vc { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
html.paper .vbar { position: relative; height: 8px; background: var(--g-track); }
html.paper .vbar > b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--burgundy); }
html.paper .vbar.z > b { background: var(--hatch); box-shadow: inset 0 0 0 1px var(--burgundy); }
html.paper .vbar.nb { background: transparent; border: 1px dashed var(--muted); }
html.paper .vbar.na { background: transparent; border-bottom: 1px solid var(--line); height: 1px; }
html.paper .vl { font-size: var(--type-foot); line-height: 1.25; font-variant-numeric: lining-nums tabular-nums; }
html.paper .vl .sub { color: var(--muted); }
html.paper .vnote { font-size: var(--type-foot); color: var(--muted); line-height: 1.3; }
html.paper .vtable td, html.paper .vtable th { vertical-align: top; }
html.paper .vtable tr.vgroup th { padding-top: 12px; font-weight: 400; font-variant-caps: all-small-caps; letter-spacing: 0.06em; text-transform: lowercase; color: var(--ink); }   /* group head */
html.paper .vtable tr.vnote-row td { padding-top: 0; padding-bottom: 8px; }

/* report-card glyph: two 44 x 8 mini-bars, as released → with our fixes */
html.paper .akg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: var(--type-foot); color: var(--muted); vertical-align: middle; }
html.paper .akg .vbar { display: inline-block; width: 44px; height: 8px; }
html.paper .akg .na { color: var(--muted); }
html.paper .akg .na.slot { display: inline-block; width: 44px; text-align: center; }
html.paper .akg .aud { color: var(--muted); }

/* ------------------------------------------------------------------ tasks page */
html.paper .controls { display: grid; gap: 10px; margin: 18px 0 10px; font-size: var(--type-foot); }
html.paper .controls label { color: var(--muted); }
html.paper .controls .row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
html.paper .controls input[type="search"], html.paper .controls select {
  font: inherit; font-size: var(--type-foot); padding: 6px 8px; border: 0.8px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); max-width: 100%; min-width: 0; }
html.paper .controls input[type="search"] { width: 100%; }
html.paper .controls select { font-size: var(--type-foot); padding: 4px 6px; }
html.paper .result-line { margin: 8px 0; font-size: var(--type-foot); color: var(--muted); }
html.paper details.filters-m { display: none; }
html.paper .tasks-table { table-layout: auto; }
html.paper .tasks-table tbody tr.trow { cursor: pointer; }
html.paper .tasks-table tbody tr.trow:hover, html.paper .tasks-table tbody tr.trow:focus-visible, html.paper .tasks-table tbody tr.trow[aria-expanded="true"] { background: var(--b-wash); }
html.paper .tasks-table td.t-name { font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
html.paper .tasks-table .via { font-size: var(--type-foot); color: var(--muted); white-space: nowrap; }
html.paper .tasks-table tr.detail > td { padding: 6px 4px 18px; border-bottom: 0.6px solid var(--line); background: var(--paper); white-space: normal; }
html.paper .detail h4 { margin: 14px 0 4px; font-size: var(--type-foot); font-weight: 400; font-variant-caps: all-small-caps; letter-spacing: 0.06em; text-transform: lowercase; color: var(--ink); }
html.paper .detail p, html.paper .detail li { font-size: var(--type-small); text-align: left; hyphens: manual; }
html.paper .detail ul { margin: 4px 0; padding-left: 1.2em; }
html.paper .detail .facts-line { margin: 0 0 6px; font-size: var(--type-foot); color: var(--muted); }
html.paper .detail .gradings { margin-top: 6px; }
html.paper .detail .audit-tag { font-size: var(--type-foot); color: var(--muted); }
html.paper .card-list { list-style: none; margin: 0; padding: 0; border-top: 1.3px solid var(--ink); border-bottom: 1.3px solid var(--ink); }
html.paper .card-list > li { margin: 0; padding: 8px 2px; border-top: 0.6px solid var(--line); display: grid; gap: 4px; text-align: left; }
html.paper .card-list > li:first-child { border-top: 0; }
html.paper .card-list .c1 { display: flex; justify-content: space-between; gap: 10px; }
html.paper .card-list .c1 > :last-child { font-size: var(--type-foot); color: var(--muted); }
html.paper .card-list .c2 { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--type-foot); font-variant-numeric: lining-nums tabular-nums; }

html.paper .facts dl, html.paper dl.facts { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 3px 12px; margin: 0; }
html.paper .facts dt, html.paper dl.facts dt { color: var(--muted); }
html.paper .facts dd, html.paper dl.facts dd { margin: 0; font-variant-numeric: lining-nums tabular-nums; min-width: 0; overflow-wrap: anywhere; }
html.paper .facts ul.fact-lines { margin: 8px 0 0; padding-left: 1.1em; }
html.paper .facts ul.fact-lines li { margin: 0 0 3px; font-size: var(--type-foot); text-align: left; }

/* ------------------------------------------------------------------ tooltip (single node; values are always printed too) */
html.paper .swv-tip { position: fixed; z-index: 20; max-width: 300px; padding: 7px 9px; background: var(--paper); border: 0.8px solid var(--ink); color: var(--ink); font-size: var(--type-foot); line-height: 1.35; pointer-events: none; text-align: left; }
html.paper .swv-tip .t-src { color: var(--muted); }

/* ------------------------------------------------------------------ article furniture */
html.paper .byline { margin: 18px 0 0; font-size: var(--type-foot); color: var(--muted); }

/* ------------------------------------------------------------------ lists inside .copy: undo paper.css's prose list styling */
html.paper .copy ul.legend { margin: 12px 0 4px; padding: 0; }
html.paper .copy ul.legend > li { margin: 0; padding: 0; text-align: left; }
html.paper .copy ul.card-list { margin: 0; padding: 0; }
html.paper .copy ul.card-list > li { margin: 0; padding: 8px 2px; text-align: left; hyphens: manual; }
html.paper .copy ol.steps { margin: 0; padding: 0; }
html.paper .copy ol.steps > li { margin: 0; padding: 5px 6px 6px; text-align: left; hyphens: manual; }
html.paper .copy .readout p, html.paper .copy .facts li { hyphens: manual; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  html.paper .fig-wide { width: auto; margin-left: 0; margin-right: 0; }
}

@media (max-width: 560px) {
  html.paper .page-container { width: calc(100% - 40px); margin-inline: 20px; }
  html.paper .fig-wide { width: auto; margin-inline: 0; }

  /* every row chart: two lines per row */
  html.paper .hrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name score" "bar bar"; row-gap: 3px; padding: 5px 2px; }
  html.paper .hname { text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
  html.paper .hid, html.paper .hsub { display: inline; }
  html.paper .hscore { justify-content: flex-end; }
  html.paper .hscore .sc-p { min-width: 0; }
  html.paper .dumbbell .hrow { min-height: 0; }
  html.paper .axis { margin-left: 2px; margin-right: 2px; }

  html.paper .fig-head { flex-direction: column; align-items: stretch; }

  html.paper .steps > li { grid-template-columns: 18px minmax(0, 1fr); column-gap: 6px; }

  html.paper .hide-s, html.paper .booktabs .hide-s { display: none; }
  html.paper .show-s { display: inline; }
  html.paper .booktabs th, html.paper .booktabs td { padding: 4px 4px; }
  html.paper .vc { grid-template-columns: 40px minmax(0, 1fr); gap: 6px; }
  /* validation tables reflow: one block per row, each cell labelled from its data-k attribute */
  html.paper table.reflow { table-layout: auto; }
  html.paper table.reflow thead { display: none; }
  html.paper table.reflow, html.paper table.reflow tbody, html.paper table.reflow tr, html.paper table.reflow th, html.paper table.reflow td { display: block; width: auto; }
  html.paper table.reflow tr { padding: 6px 0; border-top: 0.6px solid var(--line); }
  html.paper table.reflow tbody tr:first-child { border-top: 0; }
  html.paper table.reflow th, html.paper table.reflow td { padding: 2px 2px; }
  html.paper table.reflow td[data-k] { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 6px; align-items: center; }
  html.paper table.reflow td[data-k]::before { content: attr(data-k); color: var(--muted); }
  html.paper table.reflow tr.vgroup, html.paper table.reflow tr.vnote-row { border-top: 0; }

  html.paper .tasks-table.can-cards { display: none; }
  html.paper .card-list.phone-only { display: block; }
  html.paper details.filters-m { display: block; }
  html.paper .controls .desk-only { display: none; }
  html.paper .facts dl, html.paper dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  html.paper .facts dd, html.paper dl.facts dd { margin-bottom: 4px; }
}
@media (min-width: 561px) {
  html.paper .card-list.phone-only { display: none; }
}
/* touch screens: 16px in text fields, so that phones do not zoom the page on focus */
@media (pointer: coarse) {
  html.paper .controls input[type="search"] { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html.paper *, html.paper *::before, html.paper *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  html.paper .controls, html.paper .swv-tip, html.paper .skip-link { display: none !important; }
  html.paper .readout { display: none !important; }
  html.paper .fig-wide { width: auto; margin-inline: 0; }
  html.paper .hrow, html.paper .steps > li, html.paper figure { break-inside: avoid; }
  html.paper * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* V14: no hyphenation inside code; V25: a stable scrollbar gutter, as on the sibling pages */
html.paper code, html.paper .mono, html.paper .tid { hyphens: none; }
html.paper { scrollbar-gutter: stable; }
/* folded tables (Method): the summary reads like a caption */
html.paper details.vfold { margin: 14px 0; border-top: 0.6px solid var(--line); border-bottom: 0.6px solid var(--line); }
html.paper details.vfold > summary { padding: 8px 2px; cursor: pointer; font-size: var(--type-foot); line-height: 1.35; color: var(--ink); }
html.paper details.vfold > summary:hover { background: var(--b-wash); }
html.paper details.vfold > summary:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 1px; }
html.paper details.vfold[open] > summary { color: var(--muted); }
html.paper details.vfold > .table-figure { margin-top: 4px; }
/* in-page link targets get focus for keyboard users, without a ring around a whole section */
html.paper .jump-target:focus { outline: none; }

/* ------------------------------------------------------------------ "On this page" list (Tasks, Method) */
html.paper .toc { margin: 18px 0 8px; padding: 10px 0; border-top: 0.6px solid var(--line); border-bottom: 0.6px solid var(--line); font-size: var(--type-foot); }
html.paper .copy .toc ol { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 28px; }
html.paper .copy .toc li { margin: 0 0 3px; padding: 0; text-align: left; break-inside: avoid; counter-increment: toc; }
html.paper .copy .toc li::before { content: counter(toc) "."; display: inline-block; min-width: 1.6em; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
html.paper .toc ol { counter-reset: toc; }
@media (max-width: 560px) {
  html.paper .copy .toc ol { columns: 1; }
}

/* the narrowest phones: a tighter nav gap, so Method is never clipped at 320px */
@media (max-width: 360px) {
  html.paper .site-nav { gap: 14px; }
}

/* the scoring pseudocode, the zero-rule accent and the scoring text (Overview terms, Method) */
html.paper .copy pre.code-block { margin: 0; padding: 8px 4px; border-top: 0.6px solid var(--line); border-bottom: 0.6px solid var(--line); font-family: var(--font-mono); font-size: 12px; line-height: 1.5; color: var(--burgundy); white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; hyphens: none; }
html.paper .copy pre.code-block code { font-size: 12px; }
html.paper .copy pre.code-block .ln { display: block; padding-left: 4ch; text-indent: -4ch; }   /* a wrapped line (phones) hangs */
html.paper .copy .zero-rule { color: var(--burgundy); }
html.paper .copy .scoring { display: grid; gap: 14px; margin-top: 0; }
html.paper .copy .scoring > p { margin: 0; hyphens: auto; text-align: justify; }   /* one shared gap for each scoring paragraph and the pseudocode */
