.tmm-flow-container,
.tmm-flow-container * {
  box-sizing: border-box;
}

.tmm-flow-container {
  width: 100%;
  max-width: 100%;
  margin: 20px 0;
  padding: 15px 5px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #27323a;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  isolation: isolate;
}

.tmm-flow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

.tmm-flow-node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  max-width: min(220px, 100%);
  min-height: 38px;
  padding: 9px 14px;
  overflow-wrap: anywhere;
  border: 1px solid #9ca8af;
  border-radius: 3px;
  background: #fff;
  color: #27323a;
  box-shadow: none;
  text-align: center;
  font: inherit;
  font-weight: 400;
}

.tmm-flow-row > .tmm-flow-node {
  flex: 0 1 auto;
}

.tmm-flow-edge {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 0 4px;
  color: #4e5a60;
  line-height: 1;
}

.tmm-flow-arrow {
  color: #4e5a60;
  font-size: 20px;
  line-height: 1;
}

.tmm-flow-edge-label {
  color: #465158;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.tmm-flow-canvas {
  position: relative;
  width: 100%;
  min-width: 0;
}

.tmm-flow-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--tmm-flow-columns), minmax(72px, 220px));
  grid-auto-rows: minmax(40px, auto);
  gap: 28px 42px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.tmm-flow-grid > .tmm-flow-node {
  grid-column: var(--tmm-flow-column);
  grid-row: var(--tmm-flow-row);
  justify-self: center;
  width: auto;
  min-width: 72px;
  max-width: min(220px, 100%);
}

.tmm-flow-lines {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.tmm-flow-lines path:not([d^="M0,0"]) {
  fill: none;
  stroke: #525e64;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.tmm-flow-lines marker path {
  fill: #525e64;
}

.tmm-flow-canvas > .tmm-flow-edge-label {
  position: absolute;
  z-index: 3;
  max-width: 120px;
  padding: 2px 5px;
  transform: translate(-50%, -50%);
  border-radius: 3px;
  background: #fff;
  pointer-events: none;
}

.tmm-flow-relations,
.tmm-flow-marker-id {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.tmm-flow-relation {
  display: block;
}

@media (max-width: 640px) {
  .tmm-flow-container {
    padding: 15px 5px;
  }

  .tmm-flow-row {
    flex-direction: column;
  }

  .tmm-flow-row > .tmm-flow-node {
    flex: 0 1 auto;
    width: auto;
    min-width: 96px;
    max-width: min(280px, 100%);
  }

  .tmm-flow-edge {
    min-width: 0;
    min-height: 34px;
    padding: 3px 0;
  }

  .tmm-flow-edge > .tmm-flow-arrow {
    font-size: 0;
  }

  .tmm-flow-edge > .tmm-flow-arrow::before {
    content: "\2193";
    font-size: 20px;
  }

  .tmm-flow-edge--bidirectional > .tmm-flow-arrow::before {
    content: "\2195";
  }

  .tmm-flow-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(40px, auto);
    gap: 32px 0;
  }

  .tmm-flow-grid > .tmm-flow-node {
    grid-column: 1;
    grid-row: var(--tmm-flow-order);
    width: auto;
    min-width: 96px;
    max-width: min(280px, 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tmm-flow-container * {
    scroll-behavior: auto;
  }
}
