/* ==========================================================================
   ⚡ FLOWORK OS — SWARM PIPELINE & DAG WORKFLOW ENGINE STYLES
   Module: swarm_pipeline.css (100% Nano-Modular, Zero-Bleed)
   Co-authored-by: Flowork OS <agent@floworkos.com>
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GROUP STUDIO SUB-NAV FLOATING CAPSULE BAR
   -------------------------------------------------------------------------- */
.group-subnav-bar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  pointer-events: auto;
}

.group-subnav-capsule {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(8, 12, 22, 0.88);
  border: 1px solid rgba(0, 242, 254, 0.28);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 4px 6px;
  border-radius: 9999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 242, 254, 0.18);
}

.group-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.group-subnav-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.group-subnav-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.3), rgba(99, 102, 241, 0.4));
  border-color: rgba(0, 242, 254, 0.7);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.4);
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.7);
}

.group-subnav-btn .subtab-icon {
  font-size: 13px;
  line-height: 1;
}

.group-subnav-btn .subtab-badge {
  background: rgba(0, 242, 254, 0.2);
  color: #00f2fe;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(0, 242, 254, 0.4);
  letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   2. SUBVIEW PANES IN GROUP STUDIO
   -------------------------------------------------------------------------- */
.group-subview-pane {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

.group-subview-pane.active {
  display: block !important;
}

/* --------------------------------------------------------------------------
   3. SWARM PIPELINE WORKFLOW CONTAINER (3-ZONE COCKPIT)
   -------------------------------------------------------------------------- */
.swarm-pipeline-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  background: #060911;
  color: #f1f5f9;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ZONE 1: PALETTE SIDEBAR */
.pipeline-palette-sidebar {
  width: 260px;
  min-width: 240px;
  background: rgba(10, 15, 29, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 40;
  padding-top: 60px; /* offset below floating subnav */
  backdrop-filter: blur(12px);
}

.palette-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.palette-header h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #00f2fe;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.palette-search-box {
  padding: 8px 14px;
}

.palette-search-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.palette-search-input:focus {
  border-color: #00f2fe;
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
}

.palette-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.palette-category-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.palette-category-title:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}
.palette-chevron {
  display: inline-block;
  font-size: 8px;
  margin-right: 4px;
  transition: transform 0.2s ease;
  color: #64748b;
}
.palette-category-title:hover .palette-chevron {
  color: #38bdf8;
}

.palette-items-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}
.palette-items-grid.collapsed {
  display: none;
}

.palette-card-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: grab;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.palette-card-item:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(0, 242, 254, 0.4);
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.palette-card-item:active {
  cursor: grabbing;
}

.palette-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.palette-card-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.palette-card-name {
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette-card-desc {
  font-size: 9.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ZONE 2: INFINITE DAG CANVAS BOARD */
.pipeline-canvas-board {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #070a14;
  background-image: 
    radial-gradient(circle, rgba(0, 242, 254, 0.12) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px, 14px 14px;
  cursor: default;
}

/* Top Toolbar Bar inside Canvas - PERMANENTLY REMOVED PER USER INSTRUCTION */
.pipeline-top-toolbar {
  display: none !important;
}

.pipeline-tool-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.pipeline-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.pipeline-tool-btn.primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.pipeline-tool-btn.primary:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.pipeline-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* SVG Connection Cables Layer */
.pipeline-svg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.pipeline-cable {
  fill: none;
  stroke: #10b981;
  stroke-width: 2.5px;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.5));
}

.pipeline-cable.trigger-cable {
  stroke: #00f2fe;
  filter: drop-shadow(0 0 6px rgba(0, 242, 254, 0.6));
}

.pipeline-cable.revision-cable {
  stroke: #f43f5e;
  stroke-dasharray: 6 4;
  filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.6));
  animation: cableRevisionDash 1.2s linear infinite;
}

@keyframes cableRevisionDash {
  to { stroke-dashoffset: -20; }
}

.pipeline-photon-stream {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3.5px;
  stroke-linecap: round;
  stroke-dasharray: 8 40;
  animation: photonFlow 1s linear infinite;
}

@keyframes photonFlow {
  to { stroke-dashoffset: -48; }
}

