/* AI Mind Systems — website assistant widget */
.aims-chat-btn {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--ink); color: var(--porcelain);
  border: 1px solid var(--ink); cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(26,24,19,0.30);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.aims-chat-btn:hover { background: var(--bronze-deep); transform: translateY(-2px); }
.aims-chat-btn svg { width: 24px; height: 24px; }
.aims-chat-btn .close-icon { display: none; }
.aims-chat-btn.is-open .chat-icon { display: none; }
.aims-chat-btn.is-open .close-icon { display: block; }

.aims-chat {
  position: fixed; right: 22px; bottom: 90px; z-index: 900;
  width: min(380px, calc(100vw - 44px));
  height: min(560px, calc(100vh - 130px));
  background: var(--porcelain);
  border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: 0 30px 80px -20px rgba(26,24,19,0.35);
  display: none; flex-direction: column; overflow: hidden;
}
.aims-chat.is-open { display: flex; animation: chatIn 0.3s var(--ease); }
@keyframes chatIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .aims-chat.is-open { animation: none; } }

.aims-chat__head {
  background: var(--ink); color: var(--porcelain);
  padding: 0.95rem 1.2rem;
}
.aims-chat__title { font-family: var(--display); font-size: 1.15rem; }
.aims-chat__sub { font-size: 0.7rem; color: rgba(247,245,240,0.6); letter-spacing: 0.04em; }

.aims-chat__body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.aims-chat__msg { max-width: 85%; font-size: 0.86rem; line-height: 1.5; padding: 0.65rem 0.9rem; border-radius: 2px 12px 12px 12px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-soft); overflow-wrap: break-word; }
.aims-chat__msg--user { align-self: flex-end; background: #F0E9DC; border-color: #E2D5BC; border-radius: 12px 2px 12px 12px; }
.aims-chat__msg a { color: var(--bronze-deep); text-decoration: underline; text-underline-offset: 2px; }
.aims-chat__msg p { margin: 0 0 0.5em; } .aims-chat__msg p:last-child { margin: 0; }

.aims-chat__typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 0.7rem 0.9rem; }
.aims-chat__typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--bronze); animation: aimsBlink 1.2s infinite; font-style: normal; }
.aims-chat__typing i:nth-child(2) { animation-delay: 0.2s; }
.aims-chat__typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes aimsBlink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

.aims-chat__form { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--line); background: var(--paper); }
.aims-chat__input {
  flex: 1; font: inherit; font-size: 0.86rem; color: var(--ink);
  background: var(--porcelain); border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 0.6rem 0.8rem; resize: none; max-height: 100px;
}
.aims-chat__input:focus { outline: none; border-color: var(--bronze); }
.aims-chat__send {
  font: 600 0.78rem var(--sans); letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--ink); color: var(--porcelain); border: none; border-radius: 6px;
  padding: 0 1rem; cursor: pointer; transition: background 0.3s var(--ease);
}
.aims-chat__send:hover { background: var(--bronze-deep); }
.aims-chat__send:disabled { opacity: 0.5; cursor: default; }
.aims-chat__note { font-size: 0.62rem; color: var(--muted); text-align: center; padding: 0 0.75rem 0.6rem; background: var(--paper); }
