/* Flow editor — canvas, nodes, palette, toolbar */

.flow-editor {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-height: 0;
  font-family: Montserrat, Arial, sans-serif;
  color: #404040;
  background: #f6f6f6;
}

.screen-root--flow .screen-body {
  padding: 0;
  min-height: 0;
}

.screen-root--flow .flow-editor-host,
.screen-root--flow .flow-editor {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.flow-editor-host {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.flow-editor__status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  border-bottom: 1px solid rgba(200, 205, 210, 0.45);
  background: #f6f6f6;
  flex-shrink: 0;
}

.flow-editor__status-strip[hidden] {
  display: none !important;
}

.flow-editor__status-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.flow-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #c8cdd2;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.flow-btn--secondary {
  background: white;
  color: #404040;
}

.flow-btn--secondary:hover {
  border-color: #0f70b7;
}

.flow-btn--primary {
  background: #0f70b7;
  border-color: #0f70b7;
  color: white;
}

.flow-btn--primary:hover:not(:disabled) {
  background: #0d5f9c;
}

.flow-btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.flow-editor__body {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}

.flow-editor__body--panel-open .flow-editor__canvas-wrap {
  margin-right: 280px;
}

.flow-editor__status {
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.flow-editor__status--active {
  background: #d2f3db;
  color: #2f8a62;
}

.flow-editor__status--paused {
  background: #fde8c8;
  color: #c47d1a;
}

.flow-btn--pause {
  min-width: 90px;
}

/* Palette — hidden; nodes via canvas toolbar per Figma 10049:27026 */

.flow-palette {
  display: none;
}

.flow-palette__heading {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: #818181;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.flow-palette__list {
  display: grid;
  gap: 8px;
}

.flow-palette__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: white;
  border-radius: 8px;
  border: 1px solid rgba(200, 205, 210, 0.5);
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.flow-palette__item:hover {
  border-color: #0f70b7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.flow-palette__item:active {
  cursor: grabbing;
}

.flow-palette__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.flow-palette__label {
  font-size: 13px;
  font-weight: 500;
}

/* Canvas area */

.flow-editor__canvas-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  transition: margin-right var(--nav-transition-duration, 0.28s) var(--nav-transition-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

.flow-canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.flow-canvas__viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  position: relative;
  background-color: #f0f0f0;
  background-image: radial-gradient(circle, #c8cdd2 1px, transparent 1px);
  background-size: 20px 20px;
}

.flow-canvas__viewport--panning {
  cursor: grabbing;
}

.flow-canvas__viewport--connecting {
  cursor: crosshair;
}

.flow-canvas__viewport--connecting .flow-node {
  cursor: crosshair;
}

.flow-canvas__surface {
  position: relative;
  width: 4000px;
  height: 3000px;
  transform-origin: 0 0;
}

.flow-canvas__connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.flow-canvas__nodes {
  position: absolute;
  inset: 0;
}

/* Connections */

.flow-edge {
  fill: none;
  stroke: #404040;
  stroke-width: 2;
  stroke-linecap: round;
}

.flow-edge--true {
  stroke: #389f86;
}

.flow-edge--false {
  stroke: #f16a5e;
}

.flow-edge--loop {
  stroke: #0f70b7;
  stroke-dasharray: 8 4;
}

.flow-edge--temp {
  stroke: #0f70b7;
  stroke-dasharray: 6 4;
  opacity: 0.8;
}

/* Nodes */

.flow-node {
  position: absolute;
  display: flex;
  align-items: stretch;
  min-width: 220px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 2px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(200, 205, 210, 0.4);
  user-select: none;
  cursor: default;
  z-index: 1;
}

.flow-node__content {
  flex: 1;
  min-width: 0;
}

.flow-node--dragging {
  z-index: 10;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.flow-node--invalid {
  border-color: #f16a5e;
}

.flow-node--selected {
  border-color: #0f70b7;
  box-shadow: 0 0 0 2px rgba(15, 112, 183, 0.25), 0 4px 2px rgba(0, 0, 0, 0.1);
}

.flow-node--send-highlight {
  border-color: #0f70b7;
  background: linear-gradient(180deg, #f4f9fd 0%, #ffffff 72%);
  box-shadow:
    0 0 0 1px rgba(15, 112, 183, 0.18),
    0 8px 18px rgba(15, 112, 183, 0.12);
}

.flow-node--send-highlight.flow-node--selected {
  box-shadow:
    0 0 0 2px rgba(15, 112, 183, 0.28),
    0 8px 18px rgba(15, 112, 183, 0.14);
}

.flow-node__header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 12px 10px 8px;
  flex-wrap: wrap;
}

.flow-node__result-link {
  margin-left: auto;
  border: 1px solid #b8d4ec;
  border-radius: 999px;
  background: #e8f3fc;
  color: #0f70b7;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.flow-node__result-link:hover {
  background: #d4eafb;
  border-color: #0f70b7;
  box-shadow: 0 0 0 3px rgba(15, 112, 183, 0.12);
}

.flow-node__result-link:focus-visible {
  outline: 2px solid #0f70b7;
  outline-offset: 2px;
}

.flow-node__warning {
  display: none;
}

.flow-node__header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.flow-node__error {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  color: #f16a5e;
}

.flow-node__error[hidden] {
  display: none !important;
}

.flow-node__body {
  padding: 10px 12px 12px;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.5;
  color: #404040;
  border-top: 1px solid rgba(200, 205, 210, 0.35);
}

.flow-node__rule {
  display: grid;
  gap: 4px;
}

.flow-node__rule + .flow-node__rule {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef1f3;
}

.flow-node__icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flow-node__icon .ti {
  font-size: 12px;
  line-height: 1;
}

.flow-node__title {
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}

.flow-node__text {
  display: block;
  margin-bottom: 6px;
}

.flow-node__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.flow-node__chip {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #c8cdd2;
  border-radius: 4px;
  background: white;
  font-size: 13px;
  white-space: nowrap;
}

/* Ports — Figma rail layout (10049:27026) */

.flow-node__output-rail {
  position: relative;
  display: flex;
  align-items: center;
  align-self: stretch;
  flex-shrink: 0;
  padding-left: 12px;
}

.flow-node__output-rail::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(200, 205, 210, 0.55);
}

.flow-node__outputs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-right: 0;
  margin-right: -6px;
  min-height: 100%;
}

.flow-node__outputs--branch {
  gap: 50px;
  padding: 12px 0;
}

.flow-node__output-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-node__outputs--branch .flow-port__label {
  position: static;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}

.flow-port {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #404040;
  background: white;
  padding: 0;
  cursor: crosshair;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  touch-action: none;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
  z-index: 2;
}

.flow-port::before {
  content: '';
  position: absolute;
  inset: -10px;
}

.flow-port:hover,
.flow-port--snap-target {
  border-color: #0f70b7;
  box-shadow: 0 0 0 3px rgba(15, 112, 183, 0.2);
}

.flow-port--snap-target {
  background: #e8f3fc;
}

.flow-port--input {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  margin-left: -10px;
  margin-right: 4px;
  flex-shrink: 0;
}

.flow-port--output {
  position: relative;
}

.flow-port__label {
  position: absolute;
  right: calc(100% + 8px);
  font-size: 12px;
  font-weight: 500;
  color: #6d7582;
  pointer-events: none;
  white-space: nowrap;
  line-height: 1;
}

.flow-port--true {
  border-color: #389f86;
}

.flow-port--true:hover,
.flow-port--true.flow-port--snap-target {
  border-color: #389f86;
  box-shadow: 0 0 0 3px rgba(56, 159, 134, 0.2);
}

.flow-port--false {
  border-color: #404040;
}

/* Toolbar */

.flow-toolbar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  z-index: 20;
}

