/* アイコン状態 */
#chat-396-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    line-height: normal;
    text-align: center;
    z-index: 100000;
}

/* チャットウィンドウ */
#chat-396-box {
    position: fixed;
    bottom: 80px; /* アイコンの上 */
    right: 20px;
    width: var(--chat396-w, 340px);
    height: var(--chat396-h, 560px);
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    font-family: sans-serif;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;

    /* 初期は下に隠して透明 */
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ウィンドウを開くとき */
#chat-396-box.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ヘッダー */
#chat-396-header {
    background: #0073aa;
    color: #fff;
    padding: 10px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* チャット本文 */
#chat-396-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #f9f9f9;
}

/* メッセージ */
.chat-396-user {
    text-align: right;
    background: #0073aa;
    color: #fff;
    padding: 6px 10px;
    margin: 5px 0;
    border-radius: 10px;
    max-width: 80%;
}

.chat-396-bot {
    text-align: left;
    background: #e5e5e5;
    padding: 6px 10px;
    margin: 5px 0;
    border-radius: 10px;
    max-width: 80%;
}

#chat-396-close {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 8px;
}

/* フッター */
#chat-396-footer {
  display: flex;
  border-top: 1px solid #ccc;
  align-items: stretch;
}

#chat-396-input {
  flex: 1;
  border: none;
  padding: 10px;
  resize: none;
  outline: none;
  font-size: 14px;
  line-height: 1.4;
  border-radius: 0 0 0 12px;
  box-sizing: border-box;
}

#chat-396-send {
  width: 84px;
  border: none;
  background: #0073aa;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  border-radius: 0 0 10px 0;
  box-sizing: border-box;
}
/* スマホ対応 */
@media(max-width:600px){
    #chat-396-box {
        width: 90%;
    	height: 70vh;            /* ← スマホはvhで広く */
        bottom: 80px;
        right: 5%;
    }
    #chat-396-icon {
        bottom: 20px;
        right: 5%;
    }
}
