/* Ask-AI widget — a floating "Ask AI" pill that expands into a chat panel.
   Uses the page's own CSS variables (--ink, --muted, --line) so it matches
   both case-study pages. */

@property --aa-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

.askai { position: fixed; right: 20px; bottom: 20px; z-index: 95; font-family: inherit; }
.askai *, .askai *::before, .askai *::after { box-sizing: border-box; }

.askai__pill { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 10px; border-radius: 100px;
  cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink, #1a1c18);
  background: rgba(255,255,255,0.9); border: 1px solid var(--line, rgba(17,17,17,0.12));
  box-shadow: 0 12px 30px -12px rgba(17,17,17,0.35); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.askai__pill:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -14px rgba(26,26,201,0.35); }

.askai__orb { width: 22px; height: 22px; border-radius: 50%; flex: none; filter: saturate(1.2);
  background: conic-gradient(from var(--aa-angle) at 32% 30%, #1a1ac9, #6f7bff, #9a6cff, #1a1ac9);
  animation: aaSpin 6s linear infinite; }
@keyframes aaSpin { to { --aa-angle: 360deg; } }

.askai__panel { position: absolute; right: 0; bottom: 56px; width: min(360px, calc(100vw - 40px)); height: min(470px, 72vh);
  display: none; flex-direction: column; overflow: hidden; border-radius: 18px;
  background: rgba(255,255,255,0.98); border: 1px solid var(--line, rgba(17,17,17,0.12));
  box-shadow: 0 24px 60px -20px rgba(17,17,17,0.4); }
.askai.is-open .askai__panel { display: flex; }
.askai.is-open .askai__pill { display: none; }

.askai__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line, rgba(17,17,17,0.1)); flex: none; }
.askai__head .askai__orb { width: 20px; height: 20px; }
.askai__title { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; color: var(--ink, #1a1c18); }
.askai__title small { display: block; font-weight: 500; font-size: 11px; color: var(--muted, #5d6157); margin-top: 1px; }
.askai__close { border: 0; background: transparent; cursor: pointer; color: var(--muted, #5d6157); display: flex; padding: 4px; }
.askai__close:hover { color: var(--ink, #1a1c18); }
.askai__close svg { width: 18px; height: 18px; }

.askai__log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.askai__msg { max-width: 88%; font-size: 14px; line-height: 1.5; padding: 10px 13px; border-radius: 14px; word-wrap: break-word; }
.askai__msg--user { align-self: flex-end; background: #1a1ac9; color: #fff; border-bottom-right-radius: 4px; }
.askai__msg--ai { align-self: flex-start; background: rgba(17,17,17,0.05); color: var(--ink, #1a1c18); border-bottom-left-radius: 4px; }
.askai__msg--ai b { font-weight: 600; }
.askai__hint { align-self: flex-start; font-size: 12.5px; line-height: 1.5; color: var(--muted, #5d6157); }
.askai__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.askai__chip { font: inherit; font-size: 12px; cursor: pointer; color: #1a1ac9; text-align: left;
  background: rgba(26,26,201,0.08); border: 1px solid rgba(26,26,201,0.2); border-radius: 100px; padding: 5px 10px; }
.askai__chip:hover { background: rgba(26,26,201,0.14); }

.askai__typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 13px; }
.askai__typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted, #5d6157); animation: aaBlink 1s infinite; }
.askai__typing i:nth-child(2) { animation-delay: 0.15s; }
.askai__typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes aaBlink { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.askai__form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line, rgba(17,17,17,0.1)); flex: none; }
.askai__input { flex: 1; resize: none; border: 1px solid var(--line, rgba(17,17,17,0.12)); border-radius: 12px; padding: 10px 12px;
  font: inherit; font-size: 14px; color: var(--ink, #1a1c18); background: #fff; max-height: 100px; line-height: 1.4; }
.askai__input:focus { outline: none; border-color: rgba(26,26,201,0.5); }
.askai__send { flex: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: #1a1ac9; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: opacity 0.2s ease; }
.askai__send:disabled { opacity: 0.5; cursor: default; }
.askai__send svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) { .askai__orb { animation: none; } .askai__typing i { animation: none; } }
