/* ── Mission Control: Data Pipe X-Ray ── */

/* ── Dark theme (default) ── */
[data-bs-theme="dark"],
:root {
  --neon-green: #00ff99;
  --neon-blue: #38bdf8;
  --neon-purple: #a78bfa;
  --neon-red: #ff4c4c;
  --neon-amber: #f59e0b;
  --bg-deep: #020617;
  --bg-card: rgba(15, 23, 42, 0.85);
  --border-glow: rgba(56, 189, 248, 0.25);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --grid-color: rgba(56, 189, 248, 0.04);
  --navbar-bg: rgba(2, 6, 23, 0.92);
  --console-bg: rgba(2, 6, 23, 0.6);
  --spec-bg: rgba(2, 6, 23, 0.7);
  --code-bg: rgba(2, 6, 23, 0.6);
  --graph-bg: rgba(2, 6, 23, 0.5);
  --node-fill: rgba(15, 23, 42, 0.95);
  --node-stroke: rgba(148, 163, 184, 0.5);
  --node-label: rgba(209, 213, 219, 0.85);
  --edge-stroke: rgba(148, 163, 184, 0.25);
}

* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

code,
pre,
.font-monospace {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace !important;
}

/* ── Particle Canvas ── */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* ── Light theme ── */
[data-bs-theme="light"] {
  --neon-green: #059669;
  --neon-blue: #0284c7;
  --neon-purple: #7c3aed;
  --neon-red: #dc2626;
  --neon-amber: #d97706;
  --bg-deep: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.92);
  --border-glow: rgba(2, 132, 199, 0.2);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --grid-color: rgba(2, 132, 199, 0.06);
  --navbar-bg: rgba(255, 255, 255, 0.95);
  --console-bg: rgba(248, 250, 252, 0.9);
  --spec-bg: rgba(248, 250, 252, 0.95);
  --code-bg: #f8fafc;
  --graph-bg: rgba(248, 250, 252, 0.7);
  --node-fill: rgba(255, 255, 255, 0.95);
  --node-stroke: rgba(71, 85, 105, 0.5);
  --node-label: #334155;
  --edge-stroke: rgba(71, 85, 105, 0.25);
}

html,
body {
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

/* Override Bootstrap's text-secondary to be more readable */
.text-secondary {
  color: var(--text-secondary) !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(56, 189, 248, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(0, 255, 153, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(167, 139, 250, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

[data-bs-theme="light"] body::before,
[data-bs-theme="light"]::before {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(2, 132, 199, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(5, 150, 105, 0.06) 0%, transparent 50%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  animation: gridDrift 20s linear infinite;
}

@keyframes gridDrift {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(48px, 48px);
  }
}

/* ── Navbar ── */
.navbar {
  background: var(--navbar-bg) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glow) !important;
  z-index: 1060;
  position: relative;
}

/* (floating metrics are now in .floating-metrics below) */

.time-saved-float .ts-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon-green);
  opacity: 0.8;
}

.time-saved-float .ts-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.time-saved-float .ts-sub {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* ── Hero Section ── */
.hero-title {
  font-size: 3.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--text-primary) 20%, var(--neon-blue) 50%, var(--neon-green) 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
  animation: shimmerTitle 4s ease-in-out infinite;
}

@keyframes shimmerTitle {

  0%,
  100% {
    background-position: 0% center;
  }

  50% {
    background-position: 100% center;
  }
}

.hero-sub {
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

/* ── Launch Button ── */
.btn-launch {
  background: linear-gradient(135deg, var(--neon-green), var(--neon-blue));
  color: #020617;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  padding: 0.75rem 2.5rem;
  border: none;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  text-transform: uppercase;
}

.btn-launch:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 0 50px rgba(0, 255, 153, 0.45), 0 0 100px rgba(56, 189, 248, 0.2), 0 8px 32px rgba(0, 0, 0, 0.3);
  color: #020617;
}

.btn-launch:disabled {
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.btn-launch::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-blue));
  z-index: -1;
  filter: blur(12px);
  opacity: 0.5;
}

.btn-launch.launching {
  animation: launchIgnition 0.8s ease;
}

@keyframes launchIgnition {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 255, 153, 0.7);
  }

  30% {
    transform: scale(0.95);
  }

  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 30px rgba(0, 255, 153, 0), 0 0 60px rgba(0, 255, 153, 0.3);
  }

  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

/* ── Scenario Pills ── */
.scenario-btn {
  border-radius: 999px;
  border-color: var(--border-glow);
  color: var(--neon-blue);
  font-size: 0.78rem;
  transition: all 0.3s;
  backdrop-filter: blur(4px);
}

.scenario-btn:hover,
.scenario-btn.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--neon-blue);
  color: var(--text-primary);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

/* ── Agent Console ── */
.agent-console-card {
  border-radius: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
}

.agent-console-log {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  background: var(--console-bg);
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
}

