/* 基本設定 */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #121212;
    color: #FFFFFF;
    margin: 0;
    padding: 0; /* 修正: 上下paddingを外し、ヘッダー/フッターは固定 */
    height: 100%;
    overflow: hidden; /* 全体でスクロールせず内部でスクロール */
}

html {
    height: 100%;
}

/* ヘッダー */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #1F1F1F;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 999;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  padding: 0 20px;
  box-sizing: border-box; /* 追加：paddingを含む幅の計算 */
}


header .logo {
  display: flex;
  gap: 10px;
  color: #E0E0E0;
}
header .logo .main-title {
  font-size: 1.5em;
  font-weight: bold;
  color: #E0E0E0;
}
header .logo .sub-title {
  font-size: 0.9em;
  font-weight: 400;
  color: #B0B0B0;
}

/* 初期状態 */
#header-nav {
    display: none;
}
/* openクラスが付与されたとき */
  #header-nav.open {
    display: flex;
    flex-direction: column;
    align-items: flex-end;     /* 右揃えなら flex-end など */
    width: 100%;
    padding: 10px 20px;
    box-sizing: border-box;    /* ★ これでパディング込みでwidthを計算 */
    position: absolute;
    top: 60px;
    left: 0;
    /* 右寄せするために left: auto; right: 0; にしてもOK */
    /* left: auto; right: 0; width: 80%; などでも可 */
    background-color: #1F1F1F;
    z-index: 1000;
  }
  
  #header-nav.open a {
    display: block;
    width: 100%;
    text-align: right;
  }
header nav a {
  text-decoration: none;
  color: #E0E0E0;
  font-weight: 500;
  transition: color 0.3s;
}
header nav a:hover {
  color: #FFD700;
}

/* メニューアイコン(ヘッダー右) */
.menu-toggle {
  /* 以下の absolute 配置で header 内に収める */
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #CB6847;
  font-size: 24px;
  z-index: 10000;
  padding: 8px;
  border-radius: 4px;
}


/* サイドバー初期状態：表示（オーバーレイ） */
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;               
  width: 240px;
  height: calc(100% - 60px);
  background-color: #333;
  padding: 10px 15px; /* 左右の隙間を設ける */
  box-sizing: border-box;
  transition: transform 0.3s ease; 
  transform: translateX(0);
  z-index: 999;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* トグルボタンを固定配置（初期はサイドバーが開いた状態を想定し、left:250pxなど） */
.sidebar-toggle {
  position: fixed;
  top: 100px; /* サイドバーの一覧と重ならないよう、適度に余裕をもつ */
  left: 250px; /* サイドバー幅240px + 10pxの余白 */
  z-index: 9999; 
  background: #444;
  color: #fff;
  border: none;
  font-size: 18px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: left 0.3s ease; /* アニメーション */
}

/* 閉じた状態 */
.sidebar.collapsed {
  transform: translateX(-240px);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.2em;
  color: #fff;
}

#new-conversation-btn, #conversation-refresh {
  background: #444;
  color: #fff;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s;
}

#new-conversation-btn:hover, #conversation-refresh:hover {
  background: #555;
}

#conversation-list {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
}

#conversation-list li {
  padding: 8px;
  border-bottom: 1px solid #444;
  cursor: pointer;
  border-radius: 4px;
}

#conversation-list li:hover {
  background-color: #444;
}

/* 更新ボタンを上に配置 */
#conversation-refresh {
  order: -1; /* 上側に移動 */
  margin-bottom: 10px;
}


/* メインチャット領域 */
.chat-main {
  position: absolute;
  top: 60px;
  left: 0;           /* サイドバーぶん動かさない */
  right: 0;
  bottom: 40px;
  overflow: hidden;
  /* 余白を付けず常に全幅表示したいならここを固定 */
  margin-left: 0;
}

/* チャットコンテナ */
.chat-container {
  position:relative;
  display:flex;
  flex-direction:column;
  width:100%;
  height:100%;
  box-sizing:border-box;
}

