/* AI assistant answer with callouts (includes/visuals/aianswer.php) */
.ai { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.ai-win { order: -1; }
@media (min-width: 700px) { .ai { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "win win" "l r"; gap: 32px 28px; } .ai-win { grid-area: win; } .ai-calls--l { grid-area: l; } .ai-calls--r { grid-area: r; } }
@media (min-width: 1200px) {
  .ai { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr); grid-template-areas: "l win r"; gap: 40px; align-items: center; }
}
.ai::before { content: ""; position: absolute; left: 50%; top: 45%; width: min(780px, 100%); aspect-ratio: 1; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(150, 248, 120, .22), rgba(150, 248, 120, 0)); pointer-events: none; z-index: 0; }
.ai > * { position: relative; z-index: 1; }

/* window */
.ai-win { width: 100%; max-width: 640px; justify-self: center; background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px -30px rgba(12, 43, 21, .35); overflow: hidden; }
.ai-bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--forest); }
.ai-bar-dots { display: inline-flex; gap: 4px; margin-left: auto; }
.ai-bar-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-2); }
.ai-spark { display: inline-block; width: 16px; height: 16px; flex: none; background: var(--forest); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
.ai-chat { display: grid; gap: 18px; padding: 22px 22px 24px; padding: clamp(16px, 2vw, 26px); }
.ai-q { justify-self: end; max-width: 85%; margin: 0; padding: 11px 16px; border-radius: 16px 16px 4px 16px; background: var(--forest); color: var(--white); font-size: 15px; line-height: 1.45; }
.ai-a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.ai-a > .ai-spark { width: 30px; height: 30px; clip-path: none; border-radius: 50%; background: var(--mint); position: relative; }
.ai-a > .ai-spark::after { content: ""; position: absolute; inset: 7px; background: var(--forest); clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%); }
.ai-a-body { position: relative; min-width: 0; }
.ai-text { margin: 4px 0 0; font-size: 15px; line-height: 1.6; color: var(--ink); }
.ai-s--you .ai-st { background: linear-gradient(transparent 58%, rgba(150, 248, 120, .45) 58%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ai-cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin-left: 2px; border-radius: 5px; background: var(--paper); color: var(--ink-2); font-size: 11.5px; font-weight: 700; line-height: 1; vertical-align: 2px; }
.ai-cite--you { background: var(--green); color: var(--forest); }
.ai-src-l { margin: 18px 0 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.ai-srcs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ai-src { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.ai-src .ai-cite { margin: 1px 0 0; vertical-align: 0; }
.ai-src-t { display: grid; gap: 1px; min-width: 0; }
.ai-dom { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.ai-src--you { border: 1.5px solid var(--green-2); background: var(--mint); color: var(--ink); }
.ai-src--you .ai-dom { color: var(--forest); }
.ai-you { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--forest); color: var(--white); font-size: 11px; font-weight: 600; letter-spacing: .02em; vertical-align: 1px; }
.ai-typing { position: absolute; left: 0; top: 8px; display: inline-flex; gap: 5px; opacity: 0; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-2); }

/* callouts */
.ai-calls { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; align-content: start; }
@media (min-width: 1200px) { .ai-calls { align-content: center; } }
.ai-call { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.ai-ic { width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: var(--forest); fill: none; stroke: var(--green); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.ai-call > span { display: grid; gap: 3px; }
.ai-call strong { font-size: 16.5px; color: var(--forest); }
.ai-call span span { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
@media (min-width: 1200px) {
  /* left callouts read towards the window: icon on the right */
  .ai-calls--l .ai-call { grid-template-columns: minmax(0, 1fr) auto; text-align: right; }
  .ai-calls--l .ai-ic { order: 2; }
  .ai-call { position: relative; }
  .ai-calls--l .ai-call::after, .ai-calls--r .ai-call::after { content: ""; position: absolute; top: 21px; width: 26px; border-top: 1.5px dashed #7d8a80; }
  .ai-calls--l .ai-call::after { right: -34px; }
  .ai-calls--r .ai-call::after { left: -34px; }
}

/* animation: question, typing dots, the answer sentence by sentence, the sources, then the callouts */
.js .vz-figure .ai-q, .js .vz-figure .ai-src, .js .vz-figure .ai-src-l { opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s cubic-bezier(.2, .7, .2, 1); }
.js .vz-figure .ai-s { opacity: 0; transition: opacity .5s ease; }
.js .vz-figure .ai-call { opacity: 0; transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.js .vz-figure .ai-calls--l .ai-call { transform: translateX(-14px); }
.js .vz-figure .ai-calls--r .ai-call { transform: translateX(14px); }
.js .vz-figure .ai-q { transition-delay: .2s; }
.js .vz-figure .ai-s--1 { transition-delay: 1s; }
.js .vz-figure .ai-s--2 { transition-delay: 1.35s; }
.js .vz-figure .ai-s--3 { transition-delay: 1.7s; }
.js .vz-figure .ai-s--4 { transition-delay: 2.05s; }
.js .vz-figure .ai-src-l { transition-delay: 2.2s; }
.js .vz-figure .ai-src:nth-child(1) { transition-delay: 2.3s; }
.js .vz-figure .ai-src:nth-child(2) { transition-delay: 2.4s; }
.js .vz-figure .ai-src:nth-child(3) { transition-delay: 2.5s; }
.js .vz-figure .ai-call--1 { transition-delay: 1.2s; } .js .vz-figure .ai-call--4 { transition-delay: 1.45s; }
.js .vz-figure .ai-call--2 { transition-delay: 1.7s; } .js .vz-figure .ai-call--5 { transition-delay: 1.95s; }
.js .vz-figure .ai-call--3 { transition-delay: 2.2s; }
.js .vz-figure.is-visible .ai-q, .js .vz-figure.is-visible .ai-src, .js .vz-figure.is-visible .ai-src-l,
.js .vz-figure.is-visible .ai-s, .js .vz-figure.is-visible .ai-call { opacity: 1; transform: none; }
.js .vz-figure.is-visible .ai-typing { animation: ai-typing .7s ease .45s both; }
.js .vz-figure.is-visible .ai-typing i { animation: ai-dot .5s ease-in-out .45s 2 alternate; }
.js .vz-figure.is-visible .ai-typing i:nth-child(2) { animation-delay: .55s; }
.js .vz-figure.is-visible .ai-typing i:nth-child(3) { animation-delay: .65s; }
.js .vz-figure.is-visible .ai-src--you { animation: ai-glow 2.4s ease-in-out 2.9s 2; }
@keyframes ai-typing { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ai-dot { to { transform: translateY(-4px); } }
@keyframes ai-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(111, 226, 79, 0); } 50% { box-shadow: 0 0 0 5px rgba(111, 226, 79, .3); } }

@media (max-width: 600px) {
  .ai-q { max-width: 92%; font-size: 14.5px; }
  .ai-a { grid-template-columns: minmax(0, 1fr); }
  .ai-a > .ai-spark { display: none; }
  .ai-typing { top: 2px; }
}