.agent-console-log-line {
  white-space: pre-wrap;
  padding: 1px 0;
  animation: fadeSlideIn 0.3s ease-out;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.agent-console-log-line.agent {
  color: var(--neon-purple);
}

.agent-console-log-line.signal {
  color: var(--neon-green);
}

.agent-console-log-line.warning {
  color: var(--neon-amber);
}

.agent-console-log-line.system {
  color: var(--neon-blue);
}

.agent-phase-pill {
  border-radius: 999px;
  padding: 0.15rem 0.75rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.agent-phase-pill.idle {
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
}

.agent-phase-pill.scanning {
  background: rgba(56, 189, 248, 0.15);
  color: var(--neon-blue);
  animation: pulsePill 1.5s ease infinite;
}

.agent-phase-pill.generating {
  background: rgba(167, 139, 250, 0.15);
  color: var(--neon-purple);
  animation: pulsePill 1.5s ease infinite;
}

.agent-phase-pill.xray {
  background: rgba(0, 255, 153, 0.15);
  color: var(--neon-green);
  animation: pulsePill 1.2s ease infinite;
}

@keyframes pulsePill {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* ── Cards / Panels ── */
.xray-card {
  border-radius: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

[data-bs-theme="dark"] .xray-card {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ── Spec Textarea ── */
.spec-textarea {
  min-height: 140px;
  max-height: 200px;
  resize: vertical;
  background: var(--spec-bg) !important;
  border-color: var(--border-glow) !important;
  color: var(--text-primary) !important;
  font-size: 0.82rem;
}

/* ── Scan Overlay ── */
.spec-scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom,
      rgba(0, 255, 153, 0) 0%,
      rgba(0, 255, 153, 0.35) 48%,
      rgba(56, 189, 248, 0.2) 52%,
      rgba(56, 189, 248, 0) 100%);
  mix-blend-mode: screen;
  animation: scan 2s linear infinite;
}

@keyframes scan {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(100%);
    opacity: 0;
  }
}

/* ── Code Panes (height set in new section below) ── */

/* Let highlight.js handle syntax colors; only set fallback */
.code-pane code {
  color: var(--text-primary);
}

.code-pane code.hljs {
  background: transparent !important;
  padding: 0 !important;
}

/* ── X-Ray Graph ── */
.xray-graph-shell {
  min-height: 360px;
  background: var(--graph-bg);
  border-radius: 0.75rem;
  border: 1px solid var(--border-glow);
  overflow: hidden;
}

/* SVG edges */
.xray-edge {
  stroke: var(--edge-stroke);
  stroke-width: 2;
  stroke-dasharray: 8 5;
  transition: stroke 0.3s;
}

.xray-arrowhead {
  fill: var(--edge-stroke);
  transition: fill 0.3s;
}

/* SVG nodes */
.xray-node {
  cursor: pointer;
}

.xray-node-ring {
  fill: none;
  stroke: var(--node-stroke);
  stroke-opacity: 0.15;
  stroke-width: 1;
  transition: all 0.3s ease;
}

.xray-node-circle {
  fill: var(--node-fill);
  stroke: var(--node-stroke);
  stroke-width: 2.5;
  transition: all 0.3s ease;
}

.xray-node-icon {
  fill: var(--text-secondary);
  pointer-events: none;
  transition: fill 0.3s;
}

.xray-node-label {
  fill: var(--node-label);
  pointer-events: none;
  transition: fill 0.3s;
}

/* Active (currently processing) */
.xray-node.active .xray-node-circle {
  stroke: var(--neon-green);
  filter: drop-shadow(0 0 10px var(--neon-green));
}

.xray-node.active .xray-node-ring {
  stroke: var(--neon-green);
  stroke-opacity: 0.3;
}

/* Passed */
.xray-node.passed .xray-node-circle {
  stroke: var(--neon-green);
  filter: drop-shadow(0 0 6px var(--neon-green));
}

.xray-node.passed .xray-node-ring {
  stroke: var(--neon-green);
  stroke-opacity: 0.2;
}

/* Failed */
.xray-node.failed .xray-node-circle {
  stroke: var(--neon-red);
  filter: drop-shadow(0 0 14px var(--neon-red));
  animation: pulseRedCircle 0.8s ease infinite;
}

.xray-node.failed .xray-node-ring {
  stroke: var(--neon-red);
  stroke-opacity: 0.4;
  animation: pulseRedRing 0.8s ease infinite;
}

@keyframes pulseRedCircle {

  0%,
  100% {
    filter: drop-shadow(0 0 14px var(--neon-red));
  }

  50% {
    filter: drop-shadow(0 0 24px var(--neon-red));
  }
}

@keyframes pulseRedRing {

  0%,
  100% {
    stroke-opacity: 0.4;
  }

  50% {
    stroke-opacity: 0.7;
  }
}

/* Risk heatmap coloring on nodes (before X-Ray runs) */
.xray-node.risk-low .xray-node-ring {
  stroke: var(--neon-green);
  stroke-opacity: 0.15;
}

.xray-node.risk-medium .xray-node-ring {
  stroke: var(--neon-amber);
  stroke-opacity: 0.25;
}

.xray-node.risk-medium .xray-node-circle {
  stroke: var(--neon-amber);
  stroke-opacity: 0.6;
}

.xray-node.risk-high .xray-node-ring {
  stroke: var(--neon-red);
  stroke-opacity: 0.3;
  animation: pulsePill 2s ease infinite;
}

.xray-node.risk-high .xray-node-circle {
  stroke: var(--neon-red);
  stroke-opacity: 0.7;
}

/* Data packets */
.xray-packet-ok {
  fill: var(--neon-green);
}

.xray-packet-fail {
  fill: var(--neon-red);
}

/* ── Metric Pill ── */
.metric-pill {
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
}

/* ── Explanation Panel ── */
.xray-explain-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255, 76, 76, 0.3);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 0 20px rgba(255, 76, 76, 0.1);
  animation: fadeSlideIn 0.3s ease-out;
}

