.vue-flow {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  direction: ltr;
}

.vue-flow__container {
  position: absolute;
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
}

.vue-flow__pane {
  z-index: 1;
}

.vue-flow__pane.draggable {
    cursor: grab;
  }

.vue-flow__pane.selection {
    cursor: pointer;
  }

.vue-flow__pane.dragging {
    cursor: grabbing;
  }

.vue-flow__transformationpane {
  transform-origin: 0 0;
  z-index: 2;
  pointer-events: none;
}

.vue-flow__viewport {
  z-index: 4;
  overflow: clip;
}

.vue-flow__selection {
  z-index: 6;
}

.vue-flow__edge-labels {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.vue-flow__nodesselection-rect:focus,
.vue-flow__nodesselection-rect:focus-visible {
  outline: none;
}

.vue-flow .vue-flow__edges {
  pointer-events: none;
  overflow: visible;
}

.vue-flow__edge-path,
.vue-flow__connection-path {
  stroke: #b1b1b7;
  stroke-width: 1;
  fill: none;
}

.vue-flow__edge {
  pointer-events: visibleStroke;
  cursor: pointer;
}

.vue-flow__edge.animated path {
    stroke-dasharray: 5;
    animation: dashdraw 0.5s linear infinite;
  }

.vue-flow__edge.animated path.vue-flow__edge-interaction {
    stroke-dasharray: none;
    animation: none;
  }

.vue-flow__edge.inactive {
    pointer-events: none;
  }

.vue-flow__edge.selected,
  .vue-flow__edge:focus,
  .vue-flow__edge:focus-visible {
    outline: none;
  }

.vue-flow__edge.selected .vue-flow__edge-path,
  .vue-flow__edge:focus .vue-flow__edge-path,
  .vue-flow__edge:focus-visible .vue-flow__edge-path {
    stroke: #555;
  }

.vue-flow__edge-textwrapper {
    pointer-events: all;
  }

.vue-flow__edge-textbg {
    fill: white;
  }

.vue-flow__edge-text {
    pointer-events: none;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
  }

.vue-flow__connection {
  pointer-events: none;
}

.vue-flow__connection .animated {
    stroke-dasharray: 5;
    animation: dashdraw 0.5s linear infinite;
  }

.vue-flow__connectionline {
  z-index: 1001;
}

.vue-flow__nodes {
  pointer-events: none;
  transform-origin: 0 0;
}

.vue-flow__node {
  position: absolute;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  pointer-events: all;
  transform-origin: 0 0;
  box-sizing: border-box;
  cursor: default;
}

.vue-flow__node.draggable {
    cursor: grab;
    pointer-events: all;
  }

.vue-flow__node.draggable.dragging {
      cursor: grabbing;
    }

.vue-flow__nodesselection {
  z-index: 3;
  transform-origin: left top;
  pointer-events: none;
}

.vue-flow__nodesselection-rect {
    position: absolute;
    pointer-events: all;
    cursor: grab;
  }

.vue-flow__nodesselection-rect.dragging {
      cursor: grabbing;
    }

.vue-flow__handle {
  position: absolute;
  pointer-events: none;
  min-width: 5px;
  min-height: 5px;
}

.vue-flow__handle.connectable {
    pointer-events: all;
    cursor: crosshair;
  }

.vue-flow__handle-bottom {
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 50%);
  }

.vue-flow__handle-top {
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
  }

.vue-flow__handle-left {
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
  }

.vue-flow__handle-right {
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
  }

.vue-flow__edgeupdater {
  cursor: move;
  pointer-events: all;
}

.vue-flow__panel {
  position: absolute;
  z-index: 5;
  margin: 15px;
}

.vue-flow__panel.top {
    top: 0;
  }

.vue-flow__panel.bottom {
    bottom: 0;
  }

.vue-flow__panel.left {
    left: 0;
  }

.vue-flow__panel.right {
    right: 0;
  }

.vue-flow__panel.center {
    left: 50%;
    transform: translateX(-50%);
  }

@keyframes dashdraw {
  from {
    stroke-dashoffset: 10;
  }
}
:root {
  --vf-node-bg: #fff;
  --vf-node-text: #222;
  --vf-connection-path: #b1b1b7;
  --vf-handle: #555;
}

