/* LMSysDojo project page: section 02, gap analysis (assets/js/gap.js). Everything is scoped under #gap and drawn
 * from the base.css tokens, so both themes work without redraws. */

/* ------------------------------------------------------------------ shared bits */
#gap .g-seg {
  position: relative; display: inline-flex; padding: 3px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); isolation: isolate; max-width: 100%;
}
#gap .g-seg button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  padding: 7px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 520; color: var(--ink-3);
  white-space: nowrap; transition: color .25s var(--ease);
}
#gap .g-seg button:hover { color: var(--ink); }
#gap .g-seg button[aria-pressed="true"] { color: var(--ink); }
#gap .g-seg-thumb {
  position: absolute; z-index: 0; left: 0; top: 3px; bottom: 3px; width: 0; border-radius: 999px;
  background: var(--bg); box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 0 0 1px var(--line);
  transition: transform .5s var(--ease-out), width .5s var(--ease-out);
}
:root[data-theme="dark"] #gap .g-seg-thumb { background: var(--panel-2); box-shadow: 0 0 0 1px var(--line-2); }
/* keep each control's own shape when focused (base.css sets a 6px radius on :focus-visible) */
#gap .g-seg button:focus-visible, #gap .gi-toggle:focus-visible { border-radius: 999px; outline-offset: 2px; }
#gap .gp-step:focus-visible { border-radius: 50%; }
#gap .gpv-chip:focus-visible { border-radius: 14px; }
#gap .gr-mh:focus-visible { border-radius: 8px; outline-offset: 1px; }
#gap .gpv-pre:focus-visible { border-radius: 0; }
#gap .g-grow { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.1s var(--ease-out) var(--d, 0s); }
#gap .g-grown .g-grow { transform: none; }

/* the insight quote: a readable measure for display italic */
#gap .insight { max-width: 860px; }

/* ------------------------------------------------------------------ 1. variance */
/* the paragraph sits under its heading, not centred against the taller chart */
#gap .split { align-items: start; }
#gap .variance.g-on { align-self: center; }
#gap .gv-k { margin: 0 0 18px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
#gap .gv-body { position: relative; padding-bottom: 30px; --lab: 150px; --pad: 52px; }
#gap .gv-grid { position: absolute; top: 0; bottom: 0; left: calc(var(--lab) + 16px); right: var(--pad); pointer-events: none; }
#gap .gv-grid span { position: absolute; top: 0; bottom: 22px; width: 1px; background: var(--line); }
#gap .gv-grid span:first-child { background: var(--line-2); }
#gap .gv-grid em {
  position: absolute; bottom: -22px; left: 0; transform: translateX(-50%);
  font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--ink-3);
}
#gap .gv-group { position: relative; padding: 4px 0 14px; }
#gap .gv-group + .gv-group { margin-top: 8px; }
#gap .gv-name { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; font-size: 14.5px; }
#gap .gv-name b { font-weight: 600; }
#gap .gv-name span { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
#gap .gv-row { display: grid; grid-template-columns: var(--lab) minmax(0, 1fr); gap: 16px; align-items: center; min-height: 38px; }
#gap .gv-lab { font-size: 13.5px; color: var(--ink-2); line-height: 1.25; }
#gap .gv-lab small { display: block; font-size: 11.5px; color: var(--ink-3); }
#gap .gv-track { position: relative; height: 14px; margin-right: var(--pad); }
#gap .gv-bar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 0 4px 4px 0; }
#gap .gv-val {
  position: absolute; top: 50%; margin-left: 9px; transform: translateY(-50%);
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums;
}
#gap .gv-group[data-k="gap"] { --c: var(--s-gap); }
#gap .gv-group[data-k="structured"] { --c: var(--s-structured); }
#gap .gv-full .gv-bar { background: var(--c); }
#gap .gv-fix .gv-bar { background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: inset 0 0 0 1.5px var(--c); }
#gap .gv-foot { display: flex; align-items: baseline; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
#gap .gv-big { font-size: clamp(30px, 3vw, 40px); font-weight: 520; letter-spacing: -.035em; line-height: 1; color: var(--blue); font-variant-numeric: tabular-nums; white-space: nowrap; }
#gap .gv-note { font-size: 14px; line-height: 1.45; color: var(--ink-3); max-width: 380px; }
@media (max-width: 560px) {
  #gap .gv-body { --pad: 46px; }
  #gap .gv-grid { left: 0; }
  #gap .gv-row { grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 4px 0 6px; }
  #gap .gv-lab small { display: inline; margin-left: 8px; }
  #gap .gv-name { flex-wrap: wrap; row-gap: 0; }
  #gap .gv-foot { flex-direction: column; gap: 8px; }
}