/* ── Nav Pills for test categories ── */
.nav-pills .nav-link {
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-radius: 999px;
}

.nav-pills .nav-link.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--neon-blue);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

/* ── Nav Tabs for bottom section ── */
.nav-tabs {
  border-bottom-color: rgba(148, 163, 184, 0.15);
}

.nav-tabs .nav-link {
  color: var(--text-secondary);
  border: none;
  font-size: 0.82rem;
}

.nav-tabs .nav-link.active {
  background: transparent;
  color: var(--neon-blue);
  border-bottom: 2px solid var(--neon-blue);
}

/* ── Badge glow variants ── */
.badge-glow-green {
  background: rgba(0, 255, 153, 0.15);
  color: var(--neon-green);
  border: 1px solid rgba(0, 255, 153, 0.3);
}

.badge-glow-red {
  background: rgba(255, 76, 76, 0.15);
  color: var(--neon-red);
  border: 1px solid rgba(255, 76, 76, 0.3);
}

.badge-glow-blue {
  background: rgba(56, 189, 248, 0.12);
  color: var(--neon-blue);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* ── Mock Service Cards ── */
.mock-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.3s;
}

.mock-status-dot.healthy {
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
}

.mock-status-dot.slow {
  background: var(--neon-amber);
  box-shadow: 0 0 8px var(--neon-amber);
  animation: pulseDot 1.5s ease infinite;
}

.mock-status-dot.down {
  background: var(--neon-red);
  box-shadow: 0 0 8px var(--neon-red);
  animation: pulseDot 0.8s ease infinite;
}

@keyframes pulseDot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.mock-card {
  transition: border-color 0.3s, box-shadow 0.3s;
}

.mock-state-btn.active {
  pointer-events: none;
}

/* ── Loading Spinner ── */
.spinner-neon {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(0, 255, 153, 0.2);
  border-top-color: var(--neon-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ──────────────────────────────────────────
   Light-mode specific overrides
   ────────────────────────────────────────── */

[data-bs-theme="light"] .badge-glow-green {
  background: rgba(5, 150, 105, 0.1);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.3);
}

[data-bs-theme="light"] .badge-glow-red {
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
}

[data-bs-theme="light"] .badge-glow-blue {
  background: rgba(2, 132, 199, 0.08);
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.2);
}

[data-bs-theme="light"] .agent-console-card {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="light"] .agent-console-log {
  scrollbar-color: rgba(2, 132, 199, 0.25) transparent;
}

[data-bs-theme="light"] .agent-console-log-line.agent {
  color: #6d28d9;
}

[data-bs-theme="light"] .agent-console-log-line.signal {
  color: #047857;
}

[data-bs-theme="light"] .agent-console-log-line.warning {
  color: #b45309;
}

[data-bs-theme="light"] .agent-console-log-line.system {
  color: #0369a1;
}

[data-bs-theme="light"] .nav-pills .nav-link.active {
  background: rgba(2, 132, 199, 0.1);
  box-shadow: none;
}

[data-bs-theme="light"] .nav-tabs {
  border-bottom-color: rgba(71, 85, 105, 0.15);
}

[data-bs-theme="light"] .xray-explain-panel {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="light"] .spec-scan-overlay {
  mix-blend-mode: multiply;
}

/* Graph glow intensities are controlled by the CSS variables above; no extra overrides needed. */

[data-bs-theme="light"] .btn-launch {
  color: #fff;
}

[data-bs-theme="light"] .btn-launch:hover {
  color: #fff;
  box-shadow: 0 4px 20px rgba(5, 150, 105, 0.3);
}

[data-bs-theme="light"] .spinner-neon {
  border-color: rgba(5, 150, 105, 0.2);
  border-top-color: var(--neon-green);
}

/* Navbar buttons: switch outline from light to dark in light mode */
[data-bs-theme="light"] .navbar .btn-outline-light {
  color: var(--text-primary);
  border-color: var(--border-glow);
}

[data-bs-theme="light"] .navbar .btn-outline-light:hover {
  background: rgba(2, 132, 199, 0.08);
  color: var(--neon-blue);
  border-color: var(--neon-blue);
}

/* ── Floating Metrics (Time Saved + Risk Mitigated) ── */
.floating-metrics {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.2s, visibility 0.2s;
}

.floating-metrics.hidden-by-dropdown {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.float-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 255, 153, 0.3);
  border-radius: 1rem;
  padding: 0.5rem 1rem;
  box-shadow: 0 0 24px rgba(0, 255, 153, 0.12);
  backdrop-filter: blur(8px);
  text-align: center;
  min-width: 160px;
}

.float-card-risk {
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.1);
}

/* ── Chaos Dial ── */
.chaos-control,
.compliance-control {
  min-width: 180px;
}

.chaos-tick {
  font-size: 0.6rem;
  color: var(--text-secondary);
}

