* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

	
p, h1, h2, h3, h4, h5, h6 {
  margin: 0;
  padding: 0;
}


.ai-message.markdown-body {
  font-family: 'Noto Sans KR', sans-serif;
  line-height: 1.8;
  font-size: 16px;
  color: #333;
  background-color: #fefefe;
  max-width: 768px;
  padding:0px;
}

.ai-message.markdown-body h3 {
  font-size: 20px;
  margin-top: 24px;
  margin-bottom: 12px;
  color: #002060;
  border-left: 4px solid #002060;
  padding-left: 10px;
}

.ai-message.markdown-body h4 {
  font-size: 17px;
  margin-top: 16px;
  margin-bottom: 8px;
  color: #003366;
}

.ai-message.markdown-body ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.ai-message.markdown-body ul ul {
  margin-top: 4px;
  margin-bottom: 4px;
}

.ai-message.markdown-body li {
  margin-bottom: 6px;
}

.ai-message.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  margin-bottom: 24px;
  font-size: 15px;
}

.ai-message.markdown-body th,
.ai-message.markdown-body td {
  border: 1px solid #ccc;
  padding: 10px 12px;
  text-align: left;
}

.ai-message.markdown-body th {
  background-color: #f0f4f8;
  font-weight: 600;
}

.ai-message.markdown-body strong {
  color: #001F3F;
}

.ai-message.markdown-body p {
  margin-bottom: 16px;
}

@media screen and (max-width: 768px) {
  .ai-message.markdown-body {
    font-size: 15px;
    padding: 20px;
  }

  .ai-message.markdown-body h3 {
    font-size: 18px;
  }

  .ai-message.markdown-body table th,
  .ai-message.markdown-body table td {
    font-size: 14px;
    padding: 8px;
  }
}

.ai-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.ai-text th,
.ai-text td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
}

.ai-text h3,
.ai-text h4 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

.markdown-body p,
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6,
.markdown-body ul,
.markdown-body ol,
.markdown-body li,
.markdown-body table,
.markdown-body blockquote {
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.5;
}



/* 제목(h3) 위 공백만 약간 주고 아래는 거의 없음 */
.ai-message h3 {
  font-size: 17px;
  margin: 0px 0 0px;
  color: #002060;
}

/* 리스트 초기화 */
.ai-message ul,
.ai-message ol {
  list-style: none;
  margin: 4px 0;
  padding-left: 0;
}

/* 리스트 마커 제거 */
.ai-message li::marker {
  content: '';
}

/* 리스트 항목 간격 */
.ai-message li {
  margin: 2px 0;
  padding-left: 0;
}

/* 표 */
.ai-message table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 14px;
}

.ai-message th,
.ai-message td {
  border: 1px solid #ccc;
  padding: 6px;
  text-align: left;
}

.ai-message thead {
  background-color: #f1f1f1;
}
.ai-message hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 8px 0;
}
.ai-message p > strong {
  font-size: 18px;
  color: #001F3F;
}

.ai-message ul > li {
  font-size: 16px;
  color: #444;
  margin-bottom: 0.5em;
}

html, body {
	margin: 0;
	padding: 0;
	height: 100%;
	overflow: hidden;  /* 바디 스크롤 막기 */
	font-size: unset;
	font-family: "Pretendard",sans-serif;	
}
.user-file-label {
  align-self: flex-end;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  color: #333;
  display: inline-block;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 10px;
  max-width: 90%;
  padding: 8px 14px;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.user-file-label a {
  color: #0074D9;
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95rem;
    color: #333;
}

table th,
table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
    vertical-align: middle;
}

table th {
    background-color: #f4f4f4;
    font-weight: bold;
}

table tr:nth-child(even) {
    background-color: #fafafa;
}

table tr:hover {
    background-color: #f1f7ff;
}

.user-file-label a:hover {
  text-decoration: underline;
}
.pdf-icon{
	width:30px; height:30px;
}

