/* Asteria assistant: a taller chat that scrolls, class cards, a typing indicator and the input. */
.chat[hidden] { display: none; }
.chat { display: flex; flex-direction: column; max-height: min(640px, calc(100svh - 120px)); }
.chat .msgs { flex: 1; min-height: 160px; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.msg { line-height: 1.5; white-space: pre-wrap; }
.msg.typing { display: inline-flex; gap: 4px; width: max-content; padding: 14px 16px; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--taupe); animation: asDot 1.2s ease-in-out infinite; }
.msg.typing i:nth-child(2) { animation-delay: 0.15s; }
.msg.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes asDot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.as-cards { display: grid; gap: 8px; }
.as-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 18px; background: var(--sand); border: 1px solid var(--line); }
.as-card strong { display: block; font-size: 15px; }
.as-card span { display: block; margin-top: 2px; font-size: 12px; color: var(--taupe); }
.as-card em { display: block; margin-top: 4px; font-style: normal; font-size: 12px; color: var(--clay); }
.as-card button { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--cocoa); color: var(--paper); font-size: 13px; transition: background 0.3s, scale 0.2s var(--ease); }
.as-card button:hover { background: var(--clay); }
.as-card button:active { scale: 0.95; }
.as-card button.done { background: var(--sage); color: var(--forest); }

.chips:empty { display: none; }
.chips button { transition: background 0.25s, scale 0.2s var(--ease); }
.chips button:hover { background: var(--sand); }
.chips button:active { scale: 0.95; }

.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--paper); }
.chat-form input { flex: 1; min-width: 0; min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--sand); font: inherit; font-size: 16px; color: var(--cocoa); }
.chat-form input:focus-visible { outline: 2px solid var(--clay); outline-offset: 1px; }
.chat-form button { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--cocoa); color: var(--paper); display: grid; place-items: center; transition: background 0.3s, scale 0.2s var(--ease); }
.chat-form button:hover { background: var(--clay); }
.chat-form button:active { scale: 0.92; }
.chat-form svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#site[dir="rtl"] .chat-form svg { transform: scaleX(-1); }

@media (max-width: 760px) {
  .chat { inset-inline: 8px; width: auto; max-height: calc(100svh - 110px); }
}