.vue-flow__edge.updating .vue-flow__edge-path {
      stroke: #777;
    }

.vue-flow__edge-text {
  font-size: 10px;
}

.vue-flow__edge-textbg {
  fill: #fff;
}

.vue-flow__connection-path {
  stroke: var(--vf-connection-path);
}

.vue-flow__node {
  cursor: grab;
}

.vue-flow__node.selectable:focus,
  .vue-flow__node.selectable:focus-visible {
    outline: none;
  }

.vue-flow__node-default,
.vue-flow__node-input,
.vue-flow__node-output {
  padding: 10px;
  border-radius: 3px;
  width: 150px;
  font-size: 12px;
  text-align: center;
  border-width: 1px;
  border-style: solid;
  color: var(--vf-node-text);
  background-color: var(--vf-node-bg);
  border-color: var(--vf-node-color);
}

.vue-flow__node-default.selected,
  .vue-flow__node-default.selected:hover,
  .vue-flow__node-input.selected,
  .vue-flow__node-input.selected:hover,
  .vue-flow__node-output.selected,
  .vue-flow__node-output.selected:hover {
    box-shadow: 0 0 0 0.5px var(--vf-box-shadow);
  }

.vue-flow__node-default.selected,
  .vue-flow__node-default:focus,
  .vue-flow__node-default:focus-visible,
  .vue-flow__node-input.selected,
  .vue-flow__node-input:focus,
  .vue-flow__node-input:focus-visible,
  .vue-flow__node-output.selected,
  .vue-flow__node-output:focus,
  .vue-flow__node-output:focus-visible {
    outline: none;
    border: 1px solid #555;
  }

.vue-flow__node-default .vue-flow__handle, .vue-flow__node-input .vue-flow__handle, .vue-flow__node-output .vue-flow__handle {
    background: var(--vf-handle);
  }

.vue-flow__node-default.selectable:hover, .vue-flow__node-input.selectable:hover, .vue-flow__node-output.selectable:hover {
    box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.08);
  }