.footer_margin    {margin-top:0px !important;}
html {
}
ol, ul {
	padding-left: 0 !important;
	margin-left: 0;
}    
.container-fluid {
	padding: 0;
	display: flex;
	height: 100vh;
}
#content {
	display: flex;
	flex-direction: row;
	min-height: 100vh;
	width: 100%;
	margin: 0 auto;
	position:relative;
}
#sidebar {
	max-height:calc(100vh - 100px);
	background-color: #f8f9fa;
	transition: all 0.3s;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
	left: 0;
	top: 0;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	overflow-y:scroll;
}
#sidebar::-webkit-scrollbar {
	display: none;
}

#sidebar.collapsed {
	width: 80px !important;
}

.new-chat-btn {
	padding: 8px 8px 8px 8px;
}

.new-chat-btn .btn-primary {
	width: 100%;
	padding: 10px;
	background-color: #1C2252;
	border-color: #1C2252;
	transition: background-color 0.3s ease;		
}

.new-chat-btn .btn-primary:hover {
	background-color: #2E347F;
	border-color: #2E347F;
}

.chat-history {
	overflow-y: scroll;
	flex: 1;
}

.chat-history::-webkit-scrollbar {
	width: 6px; 
}

.chat-history::-webkit-scrollbar-track {
	background: #f8f9fa; /* 스크롤바 트랙 배경 (사이드바 배경과 조화) */
	border-radius: 3px;
}

.chat-history::-webkit-scrollbar-thumb {
	background: #d4d4d4; /* 스크롤바 색상 */
	border-radius: 3px;
	transition: background 0.2s ease;
}

.chat-history::-webkit-scrollbar-thumb:hover {
	background: #b0b0b0; /* 호버 시 약간 더 진한 색상 */
}

.chat-history-title {
	color: #6c757d;
	font-size: 0.9rem;
	font-weight: 600;
	text-transform: uppercase;
}

.chat-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.delete-thread-btn {
	background: transparent;
	border: none;
	cursor: pointer;
	color: #d00;
	flex-shrink: 0;
	font-size: 18px;
}

.delete-thread-btn:hover {
	color: #ff3b3b;
}
.chat-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 5px 0px;
	color: #495057;
	font-size:14px;
	text-decoration: none;
	transition: background-color 0.2s;
	overflow: hidden;        
	flex: 1;
	text-decoration: none;
	overflow: hidden;
	
}

.chat-item:hover {
	background-color: #e9ecef;
	color: #212529;
}

.chat-item.active {
	background-color: #e2e8f0;
	color: #212529;
	font-weight: 500;
}

.chat-item i {
	color: #1C2252;
	font-size: 1.1rem;
		margin-right: 8px;
flex-shrink: 0;
}

.chat-title {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sidebar-menu {
	margin-top: auto;
	border-top: 1px solid #dee2e6;
}

#sidebar .nav-link {
	color: #495057;
	padding: 12px 20px;
	display: flex;
	align-items: center;
}

#sidebar .nav-link:hover {
	background-color: #e9ecef;
}

.nav-label {
	margin-left: 10px;
	white-space: nowrap;
}

#sidebar.collapsed .nav-label {
	display: none;
}

#sidebar-header {
	padding: 15px;
	border-bottom: 1px solid #dee2e6;
}

#sidebar.collapsed .sidebar-title {
	display: none;
}

#sidebar.collapsed .new-chat-btn .btn-primary {
	padding: 10px 0;
	justify-content: center;
}

#sidebar.collapsed .chat-history-title,
#sidebar.collapsed .chat-title {
	display: none;
}

#sidebar.collapsed .chat-item {
	justify-content: center;
	padding: 10px 0;
}

.toggle-btn {
	border: none;
	background: transparent;
	cursor: pointer;
}

#sidebar.collapsed .toggle-btn .bi-chevron-left {
	display: none;
}