/* NODES CONTAINER (TRANSFORMS VIA PAN / ZOOM) */
.pipeline-nodes-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  z-index: 20;
}

/* DAG NODE CARDS */
.dag-node {
  position: absolute;
  width: 220px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  user-select: none;
  cursor: move;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dag-node:hover {
  border-color: rgba(0, 242, 254, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 16px rgba(0, 242, 254, 0.2);
}

.dag-node.selected {
  border-color: #00f2fe;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.dag-node.node-locked {
  border-color: rgba(234, 179, 8, 0.6);
}

.dag-node.node-locked:hover {
  box-shadow: 0 0 18px rgba(234, 179, 8, 0.35);
}

/* Node Header */
.dag-node-header {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 9px 9px 0 0;
}

.dag-node-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.dag-node-type-badge {
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-leader { background: rgba(234, 179, 8, 0.2); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.4); }
.badge-specialist { background: rgba(0, 242, 254, 0.2); color: #00f2fe; border: 1px solid rgba(0, 242, 254, 0.4); }
.badge-trigger { background: rgba(147, 51, 234, 0.2); color: #a855f7; border: 1px solid rgba(147, 51, 234, 0.4); }
.badge-gate { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-task { background: rgba(99, 102, 241, 0.25); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.5); }
.badge-rule { background: rgba(244, 63, 94, 0.25); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.5); }

.dag-node-delete-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dag-node-delete-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: rgba(244, 63, 94, 0.5);
  color: #f43f5e;
}

.dag-node.node-task {
  border-color: rgba(99, 102, 241, 0.35);
}
.dag-node.node-task:hover {
  border-color: #818cf8;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

.dag-node.node-rule {
  border-color: rgba(244, 63, 94, 0.35);
}
.dag-node.node-rule:hover {
  border-color: #fb7185;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.35);
}


/* Node Body */
.dag-node-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dag-node-model-chip {
  font-size: 9.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.dag-node-model-chip .chip-provider {
  color: #38bdf8;
  font-weight: 700;
}

/* Ports */
.dag-port {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0f172a;
  border: 2.5px solid #10b981;
  cursor: crosshair;
  z-index: 30;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  color: #ffffff;
  user-select: none;
}

.dag-port:hover {
  transform: scale(1.35);
}

.dag-port-input {
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  border-color: #00f2fe;
}
.dag-port-input:hover {
  transform: translateY(-50%) scale(1.35);
  box-shadow: 0 0 10px #00f2fe;
  background: #00f2fe;
}

/* Mandatory 2 Outputs per Node */
.dag-port-out-1 {
  right: -7px;
  top: 22px;
  transform: translateY(-50%);
  border-color: #10b981;
}
.dag-port-out-1:hover {
  transform: translateY(-50%) scale(1.35);
  box-shadow: 0 0 10px #10b981;
  background: #10b981;
}

.dag-port-out-2 {
  right: -7px;
  top: 52px;
  transform: translateY(-50%);
  border-color: #f43f5e;
}
.dag-port-out-2:hover {
  transform: translateY(-50%) scale(1.35);
  box-shadow: 0 0 10px #f43f5e;
  background: #f43f5e;
}

/* Quick Delete Button on Cable Midpoint Badge */
.gate-delete-quick-btn {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 6px;
  padding: 0;
  line-height: 1;
  transition: all 0.15s ease-in-out;
}
.gate-delete-quick-btn:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.25);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}


/* ZONE 3: INSPECTOR PANEL */
.pipeline-inspector-panel {
  display: none !important;
}

.pipeline-inspector-panel.collapsed {
  transform: translateX(100%);
  position: absolute;
  right: 0;
  height: 100%;
}

.inspector-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspector-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspector-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inspector-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inspector-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inspector-select,
.inspector-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}

.inspector-select:focus,
.inspector-input:focus {
  border-color: #00f2fe;
}

/* --------------------------------------------------------------------------
   4. RULE GATE BADGES & CABLE HIGHLIGHTS
   -------------------------------------------------------------------------- */
.pipeline-gate-badge {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 15, 29, 0.94);
  border: 1px solid rgba(0, 242, 254, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 242, 254, 0.2);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  color: #00f2fe;
  cursor: pointer;
  z-index: 25;
  user-select: none;
  backdrop-filter: blur(8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pipeline-gate-badge:hover {
  transform: translate(-50%, -50%) scale(1.08);
  border-color: #00f2fe;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), 0 0 16px rgba(0, 242, 254, 0.5);
  color: #ffffff;
}

.pipeline-gate-badge.selected {
  border-color: #38bdf8;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.3), rgba(99, 102, 241, 0.4));
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.6);
  color: #ffffff;
}

.pipeline-gate-badge .gate-icon {
  font-size: 11px;
}

.pipeline-gate-badge .gate-count {
  background: rgba(0, 242, 254, 0.2);
  color: #00f2fe;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  border: 1px solid rgba(0, 242, 254, 0.4);
}

/* --------------------------------------------------------------------------
   GUARDIAN CABLE & TOGGLE BUTTON STYLES
   -------------------------------------------------------------------------- */
.gate-guardian-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(0, 242, 254, 0.14);
  border: 1px solid rgba(0, 242, 254, 0.45);
  color: #00f2fe;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 8.5px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.3px;
}

