/* =========================================================
   1. 右下フローティングチャット（吹き出し）本体のデザイン
========================================================= */
#custom-chat-container {
  position: fixed;
  bottom: 75px;
  right: 20px;
  z-index: 9999;
  display: inline-block;
}

#custom-chat-bubble {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: fit-content;
  max-width: 180px;
  box-sizing: border-box;
  height: auto;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  background-color: #005bac;
  opacity: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
}

#custom-chat-bubble:hover {
  transform: scale(1.03);
  opacity: 1;
}

#custom-chat-bubble::after {
  content: "";
  position: absolute;
  right: -9px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #005bac;
}

.chat-text {
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  letter-spacing: 0.5px;
  user-select: none;
  line-height: 1.0;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.chat-icon {
  color: #ffffff;
  font-size: 18px;
  line-height: 1 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -2px !important;
}

.chat-icon i {
  line-height: 1 !important;
  vertical-align: top;
}

#close-bubble {
  position: absolute;
  top: -12px;
  right: -10px;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  color: #888888;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 2;
}

#close-bubble:hover {
  color: #444444;
}

/* =========================================================
   2. 吹き出し専用 同意ポップアップ（モーダル）のデザイン
========================================================= */
#bubble-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

#bubble-modal-window {
  background-color: #ffffff;
  width: 90%;
  max-width: 520px;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  padding: 24px;
  box-sizing: border-box;
  animation: chatModalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bubble-modal-header {
  font-size: 16px;
  font-weight: bold;
  color: #005bac;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.bubble-modal-body {
  font-size: 13px;
  line-height: 1.6;
  color: #444444;
  max-height: 240px;
  overflow-y: auto;
  background-color: #fafafa;
  border: 1px solid #e5e5e5;
  padding: 14px;
  border-radius: 6px;
  box-sizing: border-box;
}

.bubble-modal-body p {
  margin: 0 0 16px 0;
  text-align: left;
}

.bubble-modal-body p:last-child {
  margin-bottom: 0;
}

.bubble-modal-body strong {
  color: #111111;
}

.bubble-modal-body a {
  color: #005bac;
  font-weight: bold;
  text-decoration: underline;
}

.bubble-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid #f0f0f0;
  padding-top: 16px;
}

#bubble-cancel-btn {
  background: none;
  border: none;
  padding: 0 16px;
  height: 38px;
  font-size: 13px;
  color: #666666;
  cursor: pointer;
  border-radius: 6px;
}

#bubble-cancel-btn:hover {
  background-color: #f5f5f5;
}

#bubble-agree-btn {
  background-color: #005bac;
  border: none;
  padding: 0 20px;
  height: 38px;
  font-size: 13px;
  font-weight: bold;
  color: #ffffff;
  cursor: pointer;
  border-radius: 19px;
  box-shadow: 0 2px 6px rgba(0, 91, 172, 0.2);
  transition: background-color 0.2s;
  white-space: nowrap;
}

#bubble-agree-btn:hover {
  background-color: #004481;
}

@keyframes chatModalFadeIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 480px) {
  .bubble-modal-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
  }

  #bubble-agree-btn {
    height: 44px;
    font-size: 14px;
    border-radius: 22px;
  }

  #bubble-cancel-btn {
    height: 40px;
  }
}