* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: #b2c7d9;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.chat-container {
  width: 400px;
  height: 100vh;
  max-height: 800px;
  background: #b2c7d9;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* 헤더 */
.chat-header {
  background: #b2c7d9;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.header-back {
  font-size: 20px;
  color: #333;
  cursor: pointer;
}

.header-info {
  flex: 1;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

.header-subtitle {
  font-size: 11px;
  color: #666;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #4caf50;
  border-radius: 50%;
}

.response-time {
  font-size: 11px;
  color: #666;
}

/* 메시지 영역 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

/* 날짜 구분선 */
.date-divider {
  text-align: center;
  margin: 8px 0;
}

.date-divider span {
  background: rgba(0, 0, 0, 0.1);
  color: #fff;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
}

/* 메시지 */
.message {
  display: flex;
  gap: 8px;
  max-width: 85%;
}

.message.user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.message.bot {
  align-self: flex-start;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-name {
  font-size: 12px;
  color: #333;
  font-weight: 500;
}

.message.user .message-name {
  display: none;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.message.bot .message-bubble {
  background: #fff;
  color: #1a1a1a;
  border-top-left-radius: 4px;
}

.message.user .message-bubble {
  background: #fee500;
  color: #1a1a1a;
  border-top-right-radius: 4px;
}

.message-time {
  font-size: 11px;
  color: #888;
}

.message.user .message-time {
  text-align: right;
}

/* 타이핑 인디케이터 */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.typing-indicator .dot {
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* 빠른 답장 */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.quick-reply-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 18px;
  padding: 8px 16px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.quick-reply-btn:hover {
  background: #fee500;
  border-color: #fee500;
}

/* 입력 영역 */
.chat-input {
  display: flex;
  padding: 8px 12px;
  background: #fff;
  border-top: 1px solid #e5e5e5;
  gap: 8px;
}

.chat-input input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 10px 12px;
  background: #f5f5f5;
  border-radius: 20px;
  font-family: inherit;
}

.chat-input button {
  background: #fee500;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.chat-input button:hover {
  background: #fdd800;
}

.chat-input button:disabled {
  background: #e5e5e5;
  color: #999;
  cursor: not-allowed;
}

/* 인텐트 배지 */
.intent-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e8f5e9;
  color: #2e7d32;
  margin-top: 2px;
}

/* 모바일 반응형 */
@media (max-width: 440px) {
  .chat-container {
    width: 100%;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }
}
