/* Chat Panel */
.chat-panel {
  width: var(--chat-width);
  background: #fff;
  border-left: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-200);
}
.chat-header h2 { font-size: 14px; font-weight: 700; color: var(--gray-700); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-welcome {
  padding: 20px 12px;
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
}
.chat-welcome p { margin-bottom: 8px; }
.chat-hint {
  font-size: 12px;
  font-style: italic;
  color: var(--gray-500);
  background: var(--gray-50);
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 8px;
}

/* Chat Bubbles */
.chat-msg {
  max-width: 95%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--green-mid);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: var(--gray-100);
  color: var(--gray-900);
  border-bottom-left-radius: 4px;
}
.chat-msg.assistant.streaming {
  position: relative;
}

/* Streaming progress indicator */
.streaming-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}
.streaming-dots {
  display: flex;
  gap: 4px;
}
.streaming-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-mid);
  animation: dot-pulse 1.4s ease-in-out infinite;
}
.streaming-dots span:nth-child(2) { animation-delay: 0.2s; }
.streaming-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
.streaming-text {
  font-size: 13px;
  color: var(--gray-700);
}

.chat-msg .msg-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}
.chat-msg .btn-apply {
  font-size: 11px;
  padding: 3px 10px;
  background: var(--green-mid);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.chat-msg .btn-apply:hover { background: #236b3d; }
.chat-msg .btn-undo {
  font-size: 11px;
  padding: 3px 10px;
  background: var(--gray-200);
  color: var(--gray-700);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.chat-msg .btn-undo:hover { background: var(--gray-300); }

.chat-msg .msg-status {
  font-size: 11px;
  margin-top: 4px;
  color: var(--gray-500);
}

/* Chat Input */
.chat-input-area {
  border-top: 1px solid var(--gray-200);
  padding: 10px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 38px;
  max-height: 120px;
}
.chat-input-row textarea:focus { border-color: var(--green-mid); }

.btn-send {
  padding: 8px 16px;
  flex-shrink: 0;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 8px;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone.drag-over {
  border-color: var(--green-mid);
  background: var(--green-light);
}
.upload-label {
  color: var(--green-mid);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