.chaos-level-badge {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.chaos-level-badge.chaos-low {
  background: rgba(0, 255, 153, 0.15);
  color: var(--neon-green);
}

.chaos-level-badge.chaos-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--neon-amber);
}

.chaos-level-badge.chaos-high {
  background: rgba(255, 76, 76, 0.2);
  color: var(--neon-red);
  animation: pulsePill 1s ease infinite;
}

/* ── Compliance Tags ── */
.compliance-tag {
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: var(--neon-purple);
  background: transparent;
  transition: all 0.2s;
}

.compliance-tag.active {
  background: rgba(167, 139, 250, 0.2);
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.2);
}

/* ── PII Cards ── */
.pii-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 76, 76, 0.2);
  border-radius: 0.75rem;
  padding: 0.75rem;
  box-shadow: 0 0 12px rgba(255, 76, 76, 0.05);
}

/* ── Flakiness Heatmap Bars ── */
.flakiness-bar-bg {
  height: 10px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.flakiness-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 1s ease-out;
}

/* ── Auto-Repair Cards ── */
.auto-repair-card {
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 0.75rem;
  padding: 0.75rem;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.06);
}

.auto-repair-code {
  background: var(--code-bg) !important;
  border: 1px solid var(--border-glow);
}

.auto-repair-code code.hljs {
  background: transparent !important;
  padding: 0 !important;
}

.btn-repair {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.25));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: var(--neon-amber);
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.2rem 0.8rem;
  animation: pulsePill 2s ease infinite;
}

.btn-repair:hover {
  background: rgba(245, 158, 11, 0.3);
  color: var(--neon-amber);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.auto-repair-inline {
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Badge glow red ── */
/* ── Act Progress Bar ── */
.act-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 2rem;
}

.act-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 1;
}

.act-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 2px solid var(--edge-stroke);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.5s ease;
}

.act-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 600;
  transition: color 0.5s ease;
}

.act-step.active .act-dot {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  animation: pulsePill 1.2s ease infinite;
}

.act-step.active .act-label {
  color: var(--neon-blue);
}

.act-step.completed .act-dot {
  border-color: var(--neon-green);
  color: var(--neon-green);
  background: rgba(0, 255, 153, 0.08);
  box-shadow: 0 0 10px rgba(0, 255, 153, 0.15);
}

.act-step.completed .act-label {
  color: var(--neon-green);
}

.act-connector {
  flex: 1;
  height: 2px;
  background: var(--edge-stroke);
  max-width: 80px;
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}

.act-connector-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--neon-green);
  border-radius: 1px;
  transition: width 0.8s ease;
  box-shadow: 0 0 6px var(--neon-green);
}

/* ── Coverage Meter ── */
.coverage-bar-bg {
  height: 6px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.coverage-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(0, 255, 153, 0.3);
}

/* ── Failure Flash ── */
.xray-failure-flash {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  border-radius: 0.75rem;
}

.xray-failure-flash.flash-active {
  animation: failureFlash 0.6s ease-out;
}

@keyframes failureFlash {
  0% {
    background: rgba(255, 76, 76, 0.3);
  }

  30% {
    background: rgba(255, 76, 76, 0.15);
  }

  100% {
    background: transparent;
  }
}

.xray-card.shake {
  animation: shakeCard 0.4s ease;
}

@keyframes shakeCard {

  0%,
  100% {
    transform: translateX(0);
  }

  15% {
    transform: translateX(-4px);
  }

  30% {
    transform: translateX(4px);
  }

  45% {
    transform: translateX(-3px);
  }

  60% {
    transform: translateX(3px);
  }

  75% {
    transform: translateX(-1px);
  }
}

/* ── Spec Extraction Annotations ── */
.spec-extractions {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 200px;
}

.spec-extract-chip {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.6rem;
  color: var(--neon-blue);
  font-family: ui-monospace, monospace;
  animation: chipSlideIn 0.4s ease-out;
  backdrop-filter: blur(4px);
}

.spec-extract-chip.risk {
  border-color: rgba(255, 76, 76, 0.3);
  background: rgba(255, 76, 76, 0.1);
  color: var(--neon-red);
}

.spec-extract-chip.warn {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
  color: var(--neon-amber);
}

@keyframes chipSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Typewriter Cursor ── */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--neon-purple);
  animation: cursorBlink 0.8s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}

@keyframes cursorBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ── Code Typing Thinking Indicator ── */
.typing-thinking {
  display: inline-block;
  color: var(--neon-purple);
  font-size: 0.75rem;
  animation: thinkingDots 1.4s steps(4, end) infinite;
}

@keyframes thinkingDots {
  0% {
    content: "";
  }

  25% {
    content: ".";
  }

  50% {
    content: "..";
  }

  75% {
    content: "...";
  }
}

.code-thinking-indicator {
  padding: 0.25rem 0.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--neon-purple);
  animation: fadeSlideIn 0.3s ease-out;
}

.code-thinking-indicator::after {
  content: "...";
  animation: dotAnimation 1.4s steps(3, end) infinite;
}

@keyframes dotAnimation {
  0% {
    content: "";
  }

  33% {
    content: ".";
  }

  66% {
    content: "..";
  }

  100% {
    content: "...";
  }
}