.gate-guardian-toggle-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
}

.gate-guardian-toggle-btn.bypassed {
  background: rgba(100, 116, 139, 0.18);
  border-color: rgba(100, 116, 139, 0.4);
  color: #94a3b8;
}

.pipeline-gate-badge.guardian-active {
  border-color: rgba(0, 242, 254, 0.6);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 242, 254, 0.35);
}

.pipeline-gate-badge.guardian-bypassed {
  border-color: rgba(100, 116, 139, 0.4);
  background: rgba(15, 23, 42, 0.92);
  color: #94a3b8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.pipeline-cable.cable-guardian-bypassed {
  stroke: #475569 !important;
  stroke-dasharray: 4 4;
  opacity: 0.7;
}

.pipeline-photon-stream.photon-bypassed {
  opacity: 0.25;
}

.pipeline-gate-badge.gate-evaluating {
  border-color: #f59e0b !important;
  color: #f59e0b !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6) !important;
  animation: pulseEvaluating 0.6s infinite alternate;
}

@keyframes pulseEvaluating {
  from { transform: translate(-50%, -50%) scale(1.0); }
  to { transform: translate(-50%, -50%) scale(1.12); }
}

.pipeline-gate-badge.gate-passed {
  border-color: #10b981 !important;
  color: #10b981 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.6) !important;
}

.pipeline-gate-badge.gate-failed {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6) !important;
}

.pipeline-cable-group {
  cursor: pointer;
  pointer-events: stroke;
}

.pipeline-cable-group:hover .pipeline-cable {
  stroke-width: 4px;
  filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.8));
}

.pipeline-cable.cable-selected {
  stroke: #00f2fe !important;
  stroke-width: 3.5px !important;
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.8)) !important;
}

/* Route 2 (Output 2) Styling */
.pipeline-cable.cable-route-2 {
  stroke: #f43f5e;
  stroke-dasharray: 6 3;
}
.pipeline-photon-stream.photon-route-2 {
  stroke: #fda4af;
}
.pipeline-gate-badge.badge-route-2 {
  border-color: rgba(244, 63, 94, 0.5);
  color: #fb7185;
}
.pipeline-gate-badge.badge-route-2:hover {
  border-color: #f43f5e;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.6);
  color: #ffffff;
}


/* --------------------------------------------------------------------------
   5. RULE GATE & TOOL GOVERNANCE INSPECTOR COMPONENTS
   -------------------------------------------------------------------------- */
.gate-rules-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gate-category-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px;
}

.gate-category-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: #38bdf8;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.gate-rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.2);
  margin-bottom: 4px;
  transition: background 0.15s;
}

.gate-rule-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.gate-rule-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #e2e8f0;
  cursor: pointer;
}

.gate-rule-checkbox {
  accent-color: #00f2fe;
  cursor: pointer;
}

.gate-rule-badge {
  font-size: 8.5px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 242, 254, 0.15);
  color: #00f2fe;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

/* Bifurcation & Circuit Breaker */
.bifurcation-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bifurcation-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.bifurcation-card:hover {
  border-color: rgba(0, 242, 254, 0.4);
}