#sidebar.collapsed .toggle-btn .bi-chevron-right {
	display: inline-block;
}

.toggle-btn .bi-chevron-right {
	display: none;
}

.user-message {
	align-self: flex-end; 
	background-color: rgba(233, 233, 233, 0.5); 
	border-bottom-color: rgba(0, 0, 0, 0.1);
	border-bottom-left-radius: 24px;
	border-bottom-right-radius: 24px;
	border-bottom-style: solid;
	border-bottom-width: 0px;
	border-left-color: rgba(0, 0, 0, 0.1);
	border-left-style: solid;
	border-left-width: 0px;
	border-right-color: rgba(0, 0, 0, 0.1);
	border-right-style: solid;
	border-right-width: 0px;
	border-top-color: rgba(0, 0, 0, 0.1);
	border-top-left-radius: 24px;
	border-top-right-radius: 24px;
	border-top-style: solid;
	border-top-width: 0px;
	box-sizing: border-box;
	color: rgb(13, 13, 13); 
	display: block;
	font-feature-settings: normal;
	font-size: 16px;
	font-variation-settings: normal;
	line-height: 24px;
	margin: 0;
	max-width: 100%; 
	overflow-wrap: break-word; 
	padding: 10px 20px;
	position: relative;
	scrollbar-color: rgb(236, 236, 236) rgba(0, 0, 0, 0);
	margin-bottom:40px;		
	
}

.ai-message {
	align-items: flex-start;
	align-self: flex-start;
	width:100%;
	box-sizing: border-box;
	color: rgb(13, 13, 13);
	display: flex;
	flex-direction: column;
	font-size: 16px;
	line-height: 24px;
	margin: 0;
	overflow-wrap: break-word;
	padding: 10px 15px; 
	position: relative;
	text-align: start;
	text-wrap: wrap;
	gap: 8px;
	margin-bottom:20px;		
}


body.sidebar-collapsed #content {
	margin-left: 80px;
	width: calc(100% - 80px);
}

.chat-messages{
	overflow-y: auto;
	padding: 20px 16px;
	display: flex;
	flex-direction: column;
	max-width:800px;
}
.center-input-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* ✅ 왼쪽 정렬로 변경 */
  width: 100%;
  max-width: 800px;        /* ✅ 입력창 최대 너비 제한 */
  margin: 0 auto;          /* ✅ 전체 중앙에 배치 */
}

.empty-message {
	display: flex;
	justify-content: center;
	align-items: center;
	color: #6c757d;
	font-size: 1.2rem;
	text-align: center;
	justify-content: center;		
}

.message-input {
	padding: 5px 0;
	width:100%;
	max-width:800px;
}
textarea.form-control {
	resize: none;
}
#sendButton {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s;
}
#sendButton:hover {
	opacity: 0.8;
}


@media (max-width: 768px) {

	.right-wrap{padding:10px;}
	
	.sidebar {
		transform: translateX(-100%);
	}
	#right_quick > div{
		display:none !important;
	}
	.chat-container {
		margin-left: 0;
		width: 100%;
		max-width: 100%;
	}
	.message-input {
		left: 0;
		transform: none;
		max-width: 100%;
	}
	.sidebar.active {
		transform: translateX(0);
	}
	  .main-card-container {
    flex-direction: column; /* 세로 정렬 */
  }
  .main-card-inner {
    flex-direction: column; /* 내부도 세로로 */
    gap: 12px;
  }
  .main-image-area,
  .main-tool-area {
    width: 100%; /* 가로폭 꽉 채우기 */
  }
   .d-flex.flex-wrap {
    flex-wrap: nowrap !important;           
    overflow-x: auto;            
    -webkit-overflow-scrolling: touch; 
    padding: 8px 0;              /* 상하 여백 추가 */

    /* 스크롤바 숨기기 */
    -ms-overflow-style: none;    /* IE/Edge */
    scrollbar-width: none;       /* Firefox */
  }
  .d-flex.flex-wrap::-webkit-scrollbar {
    display: none;               /* Chrome/Safari */
  }

  .d-flex.flex-wrap a.btn {
    flex: 0 0 auto;              
    white-space: nowrap;         
  }

}

