/* ============================
   ProLabo AIチャット（右下固定）
============================ */
#prolabo-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: "Noto Sans JP", sans-serif;

  /* 初期は非表示（スクロール後にフェードイン） */
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* スクロール後にふわっと出現 */
#prolabo-launcher.show-launcher {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* チャット起動ボタン（PC用） */
#prolabo-launcher button#chat-open {
  display: flex;
  align-items: center;
  background: #ff007f;
  border: none;
  border-radius: 30px;
  color: #fff;
  font-weight: bold;
  padding: 10px 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s;
}
#prolabo-launcher button#chat-open:hover {
  background: #d9006d;
}

#prolabo-launcher img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 10px;
}

/* チャットウィンドウ */
#prolabo-chat-window {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 360px;
  height: 480px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* ヘッダー */
.chat-header {
  background: linear-gradient(90deg, #ff007f, #ff65a3);
  color: white;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

/* 本体 */
#chat-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #f9f9fb;
}

/* 吹き出し */
.chat-message {
  margin-bottom: 10px;
  display: flex;
}
.chat-message.ai {
  justify-content: flex-start;
  align-items: flex-start;
}
.chat-message.user {
  justify-content: flex-end;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 20px;
  max-width: 75%;
  line-height: 1.5;
  word-break: break-word;
  font-size: 14px;
}
.chat-bubble.ai {
  background: rgba(232, 240, 254, 0.9);
  border: 1px solid #d0defc;
  color: #333;
}
.chat-bubble.user {
  background: #ff007f;
  color: #fff;
}

/* 入力エリア */
.chat-input {
  display: flex;
  border-top: 1px solid #ddd;
}
#chat-text {
  flex: 1;
  border: none;
  padding: 10px;
  outline: none;
  font-size: 14px;
}
#chat-send {
  background: #ff007f;
  color: white;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  transition: 0.2s;
}
#chat-send:hover {
  background: #d9006d;
}

/* 閉じるボタン */
#chat-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
}

/* ラボ先生アイコン */
.chat-message.ai img.labo-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  margin-right: 8px;
  background: #fff;
}

/* ラボ先生考え中アニメーション */
@keyframes laboThinking {
  0% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}
.labo-thinking {
  animation: laboThinking 1.4s ease-in-out infinite;
}

/* ============================
   モバイル最終版
============================ */
@media (max-width: 768px) {
  /* 半透明カード背景 */
  #prolabo-launcher {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 30px;
    padding: 8px 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    width: calc(100% - 40px);
    max-width: 380px;
    z-index: 9999;
  }

  /* 電話情報 */
  .phone-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    line-height: 1.3;
  }
  .phone-link {
    font-weight: bold;
    font-size: 14px;
    color: #ff007f;
    text-decoration: none;
  }
  .phone-hours {
    font-size: 11px;
    color: #555;
  }
  .phone-hours small {
    display: block;
    font-size: 10px;
    color: #777;
  }

  /* AIボタン */
  #prolabo-launcher button#chat-open {
    background: linear-gradient(135deg, #ff007f, #d9006d);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 12px; /* ← 少し小さく */
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(217, 0, 109, 0.35);
  }

  #prolabo-launcher button#chat-open img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 6px;
  }

  #prolabo-launcher .chat-open-text {
    font-size: 12px; /* 小さめ文字 */
  }
}

/* PCでは電話を非表示 */
@media (min-width: 769px) {
  #prolabo-launcher .phone-info {
    display: none;
  }
}

@media (max-width: 768px) {
  /* 電話情報 */
  .phone-info {
    display: flex;
    flex-direction: column;
    align-items: center; /* ← 中央揃えに変更 */
    text-align: center;  /* ← これも中央寄せ */
    line-height: 1.4;
  }

  .phone-link {
    font-weight: bold;
    font-size: 14px;
    color: #ff007f;
    text-decoration: none;
  }

  .phone-hours {
    font-size: 11px;
    color: #555;
  }

  .phone-hours small {
    display: block;
    font-size: 10px;
    color: #777;
  }
}
