/* Figure controls share the data-pipeline drawing's ink, grey and lime palette. */
.factory .lede { max-width: 66ch; }
.factory .authored-figure { --figure-ink: #141414; --figure-lime: #b6d640; --figure-olive: #819827; margin: 32px 0 44px; }
.factory .orchestration { max-width: 760px; }
.figure-scroll { overflow: auto; }
.authored-figure .figstack { width: 100%; border-color: #cecec7; border-radius: 6px; }
.authored-figure.enlarged .figure-scroll { max-height: 75vh; }
.authored-figure.enlarged .figstack { width: max(100%, 1180px); }
.factory .figstack .hot { rx: 4px; vector-effect: non-scaling-stroke; }
.factory .pipeline-figure .hot { cursor: pointer; }
.factory .figstack .hot:hover { stroke: var(--figure-olive); fill: var(--figure-lime); fill-opacity: .07; }
.factory .figstack .hot.selected { stroke: var(--figure-olive); stroke-width: 1.5; fill: var(--figure-lime); fill-opacity: .07; }
.factory .figstack .hot:focus-visible { outline: none; stroke: var(--figure-ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
.factory .figstack .dims { pointer-events: none; }
.factory .figstack .dim { opacity: .32; }
.factory .figstack .pulse { fill: var(--figure-lime); stroke: var(--figure-olive); stroke-width: .8; }
.factory .figstack .hot.has-screenshot { cursor: zoom-in; }
.factory .tip.has-screenshot { width: min(460px, calc(100vw - 16px)); max-width: none; }
.factory .tip.screenshot-preview { pointer-events: auto; max-height: calc(100dvh - 16px); overflow: auto; }
.screenshot-enlarge { display: block; width: 100%; padding: 0; margin-top: 10px; border: 0; border-radius: 3px; background: #f5f5f1; cursor: zoom-in; }
.tip-screenshot { display: block; width: 100%; height: min(28vh, 250px); object-fit: contain; border-radius: 3px; }
.screenshot-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.screenshot-controls[hidden] { display: none; }
.screenshot-controls button { display: grid; place-items: center; width: 32px; height: 30px; padding: 0; border: 1px solid currentColor; border-radius: 5px; background: transparent; color: inherit; font: 18px var(--sans); cursor: pointer; }
.screenshot-controls button:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.screenshot-position { min-width: 180px; text-align: center; font: 12px var(--sans); }
.screenshot-controls button:focus-visible, .screenshot-enlarge:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.tip-image-hint { display: block; margin-top: 6px; font-size: 11px; }
.factory-screenshot-dialog { width: min(1480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 18px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--paper); color: var(--ink); }
.factory-screenshot-dialog::backdrop { background: rgb(0 0 0 / .65); }
.screenshot-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.screenshot-heading h2 { margin: 0; font: 600 18px var(--sans); }
.screenshot-heading button { padding: 7px 14px; font: 12px var(--sans); color: var(--ink); border: 1px solid var(--rule-2); border-radius: 4px; background: var(--paper-2); cursor: pointer; }
.factory-screenshot { display: block; width: 100%; height: min(60dvh, 780px); object-fit: contain; }
.screenshot-caption { margin: 14px 0 10px; font: 13px/1.5 var(--sans); color: var(--ink-2); }
.screenshot-original { font: 12px var(--sans); }
.figure-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 14px; }
.figure-tools[hidden] { display: none; }
.figure-choices { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.figure-tools button { font-family: var(--sans); font-size: 11px; padding: 6px 9px; border: 1px solid var(--rule-2); background: var(--paper); color: var(--ink-2); border-radius: 4px; cursor: pointer; }
.figure-tools button:hover { border-color: var(--ink); color: var(--ink); }
.figure-choices button[aria-pressed="true"] { background: var(--figure-lime); border-color: var(--figure-olive); color: var(--figure-ink); }
.figure-tools button:focus-visible { outline: 2px solid var(--figure-olive); outline-offset: 3px; }
.figure-detail { margin: 14px 0 0; padding: 10px 14px; border-left: 2px solid var(--rule-2); background: var(--paper-2); }
.authored-figure.has-selection .figure-detail { border-left-color: var(--figure-olive); }
.prose .figure-detail p { max-width: none; margin: 0; font-family: var(--sans); font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.figure-detail b { color: var(--ink); }
#ablation-effects { min-width: 700px; }
#ablation-effects .row { cursor: pointer; }
#ablation-effects .row .row-hit { fill: transparent; }
#ablation-effects .row:hover .row-hit, #ablation-effects .row.selected .row-hit { fill: var(--lime); fill-opacity: .16; }
#ablation-effects .row:focus-visible { outline: none; }
#ablation-effects .row:focus-visible .row-hit { stroke: var(--ink); stroke-width: 1; }
.comparison-details { margin: 24px 0; }
.comparison-details > summary { font-family: var(--sans); font-size: 14px; font-weight: 600; cursor: pointer; }
.comparison-details[open] > summary { margin-bottom: 18px; }
.factory .site-footer { margin-top: 48px; }
.ablation-explorer { padding: 24px 28px; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; }
.decision-options { display: flex; flex-wrap: wrap; gap: 8px; border: 0; margin: 0 0 28px; padding: 0; min-width: 0; }
.decision-options legend { font-family: var(--mono); font-size: 11px; color: var(--ink-2); margin-bottom: 12px; }
.decision-options label { position: relative; cursor: pointer; font-family: var(--sans); font-size: 12px; font-weight: 600; }
.decision-options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.decision-options label span { display: block; border: 1px solid var(--rule-2); padding: 9px 12px; border-radius: 999px; }
.decision-options input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.decision-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.decision-options:disabled { opacity: .5; }
.decision-summary { display: grid; grid-template-columns: minmax(0, 1fr) 185px; gap: 36px; padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
.decision-summary h3 { font-size: 24px; margin: 0 0 12px; }
.decision-summary p:last-child { font-size: 16px; margin: 0; max-width: 65ch; }
.effect-summary { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.effect-number { font-family: var(--mono); font-size: 31px; font-weight: 500; line-height: 1.2; }
.effect-summary .small { font-size: 12px; }
.comparison-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 20px 0; }
.comparison-control label { font-family: var(--sans); font-size: 13px; }
.comparison-control select { max-width: 100%; min-width: 0; font-size: 12px; }
.comparison-figure { margin: 24px 0 18px; }
.effect-chart { --zero: 31.25%; }
.effect-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 62px; align-items: center; gap: 18px; min-height: 54px; border-bottom: 1px solid var(--rule); }
.effect-row-label { font-family: var(--sans); font-size: 12px; line-height: 1.5; }
.effect-track { height: 34px; position: relative; background: linear-gradient(to right, var(--paper) 0 var(--zero), var(--sage) var(--zero) 100%); border-radius: 3px; }
.effect-track::before { content: ''; position: absolute; top: 0; bottom: 0; left: var(--zero); border-left: 1px solid var(--ink-3); }
.seed-range { position: absolute; top: 16px; height: 1px; background: var(--ink-2); }
.effect-dot { position: absolute; top: 12px; width: 9px; height: 9px; border: 1.5px solid var(--ink-2); border-radius: 50%; background: var(--card); transform: translateX(-50%); }
.effect-dot.mean { border-radius: 0; width: 9px; height: 9px; background: var(--accent); border: 1px solid var(--card); transform: translateX(-50%) rotate(45deg); }
.effect-row-value { font-family: var(--mono); font-size: 12px; text-align: right; }
.effect-axis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 62px; gap: 18px; margin-top: 6px; }
.effect-ticks { position: relative; height: 22px; }
.effect-ticks span { position: absolute; font-family: var(--mono); font-size: 10px; color: var(--ink-2); transform: translateX(-50%); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.chart-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border: 1.5px solid var(--ink-2); }
.chart-legend .seed-mark { border-radius: 50%; }
.chart-legend .mean-mark { background: var(--accent); border: 0; transform: rotate(45deg); }
.decision-reading { border-left: 3px solid var(--accent); padding-left: 14px; font-size: 16px; max-width: 82ch; }
.exact-values summary { font-family: var(--sans); font-size: 13px; cursor: pointer; font-weight: 600; }
.exact-values .tablewrap { margin-bottom: 0; }
.factory-note { font-family: var(--sans); font-size: 13px; color: var(--ink-2); max-width: 96ch; margin: 18px 0 12px; }

@media (max-width: 1050px) {
  .factory .topbar .inner { flex-wrap: wrap; gap: 10px; }
  .factory .topbar nav { gap: 8px 20px; }
}
@media (max-width: 640px) {
  .factory .topbar .inner { padding: 10px 18px; }
  .factory .topbar nav { font-size: 12px; gap: 4px 16px; }
  .factory .page { padding-left: 18px; padding-right: 18px; }
  .factory .lede { font-size: 18px; }
  .factory .figstack { padding: 6px; }
  .factory .figstack svg.hotspots { left: 6px; top: 6px; width: calc(100% - 12px); height: calc(100% - 12px); }
  .figure-tools { gap: 10px; }
  .figure-choices { flex-basis: 100%; }
  .ablation-explorer { padding: 20px 16px; }
  .decision-options { gap: 8px; }
  .decision-options label { font-size: 11px; }
  .decision-options label span { padding: 8px 10px; }
  .decision-summary { grid-template-columns: 1fr; gap: 18px; }
  .decision-summary h3 { font-size: 22px; }
  .effect-summary { flex-direction: row; align-items: center; justify-content: flex-start; gap: 16px; }
  .effect-number { font-size: 27px; white-space: nowrap; }
  .effect-row { grid-template-columns: minmax(0, 1fr) 52px; gap: 6px 12px; padding: 12px 0; }
  .effect-row-label { grid-column: 1 / -1; }
  .effect-axis { grid-template-columns: minmax(0, 1fr) 52px; gap: 12px; }
  .effect-axis > span:first-child { display: none; }
  .effect-row-value { font-size: 11px; }
  .factory .site-footer { gap: 8px; }
}
