h2 {
    text-align: center;
}

.chat-container {
    max-width: 80%;
    margin: 0 auto;
    padding: 20px;
    border-radius: 8px;
    flex-direction: column;
}

.bubble {
    padding: 20px 15px;
    margin: 5px 0;
    border-radius: 10px;
    position: relative;
    max-width: 90%;
    font-size: 16px;
}

.rounded-textarea {
    border-radius: 10px;
    padding: 8px;
    border: 1px solid #ccc;
    width: 100%;
    box-sizing: border-box;
}

.user-bubble {
    background-color: #f5f5f5;
    align-self: flex-end; /* 右側に配置 */
    margin-left: auto; /* 左側の余白を自動に */
}

.bot-bubble {
    background-color: #ffffff;
    align-self: flex-start; /* 左側に配置 */
    margin-right: auto; /* 右側の余白を自動に */
}

/* 吹き出しの三角形部分を作成 */
.user-bubble:after {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 10px; /* 吹き出しの右側からの距離 */
    border-width: 10px;
    border-style: solid;
    border-color: transparent transparent #f5f5f5 transparent; /* 下向きの三角形 */
}

.bot-bubble:after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 10px; /* 吹き出しの左側からの距離 */
    border-width: 10px;
    border-style: solid;
    border-color: transparent transparent #ffffff transparent; /* 下向きの三角形 */
}

.bot-answer {
    text-align: left; /* 左寄せ */
    margin-bottom: 5px; /* 下部マージンを追加 */
    width: 100%; /* 幅を100%に設定 */
}

/* 親要素をflexboxで扱う場合の例 */
.chat-output {
    display: flex;
    flex-direction: column; /* 縦方向に並べる */
    align-items: flex-start; /* 左寄せ */
    width: 85%; /* スマホのときは100%にする */
}

.info-text {
    font-size: 0.8em; /* サイズを小さく */
    color: rgba(0, 0, 0, 0.5); /* 色を薄く（透明度を50%に設定） */
    margin-top: 10px; /* 上部マージンを追加して見やすくする */
}

/* ボタンのスタイルを追加 */
button {
    font-size: 18px;
    /* フォントサイズを調整 */
    padding: 8px 15px;
    /* 内側のスペースを調整 */
    background-color: #fc93a4;
    /* 背景色を設定 */
    color: rgb(253, 253, 253);
    /* 文字色を設定 */
    border: none;
    /* ボーダーを削除 */
    border-radius: 5px;
    /* 角を丸める */
    cursor: pointer;
    /* ポインタカーソルを表示 */
    transition: background-color 0.3s ease;
    /* ホバー時の色変更をスムーズに */
    font-weight: bold;
    /* 文字を太字にする */
}

.limit-message {
    text-align: center;
    color: red;
}

/* スマホ用のスタイル */
@media (max-width: 600px) {
    body {
        font-size: 12px;
        font-weight: 300; /* フォントを細くする */
    }

    textarea {
        width: 100%;
        margin: 0 auto; /* センター揃え（任意） */
        display: block; /* ブロック要素として表示 */
        font-size: 1em; /* フォントサイズを調整（必要に応じて変更） */
    }

    button {
        font-size: 15px;
        /* フォントサイズを調整 */
        padding: 7px 10px;
    }

    legend {
        font-size: 14px; /* フォントサイズを小さく設定（必要に応じて調整） */
    }

    .chat-output {
        width: 100%; /* スマホのときは100%にする */
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 2;
    }
}

.fade-in {
    animation: fadeIn 2s ease-in-out forwards;
}