/* チャット表示領域 */
.chat-messages{
  position:absolute;          /* ← .chat-container 基準 */
  left:0; right:0;
  bottom:60px;               /* 入力欄までのマージン */
  max-height:50vh;           /* 高さ上限＝字幕風 */
  padding:0 20px 10px;       /* 下に少し余白 */
  overflow-y:auto;
  pointer-events:auto;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;  /* 最新行を下へ詰める */
  gap:6px;                   /* 行間 */
  z-index:6;                 /* 動画(0)＜メッセージ(6)＜モーダル等 */
  pointer-events:none;       /* クリック透過 */
  background:transparent;    /* 背景なしで動画が見える */
}
.chat-messages::-webkit-scrollbar{
  width:4px;
}
.message{
  margin:0;                  /* 上下余白を無くし 1 行化 */
  padding:8px 16px;
  border-radius:20px;
  font-size:1rem;
  line-height:1.3;
  max-width:80%;
  word-wrap:break-word;
  pointer-events:auto;       /* クリックは許可 */
  position: relative;
}
/* --- 共通部分はそのまま --- */
.message.user,
.message.bot {
  white-space: pre-wrap;
  word-break: break-word;

  max-height: 40vh;          /* 長文は 40 vh で頭打ち */
  overflow-y: overlay;       /* overlay ならバーが重なり表示＆溝は確保しない */
                              /* 未対応ブラウザは auto と同等に振る舞う */

  /* === デフォルトではスクロールバー非表示 === */
  scrollbar-width: none;           /* Firefox */
}
.message.user::-webkit-scrollbar,
.message.bot::-webkit-scrollbar {  /* Chrome / Edge / Safari */
  width: 0; height: 0;             /* 0 にすると非表示 */
}

/* === ホバーした時だけ細いバーを出す（お好み）=== */
/* .message.user:hover, */
.message.bot:hover {
  scrollbar-width: thin;           /* Firefox */
}
/* .message.user:hover::-webkit-scrollbar, */
.message.bot:hover::-webkit-scrollbar {
  width: 6px;
}
/* .message.user:hover::-webkit-scrollbar-thumb, */
.message.bot:hover::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.25);
  border-radius: 3px;
}

/* 音声ボタン重ね配置例 */
.text-to-audio-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: #CB6847;
  color: #fff;
  border: none;
  border-radius: 50%;
  padding: 6px;
  cursor: pointer;
  font-size: 1.2em;
  opacity: 0.8;
  pointer-events: auto;
}
.text-to-audio-btn:hover {
  opacity: 1;
}

/* 入力エリア */
.chat-input{
  position:absolute;          /* ← .chat-container 基準で固定 */
  left:0; right:0; bottom:0;  /* ページ最下部に張り付く */
  display:flex;
  gap:10px;
  padding:10px;
  background:rgba(31, 31, 31, 0.2);
  border:1px solid rgba(255, 255, 255, 0.2);
  z-index:7;                  /* メッセージ(6) より前面 */
  backdrop-filter:blur(8px);  /* 好みで薄いガラス効果 */
  border-radius:30px;
  box-shadow:0 4px 20px rgba(0, 0, 0, 0.3);
}
.chat-input textarea {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  color: #E0E0E0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  resize: none;
  height: 40px;
  padding: 8px;
  box-sizing: border-box;
  backdrop-filter: blur(4px);
}
.chat-input button {
  background: #CB6847;
  border: none;
  color: #fff;
  padding: 10px 15px;
  border-radius: 50%;
  cursor: pointer;
}

/* 音声読み上げボタン(固定非表示) */
#text-to-audio-button {
  display: none;
}

/* モーダル等 共通 */
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.5);
  z-index: 2000;
}
.modal-content {
  position: relative;
  background: #fff;
  color: #333;
  padding: 20px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  max-height: 80vh;
  overflow-y: auto;
  animation: popupFadeIn 0.3s ease-in-out;
  text-align: left;
}
.modal-content h2 {
  margin-bottom: 20px;
  font-size: 1.2em;
}
.modal-content input[type="file"] {
  display: block;
  margin: 0 auto 20px auto;
}
.modal-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}
.modal-buttons button {
  background-color: #CB6847;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

/* 右上の閉じるボタン */
.modal-close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #000;
}
.modal-close-button:hover {
  color: #666;
}
#file-list {
  list-style: none;
  padding-left: 0;
}
#file-list li {
  padding: 8px 0;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}
