
/* ===== FABボタン ===== */
#chat-fab{
    position:fixed;
    right:20px;
    bottom:100px;
    background:#e83421;
    color:#fff;
    border-radius:50px;
    padding:12px 16px;
    display:flex;
    align-items:center;
    gap:8px;
    cursor:pointer;
    box-shadow:0 4px 12px rgba(0,0,0,0.2);
    z-index:9999;
}

.chat-fab-icon{
    background:#fff;
    color:#e83421;
    width:28px;
    height:28px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
    font-size:12px;
}

.chat-fab-text{
    font-size:13px;
    font-weight:600;
}

/* ===== ウィジェット本体 ===== */
#chat-widget{
    position:fixed;
    right:20px;
    bottom:90px;
    width:320px;
    height:500px;
    background:#fff;
    border-radius:12px;
    box-shadow:0 6px 20px rgba(0,0,0,0.25);
    display:none;
    flex-direction:column;
    overflow:hidden;
    z-index:9999;
    font-family:sans-serif;
}

@media (max-width:650px){
    #chat-fab{
    bottom:80px;
}
    #chat-widget{
    height:400px;
    bottom:80px;
}
#chat-header{
    padding:5px;
}
}

/* ヘッダー */
#chat-header{
    background:#e83421;
    color:#fff;
    padding:10px;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

/* 閉じる */
#chat-close{
    cursor:pointer;
    font-size:20px;
}

/* チャット表示 */
#chat-body{
    flex:1;
    padding:10px;
    overflow-y:auto;
    background:#f6f6f6;
}

/* 入力エリア */
#chat-input-area{
    display:flex;
    border-top:1px solid #ddd;
}

#chat-input{
    flex:1;
    border:none;
    padding:10px;
    outline:none;
    font-size:16px;
}

#chat-send{
    background:#e83421;
    color:#fff;
    border:none;
    width:80px;
    cursor:pointer;
    font-size:16px;
}

#chat-send:hover{
    background:#b82110;
}

/* メッセージ */
.chat-msg{
    margin:8px 0;
}

.chat-user{
    text-align:right;
}

.chat-ai{
    text-align:left;
}

.chat-bubble{
    display:inline-block;
    padding:8px 12px;
    border-radius:10px;
    max-width:80%;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
}

.chat-user .chat-bubble{
    background:#e83421;
    color:#fff;
}

.chat-ai .chat-bubble{
    background:#eaeaea;
}

.chat-thinking{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:13px;
    color:#666;
}

/* くるくるローディング */
.chat-thinking-spinner{
    width:14px;
    height:14px;
    border:2px solid #ddd;
    border-top:2px solid #e83421;
    border-radius:50%;
    animation:chat-spin 0.8s linear infinite;
}

@keyframes chat-spin{
    0% { transform:rotate(0deg); }
    100% { transform:rotate(360deg); }
}