.container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  background-color: #f4f4f9;
  min-width: 300px;
  min-height: 500px;
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 140%;
  color: #333;
}

.chat-container {
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  border-radius: 8px;
  overflow-x: hidden;
  overflow-y: hidden;
  min-width: 300px;
  min-height: 500px;
  margin: 0 auto;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.chat-box {
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow: hidden;
  position: relative;
}

.messages {
  flex-grow: 0.95;
  flex-shrink: 1;
  flex-basis: 0%;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
}

.message {
  position: relative;
  word-wrap: break-word;
  margin: 5px 0;
  padding: 5px 10px;
  border-radius: 10px;
  max-width: 80%;
}

.user-message {
  background-color: #1f8ef6;
  color: #333;
  align-self: flex-end;
}

.message a {
  color: #025fae;
  text-decoration-color: #025fae;
}

.bot-message {
  background-color: #f5f5f5;
  color: #333;
  align-self: flex-start;
}

.input-container {
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.input-wrapper {
  position: relative;
}

.text-area {
  border: none;
  width: 95%;
  padding: 10px;
  resize: none;
  overflow-y: auto;
  max-height: 150px;
  font-size: 14px;
  line-height: 140%;
  color: #333;
}

.text-area:focus {
  outline: none;
}

.button-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.clear-button-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 8px;
}

.clear-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background-color: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #4b5563;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-button:hover {
  background-color: #f3f4f6;
  color: #1f2937;
  border-color: #d1d5db;
}

.clear-button svg {
  width: 16px;
  height: 16px;
}

.send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-color: #141382;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  color: #fff;
  border-radius: 16px;
}

.send-button svg {
  width: 32px;
  height: 32px;
}

.send-button:hover {
  background-color: #0056b3;
}

.message-content h1,
.message-content h2,
.message-content h3 {
  margin: 0;
}

.message-content p {
  margin: 0;
}

.message-content ul {
  padding-left: 20px;
  margin: 0;
}

/* ローディング表示 */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  z-index: 100;
}

.loading-spinner-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 40px;
  height: 40px;
  animation: rotate 2s linear infinite;
}

.spinner .path {
  stroke: #333;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }

  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }

  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

.feedback-container {
  display: flex;
  flex-direction: column;
  margin: 24px 0 12px 0;
  padding: 0 4px;
}

.please-feedback-text {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
  padding: 0 4px;
}

.feedback-buttons-wrapper {
  display: flex;
  max-width: 100%;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-button {
  display: flex;
  height: 44px;
  padding: 2px 16px;
  justify-content: center;
  align-items: center;
  gap: 2px;
  border-radius: 24px;
  background: #025fae;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.feedback-button:hover {
  background: #004098;
}

.feedback-selected {
  display: flex;
  padding: 0;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.feedback-tag {
  display: flex;
  padding: 8px;
  justify-content: center;
  align-items: center;
  gap: 4px;
  border-radius: 3px;
  background: #cee7fe;
  color: #333;
  font-size: 14px;
}

.feedback-message-container {
  margin-top: 12px;
  width: 100%;
}

.feedback-message-box {
  max-width: 80%;
  align-self: flex-start;
}

/* メッセージ直下に表示するローディング（インライン） */
.loading-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

/* ============================
テーブル関連（修正版）
============================ */

.tables-external-container {
  margin-top: 24px;
  width: 100%;
  max-width: 100%;
}

.table-wrapper-external {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 100%;
}

/* 上部スクロールバー */
.table-scroll-wrapper-top {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  margin-bottom: 8px;
}

.table-scroll-content {
  height: 1px;
}

/* テーブル全体スクロール制御 */
.table-container-external {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 4px;
  background: #fff;
  width: 100%;
  max-width: 100%;
}

/* テーブル本体 */
.table-container-external table {
  border-collapse: collapse;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

/* セル */
.table-container-external th,
.table-container-external td {
  border: 1px solid #d9d9e0;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-wrap: break-word;
  min-width: 80px;
  max-width: 400px;
  box-sizing: border-box;
}

/* ヘッダー */
.table-container-external th {
  background: #e8e8e8;
  font-weight: bold;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* キャプション */
.table-container-external caption {
  font-weight: bold;
  font-size: 16px;
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  border: none;
  caption-side: top;
}

/* コピー関連 */
.copy-button-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  transition: opacity 0.2s ease;
}

.copy-button:hover {
  opacity: 0.7;
}

.copied-message {
  display: inline-block;
  font-size: 14px;
  color: #333;
  font-weight: 500;
  animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* Tooltip 共通 */
.has-tooltip {
  position: relative;
  display: inline-flex;
}

.tooltip-box {
  position: absolute;
  z-index: 10;
  bottom: calc(100% + 8px);
  left: 0;
  display: flex;
  padding: 8px 12px;
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
  white-space: nowrap;
}

.tooltip-box::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 14px;
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(17, 17, 17, 0.92) transparent transparent transparent;
}

.has-tooltip:hover .tooltip-box,
.has-tooltip:focus-within .tooltip-box {
  opacity: 1;
  visibility: visible;
}

.has-tooltip.hide-tooltip .tooltip-box {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* 回答準備中メッセージ（… が順番に点灯するアニメーション） */
.message.bot-message.loading-message .loading-text {
  display: inline-block;
}

.message.bot-message.loading-message .loading-text .dot {
  display: inline-block;
  animation: dotAnimation 1.4s infinite;
  opacity: 0;
}

.message.bot-message.loading-message .loading-text .dot:nth-of-type(2) {
  animation-delay: 0.2s;
}

.message.bot-message.loading-message .loading-text .dot:nth-of-type(3) {
  animation-delay: 0.4s;
}

@keyframes dotAnimation {
  0% {
    opacity: 0;
  }

  40% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}
/* スクロール問題解決---------------------------- */
/* * {
  overscroll-behavior: none;
} */
 #chatbot-container,
.messages {
  overscroll-behavior: contain;
}
/* スクロール問題解決---------------------------- */

/* チャットボタンのスタイル */
#chat-button {
  border-radius: 40px;
  border: 0.4px solid #0A1464;
  background: #fff;
  box-shadow: 0 5px 24px 0 rgba(0, 0, 0, 0.20);

  display: flex;
  padding: 16px 24px;
  justify-content: center;
  align-items: center;
  gap: 8px;

  opacity: 1;

  position: fixed;
  bottom: 16px;
  right: 8px;
  transition: bottom .2s ease;
}
/* ここだけオリジナル ------------------------*/
/* footer_bnr 表示中だけ上に逃がす */
body.has-footer-bnr #chat-button {
  bottom: calc(20px + var(--footer-bnr-offset, 0px));
  bottom:100px
}
@media screen and (max-width: 600px) {
  #chat-button{display: none;}
}
/* ここだけオリジナル END ------------------------*/

#chat-button:hover {
  opacity: 1;
}

#chat-button img {
  width: 48px;
  height: 48px;
  display: block;
}