/* ── Floating Section Navigator ── */
.section-nav {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-nav-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  color: var(--text-secondary);
  font-size: 0.7rem;
  text-decoration: none;
  transition: all 0.3s;
  backdrop-filter: blur(4px);
}

.section-nav-dot:hover,
.section-nav-dot.active {
  color: var(--neon-blue);
  border-color: var(--neon-blue);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  transform: scale(1.15);
}

@media (max-width: 768px) {
  .section-nav {
    display: none;
  }
}

/* ── Executive Summary ── */
.exec-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--neon-green);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 0 30px rgba(0, 255, 153, 0.08);
  backdrop-filter: blur(8px);
  animation: fadeSlideIn 0.5s ease-out;
}

.exec-metric {
  text-align: center;
  padding: 0.75rem 0.5rem;
  border-radius: 0.75rem;
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.12);
}

.exec-metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--neon-blue);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.exec-metric-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-top: 2px;
}

.exec-metric-pass .exec-metric-value {
  color: var(--neon-green);
}

.exec-metric-pass {
  border-color: rgba(0, 255, 153, 0.15);
  background: rgba(0, 255, 153, 0.05);
}

.exec-metric-fail .exec-metric-value {
  color: var(--neon-red);
}

.exec-metric-fail {
  border-color: rgba(255, 76, 76, 0.15);
  background: rgba(255, 76, 76, 0.05);
}

.exec-metric-risk .exec-metric-value {
  color: var(--neon-amber);
}

.exec-metric-risk {
  border-color: rgba(245, 158, 11, 0.15);
  background: rgba(245, 158, 11, 0.05);
}

.exec-metric-time .exec-metric-value {
  color: var(--neon-purple);
}

.exec-metric-time {
  border-color: rgba(167, 139, 250, 0.15);
  background: rgba(167, 139, 250, 0.05);
}

/* ── Export Button ── */
.btn-export {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--neon-blue);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.2rem 0.8rem;
}

.btn-export:hover {
  background: rgba(56, 189, 248, 0.2);
  color: var(--neon-blue);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

/* ── Collapsible Toggle ── */
.btn-collapse-toggle {
  background: transparent;
  border: 1px solid var(--border-glow);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.15rem 0.6rem;
}

.btn-collapse-toggle:hover {
  color: var(--neon-blue);
  border-color: var(--neon-blue);
}

#spec-code-body {
  transition: max-height 0.5s ease, opacity 0.3s ease;
  overflow: hidden;
}

#spec-code-body.collapsed {
  max-height: 0 !important;
  opacity: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

/* ── AI Strategy Card ── */
.strategy-card {
  border-color: rgba(167, 139, 250, 0.3);
}

.strategy-item {
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
}

.strategy-item-icon {
  font-size: 1rem;
}

.strategy-item-count {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--neon-purple);
}

.strategy-item-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.strategy-item-reason {
  font-size: 0.6rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ── Reduced code pane height ── */
.code-pane {
  min-height: 180px;
  max-height: 280px;
  background: var(--code-bg) !important;
}

/* ── Legacy Archaeology Card ── */
.archaeology-card {
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.06);
}

#arch-arrow {
  animation: arrowPulse 1.2s ease infinite;
}

@keyframes arrowPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* ── COBOL Scenario Button ── */
.scenario-btn-legacy {
  border-color: rgba(245, 158, 11, 0.4) !important;
  color: var(--neon-amber) !important;
}

.scenario-btn-legacy:hover,
.scenario-btn-legacy.active {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: var(--neon-amber) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.2) !important;
}

/* ── Expert Insight cards (below code panes) ── */
.expert-insight-card {
  border-left: 3px solid var(--neon-amber);
  background: var(--code-bg);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}

.expert-insight-icon {
  color: var(--neon-amber);
  font-size: 0.9rem;
}

.expert-tag-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--neon-amber);
  font-size: 0.65rem;
  font-weight: 600;
}

.expert-insight-text {
  color: var(--text-primary);
  font-size: 0.75rem;
}

.confidence-badge {
  font-size: 0.65rem;
  font-weight: 600;
}

.confidence-high {
  background: rgba(0, 255, 153, 0.2);
  color: var(--neon-green);
}

.confidence-medium {
  background: rgba(245, 158, 11, 0.2);
  color: var(--neon-amber);
}

.confidence-low {
  background: rgba(255, 76, 76, 0.2);
  color: var(--neon-red);
}

/* ── CI animated steps ── */
.ci-step-row {
  cursor: pointer;
  transition: background 0.2s ease;
}

.ci-step-row:hover {
  background: rgba(148, 163, 184, 0.08);
}

.ci-step-queued {
  color: var(--text-secondary);
}

.ci-step-running {
  color: var(--neon-amber);
  animation: ciSpin 0.8s linear infinite;
}

.ci-step-success-row {
  background: rgba(0, 255, 153, 0.04);
}

@keyframes ciSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.ci-step-log {
  font-size: 0.7rem;
  max-height: 180px;
  overflow: auto;
}

/* ── PR status check mock ── */
.ci-pr-mock {
  background: var(--bg-card);
  border-color: rgba(148, 163, 184, 0.2);
}

