@charset "UTF-8";

/* HomeBot のサイト埋め込み: ランチャー（入口）。
   チャット窓の中身は共通ウィジェット（Shadow DOM）側＝ここでは触らない。
   PC は右下のピル、スマホ（767px 以下）は画面の最下端に付ける全幅の帯。
   既存のボタン・バナー（.line_btn_right・.banner_cta・下部CTA）は隠さず、重ならない位置に置く。
   スマホで帯を出している間だけ、下部CTAなどを帯の上へ上げる（帯の高さ --irhb-band-height は js/homebot-guide.js が計測。帯が無いときは 0px＝元の位置）。 */

/* ===== ランチャー ===== */
/* 横長のピル（ロゴの白丸 → 状態の点と補足・ラベル → 吹き出しの濃いピンクの丸）。色はサイトのピンク #ea6383 の単色、文字・状態の点・吹き出しは白（影は付けない） */
.irhb-launcher {
    --irhb-assets-ready: 1; /* js/homebot-guide.js がこの値でCSSの読込を確認する（404 なら標準ランチャーのまま） */
    position: fixed;
    right: 58px; /* 開いたチャット窓の右端と同じ */
    bottom: calc(24px + env(safe-area-inset-bottom, 0px)); /* .banner_cta（下端 140px）より下 */
    z-index: 999; /* .banner_cta（888）より上、ヘッダー・メニューより下 */
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    max-width: calc(100vw - 32px);
    margin: 0;
    padding: 8px 10px 8px 8px;
    border: 0;
    border-radius: 40px;
    background: #ea6383;
    color: #fff;
    font-family: inherit;
    line-height: 1.35;
    text-align: left;
    box-shadow: 0 6px 20px rgba(20, 50, 35, .22);
    cursor: pointer;
    box-sizing: border-box;
}
.irhb-launcher[hidden] { display: none; }
body:has(#sp-menu.show) .irhb-launcher { display: none; }
.irhb-launcher:hover {
    background: #ea6383; /* 色は変えず、ボタンの影だけを強める */
    box-shadow: 0 8px 24px rgba(20, 50, 35, .28);
}
.irhb-launcher:focus { outline: none; }
.irhb-launcher:focus-visible { outline: 3px solid #333; outline-offset: 3px; }

.irhb-launcher__icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
}
/* ロゴ（header_logo.png 240×54 の左端＝家のマーク）。高さに合わせて縮め、左端の正方形だけを見せる。円の内接正方形に収まる大きさ */
.irhb-launcher__mark {
    display: block;
    width: 30px;
    max-width: none;
    height: 30px;
    object-fit: cover;
    object-position: left center;
}
.irhb-launcher__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.irhb-launcher__sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .05em;
    color: #fff;
    white-space: nowrap;
}
.irhb-launcher__dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
}
.irhb-launcher__label {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .03em;
}
/* 狭い画面では「、」の後で折り返す（途中で切らない） */
.irhb-launcher__phrase { display: inline-block; white-space: nowrap; }

/* 吹き出しの丸（飾り。ボタンは1つのまま）。濃いピンク #942440 の地に白い吹き出し */
.irhb-launcher__go {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin-left: 2px;
    border-radius: 50%;
    background: #942440;
}
.irhb-launcher__bubble {
    position: relative;
    display: block;
    width: 19px;
    height: 15px;
    margin-bottom: 3px; /* しっぽの分だけ上げて円の中央に見せる */
    border-radius: 7px;
    background: #fff;
}
/* 吹き出しの中の点 3 つ（地の濃いピンクで抜く） */
.irhb-launcher__bubble::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 3px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #942440;
    box-shadow: 5px 0 0 #942440, 10px 0 0 #942440;
}
/* しっぽ（左下） */
.irhb-launcher__bubble::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 3px;
    border-style: solid;
    border-width: 5px 5px 0 0;
    border-color: #fff transparent transparent transparent;
}

