/* Q&A Component Styles */
.input-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.input-wrap {
  position: relative;
}

.chat-input {
  width: 100%;
  min-height: 48px;
  max-height: 160px;
  padding: 14px 44px 14px 14px;
  border-radius: 0;
  border: 1px solid var(--stroke);
  background: var(--input-bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  outline: none;
  resize: vertical;
  transition: border 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.chat-input:focus {
  border-color: rgba(176, 181, 188, 0.7);
  box-shadow: 0 0 0 2px rgba(176, 181, 188, 0.2);
  transform: translateY(-1px);
}

.sparkle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--muted);
  transition: color 200ms ease, transform 200ms ease;
}

.chat-input:focus + .sparkle {
  color: var(--accent);
  transform: translateY(-50%) scale(1.1);
}

button {
  height: 48px;
  padding: 0 20px;
  border-radius: 0;
  border: 1px solid var(--accent);
  color: var(--button-text);
  font-weight: 600;
  background: var(--accent);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  will-change: transform;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.3);
  opacity: 0.7;
}

button:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 16px 30px rgba(96, 165, 250, 0.35);
}

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.6);
  animation: ripple 600ms ease;
  pointer-events: none;
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

.status {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  min-height: 24px;
  transition: opacity 300ms ease, transform 300ms ease;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
}


.chat-thread {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}


.chat-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
}

.chat-message {
  display: flex;
  gap: 12px;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(560px, 100%);
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  background: var(--bubble-bg);
  line-height: 1.6;
}

.chat-content {
  margin: 0;
  padding: 0;
}

.chat-message.user .chat-bubble {
  background: var(--bubble-user-bg);
  border-color: rgba(96, 165, 250, 0.5);
}

.chat-message.is-typing .chat-bubble {
  background: var(--bubble-bg);
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 12px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  animation: typingPulse 1s ease-in-out infinite;
}

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

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

@keyframes typingPulse {
  0%, 80%, 100% { transform: scale(0.75); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-content :is(p, ul, ol, pre, blockquote, h1, h2, h3, h4, h5, h6) {
  margin: 0 0 10px 0;
  text-shadow: none;
}

.chat-content :is(p, ul, ol, pre, blockquote, h1, h2, h3, h4, h5, h6):last-child {
  margin-bottom: 0;
}

.chat-content :is(ul, ol) {
  padding-left: 18px;
}

.chat-content pre {
  background: var(--code-bg);
  border: 1px solid var(--stroke);
  padding: 12px;
  border-radius: 0;
  overflow: auto;
}

.chat-content code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 0;
}

.chat-content blockquote {
  border-left: 3px solid #4b5563;
  padding-left: 10px;
  color: var(--muted);
}

.chat-content a {
  color: #c4c7cc;
}

.chat-input.shake {
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}
