/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
/* AgentForge dashboard — dark ops theme. Minimal, function-first. */

:root {
  --bg: #0b0d10;
  --panel: #14181d;
  --panel-border: #232a32;
  --text: #d4dae0;
  --text-dim: #8892a0;
  --accent: #5eead4;
  --green: #4ade80;
  --amber: #f59e0b;
  --red: #ef4444;
  --gray: #6b7280;
  --black: #1f2937;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.4;
}

/* --- Top bar wrapper -------------------------------------------------- */
/* The topbar hosts the StatusBar and the EnvironmentSelector side-by-side.
 * Keeping both inside a single 32px row preserves the grid math in
 * .ops-grid (which subtracts 32px from 100vh). */
.topbar {
  display: flex;
  align-items: stretch;
  min-height: 32px;
  background: #11151a;
  border-bottom: 1px solid var(--panel-border);
}
.topbar .status-bar {
  flex: 1 1 auto;
  border-bottom: none;
  background: transparent;
}

/* --- Top status bar -------------------------------------------------- */
.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  padding: 6px 14px;
  background: #11151a;
  border-bottom: 1px solid var(--panel-border);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  min-height: 32px;
}
.status-bar .brand {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-right: 8px;
}
.status-bar .stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-bar .stat strong {
  color: var(--text);
  font-weight: 600;
}
.status-bar .ok { color: var(--green); }
.status-bar .warn { color: var(--amber); }
.status-bar .bad { color: var(--red); }

/* The Help button anchors right; the auto-margin pushes it across the bar
 * regardless of how many stats are rendered to the left. */
.status-bar .help-button {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 6px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.04em;
  background: #0f1419;
  transition: color 120ms ease, border-color 120ms ease;
}
.status-bar .help-button:hover,
.status-bar .help-button:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}
.status-bar .help-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 10px;
  font-weight: 700;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.status-bar .help-button-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Grid layout ------------------------------------------------------ */
/* Layout v2: topology is a full-width hero strip on top so the LR flow
 * (Orchestrator → Red Team → Target → Judge → Docs → Patch Advisor) reads
 * cleanly without clipping. Below it, the remaining five panes share a
 * single row so nothing is hidden behind a scroll on a 1440×900 demo.
 *
 *   ┌──────────────────────────────────────────────────────────────┐
 *   │ status bar (32px)                                            │
 *   ├──────────────────────────────────────────────────────────────┤
 *   │ TOPOLOGY (full width, ~320px tall)                           │
 *   ├──────────┬──────────┬──────────┬──────────┬─────────────────┤
 *   │ heatmap  │ feed     │ cost     │ severity │ buginbox        │
 *   └──────────┴──────────┴──────────┴──────────┴─────────────────┘
 *
 * Each pane keeps overflow:hidden on the outer box and a scrollable inner
 * .body so headers never disappear and content never pushes the page.
 */
.ops-grid {
  display: grid;
  /* Layout v3: topology is a tall left sidebar (33% width, full height,
   * vertical stack of target + adversarial). Other 4 panes fill a 2×2
   * grid on the right (67%). */
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "topology heatmap feed"
    "topology severity cost";
  grid-gap: 10px;
  gap: 10px;
  padding: 10px;
  height: calc(100vh - 32px);
  width: 100vw;
  overflow: hidden;
}

/* Below ~1100px wide, collapse to a single column (stacks for laptops in
 * portrait, sidebar-open layouts, and small windows). */
@media (max-width: 1100px) {
  .ops-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 320px repeat(4, minmax(220px, auto));
    grid-template-areas:
      "topology"
      "heatmap"
      "feed"
      "cost"
      "severity";
    height: auto;
    overflow: auto;
  }
}

.pane {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 10px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;  /* critical: lets flex children shrink */
  min-width: 0;
}
.pane-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.pane h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.pane .subtitle {
  flex: 1 1 100%;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.35;
  opacity: 0.85;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  margin-top: 1px;
}
.pane .help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 700;
  cursor: help;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.pane .help-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.pane .body {
  flex: 1 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  position: relative;
}

