/* CVE-2026-123786 Agenta workflow-revision SSRF. Reuses the site tokens (style.css).
   Page-local: the attack-path simulation (SVG flow + stepper), fact table, status chips,
   and the ported .asks / .src-list lists from the research living-document pattern. */

.cve-sub { font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.4; max-width: 34em; margin: 18px 0 6px; }
.cve-sub b { color: var(--pink); font-weight: 400; }

/* ---------- status chips ---------- */
.cve-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.chip { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 9px 2px; border: 1px solid var(--rule); border-radius: 3px; color: var(--muted); white-space: nowrap; }
.chip.sev-high { color: #fff; background: var(--pink); border-color: var(--pink); }
:root[data-theme="dark"] .chip.sev-high { color: #0B0B0C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.sev-high { color: #0B0B0C; } }
.chip.fixed { color: var(--pink); border-color: var(--pink); }

/* ---------- at-a-glance facts ---------- */
.cve-facts { border-collapse: collapse; margin: 24px 0 0; max-width: var(--measure); width: 100%; }
.cve-facts th, .cve-facts td { border-top: 1px solid var(--rule); padding: 8px 14px 8px 0; text-align: left; vertical-align: top; font-weight: 400; }
.cve-facts tr:last-child th, .cve-facts tr:last-child td { border-bottom: 1px solid var(--rule); }
.cve-facts th { font-family: var(--mono); font-size: var(--meta); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); width: 8.5em; white-space: nowrap; }
.cve-facts td.mono, .cve-facts td { overflow-wrap: anywhere; }
.cve-facts td.mono { font-family: var(--mono); font-size: var(--meta); }

/* responsible-use note */
.cve-note { max-width: var(--measure); margin: 20px 0 0; padding: 12px 16px; border-left: 3px solid var(--pink);
  font-family: var(--mono); font-size: var(--meta); line-height: 1.6; color: var(--ink); background: var(--hl); }
.cve-note b { color: var(--pink); }

/* ============ attack-path simulation ============ */
.sim { margin: 18px 0 6px; max-width: 820px; }
.sim-fig { margin: 0; border: 1px solid var(--rule); background: var(--graph); border-radius: 6px; padding: 10px; }
.sim-canvas { max-width: 100%; }
.sim-fig svg { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 760 / 440; overflow: hidden; }

/* diagram nodes (rendered in foreignObject so they use page fonts/tokens).
   Every box is identical in size, fill, border width and style — only the border
   COLOUR hints the node type. No dashed borders, no 2px borders, no transparent
   fills: those made boxes read as mis-sized / glitchy next to each other. */
.cve-node { box-sizing: border-box; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 7px 10px; border: 1.5px solid var(--rule); border-radius: 5px; background: var(--paper); }
.cve-node .n-label { font-family: var(--serif); font-size: 15px; line-height: 1.05; color: var(--ink); }
.cve-node .n-sub { font-size: 10px; letter-spacing: .01em; color: var(--muted); overflow-wrap: anywhere; }
.cve-node.is-actor    { border-color: var(--muted); }
.cve-node.is-server   { border-color: var(--pink); }
.cve-node.is-evil     { border-color: var(--pink-hot); border-style: dashed; }
.cve-node.is-internal { border-color: var(--muted); }

/* edges: line + baked triangle head, grouped as .edge-g.
   No transitions on the edges. Animating stroke / stroke-width while toggling the
   active edge many times left Chrome painting a stale thick edge (the wrong arrow
   appeared bold and overlapped). Instant state changes repaint cleanly. */
.edge { fill: none; stroke: var(--rule); stroke-width: 2; }
.edge.is-leak { stroke-dasharray: 6 5; }
.arw { fill: var(--rule); stroke: none; }

/* enhanced (JS on): dim every edge group, light only the active one and its head */
.sim.is-enhanced .edge-g { opacity: .22; }
.sim.is-enhanced .edge-g.is-active { opacity: 1; }
.edge-g.is-active .edge { stroke: var(--pink); stroke-width: 3.5; }
.edge-g.is-active .arw { fill: var(--pink); }

/* Dim/light nodes by opacity and border colour only. No box-shadow/filter on the
   foreignObject nodes: those force Chrome to re-rasterise and the boxes visibly
   jitter on each step. Border-colour and opacity never change the layout box. */
.sim.is-enhanced .cve-node { opacity: .38; }
.sim.is-enhanced .cve-node.is-lit { opacity: 1; border-color: var(--pink); }
/* Agenta is the central platform involved across the whole attack: keep it fully
   visible in every stage so it never appears to shrink/shift between slides. */
.sim.is-enhanced .cve-node.is-server { opacity: 1; }

/* stages */
.sim-stages { margin: 16px 0 0; }
.sim-stage { border-top: 1px solid var(--rule); padding: 14px 0; max-width: var(--measure); }
.sim-stage:last-child { border-bottom: 1px solid var(--rule); }
.stage-head { margin: 0 0 6px; }
.stage-n { color: var(--pink); font-size: var(--meta); margin-right: 8px; }
.tok { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--pink-hot); border: 1px solid var(--pink-hot); border-radius: 3px; padding: 1px 6px; margin-left: 6px; }
.stage-wire { font-size: var(--meta); color: var(--ink); background: var(--graph); border: 1px solid var(--rule);
  border-radius: 4px; padding: 8px 10px; margin: 0 0 8px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.stage-detail { margin: 0; }

/* enhanced: one stage at a time. Reserve height so swapping stages of different
   length does not make the block below jump around. */
.sim.is-enhanced .sim-stage { display: none; border-bottom: 1px solid var(--rule); }
.sim.is-enhanced .sim-stage.is-active { display: block; min-height: 8.5em; }

/* controls: a bar inside the figure box (flush to its edges, divider on top) */
.sim-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px -10px -10px; padding: 10px 12px; border-top: 1px solid var(--rule); }
.sim-btn { font-family: var(--mono); font-size: var(--meta); color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: 4px; padding: 6px 12px; cursor: pointer; }
.sim-btn:hover { border-color: var(--pink); color: var(--pink); }
.sim-btn:disabled { opacity: .4; cursor: default; }
.sim-btn:disabled:hover { border-color: var(--rule); color: var(--ink); }
.sim-reset { margin-left: auto; }
.sim-count { color: var(--muted); letter-spacing: .04em; min-width: 4.5em; text-align: center; }

