/* graph.css — the control plane's run-graph stylesheet (crates/rupu-cp/web/src/styles/graph-motion.css),
   ported to the site: same anatomy, same motion, same values. Tokens are R G B channels. */
:root {
  --c-bg: 10 10 10; --c-panel: 20 20 22; --c-surface: 27 27 31; --c-surface-hover: 35 35 39;
  --c-border: 38 38 42; --c-border-strong: 63 63 70;
  --c-ink: 245 245 245; --c-ink-dim: 161 161 170; --c-ink-mute: 113 113 122;
  --c-brand-500: 124 58 237;
  --c-status-running: 96 165 250; --c-status-done: 74 222 128; --c-status-failed: 248 113 113;
  --c-status-awaiting: 251 191 36; --c-status-paused: 34 211 238; --c-status-pending: 113 113 122;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --rgx-stagger: 70ms; --rgx-enter: 460ms; --rgx-draw: 420ms;
  --gx-spring: cubic-bezier(0.34, 1.2, 0.64, 1);
  --gx-card: var(--c-surface); --gx-sh: 0 0 0;
  --gx-shadow-rest: 0 1px 1px rgb(var(--gx-sh) / 0.35), 0 4px 10px -2px rgb(var(--gx-sh) / 0.45);
  --gx-shadow-lift: 0 2px 4px rgb(var(--gx-sh) / 0.45), 0 14px 32px -8px rgb(var(--gx-sh) / 0.7);
  --gx-highlight: inset 0 1px 0 rgb(255 255 255 / 0.07);
  --gx-glow-rest: 0.4;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-w-0 { min-width: 0; } .flex-1 { flex: 1 1 0%; } .flex { display: flex; } .items-center { align-items: center; } .gap-1 { gap: 4px; }
.opacity-60 { opacity: .6; }

/* The run at a glance, over the canvas's top-right corner. */
.gx-summary {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgb(var(--c-border));
  border-radius: 13px;
  background: rgb(var(--c-panel) / 0.9);
  box-shadow: var(--gx-shadow-rest), var(--gx-highlight);
  font-size: 11px;
  color: rgb(var(--c-ink-dim));
  pointer-events: none;
  animation: rgx-fade 300ms ease-out 200ms backwards;
}
.gx-summary-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.gx-summary-item b { color: rgb(var(--c-ink)); font-weight: 600; font-variant-numeric: tabular-nums; }


/* Status color, by state, for anything marked .gx-s[data-state]. */
.gx-s { --gx-c: var(--c-status-pending); }
.gx-s[data-state='running'] { --gx-c: var(--c-status-running); }
.gx-s[data-state='done'] { --gx-c: var(--c-status-done); }
.gx-s[data-state='failed'] { --gx-c: var(--c-status-failed); }
.gx-s[data-state='awaiting_approval'] { --gx-c: var(--c-status-awaiting); }
.gx-s[data-state='paused'] { --gx-c: var(--c-status-paused); }

/* ── the card ── */
.gx-node {
  position: relative;
  --k: var(--c-ink-mute);
  animation: rgx-enter var(--rgx-enter) var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * var(--rgx-stagger));
}
@keyframes rgx-enter {
  from { opacity: 0; translate: 0 10px; scale: 0.985; }
}
.gx-card {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 11px 13px 10px;
  border: 1px solid rgb(var(--c-border));
  border-radius: 12px;
  background: rgb(var(--gx-card));
  box-shadow: var(--gx-shadow-rest), var(--gx-highlight);
  overflow: hidden;
  text-align: left;
  font-variant-numeric: tabular-nums;
  transition: translate 180ms var(--ease-out), border-color 240ms ease;
}
.gx-node[data-state='failed'] > .gx-card { border-color: rgb(var(--c-status-failed) / 0.55); }
.gx-node[data-state='awaiting_approval'] > .gx-card { border-color: rgb(var(--c-status-awaiting) / 0.5); }