/* ポップアップ */
/* ───── 引用ポップアップ専用 ───── */
.popup-container{
  position:fixed; inset:0;
  display:none;                       /* JS で flex に切替 */
  justify-content:center;
  align-items:center;
  backdrop-filter:blur(2px);
  background:rgba(0,0,0,.45);
  z-index:2500;                       /* ほかのモーダルより前面に */
}

/* カード本体 */
.popup-card{
  max-width:min(620px,92vw);
  max-height:80vh;
  padding:24px 32px 28px;
  background:#fff;
  color:#222;
  border-radius:12px;
  box-shadow:0 8px 32px rgba(0,0,0,.25);
  overflow-y:auto;
  position:relative;
  animation:popupFadeIn .25s ease;
  font-size:15px;
  line-height:1.6;
}
/* 本文 */
.popup-body{ text-align: left; white-space:pre-wrap; }

/* 右上 ? ボタン */
.popup-close{
  position:absolute; inset:12px 12px auto auto;
  width:34px; height:34px;
  display:flex; justify-content:center; align-items:center;
  background:#F1F1F1;
  border:none;
  border-radius:50%;
  font-size:17px;
  cursor:pointer;
  transition:background .2s;
}
.popup-close:hover{ background:#E0E0E0; }

/* 旧 blue button を完全無効化 */
.close-popup{ display:none !important; }
.popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}
.popup {
  position: relative;
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  padding: 20px;
  max-width: 500px;
  width: 80%;
  text-align: center;
  z-index: 1001;
  animation: popupFadeIn 0.3s ease-in-out;
}
#popup-text {
  font-size: 16px;
  color: #333333;
  margin-bottom: 20px;
}
.close-popup {
  background-color: #007BFF;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.close-popup:hover {
  background-color: #0056b3;
}

/* ファイル詳細モーダルのベース */
.file-detail-modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
}
.file-detail-modal-content {
  position: relative;
  background: #fff;
  color: #333;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  animation: popupFadeIn 0.3s ease-in-out;
}
.detail-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #000;
  cursor: pointer;
}
.file-detail-text {
  white-space: pre-wrap;
  line-height: 1.4;
}
.file-detail-textarea {
  width: 100%;
  height: 400px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}
/* 会話履歴モーダル */
#history-modal.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0,0,0,0.5);
  z-index: 2000;
}
#history-modal .modal-content {
  background: #ffffff;
  color: #333;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  max-height: 80vh;
  overflow-y: auto;
}
#history-list {
  list-style: none;
  padding-left: 0;
  max-height: 70vh;
  overflow-y: auto;
}
#history-list li {
  margin-bottom: 8px;
}

/* ボタンが読み込み中のとき */
#send-button.loading, #record-button.loading {
  opacity: 0.7;
  cursor: not-allowed;
  position: relative;
}
#send-button.loading::after, #record-button.loading::after {
  content: "";
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 0.8s linear infinite;
  display: block;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
#record-button.loading::after {
  border-top-color: red;
}

/* タイピングインジケータ */
.typing-indicator {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  padding: 10px 15px;
  border-radius: 20px;
  background-color: #333333;
  color: #E0E0E0;
  margin-bottom: 15px;
  max-width: 80%;
  word-wrap: break-word;
  align-self: flex-start;
}
.bot-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #fff;
  animation: botTyping 1s infinite ease-in-out;
  display: inline-block;
}
.bot-typing-dot:nth-child(1) { animation-delay: 0s; }
.bot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.bot-typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* フッター固定 (会社名) */
#site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: #1f1f1f;
  color: #eee;
  text-align: center;
  line-height: 40px;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.5);
  z-index: 999;
}

.custom-file-upload {
  display: inline-block;
  padding: 8px 12px;
  cursor: pointer;
  background-color: #CB6847; /* 他のボタンと同色 */
  color: #fff;
  border-radius: 4px;
  text-align: center;
  transition: background-color 0.3s ease;
}

.custom-file-upload:hover {
  background-color: #A9543A;
}

#login-modal {
  z-index: 99999 !important; /* 競合が疑われる場合、!important を付ける */
}

