/* ===============================
   AI Chat Section
================================ */

.ai-chat-wrapper {
  margin: 40px auto 56px;
  padding: 24px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.ai-chat-header h2 {
  margin: 0 0 8px;
  font-size: 20px;
  text-align: center;
  border-left: none;
}

.ai-chat-sub {
  margin: 0 0 16px;
  color: #555;
  font-size: 14px;
  text-align: center;
}

.ai-chat-box {
  background: #eef2ff;
  border-radius: 10px;
  padding: 16px;
  overflow: visible;
}

/* チャット表示 */
.chat-area {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
  margin-bottom: 12px;
}

/* 吹き出し */
.message {
  max-width: 75%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  /* white-space: pre-wrap; */
  line-height: 1.5;
}

/* コードブロックだけ pre-wrap を許可 */
.message pre {
  white-space: pre;
}

/* Markdown の <p> はデフォルトでマージンが大きいので、チャット用途では詰める */
.message p {
  margin: 0 0 0.6em;
}

.message p:last-child {
  margin-bottom: 0;
}

.message.user {
  margin-left: auto;
  background: #2563eb;
  color: #fff;
}

.message.assistant {
  margin-right: auto;
  background: #fff;
  border: 1px solid #ddd;
}

/* 入力エリア */
.chat-input {
  display: flex;
  gap: 8px;
}

.chat-input textarea {
  flex: 1;
  resize: none;
  padding: 8px;
  font-size: 14px;
}

.chat-input button {
  width: 80px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* 下部アクション */
.chat-actions {
  display: none;
  margin-top: 12px;
  text-align: right;
}

.copy-btn {
  font-size: 12px;
  background: transparent;
  border: none;
  color: #2563eb;
  cursor: pointer;
}

.ai-chat-wrapper {
  overflow: visible;
}



/* ===============================
   Markdown code block
================================ */

.message pre {
  background: #0f172a;       /* ダーク背景 */
  color: #e5e7eb;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 13px;
}

.message code {
  font-family: Consolas, Monaco, monospace;
}

.message pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* インラインコード */
.message p code {
  background: #e5e7eb;
  color: #111;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 13px;
}

/* 営業 */
.assistant-support {
  margin: 6px 0 14px;
  font-size: 12px;
  color: #555;
}

.assistant-support a {
  color: #2563eb;
  text-decoration: underline;
}