.pane.topology { grid-area: topology; }
.pane.feed     { grid-area: feed; }
.pane.heatmap  { grid-area: heatmap; }
.pane.cost     { grid-area: cost; }
.pane.severity { grid-area: severity; }

/* --- Heatmap grid ---------------------------------------------------- */
.heatmap-grid {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
}
.heatmap-cell {
  height: 18px;
  min-width: 0;
  border-radius: 2px;
  cursor: default;
  position: relative;
}
.heatmap-cell.untested { background: #2a2f37; }
.heatmap-row-label {
  font-size: 10px;
  color: var(--text-dim);
  padding-right: 6px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Attack feed ----------------------------------------------------- */
.feed-list {
  font-size: 11px;
  line-height: 1.35;
}
.feed-row {
  padding: 3px 4px;
  border-bottom: 1px solid #1c2026;
  display: grid;
  grid-template-columns: 60px 80px 1fr;
  grid-gap: 6px;
  gap: 6px;
  overflow: hidden;
}
.feed-row .ts { color: var(--text-dim); }
.feed-row .detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-row.attack_attempt .kind { color: var(--accent); }
.feed-row.verdict .kind { color: var(--amber); }
.feed-row.vuln_finding .kind { color: var(--red); }

/* --- Bug inbox ------------------------------------------------------- */
.bug-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.bug-table th, .bug-table td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--panel-border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bug-table th {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sev-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}
.sev-p0 { background: var(--red); color: #fff; }
.sev-p1 { background: var(--amber); color: #1a1a1a; }
.sev-p2 { background: var(--gray); color: #fff; }
.sev-p3 { background: var(--black); color: var(--text-dim); }

/* --- Topology v2 (target + adversarial side-by-side) ---------------- */
/* The container fills the topology pane body. Two 50% columns with a
 * thin center "←attacks" indicator. Below ~1100px the .ops-grid media
 * query already collapses the page into a single stacked column; we
 * stack the v2 panels for the same reason at the same breakpoint. */
.topology-v2 {
  display: grid;
  /* Side-by-side inside the tall left sidebar: target on the left,
   * adversarial on the right, with a thin "← attacks" hairline between.
   * Each graph still flows top-to-bottom (TB) inside its column. */
  grid-template-columns: 1fr 24px 1fr;
  grid-template-rows: 1fr;
  grid-gap: 6px;
  gap: 6px;
  height: 100%;
  min-height: 0;
  /* Anchor the absolutely-positioned arc overlay (.attack-arc-layer)
   * to the container so cross-pane bezier curves use container-local
   * coords. */
  position: relative;
}
.topology-v2__panel {
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 6px 8px 4px;
  position: relative;
  background: #0e1216;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.topology-v2__panel h3 {
  margin: 0 0 4px 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.topology-v2__hint {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.topology-v2__tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.topology-v2__tag--target { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.topology-v2__tag--adv    { background: rgba(94, 234, 212, 0.15); color: var(--accent); }
.topology-v2__body {
  flex: 1 1;
  min-height: 0;
  position: relative;
}
.topology-v2__arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 18px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.topology-v2__arrow-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 2px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: var(--text-dim);
}
@media (max-width: 1100px) {
  .topology-v2 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 16px 1fr;
  }
  .topology-v2__arrow { flex-direction: row; }
  .topology-v2__arrow-label { writing-mode: horizontal-tb; transform: none; margin: 0 0 0 6px; }
}

/* --- Target topology — surface nodes -------------------------------- */
/* Custom node rendered by TargetTopologyPane. Border color is set on
 * the wrapping React Flow node via inline style (primary TM-0X), so
 * this CSS handles only label/api/pill layout inside the box. */
.target-node {
  padding: 6px 8px;
  text-align: left;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text);
  position: relative;  /* anchor for .node-status dot */
}

/* --- Per-node binary status dot ------------------------------------- */
/* Sticky "was this node exercised by the current attack?" indicator.
 * Green = used by this attack (including downstream verdict/finding for
 * the adversarial pane), Red (muted gray) = not exercised. Resets on
 * every new attack-fired event. Independent of the .pulsing animation
 * — pulse is the brief "just happened" cue, this dot is the persistent
 * "this was used" indicator. The two compose visually: the dot sits in
 * the corner while the ring animates around the node body. */
.node-status {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  z-index: 4;
  pointer-events: none;
  transition: background-color 200ms ease, box-shadow 200ms ease, opacity 200ms ease;
}
.node-status--green {
  background: #4ade80;
  box-shadow: 0 0 4px rgba(74, 222, 128, 0.67);
  opacity: 1;
}
.node-status--red {
  background: #6b7280;
  box-shadow: none;
  opacity: 0.5;
}
.target-node__label {
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.target-node__api {
  font-size: 9px;
  color: var(--text-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.threat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 4px;
}
.threat-pill {
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 2px;
  letter-spacing: 0.02em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}
.threat-pill.threat-TM-01 { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.threat-pill.threat-TM-02 { color: #fdba74; border-color: rgba(249, 115, 22, 0.4); }
.threat-pill.threat-TM-03 { color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
.threat-pill.threat-TM-04 { color: #93c5fd; border-color: rgba(59, 130, 246, 0.4); }
.threat-pill.threat-TM-05 { color: #d8b4fe; border-color: rgba(168, 85, 247, 0.4); }
.threat-pill.threat-TM-06 { color: #6ee7b7; border-color: rgba(16, 185, 129, 0.4); }

/* Kind-specific subtle backgrounds so entry / orchestrator / tool /
 * store / identity / vendor read at a glance, while the threat
 * category drives the border color (priority). */
.target-node--entry { background: #1a1015; }
.target-node--orchestrator { background: #11181d; }
.target-node--worker { background: #0f1620; }
.target-node--tool { background: #101820; }
.target-node--guardrail { background: #0e1612; }
.target-node--store { background: #1a1410; }
.target-node--identity { background: #0f1a14; }
.target-node--integration { background: #15101a; }

/* v3 chrome-strip variant. The node body collapses to a single label
 * line + status dot — no inline threat pills, no API path — because at
 * v3's compact widths those stacked rows made every node a wall of
 * text. Threat list + API path live in the native ``title`` tooltip
 * (set on the wrapper div in the React component). Vertical centering
 * keeps the label visually anchored despite the smaller box. */
.target-node--v3 {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 8px;
}
.target-node--v3 .target-node__label {
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;        /* allow 2-line wrap if needed */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* v3 adversarial agent node. Uses the same compact chrome as the
 * target surface so the unified column reads as one continuous rail.
 * Background is the orchestrator-kind neutral so it doesn't clash with
 * the target nodes' threat-colored borders below it. */
.adv-node {
  padding: 4px 8px;
  display: flex;
  align-items: center;
  font-size: 10px;
  color: var(--text);
  position: relative;        /* anchor for .node-status dot */
  background: #11181d;
  height: 100%;
}
.adv-node--v3 .adv-node__label {
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  text-align: center;
  flex: 1 1;
}

.target-legend {
  position: absolute;
  bottom: 4px;
  left: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
  font-size: 9px;
  color: var(--text-dim);
  background: rgba(15, 20, 25, 0.7);
  padding: 2px 4px;
  border-radius: 3px;
}
.target-legend__item { display: inline-flex; align-items: center; gap: 4px; }
.target-legend__dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.target-legend__label { font-family: ui-monospace, Menlo, monospace; }

/* --- Attack-flow visualization ------------------------------------- */
/* Pulse ring applied to a React Flow node wrapper when its agent or
 * target surface is the focus of an in-flight attack/verdict/finding.
 * The animation uses ``box-shadow`` keyframed only at start / mid /
 * end (3 stops, not per-frame) and ``transform: scale`` so it's GPU-
 * cheap even when 20 nodes pulse at once. The pulse color is set per
 * modifier class via the ``--pulse-color`` CSS variable. */
.pulsing {
  --pulse-color: 239, 68, 68; /* default red */
  animation: af-pulse 1.2s ease-out infinite;
  border-color: rgb(var(--pulse-color)) !important;
  z-index: 4;
  will-change: transform, box-shadow;
}
.pulsing--attack   { --pulse-color: 239, 68, 68; }   /* red */
.pulsing--target   { --pulse-color: 239, 68, 68; }   /* red — matches attack */
.pulsing--success  { --pulse-color: 239, 68, 68; }   /* judge said attack succeeded */
.pulsing--partial  { --pulse-color: 245, 158, 11; }  /* amber */
.pulsing--fail     { --pulse-color: 16, 185, 129; }  /* green — defended */
.pulsing--finding  { --pulse-color: 168, 85, 247; }  /* purple */

@keyframes af-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--pulse-color), 0.75);
    transform: scale(1);
  }
  60% {
    box-shadow: 0 0 0 10px rgba(var(--pulse-color), 0);
    transform: scale(1.04);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--pulse-color), 0);
    transform: scale(1);
  }
}

/* Live status line in the hairline between target + adversarial panes.
 * The hairline column is only 24px wide so the text rotates 90deg and
 * reads top-to-bottom; on narrow viewports the layout falls back to a
 * horizontal row (see the existing 1100px media query). */
.topology-v2__status {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-top: 6px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 200ms ease-out, opacity 300ms ease-out;
}
.topology-v2__status--live {
  color: var(--red, #ef4444);
  opacity: 1;
}
.topology-v2__status--idle {
  color: var(--text-dim);
  opacity: 0.6;
}
@media (max-width: 1100px) {
  .topology-v2__status {
    writing-mode: horizontal-tb;
    transform: none;
    margin: 0 0 0 8px;
    font-size: 10px;
  }
}

/* Cross-pane arc overlay. Absolutely positioned across the whole
 * ``.topology-v2`` grid; ``pointer-events: none`` so it never blocks
 * clicks. The path's ``stroke-dasharray`` flows via keyframe so the
 * arc reads as "this is what just got fired". */
.attack-arc-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}
.attack-arc {
  fill: none;
  stroke: #ef4444;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 6 6;
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.6));
  animation:
    af-arc-fade 2.2s ease-out forwards,
    af-arc-flow 0.9s linear infinite;
}
@keyframes af-arc-fade {
  0%   { opacity: 0; }
  9%   { opacity: 1; }       /* fade in ~200ms of 2200ms */
  77%  { opacity: 1; }       /* hold through 1700ms */
  100% { opacity: 0; }       /* fade out 500ms */
}
@keyframes af-arc-flow {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -24; }
}

/* --- [v2 ⇄ v1] toggle ---------------------------------------------- */
.pane-header__right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}
.topology-version-toggle {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  background: #11151a;
  color: var(--text-dim);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topology-version-toggle:hover { border-color: var(--accent); color: var(--accent); }
.topology-version-toggle .active { color: var(--accent); font-weight: 700; }
.topology-version-toggle__sep { opacity: 0.7; }

/* --- Topology nodes -------------------------------------------------- */
.node-state-idle    { background: var(--gray);  border-color: var(--gray);  color: #fff; }
.node-state-active  { background: var(--green); border-color: var(--green); color: #052; }
.node-state-alert   { background: var(--red);   border-color: var(--red);   color: #fff; }
.node-state-degraded{ background: var(--amber); border-color: var(--amber); color: #1a1a1a; }
.node-state-offline { background: #1f2937; border-color: #1f2937; color: var(--text-dim); }

.empty-state {
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 24px 8px;
}

/* --- Help page -------------------------------------------------------- */
/* Static documentation surface. Wider type, generous line-height, sans
 * font, so a CISO can read it without squinting. Sized to ~720px column
 * for comfortable line length. */
.help-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}
.help-page .back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 24px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.help-page .back-link:hover { text-decoration: underline; }
.help-page h1 {
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 4px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.help-page .lede {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 32px;
}
.help-page h2 {
  font-size: 20px;
  margin: 40px 0 10px;
  color: var(--accent);
  letter-spacing: -0.005em;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 6px;
}
.help-page h3 {
  font-size: 15px;
  margin: 22px 0 6px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.help-page p { margin: 0 0 14px; }
.help-page ul, .help-page ol { padding-left: 22px; margin: 0 0 14px; }
.help-page li { margin-bottom: 6px; }
.help-page code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: #11151a;
  border: 1px solid var(--panel-border);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent);
}
.help-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 13px;
}
.help-page th, .help-page td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--panel-border);
  vertical-align: top;
}
.help-page th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: #11151a;
}
.help-page .legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -1px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.help-page .pane-card {
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 0 0 12px;
  background: #11151a;
}
.help-page .pane-card h3 {
  margin-top: 0;
  color: var(--accent);
}
.help-page .pane-card .req-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text-dim);
  display: inline-block;
  margin-top: 4px;
  padding: 1px 6px;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
}

/* --- Top bar wrapper (status bar + env selector) -------------------- */
.topbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  background: #11151a;
  border-bottom: 1px solid var(--panel-border);
}
.topbar .status-bar {
  flex: 1 1 auto;
  border-bottom: none;
  background: transparent;
}

/* --- Environment selector ------------------------------------------ */
.env-selector {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11px;
  flex: 0 0 auto;
}
.env-selector-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #181d23;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.02em;
  min-width: 180px;
}
.env-selector-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.env-selector-label {
  flex: 1 1 auto;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.env-selector-caret {
  color: var(--text-dim);
  font-size: 9px;
  margin-left: 4px;
}
.env-selector-menu {
  position: absolute;
  top: calc(100% + 2px);
  right: 10px;
  width: 280px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 4px;
  z-index: 50;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.env-selector-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  text-align: left;
  padding: 6px 8px;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
}
.env-selector-option:hover {
  background: #1c2128;
  border-color: var(--panel-border);
}
.env-selector-option.selected {
  background: #1f2630;
  border-color: var(--accent);
}
.env-selector-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.env-selector-name {
  flex: 1 1 auto;
  font-weight: 600;
}
.env-selector-status {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 2px;
  background: #232a32;
  color: var(--text-dim);
}
.env-selector-status.status-live { color: #052; background: var(--green); }
.env-selector-status.status-planned { color: #1a1a1a; background: var(--amber); }
.env-selector-status.status-offline { color: var(--text-dim); background: #2a2f37; }
.env-selector-desc {
  font-size: 10px;
  color: var(--text-dim);
  white-space: normal;
  line-height: 1.35;
}

.env-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.env-dot-live { background: var(--green); box-shadow: 0 0 4px var(--green); }
.env-dot-planned { background: var(--amber); }
.env-dot-offline { background: var(--gray); }

/* --- Env banner ----------------------------------------------------- */
.env-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 11px;
  border-bottom: 1px solid var(--panel-border);
}
.env-banner-planned {
  background: rgba(245, 158, 11, 0.10);
  color: var(--amber);
}
.env-banner-offline {
  background: rgba(107, 114, 128, 0.10);
  color: var(--text-dim);
}

/* --- Trigger attack button ------------------------------------------ */
.trigger-attack {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
}
.trigger-attack__button {
  background: rgba(239, 68, 68, 0.10);
  color: var(--red, #ef4444);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms;
}
.trigger-attack__button:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.20);
}
.trigger-attack__button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.trigger-attack__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  background: var(--panel-bg, #1a1a1a);
  border: 1px solid var(--panel-border, #333);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.trigger-attack__label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim, #888);
  letter-spacing: 0.04em;
}
.trigger-attack__label select {
  background: var(--bg, #0c0c0c);
  border: 1px solid var(--panel-border, #333);
  color: var(--text, #eee);
  padding: 4px 6px;
  border-radius: 3px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
.trigger-attack__fire {
  margin-top: 4px;
  padding: 6px;
  background: var(--red, #ef4444);
  color: #fff;
  border: 0;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
}
.trigger-attack__fire:hover:not(:disabled) { filter: brightness(1.15); }
.trigger-attack__fire:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Feed row detail expansion -------------------------------------- */
.feed-row.clickable .feed-row__line { cursor: pointer; }
.feed-row__line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}
.feed-row__line:hover { background: rgba(255,255,255,0.03); }
.feed-row .chev {
  margin-left: auto;
  color: var(--text-dim, #888);
  font-size: 10px;
}
.feed-row__detail {
  margin: 6px 0 10px 0;
  padding: 8px 10px;
  background: rgba(255,255,255,0.025);
  border-left: 2px solid var(--accent, #3b82f6);
  font-size: 11px;
  line-height: 1.45;
}
.feed-row__loading, .feed-row__error {
  color: var(--text-dim, #888);
  font-style: italic;
}
.feed-row__error { color: var(--red, #ef4444); }
.feed-row__section { margin-bottom: 8px; }
.feed-row__section:last-child { margin-bottom: 0; }
.feed-row__section-h {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim, #888);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.feed-row__prompt {
  margin: 2px 0;
  font-family: ui-monospace, monospace;
  font-size: 11px;
}
.feed-row__prompt .role {
  color: var(--accent, #3b82f6);
  font-weight: 600;
}
.feed-row__prompt .content {
  color: var(--text, #ddd);
  white-space: pre-wrap;
  word-break: break-word;
}
.feed-row__atts {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-dim, #888);
}
.feed-row__atts .attachment {
  margin-right: 6px;
  padding: 1px 5px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
}
.feed-row__response {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  background: rgba(0,0,0,0.3);
  padding: 6px 8px;
  border-radius: 3px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
  margin: 0;
  color: var(--text, #ddd);
}
.feed-row__rationale {
  font-size: 11px;
  color: var(--text, #ddd);
  font-style: italic;
}
.muted { color: var(--text-dim, #888); }

/* --- Attack detail modal -------------------------------------------- */
/* Click an attack_attempt row → centered overlay. Backdrop click + Esc +
 * the X button all close. Modal scrolls internally for long responses. */
.attack-modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: attack-modal-fade 120ms ease;
}
@keyframes attack-modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.attack-modal__panel {
  position: relative;
  width: 100%;
  max-width: 850px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--panel, #14181d);
  border: 1px solid var(--panel-border, #232a32);
  border-radius: 8px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
  color: var(--text, #d4dae0);
}
.attack-modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: transparent;
  color: var(--text-dim, #8892a0);
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.attack-modal__close:hover {
  color: var(--text, #d4dae0);
  border-color: var(--panel-border, #232a32);
}
.attack-modal__title {
  padding: 14px 48px 10px 18px;
  border-bottom: 1px solid var(--panel-border, #232a32);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.attack-modal__title .kind {
  color: var(--accent, #5eead4);
  text-transform: uppercase;
  margin-right: 6px;
}
.attack-modal__body {
  flex: 1 1;
  overflow: auto;
  padding: 14px 18px 18px;
  font-size: 12px;
  line-height: 1.5;
}
.attack-modal__loading,
.attack-modal__error {
  color: var(--text-dim, #8892a0);
  font-style: italic;
}
.attack-modal__error { color: var(--red, #ef4444); }
.attack-modal__section { margin-bottom: 16px; }
.attack-modal__section:last-child { margin-bottom: 0; }
.attack-modal__section-h {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim, #8892a0);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--panel-border, #232a32);
}
.attack-modal__prompt {
  margin: 4px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}
.attack-modal__prompt .role {
  color: var(--accent, #5eead4);
  font-weight: 600;
}
.attack-modal__prompt .content {
  color: var(--text, #d4dae0);
  white-space: pre-wrap;
  word-break: break-word;
}
.attack-modal__atts {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim, #8892a0);
}
.attack-modal__atts .attachment {
  margin-right: 6px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}
.attack-modal__response {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.35);
  padding: 10px 12px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: var(--text, #d4dae0);
  max-height: 320px;
  overflow: auto;
}
.attack-modal__rationale {
  font-size: 12px;
  color: var(--text, #d4dae0);
  font-style: italic;
  line-height: 1.55;
}

/* --- Bugs button (top bar) ------------------------------------------ */
.status-bar .bugs-button {
  /* The first .help-button child of the status bar already has
   * margin-left:auto — Bugs renders first so it gets that push. Help
   * sits to its right via a small left gap. */
  margin-left: auto;
  margin-right: 6px;
  position: relative;
}
.status-bar .bugs-button + .help-button {
  margin-left: 0;
}
.status-bar .bugs-button__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  margin-left: 4px;
  background: var(--red, #ef4444);
  color: #fff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  font-family: ui-sans-serif, system-ui, sans-serif;
  line-height: 1;
}

/* --- /bugs full-page Bug Inbox -------------------------------------- */
.bugs-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, sans-serif;
  font-size: 14px;
  color: var(--text);
}
.bugs-page .back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.bugs-page .back-link:hover { text-decoration: underline; }
.bugs-page h1 {
  font-size: 26px;
  margin: 0 0 4px;
  color: var(--text);
}
.bugs-page .lede {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 18px;
}
.bugs-page__filters {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.bugs-page__filters select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  padding: 3px 6px;
  font: inherit;
  margin-left: 4px;
}
.bugs-page__count {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}
.bugs-page__body {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.bug-table--full {
  font-size: 12px;
  table-layout: auto;
}
.bug-table--full th,
.bug-table--full td {
  padding: 8px 12px;
  white-space: normal;
}
.bug-table--full tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}
.bug-table__title {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.bug-action {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
}
.bug-action:hover {
  border-color: var(--accent);
  background: rgba(94, 234, 212, 0.05);
}

/* --- Help icon popover ---------------------------------------------- */
.help-wrap { position: relative; display: inline-flex; }
.help-icon {
  background: transparent;
  border: 1px solid var(--panel-border, #333);
  color: var(--text-dim, #888);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.help-icon:hover, .help-icon[aria-expanded="true"] {
  border-color: var(--accent, #3b82f6);
  color: var(--accent, #3b82f6);
}
.help-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: 320px;
  max-width: 80vw;
  background: var(--panel-bg, #1a1a1a);
  border: 1px solid var(--panel-border, #333);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  white-space: normal;
  color: var(--text, #ddd);
}
.help-popover__title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim, #888);
  margin-bottom: 4px;
}
.help-popover__body { color: var(--text, #ddd); }

/* --- Attack feed grouped row badges --------------------------------- */
.feed-row .detail { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.feed-row .badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-success { background: rgba(239, 68, 68, 0.15); color: var(--red, #ef4444); }
.badge-fail    { background: rgba(74, 222, 128, 0.12); color: var(--green, #4ade80); }
.badge-partial { background: rgba(245, 158, 11, 0.15); color: var(--amber, #f59e0b); }
.badge-pending { background: rgba(107,114,128,0.15); color: var(--text-dim, #888); font-style: italic; }
.badge-finding { background: rgba(94, 234, 212, 0.10); color: var(--accent, #5eead4); }
.badge-sev-p0  { box-shadow: inset 0 0 0 1px var(--red, #ef4444); }
.badge-sev-p1  { box-shadow: inset 0 0 0 1px var(--amber, #f59e0b); }
.badge-sev-p2, .badge-sev-p3 { box-shadow: inset 0 0 0 1px var(--text-dim, #888); }

/* ── Topology v3 — edge + handle polish ───────────────────────────────
 *
 * Every node in v3 carries a fan of 22 handles (5 top + 5 bottom + 6
 * left + 6 right) so that fan-out / fan-in edges can each pick a
 * distinct slot. The handle dots themselves are not useful UI — only
 * their positions matter for edge routing — so we hide them. The edge
 * polish below thickens the stroke slightly and color-codes the three
 * special edge classes (attack / response / observe). All other edges
 * inherit React Flow's default stroke from the inline ``style`` prop.
 */
.react-flow__edge-path {
  stroke-width: 1.5px;
}
.react-flow__edge.edge-attack .react-flow__edge-path { stroke: #ef4444; }
.react-flow__edge.edge-response .react-flow__edge-path { stroke: #5eead4; }
.react-flow__edge.edge-observe .react-flow__edge-path {
  stroke: #6b7280;
  stroke-dasharray: 4 4;
}
.react-flow__edge.edge-alert .react-flow__edge-path {
  stroke: #ef4444;
}

/* Handle dots — invisible but still pickable by React Flow for routing.
 * We use a tiny click target rather than display:none so RF's geometry
 * math still treats the handle as a real position on the node border. */
.react-flow__handle {
  width: 6px;
  height: 6px;
  border: none;
  background: transparent;
  opacity: 0;
}