.flow-toolbar__add-wrap {
  position: relative;
}

.flow-toolbar__add-btn {
  width: 45px;
  height: 45px;
  border: 0;
  border-radius: 8px;
  background: #0f70b7;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 2px rgba(0, 0, 0, 0.1);
  transition: background 0.15s ease;
}

.flow-toolbar__add-btn:hover {
  background: #0d5f9c;
}

.flow-toolbar__add-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  padding: 12px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: grid;
  gap: 8px;
}

.flow-toolbar__add-menu[hidden] {
  display: none !important;
}

.flow-toolbar:not(.flow-toolbar--has-nodes) .flow-toolbar__group:not(.flow-toolbar__add-wrap) {
  display: none;
}

.flow-toolbar__add-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 4px 6px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #404040;
  cursor: pointer;
  text-align: left;
}

.flow-toolbar__add-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.flow-toolbar__add-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flow-toolbar__add-icon--trigger {
  background: #d2eae4;
  color: #389f86;
}

.flow-toolbar__add-icon--condition {
  background: #ffe1c2;
  color: #ef7900;
}

.flow-toolbar__add-icon--wait {
  background: #e4e7ea;
  color: #6d7582;
}

.flow-toolbar__add-icon--send {
  background: #d4eafb;
  color: #0f70b7;
}