.composer-container {
	transition: all 0.15s ease-in-out;
	box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.composer-container:focus-within {
	box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 2px 5px rgba(0,0,0,0.06);
}

.chat-messages::-webkit-scrollbar {
	width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
	background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
	background: #d4d4d4;
	border-radius: 4px;
}

.chat-history,list-group {
	  background-color: transparent !important;
}		
.first-child-mt-0:first-child {
	margin-top: 0 !important;
}	
.text-token-text-primary {
	color: var(--text-primary);
}		
:root {
	--sidebar-surface-primary: #f8f9fa;
	--token-sidebar-surface-primary: #e9ecef;
}
.text-primary {
	color: #0D0D0D !important;
	font-weight:bold;
}


.has-messages .empty-message {
	display: none;
}

.chat-item-container {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
padding: 5px 10px;
border-bottom: 1px solid #eee;
}


.chat-item i {
margin-right: 8px;
flex-shrink: 0;
}

.chat-title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
}

.delete-thread-btn {
background: transparent;
border: none;
cursor: pointer;
color: #d00;
flex-shrink: 0;
font-size: 18px;
}

.delete-thread-btn:hover {
color: #ff3b3b;
}

.chat-side-label{
	display: flex;
	font-size:0.9rem;
	align-items: center;
	padding: 6px 10px;
	cursor: pointer;
	font-weight: 500;
	border-radius: 4px;
}
.chat-side-label a{
	text-decoration: none;
}
.chat-date-label {
	display: flex;
	font-size:0.9rem;
	justify-content: space-between;
	align-items: center;
	padding: 6px 15px;
	cursor: pointer;
	font-weight: 500;
	border-radius: 4px;
	margin-top: 10px;
}

#sendButton svg {
  width: 26px !important;
  height: 26px !important;
  max-width: none !important;
  max-height: none !important;
  fill: currentColor !important;
}

.right-wrap{
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
	min-height: 0;
	width: 100%;
}
.scroll-box{
	width: 100%;
	flex: 1;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto !important;
	overscroll-behavior: contain;
	scrollbar-color: auto;
}
.container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 100px);
  width:100%;
  max-width:100%;
  padding:0px;
}
.top-box {
  flex: 0.5;
  overflow: hidden;
}
.scroll-content {
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  justify-content: center;
}
.inner-content {
  width: 100%;
  max-width: 800px;
}

.bottom-box {
  overflow-y: auto;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  box-sizing: border-box;
}

#sidebar.collapsed .chat-date-label,
#sidebar.collapsed .delete-thread-btn {
	display: none;
}

.loading {
display: inline-block;
font-size: 16px;
color: #6c757d;
position: relative;
}

.loading::before {
content:
display: inline-block;
width: 24px;
height: 24px;
border: 3px solid #f3f3f3;
border-top: 3px solid #1C2252;
border-radius: 50%;
animation: spin 1s linear infinite;
vertical-align: middle;
margin-right: 8px;
}


.uploaded-files-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0;
  z-index: 5;
  position: relative;
}

.upload-card {
  display: inline-flex;
  align-items: center;
  background: #f7f7f7;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.9rem;
  max-width: 100%;
  width: fit-content;
  animation: fadeIn 0.3s ease-in-out;
}

.upload-card .filename {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #000;
}

.upload-card .status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #666;
  margin-left: 10px;
}


