/* Construtor visual de fluxos (15/11/2026): tela infinita com grade de
   pontos, cartões ligados por linhas, painel lateral e barra flutuante.
   Só tokens de base.css. */
body.fb-open {
  overflow: hidden;
}
.fb {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg);
  color: var(--ink);
}
.fb-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.fb .fb-top input.fb-title:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]) {
  width: min(420px, 40vw);
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  font-size: 17px;
  font-weight: 800;
}
.fb .fb-top input.fb-title:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):hover,
.fb .fb-top input.fb-title:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):focus {
  border-color: var(--line-2);
  background: var(--surface);
}
.fb-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--subtle);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.fb-badge.is-warn { background: var(--sun); color: var(--sun-ink); }
.fb-badge.is-ok { background: var(--mint); color: var(--mint-ink); }
.fb-top-space {
  flex: 1;
}
.fb-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}
.fb-icon:hover:not(:disabled) {
  background: var(--hover);
  color: var(--ink);
}
.fb-icon .icon {
  width: 18px;
  height: 18px;
}
.fb-tool,
.fb-tool-wide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.fb-tool .icon,
.fb-tool-wide .icon {
  width: 16px;
  height: 16px;
}
.fb-tool:hover:not(:disabled),
.fb-tool-wide:hover {
  background: var(--hover);
}
.fb-tool.is-danger {
  color: var(--danger-ink);
}
.fb-tool-wide {
  width: 100%;
  border-style: dashed;
}
.fb-save {
  white-space: nowrap;
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 700;
}
.fb-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 0;
}
.fb-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
}
.fb-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  background-color: var(--subtle);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 1.2px);
  touch-action: none;
}
.fb-canvas:active {
  cursor: grabbing;
}
.fb-canvas.is-list {
  overflow-y: auto;
  padding: 24px 24px 110px;
  cursor: default;
  background-image: none;
  touch-action: auto;
}
.fb-world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
.fb-edges {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  max-width: none;
  overflow: visible;
}
.fb-edges path {
  fill: none;
  stroke: color-mix(in srgb, var(--ink) 28%, transparent);
  stroke-width: 2;
}
.fb-edges path.is-hot {
  stroke: var(--accent);
  stroke-width: 2.5;
}
.fb-edge-label {
  display: block;
  width: max-content;
  margin: 0 auto;
  padding: 1px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 18px;
}
.fb-edge-label.is-hot {
  border-color: var(--accent);
  color: var(--ink);
}
.fb-node {
  position: absolute;
  width: 236px;
  height: 112px;
}
.fb-node-main {
  display: grid;
  align-content: start;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.fb-node-main:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-pop);
}
.fb-node.is-on .fb-node-main {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-pop);
}
.fb-node.is-empty strong {
  color: var(--muted);
  font-style: italic;
}
.fb-node strong {
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.fb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}
.fb-chip .icon {
  width: 14px;
  height: 14px;
}
.fb-chip.is-sun, .fb-panel-ico.is-sun { background: var(--sun); color: var(--sun-ink); }
.fb-chip.is-sky, .fb-panel-ico.is-sky { background: var(--sky); color: var(--sky-ink); }
.fb-chip.is-lilac, .fb-panel-ico.is-lilac { background: var(--lilac); color: var(--lilac-ink); }
.fb-chip.is-rose, .fb-panel-ico.is-rose { background: var(--rose); color: var(--rose-ink); }
.fb-chip.is-mint, .fb-panel-ico.is-mint { background: var(--mint); color: var(--mint-ink); }
.fb-chip.is-start { background: var(--accent-soft); color: var(--ink); }
.fb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  overflow: hidden;
  max-height: 20px;
}
.fb-meta i {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--subtle);
  color: var(--text);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}
