﻿/* 全体 */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  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%;
    min-height: 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;
  }
}

/* ★★★ ここからが、今回依頼された修正のための最小限の追加箇所です ★★★ */

/* 埋め込みコンテンツ(.embed)を含む吹き出しにだけ適用される特別ルール */
.msg.bot:has(.embed) {
    max-width: 100%; /* 親の幅制限を解除 */
    width: 100%;
    padding: 0; /* 内側の余白をなくす */
    background: transparent; /* 背景を透明に */
    box-shadow: none; /* 影をなくす */
}

/* 埋め込みコンテンツ(.embed)のコンテナスタイル */
.embed {
    width: 100%; /* 親要素の幅いっぱいに広がる */
    border-radius: 12px;
    overflow: hidden; /* 角丸をiframeに適用させるため */
    background-color: #f0f0f5; /* iframeが読み込まれるまでの背景色 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 影はコンテナに付ける */
}

/* 埋め込みコンテンツ内のiframe自体のスタイル */
.embed iframe {
    width: 100%; /* コンテナの幅いっぱいに */
    height: auto; /* 高さはアスペクト比で自動計算 */
    display: block; /* 余計な下余白を防ぐ */
    border: none; /* 境界線を消す */
    aspect-ratio: 4 / 3; /* デフォルトのアスペクト比を4:3に */
}

/* 予約フォーム(stransa)のiframeにだけ、特別なアスペクト比を適用 */
.embed:has(iframe[src*="stransa"]) iframe {
    aspect-ratio: 1 / 1; /* 正方形に近い比率に */
}

/* 埋め込みコンテンツのタイトル */
.embed-title {
    font-size: 12px;
    color: #555;
    padding: 8px 12px;
    background: #e5e5ea;
    font-weight: 500;
}