/* ------------------------------------------------------------------ 2. parallel */
#gap .gp-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: stretch; }
#gap .gp-pool { position: relative; background: var(--panel); border-radius: var(--rad-lg); padding: 24px 26px 22px; --bx: 14px; --cg: 6px; --th: 18px; }
#gap .gp-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
#gap .gp-k { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
#gap .gp-kline { font-size: 34px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
#gap .gp-kline i { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 400; }
#gap .gp-kval { display: inline-block; min-width: 1.2em; color: var(--blue); }
#gap .gp-steps { display: flex; gap: 8px; }
#gap .gp-step {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink);
  font-size: 19px; line-height: 1; cursor: pointer; display: grid; place-items: center;
  transition: border-color .2s, transform .2s var(--ease), color .2s;
}
#gap .gp-step:hover:not([aria-disabled="true"]) { border-color: var(--ink-4); transform: translateY(-1px); }
#gap .gp-step:active:not([aria-disabled="true"]) { transform: scale(.94); }
#gap .gp-step[aria-disabled="true"] { color: var(--ink-4); cursor: default; }
#gap .gp-range-wrap { padding: 0 calc(var(--bx) + 1.5px + (100% - 2 * var(--bx) - 3px - 9 * var(--cg)) / 20 - var(--th) / 2); margin: 0 0 12px; }
#gap .gp-range { display: block; width: 100%; height: 22px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
#gap .gp-range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--blue) var(--p, 44%), var(--line-2) var(--p, 44%)); }
#gap .gp-range::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--blue) var(--p, 44%), var(--line-2) var(--p, 44%)); }
#gap .gp-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: var(--th); height: var(--th); margin-top: -7px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--blue); box-shadow: 0 1px 3px rgba(16, 24, 40, .18); transition: transform .2s var(--ease);
}
#gap .gp-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--blue); box-shadow: 0 1px 3px rgba(16, 24, 40, .18); }
#gap .gp-range:hover::-webkit-slider-thumb { transform: scale(1.12); }
#gap .gp-range:focus-visible { outline: none; }
#gap .gp-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue); }
#gap .gp-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue); }
#gap .gp-box { position: relative; border: 1.5px dashed color-mix(in srgb, var(--blue) 62%, transparent); border-radius: 16px; padding: 10px var(--bx) 8px; background: var(--bg); }
#gap .gp-box-k { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
#gap .gp-box-k > span:first-child { font-family: var(--mono); font-size: 11.5px; font-weight: 650; color: var(--ink-2); }
#gap .gp-strip { position: relative; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: var(--cg); height: 176px; --area: 130px; }
/* the pick's level: a dashed line at the highest predicted gain, moved by transform */
#gap .gp-level {
  position: absolute; left: -6px; right: -6px; bottom: 24px; height: 0; border-top: 1px dashed color-mix(in srgb, var(--blue) 55%, transparent);
  transform: translateY(calc(var(--hw, 0) * -1 * var(--area))); transition: transform .6s var(--ease-out); pointer-events: none;
}
#gap .gp-cell { position: relative; display: flex; flex-direction: column; justify-content: flex-end; cursor: pointer; --bh: calc((100% - 46px) * var(--h)); }
#gap .gp-bar {
  position: absolute; left: 0; right: 0; bottom: 24px; height: var(--bh); border-radius: 5px 5px 2px 2px;
  background: var(--blue-3); transform-origin: 50% 100%; transform: scaleY(0);
  transition: transform .7s var(--ease-out), background-color .35s var(--ease);
}
#gap .gp-cell::before { content: ""; position: absolute; left: 0; right: 0; bottom: 24px; height: 2px; border-radius: 2px; background: var(--line-2); }
#gap .gp-cell.on .gp-bar { transform: none; }
#gap .gp-cell.win .gp-bar { background: var(--blue); }
#gap .gp-cell:hover .gp-bar { filter: brightness(1.04); }
#gap .gp-idx { position: relative; height: 18px; font-family: var(--mono); font-size: 11px; line-height: 18px; text-align: center; color: var(--ink-3); transition: color .3s; }
#gap .gp-cell.on .gp-idx { color: var(--ink); }
#gap .gp-cell.win .gp-idx { color: var(--blue-ink); font-weight: 650; }
#gap .gp-pick {
  position: absolute; left: 50%; bottom: calc(24px + var(--bh) + 5px); transform: translate(-50%, 4px); opacity: 0;
  font-family: var(--mono); font-size: 10.5px; font-weight: 650; color: var(--blue-ink); letter-spacing: .02em;
  transition: opacity .35s var(--ease), transform .45s var(--ease-out);
}
#gap .gp-cell.win .gp-pick { opacity: 1; transform: translate(-50%, 0); }
#gap .gp-wire { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
#gap .gp-wire-path { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-linecap: round; }
#gap .gp-wire-dot { fill: var(--blue); stroke: var(--panel); stroke-width: 2; opacity: 0; }
#gap .gp-flow { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 46px; }
#gap .gp-impl, #gap .gp-meas { position: relative; display: inline-flex; flex-direction: column; align-items: center; padding: 8px 16px 7px; border-radius: 12px; line-height: 1.25; }
#gap .gp-impl { background: var(--block); color: var(--on-block); }
#gap .gp-impl::before {
  content: ""; position: absolute; left: 50%; top: -7px; margin-left: -5px;
  border: 5px solid transparent; border-top: 6px solid var(--ink-3); border-bottom: 0;
}
#gap .gp-impl b, #gap .gp-meas b { font-family: var(--mono); font-size: 13.5px; font-weight: 650; white-space: nowrap; }
#gap .gp-impl small, #gap .gp-meas small { font-size: 11.5px; white-space: nowrap; }
#gap .gp-impl small { opacity: .72; }
#gap .gp-meas { background: var(--violet-bg); color: var(--violet); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--violet) 55%, transparent); }
#gap .gp-arrow { position: relative; width: 26px; height: 1.5px; background: var(--ink-3); flex: none; }
#gap .gp-arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 4.75px solid transparent; border-left: 6px solid var(--ink-3); border-right: 0; }
#gap .gp-impl.hit { animation: gpRing .9s var(--ease-out); }
#gap .gp-meas.hit { animation: gpRingV .9s var(--ease-out); }
@keyframes gpRing { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue) 45%, transparent); } to { box-shadow: 0 0 0 10px transparent; } }
@keyframes gpRingV { from { box-shadow: inset 0 0 0 1.5px var(--violet), 0 0 0 0 color-mix(in srgb, var(--violet) 40%, transparent); } to { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--violet) 55%, transparent), 0 0 0 10px transparent; } }
#gap .gp-pool-cap { margin: 18px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-3); text-align: center; }

#gap .gp-chart { background: var(--bg); border: 1px solid var(--line); border-radius: var(--rad-lg); padding: 22px 22px 16px; min-width: 0; }
#gap .gp-chart-head h4, #gap .gp-hr-head h4 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 2px; }
#gap .gp-chart-head .cap, #gap .gp-hr-head .cap { margin: 0 0 14px; font-size: 13.5px; }
#gap .gp-chost .chart-legend { font-size: 13px; margin-bottom: 8px; }
#gap .gp-chost .hit { cursor: pointer; }
#gap .gp-ov { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; opacity: 0; transition: opacity .6s var(--ease); }
#gap .gp-ov.in { opacity: 1; }
#gap .gp-ov-g, #gap .gp-ov-dot { transition: transform .55s var(--ease-out); }
#gap .gp-ov-line { stroke: var(--blue); stroke-width: 1; }
#gap .gp-ov-tagbg { fill: var(--blue-fill); }
#gap .gp-ov-tag { fill: var(--on-blue); font-family: var(--mono); font-size: 11px; font-weight: 650; }
#gap .gp-ov-dot { stroke: var(--bg); stroke-width: 2; }
#gap .gp-ov .gp-ov-dot { transition: transform .55s var(--ease-out), opacity .2s; }
#gap .gp-ov-dot.dim { opacity: .18; }
#gap .gp-read { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px 12px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
#gap .gp-read-k { grid-column: 1 / -1; margin: 0 0 2px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
#gap .gp-read-k span { color: var(--blue-ink); font-weight: 650; }
/* each readout item is the series' legend button: press to show or hide it */
#gap .gp-read-i {
  display: grid; grid-template-columns: 14px minmax(0, 1fr); align-items: center; align-content: start; column-gap: 7px;
  margin: -4px -6px; padding: 4px 6px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background-color .2s var(--ease);
}
#gap .gp-read-i > * { transition: opacity .2s var(--ease); }
#gap .gp-read-i:hover { background: var(--bg-soft); }
/* a hidden series dims its contents, not the button, so the focus ring keeps full contrast */
#gap .gp-read-i[aria-pressed="false"] > * { opacity: .4; }
#gap .gp-read-i small { grid-column: 2; font-family: var(--mono); font-size: 10.5px; line-height: 1.3; color: var(--ink-3); white-space: nowrap; }
#gap .gp-read-i i { width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
#gap .gp-read-i i.dash { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }
#gap .gp-read-i span { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#gap .gp-read-i b { grid-column: 2; font-family: var(--mono); font-size: 17px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

