/* 답변 하단 참고 출처(웹 검색) */
.msg-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.msg-sources b {
  color: var(--muted);
  font-size: 11px;
}

.msg-sources .src-link {
  text-decoration: none;
  border: 1px solid #8fb0ff;
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--blue);
  font-weight: 700;
}

.msg-sources .src-link:hover {
  background: #eff5ff;
}

.query-main {
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) 132px;
  min-height: 100vh;
}

.query-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
}

.query-stage.chat-mode {
  display: block;
  padding: 20px 26px;
}

.empty-state {
  width: min(780px, 92%);
  text-align: center;
}

.spark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 10px;
  background: #eef4ff;
  color: var(--blue);
  font-size: 26px;
}

.empty-state h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.empty-state p {
  margin: 0 0 26px;
  color: #77849b;
  font-size: 15px;
  line-height: 1.6;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.prompt-grid button {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  min-height: 62px;
  padding: 0 16px;
  border: 1px solid var(--line);
  color: #1f2937;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
}

.prompt-grid span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: #e3fbf6;
  color: #00a99d;
}

.chat-dock {
  padding: 14px 26px;
  border-top: 1px solid #e7ecf4;
  background: #fff;
}

.input-wrap {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 8px;
  width: min(960px, 100%);
  margin: 0 auto 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 30, 50, .08);
}

.input-wrap input {
  border: 0;
  outline: 0;
  padding: 0 10px;
  color: #4b5563;
  font-size: 14px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chat-log {
  width: min(980px, 100%);
  height: 100%;
  margin: 0 auto;
  overflow-y: auto;
  padding: 4px 0 20px;
}

.message {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.message.user {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.message.user .message-avatar {
  grid-column: 2;
  grid-row: 1;
}

.message.user .message-body {
  grid-column: 1;
  justify-self: end;
  max-width: 72%;
  background: var(--blue);
  color: #fff;
}

.message-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #e8efff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.message-body {
  max-width: 780px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  line-height: 1.7;
  box-shadow: 0 2px 8px rgba(20, 30, 50, .06);
}

.message-body p {
  margin: 0 0 10px;
}

.message-body p:last-child,
.message-body ol,
.message-body ul {
  margin-bottom: 0;
}

.message-body ol,
.message-body ul {
  padding-left: 20px;
}

.message-tools,
.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.message-tools button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  color: #334155;
  font-weight: 800;
}

.typing {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: typing 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: .15s;
}

.typing span:nth-child(3) {
  animation-delay: .3s;
}

@keyframes typing {
  0%, 80%, 100% {
    opacity: .35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@media (max-width: 760px) {
  .message.user .message-body {
    max-width: 88%;
  }
}
