/* === 基本設定 === */
.chat-wrapper {
    max-width: 600px; margin: 0 auto; height: 80vh; /* 高さ調整 */
    display: flex; flex-direction: column; background: #fff;
    border: 1px solid #ddd; box-shadow: 0 0 15px rgba(0,0,0,0.1);
    position: relative;
	margin-bottom:1rem;
}

/* === ヘッダー＆進捗バー === */
.chat-header { background: #f8f9fa; padding: 10px 15px; border-bottom: 1px solid #ddd; }
.header-title { font-weight: bold; text-align: center; margin-bottom: 5px; color: #333; }

.progress-container { display: flex; align-items: center; gap: 10px; }
.progress-bar { flex: 1; height: 8px; background: #e9ecef; border-radius: 4px; position: relative; overflow: hidden; }
.progress-bar::after {
    content: ''; position: absolute; top: 0; left: 0; height: 100%;
    width: var(--progress, 0%); /* JSで制御 */
    background: #00B900; transition: width 0.3s ease;
}
.progress-text { font-size: 12px; color: #666; width: 60px; text-align: right; }

/* === チャットログ === */
.chat-log { flex: 1; overflow-y: auto; padding: 20px; background: #f0f4f8; display: flex; flex-direction: column; gap: 15px; }

/* メッセージ共通 */
.message { max-width: 80%; padding: 12px 16px; border-radius: 18px; font-size: 14px; line-height: 1.6; position: relative; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ボット（左側・キャラクター） */
.message.bot {
    background: #fff; margin-right: auto; margin-left: 50px; /* アイコン分の余白 */
    border-top-left-radius: 4px; position: relative;
}
/* キャラクターアイコン（CSSで疑似要素として配置） */
.message.bot::before {
    content: ''; position: absolute; left: -50px; top: 0;
    width: 40px; height: 40px; border-radius: 50%;
    background-size: cover; background-position: center;
    background-color: #ddd; /* 画像がない場合の背景色 */
    background-image: var(--bot-icon); /* JSから設定 */
}

/* ユーザー（右側） */
.message.user { background: #00B900; color: #fff; margin-left: auto; border-top-right-radius: 4px; }

/* リンクテキスト装飾 */
.popup-link { color: #007bff; text-decoration: underline; cursor: pointer; font-weight: bold; }

/* === 入力エリア === */
.input-area { padding: 15px; background: #fff; border-top: 1px solid #ddd; min-height: 80px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }

.input-area div{width:fit-content; margin:0 auto;}

/* ボタン類 */
.option-btn {
    padding: 10px 15px; background: #00a6b5; color: #fff;
    border-radius: 20px; cursor: pointer; font-size: 13px; transition: 0.2s; flex: 1 1 45%; max-width: 200px;
	text-align:center;
	font-weight:900;
}
.option-btn:hover { opacity:0.7; }

.inline-controls{
	display:flex;
	flex-wrap:wrap;
	width: 100%;
    justify-content: flex-start;
    margin: 1rem auto;
	gap:10px;
}
	

.inline-option-btn{
	background-color:#00a6b5;
	color:#fff;
	font-weight:900;
	border-radius:9999px;
	padding:0.5rem;
	min-width:100px;
	text-align:center;
	cursor:pointer;
}

.pref-submit-btn{
	display: block;
    width: 100px;
    text-align: center;
}

.inline-send-btn{
	text-align:center;
}

/* フォーム要素 */
.chat-input, .chat-select { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px;}
.send-btn { background: #00a6b5; color: #fff; min-width:100px; border: none; padding: 10px 20px; border-radius: 20px; cursor: pointer; font-weight: bold; margin-top: 5px; }

.chat-input::placeholder {
    color: #ccc;
    opacity: 1;
}

/* === ポップアップ（モーダル） === */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center;
}
.modal-content {
    background: #fff; padding: 20px; border-radius: 8px; width: 90%; max-width: 400px; position: relative; text-align: center;
}
.close-modal { position: absolute; top: 10px; right: 15px; font-size: 24px; cursor: pointer; }
.modal-image-placeholder { background: #eee; height: 150px; margin: 15px 0; display: flex; align-items: center; justify-content: center; color: #888; border-radius: 4px;}
.modal-close-btn { margin-top: 10px; padding: 8px 20px; background: #333; color: #fff; border: none; border-radius: 4px; cursor: pointer; }

.bot-name {
    position: absolute;
    left: -50px;
    top: 42px;
    width: 40px;
    text-align: center;
    font-size: 9px;
    line-height: 1.2;
    white-space: nowrap;
	color:#333333;
}

/* メッセージの余白調整（名前が長い場合に備えて） */
.message.bot {
    margin-bottom: 20px; /* メッセージ同士の間隔を少し広げる */
}

.sticky-cta{
	display:none;
}

/* --- 写真プレビューエリアのスタイル --- */
#preview-area {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: flex-start; /* 左寄せ */
}

/* サムネイルの枠 */
.thumbnail-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #eee;
    background: #fff;
}

/* 画像本体 */
.thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 枠に合わせてトリミング */
}

/* 削除ボタン（×マーク） */
.thumbnail-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    font-weight: bold;
}

.thumbnail-delete:hover {
    background: rgba(255,0,0,0.8); /* ホバー時に赤くする */
}

/* セレクトボックス（ドロップダウン）のデザイン */
.inline-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 12px 15px 12px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: #fff;
    font-size: 13px;
    cursor: pointer;
    flex: 1;
    color: #333;

    /* 下矢印（▼）のアイコンを背景画像として配置 */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 5px center;
    background-size: 16px;
}

.inline-select:hover {
    background-color: #f9f9f9;
    border-color: #999;
}

.inline-select:focus {
    outline: none;
    border-color: #00B900; /* エコキュートカラーで強調 */
    box-shadow: 0 0 0 2px rgba(0, 185, 0, 0.2);
}