﻿/* 全体 */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  /* 既存の height: 100% を、最新のブラウザ対応（キーボード対応）として100dvhに */
  height: 100dvh; 
  height: 100vh; /* フォールバック */
  overflow: hidden;
  background: transparent;
  font-family: "Roboto", "Noto Sans JP", sans-serif;
}

/* チャット枠 */
.chat-wrap {
  width: 100%;
  height: 100%;
      max-height: 100vh; /* キーボード出現時に縮むことを許容 */
  display: flex;
  flex-direction: column;
  box-sizing: border-box;

  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
}

/* ヘッダー */
.chat-head {
  background: rgba(103, 193, 159, 0.9);
  color: #fff;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.6;
  padding: 12px;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 閉じるボタン */
.close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: auto;
}

/* FAQボタン群 */
.faq-buttons {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-top: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(4px);
}
.faq {
  flex: 1;
  padding: 6px 8px;
  font-size: 13px;
  border: 0;
  border-radius: 14px;
  background: #e5e5ea;
  cursor: pointer;
}

/* ログ */
.chat-log {
    flex: 1 1 0%; /* Flex-grow, Flex-shrink, Flex-basis: ログ領域を可能な限り縮小し、スペースを占有 */
    min-height: 0; /* Flexboxコンテナがオーバーフローしないように最小高さを0に設定 */
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}


/* 吹き出し */
.msg {
  display: inline-block;
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.6;
  word-break: break-word;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Bot吹き出し */
.msg.bot {
  background: rgba(255, 255, 255, 0.85);
  color: #000;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

/* User吹き出し */
.msg.user {
  background: rgba(103, 193, 159, 0.9);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* 入力エリア */
.chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.4);

  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  height: 80px;
  flex-shrink: 0;
  align-items: center;
}

/* 入力欄 */
.chat-input textarea {
  flex: 1 1 auto;
  height: 60px !important;
  max-height: 60px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 20px;
  resize: none;
  box-sizing: border-box;
  font-size: 14px;
  background: rgba(255,255,255,0.8);
}

/* ボタン */
button {
  padding: 8px 14px;
  border: 0;
  border-radius: 20px;
  background: #67c19f;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* スマホ対応 */
@media (max-width: 600px) {
  .chat-head { font-size: 1.1rem; }
  .chat-input { height: 72px; }
  .chat-input textarea {
    height: 52px !important;
    max-height: 52px;
  }
}
