/* チャットUI全体 */
.chat-ui-container {
  border: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  font-family: Arial, sans-serif;
  margin: 20px 5px;
  position: relative;
  left: 50%;
  transform: translate(-50%, 0);
}
.chat-ui-header {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #ccc;
}
.chat-ui-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* justify-content は常に flex-start に */
  justify-content: flex-start;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
  box-sizing: border-box;
}
/* 下詰めモード時：最初のラッパーを自動マージンで下押し */
.chat-ui-messages.stack-bottom > .chat-message-wrapper:first-child {
  margin-top: auto;
}
/* 各ラッパーがスクロール対象になるように縮まない */
.chat-message-wrapper {
  flex-shrink: 0;
  margin-right: 20px;
}
/* 発言枠（バブル）は内容に合わせて幅を制限 */
.chat-ui-message {
  max-width: 80%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}
/* ユーザー側の発言枠：右寄せ、アイコンは右側 */
.chat-ui-message.user {
  margin-left: auto;
  flex-direction: row-reverse;
}
/* 相手側の発言枠：左寄せ、アイコンは左側 */
.chat-ui-message.other {
  margin-right: auto;
  flex-direction: row;
}
/* テキスト部分のコンテナ（バブル内部の背景色適用用） */
.chat-message-content {
  padding: 8px;
  border-radius: 10px;
  flex: 1;
  text-align: left;
}
/* 発言日時（バブルの外側上部に表示） */
.chat-ui-meta {
  font-size: 0.8em;
  margin-top: 4px;
  margin-bottom: 4px;
  color: #fff;
}
/* メッセージ内のアイコン */
.chat-message-icon {
  width: 40px;
  height: 40px;
  object-fit: cover;
  margin: 0 5px;
}
/* 翻訳文用スタイル */
.chat-translation {
  margin-top: 8px;
}
.chat-translation-hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 8px 0 4px;
}
/* 全体枠を消すモード */
.chat-ui-container.no-frame {
  border: none;               /* 枠線を消す */
  background: transparent;    /* 背景を透明に */
  box-shadow: none;           /* 影を消す */
  padding: 0;                 /* 余白も消す */
}

/* ヘッダー（タイトル）も非表示に */
.chat-ui-container.no-frame .chat-ui-header {
  display: none;
}

/* メッセージ領域も背景／パディングをクリア */
.chat-ui-container.no-frame .chat-ui-messages {
  background: transparent;
  padding: 0;
}
