#chat-wrapper{
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 350px;
  max-height: 600px;
  min-height: 600px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  font-family: 'Helvetica Neue', sans-serif;
}

#chat-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background-color: #0078d7;
  color: white;
  font-weight: bold;
  font-size: 15px;
}

#chat-header .title{
  flex: 1;
  text-align: left;
}

#chat-header .close-button{
  cursor: pointer;
  font-size: 18px;
  padding: 0 8px;
}

/* チャットエリア */
#chat-area{
  flex: 1;
  padding: 10px;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: #e9ecf1;
}

/* 入力欄エリア */
#chat-controls{
  display: flex;
  border-top: 1px solid #ccc;
  padding: 8px;
  background-color: #fff;
}

#question-input{
  color: black;
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 18px;
  outline: none;
}

#send-button{
  margin-left: 8px;
  padding: 8px 12px;
  border: none;
  background-color: #0078d7;
  color: white;
  border-radius: 18px;
  cursor: pointer;
}

/* 吹き出し風メッセージ */
.message{
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  font-size: 14px;
}

.message.user{
  align-self: flex-end;
  background-color: #dcf8c6;
  color: #333;
  border-bottom-right-radius: 4px;
}

.message.bot{
  align-self: flex-start;
  background-color: #ffffff;
  color: #333;
  border-bottom-left-radius: 4px;
}

.message.error{
  align-self: center;
  background-color: #ffcccc;
  color: #900;
}

#chat-open-button{
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #0078d7;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 9;
}

@media (max-width: 768px) {
    #chat-wrapper,
    #chat-open-button{
  		bottom: 55px;
    }
}

#thinking-indicator{
  display: none;
  text-align: center;
  padding: 10px;
  font-size: 18px;
  color: #555;
  animation: bounceDots 1.5s infinite;
}

@keyframes bounceDots{
  0%{ content: "."; }
  25%{ content: ".."; }
  50%{ content: "..."; }
  75%{ content: ".."; }
  100%{ content: "."; }
}