.bifurcation-card.active {
  border-color: #00f2fe;
  background: rgba(0, 242, 254, 0.1);
}

.bifurcation-radio {
  margin-top: 2px;
  accent-color: #00f2fe;
}

.bifurcation-info-title {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
}

.bifurcation-info-desc {
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Tool Sandboxing Permission Matrix */
.tool-matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.tool-matrix-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  transition: all 0.15s;
  user-select: none;
}

.tool-matrix-chip:hover {
  background: rgba(30, 41, 59, 0.8);
}

.tool-matrix-chip.granted {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.tool-matrix-chip.revoked {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
}

/* Live Node Execution States */
.dag-node.node-running {
  border-color: #00f2fe !important;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.7), 0 0 10px #00f2fe !important;
  animation: pulseRunningNode 0.8s infinite alternate;
}

@keyframes pulseRunningNode {
  from { transform: scale(1.0); }
  to { transform: scale(1.02); }
}

.dag-node.node-success {
  border-color: #10b981 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6) !important;
}

/* Blackboard Feed Subview */
.group-blackboard-feed {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #080c16;
  padding: 70px 24px 24px 24px;
}

.blackboard-feed-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.blackboard-feed-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0;
}

.blackboard-meta {
  font-size: 11px;
  color: #64748b;
}

.blackboard-feed-content {
  flex: 1;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 16px;
}

.feed-empty-state {
  color: #64748b;
  font-size: 13px;
  font-style: italic;
  text-align: center;
  padding: 40px 0;
}

/* --------------------------------------------------------------------------
   6. ENTERPRISE RULE ACCORDION & 153 REAL TOOLS DRAWER
   -------------------------------------------------------------------------- */
.gate-cat-accordion {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.gate-cat-accordion:hover {
  border-color: rgba(0, 242, 254, 0.3);
}

.gate-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.4);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.gate-cat-header:hover {
  background: rgba(0, 242, 254, 0.08);
}

.gate-cat-title-text {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gate-cat-badge-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(0, 242, 254, 0.15);
  color: #00f2fe;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.gate-cat-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.gate-cat-body.collapsed {
  display: none;
}

/* Real Tools Directory Drawer */
.tools-drawer-section {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 8px;
}

.tools-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.8);
  cursor: pointer;
  user-select: none;
}

.tools-drawer-header:hover {
  background: rgba(0, 242, 254, 0.08);
}

.tools-drawer-body {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tools-drawer-body.collapsed {
  display: none;
}

.tools-search-box {
  position: relative;
}

.tools-search-input {
  width: 100%;
  background: rgba(10, 15, 29, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 5px;
  outline: none;
}

.tools-search-input:focus {
  border-color: #00f2fe;
}

.real-tools-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}

.real-tool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 10px;
  transition: all 0.15s;
}

.real-tool-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.real-tool-item.active {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.real-tool-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: monospace;
  color: #e2e8f0;
}

.real-tool-tag {
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}



/* Save Indicator Flash */
@keyframes saveFlash {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
  50% { transform: scale(1.06); box-shadow: 0 0 12px rgba(16, 185, 129, 0.7); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
}

.save-indicator-flash {
  animation: saveFlash 0.6s ease-in-out;
}

/* ==========================================================================
   ⚡ FULL POPUP PROMPT EDITOR MODAL (TASK & RULE NODES)
   ========================================================================== */
.pipeline-prompt-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pipeline-prompt-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.pipeline-prompt-modal-box {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  background: #080c18 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: none !important;
}

.pipeline-prompt-modal-overlay.active .pipeline-prompt-modal-box {
  transform: none !important;
}

/* Cockpit Header */
.pipeline-modal-header {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 17, 34, 0.95);
  flex-shrink: 0;
}

.pipeline-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pipeline-modal-icon {
  font-size: 24px;
}

.pipeline-modal-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.2px;
}

.pipeline-modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.pipeline-modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

/* 7 Tabs Bar */
.pipeline-cockpit-tabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 20px;
  background: rgba(10, 15, 30, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  flex-shrink: 0;
}

.pipeline-cockpit-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
}

.pipeline-cockpit-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.pipeline-cockpit-tab-btn.active {
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.18);
}

