:root {
  --base: #f8f4f0;
  --text: #4b3f2f;
  --accent: #a38b6d;
  --main: #3c2f25;
  --button-bg: #eae6df;
  --white: #ffffff;
  --shadow: rgba(0, 0, 0, 0.1);
}

/* 全体レイアウト */
body {
  background-color: var(--base);
  font-family: 'Noto Serif JP', 'Yu Mincho', Georgia, serif;
  color: var(--text);
  overscroll-behavior: none;
}


/* 挨拶文 */
.greeting {
  font-size: 18px;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* チャットオプションボタン */
.chat-options {
  margin-bottom: 24px;
}
.chat-options button {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 12px 16px;
  font-size: 16px;
  background-color: var(--button-bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-family: 'Noto Serif JP', serif;
}
.chat-options button:hover {
  background-color: var(--accent);
  color: var(--white);
}

/* 入力フォームセクション */
.form-section {
  background: var(--white);
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 0 4px var(--shadow);
}
input,
textarea,
select {
  width: calc(100% - 16px);
  margin-bottom: 1em;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  font-family: 'Noto Serif JP', serif;
  background-color: #fff;
  color: var(--text);
}
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 4px var(--accent);
}

/* チャットトリガー */
.chat-trigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background-color: var(--accent);
  color: #fff;
  padding: 14px 22px;
  border: none;
  border-radius: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 9999;
  font-size: 16px;
  font-family: 'Noto Serif JP', serif;
  transition: all 0.3s ease;
}
.chat-trigger:hover {
  transform: translateY(-2px);
  background-color: var(--main);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
#chatTrigger {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* チャットウィンドウ */
.chat-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 360px;
  max-height: 80vh;
  overflow: auto;
  background-color: var(--base);
  border-radius: 16px;
  box-shadow: 0 0 16px rgba(0,0,0,0.2);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  font-family: 'Noto Serif JP', serif;
}
.chat-header {
  position: relative;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  padding: 12px 48px 18px 12px;
}
.chat-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #555;
  font-size: 28px;
  cursor: pointer;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.message {
  text-align: left;
  max-width: 300px;
  font-size: 16px;
  line-height: 1.6;
  color: #3a2f20;
  margin: 8px 0;
  padding-left: 4px;
}

/* 選択肢ボタン */
.options {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.options button {
  background-color: var(--button-bg);
  color: var(--text);
  border: none;
  margin: 6px 0;
  padding: 12px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 15px;
  font-family: 'Noto Serif JP', serif;
  text-align: center;
  transition: background-color 0.3s ease;
}
.options button:hover {
  background-color: var(--accent);
  color: white;
}

/* 送信ボタン */
.send-btn,
.submit-btn {
  background-color: var(--accent);
  color: white;
  font-family: 'Noto Serif JP', serif;
  font-weight: bold;
  border-radius: 28px;
  padding: 12px 20px;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.send-btn:hover,
.submit-btn:hover {
  background-color: var(--main);
}

/* 戻るボタン */
.back-btn {
  background-color: transparent;
  border: none;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 1em;
  cursor: pointer;
  font-family: 'Noto Serif JP', serif;
  text-align: left;
}
.back-btn:hover {
  text-decoration: underline;
}

/* メッセージ表示 */
.response-msg {
  margin-top: 12px;
  font-size: 14px;
  color: #3c3c3c;
  font-family: 'Noto Serif JP', serif;
}
.error-msg {
  color: #b40000;
  font-size: 13px;
  margin-top: 8px;
  font-family: 'Noto Serif JP', serif;
}

/* モバイル対応 */
@media screen and (max-width: 600px) {
  .chat-container {
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .chat-log {
    padding: 12px;
    scroll-padding-bottom: 60px;
    flex: 1;
    overflow-y: auto;
  }

  .chat-log::after {
    content: "";
    display: block;
    height: 60px;
  }

  input,
  textarea {
    font-size: 16px;
  }

  .response-msg {
    max-width: 100%;
    font-size: 14px;
  }

  body {
    padding: 8px; /* ← 16px → 8px に詰める */
  }

  .content-box {
    padding: 10px; /* ← 16px → 10px に詰める */
    margin-bottom: 8px; /* ← 下部余白を減らす */
  }
}
