html {
  font-size: 16px; /* or 62.5% for 1rem = 10px */
}
/* markdown 태그 크기 조절 */
h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.25rem;
}
/* markdown 본문 스타일 */
body {
height: 100%;
background-color: #fff;
margin: 0;
padding: 0;
font-family: 'Segoe UI', 'Helvetica', 'Apple SD Gothic Neo', sans-serif;
line-height: 1.5;
}
:root {
  --spacing: 0.25rem;             /* spacing 단위 */
  --content-max-width: 48rem;     /* 최대 콘텐츠 너비 */
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
}
.wrapper {
  max-width: 768px;   /* 또는 48rem */
  margin: 0 auto;
  padding: 0 1rem;     /* 좌우 여백 추가 */
}
.fixed-label {
position: fixed;
top: 10px;       /* 화면 상단에서 10px 아래 */
left: 10px;      /* 화면 왼쪽에서 10px 오른쪽 */
z-index: 1000;   /* 다른 요소 위에 표시되도록 */
}
.chat-container {
height: 100dvh;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
padding: 1rem;
}
.chat-body {
flex: 1;
padding: 1rem;
padding-bottom: 140px; /* ✅ chat-box 최대 높이보다 여유 있게 확보 */
width: 100%;
max-width: 100dvw;  /* ✅ 여기 추가 */
margin: 0 auto;    /* ✅ 중앙 정렬 */
overflow-y: auto; /* ✅ 전체 스크롤은 여기서 처리 */
scroll-behavior: smooth;
}
.link-plain { color: inherit; text-decoration: none; font-weight: 700; }
.chat-response {
width: 100%;
max-width: 700px;
margin: 0 auto; /* ✅ 가운데 정렬 */
}
.scroll-icon {
  width: 100%;   /* 또는 100%로 맞춰도 OK */
  height: 100%;
  object-fit: contain;
}
.scroll-down-btn {
  position: fixed;
  bottom: 160px; /* ❌ 이건 JS에서 덮어씀 */
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background-color: #ffffff; /* ✅ 하얀 배경 */
  color: #333;
  border: 1px solid #ccc;
  border-radius: 999px;
  width: 2rem;  /* ✅ 크기 설정 */
  height: 2rem; /* ✅ 크기 설정 */
  padding: 0; /* ✅ 패딩 제거 */
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);

  display: flex; /* ✅ 아이콘 정렬용 */
  align-items: center;
  justify-content: center;
}
.chat-box-wrapper {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);  /* 처음엔 가운데 정렬 */
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 48rem;

  transition: bottom 0.3s ease, margin 0.3s ease;
}

/* 전환 후: 아래 고정 */
.chat-box-wrapper.bottom-fixed {
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  transform: none;
  margin: 0 auto;
}

/* 문구 (intro-title) 스타일 */
#intro-title {
  margin-bottom: 1rem;
  text-align: center;
  color: #333;
}

/* chat-box 자체는 padding 중심 */
.chat-box {
  background: white;
  width: 100%;
  padding: 1rem;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  border-radius: 10px;
  box-sizing: border-box;
}
#chat-input {
    border-radius: 20px;
    resize: none;
    overflow-y: auto;
    max-height: 120px;
    min-height: 15px !important;
    line-height: 1;
    padding: 2px 6px !important;  /* ✅ padding 강제 줄이기 */
    font-size: 0.9rem;
    box-sizing: border-box;
}
.input-group-text {
background-color: #fff;
border: none;
}
.form-control:focus {
box-shadow: none;
border-color: #ccc;
}
.tools-icon {
cursor: pointer;
}
.btn-light {
    border-radius: 50px;
    box-shadow: none;
    border: none;
    background-color: #e0e0e0;
}
.btn-light:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}
.btn-white {
    border-radius: 50px;
    box-shadow: none;
    border: none;
    background-color: white;
}
.btn-white:hover {
    background-color: #e0e0e0;
    cursor: pointer;
}
.left-align {
    align-self: flex-start;
}
.bold {
    font-weight: bold;
}
.chat-message.user-message {
    text-align: right;
    margin: 10px 0;
}
.user-bubble {
    display: inline-block;
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 80%;
    font-size: 1rem;
    white-space: pre-wrap;
    font-family: 'Noto Sans', sans-serif; /* 또는 원하는 폰트 */
    text-align: left;
}
.chat-message.bot-message {
    text-align: left;
    margin: 10px 0;
}
.bot-bubble {
    display: inline-block;
    background: #FFFFFF;
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 100%;
    font-size: 1rem;
    font-family: 'Noto Sans', sans-serif; /* 또는 원하는 폰트 */
}
/* 마크다운 코드 블록 스타일 */
.bot-bubble pre {
    background-color: #f6f8fa;
    border-radius: 8px;
    padding: 10px;
    overflow-x: auto;
    font-family: Consolas, monospace;
    font-size: 0.875rem;
    margin: 8px 0;
}

.bot-bubble code {
    background-color: inherit;
}
@media (max-width: 576px) {
.left-align.fixed-label {
    position: relative;
    top: auto;
    left: auto;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
}
.chat-container {
    display: flex;
    flex-direction: column;
}
.chat-body {
    margin-top: 0.5rem;
}
.form-control {
    font-size: 14px;
}
.btn {
    font-size: 14px;
    padding: 0.375rem 0.5rem;
}
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  background-color: #f0f0f0;
  border: none;              /* ✅ 테두리 없애기 */
  border-radius: 4px;
  z-index: 10;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.copy-btn:hover {
  opacity: 1;
}

/* 기본(PC): 한 줄, 가운데 정렬 */
.suggestion-list {
  display: flex;
  flex-wrap: nowrap;              /* 한 줄 유지 */
  justify-content: center;        /* 가운데 정렬 */
  gap: 8px;
}
.suggestion-list .suggestion-btn {
  font-size: 0.9rem;
  line-height: 1.1;
  padding: 6px 12px;
  border-width: 1px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  white-space: nowrap;            /* 칩 내부 줄바꿈 방지 */
}

/* 모바일(<=576px): 3줄(세로 스택) + 가운데 정렬 */
@media (max-width: 576px) {
  .suggestion-list {
    flex-direction: column;       /* 세로 배치 */
    align-items: center;          /* 가운데 정렬 */
    gap: 10px;
  }
  .suggestion-list .suggestion-btn {
    width: 100%;
    max-width: 420px;             /* 너무 넓어지지 않게 */
    text-align: center;           /* 버튼 텍스트 중앙 */
    justify-content: center;      /* 아이콘/텍스트 있을 때 중앙 */
  }
}