.pipeline-cockpit-tab-btn .tab-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.pipeline-cockpit-tab-btn.active .tab-badge {
  background: rgba(0, 242, 254, 0.25);
  color: #00f2fe;
}

/* Body / Panes */
.pipeline-cockpit-panes-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
}

.pipeline-cockpit-pane {
  display: none;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.pipeline-cockpit-pane.active {
  display: flex;
}

/* Tables & Cards */
.pipeline-table-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.pipeline-table-header-row {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(18, 26, 48, 0.85);
}

.pipeline-table-header-row h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-mini-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s;
}

.pipeline-mini-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.pipeline-mini-btn.primary {
  background: rgba(0, 242, 254, 0.18);
  border-color: rgba(0, 242, 254, 0.45);
  color: #00f2fe;
}

.pipeline-mini-btn.danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.pipeline-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.pipeline-data-table th {
  padding: 10px 16px;
  background: rgba(10, 15, 30, 0.9);
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pipeline-data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  vertical-align: middle;
}

.pipeline-data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Switch & Controls */
.pipeline-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.pipeline-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pipeline-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .25s;
  border-radius: 20px;
}

.pipeline-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
}

.pipeline-switch input:checked + .pipeline-slider {
  background-color: #10b981;
}

.pipeline-switch input:checked + .pipeline-slider:before {
  transform: translateX(16px);
}

.pipeline-data-table tr.selected td {
  background: rgba(0, 242, 254, 0.08) !important;
  color: #f1f5f9;
}

.pipeline-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s;
}

.pipeline-chip:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: rgba(0, 242, 254, 0.4);
  color: #00f2fe;
}