.flow-toolbar__add-icon--exit {
  background: #fbd9d6;
  color: #f16a5e;
}

.flow-toolbar__add-icon .ti {
  font-size: 14px;
  line-height: 1;
}

.flow-toolbar__redo-icon {
  transform: scaleX(-1);
  display: inline-block;
}

.flow-toolbar__group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.flow-toolbar__btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #404040;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.flow-toolbar__btn .ti {
  font-size: 24px;
  line-height: 1;
}

.flow-toolbar__add-btn .ti {
  font-size: 21px;
  line-height: 1;
}

.flow-toolbar__btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.flow-toolbar__btn.is-active {
  background: #0f70b7;
  color: white;
}

.flow-toolbar__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.flow-toolbar__zoom {
  font-size: 13px;
  color: #6d7582;
  min-width: 36px;
  text-align: center;
}

/* Validation banner */

.flow-editor__validation {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fff5f4;
  border: 1px solid #f16a5e;
  border-radius: 8px;
  font-size: 13px;
  color: #404040;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(241, 106, 94, 0.15);
}

.flow-editor__validation[hidden] {
  display: none !important;
}

.flow-editor__validation .ti {
  color: #f16a5e;
  font-size: 13px;
  flex-shrink: 0;
}

/* Config panel */

.flow-panel[hidden] {
  display: none !important;
}

.flow-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  border-left: 2px solid #ffffff;
  background: #f6f6f6;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  z-index: 10;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  transition:
    transform var(--nav-transition-duration, 0.28s) var(--nav-transition-ease, cubic-bezier(0.4, 0, 0.2, 1)),
    opacity var(--nav-transition-duration, 0.28s) var(--nav-transition-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

.flow-panel--visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.flow-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 4px;
  flex-shrink: 0;
}

.flow-panel__title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #404040;
}

.flow-panel__close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6d7582;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-panel__close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.flow-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 10px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.flow-panel__fields {
  display: grid;
  gap: 6px;
}

.flow-panel__field {
  display: grid;
  gap: 3px;
}

.flow-panel__label {
  font-size: 11px;
  font-weight: 500;
  color: #6d7582;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.flow-panel__input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #c8cdd2;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  color: #404040;
  background: white;
  box-sizing: border-box;
}

.flow-panel__input:focus {
  outline: none;
  border-color: #0f70b7;
}

.flow-panel__hint {
  margin: 0;
  font-size: 11px;
  color: #848f99;
  line-height: 1.35;
}

.flow-panel__section {
  padding-top: 6px;
  border-top: 1px solid #e4e7ea;
  display: grid;
  gap: 4px;
}

.flow-panel__section-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #404040;
}

.flow-panel__section-title .ti {
  color: #0f70b7;
}

.flow-panel__checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.flow-panel__loop-fields {
  display: grid;
  gap: 4px;
}

.flow-panel__stub {
  margin: 0;
  padding: 4px 8px;
  background: #fff8e6;
  border: 1px dashed #ef7900;
  border-radius: 6px;
  font-size: 11px;
  color: #8a5a00;
  line-height: 1.4;
}

.flow-panel__rules {
  display: grid;
  gap: 6px;
}

.flow-panel__rule {
  display: grid;
  gap: 4px;
  padding: 8px;
  background: white;
  border: 1px solid #e4e7ea;
  border-radius: 8px;
}

.flow-panel__rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
  margin-bottom: 2px;
}

.flow-panel__rule-label {
  font-size: 12px;
  font-weight: 500;
  color: #6d7582;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.flow-panel__rule-remove {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #f16a5e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flow-panel__rule-remove:hover {
  background: rgba(241, 106, 94, 0.1);
}

.flow-panel__add-rule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed #c8cdd2;
  border-radius: 8px;
  background: white;
  padding: 5px 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #0f70b7;
  cursor: pointer;
}

.flow-panel__add-rule:hover {
  border-color: #0f70b7;
  background: rgba(15, 112, 183, 0.04);
}

