/* chat.css — Ask Mesh panel. Owned by chat-owner.
 * CSS prefix: .am-* (Ask Mesh) — verified unused elsewhere.
 *
 * Slide-out pattern mirrors css/workbook.css `.checklist-drawer`:
 *   width:0 → 360px, transition: width 0.22s ease, flex-shrink:0.
 * The width transition auto-pushes flex siblings; do NOT switch to transform.
 */

.am-panel {
  width: 0;
  flex-shrink: 0;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  transition: width 0.22s ease;
  display: flex;
  flex-direction: column;
}

.am-panel.open { width: 360px; }

/* ───── Header ───── */
.am-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 10px 16px;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}
.am-title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.am-title { font-size: 13.5px; font-weight: 600; color: #111827; }
.am-badge {
  display: inline-flex; align-items: center;
  height: 16px; padding: 0 6px;
  background: #eef2ff; color: #4f6ef7;
  border-radius: 8px;
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.2px;
}
.am-close { margin-left: auto; }

/* ───── Empty state ───── */
.am-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  text-align: center;
}
.am-empty-greet { font-size: 18px; font-weight: 600; color: #111827; }
.am-empty-sub { font-size: 12.5px; color: #6b7280; margin-top: 6px; line-height: 1.4; }
.am-empty-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center;
  margin-top: 20px;
  width: 100%;
}

/* ───── Suggestion chip strip (above input when transcript has messages) ───── */
.am-chip-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 6px;
  flex-shrink: 0;
}

.am-chip {
  display: inline-flex; align-items: center;
  padding: 6px 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 11.5px;
  color: #374151;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.3;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.am-chip:hover { background: #eef2ff; border-color: #c7d2fe; color: #4f6ef7; }
.am-chip:active { transform: scale(0.97); }

/* ───── Transcript ───── */
.am-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
.am-msg { display: flex; }
.am-msg-user { justify-content: flex-end; }
.am-msg-bot  { justify-content: flex-start; }
.am-bubble {
  max-width: 280px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.am-msg-user .am-bubble {
  background: #4f6ef7;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.am-msg-bot .am-bubble {
  background: #f3f4f6;
  color: #111827;
  border-bottom-left-radius: 4px;
}
.am-msg-bot .am-bubble b { font-weight: 600; color: #111827; }
.am-msg-bot .am-bubble i { font-style: italic; color: #374151; }

/* ───── Typing indicator (three dots) ───── */
.am-typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
  align-items: center;
}
.am-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  animation: amTypingPulse 1.1s infinite ease-in-out;
}
.am-typing span:nth-child(2) { animation-delay: 0.15s; }
.am-typing span:nth-child(3) { animation-delay: 0.30s; }
@keyframes amTypingPulse {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

/* ───── Input row (sticky at bottom) ───── */
.am-inputrow {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid #f3f4f6;
  background: #ffffff;
  flex-shrink: 0;
}
.am-input {
  flex: 1;
  min-height: 36px;
  max-height: 96px;
  padding: 8px 11px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  color: #111827;
  background: #ffffff;
  resize: none;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.am-input:focus {
  border-color: #4f6ef7;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.12);
}
.am-input::placeholder { color: #9ca3af; }

.am-send {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border: none;
  border-radius: 7px;
  background: #e5e7eb;
  color: #9ca3af;
  display: flex; align-items: center; justify-content: center;
  cursor: not-allowed;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}
.am-send.on {
  background: #4f6ef7;
  color: #ffffff;
  cursor: pointer;
}
.am-send.on:hover  { background: #3d5bd9; }
.am-send.on:active { transform: scale(0.94); }