/* Depth: the lift shadow cross-fades in (never a shadow transition). */
.gx-lift {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 12px;
  box-shadow: var(--gx-shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease, translate 180ms var(--ease-out);
}
:is(.gx-node[data-state='running'], .gx-node[data-state='awaiting_approval']) > :is(.gx-card, .gx-lift) {
  translate: 0 -1px;
}
:is(.gx-node[data-state='running'], .gx-node[data-state='awaiting_approval']) > .gx-lift { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .gx-node:hover > :is(.gx-card, .gx-lift) { translate: 0 -1px; }
  .gx-node:hover > .gx-lift { opacity: 1; }
  .gx-node:hover > .gx-card { border-color: rgb(var(--c-ink) / 0.14); }
  .gx-node:hover[data-state='failed'] > .gx-card { border-color: rgb(var(--c-status-failed) / 0.7); }
}

/* The under-glow a working card breathes on, and the bloom a landing plays. */
.gx-glow,
.gx-bloom {
  position: absolute;
  z-index: 0;
  left: 14%;
  right: 14%;
  bottom: -8px;
  height: 24px;
  border-radius: 50%;
  filter: blur(14px);
  opacity: 0;
  pointer-events: none;
}
.gx-glow { background: rgb(var(--c-status-running)); transition: opacity 400ms ease; }
.gx-node[data-state='running'] > .gx-glow {
  opacity: var(--gx-glow-rest);
  animation: gx-breathe 2.8s var(--ease-in-out) infinite;
}
.gx-node[data-state='awaiting_approval'] > .gx-glow {
  background: rgb(var(--c-status-awaiting));
  opacity: calc(var(--gx-glow-rest) * 0.75);
}
@keyframes gx-breathe {
  0%, 100% { opacity: var(--gx-glow-rest); scale: 0.96 1; }
  50% { opacity: calc(var(--gx-glow-rest) + 0.25); scale: 1.05 1; }
}
.gx-bloom {
  left: 6%;
  right: 6%;
  bottom: -12px;
  height: 30px;
  filter: blur(18px);
  background: rgb(var(--c-status-done));
}
.gx-node[data-cue='done'] > .gx-bloom { animation: gx-bloom 1000ms var(--ease-out); }
@keyframes gx-bloom {
  0% { opacity: 0; scale: 0.85; }
  30% { opacity: 0.8; }
  100% { opacity: 0; scale: 1.15; }
}
.gx-flash {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: rgb(var(--c-status-failed));
  opacity: 0;
  pointer-events: none;
}
.gx-node[data-cue='failed'] > .gx-card > .gx-flash { animation: gx-flash 440ms var(--ease-out); }
@keyframes gx-flash {
  0% { opacity: 0; }
  15% { opacity: 0.26; }
  100% { opacity: 0; }
}

/* Selection: a brand ring with a gap. */
.gx-sel {
  position: absolute;
  inset: -5px;
  z-index: 3;
  border: 2px solid rgb(var(--c-brand-500));
  border-radius: 17px;
  box-shadow: 0 0 0 4px rgb(var(--c-brand-500) / 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.gx-node[data-selected] > .gx-sel { opacity: 1; }
/* An end of the selected message: the ring, lighter and without its halo. */
.gx-node[data-lit] > .gx-sel { opacity: 0.7; box-shadow: none; }
.react-flow__node.selected .gx-node[data-lit] > .gx-sel { opacity: 1; }

/* Ports: a small ring on each side, in the kind's color. */
.gx-port {
  position: absolute; top: 50%; z-index: 4; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  border: 1.5px solid rgb(var(--k) / 0.55); background: rgb(var(--gx-card));
}
.gx-port-in { left: -3.5px; } .gx-port-out { right: -3.5px; }

/* ── anatomy ── */
.gx-head { display: flex; align-items: center; gap: 7px; height: 20px; min-width: 0; }
.gx-tile {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgb(var(--k) / 0.14);
  color: rgb(var(--k));
}
.gx-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgb(var(--c-ink));
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gx-count {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: rgb(var(--c-ink-dim));
}
.gx-body { margin-top: 9px; min-width: 0; }
.gx-line {
  overflow: hidden;
  font-size: 12px;
  line-height: 16px;
  color: rgb(var(--c-ink));
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gx-sub {
  overflow: hidden;
  font-size: 11px;
  line-height: 14px;
  color: rgb(var(--c-ink-dim));
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gx-body > .gx-sub { margin-top: 0; }
.gx-line + .gx-sub { margin-top: 2px; }
.gx-row { display: flex; align-items: center; gap: 8px; height: 28px; }
.gx-grow { flex: 1 1 auto; }
.gx-tag {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgb(var(--c-surface));
  font-size: 10px;
  font-weight: 600;
  color: rgb(var(--c-ink-dim));
}
.gx-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 9px;
  font-size: 10px;
  line-height: 12px;
  min-width: 0;
}
.gx-kind {
  flex: none;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--k));
}
.gx-failcount { font-size: 10px; font-weight: 600; color: rgb(var(--c-status-failed)); }

/* Identity: `leaf · agent` 12px, provider/model 11px mono. */
.gx-ident [data-testid='agent-head'] { font-size: 12px; line-height: 16px; color: rgb(var(--c-ink)); }
.gx-ident [data-testid='agent-pm'] { margin-top: 2px; font-size: 11px; line-height: 14px; color: rgb(var(--c-ink-dim)); }
.gx-ident-sm [data-testid='agent-head'] { font-size: 11px; line-height: 14px; color: rgb(var(--c-ink-dim)); }
.gx-ident-sm [data-testid='agent-pm'] { margin-top: 1px; font-size: 10px; line-height: 13px; color: rgb(var(--c-ink-mute)); }

/* The progress line a working card (or row) carries along its foot. */
.gx-runline {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  overflow: hidden;
  border-radius: 1px;
  background: rgb(var(--c-status-running) / 0.16);
}
.gx-runline > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: 1px;
  background: linear-gradient(90deg, rgb(var(--c-status-running) / 0), rgb(var(--c-status-running)), rgb(var(--c-status-running) / 0));
  translate: -100% 0;
  animation: gx-run 1.6s var(--ease-in-out) infinite;
}
@keyframes gx-run {
  to { translate: 270% 0; }
}

/* ── status capsule + its morphing glyph ── */
.gx-cap {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px 0 5px;
  border-radius: 10px;
  background: rgb(var(--gx-c) / 0.1);
  box-shadow: inset 0 0 0 1px rgb(var(--gx-c) / 0.22);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgb(var(--c-ink) / 0.82);
  transition: background-color 240ms ease, box-shadow 240ms ease;
}
.gx-cap:is([data-state='pending'], [data-state='skipped']) { color: rgb(var(--c-ink-dim)); }
.gx-cap-sm { height: 18px; }
/* A calm state's capsule is its glyph alone, in a round chip. */
.gx-cap-quiet { justify-content: center; width: 20px; padding: 0; }
.gx-cap-sm.gx-cap-quiet { width: 18px; }
.gx-word { animation: rgx-fade 220ms ease-out; }
.gx-glyph { flex: none; width: 12px; height: 12px; overflow: visible; color: rgb(var(--gx-c)); }
.gx-glyph :is(circle, path) {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* The arc spins while running and only pauses otherwise: closed, a ring
   reads the same at any angle, so landing never snaps the rotation back. */
.gx-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: gx-spin 1s linear infinite paused;
}
.gx-glyph[data-state='running'] .gx-spin { animation-play-state: running; }
@keyframes gx-spin {
  to { rotate: 360deg; }
}
.gx-g-ring {
  stroke-dasharray: 34.6px;
  stroke-dashoffset: 34.6px;
  transition: stroke-dashoffset 460ms var(--ease-out), opacity 200ms ease;
}
.gx-glyph[data-state='running'] .gx-g-ring { stroke-dashoffset: 24px; }
.gx-glyph:is([data-state='done'], [data-state='failed'], [data-state='awaiting_approval'], [data-state='paused']) .gx-g-ring {
  stroke-dashoffset: 0;
}
.gx-glyph[data-state='skipped'] .gx-g-ring { stroke-dashoffset: 0; opacity: 0.55; }
.gx-g-dash { stroke-dasharray: 2.3px 2.1px; opacity: 0; transition: opacity 200ms ease; }
.gx-glyph[data-state='pending'] .gx-g-dash { opacity: 1; }
.gx-g-check {
  stroke-dasharray: 9.5px;
  stroke-dashoffset: 9.5px;
  opacity: 0;
  transition: stroke-dashoffset 460ms var(--ease-out) 140ms, opacity 160ms ease 140ms;
}
.gx-glyph[data-state='done'] .gx-g-check { stroke-dashoffset: 0; opacity: 1; }
.gx-g-x1,
.gx-g-x2 {
  stroke-dasharray: 7px;
  stroke-dashoffset: 7px;
  opacity: 0;
  transition: stroke-dashoffset 460ms var(--ease-out), opacity 120ms ease;
}
.gx-g-x2 { transition-delay: 110ms; }
.gx-glyph[data-state='failed'] :is(.gx-g-x1, .gx-g-x2) { stroke-dashoffset: 0; opacity: 1; }
.gx-glyph .gx-g-dot {
  fill: currentColor;
  stroke: none;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 200ms ease;
}
.gx-glyph[data-state='awaiting_approval'] .gx-g-dot { opacity: 1; animation: gx-pulse 1.7s ease-in-out infinite; }
@keyframes gx-pulse {
  0%, 100% { scale: 1; }
  50% { scale: 1.45; }
}
.gx-g-pause,
.gx-g-skip { opacity: 0; transition: opacity 160ms ease; }
.gx-glyph[data-state='paused'] .gx-g-pause { opacity: 1; }
.gx-glyph[data-state='skipped'] .gx-g-skip { opacity: 1; }

/* ── parallel rows ── */
.gx-subrows { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.gx-subrow {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 32px;
  padding: 6px 6px 6px 8px;
  border-radius: 8px;
  background: rgb(var(--c-ink) / 0.035);
  overflow: hidden;
  transition: background-color 240ms ease;
}
/* A row reserves its identity's two lines (nodeSize), so the card has no gap. */
.gx-subrow:has(.gx-ident) { min-height: 62px; }
.gx-subrow[data-state='running'] { background: rgb(var(--c-status-running) / 0.08); }
.gx-subrow[data-state='failed'] { background: rgb(var(--c-status-failed) / 0.08); }
.gx-subrow::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgb(var(--c-status-done) / 0.2);
  opacity: 0;
  pointer-events: none;
}
.gx-subrow[data-cue='done']::after { animation: gx-row-bloom 800ms var(--ease-out); }
@keyframes gx-row-bloom {
  0% { opacity: 0; }
  25% { opacity: 1; }
  100% { opacity: 0; }
}
.gx-subrow .gx-runline { left: 8px; right: 8px; }
.gx-subrow-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.gx-subname {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  color: rgb(var(--c-ink));
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gx-subrow .gx-ident { margin-top: 3px; }

/* ── fan-out ── */
.gx-cells { display: grid; gap: 5px; }
.gx-cell {
  display: grid;
  place-items: center;
  height: 24px;
  border: 1px solid rgb(var(--gx-c) / 0.3);
  border-radius: 6px;
  background: rgb(var(--gx-c) / 0.1);
  cursor: pointer;
  transition: background-color 240ms ease, border-color 240ms ease, scale 140ms var(--ease-out);
}
.gx-cell[data-state='pending'] { border-style: dashed; border-color: rgb(var(--gx-c) / 0.5); background: transparent; }
.gx-cell[data-cue='done'] { animation: gx-pop 380ms var(--gx-spring); }
@keyframes gx-pop {
  40% { scale: 1.1; }
}
@media (hover: hover) and (pointer: fine) {
  .gx-cell:hover { scale: 1.06; }
}
.gx-cell:active { scale: 0.96; }
/* A unit's grid cell: its button, and its message-arc ends beside it (an
 * invisible point at the cell's centre). */
.gx-cell-slot { position: relative; display: grid; }
.gx-cell-slot > .react-flow__handle.gx-unit-port {
  top: 50%; left: 50%; width: 1px; height: 1px; min-width: 0; min-height: 0;
  border: 0; background: none; opacity: 0; pointer-events: none; transform: none;
}
.gx-role { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font-size: 10px; color: rgb(var(--c-ink-dim)); }
.gx-big { display: flex; align-items: baseline; gap: 6px; }
.gx-big-n { font-size: 24px; font-weight: 650; line-height: 1; letter-spacing: -0.02em; color: rgb(var(--c-ink)); }
.gx-pct { margin-left: auto; font-size: 13px; font-weight: 650; color: rgb(var(--k)); }
.gx-bar {
  position: relative;
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 3px;
  background: rgb(var(--c-surface));
}
.gx-bar-fill {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, rgb(var(--c-status-running)), rgb(var(--c-status-done)));
  transform-origin: left;
  transition: scale 600ms var(--ease-out);
}
.gx-bar[data-live]::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.55), transparent);
  translate: -100% 0;
  animation: gx-run 1.8s var(--ease-in-out) infinite;
}
.gx-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: 11px; color: rgb(var(--c-ink-dim)); }
.gx-stats b { font-weight: 600; color: rgb(var(--c-ink)); }
.gx-mini { display: grid; grid-template-columns: repeat(20, 8px); gap: 2px; margin-top: 10px; }
.gx-mini-cell {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: rgb(var(--gx-c) / 0.85);
  transition: background-color 300ms ease;
}
.gx-mini-cell[data-state='pending'] { background: rgb(var(--gx-c) / 0.3); }
.gx-mini-cell[data-state='running'] { animation: gx-cell-work 1.8s ease-in-out infinite; }
@keyframes gx-cell-work {
  50% { opacity: 0.4; }
}
.gx-link {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 500;
  color: rgb(var(--k));
  text-align: left;
}
@media (hover: hover) and (pointer: fine) {
  .gx-link:hover { text-decoration: underline; }
}