.remove-btn {
  background: none;
  border: none;
  margin-left: 8px;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content:
}
.top-box {
    flex: 1;
    transition: flex 0.4s ease;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.top-box .welcome-message {
    font-size: 2rem;
    transition: font-size 0.4s ease, opacity 0.4s ease;
    opacity: 1;
}

.top-box.full .welcome-message {
    font-size: 0; /* 또는 작은 글씨 예: 0.8rem */
    opacity: 0;
    pointer-events: none;
}

.loading-dots {
    font-weight: bold;
    font-size: 16px;
    padding-left: 5px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}


.spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  width: 80px;   /* 기존: 40px */
  height: 80px;  /* 기존: 40px */
  position: relative;
}

.spinner div {
  position: absolute;
  width: 8px;    /* 기존: 4px */
  height: 20px;  /* 기존: 10px */
  background: #888;
  border-radius: 4px;  /* 기존: 2px */
  top: 8px;      /* 기존: 4px */
  left: 36px;    /* 기존: 18px */
  transform-origin: 4px 32px;  /* 기존: 2px 16px */
  animation: fade 1.2s linear infinite;
}

.spinner div:nth-child(1)  { transform: rotate(0deg);   animation-delay: -1.1s; }
.spinner div:nth-child(2)  { transform: rotate(30deg);  animation-delay: -1.0s; }
.spinner div:nth-child(3)  { transform: rotate(60deg);  animation-delay: -0.9s; }
.spinner div:nth-child(4)  { transform: rotate(90deg);  animation-delay: -0.8s; }
.spinner div:nth-child(5)  { transform: rotate(120deg); animation-delay: -0.7s; }
.spinner div:nth-child(6)  { transform: rotate(150deg); animation-delay: -0.6s; }
.spinner div:nth-child(7)  { transform: rotate(180deg); animation-delay: -0.5s; }
.spinner div:nth-child(8)  { transform: rotate(210deg); animation-delay: -0.4s; }
.spinner div:nth-child(9)  { transform: rotate(240deg); animation-delay: -0.3s; }
.spinner div:nth-child(10) { transform: rotate(270deg); animation-delay: -0.2s; }
.spinner div:nth-child(11) { transform: rotate(300deg); animation-delay: -0.1s; }
.spinner div:nth-child(12) { transform: rotate(330deg); animation-delay:  0s; }

@keyframes fade {
  0%   { opacity: 1; }
  100% { opacity: 0.1; }
}


.blinking-cursor {
  display: inline-block;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

@media (max-width: 768px) {
  .table-wrapper {
    width: 100%;
    overflow-x: auto;    /* 가로 스크롤 허용 */
  }

  .table-wrapper .input-form-table {
    width: auto !important;       /* 100% 강제 해제 */
    min-width: 1300px !important; /* 원래 테이블 크기 유지 */
    table-layout: auto !important;
  }
  
 .import-section > .d-flex {
    display: grid !important;
    grid-template-columns: 1fr 1fr; /* 2개씩 2줄 */
    gap: 10px; /* 버튼 간격 */
  }

  .import-section > .d-flex .btn {
    width: 100%; /* 칸 꽉 채움 */
  }
  .import-section > .d-flex {
    display: grid !important;          /* flex 제거 후 grid 강제 */
    grid-template-columns: repeat(2, 1fr); /* 2개씩 2줄 */
    gap: 10px !important;
    justify-items: stretch;
    width: 100% !important;
  }

  .import-section > .d-flex .btn {
    width: 100% !important;            /* 칸에 맞게 폭 늘림 */
    height: auto !important;           /* 세로 길이 최소화 */
    white-space: normal !important;    /* 텍스트 줄바꿈 허용 */
  }
    .import-section > .d-flex {
    display: flex !important;      /* flex 유지 */
    flex-wrap: wrap !important;    /* 줄바꿈 허용 */
    gap: 12px !important;          /* 간격 */
  }

  .import-section > .d-flex .btn {
    flex: 0 0 48% !important;      /* 한 줄에 2개 */
    max-width: 48% !important;
    white-space: normal !important; /* 텍스트 줄바꿈 */
    margin-bottom: 8px;            /* 아래 간격 */
  }
}