Person A: くしゃみをしたら元の根暗に戻った
Person B: ギリギリすぎる設定ですな
Person C: あんただってギリギリじゃない
The context here is that someone has a split personality and when she sneezes her character changes, the first line is explaining this (くしゃみをしたら元の根暗に戻った), the second line is someone commenting on this (ギリギリすぎる設定ですな) and the third line is the person with the split personality (あんただってギリギリじゃない) but I can't understand what ぎりぎり and 設定 mean in the sentence.