.ci-pr-check {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ci-pr-pending {
  color: var(--neon-amber);
}

/* ── Beginner vs Expert comparison ── */
.expert-comparison-column {
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.expert-comparison-beginner {
  opacity: 0.85;
}

.expert-comparison-ai {
  border-color: rgba(0, 255, 153, 0.2);
  box-shadow: 0 0 12px rgba(0, 255, 153, 0.06);
}

/* ── Badge glow purple ── */
.badge-glow-purple {
  background: rgba(167, 139, 250, 0.15);
  color: var(--neon-purple);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

/* ── Mutation Score Ring ── */
.mutation-score-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--score-color, var(--neon-green));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 16px color-mix(in srgb, var(--score-color, var(--neon-green)) 25%, transparent);
}

.mutation-score-inner {
  text-align: center;
}

.mutation-score-pct {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.1;
}

.mutation-score-label {
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.mutation-list {
  max-height: 200px;
  overflow-y: auto;
}

/* ── Blast Radius ── */
.blast-radius-row {
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.1);
  transition: border-color 0.2s;
}

.blast-radius-row:hover {
  border-color: rgba(255, 76, 76, 0.3);
}

.blast-affected-badge {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
  font-size: 0.6rem;
  font-weight: 500;
}

/* ── Data Lineage ── */
.lineage-field {
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  padding-bottom: 0.75rem;
}

.lineage-field:last-child {
  border-bottom: none;
}

.lineage-field-name {
  background: rgba(56, 189, 248, 0.1);
  color: var(--neon-blue);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.lineage-stages {
  overflow-x: auto;
}

.lineage-stage {
  min-width: 110px;
  max-width: 160px;
  flex-shrink: 0;
}

.lineage-stage-system {
  border-left: 3px solid;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.lineage-stage-format {
  font-size: 0.6rem;
  color: var(--text-secondary);
  padding-left: 9px;
}

.lineage-arrow {
  font-size: 0.7rem;
  align-self: center;
  flex-shrink: 0;
}

/* ── Test Impact Ranking ── */
.impact-bar-bg {
  height: 6px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.impact-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease-out;
}

/* ── Latency Simulation ── */
.latency-gauge {
  flex: 1;
  min-width: 120px;
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  padding: 0.75rem;
}

.latency-gauge-bar {
  height: 8px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.25rem 0;
}

.latency-gauge-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease-out;
}

/* ── Dead Letter Queue ── */
.dlq-message {
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.1);
  transition: border-color 0.2s;
}

.dlq-message:hover {
  border-color: rgba(255, 76, 76, 0.2);
}

.dlq-retry-dots {
  display: flex;
  gap: 4px;
}

.dlq-retry-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.15);
}

.dlq-retry-dot.used {
  background: var(--neon-amber);
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.3);
}

/* ══════════════════════════════════════════
   CINEMATIC PREMIUM ENHANCEMENTS
   ══════════════════════════════════════════ */

/* ── Enhanced XRay Card Glassmorphism ── */
.xray-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 1rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  transition: border-color 0.4s, box-shadow 0.4s, transform 0.3s;
}

.xray-card:hover {
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.2), 0 0 30px rgba(56, 189, 248, 0.06);
}

/* ── Fullscreen X-Ray Mode ── */
.btn-fullscreen {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--neon-blue);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: all 0.3s;
}

.btn-fullscreen:hover {
  background: rgba(56, 189, 248, 0.2);
  color: var(--neon-blue);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
  transform: scale(1.15);
}

.xray-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2000 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  max-height: 100vh !important;
  overflow: auto !important;
}

.xray-fullscreen .xray-graph-shell {
  height: 70vh !important;
}

.xray-fullscreen-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1999;
  backdrop-filter: blur(8px);
}

/* ── Phase Transition Vignette ── */
.phase-vignette {
  position: fixed;
  inset: 0;
  z-index: 1500;
  pointer-events: none;
  animation: vignetteFlash 0.6s ease-out forwards;
}

@keyframes vignetteFlash {
  0% {
    background: radial-gradient(ellipse at center, transparent 30%, rgba(56, 189, 248, 0.15) 100%);
    opacity: 1;
  }

  100% {
    background: radial-gradient(ellipse at center, transparent 30%, rgba(56, 189, 248, 0) 100%);
    opacity: 0;
  }
}

.phase-vignette.fail {
  animation-name: vignetteFlashRed;
}

@keyframes vignetteFlashRed {
  0% {
    background: radial-gradient(ellipse at center, transparent 20%, rgba(255, 76, 76, 0.2) 100%);
    opacity: 1;
  }

  100% {
    background: radial-gradient(ellipse at center, transparent 20%, rgba(255, 76, 76, 0) 100%);
    opacity: 0;
  }
}

/* ── Staggered Panel Reveal ── */
.panel-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.panel-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Enhanced Floating Metrics ── */
.float-card {
  animation: floatBreathing 3s ease-in-out infinite;
}

@keyframes floatBreathing {

  0%,
  100% {
    box-shadow: 0 0 30px rgba(0, 255, 153, 0.15);
  }

  50% {
    box-shadow: 0 0 40px rgba(0, 255, 153, 0.25);
  }
}

.float-card-risk {
  animation-name: floatBreathingAmber;
}

@keyframes floatBreathingAmber {

  0%,
  100% {
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.1);
  }

  50% {
    box-shadow: 0 0 36px rgba(245, 158, 11, 0.2);
  }
}