/* ── panel ── */
.gx-chip {
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  background: rgb(var(--c-status-awaiting) / 0.1);
  box-shadow: inset 0 0 0 1px rgb(var(--c-status-awaiting) / 0.28);
  font-size: 11px;
  font-weight: 500;
  color: rgb(var(--c-ink) / 0.82);
}
.gx-prows { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.gx-prow {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgb(var(--c-ink) / 0.035);
  text-align: left;
  transition: background-color 200ms ease;
}
.gx-prow[data-cue='done'] { animation: gx-pop 380ms var(--gx-spring); }
@media (hover: hover) and (pointer: fine) {
  .gx-prow:hover { background: rgb(var(--c-ink) / 0.07); }
}
.gx-loop { display: inline-block; color: rgb(var(--c-status-awaiting)); animation: gx-spin 2.4s linear infinite; }

/* ── gate actions ── */
.gx-approve {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 13px 0 10px;
  border-radius: 14px;
  background: rgb(var(--c-status-awaiting));
  box-shadow: 0 1px 2px rgb(var(--gx-sh) / 0.14), inset 0 1px 0 rgb(255 255 255 / 0.35);
  font-size: 12px;
  font-weight: 600;
  color: rgb(15 23 42);
  animation: gx-invite 2.6s var(--ease-in-out) infinite;
  transition: scale 120ms var(--ease-out), opacity 160ms ease;
}
.gx-approve::before {
  content: '';
  position: absolute;
  inset: -3px;
  z-index: -1;
  border-radius: 17px;
  background: rgb(var(--c-status-awaiting) / 0.4);
  filter: blur(6px);
  animation: gx-invite-glow 2.6s var(--ease-in-out) infinite;
}
@keyframes gx-invite {
  50% { scale: 1.03; }
}
@keyframes gx-invite-glow {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.85; }
}
.gx-approve:active:not(:disabled) { scale: 0.97; animation: none; }
.gx-approve:disabled { opacity: 0.6; animation: none; }
.gx-approve:disabled::before { animation: none; opacity: 0; }
.gx-btn {
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 150ms ease, scale 120ms var(--ease-out);
}
.gx-btn:active:not(:disabled) { scale: 0.97; }
.gx-btn:disabled { opacity: 0.6; }
.gx-btn-quiet { color: rgb(var(--c-ink-dim)); }
.gx-btn-danger { background: rgb(var(--c-status-failed)); color: rgb(255 255 255); }
@media (hover: hover) and (pointer: fine) {
  .gx-btn-quiet:hover:not(:disabled) { background: rgb(var(--c-surface-hover)); color: rgb(var(--c-ink)); }
}
.gx-error {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  color: rgb(var(--c-status-failed));
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gx-gate-done { animation: rgx-fade 240ms ease-out; }
.gx-swap { animation: rgx-fade 260ms ease-out; }

/* ── edges ── */
.gx-edge path { fill: none; stroke-linecap: round; }
.gx-e-base {
  stroke-width: 2;
  stroke-dasharray: 1 1;
  opacity: 0.26;
  animation: rgx-draw var(--rgx-draw) var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * var(--rgx-stagger) + 260ms);
  transition: opacity 320ms ease;
}
.gx-edge:is([data-tone='lit'], [data-tone='live'], [data-tone='await']) .gx-e-base { opacity: 1; }
.gx-edge[data-tone='dead'] .gx-e-base { opacity: 0; }
.gx-e-halo { stroke-width: 6; filter: blur(3px); opacity: 0; transition: opacity 320ms ease; }
.gx-edge[data-tone='lit'] .gx-e-halo { opacity: 0.22; }
.gx-edge:is([data-tone='live'], [data-tone='await']) .gx-e-halo { opacity: 0.32; }
.gx-e-dead {
  stroke: rgb(var(--c-status-failed));
  stroke-width: 1.5;
  stroke-dasharray: 3 6;
  opacity: 0;
  transition: opacity 320ms ease;
}
.gx-edge[data-tone='dead'] .gx-e-dead { opacity: 0.5; }
@keyframes rgx-draw {
  from { stroke-dashoffset: 1; }
}
/* The travelling glow: a blurred comet with a bright core. */
.gx-e-comet,
.gx-e-core {
  --gx-light-at: calc(var(--i, 0) * var(--rgx-stagger) + 260ms + var(--rgx-draw));
  animation:
    gx-travel 2.4s var(--ease-in-out) var(--gx-light-at) infinite,
    rgx-fade 300ms ease-out var(--gx-light-at) backwards;
}
.gx-e-comet { stroke-width: 5; stroke-dasharray: 0.2 1.2; filter: blur(3px); opacity: 0.6; }
.gx-e-core { stroke-width: 2.5; stroke-dasharray: 0.1 1.1; }
.gx-edge[data-tone='await'] :is(.gx-e-comet, .gx-e-core) { animation-duration: 3.4s, 300ms; }
@keyframes gx-travel {
  from { stroke-dashoffset: 0.2; }
  to { stroke-dashoffset: -1; }
}
@keyframes rgx-travel {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes rgx-fade {
  from { opacity: 0; }
}

/* ── reduced motion: fades, no travel, no breathing (CP rules) ── */
@media (prefers-reduced-motion: reduce) {
  .gx-node { animation: rgx-fade 240ms ease-out backwards; animation-delay: 0ms; }
  .gx-node > :is(.gx-card, .gx-lift) { translate: none !important; }
  .gx-node > .gx-glow { animation: none; }
  .gx-node[data-cue='done'] > .gx-bloom { animation: gx-bloom-fade 900ms ease-out; }
  .gx-runline > i, .gx-bar[data-live]::after { animation: none; translate: 80% 0; }
  .gx-spin, .gx-loop, .gx-glyph .gx-g-dot, .gx-approve, .gx-approve::before { animation: none; }
  .gx-g-ring, .gx-g-check, .gx-g-x1, .gx-g-x2 { transition-property: opacity; }
  .gx-cell[data-cue], .gx-prow[data-cue] { animation: none; }
  .gx-e-base { animation: rgx-fade 240ms ease-out backwards; animation-delay: 0ms; }
  .gx-e-comet, .gx-e-core { display: none; }
}
@keyframes gx-bloom-fade { 30% { opacity: 0.6; } }
