.taiwani-fc{
  position: fixed;
  bottom: var(--fc-b, 120px);
  z-index: 99999;
  width: var(--fc-size, 56px);
  height: var(--fc-size, 56px);
  pointer-events: none;
}
.taiwani-fc[data-side="left"]{ left: var(--fc-x, 16px); }
.taiwani-fc[data-side="right"]{ right: var(--fc-x, 16px); }

/* Stack is absolutely positioned above toggle so toggle NEVER moves */
.taiwani-fc__stack{
  position: absolute;
  left: 0;
  bottom: calc(var(--fc-size, 56px) + var(--fc-gap, 12px));
  display:flex;
  flex-direction: column;
  gap: var(--fc-gap, 12px);
  pointer-events: auto;
  transform-origin: bottom center;
  transition: transform .22s ease, opacity .22s ease;
}

.taiwani-fc__btn, .taiwani-fc__toggle{
  width: var(--fc-size, 56px);
  height: var(--fc-size, 56px);
  border-radius: var(--fc-radius, 999px);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
  text-decoration:none;
  border: none;
  cursor: pointer;
  background: var(--fc-bg, #222);
  overflow: hidden;
}

.taiwani-fc__btn{
  position: relative;
}
.taiwani-fc__btn::after{
  content:"";
  position:absolute;
  inset:-30%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.30), rgba(255,255,255,0) 55%);
  pointer-events:none;
}

.taiwani-fc__icon{
  width: 56%;
  height: 56%;
  display:flex;
  align-items:center;
  justify-content:center;
}
.taiwani-fc__icon img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display:block;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.18));
}

.taiwani-fc__toggle{
  pointer-events: auto;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.taiwani-fc__toggle-icon{
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: rgba(0,0,0,.6);
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.taiwani-fc__toggle-icon--chat{
  width: 52%;
  height: 52%;
  color: rgba(0,0,0,.55);
  display:none; /* show only when collapsed */
}
.taiwani-fc__toggle-icon--chat svg{
  width:100%;
  height:100%;
  display:block;
}

/* collapsed state: hide stack, swap icon to chat bubble */
.taiwani-fc.is-collapsed .taiwani-fc__stack{
  transform: scale(.86);
  opacity: 0;
  pointer-events: none;
}
.taiwani-fc.is-collapsed .taiwani-fc__toggle-icon--close{ display:none; }
.taiwani-fc.is-collapsed .taiwani-fc__toggle-icon--chat{ display:inline-flex; }

@media (max-width: 480px){
  .taiwani-fc{ bottom: calc(var(--fc-b, 120px) * .85); }
}


/* Contact bubble */
.taiwani-fc__bubble{
  position:absolute;
  bottom:0;
  white-space:nowrap;
  padding:10px 18px;
  border-radius:999px;
  background:#fff;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  font-size:14px;
  font-weight:600;
  color:#444;
  pointer-events:none;
  opacity:0;
  transform:translateY(4px);
  transition:all .25s ease;
}

.taiwani-fc[data-side="left"] .taiwani-fc__bubble{
  left:calc(var(--fc-size,56px) + 14px);
}
.taiwani-fc[data-side="right"] .taiwani-fc__bubble{
  right:calc(var(--fc-size,56px) + 14px);
}

/* small tail */
.taiwani-fc__bubble::after{
  content:"";
  position:absolute;
  width:10px;
  height:10px;
  background:#fff;
  bottom:50%;
  transform:translateY(50%) rotate(45deg);
}
.taiwani-fc[data-side="left"] .taiwani-fc__bubble::after{
  left:-5px;
}
.taiwani-fc[data-side="right"] .taiwani-fc__bubble::after{
  right:-5px;
}

/* show only when collapsed */
.taiwani-fc.is-collapsed .taiwani-fc__bubble{
  opacity:1;
  transform:translateY(0);
}