@media (max-width: 860px) {
  .flow-editor__body--panel-open .flow-editor__canvas-wrap {
    margin-right: 0;
  }

  .flow-panel {
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
  }

  .flow-palette {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-panel,
  .flow-editor__canvas-wrap {
    transition: none;
  }
}

/* Flow screen tabs + analytics */
.flow-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.flow-screen .vl-tabs {
  padding: 8px 20px 0;
  border-bottom: 1px solid #e4e7ea;
  background: #f6f6f6;
  flex-shrink: 0;
}

.flow-screen-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 20px 0;
  border-bottom: 1px solid #e4e7ea;
  background: #f6f6f6;
  flex-shrink: 0;
}

.flow-screen-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  margin-bottom: -1px;
}

.flow-screen-tab.is-active {
  color: #0f70b7;
  border-bottom-color: #0f70b7;
}

.flow-screen-panels {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.flow-screen-panel {
  display: none;
  flex: 1;
  min-height: 0;
}

.flow-screen-panel.is-active {
  display: flex;
  flex-direction: column;
}

.flow-analytics-host {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
}

.flow-analytics-inner {
  max-width: 1100px;
  min-width: 0;
  margin: 0 auto;
  padding: 20px 24px 32px;
}

.flow-analytics-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.flow-analytics-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
}

.flow-analytics-header p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.flow-analytics .flow-funnel-card {
  margin-bottom: 20px;
  min-width: 0;
  max-width: 100%;
}

.flow-analytics .vl-funnel-body {
  min-width: 0;
  overflow: visible;
}

.flow-analytics .vl-funnel-flow-scroll {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.flow-analytics-section {
  margin-bottom: 28px;
}

.flow-analytics-section h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
}

.flow-analytics-nodes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flow-analytics-node {
  background: #fff;
  border: 1px solid #e4e7ea;
  border-radius: 10px;
  padding: 14px 16px;
}

.flow-analytics-node--send-highlight {
  border-color: #b8d4ec;
  background: linear-gradient(180deg, #f4f9fd 0%, #ffffff 100%);
  box-shadow: 0 0 0 1px rgba(15, 112, 183, 0.08);
}

.flow-analytics-node-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.flow-analytics-node-copy {
  flex: 1;
  min-width: 0;
}

.flow-analytics-node-result-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  border: 1px solid #b8d4ec;
  border-radius: 999px;
  background: #e8f3fc;
  color: #0f70b7;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.flow-analytics-node-result-link:hover {
  background: #d4eafb;
  border-color: #0f70b7;
  box-shadow: 0 0 0 3px rgba(15, 112, 183, 0.12);
}

.flow-analytics-node-result-link:focus-visible {
  outline: 2px solid #0f70b7;
  outline-offset: 2px;
}

.flow-analytics-node-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.flow-analytics-node-icon--trigger {
  background: #d2eae4;
  color: #389f86;
}

.flow-analytics-node-icon--condition {
  background: #ffe1c2;
  color: #ef7900;
}

.flow-analytics-node-icon--wait {
  background: #e4e7ea;
  color: #6d7582;
}

.flow-analytics-node-icon--send {
  background: #d4eafb;
  color: #0f70b7;
}

.flow-analytics-node-icon--exit {
  background: #fbd9d6;
  color: #f16a5e;
}

.flow-analytics-node--exit {
  padding: 10px 12px;
  background: #fff;
}

.flow-analytics-node-header--compact {
  margin-bottom: 0;
}

.flow-analytics-node-exit-count {
  display: block;
  font-size: 12px;
  color: #6d7582;
}

.flow-analytics-node-exit-count strong {
  font-weight: 700;
  color: #111827;
}

.flow-analytics-node-exit-action {
  margin-left: auto;
  font-size: 12px;
}

.flow-analytics-node-type {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  text-transform: capitalize;
}

