/* /ai-assistants hero: a scripted demo of the AI Assistant Connector (driven by assistant-demo.js).
   Without JavaScript the markup shows a finished, static composition. */
@media (min-width: 980px) { .hero2--demo .hero2__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); } }

.ad { width: 100%; max-width: 620px; margin: 0 auto; font-size: 12.5px; line-height: 1.4; }
.ad *, .ad *::before, .ad *::after { box-sizing: border-box; }

/* step indicator */
.ad-steps { display: flex; gap: 6px; list-style: none; margin: 0 0 14px; padding: 0; }
.ad-steps li { flex: 1 1 0; min-width: 0; }
.ad-steps button { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 6px 2px 10px; border: 0; background: none; font: 700 13px/1.2 var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; }
.ad-steps button::before, .ad-steps button::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--line); }
.ad-steps button::after { background: linear-gradient(90deg, var(--brand), var(--pink)); transform: scaleX(var(--p, 0)); transform-origin: left; }
.ad-steps b { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--line); color: var(--ink-2); font-size: 10.5px; flex: none; transition: background .3s, color .3s; }
.ad-steps button:hover { color: var(--ink); }
.ad-steps [aria-current] { color: var(--ink); }
.ad-steps [aria-current] b { background: var(--brand); color: #fff; }
@media (max-width: 440px) { .ad-steps { gap: 4px; } .ad-steps b { display: none; } .ad-steps button { font-size: 12px; } }

/* stage and windows */
.ad__stage { position: relative; height: 452px; transition: opacity .5s ease; }
.ad__stage.is-out { opacity: 0; }
.ad-win { position: absolute; display: flex; flex-direction: column; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .55s, box-shadow .55s; }
.ad-win::after { content: ''; position: absolute; inset: 0; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity .55s; }
.ad-win.is-front { z-index: 2; }
.ad-win:not(.is-front) { z-index: 1; box-shadow: var(--shadow); }
.ad-win:not(.is-front)::after { opacity: .3; }
.ad-win { left: 0; right: 0; top: 16px; bottom: 0; transform-origin: top center; }
.ad-win:not(.is-front) { transform: translateY(-16px) scale(.92); }
.ad-win:not(.is-front)::after { opacity: .5; }
@media (min-width: 640px) {
  .ad__stage { height: 500px; }
  .ad-app { left: auto; bottom: auto; top: 0; right: 0; width: 84%; height: 332px; transform-origin: top right; }
  .ad-chat { right: auto; top: auto; left: 0; bottom: 0; width: 64%; height: 362px; transform-origin: bottom left; }
  .ad-win:not(.is-front) { transform: scale(.965); }
  .ad-win:not(.is-front)::after { opacity: .28; }
}
.ad-win__bar { display: flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.ad-win__bar > i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.ad-win__bar b { font-size: 12.5px; }
.ad-win__bar small { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; color: var(--muted); }
.ad-url { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; min-width: 0; height: 22px; margin-left: 8px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--muted); font-size: 11px; font-weight: 600; }
.ad-url img { width: 12px; height: 12px; flex: none; }
.ad-url span { overflow: hidden; text-overflow: ellipsis; }
.ad-ai { width: 18px; height: 18px; border-radius: 50%; flex: none; background: conic-gradient(from 40deg, #14b8a6, #5b2ee6, #ff4d8d, #ffb020, #14b8a6); box-shadow: inset 0 0 0 4px var(--surface-2); }

/* shared bits */
.ad-btn { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 8px; background: #5b2ee6; color: #fff; font-size: 11.5px; font-weight: 700; white-space: nowrap; flex: none; }
.ad-btn--ghost { background: var(--card); color: var(--ink-2); border: 1px solid var(--line); }
.ad-lbl { display: block; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ad-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(15, 157, 116, .18); flex: none; }
.is-tap { animation: adTap .35s ease; }
@keyframes adTap { 40% { transform: scale(.9); } }
@keyframes adSpin { to { transform: rotate(360deg); } }
@keyframes adBlink { 50% { opacity: 0; } }
@keyframes adShim { to { background-position: -200% 0; } }
@keyframes adPop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } }
@keyframes adRing { 0% { opacity: .8; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes adGlow { 0%, 100% { opacity: 0; } 25%, 70% { opacity: 1; } }

/* app window */
.ad-app__body { display: flex; flex: 1; min-height: 0; }
.ad-side { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: none; width: 40px; padding: 10px 0; background: linear-gradient(180deg, #2a1570, #1b1035); }
.ad-side img { width: 20px; height: 20px; margin-bottom: 4px; }
.ad-side i { width: 16px; height: 16px; border-radius: 5px; background: rgba(255, 255, 255, .16); transition: background .3s; }
.ad-side i.ad-side__on { background: rgba(255, 255, 255, .9); }
.ad-app__main { position: relative; flex: 1; min-width: 0; background: var(--surface-2); }
.ad-scr { position: absolute; inset: 12px 14px; display: flex; flex-direction: column; gap: 8px; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .35s, transform .35s, visibility 0s .35s; }
.ad-scr.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.ad-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; font-size: 13.5px; color: var(--ink); }
.ad-head small { color: var(--muted); }

.ad-card__in { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; }
.ad-card__info { display: grid; justify-items: start; gap: 5px; flex: 1; min-width: 0; }
.ad-card__title { font-size: 14px; font-weight: 800; color: var(--ink); border-radius: 6px; transition: color .3s; }
.ad-card__meta { font-size: 11px; color: var(--muted); }
.ad-card__prize { font-size: 11.5px; color: var(--ink-2); }
.ad-card__prize b { display: inline-block; padding: 0 5px; border-radius: 5px; color: #c22f3c; }
.ad-card__prize b.is-new { animation: adHi 1.6s ease; }
@keyframes adHi { 0%, 70% { background: #ffe066; } }
.ad-card__links { display: flex; flex-wrap: wrap; gap: 4px; transition: opacity .4s .3s; }
.ad-card__links em { font-style: normal; font-size: 10.5px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 6px; padding: 1px 6px; }
.ad-card__in:not(.is-built) .ad-card__title { color: transparent; background: linear-gradient(90deg, var(--line), var(--surface-2), var(--line)) 0 0 / 200% 100%; animation: adShim 1.1s linear infinite; }
.ad-card__in:not(.is-built) .ad-card__links, .ad-card__in:not(.is-built) .ad-badge, .ad-card__in:not(.is-built) .ad-card__prize { opacity: 0; }
.ad-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: #fff1d1; color: #8a5a00; font-size: 10.5px; font-weight: 800; transition: background .3s, color .3s, opacity .3s; }
.ad-badge.is-live { background: rgba(15, 157, 116, .14); color: var(--success); animation: adPop .45s ease; }
.ad-badge.is-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ad-badge--muted, .ad-row .ad-badge { background: var(--line); color: var(--muted); }

.ad-wheel { position: relative; flex: none; width: 112px; height: 112px; }
@media (min-width: 640px) { .ad-wheel { width: 128px; height: 128px; } }
.ad-wheel::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; border: 3px dashed var(--line-strong); opacity: 0; transition: opacity .3s; }
.ad-card__in:not(.is-built) .ad-wheel::before { opacity: 1; animation: adSpin 2.4s linear infinite; }
.ad-wheel__spin { display: block; width: 100%; height: 100%; }
.ad-wheel svg { width: 100%; height: 100%; transition: transform 1s cubic-bezier(.2, .9, .25, 1.15), opacity .4s; filter: drop-shadow(0 6px 10px rgba(42, 21, 112, .28)); }
.ad-card__in:not(.is-built) .ad-wheel svg { opacity: 0; transform: scale(.4) rotate(-200deg); }
.ad-wheel text { font: 800 15px/1 var(--font); }
.ad-wheel__hl { opacity: 0; }
.ad-wheel.is-flash .ad-wheel__hl { animation: adGlow 1.4s ease; }
.ad-wheel__pin { position: absolute; left: 50%; top: -5px; width: 0; height: 0; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top: 13px solid #1b1530; filter: drop-shadow(0 0 1.5px #fff); }

.ad-row { display: flex; align-items: center; gap: 9px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.ad-row b { flex: 1; min-width: 0; font-size: 12.5px; }
.ad-mini { width: 22px; height: 22px; border-radius: 50%; flex: none; background: conic-gradient(#ff8fb1 0 25%, #ffd166 0 50%, #7ad7a8 0 75%, #8fa8ff 0); }
.ad-toast { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%; margin: 0 auto; padding: 8px 14px 8px 8px; border-radius: 12px; background: #1b1530; color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 12px 30px rgba(27, 21, 48, .35); opacity: 0; transform: translateY(12px); transition: opacity .35s, transform .45s cubic-bezier(.2, .8, .2, 1.3); }
.ad-toast span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #0f9d74; font-size: 11px; }
.ad-toast.is-on { opacity: 1; transform: none; }

.ad-scr--auth { align-items: center; justify-content: center; }
.ad-auth { display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 300px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); color: var(--ink); }
.ad-auth__h { font-size: 15px; font-weight: 800; }
.ad-auth p { margin: 0; font-size: 11.5px; color: var(--muted); }
.ad-perm { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.ad-perm small { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.ad-tg { position: relative; width: 28px; height: 16px; margin-left: auto; flex: none; border-radius: 99px; background: var(--line-strong); transition: background .25s; }
.ad-tg::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .25s; }
.ad-tg.is-on { background: #5b2ee6; }
.ad-tg.is-on::after { transform: translateX(12px); }
.ad-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ad-chips em { font-style: normal; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); transition: background .25s, color .25s, border-color .25s; }
.ad-chips em.is-on { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }
.ad-chips em.is-on::before { content: '✓ '; }
.ad-auth__btns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 3px; }

.ad-conn-app { display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.ad-conn-app > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.ad-conn-app small, .ad-conn__ok small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: var(--muted); }
.ad-log { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; margin: 0; padding: 0; list-style: none; }
.ad-log li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-size: 11.5px; color: var(--ink-2); opacity: 0; transform: translateX(14px); transition: opacity .35s, transform .4s; }
.ad-log li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none; }
.ad-log span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-log time { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.ad-scr.is-on .ad-log li { opacity: 1; transform: none; transition-delay: calc(.3s + var(--i) * .32s); }
.ad-foot { margin: 0; text-align: center; font-size: 10.5px; font-weight: 700; color: var(--success); }

/* chat window */
.ad-chat__body { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 10px 12px; }
.ad-thread { display: flex; flex-direction: column; justify-content: flex-end; flex: 1; min-height: 0; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 28px); mask-image: linear-gradient(transparent, #000 28px); }
.ad-rv { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .45s ease, opacity .35s .1s; }
.ad-rv.is-on { grid-template-rows: 1fr; opacity: 1; }
.ad-rv > div { min-height: 0; overflow: hidden; }
.ad-thread .ad-rv > div > * { margin: 8px 0 0; }
.ad-thread .ad-rv > div > .ad-msg--you { margin-left: auto; }
.ad-scr .ad-rv > div { padding: 1px; }
.ad-msg { width: fit-content; max-width: 86%; padding: 8px 11px; border-radius: 14px; overflow-wrap: anywhere; }
.ad-msg--you { background: #5b2ee6; color: #fff; border-bottom-right-radius: 4px; }
.ad-msg--ai { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; }
.ad-msg--wide { width: 90%; max-width: 90%; }
.ad-sys { width: fit-content; margin-inline: auto !important; padding: 3px 10px; border-radius: 999px; background: rgba(15, 157, 116, .1); color: var(--success); font-size: 10.5px; font-weight: 700; }
.ad-sys::before { content: '● '; }
.ad-tool { display: grid; grid-template-columns: 14px auto; align-items: center; column-gap: 7px; width: fit-content; max-width: 94%; padding: 5px 10px 5px 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); color: var(--ink-2); font-size: 11px; font-weight: 600; transition: border-color .3s; }
.ad-tool code { font: 600 10.5px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--brand); background: none; padding: 0; overflow-wrap: anywhere; }
.ad-tool small { grid-column: 2; display: none; font-size: 10.5px; font-weight: 700; color: var(--success); }
.ad-tool__ic { position: relative; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--brand); animation: adSpin .8s linear infinite; }
.ad-tool.is-done small, .ad-tool.is-err small { display: block; }
.ad-tool.is-done .ad-tool__ic, .ad-tool.is-err .ad-tool__ic { border: 0; background: #0f9d74; animation: adPop .4s ease; }
.ad-tool.is-done .ad-tool__ic::after, .ad-tool.is-err .ad-tool__ic::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: 800; line-height: 1; }
.ad-tool.is-err { border-color: rgba(211, 58, 58, .55); }
.ad-tool.is-err small { color: var(--danger); }
.ad-tool.is-err .ad-tool__ic { background: var(--danger); }
.ad-tool.is-err .ad-tool__ic::after { content: '✕'; }
.ad-bars { display: grid; gap: 7px; margin-top: 7px; }
.ad-bar { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; font-size: 11px; }
.ad-bar em { font-style: normal; font-weight: 700; color: var(--ink-2); }
.ad-bar i { grid-column: 1 / -1; height: 8px; border-radius: 4px; width: calc(var(--w) * 100%); background: linear-gradient(90deg, #5b2ee6, #ff4d8d); transform: scaleX(0); transform-origin: left; transition: transform 1s .35s cubic-bezier(.2, .8, .2, 1); }
.ad-bar + .ad-bar i { transition-delay: .55s; }
.ad-rv.is-on .ad-bar i, .ad:not(.ad--js) .ad-bar i { transform: none; }
.ad-input { display: flex; align-items: center; gap: 8px; flex: none; height: 38px; margin: 0 10px 10px; padding: 0 6px 0 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--card); color: var(--ink); }
.ad-input__txt { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.ad-input__txt::after, .ad-input__txt:empty::before, .ad-field.is-focus .ad-type::after { content: ''; display: inline-block; width: 1.5px; height: 1.15em; margin-left: 1px; vertical-align: -3px; background: var(--brand); animation: adBlink 1s steps(1) infinite; }
.ad-input__txt:empty::after { content: 'Ask anything'; width: auto; height: auto; margin-left: 3px; vertical-align: 0; background: none; color: var(--muted); animation: none; }
.ad-send { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #5b2ee6; color: #fff; font-weight: 800; flex: none; }
.ad-conn { display: none; flex-direction: column; gap: 8px; }
.ad-conn.is-on { display: flex; }
.ad-conn__card { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.ad-conn__card b { font-size: 13px; }
.ad-conn__card .ad-btn { align-self: flex-end; }
.ad-field { display: grid; gap: 3px; }
.ad-field small { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.ad-field > span { display: flex; align-items: center; height: 28px; padding: 0 9px; overflow: hidden; white-space: nowrap; background: var(--card); border: 1px solid var(--line-strong); border-radius: 8px; transition: border-color .2s, box-shadow .2s; }
.ad-field.is-focus > span { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.ad-type { font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ad-conn__ok { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid rgba(15, 157, 116, .35); border-radius: 12px; background: rgba(15, 157, 116, .08); color: var(--ink); opacity: 0; transform: translateY(8px) scale(.97); transition: opacity .35s, transform .45s cubic-bezier(.2, .8, .2, 1.3); }
.ad-conn__ok > span:last-child { display: grid; min-width: 0; }
.ad-conn__ok.is-on { opacity: 1; transform: none; }

/* pointer, caption, play button */
.ad-cursor { position: absolute; left: 0; top: 0; z-index: 5; width: 22px; height: 22px; opacity: 0; pointer-events: none; transition: opacity .3s; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.ad-cursor.is-on { opacity: 1; }
.ad-cursor svg { width: 22px; height: 22px; }
.ad-cursor::before { content: ''; position: absolute; left: -11px; top: -11px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--brand); opacity: 0; }
.ad-cursor.is-click::before { animation: adRing .5s ease-out; }
.ad__foot { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 14px; }
.ad__cap { flex: 1; min-width: 0; margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--ink-2); }
.ad-play { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--ink); cursor: pointer; box-shadow: var(--shadow); }
.ad-play:hover { border-color: var(--brand); color: var(--brand); }
.ad-play__ic { width: 11px; height: 12px; border-left: 3.5px solid currentColor; border-right: 3.5px solid currentColor; }
.ad--stopped .ad-play__ic { width: 0; height: 0; margin-left: 3px; border: 7px solid transparent; border-right: 0; border-left: 11px solid currentColor; }
.ad__note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.ad:not(.ad--js) .ad-steps, .ad:not(.ad--js) .ad-play { visibility: hidden; }
@media (max-width: 639px) { .ad__cap { font-size: 13.5px; min-height: 2.8em; } }

.ad--hold *, .ad--hold *::before, .ad--hold *::after { animation-play-state: paused !important; }
.ad--instant *, .ad--instant *::before, .ad--instant *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .ad *, .ad *::before, .ad *::after { transition-duration: .01s !important; transition-delay: 0s !important; animation: none !important; }
}
@media (max-width: 400px) { .ad__cap { min-height: 4.2em; } }