/* ── Spark particles ── */
.spark-container {
  position: absolute;
  pointer-events: none;
  inset: 0;
  overflow: hidden;
}

.spark {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--neon-green);
  animation: sparkFly 0.8s ease-out forwards;
}

@keyframes sparkFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--spark-x, 20px), var(--spark-y, -30px)) scale(0);
  }
}

/* ── Screen shake on failure ── */
@keyframes screenShake {

  0%,
  100% {
    transform: translateX(0);
  }

  10% {
    transform: translateX(-3px) translateY(1px);
  }

  20% {
    transform: translateX(3px) translateY(-1px);
  }

  30% {
    transform: translateX(-2px);
  }

  40% {
    transform: translateX(2px);
  }

  50% {
    transform: translateX(0);
  }
}

.screen-shake {
  animation: screenShake 0.5s ease;
}

/* ── Enhanced edge glow ── */
.xray-edge.pulse-green {
  stroke: var(--neon-green);
  stroke-opacity: 0.6;
  filter: drop-shadow(0 0 6px var(--neon-green));
  transition: all 0.4s;
}

.xray-edge.pulse-red {
  stroke: var(--neon-red);
  stroke-opacity: 0.8;
  filter: drop-shadow(0 0 8px var(--neon-red));
  animation: edgePulseRed 0.5s ease;
}

@keyframes edgePulseRed {
  0% {
    stroke-width: 2;
  }

  50% {
    stroke-width: 4;
  }

  100% {
    stroke-width: 2;
  }
}

/* ── CI GitHub Actions Enhancement ── */
.ci-github-header {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 0.5rem 0.5rem 0 0;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ci-github-title {
  color: #f0f6fc;
  font-size: 0.85rem;
  font-weight: 600;
}

.ci-github-badge {
  background: #238636;
  color: #fff;
  font-size: 0.6rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.ci-github-badge.failed {
  background: #da3633;
}

.ci-github-body {
  background: #0d1117;
  border: 1px solid #30363d;
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
}

.ci-github-step {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #21262d;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #c9d1d9;
  cursor: pointer;
  transition: background 0.2s;
}

.ci-github-step:hover {
  background: #161b22;
}

.ci-github-step:last-child {
  border-bottom: none;
}

.ci-github-step .step-duration {
  margin-left: auto;
  color: #8b949e;
  font-size: 0.7rem;
}

.ci-github-check {
  color: #3fb950;
  font-size: 0.9rem;
}

.ci-github-check.running {
  color: #d29922;
  animation: ciSpin 0.8s linear infinite;
}

.ci-github-check.failed {
  color: #f85149;
}

/* ═══════════════════════════════════════════
   Step Narration Overlay
   ═══════════════════════════════════════════ */
.step-narration-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.step-narration-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.step-narration-content {
  text-align: center;
  max-width: 520px;
  animation: narrationEnter 0.5s ease-out;
}

@keyframes narrationEnter {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.step-narration-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  color: var(--neon-blue);
  filter: drop-shadow(0 0 20px var(--neon-blue));
  animation: narrationIconPulse 2s ease infinite;
}

@keyframes narrationIconPulse {

  0%,
  100% {
    filter: drop-shadow(0 0 20px var(--neon-blue));
  }

  50% {
    filter: drop-shadow(0 0 40px var(--neon-green));
  }
}

.step-narration-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.step-narration-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.step-narration-progress {
  width: 200px;
  height: 3px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  margin: 0 auto;
  overflow: hidden;
}

.step-narration-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
  border-radius: 999px;
  animation: narrationProgress 2.6s ease-in-out forwards;
}

@keyframes narrationProgress {
  from {
    width: 0%;
  }

  to {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════
   Validator Pipeline Steps
   ═══════════════════════════════════════════ */
.validator-pipeline {
  background: rgba(2, 6, 23, 0.4);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 0.5rem;
}

.validator-pipeline-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--neon-blue);
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.validator-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.validator-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.08);
  transition: all 0.4s ease;
  opacity: 1;
  transform: translateX(0);
}

.validator-step.entering {
  opacity: 0;
  transform: translateX(-20px);
}

