/* --------------------------------------------------
 LIVELY CLINIC AI Concierge (LCAI) chatbot UI
--------------------------------------------------- */

:root {
    --lcai-primary: var(--color-theme-01, #677475);
    --lcai-accent: var(--color-theme-02, #b9d8db);
    --lcai-accent-dark: var(--color-theme-04, #9ab1b2);
    --lcai-cream: var(--color-theme-07, #f4efea);
    --lcai-text: var(--color-base, #262626);
    --lcai-wh: var(--color-wh, #ffffff);
    --lcai-z: 9990;
}

/* Chat price tables: always two columns so they remain readable without horizontal scrolling. */
.lcai-price-table-wrap {
    margin: 12px 0;
}
.lcai-price-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: .78rem;
    line-height: 1.45;
}
.lcai-price-table th,
.lcai-price-table td {
    padding: 8px 6px;
    border: 1px solid var(--color-gy, #ddd);
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.lcai-price-table tbody th {
    width: 48%;
    font-weight: 400;
    text-align: left;
}
.lcai-price-table td {
    width: 52%;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.lcai-price-table__condition {
    display: block;
    margin-top: 3px;
    font-size: .9em;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
}
.lcai-price-table__risk {
    margin: 8px 0 0;
    font-size: .76rem;
    line-height: 1.5;
}
.lcai-price-table__risk a { text-decoration: underline; }

/* launcher
--------------------------------------------------- */

/* 画面下部のコンパクトなバナー型（円形チャットアイコン＋「24時間受付中」）。
   サイズは全て .lcai-launcher の font-size 基準（em）。ここを変えれば余白・アイコン・文字が一括で縮む。
   幅は固定せず文字量に合わせる（右側に余白が余らないように）。
   1400px以下は画面下部に .fixed-menu（電話/WEB/LINE予約バー 70px）があるため、その上に配置する */
.lcai-launcher {
    --lcai-launcher-icon: 2.75em; /* 44px: タップ対象の最低サイズ */
    position: fixed;
    right: max(1em, env(safe-area-inset-right));
    bottom: 78px;
    z-index: var(--lcai-z);
    display: flex;
    align-items: center;
    width: auto;
    max-width: calc(100vw - 2em);
    padding: .5em 1em .5em .5em;
    font-size: 1rem;
    text-align: left;
    border-radius: 3em; /* 高さの半分以上＝ピル型。縮小時は正円へ */
    background: var(--lcai-wh);
    border: 1px solid var(--color-gy, #dddddd);
    box-shadow: 0 12px 32px rgba(38, 38, 38, .16), 0 2px 8px rgba(38, 38, 38, .08);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        opacity .25s ease, visibility .25s,
        transform .3s ease, box-shadow .3s ease,
        padding .35s ease, border-radius .35s ease,
        background-color .35s ease, border-color .35s ease;
}
.lcai-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(38, 38, 38, .2), 0 3px 10px rgba(38, 38, 38, .1);
}
/* 円形のチャットアイコン（ロゴは使わない） */
.lcai-launcher__icon {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: var(--lcai-launcher-icon);
    height: var(--lcai-launcher-icon);
    border-radius: 50%;
    background: var(--lcai-primary);
    color: var(--lcai-wh);
}
.lcai-launcher__icon svg {
    width: 1.375em;
    height: 1.375em;
}
.lcai-launcher__tx {
    display: flex;
    flex-direction: column;
    gap: .375em;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 10em;
    margin-left: .75em;
    white-space: nowrap;
    overflow: hidden;
    transition: max-width .35s ease, margin .35s ease, opacity .2s ease;
}
.lcai-launcher__eyebrow {
    font-size: .6875em;
    letter-spacing: .12em;
    font-weight: 600;
    line-height: 1;
    color: #8f8f8f;
}
.lcai-launcher__head {
    font-size: 1.0625em;
    letter-spacing: .02em;
    font-weight: 700;
    line-height: 1.18;
    color: var(--lcai-primary);
}
.lcai-launcher__go {
    flex: 0 0 auto;
    display: flex;
    max-width: 2em;
    margin-left: .5em;
    overflow: hidden;
    color: rgba(103, 116, 117, .6);
    transition: max-width .35s ease, margin .35s ease, opacity .2s ease;
}
.lcai-launcher__go svg {
    width: 1.25em;
    height: 1.25em;
    flex: 0 0 auto;
}

/* 下スクロール時の縮小状態（PCのみ。JSが .is-collapsed を付け外しする）。
   文字と矢印を畳み、右端に円形アイコンだけを残す。上スクロールで元に戻る */
@media screen and (min-width: 768px) {
    .lcai-launcher.is-collapsed {
        padding: 0;
        border-radius: 50%;
        background: var(--lcai-primary);
        border-color: var(--lcai-primary);
        box-shadow: 0 8px 24px rgba(103, 116, 117, .35);
    }
    .lcai-launcher.is-collapsed:hover {
        transform: translateY(-2px) scale(1.06);
    }
    .lcai-launcher.is-collapsed .lcai-launcher__tx,
    .lcai-launcher.is-collapsed .lcai-launcher__go {
        max-width: 0;
        margin-left: 0;
        opacity: 0;
    }
    /* 縮小中は控えめな波紋で存在を知らせる */
    .lcai-launcher.is-collapsed::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: 2px solid var(--lcai-accent-dark);
        animation: lcai-launcher-ring 2.4s ease-out infinite;
        pointer-events: none;
    }
}
@keyframes lcai-launcher-ring {
    0% { transform: scale(1); opacity: .7; }
    70%, 100% { transform: scale(1.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .lcai-launcher,
    .lcai-launcher__tx,
    .lcai-launcher__go {
        transition: none;
    }
    .lcai-launcher.is-collapsed::before {
        animation: none;
    }
}

/* open state: launcher hides entirely（閉じる操作はウィジェットヘッダーの×に一本化） */
.lcai-launcher.is-open {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* backdrop
--------------------------------------------------- */

/* コンシェルジュを開いている間、背景（ページ本文・ヘッダー・予約バー）にぼかしと薄い暗幕をかけて会話に集中させる。
   ウィジェットとランチャーより1つ下の z-index に置き、クリックで閉じられるようにする */
.lcai-backdrop {
    position: fixed;
    inset: 0;
    z-index: calc(var(--lcai-z) - 1);
    background: rgba(38, 38, 38, .18);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease, visibility .3s;
}
.lcai-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.lcai-backdrop.is-instant { transition: none; }
/* backdrop-filter 非対応ブラウザは暗幕を少し濃くして代替する */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .lcai-backdrop { background: rgba(38, 38, 38, .35); }
}
@media (prefers-reduced-motion: reduce) {
    .lcai-backdrop { transition: none; }
}

/* widget
--------------------------------------------------- */

/* 開いている間はランチャーが消えるため、ウィジェットはランチャー位置まで下げて配置する。
   高さは「bottom + 上部固定ヘッダー(60〜90px) + 余白」を差し引き、ヘッダーに達しないようにする */
.lcai-widget {
    position: fixed;
    right: 20px;
    bottom: 90px;
    z-index: var(--lcai-z);
    display: flex;
    flex-direction: column;
    width: min(380px, calc(100vw - 40px));
    height: min(600px, calc(100dvh - 190px));
    background: var(--lcai-wh);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(38, 38, 38, .22);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(.98);
    transform-origin: bottom right;
    visibility: hidden;
    transition: opacity .3s ease, transform .3s ease, visibility .3s;
}
.lcai-widget.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}
/* ページ遷移後に開いた状態を引き継ぐ時はアニメーションなしで表示する（JSが一瞬だけ付ける） */
.lcai-widget.is-instant { transition: none; }

/* header */
.lcai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: var(--lcai-primary);
    color: var(--lcai-wh);
    flex-shrink: 0;
}
.lcai-header__info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.lcai-header__dot {
    position: relative;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #8fe3b0;
    box-shadow: 0 0 0 3px rgba(143, 227, 176, .25);
    flex-shrink: 0;
    animation: lcai-dot-glow 2s ease-in-out infinite;
}
.lcai-header__dot::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(143, 227, 176, .6);
    animation: lcai-dot-ping 2s ease-out infinite;
    pointer-events: none;
}
@keyframes lcai-dot-ping {
    0% { transform: scale(1); opacity: .8; }
    70%, 100% { transform: scale(2.6); opacity: 0; }
}
@keyframes lcai-dot-glow {
    0%, 100% { box-shadow: 0 0 0 3px rgba(143, 227, 176, .25); }
    50% { box-shadow: 0 0 0 4px rgba(143, 227, 176, .4); }
}
@media (prefers-reduced-motion: reduce) {
    .lcai-header__dot,
    .lcai-header__dot::before {
        animation: none;
    }
}
.lcai-header__title {
    font-family: var(--font-en-02, 'montserrat', sans-serif);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .12em;
    line-height: 1.3;
    white-space: nowrap;
}
.lcai-header__sub {
    display: block;
    font-family: var(--font-jp, sans-serif);
    font-size: .62rem;
    font-weight: 400;
    letter-spacing: .06em;
    opacity: .85;
}
.lcai-header__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.lcai-header__close,
.lcai-header__reset {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: var(--lcai-wh);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, opacity .2s ease;
    flex-shrink: 0;
}
.lcai-header__close:hover,
.lcai-header__reset:hover:not(:disabled) { background: rgba(255, 255, 255, .3); }
.lcai-header__reset svg {
    width: 16px;
    height: 16px;
}
.lcai-header__reset[aria-expanded="true"] { background: rgba(255, 255, 255, .3); }
.lcai-header__reset:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* 会話リセットの確認バー（ヘッダー直下。JSが hidden を付け外しする） */
.lcai-reset-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
    padding: 10px 14px;
    background: var(--lcai-wh);
    border-bottom: 1px solid var(--color-gy, #dddddd);
    animation: lcai-slide-down .2s ease both;
}
.lcai-reset-confirm[hidden] { display: none; }
@keyframes lcai-slide-down {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.lcai-reset-confirm__text {
    font-size: .74rem;
    line-height: 1.6;
    letter-spacing: .02em;
    color: var(--lcai-text);
}
.lcai-reset-confirm__btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.lcai-reset-confirm__cancel,
.lcai-reset-confirm__ok {
    padding: 7px 12px;
    font-size: .74rem;
    line-height: 1.4;
    letter-spacing: .03em;
    border-radius: 16px;
    cursor: pointer;
    transition: background .2s ease, opacity .2s ease;
}
.lcai-reset-confirm__cancel {
    color: var(--lcai-primary);
    background: var(--lcai-wh);
    border: 1px solid var(--lcai-accent-dark);
}
.lcai-reset-confirm__cancel:hover { background: var(--lcai-accent); border-color: var(--lcai-accent); }
.lcai-reset-confirm__ok {
    color: var(--lcai-wh);
    background: #c0564f;
    border: 1px solid #c0564f;
    font-weight: 600;
}
.lcai-reset-confirm__ok:hover { opacity: .85; }

/* messages */
.lcai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--lcai-cream);
    overscroll-behavior: contain;
    overflow-anchor: none; /* タイプライター表示中のスクロール位置制御をJS側で行うため */
}
.lcai-msg {
    display: flex;
    gap: 8px;
    max-width: 88%;
    animation: lcai-slide-up .3s ease both;
}
@keyframes lcai-slide-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
/* 保存済み会話から復元した要素はスライドインさせない（一括描画のため） */
.lcai-msg.is-restored,
.lcai-chips.is-restored,
.lcai-ai-note.is-restored { animation: none; }
.lcai-msg--bot { align-self: flex-start; }
.lcai-msg--user { align-self: flex-end; }
.lcai-msg__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: url(../images/lcai-avatar.png) no-repeat center / cover;
    flex-shrink: 0;
    align-self: flex-end;
}
.lcai-msg__bubble {
    padding: 10px 14px;
    font-size: .82rem;
    line-height: 1.7;
    letter-spacing: .02em;
    color: var(--lcai-text);
    word-break: break-word;
}
/* JS 生成メッセージのみ改行を保持（初期メッセージはHTML整形の空白があるため除外） */
.lcai-msg__bubble.lcai-msg__bubble--pre {
    white-space: pre-wrap;
}
/* タイプライター表示中のカーソル */
.lcai-msg__bubble.is-typing::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: var(--lcai-accent-dark);
    animation: lcai-caret 1s steps(2) infinite;
}
@keyframes lcai-caret {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
.lcai-msg--bot .lcai-msg__bubble {
    background: var(--lcai-wh);
    border-radius: 2px 14px 14px 14px;
    box-shadow: 0 2px 8px rgba(38, 38, 38, .06);
}
.lcai-msg--user .lcai-msg__bubble {
    background: var(--lcai-accent);
    border-radius: 14px 2px 14px 14px;
}

/* プライバシーポリシー同意文言（最初のあいさつ吹き出しの直下に自然に表示する） */
.lcai-policy-note {
    align-self: flex-start;
    max-width: 88%;
    margin: -6px 0 0 38px; /* アバター幅30px + 余白8px で吹き出しの左端に揃える */
    font-size: .66rem;
    line-height: 1.6;
    letter-spacing: .02em;
    color: #8f8f8f;
}
.lcai-policy-note a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .2s ease;
}
.lcai-policy-note a:hover { color: var(--lcai-primary); }

/* 最下部へスクロールするボタン（会話を遡った時に表示。biancaclinic.jp 参考） */
.lcai-scroll-btn {
    position: absolute;
    right: 14px;
    bottom: 122px; /* 入力エリア（約110px）の上に重ならない位置 */
    z-index: 6;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--lcai-primary);
    color: var(--lcai-wh);
    box-shadow: 0 6px 18px rgba(38, 38, 38, .28);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, background .2s ease;
}
.lcai-scroll-btn.is-show {
    opacity: 1;
    pointer-events: auto;
}
.lcai-scroll-btn:hover { background: var(--lcai-accent-dark); }
.lcai-scroll-btn svg {
    width: 17px;
    height: 17px;
}

/* 最新のAI回答の直下に表示する注意書き（JSで最新回答にのみ付与） */
.lcai-ai-note {
    align-self: flex-start;
    max-width: 88%;
    margin: -8px 0 0 38px; /* アバター幅30px + 余白8px で吹き出しの左端に揃える */
    font-size: .66rem;
    line-height: 1.6;
    letter-spacing: .02em;
    color: #8f8f8f;
    animation: lcai-slide-up .3s ease both;
}

/* FAQ quick replies */
.lcai-faq {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.lcai-faq__lead {
    font-size: .72rem;
    color: var(--lcai-primary);
    letter-spacing: .04em;
}
.lcai-faq__btn {
    padding: 9px 14px;
    font-size: .78rem;
    line-height: 1.5;
    letter-spacing: .02em;
    text-align: left;
    color: var(--lcai-primary);
    background: var(--lcai-wh);
    border: 1px solid var(--lcai-accent-dark);
    border-radius: 20px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}
.lcai-faq__btn:hover {
    background: var(--lcai-accent);
    border-color: var(--lcai-accent);
}
.lcai-faq__btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* bot bubble links */
.lcai-msg--bot .lcai-msg__bubble a {
    color: var(--lcai-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
    transition: opacity .2s ease;
}
.lcai-msg--bot .lcai-msg__bubble a:hover { opacity: .7; }

/* ▶付きリンク（予約カレンダー誘導）はボタン風で目立たせる */
.lcai-msg--bot .lcai-msg__bubble a.lcai-link--cta {
    display: inline-block;
    margin: 4px 0 2px;
    padding: 8px 18px;
    background: var(--lcai-primary);
    color: var(--lcai-wh);
    font-weight: 600;
    letter-spacing: .04em;
    text-decoration: none;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(103, 116, 117, .3);
    word-break: break-word;
    transition: opacity .2s ease, transform .2s ease;
}
.lcai-msg--bot .lcai-msg__bubble a.lcai-link--cta:hover {
    opacity: .85;
    transform: translateY(-1px);
}

/* choice chips */
.lcai-chips {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    align-self: flex-start;
    flex-shrink: 0; /* 親が flex 列のため、縮んで高さ0にならないように */
    max-width: 88%;
    padding-left: 38px; /* アバター幅ぶんインデントしてバブル直下に揃える */
    margin-top: -4px;
    max-height: 180px;
    overflow-y: auto;
    animation: lcai-slide-up .3s ease both;
}
/* スクロール余地があるときだけ下端をフェードさせ、選択肢が途中で切れて見えないようにする。
   has-more は JS（updateChipsFade）が scroll 位置に応じて付け外しする */
.lcai-chips.has-more {
    padding-bottom: 12px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent 100%);
}
.lcai-chip {
    padding: 7px 14px;
    font-size: .76rem;
    line-height: 1.5;
    letter-spacing: .02em;
    color: var(--lcai-primary);
    background: var(--lcai-wh);
    border: 1px solid var(--lcai-accent-dark);
    border-radius: 16px;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}
.lcai-chip:hover:not(:disabled) {
    background: var(--lcai-accent);
    border-color: var(--lcai-accent);
}
.lcai-chip:disabled {
    opacity: .45;
    cursor: not-allowed;
}
/* 選択済みチップは無効化後も塗りで区別する */
.lcai-chip.is-selected {
    background: var(--lcai-primary);
    border-color: var(--lcai-primary);
    color: var(--lcai-wh);
    opacity: 1;
}

/* typing indicator
 ステータス文言の末尾に「…」として小さなドットを続けて表示する */
.lcai-typing .lcai-msg__bubble {
    display: flex;
    /* テキストを持たないflexアイテム（ドット）のベースライン＝下端となるため、
       baseline揃えでドット下端が文言のベースラインに乗る */
    align-items: baseline;
    gap: 4px;
    padding: 12px 16px;
}
.lcai-typing__dots {
    display: flex;
    gap: 3px;
    align-items: center;
}
/* 思考プロセスのステータス文言（時間差で切り替わる） */
.lcai-typing__status {
    font-size: .74rem;
    line-height: 1.5;
    letter-spacing: .03em;
    color: var(--lcai-primary);
    opacity: .85;
}
.lcai-typing__status:empty {
    display: none;
}
.lcai-typing__status.is-in {
    animation: lcai-status-in .35s ease both;
}
@keyframes lcai-status-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: .85; transform: none; }
}
.lcai-typing__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--lcai-primary);
    animation: lcai-bounce 1.2s infinite ease-in-out;
}
.lcai-typing__dot:nth-child(2) { animation-delay: .15s; }
.lcai-typing__dot:nth-child(3) { animation-delay: .3s; }
@keyframes lcai-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-2px); opacity: .9; }
}