#gap .gp-hr { margin-top: 20px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--rad-lg); padding: 22px 24px 18px; }
#gap .gp-hr-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 24px; }
#gap .gp-hr-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-3); padding-top: 3px; }
#gap .gp-hr-leg span { display: inline-flex; align-items: center; gap: 7px; }
#gap .gp-hr-leg i { display: inline-block; width: 10px; height: 10px; }
#gap .gp-hr-leg .m-dot { border-radius: 50%; background: var(--ink-3); }
#gap .gp-hr-leg .m-tri { background: var(--ink-3); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
#gap .gp-hr-leg .m-ring { border-radius: 50%; box-shadow: inset 0 0 0 1.75px var(--ink-3); }
#gap .gp-hr-leg .m-arrow { width: 16px; height: 2px; background: var(--s-iterative); position: relative; }
#gap .gp-hr-leg .m-arrow::after { content: ""; position: absolute; right: -2px; top: -3.5px; border: 4.5px solid transparent; border-left: 6px solid var(--s-iterative); border-right: 0; }
#gap .gp-hr-plot { margin-top: 4px; }
#gap .gp-hr-plot svg { display: block; overflow: visible; }
#gap .gp-hr-grid { stroke: var(--line); stroke-width: 1; }
#gap .gp-hr-tick { font-family: var(--mono); font-size: 11px; fill: var(--ink-3); }
#gap .gp-hr-lab { font-family: var(--sans); font-size: 13.5px; fill: var(--ink-2); }
#gap .gp-hr-span { stroke: color-mix(in srgb, var(--c) 26%, transparent); stroke-width: 6; stroke-linecap: round; }
#gap .gp-hr-mean, #gap .gp-hr-pick { fill: var(--c); }
#gap .gp-hr-oracle { fill: var(--bg); stroke: var(--c); stroke-width: 2; }
#gap .gp-hr-val { font-family: var(--mono); font-size: 11.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
#gap .gp-hr-it { fill: var(--blue-ink); font-weight: 650; }
#gap .gp-hr-arrow { stroke: var(--s-iterative); stroke-width: 2.2; fill: none; }
#gap .gp-hr-head { fill: var(--s-iterative); }
#gap .gp-hr-row { opacity: 0; transition: opacity .9s var(--ease-out) var(--d, 0s); }
#gap .gp-hr.g-grown .gp-hr-row { opacity: 1; }
#gap .gp-hr-note { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-3); max-width: 880px; }
#gap .gp-hr-note b { color: var(--ink-2); font-weight: 600; }
@media (max-width: 1080px) {
  #gap .gp-grid { grid-template-columns: minmax(0, 1fr); }
  #gap .gp-pool > :not(.gp-wire) { max-width: 560px; margin-left: auto; margin-right: auto; }
}
@media (max-width: 560px) {
  #gap .gp-pool { padding: 20px 16px 18px; --bx: 10px; --cg: 4px; }
  #gap .gp-strip { height: 132px; --area: 86px; }
  #gap .gp-chart, #gap .gp-hr { padding: 18px 14px 14px; }
  #gap .gp-read { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; }
  #gap .gp-pick { font-size: 9.5px; }
}

