body {
  font-family: "Arial", sans-serif;
  background-color: #f0f0f0;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

p {
  padding: 0;
  margin: 0;
}

.chat-container {
  width: 100%;
  max-width: 1000px;
  height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chat-box {
  width: 100%;
  height: 100%;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chat-messages {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
  background-color: rgb(4 101 180 / 60%);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.message {
  display: flex;
  align-items: center; /* アイコンとテキストを中央揃え */
  margin-bottom: 10px;
  padding: 15px;
  border-radius: 10px;
  max-width: fit-content; /* テキストの長さに応じた幅にする */
  min-width: 120px; /* 最小幅を設定 */
  word-wrap: break-word;
}

/* 右側に表示されるメッセージ（自分）のスタイル */
.sent {
  background-color: #dcf8c6; /* 明るい緑色 */
  margin-left: auto;
}

/* 左側に表示されるメッセージ（AI）のスタイル */
.received {
  background-color: white;
  margin-right: auto;
}

.time {
  font-size: 0.8rem;
  color: gray;
  margin-top: 10px;
}

.chat-input {
  display: flex;
  padding: 10px;
  background-color: #f9f9f9;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  flex-wrap: wrap; /* ★追加: 幅が足りない場合に折り返すようにする */
  gap: 8px; /* ★追加: 要素間のスペースを均等に設定 */
}

.chat-input input {
  flex-grow: 1;
  border: none;
  padding: 10px;
  font-size: 1rem;
  border-radius: 5px;
  /* margin-right: 10px;  ← gapプロパティでスペースを管理するため不要にします */
  background-color: #f1f1f1;
  min-width: 150px; /* ★追加: 入力欄がこれ以上は潰れないように最小幅を指定 */
}

.chat-input input:focus {
  outline: none;
}

.chat-input .submit-button {
  background-color: #0465b2;
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
}

.chat-input .submit-button:hover {
  background-color: #0464b2da;
}

.message-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin-right: 12px;
}

.choice-button {
  padding: 10px 20px;
  border: none;
  background-color: #fff;
  color: #0465b2;
  cursor: pointer;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
}

.choice-button:hover {
  background-color: #eee;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.link-button {
  background-color: #0465b2;
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
}

.link-button:hover {
  background-color: #0464b2da;
}

button.reset-button {
  color: #0465b2;
  border: none;
  padding: 10px 15px;
  font-size: 0.9em;
  border-radius: 5px;
  cursor: pointer;
  margin-left: 10px;
}

button.reset-button:hover {
  color: #0464b2da;
}

/* 関連ページセクションのスタイル */
.sources {
  font-size: 0.8rem;
  margin-top: 10px;
  padding: 10px;
  background-color: #f0f8ff; /* 薄い青色 */
  border-radius: 5px;
}

.sources ul {
  list-style-type: disc;
  padding-left: 20px;
  margin: 5px 0 0 0;
}

.sources a {
  color: #0056b3; /* 濃い青色 */
  text-decoration: underline;
}

.sources a:hover {
  color: #003d80; /* ホバー時さらに濃い青色 */
}

.disclaimer-text {
  font-size: 0.75rem; /* 12px */
  color: #6b7280; /* やや薄いグレー */
  text-align: center;
  padding: 8px 10px 4px 10px;
  margin: 0;
}

.disclaimer-text a {
  color: #0056b3; /* リンクの色を少し濃くする */
  text-decoration: underline; /* 下線を引く */
  font-weight: bold; /* 少し太字にする */
}

.disclaimer-text a:hover {
  opacity: 0.8; /* マウスを乗せたときに少し薄くする */
}

/* AIの注意書き専用のスタイル */
.disclaimer-ai {
  font-size: 0.85rem; /* 少し小さめの文字 */
  color: #4a5568; /* 落ち着いたグレー系の色 */
  background-color: #f7fafc; /* 薄い背景色 */
  border: 1px solid #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
}