.vue-flow__node-input {
  --vf-node-color: var(--vf-node-color, #0041d0);
  --vf-handle: var(--vf-node-color, #0041d0);
  --vf-box-shadow: var(--vf-node-color, #0041d0);

  background: var(--vf-node-bg);
  border-color: var(--vf-node-color, #0041d0);
}

.vue-flow__node-input.selected,
  .vue-flow__node-input:focus,
  .vue-flow__node-input:focus-visible {
    outline: none;
    border: 1px solid var(--vf-node-color, #0041d0);
  }

.vue-flow__node-default {
  --vf-handle: var(--vf-node-color, #1a192b);
  --vf-box-shadow: var(--vf-node-color, #1a192b);

  background: var(--vf-node-bg);
  border-color: var(--vf-node-color, #1a192b);
}

.vue-flow__node-default.selected,
  .vue-flow__node-default:focus,
  .vue-flow__node-default:focus-visible {
    outline: none;
    border: 1px solid var(--vf-node-color, #1a192b);
  }

.vue-flow__node-output {
  --vf-handle: var(--vf-node-color, #ff0072);
  --vf-box-shadow: var(--vf-node-color, #ff0072);

  background: var(--vf-node-bg);
  border-color: var(--vf-node-color, #ff0072);
}

.vue-flow__node-output.selected,
  .vue-flow__node-output:focus,
  .vue-flow__node-output:focus-visible {
    outline: none;
    border: 1px solid var(--vf-node-color, #ff0072);
  }

.vue-flow__nodesselection-rect,
.vue-flow__selection {
  background: rgba(0, 89, 220, 0.08);
  border: 1px dotted rgba(0, 89, 220, 0.8);
}

.vue-flow__nodesselection-rect:focus,
  .vue-flow__nodesselection-rect:focus-visible,
  .vue-flow__selection:focus,
  .vue-flow__selection:focus-visible {
    outline: none;
  }

.vue-flow__handle {
  width: 6px;
  height: 6px;
  background: var(--vf-handle);
  border: 1px solid #fff;
  border-radius: 100%;
}
.vue-flow__minimap {
  background-color: #fff;
}

.vue-flow__minimap.pannable {
  cursor: grab;
}

.vue-flow__minimap.dragging {
  cursor: grabbing;
}

.vue-flow__minimap-mask.pannable {
  cursor: grab;
}
.vue-flow__controls {
  box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.08);
}

.vue-flow__controls-button {
  background: #fefefe;
  border: none;
  border-bottom: 1px solid #eee;
  box-sizing: content-box;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 16px;
  height: 16px;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  padding: 5px;
}

.vue-flow__controls-button svg {
  width: 100%;
  max-width: 12px;
  max-height: 12px;
}

.vue-flow__controls-button:hover {
  background: #f4f4f4;
}


.vue-flow__controls-button:disabled {
  pointer-events: none;
}

.vue-flow__controls-button:disabled svg {
  fill-opacity: 0.4;
}

/*
 * Glow de seleção (padrão n8n canvas): o Vue Flow aplica a classe
 * ".selected" no wrapper ".vue-flow__node" (um nível acima do card
 * renderizado aqui), então o hook desce via combinador ">" em vez de
 * receber uma prop "selected" — evita ter que roteá-la manualmente por
 * todos os ~20 *Node.vue que usam <BaseNode> como raiz.
 */
/* !important necessario: tailwind.config.js tem "important: true" global,
   entao a classe utilitaria shadow-[...] do BaseNode (sempre presente,
   inclusive em hover) tambem compila com !important e vence por ordem. */
.vue-flow__node.selected > .chatbot-node-card {
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.15) !important;
}

/* Play de "testar a partir daqui": so no hover do card, pra nao poluir o
   canvas. Fica visivel tambem enquanto o proprio botao esta em hover. */
.chatbot-node-card:hover > .chatbot-node-test-btn,
.chatbot-node-test-btn:hover,
.chatbot-node-test-btn:focus-visible {
  opacity: 1;
}

.code-editor[data-v-3e6f02a4] {
  display: flex;
  background: #1e1e2e;
  border: 1px solid #313244;
  border-radius: 8px;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  -moz-tab-size: var(--tab, 2);
    -o-tab-size: var(--tab, 2);
       tab-size: var(--tab, 2);
}
.code-editor__gutter[data-v-3e6f02a4] {
  flex: 0 0 auto;
  padding: 10px 8px;
  text-align: right;
  color: #4b4f6b;
  background: #181825;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  overflow: hidden;
  min-width: 34px;
}
.code-editor__area[data-v-3e6f02a4] {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: var(--min-h, 260px);
}

/* <pre> e <textarea> precisam de metricas IDENTICAS para alinhar o caret */
.code-editor__pre[data-v-3e6f02a4],
.code-editor__input[data-v-3e6f02a4] {
  margin: 0;
  padding: 10px 12px;
  width: 100%;
  height: 100%;
  font: inherit;
  line-height: inherit;
  -moz-tab-size: inherit;
    -o-tab-size: inherit;
       tab-size: inherit;
  white-space: pre;
  overflow: auto;
  border: 0;
  box-sizing: border-box;
}
.code-editor__pre[data-v-3e6f02a4] {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: #cdd6f4;
}
.code-editor__pre code[data-v-3e6f02a4] {
  font: inherit;
  background: none;
  white-space: pre;
}
.code-editor__input[data-v-3e6f02a4] {
  position: relative;
  background: transparent;
  color: transparent;
  caret-color: #f5e0dc;
  resize: none;
  outline: none;
}
.code-editor__input[data-v-3e6f02a4]::-moz-placeholder {
  color: #585b70;
}
.code-editor__input[data-v-3e6f02a4]::placeholder {
  color: #585b70;
}

/* Scrollbar discreta */
.code-editor__pre[data-v-3e6f02a4]::-webkit-scrollbar,
.code-editor__input[data-v-3e6f02a4]::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.code-editor__input[data-v-3e6f02a4]::-webkit-scrollbar-thumb {
  background: #45475a;
  border-radius: 4px;
}

/* Paleta de tokens (estilo Catppuccin Mocha) */
.code-editor__pre[data-v-3e6f02a4] .token.comment,
.code-editor__pre[data-v-3e6f02a4] .token.prolog,
.code-editor__pre[data-v-3e6f02a4] .token.doctype,
.code-editor__pre[data-v-3e6f02a4] .token.cdata { color: #6c7086; font-style: italic;
}
.code-editor__pre[data-v-3e6f02a4] .token.punctuation { color: #9399b2;
}
.code-editor__pre[data-v-3e6f02a4] .token.keyword,
.code-editor__pre[data-v-3e6f02a4] .token.boolean,
.code-editor__pre[data-v-3e6f02a4] .token.atrule { color: #cba6f7;
}
.code-editor__pre[data-v-3e6f02a4] .token.string,
.code-editor__pre[data-v-3e6f02a4] .token.char,
.code-editor__pre[data-v-3e6f02a4] .token.template-string,
.code-editor__pre[data-v-3e6f02a4] .token.regex { color: #a6e3a1;
}
.code-editor__pre[data-v-3e6f02a4] .token.number { color: #fab387;
}
.code-editor__pre[data-v-3e6f02a4] .token.function,
.code-editor__pre[data-v-3e6f02a4] .token.method { color: #89b4fa;
}
.code-editor__pre[data-v-3e6f02a4] .token.operator,
.code-editor__pre[data-v-3e6f02a4] .token.entity,
.code-editor__pre[data-v-3e6f02a4] .token.url { color: #94e2d5;
}
.code-editor__pre[data-v-3e6f02a4] .token.class-name,
.code-editor__pre[data-v-3e6f02a4] .token.constant { color: #f9e2af;
}
.code-editor__pre[data-v-3e6f02a4] .token.property,
.code-editor__pre[data-v-3e6f02a4] .token.parameter { color: #cdd6f4;
}
.code-editor__pre[data-v-3e6f02a4] .token.builtin { color: #f5c2e7;
}

@keyframes panel-in-39ddf13c {
from { transform: translateX(20px); opacity: 0;
}
to { transform: translateX(0); opacity: 1;
}
}
.animate-panel-in[data-v-39ddf13c] {
  animation: panel-in-39ddf13c 0.2s ease-out;
}

@keyframes slide-in-cfe2a2ca {
from { transform: translateX(100%);
}
to { transform: translateX(0);
}
}
.animate-slide-in[data-v-cfe2a2ca] {
  animation: slide-in-cfe2a2ca 0.2s ease-out;
}

/* Input estilo "pill contido" (inspirado no chat de IA do Kanban) */
.ai-input-shell[data-v-03c11250] {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 6px 8px 6px 10px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ai-input-shell[data-v-03c11250]:focus-within {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 10%);
}
.markdown-body[data-v-03c11250] strong { font-weight: 600; color: #111827;
}
.markdown-body[data-v-03c11250] em { font-style: italic;
}
.markdown-body[data-v-03c11250] code {
  background-color: #f3f4f6;
  color: #1f2937;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: ui-monospace, monospace;
  font-size: 10px;
}
.markdown-body[data-v-03c11250] ul,
.markdown-body[data-v-03c11250] ol { margin: 4px 0; padding-left: 16px;
}
.markdown-body[data-v-03c11250] ul { list-style-type: disc;
}
.markdown-body[data-v-03c11250] ol { list-style-type: decimal;
}
.markdown-body[data-v-03c11250] li { margin: 1px 0;
}

/* Hitbox transparente de 32px ao redor do handle. Captura pointer events
   numa area ~10x maior que a bolinha visual sem mudar o visual.
   pseudo-element absolute se ancora no .vue-flow__handle que ja tem
   position:absolute do vue-flow. */
.chatbot-builder .vue-flow__handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: transparent;
  pointer-events: auto;
}

/* Halo discreto quando o cursor esta na hitbox expandida — comunica
   "estou dentro da zona de drag" sem precisar de uma bolinha grande. */
.chatbot-builder .vue-flow__handle:hover::before {
  background: rgba(99, 102, 241, 0.10);
  transition: background 120ms ease-out;
}

/* Durante uma conexao em andamento (vue-flow adiciona connecting* state),
   intensifica o halo de TODOS os handles do tipo target pra deixar claro
   onde dropar. */
.chatbot-builder .vue-flow.connection-in-progress .vue-flow__handle.target::before {
  background: rgba(16, 185, 129, 0.12);
}
.chatbot-builder .vue-flow.connection-in-progress .vue-flow__handle.target:hover::before {
  background: rgba(16, 185, 129, 0.22);
}

/* Anel da validacao inline. Aplicado via node.class (canal proprio) e
   desenhado num ::after do wrapper do node — NAO usa style.boxShadow (que e
   do highlight da IA) nem style.outline (que e do filtro por tipo), entao os
   tres mecanismos convivem sem se apagar. Fica no canvas ate o problema ser
   corrigido; clique no canvas nao limpa. */
.chatbot-builder .vue-flow__node.chatbot-node-invalid::after,
.chatbot-builder .vue-flow__node.chatbot-node-warned::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 16px;
  border-width: 2px;
  border-style: solid;
  pointer-events: none;
}
.chatbot-builder .vue-flow__node.chatbot-node-invalid::after {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}
.chatbot-builder .vue-flow__node.chatbot-node-warned::after {
  border-color: #f59e0b;
  border-style: dashed;
}

/* ─── Realce da SIMULACAO ──────────────────────────────────────
   Mesmo canal da validacao (node.class, composto por applyNodeClasses), mas
   desenhado no ::before — pseudo-elemento DIFERENTE do ::after da validacao.
   Assim os dois aparecem juntos no mesmo no sem se apagar, e nenhum encosta
   no boxShadow inline da IA nem no outline/opacity inline do filtro. */
.chatbot-builder .vue-flow__node[class*='chatbot-node-sim-']::before {
  content: '';
  position: absolute;
  inset: -11px;
  border-radius: 20px;
  border-width: 2px;
  border-style: solid;
  border-color: transparent;
  pointer-events: none;
  transition: border-color 150ms ease-out;
}

/* Caminho ja percorrido: presente, mas discreto. */
.chatbot-builder .vue-flow__node.chatbot-node-sim-path::before {
  border-color: rgba(139, 92, 246, 0.45);
}

/* Passo de preparo (start_mode=prepare): e contexto, nao o que foi pedido. */
.chatbot-builder .vue-flow__node.chatbot-node-sim-prep::before {
  border-color: rgba(148, 163, 184, 0.5);
  border-style: dotted;
}

/* Efeito apenas simulado — o usuario nao pode confundir com "rodou". */
.chatbot-builder .vue-flow__node.chatbot-node-sim-mocked::before {
  border-color: #f59e0b;
  border-style: dashed;
}

/* No onde a simulacao esta agora. */
.chatbot-builder .vue-flow__node.chatbot-node-sim-current::before {
  border-color: #8b5cf6;
  border-width: 3px;
  animation: chatbot-sim-pulse 1.6s ease-in-out infinite;
}

/* No que falhou durante a simulacao. */
.chatbot-builder .vue-flow__node.chatbot-node-sim-error::before {
  border-color: #ef4444;
  border-width: 3px;
}
@keyframes chatbot-sim-pulse {
0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.35);
}
50% { box-shadow: 0 0 0 7px rgba(139, 92, 246, 0);
}
}

/* Aresta percorrida. Canal proprio (edge.class); o !important e necessario
   porque o BaseEdge aplica a cor via style inline no <path>. */
.chatbot-builder .vue-flow__edge.chatbot-edge-sim-path .vue-flow__edge-path {
  stroke: #8b5cf6 !important;
  stroke-width: 3 !important;
}

/* Aresta que caiu no fallback: o no pediu uma saida sem conexao desenhada.
   Quase sempre e um branch esquecido — por isso grita. */
.chatbot-builder .vue-flow__edge.chatbot-edge-sim-warn .vue-flow__edge-path {
  stroke: #f59e0b !important;
  stroke-width: 3 !important;
  stroke-dasharray: 6 4 !important;
}