/* ------------------------------------------------------------------ 3. provenance */
#gap .gpv-main { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: stretch; }
#gap .gpv-code { display: flex; flex-direction: column; background: var(--panel); border-radius: var(--rad-lg); overflow: hidden; min-width: 0; }
#gap .gpv-run { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding: 12px 20px 14px 22px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
#gap .gpv-run-k { color: var(--ink-3); margin-right: 2px; }
#gap .gpv-run-v { padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
#gap .gpv-run-v b { color: var(--blue-ink); font-weight: 650; }
#gap .gpv-code-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 10px 22px; }
#gap .gpv-code-head b { display: block; font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
#gap .gpv-code-head > div:first-child span { font-size: 13.5px; font-style: italic; color: var(--ink-3); }
#gap .gpv-pred { flex: none; text-align: right; padding: 7px 13px 6px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); line-height: 1.2; }
#gap .gpv-pred span { display: block; font-family: var(--mono); font-size: 11px; font-weight: 650; color: var(--ink-2); }
#gap .gpv-pred b { font-family: var(--sans); font-size: 21px; font-weight: 600; letter-spacing: -.02em; color: var(--blue-ink); font-variant-numeric: tabular-nums; }
#gap .gpv-pre { margin: 0; padding: 4px 0 18px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.8; color: var(--ink); outline-offset: -3px; }
#gap .gpv-ln { display: grid; grid-template-columns: 38px 24px max-content; align-items: center; width: max-content; min-width: 100%; padding-right: 20px; transition: background-color .3s var(--ease), opacity .3s var(--ease), box-shadow .3s var(--ease); }
#gap .gpv-no { text-align: right; padding-right: 10px; color: var(--ink-4); font-size: 11px; user-select: none; }
#gap .gpv-src { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; font-size: 10px; font-weight: 700; line-height: 1; }
#gap .gpv-txt { white-space: pre; }
#gap .gpv-txt .cm { color: var(--ink-3); font-style: italic; }
#gap .gpv-txt .kw { color: var(--blue-deep); font-weight: 650; }
#gap .gpv-txt .pc-C, #gap .gpv-txt .pc-E, #gap .gpv-txt .pc-A { padding: 1px 3px; margin: 0 -3px; font-weight: 600; }
#gap .has-C .gpv-src { color: var(--blue-ink); background: color-mix(in srgb, var(--blue) 14%, transparent); }
#gap .has-E .gpv-src { color: var(--aqua-ink); background: color-mix(in srgb, var(--aqua) 16%, transparent); }
#gap .has-A .gpv-src { color: var(--orange-ink); background: color-mix(in srgb, var(--orange) 18%, transparent); }
/* the source inks a step deeper in the viewer, where tokens sit on tinted rows over the grey panel (AA in both themes) */
#gap .gpv { --pc-c: color-mix(in srgb, var(--blue-ink) 75%, var(--ink)); --pc-e: color-mix(in srgb, var(--aqua-ink) 75%, var(--ink)); --pc-a: color-mix(in srgb, var(--orange-ink) 75%, var(--ink)); }
#gap .gpv-txt .pc-C, #gap .has-C .gpv-src, #gap .gpv-chip-k.pc-C { color: var(--pc-c); }
#gap .gpv-txt .pc-E, #gap .has-E .gpv-src, #gap .gpv-chip-k.pc-E { color: var(--pc-e); }
#gap .gpv-txt .pc-A, #gap .has-A .gpv-src, #gap .gpv-chip-k.pc-A { color: var(--pc-a); }
#gap .gpv-ln.lit.has-C { background: color-mix(in srgb, var(--blue) 9%, transparent); box-shadow: inset 2px 0 0 var(--blue); }
#gap .gpv-ln.lit.has-E { background: color-mix(in srgb, var(--aqua) 10%, transparent); box-shadow: inset 2px 0 0 var(--aqua); }
#gap .gpv-ln.lit.has-A { background: color-mix(in srgb, var(--orange) 10%, transparent); box-shadow: inset 2px 0 0 var(--orange); }
#gap .gpv-focus .gpv-ln:not(.lit) { opacity: .36; }
#gap .gpv-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
#gap .gpv-chips { display: flex; flex-direction: column; gap: 8px; }
#gap .gpv-chip {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); text-align: left; cursor: pointer;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
  --c: var(--blue);
}
#gap .gpv-chip[data-src="E"] { --c: var(--aqua); }
#gap .gpv-chip[data-src="A"] { --c: var(--orange); }
#gap .gpv-chip:hover { transform: translateY(-1px); }
#gap .gpv-chip.lit, #gap .gpv-chip[aria-pressed="true"] { border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 13%, transparent); }
#gap .gpv-chip-k { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px !important; font-family: var(--mono); font-size: 14px; font-weight: 700; }
#gap .gpv-chip-t { line-height: 1.3; min-width: 0; }
#gap .gpv-chip-t b { font-size: 14.5px; font-weight: 600; color: var(--ink); }
#gap .gpv-chip-r { margin-left: 7px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
#gap .gpv-chip-t small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
#gap .gpv-chip-n { font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
#gap .gpv-yaml { padding: 14px 16px 6px; border-radius: 16px; background: var(--panel); transition: box-shadow .3s var(--ease); }
#gap .gpv-yaml.lit { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--orange) 55%, transparent); }
#gap .gpv-yaml-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
#gap .gpv-yaml-head b { font-family: var(--mono); font-size: 13px; font-weight: 700; }
#gap .gpv-yaml-head span { font-size: 12px; color: var(--ink-3); }
#gap .gpv-a code { display: block; padding: 0; background: none; font-size: 12.5px; color: var(--ink-2); }
#gap .gpv-a-n { color: var(--orange-ink); font-weight: 600; }
#gap .gpv-a code b { color: var(--ink); font-weight: 650; }
#gap .gpv-a p { margin: 3px 0 12px; padding-left: 12px; border-left: 2px solid color-mix(in srgb, var(--orange) 38%, transparent); font-size: 13px; line-height: 1.5; color: var(--ink-2); }

#gap .gpv-out { margin-top: 20px; padding: 22px 24px 16px; border-radius: var(--rad-lg); border: 1px solid var(--line); background: var(--bg); }
#gap .gpv-out-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 24px; }
#gap .gpv-out-head h4 { font-size: 16px; font-weight: 600; margin: 0 0 2px; }
#gap .gpv-out-head .cap { margin: 0 0 10px; font-size: 13.5px; }
#gap .gpv-leg { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-3); padding-top: 3px; }
#gap .gpv-leg span { display: inline-flex; align-items: center; gap: 7px; }
#gap .gpv-leg i { width: 16px; height: 9px; border-radius: 0 2px 2px 0; }
#gap .gpv-leg i.p, #gap .gpv-bar-t.p i { background: color-mix(in srgb, var(--blue) 12%, transparent); box-shadow: inset 0 0 0 1.5px var(--blue); }
#gap .gpv-leg i.m, #gap .gpv-bar-t.m i { background: var(--violet); }
#gap .gpv-bar-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 84px; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
#gap .gpv-bar-row:first-child { border-top: 0; }
#gap .gpv-bar-m { font-family: var(--mono); font-size: 13px; font-weight: 650; color: var(--ink); }
#gap .gpv-bar-tracks { display: block; margin-right: 64px; }
#gap .gpv-bar-t { position: relative; display: block; height: 11px; margin: 4px 0; }
#gap .gpv-bar-t i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 0 3px 3px 0; }
#gap .gpv-bar-t b { position: absolute; left: var(--w); top: 50%; transform: translateY(-50%); margin-left: 8px; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
#gap .gpv-bar-t.m b { color: var(--violet); }
#gap .gpv-bar-e { text-align: right; line-height: 1.25; }
#gap .gpv-bar-e { position: relative; }
#gap .gpv-bar-e small { position: absolute; right: 0; bottom: 100%; margin-bottom: 4px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
#gap .gpv-bar-e b { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink-2); }
#gap .gpv-conf { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-3); }
#gap .gpv-conf b { color: var(--ink-2); font-weight: 600; }