/* モーダルのメインコンテンツ */
.login-modal-content {
  color: black;
  position: relative;
  width: 90%;
  max-width: 400px; /* モーダルの横幅 */
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  animation: loginModalFadeIn 0.3s ease; /* フェードイン演出用 */
}

/* タイトル */
.modal-title {
  margin-bottom: 20px;
  font-size: 1.4rem;
  text-align: center;
}

/* 閉じるボタン */
.modal-close-button {
  position: absolute;
  top: 10px; 
  right: 10px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}
.modal-close-button:hover {
  color: #333;
}

/* 入力フォーム */
.login-form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}
.login-form-group label {
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}
.login-form-group input {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
}
.login-form-group input:focus {
  border-color: #777;
}

/* ボタン行 */
.modal-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

/* ログインボタン */
.login-submit-btn {
  background: #CB6847; /* 例: 青緑系 */
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}
.login-submit-btn:hover {
  background: #CB6847;
}

/* ================================
   カスタムスクロールバー (グレー調)
================================ */
.chat-messages::-webkit-scrollbar,
.chat-input textarea::-webkit-scrollbar {
  width: 8px;
  background-color: #222;
}
.chat-messages::-webkit-scrollbar-thumb,
.chat-input textarea::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb:hover,
.chat-input textarea::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}
.chat-messages::-webkit-scrollbar-corner,
.chat-input textarea::-webkit-scrollbar-corner {
  background-color: #222;
}

/* スクロールバーのデザイン調整（Webkit系ブラウザ向け） */
::-webkit-scrollbar {
  width: 8px; /* スクロールバーの幅 */
}

::-webkit-scrollbar-track {
  background: #f1f1f1; /* スクロールバーの背景色 */
}

::-webkit-scrollbar-thumb {
  background: #bbb; /* スクロールバーの色 */
  border-radius: 4px; /* 丸みをつける */
}

::-webkit-scrollbar-thumb:hover {
  background: #999; /* ホバー時の色 */
}

/* ファイル一覧の削除ボタン */
.delete-file-btn {
  background: transparent;
  border: none;
  color: red;
  font-size: 1em;
  margin-left: 10px;
  cursor: pointer;
}

/* 録音中のスタイル */
#record-button.recording {
  background-color: #ff4136; /* 赤色 */
  animation: pulse 1.5s infinite;
}

/* ===== avatar video ===== */
.chat-container .avatar-container{   /* ← チャット内部だけに作用 */
  position:absolute;
  top:0; left:0; right:0; bottom:0;
  z-index:0;                 /* 背景層 */
  pointer-events:none;       /* クリック透過 */
  overflow:hidden;
  background:#ffffff;
}
#avatar-video{
  position:absolute;
  top:50%; left:50%;
  width:100%;
  height:100%;
  transform:translate(-50%,-50%);
  object-fit:contain;        /* PC はレターボックスで全体を表示 */
}

#confirm-media-upload-button { background:#CB6847;color:#fff;border:none;border-radius:4px;padding:8px 12px; }

/* === 引用リンク用 === */
.citations-container{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:6px;
}
.citation{
  background:#444;
  color:#fff;
  padding:4px 8px;
  border-radius:4px;
  font-size:0.85rem;
  cursor:pointer;
  white-space:nowrap;
}

/* ==== ナレッジ追加モーダル ==== */
#knowledge-modal .modal-content{
  max-width: 600px;          /* ? やや広めに */
  width: 95%;
}

#knowledge-modal label{
  font-weight: 600;
  margin: 8px 0 4px;
  display:block;
}

#knowledge-modal input[type="text"],
#knowledge-modal textarea{
  width: 100%;               /* ? フル幅に */
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fafafa;
  color: #333;
  font-size: .95rem;
}

#knowledge-modal #kn-submit-btn{
  background:#CB6847;
  color:#fff;
  border:none;
  padding:8px 14px;
  border-radius:4px;
  cursor:pointer;
}
#knowledge-modal #kn-submit-btn:hover{
  background:#A9543A;
}

.token-badge{
  background:#ffb400;
  color:#000;
  font-weight:700;
  padding:2px 6px;
  border-radius:6px;
  margin-left:6px;
}

.icon-button {
    background: none;
    border: none;
    color: #CB6847;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
}

