/* Bloomy AI Chat — モダン&シンプル(2026-07-16 v2)。白基調・余白・柔らかい影・絵文字なし(✿のみ)。 */

/* 🔴 hidden属性が効くように(display:flexの上書きを打ち消す=閉じるバグ修正) */
.bloomy-aichat[hidden],.bloomy-aichat-launcher[hidden]{display:none!important}

/* ランチャー: お花ロゴ + 「Bloomy / サポート」2行ラベルの白いピル。 */
.bloomy-aichat-launcher{position:fixed;right:18px;bottom:calc(22px + env(safe-area-inset-bottom,0px));z-index:99990;display:inline-flex;align-items:center;gap:2px;height:52px;padding:0 16px 0 4px;border:0;border-radius:999px;background:#fff;cursor:pointer;box-shadow:0 3px 12px rgba(16,32,64,.16),0 0 0 1px rgba(31,42,68,.05);-webkit-tap-highlight-color:transparent;transition:box-shadow .2s ease,transform .2s ease}
.bloomy-aichat-launcher:hover{box-shadow:0 6px 20px rgba(16,32,64,.22),0 0 0 1px rgba(31,42,68,.06);transform:translateY(-1px)}
.bloomy-aichat-launcher:active{transform:translateY(0)}
.bloomy-aichat-launcher__ic{flex:0 0 auto;width:40px;height:40px;display:flex;align-items:center;justify-content:center}
.bloomy-aichat-launcher__ic img{width:28px;height:28px;object-fit:contain;display:block}
.bloomy-aichat-launcher__lbl{display:flex;flex-direction:column;justify-content:center;text-align:left;line-height:1.08}
.bloomy-aichat-launcher__lbl b{font-size:13px;font-weight:800;color:#16294d;letter-spacing:.01em}
.bloomy-aichat-launcher__lbl i{font-size:9.5px;font-weight:700;font-style:normal;color:#9aa6bf;letter-spacing:.13em;margin-top:1px}
.bloomy-aichat-launcher.is-open .bloomy-aichat-launcher__ic img{opacity:.75}

/* 誘い吹き出し: ランチャー(ピル)の上にそっと出て、一定時間で切り替わる。タップでその質問を送信。 */
.bloomy-aichat-bubble{position:fixed;right:16px;bottom:calc(82px + env(safe-area-inset-bottom,0px));z-index:99989;max-width:calc(100vw - 32px);white-space:nowrap;text-align:left;background:#fff;color:#16294d;font-family:inherit;font-size:12px;font-weight:700;line-height:1.4;border:1px solid #e6ecf6;border-radius:14px;padding:8px 12px;cursor:pointer;box-shadow:0 6px 18px rgba(16,32,64,.16),0 0 0 1px rgba(31,42,68,.04);-webkit-tap-highlight-color:transparent;opacity:0;transform:translateY(6px) scale(.98);transition:opacity .35s ease,transform .35s ease}
.bloomy-aichat-bubble.is-in{opacity:1;transform:none}
.bloomy-aichat-bubble::after{content:"";position:absolute;right:26px;bottom:-6px;width:11px;height:11px;background:#fff;border-right:1px solid #e6ecf6;border-bottom:1px solid #e6ecf6;transform:rotate(45deg)}
@media (max-width:480px){.bloomy-aichat-bubble{right:14px;bottom:calc(80px + env(safe-area-inset-bottom,0px))}}
@media (prefers-reduced-motion:reduce){.bloomy-aichat-bubble{transition:opacity .2s ease}.bloomy-aichat-bubble.is-in{transform:none}}

/* パネル: 角丸・柔らかい影・整った余白 */
.bloomy-aichat{position:fixed;right:18px;bottom:82px;z-index:99992;width:min(380px,calc(100vw - 24px));height:min(560px,calc(100dvh - 116px));display:flex;flex-direction:column;background:#fff;border-radius:20px;box-shadow:0 24px 64px rgba(16,32,64,.24),0 0 0 1px rgba(31,42,68,.06);overflow:hidden;animation:bloomyChatIn .24s cubic-bezier(.2,.8,.25,1) both}
/* 背景の薄い暗幕: PCは非表示(非ブロッキング維持)、モバイルのボトムシート時だけ薄く暗くする。 */
.bloomy-aichat-backdrop{display:none}
@media (max-width:480px){.bloomy-aichat-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:99991;background:rgba(14,22,38,.36);animation:bloomyBackdropIn .22s ease both}}
@keyframes bloomyBackdropIn{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:reduce){.bloomy-aichat-backdrop{animation:none}}
@keyframes bloomyChatIn{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}

/* ヘッダー: 花アバター + 名前(上) + 役割(下) を縦に整理 */
.bloomy-aichat__head{display:flex;align-items:center;gap:11px;padding:13px 15px;border-bottom:1px solid #eef2f8}
.bloomy-aichat__avatar{position:relative;flex:0 0 auto;width:36px;height:36px;border-radius:50%;background:#f4f8ff;display:flex;align-items:center;justify-content:center}
.bloomy-aichat__avatar img{width:23px;height:23px;display:block}
.bloomy-aichat__avatar.is-photo{background:#eaf1ff;overflow:hidden}
.bloomy-aichat__avatar-photo{width:100%!important;height:100%!important;object-fit:cover;object-position:center 16%;display:block;border-radius:50%}
.bloomy-aichat__heads{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:1px;line-height:1.3}
.bloomy-aichat__name{display:inline-flex;align-items:center;gap:5px;font-size:14.5px;font-weight:800;color:#16294d}
.bloomy-aichat__nameflower{flex:0 0 auto;width:15px;height:15px;display:block}
.bloomy-aichat__role{display:block;font-size:11.5px;color:#8a97b3;font-weight:600}
.bloomy-aichat__close,.bloomy-aichat__reset{flex:0 0 auto;border:0;background:none;color:#aab6cc;cursor:pointer;padding:6px;line-height:0;border-radius:8px;transition:background .15s,color .15s}
.bloomy-aichat__close:hover,.bloomy-aichat__reset:hover{color:#5b6b86;background:#f2f6fd}
.bloomy-aichat__reset{margin-left:-2px}

.bloomy-aichat__log{flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;padding:16px 14px;display:flex;flex-direction:column;gap:10px;background:#fbfcfe}
.bloomy-aichat__msg{max-width:85%;padding:10px 13px;font-size:13.5px;line-height:1.72;word-break:break-word}
.bloomy-aichat__msg--ai{align-self:flex-start;background:#fff;border:1px solid #eaeef6;color:#1f2a44;border-radius:16px 16px 16px 4px;box-shadow:0 1px 2px rgba(16,32,64,.03)}
.bloomy-aichat__msg--user{align-self:flex-end;background:#2f7ef7;color:#fff;border-radius:16px 16px 4px 16px}
.bloomy-aichat__msg--ai a{color:#1f6fe6;font-weight:700;text-decoration:underline;text-underline-offset:2px}
.bloomy-aichat__typing{align-self:flex-start;display:inline-flex;gap:4px;padding:12px 14px;background:#fff;border:1px solid #eaeef6;border-radius:16px 16px 16px 4px}
.bloomy-aichat__typing span{width:6px;height:6px;border-radius:50%;background:#c3d4f2;animation:bloomyChatDot 1.1s infinite}
.bloomy-aichat__typing span:nth-child(2){animation-delay:.18s}
.bloomy-aichat__typing span:nth-child(3){animation-delay:.36s}
@keyframes bloomyChatDot{0%,60%,100%{opacity:.4;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* プラン推薦カード: 3枚を横幅に収める(3列・横スクロール無し=縦スクロールと干渉しない)。狭幅向けにコンパクト。 */
.bloomy-aichat__cards{align-self:stretch;width:100%;min-width:0;display:flex;flex-direction:row;gap:6px;padding:2px 0 4px}
.bloomy-aichat__pcard{flex:1 1 0;min-width:0;display:flex;flex-direction:column;border:1px solid #e6ecf6;border-radius:12px;background:#fff;padding:9px 7px;box-shadow:0 1px 2px rgba(16,32,64,.03)}
.bloomy-aichat__pcard--primary{border-color:#bcd6fb;box-shadow:0 2px 10px rgba(47,126,247,.1)}
.bloomy-aichat__pcard-top{display:flex;flex-wrap:wrap;align-items:center;gap:3px;margin-bottom:4px}
.bloomy-aichat__pcard-tag{font-size:9px;font-weight:800;color:#1f6fe6;background:#eef5ff;border-radius:999px;padding:2px 6px;letter-spacing:0}
.bloomy-aichat__pcard--save .bloomy-aichat__pcard-tag{color:#3f8f5b;background:#eefaf1}
.bloomy-aichat__pcard--plus .bloomy-aichat__pcard-tag{color:#8a5cc4;background:#f4eefb}
.bloomy-aichat__pcard-country{font-size:9.5px;font-weight:700;color:#6b7896;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.bloomy-aichat__pcard-data{display:flex;align-items:baseline;gap:3px;min-width:0;line-height:1.2}
.bloomy-aichat__pcard-num{font-size:13px;font-weight:800;color:#16294d;white-space:nowrap}
.bloomy-aichat__pcard-days{font-size:9px;font-weight:600;color:#8a97b3;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:0 1 auto;min-width:0}
.bloomy-aichat__pcard-price{font-size:13.5px;font-weight:800;color:#16294d;margin-top:4px}
.bloomy-aichat__pcard-unit{display:block;font-size:9px;font-weight:600;color:#8a97b3;margin:1px 0 0}
.bloomy-aichat__pcard-note{display:none}
.bloomy-aichat__pcard-buy{display:block;text-align:center;margin-top:8px;padding:7px 4px;border-radius:9px;background:#2f7ef7;color:#fff!important;font-size:10.5px;font-weight:700;text-decoration:none!important;line-height:1.2}
.bloomy-aichat__pcard-buy:hover{background:#1f6fe6}
.bloomy-aichat__pcard--save .bloomy-aichat__pcard-buy,.bloomy-aichat__pcard--plus .bloomy-aichat__pcard-buy{background:#fff;color:#1f6fe6!important;border:1px solid #cfe0f8}
.bloomy-aichat__pcard--save .bloomy-aichat__pcard-buy:hover,.bloomy-aichat__pcard--plus .bloomy-aichat__pcard-buy:hover{background:#f6faff}

/* クイック質問チップ: 白のリスト型(塗り乱発しない) */
.bloomy-aichat__chips{display:flex;flex-wrap:wrap;gap:7px;padding:2px 14px 8px;background:#fbfcfe}
.bloomy-aichat__chips-hint{flex:0 0 100%;font-size:11.5px;color:#8a97b3;font-weight:600;margin:0 0 1px 2px}
.bloomy-aichat__chip{border:1px solid #dce4f1;border-radius:999px;background:#fff;color:#1f6fe6;font-size:12.5px;font-weight:600;padding:8px 13px;cursor:pointer;font-family:inherit;-webkit-tap-highlight-color:transparent;transition:border-color .15s,background .15s}
.bloomy-aichat__chip:hover{border-color:#9fc0ef;background:#f6faff}
.bloomy-aichat__notice{padding:6px 14px;font-size:10.5px;color:#a3aec6;text-align:center;background:#fbfcfe}
.bloomy-aichat__form{display:flex;gap:9px;padding:10px 12px 12px;border-top:1px solid #eef2f8}
.bloomy-aichat__form input{flex:1 1 auto;border:1px solid #dce4f1;border-radius:13px;padding:11px 14px;font-size:16px;color:#16294d;font-family:inherit;background:#fbfcfe;transition:border-color .15s,background .15s}
.bloomy-aichat__form input:focus{outline:none;border-color:#7fb0f7;background:#fff;box-shadow:0 0 0 3px rgba(47,126,247,.1)}
.bloomy-aichat__form button{flex:0 0 auto;width:44px;border:0;border-radius:13px;background:#2f7ef7;color:#fff;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background .15s}
.bloomy-aichat__form button:hover{background:#1f6fe6}
.bloomy-aichat__form button:disabled{opacity:.45;cursor:default}

@media (max-width:480px){
	.bloomy-aichat{right:0;left:0;bottom:0;width:100%;height:min(90dvh,780px);border-radius:22px 22px 0 0;box-shadow:0 -8px 40px rgba(16,32,64,.24)}
	.bloomy-aichat-launcher{right:16px;height:50px}
}
/* 記事の浮き目次(.bloomy-ftoc・≤900pxで右下固定)と共存: 目次があるページではチャット系を左下へ(JSがhas-ftocを付与) */
@media (max-width:900px){
	.bloomy-aichat-launcher.has-ftoc{left:16px;right:auto}
	.bloomy-aichat-bubble.has-ftoc{left:14px;right:auto;white-space:normal;max-width:calc(100vw - 150px)}
	.bloomy-aichat-bubble.has-ftoc::after{left:26px;right:auto}
}
@media (min-width:481px) and (max-width:900px){
	.bloomy-aichat.has-ftoc{left:18px;right:auto}
}
@media (prefers-reduced-motion:reduce){.bloomy-aichat,.bloomy-aichat-launcher,.bloomy-aichat-launcher__lbl{animation:none;transition:none}}