#gap .gpv-corpus { margin-top: 28px; }
#gap .gpv-corpus-k { margin: 0 0 4px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
#gap .gpv-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#gap .gpv-fact { padding: 20px 22px 18px 0; }
#gap .gpv-fact + .gpv-fact { padding-left: 22px; border-left: 1px solid var(--line); }
#gap .gpv-fact-n { font-size: clamp(30px, 3vw, 38px); font-weight: 520; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
#gap .gpv-fact-n small { font-size: .45em; font-weight: 500; letter-spacing: 0; color: var(--ink-3); }
#gap .gpv-fact-bar { position: relative; display: block; height: 4px; margin: 14px 0 12px; border-radius: 2px; background: var(--line); overflow: hidden; }
#gap .gpv-fact-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 2px; background: var(--ink); }
#gap .gpv-lit .gpv-fact-bar i { background: var(--ink-3); }
#gap .gpv-zc .gpv-fact-bar i { background: var(--blue); }
#gap .gpv-fact p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 1080px) {
  #gap .gpv-main { grid-template-columns: minmax(0, 1fr); }
  #gap .gpv-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 760px) {
  #gap .gpv-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  #gap .gpv-pre { font-size: 11.5px; }
  #gap .gpv-code-head { flex-direction: column; gap: 10px; }
  #gap .gpv-pred { text-align: left; }
  #gap .gpv-facts { grid-template-columns: minmax(0, 1fr); }
  #gap .gpv-fact, #gap .gpv-fact + .gpv-fact { padding: 18px 0 16px; border-left: 0; }
  #gap .gpv-fact + .gpv-fact { border-top: 1px solid var(--line); }
  #gap .gpv-bar-row { grid-template-columns: 44px minmax(0, 1fr) 62px; gap: 10px; }
  #gap .gpv-bar-tracks { margin-right: 54px; }
  #gap .gpv-out { padding: 18px 16px 12px; }
}

/* ------------------------------------------------------------------ 4. iterative */
#gap .gi-stage {
  --gi-mode: w;
  position: relative; display: grid; grid-template-columns: 186px minmax(0, 1.3fr) 158px 188px;
  grid-template-areas: "an ck cand impl" "fresh find find find"; column-gap: 70px; row-gap: 62px; align-items: center;
  padding: 44px 32px 30px; border-radius: var(--rad-lg); border: 1px solid var(--line);
  background-color: var(--bg-soft); background-image: radial-gradient(var(--dot) 1px, transparent 1.3px); background-size: 22px 22px;
}
#gap .gi-node {
  position: relative; z-index: 1; padding: 12px 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line-2);
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease), background-color .35s var(--ease);
}
#gap .gi-node > b { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
#gap .gi-node > small { display: block; margin-top: 2px; font-size: 12.5px; font-style: italic; line-height: 1.35; color: var(--ink-3); }
#gap .gi-node > small.mono { font-style: normal; font-size: 11.5px; margin-top: 1px; }
#gap .gi-node.on { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 14%, transparent); }
#gap .gi-an { grid-area: an; }
#gap .gi-cand { grid-area: cand; }
#gap .gi-fresh { grid-area: fresh; }
#gap .gi-impl { grid-area: impl; background: var(--block); color: var(--on-block); border-color: var(--block); }
#gap .gi-impl > b { font-family: var(--mono); font-size: 15px; font-weight: 700; }
#gap .gi-impl > small { color: color-mix(in srgb, var(--on-block) 72%, transparent); }
#gap .gi-impl .gi-ico { width: 18px; height: 18px; stroke: currentColor; }
#gap .gi-impl.on { border-color: var(--block); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 30%, transparent); }
#gap .gi-impl::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; }
#gap .gi-impl.on::after { animation: giRing 1.4s var(--ease-out); }
@keyframes giRing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue) 50%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
#gap .gi-checks { grid-area: ck; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--bg); border: 1.5px dashed color-mix(in srgb, var(--blue) 62%, transparent); }
#gap .gi-checks.on { border-color: var(--blue); border-style: dashed; }
#gap .gi-check {
  position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 11px; background: var(--panel); transition: background-color .35s var(--ease), box-shadow .35s var(--ease);
}
#gap .gi-check b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
#gap .gi-check small { display: block; font-size: 12.5px; font-style: italic; color: var(--ink-3); line-height: 1.35; }
#gap .gi-check .gi-ico { width: 34px; height: 34px; padding: 7px; border-radius: 9px; background: var(--blue-bg); stroke: var(--blue); }
#gap .gi-ico { display: block; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
#gap .gi-check.on { background: var(--blue-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 40%, transparent); }
#gap .gi-check::after {
  position: absolute; right: 10px; top: 8px; font-family: var(--mono); font-size: 10px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  opacity: 0; transform: translateY(-3px); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
