/* SWE-sweep research: the figures of the Overview (Figure 1, the grading steps; Figures 2 to 7, one per fix) and Method's
   agents' scores table. Loaded after paper.css and swv.css; adds what the figures need and does not change the shared frame. */

/* ------------------------------------------------------------------ Method Figure 1: the grading steps (#fig-1 > #steps).
   The whole figure, caption included, fits the first screen at 1440 x 900 (base step styles in swv.css). */
html.paper .pipeline { margin-top: 18px; margin-bottom: 26px; }
html.paper .pipeline figcaption { margin-top: 7px; }
html.paper .gate-tag { margin-left: 6px; font-size: var(--type-foot); font-variant-caps: all-small-caps; letter-spacing: 0.06em; text-transform: lowercase; color: var(--burgundy); white-space: nowrap; }
html.paper .step-trace .trace-k { display: inline-block; margin-right: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
html.paper .step-trace code { color: var(--ink); }
html.paper .step-trace code.fail { color: var(--burgundy); }
html.paper .step-chip { display: inline-flex; align-items: center; gap: 5px; }
html.paper .step-chip .chip { padding: 0 5px 1px; }
/* phones: the chips stack, so give each a full 24px tap target (the tight padding above is for the 1440 x 900 fold) */
@media (max-width: 560px) { html.paper .step-chip .chip { padding: 3px 6px; } }

html.paper code.bid { white-space: nowrap; }

/* ------------------------------------------------------------------ shared plot overlay (gridlines, the "1 failure" rule)
   It sits over the plot column of a .rows container: label | plot | value, with 4px row padding and 12px gaps. */
html.paper .rows .plot-ov { position: absolute; top: 0; bottom: 40px; left: calc(var(--lw, 132px) + 16px); right: calc(var(--vw, 112px) + 16px); pointer-events: none; }
html.paper .rows .plot-ov .gridline { border-left-color: #ededed; }
html.paper .rows .hrow { position: relative; }
html.paper .rows .hrow .hbar { z-index: 1; }
html.paper .axis-t { margin: 0 4px 0 calc(var(--lw, 132px) + 16px); margin-right: calc(var(--vw, 112px) + 16px); font-size: var(--type-foot); color: var(--muted); text-align: center; }
html.paper .copy .axis-t { text-align: center; }

/* legend key for "other bugs in the task" (Figure 3) */
html.paper .sq-key.track { background: var(--g-track); }

/* Figures 2 and 6: dumbbells */
html.paper .dval { color: var(--muted); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }   /* before → after: muted, the after value in Burgundy */
html.paper .dval .dag { margin-left: 2px; }
html.paper .dumbbell .mk.after { z-index: 2; }
html.paper .dumbbell .mk.before { z-index: 3; background: transparent; box-shadow: inset 0 0 0 2px var(--g-mid); }   /* V20: the ring stays visible over the dot */
html.paper .lane .plot-ov { bottom: 40px; }
html.paper .lane .group-h, html.paper .lane .hrow.total { position: relative; z-index: 1; background: var(--paper); }
html.paper .lane .hrow.total { background: var(--paper); }
html.paper .lane .hrow.total .hscore { font-weight: 400; }
html.paper .lane .lane-rule { left: 36px; }
html.paper .lane .plot-ov .lane-band { position: absolute; left: 0; top: 0; bottom: 0; width: 36px; background: #f6f6f6; border-right: 1px solid var(--line); }
html.paper .lane .hbar .empty-lane { display: none; }
html.paper .none-v { line-height: 1.2; color: var(--muted); white-space: normal; }
html.paper .lane .hscore { white-space: normal; }

/* Figure 4: one square per grading */
html.paper .runs .hrow { align-items: start; padding-top: 7px; padding-bottom: 1px; }
html.paper .runs .r-why-l { margin: 0; padding: 0 4px 7px; border-bottom: 0.6px solid #eeeeee; font-size: var(--type-foot); line-height: 1.3; color: var(--muted); text-align: left; hyphens: manual; }
html.paper .runs .r-why-l:last-child { border-bottom: 0; }
html.paper .runs .hbar { height: auto; }
html.paper .runs .hid { line-height: 1.3; }
html.paper .runs .sqs { display: flex; flex-wrap: wrap; gap: 3px; padding-top: 3px; }
html.paper .runs .hscore { line-height: 1.3; flex-wrap: wrap; gap: 2px 6px; }
html.paper .runs .kn { white-space: nowrap; }
html.paper .runs sup.fn { margin-left: 1px; }

/* Figure 5: duplicates removed (track = bugs, Burgundy segment at its end, label right after it) */
html.paper .bars .hrow { min-height: 24px; }
html.paper .bars .hbar { height: 12px; }
html.paper .bars .cseg { position: absolute; top: 0; bottom: 0; background: var(--burgundy); }
html.paper .bars .endlab { position: absolute; top: 50%; transform: translateY(-52%); font-size: var(--type-foot); white-space: nowrap; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
html.paper .bars .endlab b, html.paper .bars .endlab-ph b { font-weight: 400; color: var(--burgundy); }
html.paper .bars .hscore { display: none; }
html.paper .bars .hrow.total .hbar { height: auto; }
html.paper .bars .hrow.total .tot-l { font-size: var(--type-foot); font-weight: 400; }
html.paper .bars .hrow.total { font-weight: 400; }
html.paper .bars .hrow.total .hid { font-weight: 400; color: var(--muted); }

/* Figure 3: unit grids */
html.paper .units .unit-block .unit-h { margin: 0 0 2px; }
html.paper .units .unit-big { margin: 0; }
html.paper .units .u.on[data-tip] { cursor: help; }
html.paper figure > .units { border-top: 0.6px solid var(--ink); border-bottom: 0.6px solid var(--ink); }

/* Figure 7 (Fix 6): two lines per task. Line 1: task | track of its bugs, hatched where they passed | score;
   line 2: its regression-test failures | their cause. The task name's two spans become grid items (display: contents). */
html.paper .f6 { border-top: 0.6px solid var(--ink); }
html.paper .f6 .hrow { grid-template-areas: "id bar score" "sub cause cause"; row-gap: 0; padding-top: 4px; padding-bottom: 4px; }
html.paper .f6 .hrow + .hrow:not(.total) { border-top: 0.6px solid #eeeeee; }
html.paper .f6 .hname { display: contents; }
html.paper .f6 .hid { grid-area: id; text-align: right; }
html.paper .f6 .hsub { grid-area: sub; text-align: right; line-height: 1.3; }
html.paper .f6 .hcause { grid-area: cause; min-width: 0; font-size: var(--type-foot); line-height: 1.3; color: var(--muted); text-align: left; }
html.paper .f6 .hrow.total { margin-top: 0; }
html.paper .f6 .hrow.total .hid { color: var(--ink); }
html.paper .f6 .readout { padding-left: calc(var(--lw, 132px) + 16px); padding-right: 8px; }

/* Method: the agents' scores table (#runs-table) */
html.paper .runs-table th[scope="row"] { white-space: normal; }
html.paper .runs-table thead th { white-space: normal; vertical-align: bottom; }
html.paper .runs-table .run-sub { display: block; color: var(--muted); }
html.paper .runs-table td.num { white-space: nowrap; }
/* between phone and desktop: the frame makes booktabs fixed-layout at <= 680px */
@media (min-width: 561px) and (max-width: 699px) {
  html.paper .runs-table { table-layout: auto; }
  html.paper .runs-table th:first-child { width: auto; }
  html.paper .runs-table td.num:last-child { white-space: normal; }
  html.paper .runs-table td.num:last-child .muted { display: block; white-space: nowrap; }
  html.paper .runs-table th > span.hide-s { display: none; }
  html.paper .runs-table th > span.show-s { display: inline; }
}


/* ------------------------------------------------------------------ phone */
@media (max-width: 560px) {
  html.paper .f6 .readout { padding-left: 4px; }
  html.paper .rows .plot-ov { left: 2px; right: 2px; }
  html.paper .axis-t { margin-left: 2px; margin-right: 2px; }
  html.paper .lane .plot-ov { display: none; }
  html.paper .lane .hbar .empty-lane { display: block; }
  html.paper .lane .hrow { padding-top: 3px; padding-bottom: 3px; row-gap: 1px; }
  html.paper .bars .hrow { padding-top: 3px; padding-bottom: 3px; row-gap: 2px; }
  html.paper .dumbbell .plot-ov { display: none; }
  html.paper .bars .hscore { display: flex; }
  html.paper .bars .endlab { display: none; }
  html.paper .bars .hrow.total .tot-l { display: none; }
  html.paper .bars .hbar { height: 10px; }
  html.paper .runs .hscore { justify-content: flex-end; }
  html.paper .step-trace .trace-k { display: none; }
  html.paper .runs-table { table-layout: auto; }
  html.paper .runs-table th:first-child { width: auto; }
  html.paper .runs-table th, html.paper .runs-table td { padding-left: 3px; padding-right: 3px; }
  html.paper .runs-table .nowrap { white-space: normal; }
  html.paper .runs-table td.num:last-child { white-space: normal; }
  html.paper .runs-table td.num:last-child .muted { display: block; }
  /* V16 */
  html.paper .runs-table td:last-child .muted { display: block; white-space: nowrap; }
  html.paper .runs-table th { hyphens: none; }
  html.paper .runs-table th:first-child, html.paper .runs-table tbody th { width: 6.2em; }
  html.paper #copies-rows .hrow { grid-template-columns: 86px minmax(0, 1fr) auto; grid-template-areas: "name bar score"; padding: 3px 2px; }
  html.paper .dumbbell:not(.lane) .hrow { padding-top: 3px; padding-bottom: 3px; row-gap: 2px; }
  /* Figure 7: task and score, then the bar, then failures and cause */
  html.paper .f6 .hrow { grid-template-areas: "id score" "bar bar" "sub cause"; row-gap: 3px; padding: 5px 2px; }
  html.paper .f6 .hid, html.paper .f6 .hsub { text-align: left; }
  html.paper .f6 .hcause { text-align: right; }
  html.paper .f6 .hrow.total { grid-template-areas: "id score" "sub sub"; }
  html.paper .runs .hrow { padding-top: 5px; }
  html.paper .runs .r-why-l { padding-bottom: 5px; }
}

/* the narrowest phones: the agents' scores table keeps its six columns at 13.6px with 2px cell padding */
@media (max-width: 360px) {
  html.paper .runs-table th, html.paper .runs-table td { padding-left: 2px; padding-right: 2px; }
}

