* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 99vw;
  min-height: 97vh;
  background: #ffffff;
  color: #222;
  font-family: "FK Grotesk", "IBM Plex Sans", "Inter", "Roboto", "Noto Sans JP", sans-serif;
}

/* ヘッダー */
.history-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid #eee;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.back-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.back-btn:hover { background: #f3f4f6; }

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: #222;
}

/* リストエリア */
.history-list {
  max-width: 800px;
  margin: 16px auto;
  padding: 0 16px;
}

/* 各履歴アイテム */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: #222;
  transition: background 0.15s;
  gap: 16px;
  border-radius: 8px;
}
.history-item:hover { background: #f9fafb; }

.history-title {
  font-size: 15px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #222;
}

.history-date {
  font-size: 13px;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 空の場合 */
.empty-message {
  text-align: center;
  color: #999;
  padding: 60px 20px;
  font-size: 15px;
}

/* ==============================
   会話詳細エリア
============================== */
.conversation-outer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 65vw;
  max-width: 900px;
  background: rgba(32,32,32);
  color: #fff;
  border-radius: 22px;
  box-shadow: 5px 5px 5px 0px rgba(0,0,0,0.4);
  bottom: 5vh;
  top: 80px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conversation-header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.conv-back-btn {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.conv-back-btn:hover { color: #fff; }

.conv-title {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-scroll {
  flex: 1;
  overflow-y: auto;
}

/* スクロールバー（logAreaScroll と同じデザイン） */
.conversation-scroll::-webkit-scrollbar {
  width: 7px;
  background: rgba(32,32,32);
}
.conversation-scroll::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 9px;
  border: none;
}

/* 背景モーダルを最前面に */
#background-modal {
  z-index: 1200 !important;
}

.conversation-scroll .logText {
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  font-size: var(--chattee-font-size, 18px);
}

/* タイムスタンプを白背景用に上書き不要（ダーク背景のまま） */

/* パッドサイズ設定（setting.htmlの大・中・小と連動） */
.logarea-large  .conversation-outer { top: 10vh; }
.logarea-medium .conversation-outer { top: 40vh; }
.logarea-small  .conversation-outer { top: 70vh; }

/* スマホ縦持ち */
@media (max-width: 767px) {
  .conversation-outer {
    width: 90vw;
    max-width: 500px;
  }
  .logarea-large  .conversation-outer { top: 10vh; }
  .logarea-medium .conversation-outer { top: 40vh; }
  .logarea-small  .conversation-outer { top: 70vh; }
}

/* ==============================
   ローディング
============================== */
/* ローディング */
.loading-message {
  text-align: center;
  color: #999;
  padding: 60px 20px;
  font-size: 15px;
}