#gap .gi-check.stop::after { content: "stopped"; color: var(--orange-ink); opacity: 1; transform: none; }
#gap .gi-check.pass::after { content: "passed"; color: var(--blue-ink); opacity: 1; transform: none; }
#gap .gi-narrow { display: none !important; }
#gap .gi-tries { display: flex; gap: 5px; margin-top: 8px; }
#gap .gi-tries i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--blue-3); transition: background-color .3s, box-shadow .3s; }
#gap .gi-tries i.lit { background: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
#gap .gi-find { grid-area: find; padding: 0; border: 0; background: none; }
#gap .gi-find.on { box-shadow: none; }
#gap .gi-find-k { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
#gap .gi-find-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 14px; }
#gap .gi-card { padding: 12px 14px 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line-2); transition: border-color .35s var(--ease), box-shadow .35s var(--ease); }
#gap .gi-card.on { border-color: color-mix(in srgb, var(--orange) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 12%, transparent); }
#gap .gi-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
#gap .gi-card-h b { font-size: 14px; font-weight: 600; }
#gap .gi-np { padding: 1px 8px; border-radius: 999px; border: 1px dashed var(--ink-4); font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
#gap .gi-trace { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
#gap .gi-tt { border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
#gap .gi-tt th, #gap .gi-tt td { padding: 1px 10px 1px 0; text-align: right; }
#gap .gi-tt thead th { font-size: 11px; font-weight: 500; color: var(--ink-3); }
#gap .gi-tt tbody th { text-align: left; font-weight: 650; color: var(--ink-2); padding-right: 14px; }
#gap .gi-tt td { color: var(--ink); }
#gap .gi-tt td.lev { color: var(--blue-ink); font-weight: 650; }
#gap .gi-ratio { text-align: right; line-height: 1.15; }
#gap .gi-ratio small { display: block; font-family: var(--mono); font-size: 11px; font-weight: 650; color: var(--ink-2); }
#gap .gi-ratio b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 650; color: var(--blue-ink); letter-spacing: -.02em; }
#gap .gi-ratio span { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
#gap .gi-quote { margin: 0 0 10px; font-size: 13px; font-style: italic; line-height: 1.5; color: var(--ink-2); }
#gap .gi-q-a { font-style: normal; font-size: 11.5px; color: var(--orange-ink); background: color-mix(in srgb, var(--orange) 14%, transparent); padding: 0 .3em; word-break: break-all; }
#gap .gi-fix { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
#gap .gi-fix-v { padding: 5px 11px 4px; border-radius: 10px; background: var(--panel); line-height: 1.15; text-align: center; }
#gap .gi-fix-v small { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 650; color: var(--ink-3); }
#gap .gi-fix-v b { font-family: var(--mono); font-size: 17px; font-weight: 650; color: var(--ink); }
#gap .gi-fix-c b { color: var(--blue-ink); }
#gap .gi-fix-arrow, #gap .gi-to { position: relative; display: inline-block; width: 18px; height: 1.5px; background: var(--ink-3); vertical-align: middle; }
#gap .gi-fix-arrow::after, #gap .gi-to::after { content: ""; position: absolute; right: -1px; top: -3.75px; border: 4.5px solid transparent; border-left: 6px solid var(--ink-3); border-right: 0; }
#gap .gi-fix-note { flex: 1 1 140px; font-size: 12.5px; font-style: italic; line-height: 1.4; color: var(--ink-3); }
#gap .gi-wires { position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; overflow: visible; }
#gap .gi-edge { fill: none; stroke: var(--ink-4); stroke-width: 1.5; stroke-linecap: round; transition: stroke .35s var(--ease); }
#gap .gi-head { fill: var(--ink-4); transition: fill .35s var(--ease); }
#gap .gi-edge.run { stroke: var(--blue); }
#gap .gi-head.run { fill: var(--blue); }
#gap .gi-lab { position: absolute; left: 0; top: 0; z-index: 2; font-size: 12.5px; font-style: italic; line-height: 1.2; color: var(--ink-3); white-space: nowrap; pointer-events: none; transition: color .35s var(--ease); }
#gap .gi-lab.run { color: var(--blue-ink); }
#gap .gi-lab.pill { padding: 4px 11px; border-radius: 999px; background: var(--blue-fill); color: var(--on-blue); font-style: normal; font-size: 12px; font-weight: 600; box-shadow: 0 0 0 4px var(--bg-soft); }
#gap .gi-token {
  position: absolute; left: -6px; top: -6px; z-index: 3; width: 12px; height: 12px; border-radius: 50%; background: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 20%, transparent), 0 0 18px color-mix(in srgb, var(--blue) 50%, transparent);
  opacity: 0; transition: opacity .2s var(--ease); pointer-events: none; will-change: transform;
}
#gap .gi-token.show { opacity: 1; }
#gap .gi-schem { position: absolute; top: 12px; right: 14px; z-index: 2; background: var(--bg-soft); }