.pipeline-chip-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.pipeline-badge-safe {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.pipeline-badge-moderate {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.pipeline-badge-high {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.pipeline-badge-critical {
  background: rgba(225, 29, 72, 0.25);
  border: 1px solid rgba(225, 29, 72, 0.6);
  color: #f43f5e;
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Form Controls */
.pipeline-modal-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pipeline-modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pipeline-modal-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.pipeline-modal-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipeline-modal-input,
.pipeline-modal-select {
  width: 100%;
  padding: 9px 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pipeline-modal-input:focus,
.pipeline-modal-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.pipeline-modal-textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f8fafc;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  min-height: 160px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pipeline-modal-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* Footer */
.pipeline-modal-footer {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 17, 34, 0.95);
  flex-shrink: 0;
}

.pipeline-modal-meta-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: #64748b;
}

.pipeline-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pipeline-modal-btn {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.pipeline-modal-btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.pipeline-modal-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.pipeline-modal-btn.primary-task {
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  border: 1px solid #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.4);
}

.pipeline-modal-btn.primary-task:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.6);
}

.dag-node-prompt-btn {
  margin-top: 6px;
  width: 100%;
  font-size: 10px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.dag-node-prompt-btn.task-prompt-btn {
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
}

.dag-node-prompt-btn.task-prompt-btn:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.dag-node-prompt-btn.rule-prompt-btn {
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fecdd3;
}

.dag-node-prompt-btn.rule-prompt-btn:hover {
  background: rgba(244, 63, 94, 0.35);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

/* ==========================================================================
   EXCLUSIVE CHAT GOVERNANCE: CHAT ONLY IN 3D STUDIO (OFFICE & BOARDROOM)
   In Swarm Pipeline, chat is strictly hidden for 100% full-width canvas
   ========================================================================== */
.canvas-layout.pipeline-active .rightbar-chat,
.canvas-layout.pipeline-active #resizer-right,
.canvas-layout.pipeline-active .resizer-right,
.canvas-layout:has(#group-pane-pipeline:not([style*="display: none"])) .rightbar-chat,
.canvas-layout:has(#group-pane-pipeline:not([style*="display: none"])) #resizer-right,
.canvas-layout:has(#group-pane-pipeline:not([style*="display: none"])) .resizer-right {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* =============================================================================
   PER-TOOL GUARDIAN POLICY MATRIX & INLINE DRAWER STYLES
   ============================================================================= */
.pipeline-guardian-expand-btn {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.pipeline-guardian-expand-btn:hover,
.pipeline-guardian-expand-btn.active {
  background: rgba(0, 242, 254, 0.2);
  border-color: rgba(0, 242, 254, 0.5);
  color: #00f2fe;
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.3);
}

.pipeline-guardian-drawer-row {
  transition: all 0.25s ease;
}

.pipeline-guardian-drawer-row.collapsed {
  display: none !important;
}

.pipeline-guardian-drawer-row td {
  padding: 0 !important;
  background: rgba(7, 12, 24, 0.95) !important;
  border-bottom: 2px solid rgba(0, 242, 254, 0.25) !important;
}

.pipeline-guardian-drawer-content {
  padding: 14px 20px;
  border-left: 3px solid #00f2fe;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guardian-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.guardian-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
}

.guardian-agent-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.guardian-arch-pill {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.guardian-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guardian-mini-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.guardian-mini-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.guardian-mini-btn.primary {
  background: rgba(0, 242, 254, 0.15);
  border-color: rgba(0, 242, 254, 0.4);
  color: #00f2fe;
}

.guardian-mini-btn.primary:hover {
  background: rgba(0, 242, 254, 0.3);
}

.guardian-form-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guardian-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.guardian-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guardian-field label {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.03em;
}

.guardian-input {
  background: rgba(10, 16, 32, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 11.5px;
  font-family: 'JetBrains Mono', monospace;
  padding: 6px 10px;
  border-radius: 5px;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}

.guardian-input:focus {
  border-color: #00f2fe;
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.3);
}

.guardian-input.danger:focus {
  border-color: #f43f5e;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.3);
}

.guardian-hint {
  font-size: 9.5px;
  color: #64748b;
  font-style: italic;
}

.guardian-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.pipeline-dock-shield-btn {
  background: transparent;
  border: none;
  color: #10b981;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: all 0.15s;
}

.pipeline-dock-shield-btn:hover {
  background: rgba(0, 242, 254, 0.2);
  transform: scale(1.15);
}

/* =============================================================================
   ⚡ AUTONOMOUS TRIGGER PROMPT & UNCE ENGINE GUI ENHANCEMENTS
   ============================================================================= */

/* Palette Trigger Ingress Button */
.pipeline-btn-create-trigger {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px dashed rgba(0, 242, 254, 0.45);
  color: #00f2fe;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pipeline-btn-create-trigger:hover {
  background: rgba(0, 242, 254, 0.22);
  border-color: #00f2fe;
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.35);
  transform: translateY(-1px);
}

/* Trigger Node Canvas Styling */
.dag-node.node-trigger {
  border-color: rgba(0, 242, 254, 0.65);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.25), 0 8px 24px rgba(0, 0, 0, 0.6);
}

.dag-node.node-trigger:hover {
  border-color: #00f2fe;
  box-shadow: 0 0 24px rgba(0, 242, 254, 0.45), 0 12px 30px rgba(0, 0, 0, 0.7);
}

.dag-node.node-trigger .dag-node-header {
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.15), rgba(15, 23, 42, 0.9));
  border-bottom: 1px solid rgba(0, 242, 254, 0.3);
}

.badge-trigger {
  background: rgba(0, 242, 254, 0.18);
  color: #00f2fe;
  border: 1px solid rgba(0, 242, 254, 0.45);
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* Dynamic Context Token Pills */
.pipeline-token-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.pipeline-token-pill {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #7dd3fc;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.pipeline-token-pill:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

/* 6-Pillar Event Filter Pills */
.trigger-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.trigger-event-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.trigger-event-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
}

.trigger-event-pill.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: #00f2fe;
  color: #00f2fe;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

/* Monitored Tools Filter Pills */
.trigger-tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.trigger-tool-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.trigger-tool-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.trigger-tool-pill.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

/* Custom Right-Click Context Menu for Nodes */
.pipeline-custom-contextmenu {
  position: fixed;
  z-index: 100000;
  min-width: 180px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(0, 242, 254, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: ctxFadeIn 0.12s ease-out;
}

@keyframes ctxFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.contextmenu-header {
  padding: 6px 10px 4px 10px;
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contextmenu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 3px 0;
}

.contextmenu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #e2e8f0;
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s;
  width: 100%;
}

.contextmenu-item:hover {
  background: rgba(0, 242, 254, 0.15);
  color: #00f2fe;
}

.contextmenu-item.danger {
  color: #fb7185;
}

.contextmenu-item.danger:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
}

.palette-refresh-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.palette-refresh-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: #00f2fe;
  color: #00f2fe;
}

/* =============================================================================
   🎨 3D AGENT WARDROBE & CHARACTER STUDIO STYLES
   ============================================================================= */

.pipeline-style-presets-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.pipeline-preset-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pipeline-preset-pill {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pipeline-preset-pill:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.4);
  color: #00f2fe;
  transform: translateY(-1px);
}

.pipeline-preset-pill.active {
  background: rgba(0, 242, 254, 0.22);
  border-color: #00f2fe;
  color: #00f2fe;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

.pipeline-style-grid-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  padding: 18px 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .pipeline-style-grid-container {
    grid-template-columns: 1fr;
  }
}

.pipeline-style-preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pipeline-style-canvas-wrap {
  position: relative;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.8) 0%, rgba(10, 14, 23, 0.98) 85%);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), inset 0 0 25px rgba(0, 242, 254, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
}

