/* "Write with AI" chat on sign-up forms (tags/aiAssist.tag + js/assist.js). Uses the site colours from styles.css. */
.ai-assist { margin: -4px 0 18px; }
.ai-assist-open { display: inline-flex; align-items: center; gap: 6px; }
.ai-assist-open .ic { width: 16px; height: 16px; }
.ai-assist-hint { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }

.ai-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); overflow: hidden; }
.ai-panel[hidden] { display: none; }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--green-soft); }
.ai-head strong { color: var(--ink); font-size: 14px; }
.ai-close { border: 0; background: transparent; cursor: pointer; padding: 4px; color: var(--text); line-height: 0; }
.ai-close .ic { width: 16px; height: 16px; }

.ai-log { max-height: 320px; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg-bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.ai-msg-me { align-self: flex-end; background: var(--green); color: #fff; }
.ai-msg-note { align-self: center; background: transparent; color: var(--muted); font-size: 13px; text-align: center; }
.ai-msg-error { align-self: flex-start; background: var(--pink-soft); border: 1px solid var(--pink); color: var(--ink); }

.ai-draft { margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--green); background: var(--green-soft); border-radius: 8px; color: var(--ink); }
.ai-draft-count { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.ai-draft-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.ai-chip { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.ai-chip:hover:not(:disabled) { border-color: var(--green); color: var(--green-dark); }
.ai-chip:disabled { opacity: .5; cursor: default; }

.ai-form { display: flex; gap: 8px; padding: 0 14px 12px; align-items: flex-end; }
.ai-form textarea { flex: 1; min-height: 44px; max-height: 120px; resize: vertical; margin: 0; }
.ai-foot { padding: 0 14px 12px; font-size: 12px; color: var(--muted); }

.ai-typing { display: inline-flex; gap: 4px; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ai-dot 1s infinite ease-in-out; }
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ai-typing span { animation: none; opacity: .6; } }