#gap .gi-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1.25fr); margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#gap .gi-stat { padding: 22px 26px 20px 0; min-width: 0; }
#gap .gi-stat + .gi-stat { padding-left: 26px; border-left: 1px solid var(--line); }
#gap .gi-stat-n { display: flex; align-items: center; gap: 12px; font-size: clamp(30px, 3vw, 38px); font-weight: 520; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
#gap .gi-stat-n small { font-size: .5em; font-weight: 500; color: var(--ink-2); margin-left: -10px; letter-spacing: 0; }
#gap .gi-stat-n .gi-to { width: 24px; }
#gap .gi-stat p { margin: 10px 0 14px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
#gap .gi-stat p.gi-stat-k { margin-top: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
#gap .gi-geos { position: relative; display: grid; gap: 7px; padding-bottom: 18px; }
#gap .gi-geo { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 10px; }
#gap .gi-geo-l { font-size: 12.5px; color: var(--ink-3); }
#gap .gi-geo-t { position: relative; height: 10px; margin-right: 52px; }
#gap .gi-geo-t i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 0 3px 3px 0; }
#gap .gi-geo.stop i { background: var(--ink-4); }
#gap .gi-geo.pass i { background: var(--blue); }
#gap .gi-geo-t b { position: absolute; left: var(--w); top: 50%; margin-left: 8px; transform: translateY(-50%); font-family: var(--mono); font-size: 12px; font-weight: 650; color: var(--ink-2); }
#gap .gi-geo-ax { position: absolute; left: 68px; right: 52px; bottom: 0; display: flex; justify-content: space-between; }
#gap .gi-geo-ax em { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); transform: translateX(-50%); }
#gap .gi-geo-ax em:last-child { transform: translateX(50%); }
#gap .gi-abl { display: grid; gap: 0; }
#gap .gi-abl-r { display: grid; grid-template-columns: minmax(0, 1fr) 44%; align-items: center; gap: 14px; min-height: 27px; }
#gap .gi-abl-l { font-size: 12.5px; color: var(--ink-2); line-height: 1.3; }
#gap .gi-abl-r.both .gi-abl-l { color: var(--ink); font-weight: 600; }
#gap .gi-abl-t { position: relative; height: 27px; margin-right: 38px; }
#gap .gi-abl-t::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
#gap .gi-abl-t i { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--ink-3); }
#gap .gi-abl-t b { position: absolute; top: 50%; margin-left: 10px; transform: translateY(-50%); font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
#gap .gi-abl-r.both i { background: var(--blue); width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
#gap .gi-abl-r.both b { color: var(--blue-ink); }
#gap .gi-abl-ax .gi-abl-t::before { display: none; }
#gap .gi-abl-ax em { position: absolute; top: 4px; transform: translateX(-50%); font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
#gap .gi-tog-row { margin-top: 18px; }
#gap .gi-toggle {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--ink-2); font-size: 14px; font-weight: 520; cursor: pointer; transition: border-color .2s, color .2s;
}
#gap .gi-toggle:hover { color: var(--ink); border-color: var(--ink-4); }
#gap .gi-toggle .gi-ico { width: 16px; height: 16px; stroke: var(--blue); }
#gap .gi-chev { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .3s var(--ease); }
#gap .gi-toggle[aria-expanded="true"] .gi-chev { transform: translateY(1px) rotate(-135deg); }
#gap .gi-code { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 14px; animation: giIn .5s var(--ease-out); }
@keyframes giIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#gap .gi-codep .code-head { background: var(--panel-2); color: var(--ink); }
#gap .gi-codep .code-head .meta { color: var(--ink-3); opacity: 1; }
#gap .gi-codep pre { font-size: 12.5px; }
#gap .gi-codep .str { color: var(--ink-3); }
#gap .gi-STOP { color: var(--orange-ink); }
#gap .gi-PASS { color: var(--blue-ink); }
/* tighter side columns before the checks column drops under ~280px, where a status tag would cover its title */
@media (max-width: 1150px) {
  #gap .gi-stage { grid-template-columns: 142px minmax(0, 1.4fr) 124px 142px; column-gap: 54px; padding: 44px 24px 26px; }
}
@media (max-width: 1080px) {
  #gap .gi-find-cards { grid-template-columns: minmax(0, 1fr); }
  /* the tag goes under the kicker, so the kicker stays right of the "stopped" wire */
  #gap .gi-find-k { flex-direction: column; align-items: flex-end; gap: 6px; }
  #gap .gi-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #gap .gi-stat-abl { grid-column: 1 / -1; border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid var(--line); }
}
/* below ~980px the four columns leave the checks too narrow for their titles: stack the flow (gap.js reads --gi-mode) */
@media (max-width: 980px) {
  #gap .gi-find-k { flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; }
  #gap .gi-narrow { display: block !important; color: var(--blue-ink) !important; }
  #gap .gi-stage { --gi-mode: n; grid-template-columns: minmax(0, 1fr); grid-template-areas: "an" "ck" "cand" "impl" "find" "fresh"; row-gap: 40px; padding: 48px 28px 26px; }
}
@media (max-width: 760px) {
  #gap .gi-stats { grid-template-columns: minmax(0, 1fr); }
  #gap .gi-stat, #gap .gi-stat + .gi-stat { padding: 20px 0 18px; border-left: 0; }
  #gap .gi-stat + .gi-stat { border-top: 1px solid var(--line); }
  #gap .gi-code { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ 5. results table */
#gap .gr-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 0 0 16px; }
#gap .gr-left, #gap .gr-right { display: flex; flex-wrap: wrap; gap: 10px; }
#gap .gr-scroll { background: var(--bg); }
/* more columns off to the right: fade the edge (gap.js sets .at-end once the last column is in view) */
#gap .gr-scroll:not(.at-end) {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
}
#gap .gr-tbl { font-size: 14.5px; }
#gap .gr-tbl thead th { padding-top: 10px; padding-bottom: 10px; vertical-align: bottom; }
#gap .gr-tbl th[scope="row"] { font-weight: 500; color: var(--ink); background: inherit; }
#gap .gr-tbl th.ind1, #gap .gr-tbl th.ind2 { color: var(--ink-2); font-weight: 450; }
#gap .gr-tbl th.ind1 { padding-left: 32px; }
#gap .gr-tbl th.ind2 { padding-left: 50px; }
#gap .gr-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; background: var(--c); margin: 0 10px 0 0; vertical-align: middle; position: relative; top: -1px; }
#gap .gr-tbl .gr-k { color: var(--ink-3); width: 44px; }
#gap .gr-tbl .gr-usd { color: var(--ink-3); width: 66px; font-variant-numeric: tabular-nums; }
#gap .gr-tbl th.gr-usd { cursor: help; }
#gap .gr-tbl td.gr-c { position: relative; min-width: 76px; padding-bottom: 15px; }
#gap .gr-v { position: relative; transition: color .25s; }
#gap .gr-tbl td.best .gr-v { font-weight: 700; color: var(--ink); }
#gap .gr-tbl td.second .gr-v { text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
#gap .gr-tbl td.gr-c:not(.best) .gr-v { color: var(--ink-2); }
#gap .gr-mini { position: absolute; left: 14px; right: 14px; bottom: 7px; height: 3px; border-radius: 2px; background: transparent; opacity: 0; transition: opacity .3s var(--ease); }
#gap .gr-mini i { position: absolute; inset: 0; border-radius: 2px; background: var(--c); transform-origin: 0 50%; transform: scaleX(0); transition: transform .8s var(--ease-out); }
#gap .gr-mini u { position: absolute; top: -3px; bottom: -3px; width: 1px; margin-left: -.5px; background: var(--ink-3); opacity: .7; }
#gap .gr-tbl td.sel .gr-mini { opacity: 1; background: var(--line); }
#gap .gr-tbl td.sel .gr-mini i { transform: scaleX(var(--f)); }
#gap .gr-tbl td.sel { background: color-mix(in srgb, var(--blue) 3.5%, transparent); }
#gap .gr-tbl tr.hl td.sel { background: color-mix(in srgb, var(--blue) 6%, var(--blue-bg)); }
#gap .gr-mh {
  border: 0; background: none; cursor: pointer; padding: 3px 8px; margin: -3px -8px; border-radius: 8px;
  font: inherit; font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em;
  transition: color .2s, background-color .2s;
}
#gap .gr-mh:hover { color: var(--ink); background: color-mix(in srgb, var(--blue) 8%, transparent); }
#gap .gr-mh[aria-pressed="true"] { color: var(--blue-ink); box-shadow: inset 0 -2px 0 var(--blue); border-radius: 8px 8px 2px 2px; }
#gap .gr-tbl tbody tr:hover th, #gap .gr-tbl tbody tr:hover td { background: var(--bg-soft); }
#gap .gr-tbl tbody tr.hl:hover th, #gap .gr-tbl tbody tr.hl:hover td, #gap .gr-tbl tr.hl th { background: var(--blue-bg); }
#gap .gr-cap { margin: 14px 0 0; max-width: 860px; }
#gap .gr-cap b { color: var(--ink-2); font-weight: 600; }
#gap .gr-cap .gr-dev b { color: var(--orange-ink); }
@media (max-width: 760px) {
  #gap .gr-long { display: none; }
  #gap .gr-bar { flex-direction: column; align-items: stretch; }
  #gap .gr-bar .g-seg { align-self: flex-start; }
}
/* the compact, sticky row labels start a little wider than the control bar: the eleven-row table needs them on tablets */
@media (max-width: 840px) {
  #gap .gr-tbl th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--bg); box-shadow: 1px 0 0 var(--line); white-space: normal; min-width: 158px; max-width: 172px; line-height: 1.3; }
  #gap .gr-tbl thead th:first-child { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--line); }
  #gap .gr-key { margin-right: 7px; }
  #gap .gr-tbl tr.hl th[scope="row"] { background: var(--blue-bg); }
  #gap .gr-tbl th.ind1 { padding-left: 22px; }
  #gap .gr-tbl th.ind2 { padding-left: 32px; }
  #gap .gr-tbl td.gr-c { min-width: 64px; }
}