#agent-style-turntable-canvas {
  width: 340px;
  height: 340px;
  cursor: grab;
}

#agent-style-turntable-canvas:active {
  cursor: grabbing;
}

.pipeline-style-turntable-badge {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #00f2fe;
  font-weight: 700;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.pipeline-style-head-notice {
  font-size: 11px;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.45;
  text-align: center;
  width: 100%;
}

.pipeline-style-head-notice span {
  color: #f59e0b;
  font-weight: 700;
}

.pipeline-style-controls-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pipeline-color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.pipeline-color-input {
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  width: 38px;
  height: 34px;
  cursor: pointer;
  background: transparent;
  padding: 2px;
}

.pipeline-color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.pipeline-color-input::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.pipeline-swatches-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.pipeline-swatches-row .swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.pipeline-swatches-row .swatch:hover {
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   🏛️ FLOWORK OS SOVEREIGN TOOL THEMES ENGINE
   4 Canonical Visual Styles for Tool Execution Cards, HUDs & Chat Outputs:
   1. cyber_neon       - Cyberpunk Holo (Default, glowing neon, futuristic)
   2. executive_glass  - Executive Glassmorphism (Frosted glass, luxury slate)
   3. retro_crt        - Retro CRT Terminal (Hacker phosphor green/amber, scanlines)
   4. minimalist       - Minimalist Slate (Flat, ultra-compact, distraction-free)
   ========================================================================== */

/* 1. CYBER NEON THEME (Default Cyberpunk Hologram) */
[data-tool-theme="cyber_neon"],
.tool-theme-cyber_neon {
  --tool-bg: rgba(9, 13, 22, 0.88);
  --tool-border: rgba(0, 242, 254, 0.35);
  --tool-border-hover: rgba(0, 242, 254, 0.75);
  --tool-text: #e2e8f0;
  --tool-accent: #00f2fe;
  --tool-secondary: #a855f7;
  --tool-header-bg: rgba(0, 242, 254, 0.08);
  --tool-glow: 0 0 16px rgba(0, 242, 254, 0.22);
  --tool-font: 'JetBrains Mono', 'Fira Code', monospace;
  --tool-radius: 8px;
}

/* 2. EXECUTIVE GLASSMORPHISM THEME (Frosted Luxury Slate) */
[data-tool-theme="executive_glass"],
.tool-theme-executive_glass {
  --tool-bg: rgba(15, 23, 42, 0.65);
  --tool-border: rgba(255, 255, 255, 0.14);
  --tool-border-hover: rgba(245, 158, 11, 0.6);
  --tool-text: #f8fafc;
  --tool-accent: #f59e0b;
  --tool-secondary: #0ea5e9;
  --tool-header-bg: rgba(255, 255, 255, 0.05);
  --tool-glow: 0 8px 32px rgba(0, 0, 0, 0.37);
  --tool-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --tool-radius: 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* 3. RETRO CRT TERMINAL THEME (Monospace Hacker Phosphor) */
[data-tool-theme="retro_crt"],
.tool-theme-retro_crt {
  --tool-bg: #050a05;
  --tool-border: #166534;
  --tool-border-hover: #22c55e;
  --tool-text: #86efac;
  --tool-accent: #22c55e;
  --tool-secondary: #eab308;
  --tool-header-bg: rgba(34, 197, 94, 0.12);
  --tool-glow: 0 0 12px rgba(34, 197, 94, 0.28);
  --tool-font: 'Courier New', 'VT323', monospace;
  --tool-radius: 4px;
}

/* 4. MINIMALIST SLATE THEME (Flat, Compact, Distraction-Free) */
[data-tool-theme="minimalist"],
.tool-theme-minimalist {
  --tool-bg: #0f172a;
  --tool-border: #334155;
  --tool-border-hover: #64748b;
  --tool-text: #cbd5e1;
  --tool-accent: #94a3b8;
  --tool-secondary: #64748b;
  --tool-header-bg: #1e293b;
  --tool-glow: none;
  --tool-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --tool-radius: 4px;
}

/* Apply variables to Tool Cards */
.fl-tool-theme-card,
.tool-hud-container[data-tool-theme],
.fl-commands-group[data-tool-theme],
.fl-cmd-item[data-tool-theme] {
  background: var(--tool-bg, rgba(9, 13, 22, 0.88)) !important;
  border: 1px solid var(--tool-border, rgba(0, 242, 254, 0.35)) !important;
  border-radius: var(--tool-radius, 8px) !important;
  box-shadow: var(--tool-glow, none) !important;
  color: var(--tool-text, #e2e8f0) !important;
  font-family: var(--tool-font, inherit) !important;
  transition: all 0.25s ease !important;
}

.fl-tool-theme-card:hover,
.fl-cmd-item[data-tool-theme]:hover {
  border-color: var(--tool-border-hover, var(--tool-accent, #00f2fe)) !important;
}

.fl-tool-theme-card .fl-tool-header,
.fl-commands-group[data-tool-theme] .fl-commands-summary,
.tool-hud-container[data-tool-theme] .tool-hud-header {
  background: var(--tool-header-bg, rgba(0, 242, 254, 0.08)) !important;
  color: var(--tool-accent, #00f2fe) !important;
  font-weight: 700;
  border-bottom: 1px solid var(--tool-border, rgba(255, 255, 255, 0.08)) !important;
}

/* CRT Scanline effect on retro_crt */
[data-tool-theme="retro_crt"] .fl-tool-body,
.tool-theme-retro_crt .fl-tool-body {
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03)) !important;
  background-size: 100% 2px, 3px 100% !important;
}

/* Cockpit Tool Theme Selector Grid */
.pipeline-tool-style-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pipeline-tool-style-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pipeline-tool-style-header h5 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-tool-theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.pipeline-tool-theme-option {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  user-select: none;
}

.pipeline-tool-theme-option:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.pipeline-tool-theme-option.active {
  background: rgba(0, 242, 254, 0.1);
  border-color: #00f2fe;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.25);
}

.pipeline-tool-theme-option .theme-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pipeline-tool-theme-option .theme-desc {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.3;
}

/* Live Tool Card Preview Container in Cockpit */
.pipeline-tool-preview-container {
  background: rgba(5, 8, 16, 0.7);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}

.pipeline-tool-preview-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipeline-sample-tool-card {
  border-radius: var(--tool-radius, 8px);
  background: var(--tool-bg, #090d16);
  border: 1px solid var(--tool-border, rgba(0, 242, 254, 0.35));
  box-shadow: var(--tool-glow, none);
  color: var(--tool-text, #e2e8f0);
  font-family: var(--tool-font, inherit);
  overflow: hidden;
  transition: all 0.3s ease;
}

.pipeline-sample-tool-card-header {
  padding: 6px 10px;
  background: var(--tool-header-bg, rgba(0, 242, 254, 0.08));
  border-bottom: 1px solid var(--tool-border, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.pipeline-sample-tool-card-header .tool-title {
  font-weight: 700;
  color: var(--tool-accent, #00f2fe);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pipeline-sample-tool-card-body {
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.5;
}

.pipeline-sample-tool-card-body code {
  color: var(--tool-accent, #00f2fe);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
}