.fb-meta i.is-fatal {
  background: var(--rose);
  color: var(--rose-ink);
}
.fb-meta .icon {
  width: 11px;
  height: 11px;
}
.fb-who {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--lilac);
  color: var(--lilac-ink);
  font-size: 10px;
  font-weight: 800;
}
.fb-add {
  position: absolute;
  right: -14px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border: 1.5px dashed var(--line-2);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s;
}
.fb-node:hover .fb-add,
.fb-node.is-on .fb-add,
.fb-add:focus-visible,
.fb-start .fb-add {
  opacity: 1;
}
.fb-add:hover {
  border-color: var(--accent);
  border-style: solid;
  color: var(--ink);
}
.fb-add .icon {
  width: 16px;
  height: 16px;
}
.fb-start .fb-node-main {
  cursor: default;
  border-style: dashed;
}
.fb-undo,
.fb-zoom {
  position: absolute;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.fb-undo {
  left: 14px;
}
.fb-zoom {
  right: 14px;
}
.fb-zoom span {
  min-width: 46px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}
.fb-dock {
  position: absolute;
  left: calc((100% - 340px) / 2);
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  z-index: 3;
}
.fb-dock-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 700;
}
.fb-dock-main .icon {
  width: 16px;
  height: 16px;
}
.fb-dock-sep {
  width: 1px;
  height: 24px;
  background: var(--line-2);
}
.fb-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--subtle);
}
.fb-seg button {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
}
.fb-seg button.is-on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.fb-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 90px;
  border-left: 1px solid var(--line);
  background: var(--surface);
}
.fb-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fb-panel-head strong {
  flex: 1;
  font-size: 15px;
}
.fb-panel-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--subtle);
  color: var(--ink);
}
.fb-panel-ico .icon {
  width: 18px;
  height: 18px;
}
.fb-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.fb-field > span {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.fb .fb-field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
.fb .fb-field select,
.fb .fb-field textarea,
.fb .fb-check-add input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]) {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
}
.fb .fb-field select {
  padding-right: 30px;
}
.fb-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.fb-switch {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r);
  background: var(--subtle);
  cursor: pointer;
}
.fb-switch input {
  position: absolute;
  opacity: 0;
}
.fb-switch > i {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
  border-radius: 999px;
  background: var(--line-2);
  transition: background 0.15s;
}
.fb-switch > i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform 0.15s;
}
.fb-switch input:checked + i {
  background: var(--mint-ink);
}
.fb-switch input:checked + i::after {
  transform: translateX(16px);
}
.fb-switch input:focus-visible + i {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, var(--ink));
  outline-offset: 2px;
}
.fb-switch span {
  display: grid;
  gap: 2px;
}
.fb-switch small {
  color: var(--muted);
}
.fb-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.fb-summary div {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.fb-summary b {
  font-size: 20px;
}
.fb-summary small {
  color: var(--muted);
  font-size: 11.5px;
}
.fb-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.fb-check {
  display: grid;
  gap: 8px;
}
.fb-check ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fb-check li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px;
}
.fb-check li span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.fb-check li .fb-icon {
  width: 26px;
  height: 26px;
}
.fb-check-add {
  display: flex;
  gap: 6px;
}
.fb-check-add input {
  flex: 1;
}
.fb-panel-acts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.fb-panel-acts .fb-tool-wide {
  grid-column: 1 / -1;
}
.fb-list {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto 14px;
  padding: 0;
  list-style: none;
}
.fb-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
}
.fb-list li.is-on button {
  border-color: var(--accent);
}
.fb-list span {
  display: grid;
  gap: 2px;
}
.fb-list small {
  color: var(--muted);
}
.fb-list-n {
  display: grid !important;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 800;
}
.fb-canvas.is-list > .fb-tool-wide {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
}
@media (max-width: 900px) {
  .fb-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .fb-panel {
    max-height: 46vh;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-bottom: 16px;
  }
  .fb-dock {
    left: 50%;
    bottom: calc(46vh + 12px);
  }
  .fb-top {
    flex-wrap: wrap;
    padding: 10px 12px;
  }
  .fb .fb-top input.fb-title:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]) {
    width: 100%;
    order: 9;
  }
  .fb-tool.is-danger {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fb-add,
  .fb-switch > i,
  .fb-switch > i::after {
    transition: none;
  }
}