#chat-button p {
  font-family: "Noto Sans JP";
  font-size: 20px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.7px;
  color: #0A1464;
  text-align: left;
}

#chat-button p span {
  font-size: 16px;
  line-height: 1.6;
  display: block;
}

/* チャットボットのコンテナスタイル */
#chatbot-container {
  background-color: white;
  border: 1px solid #cdcdcd;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
  padding: 0 0 26px;

  min-width: 300px;
  min-height: 400px;
  width: 40%;
  height: 88%;

  display: none;
  resize: both;

  position: fixed;
  bottom: 16px;
  right: 8px;
  z-index: 2000;
  overflow: hidden;
}

/* チャットボットのドラッグハンドルのスタイル */
.drag-handle {
  background-color: #f2f2f2;
  border-bottom: 1px solid #ccc;

  padding: 16px 36px 16px 16px;

  width: 100%;
  min-height: 30px;

  font-weight: 700;
  font-size: 16px;
  line-height: 1.4;

  display: flex;
  align-items: center;
  cursor: move;

  position: relative;
}

#chatbot-hide-btn {
  width: 16px;
  height: auto;
  display: block;

  cursor: pointer;

  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
}

div.chatbot__resizer {
  position: absolute;
  background: transparent;
  z-index: 10;
}

div.chatbot__resizer--top,
div.chatbot__resizer--bottom,
div.chatbot__resizer--left,
div.chatbot__resizer--right {
  width: 100%;
  height: 100%;
}

div.chatbot__resizer--top,
div.chatbot__resizer--bottom {
  cursor: ns-resize;
}

div.chatbot__resizer--left,
div.chatbot__resizer--right {
  cursor: ew-resize;
}

div.chatbot__resizer--top {
  top: -5px;
  left: 0;
  height: 10px;
}

div.chatbot__resizer--bottom {
  bottom: -5px;
  left: 0;
  height: 10px;
}

div.chatbot__resizer--left {
  left: -5px;
  top: 0;
  width: 10px;
}

div.chatbot__resizer--right {
  right: -5px;
  top: 0;
  width: 10px;
}

div.chatbot__resizer--tl,
div.chatbot__resizer--tr,
div.chatbot__resizer--bl,
div.chatbot__resizer--br {
  background: transparent;
  width: 15px;
  height: 15px;
}

div.chatbot__resizer--tl,
div.chatbot__resizer--br {
  cursor: nwse-resize;
}

div.chatbot__resizer--tr,
div.chatbot__resizer--bl {
  cursor: nesw-resize;
}

div.chatbot__resizer--tl {
  top: -8px;
  left: -8px;
}

div.chatbot__resizer--tr {
  top: -8px;
  right: -8px;
}

div.chatbot__resizer--bl {
  bottom: -8px;
  left: -8px;
}

div.chatbot__resizer--br {
  bottom: -8px;
  right: -8px;
}

/* レスポンシブ対応 */
@media screen and (max-width: 600px) {
  #chatbot-container {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
    resize: none;
    /* モバイル表示時はリサイズを無効化 */
  }
}

.sideNav {
  display: none;
}