/* ------------------------------------------------------------------ 6. replication: four held-out splits */
#gap .gx { background: var(--bg); border: 1px solid var(--line); border-radius: var(--rad-lg); padding: 22px 24px 16px; }
#gap .gx-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 24px; }
#gap .gx-head h4 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 2px; }
#gap .gx-head .cap { margin: 0 0 10px; font-size: 13.5px; max-width: 720px; }
#gap .gx-leg { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-3); padding-top: 3px; }
#gap .gx-leg span { display: inline-flex; align-items: center; gap: 7px; }
#gap .gx-leg i { display: inline-block; width: 10px; height: 10px; }
#gap .gx-leg .m-dot { border-radius: 50%; background: var(--s-vanilla); }
#gap .gx-leg .m-tri { background: var(--s-structured); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
#gap .gx-leg .m-arrow { width: 16px; height: 2px; background: var(--s-iterative); position: relative; }
#gap .gx-leg .m-arrow::after { content: ""; position: absolute; right: -2px; top: -3.5px; border: 4.5px solid transparent; border-left: 6px solid var(--s-iterative); border-right: 0; }
#gap .gx-plot svg { display: block; overflow: visible; }
#gap .gx-grid { stroke: var(--line); stroke-width: 1; }
#gap .gx-expert { stroke: var(--ink-3); stroke-dasharray: 4 4; }
#gap .gx-ref { font-family: var(--mono); font-size: 11.5px; font-weight: 600; fill: var(--ink-2); }
#gap .gx-tick { font-family: var(--mono); font-size: 11px; fill: var(--ink-3); }
#gap .gx-sep { stroke: var(--line); stroke-width: 1; }
#gap .gx-lab { font-family: var(--sans); font-size: 13.5px; font-weight: 550; fill: var(--ink); }
#gap .gx-sub { font-family: var(--sans); font-size: 12px; fill: var(--ink-3); }
#gap .gx-span { stroke: color-mix(in srgb, var(--blue) 18%, transparent); stroke-width: 6; stroke-linecap: round; }
#gap .gx-van { fill: var(--s-vanilla); }
#gap .gx-par { fill: var(--s-structured); }
#gap .gx-arrow { stroke: var(--s-iterative); stroke-width: 2.2; fill: none; }
#gap .gx-ahead { fill: var(--s-iterative); }
#gap .gx-val { font-family: var(--mono); font-size: 11.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
#gap .gx-it { fill: var(--blue-ink); font-weight: 650; }
#gap .gx-delta { font-family: var(--mono); font-size: 14px; font-weight: 650; fill: var(--blue-ink); font-variant-numeric: tabular-nums; }
#gap .gx-row { opacity: 0; transition: opacity .9s var(--ease-out) var(--d, 0s); }
#gap .gx.g-grown .gx-row { opacity: 1; }
#gap .gx-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); }
#gap .gx-foot b { font-family: var(--mono); font-weight: 650; color: var(--blue-ink); margin-right: 4px; }
@media (max-width: 560px) {
  #gap .gx { padding: 18px 14px 14px; }
  #gap .gx-lab { font-size: 12.5px; }
  #gap .gx-sub { font-size: 11px; }
  #gap .gx-val { font-size: 10.5px; }
}

/* ------------------------------------------------------------------ 7. k50 */
#gap .gk { background: var(--bg); border: 1px solid var(--line); border-radius: var(--rad-lg); padding: 24px 24px 18px; }
#gap .gk-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 4px 24px; }
#gap .gk-title { flex: 1 1 420px; min-width: 0; }
#gap .gk-head .g-seg { margin: 0 0 12px; }
#gap .gk-head h4 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 2px; }
#gap .gk-head .cap { margin: 0 0 14px; font-size: 13.5px; max-width: 820px; }
#gap .gk-chart .chart-legend { font-size: 13px; margin-bottom: 8px; }
#gap .gk-chart .ref-line { stroke: var(--ink-2); stroke-dasharray: 4 4; }
#gap .gk-chart .ref-label { font-family: var(--mono); font-size: 11.5px; font-weight: 600; fill: var(--ink-2); }
#gap .g-ov { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; opacity: 0; transition: opacity .7s var(--ease); }
#gap .g-ov.in { opacity: 1; }
#gap .gk-ring { fill: none; stroke: var(--s-iterative); stroke-width: 1.5; }
#gap .gk-lead { stroke: var(--s-iterative); stroke-width: 1; fill: none; }
#gap .gk-note { font-family: var(--sans); font-size: 12.5px; fill: var(--ink-2); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
#gap .gk-note-b { font-family: var(--mono); font-weight: 650; fill: var(--blue-ink); }
#gap .gk-dot50 { fill: var(--s-iterative); stroke: var(--bg); stroke-width: 2; }
#gap .gk-ring-gap { stroke: var(--s-gap); }
#gap .gk-ring-self { stroke: var(--s-vanilla); }
#gap .gk-span { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 3 3; fill: none; }
#gap .chart-tip .gk-tipk { font-family: var(--mono); font-size: 11px; font-weight: 450; color: var(--ink-3); margin-left: 6px; }
@media (max-width: 520px) {
  #gap .chart-tip .gk-tipk { display: block; margin: 0; white-space: nowrap; }
  #gap .chart-tip .row span { white-space: nowrap; }
}
@media (max-width: 400px) { #gap .gk-long { display: none; } }
#gap .gk-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); }
#gap .gk-foot b { font-family: var(--mono); font-weight: 650; color: var(--blue-ink); margin-right: 4px; }
@media (max-width: 560px) { #gap .gk { padding: 18px 14px 14px; } }

/* print / save as PDF: entrance states print in their final state */
@media print {
  #gap .gp-hr-row, #gap .gx-row, #gap .g-ov { opacity: 1 !important; }
  #gap *, #gap *::before, #gap *::after { transition: none !important; animation: none !important; }
}