/* ---------- ported lists ---------- */
.asks { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
/* long snake_case identifiers (AGENTA_MCP_GATEWAY_HOST_ALLOWLIST, _is_platform_service_url)
   have no break points and otherwise push the whole page wider than a phone screen */
.asks li { border-top: 1px solid var(--rule); padding: 12px 0 12px 1.6em; position: relative; overflow-wrap: anywhere; }
.asks li:last-child { border-bottom: 1px solid var(--rule); }
.asks li::before { content: "\203A"; position: absolute; left: 0; color: var(--pink); font-family: var(--mono); }
.asks code { font-family: var(--mono); font-size: .92em; color: var(--pink); overflow-wrap: anywhere; }

/* a heading already draws its own bottom rule; drop the first list item's top rule so
   the line under a section heading never doubles */
.dymo + .asks li:first-child,
.dymo + .src-list li:first-child { border-top: 0; }

.src-list { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.src-list li { border-top: 1px solid var(--rule); padding: 12px 0; display: grid; grid-template-columns: 4ch minmax(0,1fr); gap: 2px 14px; }
.src-list li:last-child { border-bottom: 1px solid var(--rule); }
.src-list .sid { font-family: var(--mono); font-size: var(--meta); color: var(--pink); }
.src-list .stitle { margin: 0; }
.src-list .smeta { font-family: var(--mono); font-size: var(--meta); color: var(--muted); letter-spacing: .02em; margin: 2px 0 0; grid-column: 2; overflow-wrap: anywhere; }
.src-list .smeta a { color: var(--ink); }

sup.ref-sup { font-family: var(--mono); font-size: 10px; letter-spacing: 0; vertical-align: super; line-height: 0; }
sup.ref-sup a { color: var(--pink); text-decoration-color: var(--rule); }

@media (max-width: 640px) {
  .sim-fig { padding: 8px; }
  .cve-facts th { width: 6.5em; }
  /* long mono strings (CVSS vector, wire lines) must break, never overflow */
  .cve-facts td.mono, .stage-wire { word-break: break-word; overflow-wrap: anywhere; }
}
/* never let the simulation or facts table push the page sideways */
.sim, .sim-fig, .sim-canvas, .sim-stages, .cve-facts { max-width: 100%; }
.sim-canvas { overflow-x: auto; }
@media (prefers-reduced-motion: reduce) {
  .edge, .arw-head, .cve-node { transition: none; }
}