/* Node stat infographic bars */
.flow-analytics-node-infographic {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.flow-analytics-node-infographic[title] {
  cursor: help;
}

.flow-analytics-node-infographic-track {
  display: flex;
  align-items: stretch;
  gap: 3px;
  height: 14px;
  padding: 2px;
  border-radius: 999px;
  background: #eef0f2;
  overflow: hidden;
}

.flow-analytics-node-infographic-track--entry {
  background: rgba(59, 130, 246, 0.1);
}

.flow-analytics-node-infographic-segment {
  display: block;
  min-width: 6px;
  height: 100%;
  border-radius: 999px;
  transition: flex-basis 0.25s ease, width 0.25s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.flow-analytics-node-infographic-segment--entry {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.flow-analytics-node-infographic-segment--passed {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.flow-analytics-node-infographic-segment--blocked {
  background: linear-gradient(90deg, #f97316, #fb923c);
}

.flow-analytics-node-infographic-segment--waiting {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.flow-analytics-node-infographic-segment--active {
  background: linear-gradient(90deg, #0f70b7, #38a3f1);
}

.flow-analytics-node-infographic-segment--stopped {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.flow-analytics-node-infographic-segment--sent {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.flow-analytics-node-infographic-segment--failed {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.flow-analytics-node-infographic--simple {
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.06);
  border-radius: 8px;
}

.flow-analytics-node-infographic--simple .flow-analytics-node-infographic-footer {
  margin-top: 0;
}

.flow-analytics-node-infographic-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.flow-analytics-node-infographic--entry .flow-analytics-node-infographic-footer {
  gap: 8px;
}

.flow-analytics-node-infographic-dot {
  width: 26px;
  height: 26px;
  font-size: 13px;
  flex-shrink: 0;
}

.flow-analytics-node-infographic-label {
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
}

.flow-analytics-node-infographic-label strong {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.flow-analytics-node-infographic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.flow-analytics-node-infographic-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.flow-analytics-node-infographic-legend-item .flow-analytics-node-infographic-dot {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.flow-analytics-node-infographic-legend-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.flow-analytics-node-infographic-legend-copy strong {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.flow-analytics-node-infographic-legend-copy span {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
}

.flow-analytics-node-infographic-summary {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

.flow-analytics-node-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: #6b7280;
}

.flow-analytics-node-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0;
}

.flow-analytics-node-stat--clickable {
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.flow-analytics-node-stat--clickable:hover,
.flow-analytics-node-stat--clickable.flow-analytics-node-stat--open {
  background: #f4f9fd;
  color: #0f70b7;
}

.flow-analytics-node-stat--waiting {
  color: #1e40af;
}

.flow-analytics-node-stat--waiting:hover,
.flow-analytics-node-stat--waiting.flow-analytics-node-stat--open {
  background: #dbeafe;
  color: #1e3a8a;
}

.flow-analytics-node-stat--active {
  color: #0f766e;
}

.flow-analytics-node-stat--active:hover,
.flow-analytics-node-stat--active.flow-analytics-node-stat--open {
  background: #ccfbf1;
  color: #115e59;
}

.flow-analytics-node-stat--failed {
  color: #dc2626;
}

.flow-analytics-node-stat--failed:hover,
.flow-analytics-node-stat--failed.flow-analytics-node-stat--open {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.flow-analytics-node-stat--clickable:focus-visible {
  outline: 2px solid #0f70b7;
  outline-offset: 2px;
}

.flow-analytics-node-participants {
  margin-top: 12px;
  border-top: 1px solid #f0f2f4;
  padding-top: 12px;
}

.flow-analytics-node-participants-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.flow-analytics-node-participants-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f0f2f4;
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
}

.flow-analytics-node-participants-empty {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
}

.flow-analytics-node-participants-table-wrap {
  overflow-x: auto;
  border: 1px solid #e4e7ea;
  border-radius: 8px;
  background: #fafbfc;
}

.flow-analytics-node-participants-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.flow-analytics-node-participants-table th,
.flow-analytics-node-participants-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #f0f2f4;
}

.flow-analytics-node-participants-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  background: #f9fafb;
}

.flow-analytics-node-stop {
  color: #dc2626;
}

.flow-analytics-table-wrap {
  overflow-x: auto;
  border: 1px solid #e4e7ea;
  border-radius: 10px;
  background: #fff;
}

.flow-analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.flow-analytics-table th,
.flow-analytics-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #f0f2f4;
}

.flow-analytics-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  background: #f9fafb;
}

.flow-analytics-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.flow-analytics-status--completed {
  background: #dcfce7;
  color: #166534;
}

.flow-analytics-status--stopped {
  background: #fee2e2;
  color: #991b1b;
}

.flow-analytics-status--active {
  background: #dbeafe;
  color: #1e40af;
}

.flow-analytics-status--waiting {
  background: #e0e7ff;
  color: #3730a3;
}