/* input area
--------------------------------------------------- */

.lcai-input {
    flex-shrink: 0;
    padding: 10px 14px 12px;
    background: var(--lcai-wh);
    border-top: 1px solid var(--color-gy, #dddddd);
}
.lcai-input__row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.lcai-input__field {
    flex: 1;
    min-height: 40px;
    max-height: 96px;
    padding: 9px 14px;
    font-size: .82rem;
    line-height: 1.6;
    color: var(--lcai-text);
    background: var(--color-wgy2, #f4f4f4);
    border: 1px solid transparent;
    border-radius: 18px;
    resize: none;
    outline: none;
    transition: border-color .2s ease, background .2s ease;
    font-family: inherit;
}
.lcai-input__field:focus {
    background: var(--lcai-wh);
    border-color: var(--lcai-accent-dark);
}
.lcai-input__field::placeholder { color: #9aa0a0; }
.lcai-input__send {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--lcai-primary);
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease;
    flex-shrink: 0;
}
.lcai-input__send svg {
    width: 17px;
    height: 17px;
    fill: var(--lcai-wh);
    margin-left: 2px;
}
.lcai-input__send:hover:not(:disabled) { transform: scale(1.08); }
.lcai-input__send:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* meta row: char counter + remaining count */
.lcai-input__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 4px;
    font-size: .66rem;
    letter-spacing: .03em;
    color: var(--color-theme-08, #666666);
}
.lcai-input__count.is-limit { color: #c0564f; font-weight: 600; }
.lcai-input__remaining strong {
    font-family: var(--font-en-02, 'montserrat', sans-serif);
    font-size: .8rem;
    color: var(--lcai-primary);
    margin: 0 2px;
}
.lcai-input__remaining.is-empty strong { color: #c0564f; }

/* input disabled (no remaining replies) */
.lcai-input.is-disabled .lcai-input__field {
    background: var(--color-wgy3, #eeeeee);
    cursor: not-allowed;
}

/* sp
--------------------------------------------------- */

@media screen and (max-width: 767px) {
    /* スマホは画面幅いっぱいの下部バナーのまま（スクロール縮小は行わない） */
    .lcai-launcher {
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        bottom: 78px;
        width: auto;
        max-width: none;
        padding: .5em 1em .5em .625em;
        border-radius: .5em;
    }
    .lcai-launcher__tx {
        flex: 1;
        max-width: none;
    }
    .lcai-widget {
        right: 12px;
        bottom: 84px;
        width: calc(100vw - 24px);
        height: min(560px, calc(100dvh - 160px));
    }
}

/* 1401px以上は .fixed-menu が画面上部に移動するため、画面最下部に配置できる */
@media screen and (min-width: 1401px) {
    .lcai-launcher { bottom: 20px; }
    .lcai-widget {
        bottom: 20px;
        height: min(600px, calc(100dvh - 130px));
    }
}

/* 失敗時の案内は通常のAI回答と同じ吹き出しで出す（エラー色は付けない）。再送ボタンのみ区別 */
.lcai-chip--retry {
    font-weight: 600;
}
.lcai-chip--retry::before {
    content: '↻ ';
}