.icon-button:hover {
    color: #E08E70;
}

/* video#avatar-video {
  max-width:100%;
  max-height:100%;
  object-fit:cover;
} */

/* 点滅アニメーション */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

/* アニメーション */
@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes spin {
  0% { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}
@keyframes botTyping {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* アニメーション (フェードイン) */
@keyframes loginModalFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1);   }
}

/* 768px以下（モバイル） */
@media (max-width: 768px) {
  header nav {
    display: none;
  }

  header .menu-toggle {
    display: block;
    cursor: pointer;
  }

  .icon-button {
    font-size: 16px;
    padding: 6px;
    margin-right: 100px;
  }

  /* サイドバーをデフォルト非表示に */
  #sidebar {
    width: 100%;
    height: calc(100% - 60px);
    top: 60px;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    padding-top: 50px; /* トグルボタンのスペースを確保 */
  }

  /* collapsedクラスでサイドバーを表示 */
  #sidebar.collapsed {
    transform: translateX(0);
  }

  /* トグルボタンを常に固定位置に配置 */
  .sidebar-toggle {
    position: fixed;
    top: 70px;
    left: 10px;
    z-index: 1000; /* sidebarよりも前面に */
  }

  /* 更新ボタンの位置調整 */
  #conversation-refresh {
    margin-top: 40px; /* トグルボタンと被らないよう調整 */
  }

  /* アバター表示の最適化 */
  .chat-container .avatar-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #avatar-video {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: auto;
    height: 70vh;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
  }

  .chat-messages {
    max-height: 50vh;
    overflow-y: auto;
  }

  .message{
    line-height: 1.35;         /* 好みで 1.3?1.5 程度 */
  }

  .message.bot {
    max-height: 25vh;
  } 

  /* メインチャット領域をフル幅に調整 */
  .chat-main {
    left: 0;
    right: 0;
    top: 60px;
    bottom: 40px;
    margin-left: 0;
  }
}



/* 769px以上（PC） */
@media (min-width: 769px) {
  /* ヘッダー全体をflexで横並びに */
  header {
    display: flex;         /* すでにfixed等は付いていると思うので省略 */
    align-items: center;   /* 高さ揃え */
    justify-content: flex-start;
    position: fixed;       /* すでにfixedなら重複OK */
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    /* もともとのヘッダー設定があればそのまま書き換えor上書き */
  }

  /* ナビを右寄せ表示：flex＆margin-left: auto; */
  #header-nav {
    display: flex !important;     /* mobileのdisplay: noneを上書き */
    flex-direction: row;          /* 横並び */
    align-items: center;
    gap: 20px;                    /* リンク間の隙間 */
    position: static;             /* position: absolute; を解除 */
    width: auto;                  /* 100%ではなく必要最小限 */
    margin-left: auto;            /* これで右寄せ */
    background: none;             /* 背景が不要なら透過に */
  }

  /* メニューアイコンは非表示 */
  .menu-toggle {
    display: none;
  }
}


/* ================================
   質問候補ボタンのスタイル (グレー系統)
================================
.suggested-questions{
  position:absolute;
  left:0; right:0; bottom:60px;
  padding:10px;
  background:rgba(47,47,47,0.1);
  display:flex; flex-wrap:wrap; gap:8px;
  z-index:7;
  backdrop-filter:blur(2px);
}
 */
.suggested-questions{
  display:none;
}
.suggested-questions button {
  background: #444;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.3s;
}
.suggested-questions button:hover {
  background: #555;
}

/* ==== 統一チャットバブルスタイル ==== */
.message{
  background: rgba(255, 255, 255, 0.5) !important;/* 白背景 */
  color:#000 !important;               /* 黒文字 */
  display:inline-block;                /* 内容幅に合わせて可変 */
  max-width:60%;                       /* 長文は折り返し */
  backdrop-filter: blur(2px);     /* オプション：下の動画がボケて読みやすく */
}

/* 位置だけ変える */
.message.user   { align-self:flex-end; }
.message.bot,
.message.system { align-self:flex-start; }

.chat-input textarea,
.chat-input input[type="text"]{
  font-size:16px;          /* iOS がズームしない安全域 */
  line-height:1.4;
}
