/* Chat panel slide-in */
#panel-chat {
  transition: transform 0.3s ease;
  transform: translateX(100%);
}
#panel-chat.open {
  transform: translateX(0);
}

/* Loading spinner */
.spinner {
  border: 3px solid #e5e7eb;
  border-top: 3px solid #236e23;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Chunk text (admin debug view) */
.chunk-text {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Smooth expand */
.chunks-wrapper {
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-height: 0;
}
.chunks-wrapper.expanded {
  max-height: 5000px;
}

/* ----------------------------------------------------------------
   Rendered Markdown Content
   ---------------------------------------------------------------- */
.rendered-content {
  line-height: 1.7;
}
.rendered-content h2,
.rendered-h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}
.rendered-content h2:first-child,
.rendered-h2:first-child {
  margin-top: 0;
}
.rendered-content h3,
.rendered-h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}
.rendered-content p {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.rendered-content p:last-child {
  margin-bottom: 0;
}
.rendered-content ul,
.rendered-ul {
  list-style-type: disc;
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}
.rendered-content li {
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 0.25rem;
  line-height: 1.6;
}
.rendered-content strong {
  font-weight: 600;
  color: #111827;
}
.rendered-content em {
  font-style: italic;
}

/* Chunk debug toggle (admin) */
.chunk-toggle-btn svg {
  transition: transform 0.2s ease;
}

/* Scrollbar styling */
#items-container::-webkit-scrollbar,
#chat-messages::-webkit-scrollbar {
  width: 6px;
}
#items-container::-webkit-scrollbar-track,
#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
#items-container::-webkit-scrollbar-thumb,
#chat-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
#items-container::-webkit-scrollbar-thumb:hover,
#chat-messages::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}
