/* セセラ 物件Q&Aチャット（試作）
 * 配色は既存コンシェルジュに合わせる（ティール #45b1a8 / ネイビー #2c3e50） */

.cecela-chat {
  --cch-teal: #45b1a8;
  --cch-teal-dark: #379b93;
  --cch-navy: #2c3e50;
  --cch-bg: #f4f7f7;
  --cch-border: #dde6e5;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--cch-border);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(44, 62, 80, 0.06);
  font-size: 15px;
  line-height: 1.7;
  color: var(--cch-navy);
  box-sizing: border-box;
}
.cecela-chat *, .cecela-chat *::before, .cecela-chat *::after {
  box-sizing: border-box;
}

/* ---- 物件ヘッダー ---- */
.cecela-chat .cch-head {
  padding: 4px 4px 14px;
  border-bottom: 1px solid var(--cch-border);
  margin-bottom: 12px;
}
.cecela-chat .cch-head-label {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cch-teal);
  letter-spacing: 0.05em;
}
.cecela-chat .cch-head-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}
.cecela-chat .cch-chips {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cecela-chat .cch-chips li {
  background: var(--cch-bg);
  border: 1px solid var(--cch-border);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 12px;
  margin: 0;
}
.cecela-chat .cch-chips li:first-child {
  background: var(--cch-navy);
  border-color: var(--cch-navy);
  color: #fff;
  font-weight: 700;
}
.cecela-chat .cch-head-link {
  font-size: 12px;
  color: var(--cch-teal-dark);
  text-decoration: underline;
}

/* ---- メッセージ ---- */
.cecela-chat .cch-messages {
  min-height: 200px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cecela-chat .cch-bubble {
  align-self: flex-start;
  max-width: 88%;
  background: var(--cch-bg);
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.cecela-chat .cch-bubble.is-user {
  align-self: flex-end;
  background: var(--cch-navy);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}

/* 考え中のドット */
.cecela-chat .cch-typing {
  align-self: flex-start;
  background: var(--cch-bg);
  border-radius: 14px 14px 14px 4px;
  padding: 12px 16px;
  display: flex;
  gap: 5px;
}
.cecela-chat .cch-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9db4b1;
  animation: cch-blink 1.2s infinite ease-in-out;
}
.cecela-chat .cch-dot:nth-child(2) { animation-delay: 0.2s; }
.cecela-chat .cch-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes cch-blink {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ---- 入力バー ---- */
.cecela-chat .cch-inputbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--cch-border);
}
.cecela-chat .cch-input {
  flex: 1;
  border: 1px solid var(--cch-border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 16px; /* iPhoneでの自動ズームを防ぐため16px以上 */
  line-height: 1.5;
  resize: none;
  background: #fff;
  color: var(--cch-navy);
}
.cecela-chat .cch-input:focus {
  outline: 2px solid var(--cch-teal);
  outline-offset: -1px;
}
.cecela-chat .cch-mic,
.cecela-chat .cch-send {
  flex: none;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.15s;
}
.cecela-chat .cch-mic {
  background: var(--cch-bg);
  color: var(--cch-navy);
  border: 1px solid var(--cch-border);
}
.cecela-chat .cch-mic:hover { background: #e9f0ef; }
.cecela-chat .cch-send {
  background: var(--cch-teal);
  color: #fff;
  font-weight: 700;
}
.cecela-chat .cch-send:hover { background: var(--cch-teal-dark); }
.cecela-chat .cch-mic:disabled,
.cecela-chat .cch-send:disabled {
  opacity: 0.5;
  cursor: default;
}

/* 聞き取り中の表示 */
.cecela-chat.is-listening .cch-mic {
  background: #e8836f;
  border-color: #e8836f;
  color: #fff;
  animation: cch-pulse 1.2s infinite;
}
@keyframes cch-pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 131, 111, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(232, 131, 111, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 131, 111, 0); }
}
.cecela-chat .cch-listening {
  margin: 8px 2px 0;
  font-size: 12px;
  color: #e8836f;
  font-weight: 700;
}

/* ---- 注記 ---- */
.cecela-chat .cch-note {
  margin: 10px 2px 0;
  font-size: 11px;
  color: #8a9a98;
}
