/* Refiner — one chat look for /support and /assistant (Request 800, QA brief R-36). Moved from support.html. */
/* ─── Chat Section ────────────────────────────────────────────────────── */
.chat-shell {
  display: flex;
  flex-direction: column;
  background: #fff;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
  height: 300px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(248, 250, 252, 0.84));
}

.bubble {
  max-width: min(80ch, 90%);
  padding: 13px 15px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 0.96rem;
  white-space: pre-wrap;
  animation: rise 180ms ease;
}

.bubble.user {
  align-self: flex-end;
  color: #fff;
  background: linear-gradient(135deg, var(--user-a), var(--user-b));
  border-top-right-radius: 6px;
}

.bubble.ai {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--assistant-a), var(--assistant-b));
  border: 1px solid #cbd5e1;
  border-top-left-radius: 6px;
  white-space: normal;
}

.bubble.ai p {
  margin: 0 0 10px;
}

.bubble.ai p:last-child {
  margin-bottom: 0;
}

.bubble.ai a {
  color: #0369a1;
  font-weight: 700;
  text-decoration: none;
}

.bubble.ai a:hover {
  text-decoration: underline;
}

.composer {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
}

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 4px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.input-row:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.94rem;
  color: inherit;
  outline: none;
  background: transparent;
  line-height: 1.5;
}

textarea::placeholder {
  color: #94a3b8;
}

.send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #00a3ff, #13c48b);
  box-shadow: 0 4px 12px rgba(0, 163, 255, 0.2);
  transition: all 140ms cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(0, 163, 255, 0.3);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.87rem;
}

.bubble.ai.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 88px;
  padding: 12px 16px;
}

.typing-label {
  color: #64748b;
  font-size: 0.9rem;
  font-style: italic;
}

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

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: typingBounce 1.2s infinite ease-in-out;
}

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

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

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .input-row {
    grid-template-columns: 1fr;
  }

  .send-btn {
    min-height: 46px;
  }

  .bubble {
    max-width: 96%;
  }
}
