.chatSessionLayout {
    position: relative;
    height: 100%;
    min-height: 200px;
    width: 100%;
    align-items: center;
    margin-bottom: 10px;
    overflow: auto;
    scrollbar-width: none;
    /* Hide scrollbar */
}

.chatSessionLayout::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for WebKit browsers (Chrome, Safari) */
}

.chatScrollArea {
    /* background-color: green; */
    /* position: relative; */
    position: absolute;
    width: 100%;
    /* height: calc(100vh - 300px); */
    /* height: 100%; */
    min-height: 200px;
}

.chatMessageContainer {
    height: 100%;
    width: 100%;
    position: relative;
    margin-bottom: 100px;
}

#chat-log {
    white-space: pre-wrap;
    height: 400px;
    /* border: 1px solid #ccc; */
    padding: 14px 20px 10px 20px;
    height: 100%;
}

.user-message {
    display: flex;
    justify-content: flex-end;
    /* 우측 정렬 */
    width: 100%;
    margin-bottom: 36px;
    /* 기존 스타일 유지 */
    background: none;
    text-align: right;
}

.user-message p {
    display: inline-block;
    background-color: var(--key1);
    color: var(--grey4);
    border-radius: 16px 16px 0px 16px;
    padding: 8px 14px;
    margin: 0;
    max-width: 60%;
    /* 20글자 이상이면 줄바꿈, 화면 크기에 따라 조정 */
    word-break: break-word;
    white-space: pre-line;
    text-align: left;
    font-size: 16px;
    line-height: 1.5;
}

.assistant-message {
    color: var(--grey3);
    text-align: left;
    margin-bottom: 70px;
    /* [추가] 메시지 간 간격 */
}

/* 어시스턴트 메시지 말풍선 스타일 */
.assistant-message .markdown-content {
    display: inline-block;
    max-width: 60%;
    /* 최대 너비 제한 */
    padding: 8px 24px;
    margin: 0;
    background-color: var(--greyBg);
    color: var(--grey4);
    border-radius: 0px 16px 16px 16px;
    word-break: break-all;
    white-space: pre-line;
    text-align: left;
    font-size: 16px;
    line-height: 1.5;
}

.assistant-message.loading-message {
    padding: 8px 14px;
}

.system-message {
    align-self: flex-start;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 14px;
    color: var(--blue1);
    font-size: 16px;
    text-align: left;
}

.loading-dots .dot {
    animation: dot-blink 1.4s infinite;
    animation-fill-mode: both;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-blink {

    0%,
    80%,
    100% {
        opacity: 0;
    }

    40% {
        opacity: 1;
    }
}

/* 답변 완료 후 생성되는 버튼 스타일 */
.response-button {
    /* [추가] 아이콘과 텍스트 정렬을 위한 스타일 */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    /* 아이콘과 텍스트 사이의 간격 */
    width: 120px;
    height: 40px;
    border: 1px solid var(--grey3);
    border-radius: var(--borderRadiusBtnSmall);
    background-color: white;
    /* 필요에 따라 다른 스타일 (배경색, 테두리 등)을 추가할 수 있습니다. */
}

.response-button:hover {
    background-color: var(--btnHover);
}

/* [추가] 버튼 내 SVG 아이콘 스타일 */
.response-button svg {
    width: 17px;
    height: 10px;
}

.response-button svg path {
    stroke: var(--grey3);
    /* SVG 경로의 색상 */
}

/* [추가] 버튼 내 텍스트 스타일 */
.response-button span {
    color: var(--grey4);
    /* 텍스트 색상 */
    font-size: 14px;
    /* 텍스트 크기 */
    font-weight: 500;
}

/* [추가] 출처 컨테이너 스타일 */
.source-container {
    margin-top: 12px;
    padding: 16px;

}

.source-container p {
    display: block;
    /* [추가] p 태그가 세로로 배열되도록 명시적으로 설정 */
    font-size: 14px;
    line-height: 1.4;
    color: var(--grey4);
    margin: 0 0 2px 0;
}

/* 출처 컨테이너 내 링크 스타일 제거 */
.source-container a {
    text-decoration: none;
    /* 밑줄 제거 */
    color: inherit;
    /* 부모 요소의 색상 상속 */
}

.source-container a:visited {
    color: inherit;
    /* 방문한 링크도 부모 요소의 색상 상속 */
}

.source-container a:hover {
    text-decoration: underline;
    /* 호버 시에만 밑줄 표시 */
}

.source-container p:last-child {
    margin-bottom: 0;
}

/* [추가] 버튼 활성화 시 SVG 회전 */
.response-button.active svg {
    transform: rotate(180deg);
}

.response-button svg {
    transition: transform 0.3s ease;
    /* 부드러운 회전 효과 */
}

/* [추가] 버튼들을 감싸는 컨테이너 스타일 */
.response-actions-container {
    display: flex;
    /* justify-content: space-between;  요소를 양 끝으로 보내는 대신, gap으로 간격 조절 */
    align-items: center;
    gap: 20px;
    /* '출처 보기' 버튼과 피드백 버튼 그룹 사이의 간격 */
    margin-top: 12px;
    margin-left: 22px;
    /* 답변 텍스트와의 간격 */
}

/* [추가] 피드백 버튼 그룹 스타일 */
.feedback-buttons {
    display: flex;
    gap: 8px;
    /* 좋아요/싫어요 버튼 사이의 간격 */
}

/* [추가] 좋아요/싫어요 버튼 공통 스타일 */
.like-button,
.dislike-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    /* response-button 높이와 동일하게 */
    height: 40px;
    background-color: white;
    border: 1px solid var(--grey3);
    border-radius: var(--borderRadiusBtnSmall);
    cursor: pointer;
}

/* [추가] 좋아요/싫어요 버튼 SVG 스타일 */
.like-button svg,
.dislike-button svg {
    width: 18px;
    height: 18px;
}

.like-button svg path,
.dislike-button svg path {
    stroke: var(--grey4);
    fill: none;
    /* 기본 상태에서는 채우지 않음 */
}

/* [추가] 활성화된 피드백 버튼 스타일 */
.like-button.active svg path,
.dislike-button.active svg path {
    fill: var(--blue1);
    /* 활성화 시 채우기 색상 */
    stroke: none;
    /* 활성화 시 테두리 제거 */
}

/* [추가] 로딩 메시지 컨텐츠 스타일 */
.loading-content {
    display: flex;
    align-items: center;
    gap: 1px;
    /* 텍스트와 점 사이의 간격 (4px -> 2px로 수정) */
}

/* 출처 보기 섹션 제목 스타일 */
.source-section-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

/* 출처 보기 항목 스타일 */
.source-item {
    margin: 4px 0;
    padding-left: 8px;
}

/* 출처 보기 구분선 스타일 */
.source-divider {
    border-top: 1px solid #e0e0e0;
    margin: 12px 0;
    width: 60%;
}