@media (max-width: 767px) {
    /* 画面の最下端に付ける全幅の帯。safe-area は外側の余白にせず内側の余白にして、地色を下端まで延ばす */
    .irhb-launcher {
        right: 0;
        left: 0;
        bottom: 0;
        justify-content: center;
        gap: 10px;
        width: 100%;
        min-height: calc(54px + env(safe-area-inset-bottom, 0px));
        max-width: none;
        padding: 6px calc(8px + env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px));
        border-radius: 0;
    }
    .irhb-launcher,
    .irhb-launcher:hover { box-shadow: none; }
    .irhb-launcher:focus-visible { outline-offset: -4px; } /* 画面の端で切れないよう内側に描く */
    .irhb-launcher__icon { width: 40px; height: 40px; }
    .irhb-launcher__mark { width: 27px; height: 27px; }
    .irhb-launcher__sub { font-size: 10px; }
    .irhb-launcher__label { font-size: 14px; }
    .irhb-launcher__go { width: 32px; height: 32px; }
}
@media (max-width: 540px) {
    /* 下部CTAの電話（同じピンク）と繋がって見えないよう、下部CTAの枠と同じ白い線で区切る */
    .irhb-launcher { border-top: 2px solid #fff; }
}
@media (max-width: 400px) {
    .irhb-launcher { gap: 8px; }
    .irhb-launcher__label { font-size: 13px; }
}
@media (max-width: 359px) {
    .irhb-launcher__icon { width: 36px; height: 36px; }
    .irhb-launcher__mark { width: 25px; height: 25px; }
    .irhb-launcher__sub { white-space: normal; }
    .irhb-launcher__go { width: 28px; height: 28px; margin-left: 0; }
}

/* ===== スマホの帯と既存の固定要素 =====
   帯を出している間だけ帯の上へ上げる。0px（帯なし・標準ランチャー・利用不可・メニュー表示中）のときは style.css と同じ値になる */
@media (max-width: 767px) {
    .footer_cta.fixed { bottom: var(--irhb-band-height, 0px); }
    #wrapper { padding-bottom: var(--irhb-band-height, 0px); } /* ページ末尾が帯に隠れないようにする */
}
@media (max-width: 540px) {
    .banner_cta { bottom: max(50vw, 17.6666vw + var(--irhb-band-height, 0px) + 8px); } /* 17.6666vw は下部CTAの高さ。通常は 50vw のまま。帯が高いとき（文字拡大など）だけ下部CTAの上へ上げる */
    #wrapper { padding-bottom: calc(15vw + var(--irhb-band-height, 0px)); }
}

/* ===== チャット窓の見出し（共通ウィジェットの公開トークン・UI契約 theme-v1） =====
   見出しをサイトのピンクの単色＋ロゴの白い台座にする。ウィジェット本体が検証する公開の値（#RGB/#RRGGBB）だけで、Shadow DOM の内部には触らない。
   未対応の旧ウィジェットでは無視され、管理画面のテーマカラーの見出しのまま。ボットの管理画面の設定は変えない */
#homebot-widget {
    --homebot-ui-header-background: #ea6383; /* 見出しの地色（ランチャーと同じピンク） */
    --homebot-ui-header-foreground: #ffffff; /* 見出しの文字・×の色 */
    --homebot-ui-header-secondary: #ffffff; /* 補助文・AI表記の文字 */
    --homebot-ui-ai-border: #ffffff; /* AI表記の枠 */
    --homebot-ui-avatar-background: #ffffff; /* ロゴの白い台座 */
    --homebot-ui-avatar-foreground: #333333; /* 代替の家のアイコン（ロゴ画像が無いとき）は濃い色 */
}
/* 見出しの×（公開 part）。ウィジェット既定のホバーは淡い背景で白い×が見えなくなるため、濃いピンクの地にする。フォーカスの枠も白にする */
#homebot-widget::part(close-button):hover,
#homebot-widget::part(close-button):focus-visible { background: #942440; }
#homebot-widget::part(close-button):focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
