 /* ── Context bar buttons ── */
.ctx-btn {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.ctx-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.ctx-btn.active {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

/* ── Chevron rotation ── */
.chevron-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.chevron-icon.rotated {
  transform: rotate(180deg);
}

/* ── Collapsible panels (meta + preview) ── */
.collapsible-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #fafbfc;
  border-top: 0 solid transparent;
}

.collapsible-panel.open {
  max-height: 200px;
  border-top: 1px solid #f0f0f0;
}

.collapsible-panel.preview-panel.open {
  max-height: 450px;
  overflow-y: auto;
  border-bottom: 1px solid #e5e7eb;
}

/* ── User message bubble ── */
.user-msg {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.user-msg>div {
  background: #f3f4f6;
  padding: 0.55rem 1rem;
  border-radius: 1.1rem 1.1rem 0.35rem 1.1rem;
  max-width: 72%;
  font-size: 0.92rem;
  color: #1f2937;
  line-height: 1.5;
}

/* ── AI message ── */
.ai-msg {
  margin-top: 1.75rem;
  color: #111827;
  font-size: 0.95rem;
  line-height: 1.65;
  padding-right: 1rem;
}

.ai-msg p {
  margin: 0 0 0.6rem;
}

.ai-msg ul,
.ai-msg ol {
  margin: 0.4rem 0 0.8rem 1.2rem;
}

.ai-msg li {
  margin-bottom: 0.25rem;
}

.ai-msg strong {
  font-weight: 600;
}

/* ── Input bar gradient fade ── */
.input-bar-gradient {
  background: linear-gradient(to top, #f8f9fb 70%, rgba(248, 249, 251, 0));
}

/* ── Input container focus glow ── */
.input-container:focus-within {
  border-color: #a7d8d8;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06), 0 0 0 2px rgba(13, 148, 136, 0.1);
}

/* ── Send button ── */
.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: not-allowed;
  background: #d1d5db;
  color: #fff;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.send-btn.enabled {
  background: #0d9488;
  cursor: pointer;
}

.send-btn.enabled:hover {
  background: #0f766e;
}

/* ── Scrollbar ── */
.chat-thread::-webkit-scrollbar {
  width: 6px;
}

.chat-thread::-webkit-scrollbar-track {
  background: transparent;
}

.chat-thread::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.chat-thread::-webkit-scrollbar-thumb:hover {
  background: #b0b5be;
}

.collapsible-panel::-webkit-scrollbar {
  width: 5px;
}

.collapsible-panel::-webkit-scrollbar-track {
  background: transparent;
}

.collapsible-panel::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 3px;
}

/* ── Loading dots animation (replaces DaisyUI) ── */
.qs-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 0.5rem 0;
}

.qs-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  animation: dotPulse 1.4s ease-in-out infinite;
}

.qs-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.qs-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {

  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Loading spinner (replaces DaisyUI for home page) ── */
.qs-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}