.validator-step-number {
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.validator-step-body {
  flex: 1;
}

.validator-step-spinner {
  display: inline-flex;
  align-items: center;
}

.validator-step-spinner:empty::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--neon-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ═══════════════════════════════════════════
   Apply Fix Deep Simulation
   ═══════════════════════════════════════════ */
.fix-simulation-steps {
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  padding-top: 0.75rem;
}

.fix-step {
  background: rgba(2, 6, 23, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 0.6rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  animation: fixStepIn 0.4s ease-out;
}

@keyframes fixStepIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fix-step-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}

.fix-step-body {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.fix-step-impact {
  font-size: 0.75rem;
  color: var(--neon-amber);
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 0.4rem;
  border-left: 3px solid var(--neon-amber);
}

.fix-step-success {
  border-color: rgba(0, 255, 153, 0.3);
  background: rgba(0, 255, 153, 0.05);
}

.fix-diff-panels {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.fix-diff-panel {
  flex: 1;
  border-radius: 0.4rem;
  overflow: hidden;
}

.fix-diff-before {
  background: rgba(255, 76, 76, 0.06);
  border: 1px solid rgba(255, 76, 76, 0.2);
}

.fix-diff-after {
  background: rgba(0, 255, 153, 0.06);
  border: 1px solid rgba(0, 255, 153, 0.2);
}

.fix-diff-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.5rem;
  text-align: center;
}

.fix-diff-before .fix-diff-label {
  background: rgba(255, 76, 76, 0.12);
  color: var(--neon-red);
}

.fix-diff-after .fix-diff-label {
  background: rgba(0, 255, 153, 0.12);
  color: var(--neon-green);
}

.fix-diff-code {
  margin: 0;
  padding: 0.5rem !important;
  background: transparent !important;
  font-size: 0.72rem;
  line-height: 1.4;
}

.fix-diff-arrow {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.fix-rerun-progress {
  height: 4px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.fix-rerun-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
  border-radius: 999px;
  animation: fixRerunProgress 2.5s ease-in-out forwards;
}

@keyframes fixRerunProgress {
  from {
    width: 0%;
  }

  to {
    width: 100%;
  }
}

.fix-rerun-log {
  color: var(--text-secondary);
  line-height: 1.6;
}

.fix-rerun-log div {
  animation: fadeSlideIn 0.3s ease-out;
}

.fix-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.fix-metric {
  font-size: 0.72rem;
  color: var(--neon-green);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-repair-applied {
  background: rgba(0, 255, 153, 0.15) !important;
  color: var(--neon-green) !important;
  border-color: rgba(0, 255, 153, 0.3) !important;
  pointer-events: none;
}

.fix-reason-text {
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 0.4rem 0.6rem;
  background: rgba(56, 189, 248, 0.06);
  border-radius: 0.4rem;
  border-left: 3px solid var(--neon-blue);
  line-height: 1.4;
}

@media (max-width: 576px) {
  .fix-diff-panels {
    flex-direction: column;
  }

  .fix-diff-arrow {
    justify-content: center;
    transform: rotate(90deg);
  }
}

/* ═══════════════════════════════════════════
   AI Thinking Bubble
   ═══════════════════════════════════════════ */
.agent-thinking-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  animation: fadeSlideIn 0.3s ease-out;
}

.thinking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-purple);
  animation: thinkingBounce 1.2s ease-in-out infinite;
}

.thinking-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes thinkingBounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.thinking-label {
  font-size: 0.7rem;
  color: var(--neon-purple);
  margin-left: 6px;
  letter-spacing: 0.03em;
  opacity: 0.7;
  animation: thinkingPulse 1.5s ease infinite;
}

@keyframes thinkingPulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════
   Act Sub-Step Display
   ═══════════════════════════════════════════ */
.act-substep-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  min-height: 28px;
}

.act-substep-display.visible {
  opacity: 1;
  transform: translateY(0);
}

.act-substep-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-blue);
  animation: substepPulse 1.2s ease infinite;
  flex-shrink: 0;
}

@keyframes substepPulse {

  0%,
  100% {
    opacity: 0.5;
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4);
  }

  50% {
    opacity: 1;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0);
  }
}

.act-substep-text {
  font-size: 0.78rem;
  color: var(--neon-blue);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════
   Rich Node Detail Panel
   ═══════════════════════════════════════════ */
.xray-node-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 0.75rem;
  padding: 1rem;
  animation: fadeSlideIn 0.3s ease-out;
}

.node-detail-metric {
  text-align: center;
  padding: 0.5rem;
  background: rgba(2, 6, 23, 0.3);
  border-radius: 0.5rem;
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.node-detail-metric-value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.node-detail-metric-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════
   "Why This Test?" Button & Reasoning Drawer
   ═══════════════════════════════════════════ */
.btn-why-test {
  background: rgba(245, 158, 11, 0.1);
  color: var(--neon-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-why-test:hover {
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
  transform: translateY(-1px);
  color: var(--neon-amber);
}

.test-reasoning-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 90vw;
  height: 100vh;
  z-index: 10000;
  background: var(--bg-deep);
  border-left: 1px solid var(--border-glow);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.test-reasoning-drawer.open {
  transform: translateX(0);
}

.test-reasoning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.btn-close-drawer {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 0.4rem;
  transition: all 0.2s;
}

.btn-close-drawer:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
}

.test-reasoning-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.2) transparent;
}

.reasoning-section {
  margin-bottom: 1.25rem;
  animation: fadeSlideIn 0.4s ease-out;
}

.reasoning-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--neon-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.reasoning-validators {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.reasoning-validator-chip {
  background: rgba(56, 189, 248, 0.1);
  color: var(--neon-blue);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.reasoning-arrow {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.reasoning-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.reasoning-alternatives {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reasoning-alt {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  background: rgba(255, 76, 76, 0.04);
  border-radius: 0.4rem;
  border-left: 3px solid rgba(255, 76, 76, 0.2);
}

.reasoning-alt i {
  flex-shrink: 0;
  margin-top: 2px;
}

.reasoning-alt-chosen {
  background: rgba(0, 255, 153, 0.06);
  border-left-color: var(--neon-green);
  color: var(--text-primary);
}

.reasoning-risk {
  background: rgba(245, 158, 11, 0.06);
  padding: 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.reasoning-risk .reasoning-section-title {
  color: var(--neon-amber);
}