/* /intelligence hero (aih-*): the Chip In 4.0 AI tab recreated on a CSS phone (AiHomeDemo.razor). Sits on the hs-* tokens
   (home-showcase.css) and the cs-* phone chrome (couples-showcase.css), which must load first. Convention: an element's
   base style is its final state (suggestions loaded); keyframes describe the journey, so reduced-motion users see the
   loaded screen. Everything inside the phone is sized in em from the phone width (cs-phone sets font-size). */
.aih { --aih-t: 18s; --aih-node: #5a45e6; --aih-node-glow: rgba(90, 69, 230, .6); --aih-lobe-core: rgba(124, 106, 242, .42); --aih-lobe-edge: rgba(124, 106, 242, .12); --aih-amber: #d97706; }
[data-bs-theme="dark"] .aih { --aih-node: #5ee6ff; --aih-node-glow: rgba(94, 230, 255, .65); --aih-lobe-core: rgba(150, 136, 255, .34); --aih-lobe-edge: rgba(150, 136, 255, .08); --aih-amber: #f2b557; }
/* In the /intelligence hero column (a flex container with perspective), the demo takes the full column width above the halo and beams. */
.chipin-ai-hero-demo { perspective: none; }
.chipin-ai-hero-demo .aih { position: relative; z-index: 5; width: 100%; }
.aih-stage { container-type: inline-size; position: relative; isolation: isolate; width: 100%; max-width: 36rem; margin-left: auto; aspect-ratio: 10 / 10.4; }
.aih-stage * { animation-duration: var(--aih-t); animation-iteration-count: infinite; animation-timing-function: ease-in-out; animation-fill-mode: both; }
.aih-glow { position: absolute; inset: 6% 2% 4% 20%; z-index: 0; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--cp-accent) 30%, transparent), transparent 70%); filter: blur(22px); animation-name: aih-glow; animation-duration: 9s; }
.aih-phone { --w: 46cqw; position: absolute; right: 2%; top: 1%; z-index: 2; }
.aih-screen { background: var(--cs-screen); }
.aih-toolbar { display: flex; align-items: center; justify-content: space-between; padding: .55em 1.15em 0; color: var(--cp-accent); font-size: 1.05em; }
.aih-toolbar span { display: inline-flex; gap: .3em; }
.aih-toolbar span i:last-child { color: var(--cp-text); }

/* The brain: two soft lobes, a lattice of connections, thirteen neurons that fire in sequence, and signals that travel the links. */
.aih-hero { position: relative; display: grid; place-items: center; min-height: 9.4em; margin: 0 .8em; padding: .2em 0; text-align: center; }
.aih-brain { position: absolute; left: 50%; top: 50%; z-index: 0; width: 84%; height: auto; transform: translate(-50%, -50%); overflow: visible; animation-name: aih-breathe; animation-duration: 7s; }
.aih-lobes path { fill: url(#aih-lobe); }
.aih-stop-a { stop-color: var(--aih-lobe-core); }
.aih-stop-b { stop-color: var(--aih-lobe-edge); }
.aih-edges use { fill: none; stroke: var(--aih-node); stroke-opacity: .45; stroke-width: .9; stroke-linecap: round; }
.aih-spark { fill: #fff; stroke: var(--aih-node); stroke-width: 1; filter: drop-shadow(0 0 2px var(--aih-node-glow)); animation-name: aih-spark; animation-duration: 2.6s; }
.aih-node * { transform-box: fill-box; transform-origin: center; animation-duration: 3.9s; animation-delay: calc(var(--i) * .3s); }
.aih-node-core { fill: var(--aih-node); animation-name: aih-core; }
.aih-node-ring { fill: none; stroke: var(--aih-node); stroke-width: .7; opacity: .55; animation-name: aih-ring; }
.aih-node-halo { fill: var(--aih-node); opacity: .22; animation-name: aih-halo; }
.aih-node.is-core * { animation-duration: 2.6s; }
.aih-title { position: relative; z-index: 2; margin: 0; max-width: 92%; color: var(--cp-accent); font-size: .9em; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.aih-sub { position: relative; z-index: 2; margin: .45em 0 0; color: var(--cp-text); font-size: .6em; font-weight: 500; }
.aih-sub i { margin-right: .25em; color: var(--cp-text-muted); vertical-align: -.1em; }
@keyframes aih-glow { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes aih-breathe { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.035); } }
@keyframes aih-core { 0%, 70%, 100% { transform: scale(1); } 78% { transform: scale(1.9); filter: drop-shadow(0 0 2px var(--aih-node-glow)); } 86% { transform: scale(1.15); } }
@keyframes aih-ring { 0%, 72% { opacity: .5; transform: scale(1); } 80% { opacity: 1; transform: scale(1.6); } 95%, 100% { opacity: .5; transform: scale(1); } }
@keyframes aih-halo { 0%, 70%, 100% { opacity: .18; transform: scale(1); } 78% { opacity: .75; transform: scale(2.3); } 92% { opacity: .2; transform: scale(1.1); } }
@keyframes aih-spark { 0% { opacity: 0; } 15%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* Suggested for you: the greeting types in, skeletons give way to cards, a pointer taps the first one, the answer slides up. */
.aih-suggested { position: relative; flex: 1; min-height: 0; margin: .2em .9em 0; }
.aih-sugg-head { display: flex; align-items: center; gap: .45em; color: var(--cp-text-muted); font-size: .54em; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.aih-sugg-head > span { display: inline-flex; align-items: center; gap: .35em; }
.aih-sugg-head > span i, .aih-refresh { color: var(--cp-accent); font-size: 1.35em; }
.aih-sugg-head em { display: inline-flex; align-items: center; gap: .35em; margin-left: auto; padding: .3em .85em; border-radius: 999px; background: color-mix(in srgb, var(--cp-accent) 14%, var(--cs-card)); color: var(--cp-accent); font-style: normal; letter-spacing: .1em; }
.aih-greet { margin-top: .35em; }
.aih-greet b { display: block; color: var(--cp-text); font-size: 1.02em; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.aih-greet span { display: block; margin-top: .15em; color: var(--cp-accent); font-size: .74em; font-weight: 600; }
.aih-greet small { display: block; margin-top: .15em; color: var(--cp-text-muted); font-size: .6em; letter-spacing: .14em; }
.aih-type { max-width: 100%; white-space: nowrap; overflow: hidden; animation-timing-function: steps(24, end); }
.aih-type.is-1 { animation-name: aih-type-1; }
.aih-type.is-2 { animation-name: aih-type-2; }
.aih-type.is-3 { animation-name: aih-type-3; }
.aih-cards { position: relative; display: grid; gap: .4em; margin-top: .45em; }
.aih-skel { position: absolute; left: 0; right: 0; z-index: 3; display: grid; grid-template-columns: auto 1fr; gap: .55em; align-items: center; padding: .55em .6em; border: 1px solid var(--cs-line); border-radius: .9em; background: var(--cs-card); opacity: 0; overflow: hidden; }
.aih-skel.is-1 { top: 0; height: calc(50% - .225em); animation-name: aih-skel; }
.aih-skel.is-2 { top: calc(50% + .225em); height: calc(50% - .225em); animation-name: aih-skel; }
.aih-skel > i { width: 2.1em; height: 2.1em; border-radius: 50%; background: color-mix(in srgb, var(--cp-text) 10%, transparent); }
.aih-skel b, .aih-skel span { display: block; height: .55em; border-radius: 999px; background: color-mix(in srgb, var(--cp-text) 10%, transparent); }
.aih-skel b { width: 55%; margin-bottom: .35em; }
.aih-skel span { width: 92%; margin-top: .25em; }
.aih-skel span.is-short { width: 48%; }
.aih-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--cp-text) 7%, transparent) 50%, transparent 80%); transform: translateX(-100%); animation: aih-shimmer 1.5s linear infinite; }
.aih-card { --aih-tone: var(--cp-accent); position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .55em; padding: .55em .5em .55em .6em; border: 1px solid color-mix(in srgb, var(--aih-tone) 45%, var(--cs-line)); border-left: .3em solid color-mix(in srgb, var(--cp-text) 55%, transparent); border-radius: .9em; background: linear-gradient(135deg, color-mix(in srgb, var(--aih-tone) 16%, var(--cs-card)), var(--cs-card) 70%); color: var(--cp-text); }
.aih-card.is-amber { --aih-tone: var(--aih-amber); }
.aih-card.is-violet { --aih-tone: var(--cp-accent); }
.aih-card > i:first-child { display: grid; place-items: center; width: 2.1em; height: 2.1em; border-radius: 50%; background: color-mix(in srgb, var(--aih-tone) 24%, var(--cs-card)); color: var(--aih-tone); font-size: 1em; }
.aih-card div { min-width: 0; }
.aih-card b { display: block; font-size: .74em; font-weight: 800; line-height: 1.2; }
.aih-card p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: .15em 0 0; overflow: hidden; color: var(--cp-text-muted); font-size: .56em; line-height: 1.35; }
.aih-card small { display: block; margin-top: .2em; color: var(--cp-text-muted); font-size: .54em; }
.aih-chev { color: var(--aih-tone); font-size: 1.15em; }
.aih-both { position: absolute; right: 1.9em; top: 50%; display: inline-flex; align-items: center; gap: .3em; padding: .2em .6em; border-radius: 999px; background: color-mix(in srgb, var(--cp-accent) 18%, var(--cs-card)); color: var(--cp-accent); font-size: .5em; font-style: normal; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; transform: translateY(-1.9em); }
.aih-card.is-2 { animation-name: aih-card-2; }
.aih-pointer { position: absolute; right: 2.1em; top: 1.1em; z-index: 6; color: var(--cp-text); font-size: 1.9em; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); opacity: 0; pointer-events: none; animation-name: aih-pointer; }
.aih-dots { display: flex; justify-content: center; gap: .45em; margin-top: .45em; animation-name: aih-late; }
.aih-dots i { width: .5em; height: .5em; border-radius: 50%; background: color-mix(in srgb, var(--cp-accent) 32%, transparent); }
.aih-dots i.is-on { background: var(--cp-accent); }
.aih-note { margin: .3em 0 0; text-align: center; color: var(--cp-text-muted); font-size: .54em; animation-name: aih-late; }
.aih-answer { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; padding: .65em .7em .6em; border: 1px solid color-mix(in srgb, var(--cp-accent) 45%, var(--cs-line)); border-radius: 1em; background: var(--cs-card); box-shadow: 0 -1.2em 2.4em rgba(12, 10, 40, .22); opacity: 0; transform: translateY(1.2em); animation-name: aih-answer; }
.aih-answer-head { display: flex; align-items: center; gap: .5em; }
.aih-answer-head > i { display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: .6em; background: var(--cp-accent); color: #fff; font-size: 1em; }
.aih-answer-head b { display: block; font-size: .66em; font-weight: 800; }
.aih-answer-head span { display: block; color: var(--cp-text-muted); font-size: .5em; }
.aih-answer p { margin: .5em 0 0; color: var(--cp-text-muted); font-size: .58em; line-height: 1.4; }
.aih-answer p b { color: var(--cp-text); }
.aih-bars { display: grid; gap: .3em; margin-top: .5em; }
.aih-bars > div { display: grid; grid-template-columns: 5.2em 1fr 3.4em; align-items: center; gap: .5em; color: var(--cp-text-muted); font-size: .52em; font-weight: 700; }
.aih-bars span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aih-bars i { display: block; height: .9em; width: var(--w); border-radius: 999px; background: linear-gradient(90deg, #a5b4fc, var(--cp-accent)); transform-origin: left; animation-name: aih-bar; }
.aih-bars .is-2 i { animation-delay: .15s; } .aih-bars .is-3 i { animation-delay: .3s; } .aih-bars .is-4 i { animation-delay: .45s; }
.aih-bars b { color: var(--cp-text); text-align: right; }
.aih-chips { display: flex; flex-wrap: wrap; gap: .35em; margin-top: .55em; }
.aih-chips span { padding: .3em .7em; border-radius: 999px; background: color-mix(in srgb, var(--cp-accent) 12%, var(--cs-card)); color: var(--cp-accent); font-size: .5em; font-weight: 800; white-space: nowrap; }
.aih-composer { display: flex; align-items: center; gap: .5em; min-height: 2.5em; margin: .4em .9em .4em; padding: .4em .4em .4em .9em; border: 1px solid color-mix(in srgb, var(--cp-text) 55%, transparent); border-radius: 1.5em; background: var(--cs-card); }
.aih-ask { flex: 1; min-width: 0; color: var(--cp-text); font-size: .6em; white-space: nowrap; overflow: hidden; }
.aih-ask em { display: inline-block; max-width: 0; overflow: hidden; vertical-align: top; font-style: normal; animation-name: aih-ask; animation-timing-function: steps(42, end); }
.aih-send { display: grid; place-items: center; flex: none; width: 2em; height: 2em; border-radius: .65em; background: var(--cp-accent); color: #fff; font-size: 1em; animation-name: aih-send; }
.aih-tabbar span.is-active i { color: var(--cp-accent); }

/* Outside the phone: the Smart Signals rail loads row by row, and two pills. */
.aih-rail { position: absolute; left: 0; top: 12%; z-index: 3; width: 48%; padding: 2.4cqw 2.6cqw 2.2cqw; border: 1px solid var(--cp-border); border-radius: 2.4cqw; background: color-mix(in srgb, var(--cp-surface) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--hs-shadow); animation-name: aih-rail; }
.aih-rail-head { display: flex; align-items: center; gap: 1.2cqw; margin-bottom: 1.8cqw; color: var(--cp-text); font-size: clamp(.56rem, 2.1cqw, .8rem); font-weight: 800; }
.aih-rail-head > i { color: var(--cp-accent); font-size: 1.3em; }
.aih-rail-head em { display: inline-flex; align-items: center; gap: .3em; margin-left: auto; color: #dc2626; font-size: .82em; font-style: normal; }
.aih-rail-row { --aih-tone: var(--cp-accent); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1.6cqw; margin-top: 1.4cqw; padding: 1.6cqw 1.8cqw; border: 1px solid color-mix(in srgb, var(--aih-tone) 35%, var(--cp-border)); border-left: .8cqw solid var(--aih-tone); border-radius: 1.8cqw; background: linear-gradient(135deg, color-mix(in srgb, var(--aih-tone) 12%, var(--cp-surface)), var(--cp-surface) 65%); }
.aih-rail-row.tone-crit { --aih-tone: #e5484d; } .aih-rail-row.tone-warn { --aih-tone: #f5a524; } .aih-rail-row.tone-ok { --aih-tone: #22b573; }
.aih-rail-row > i { display: grid; place-items: center; width: 5cqw; height: 5cqw; border-radius: 50%; background: color-mix(in srgb, var(--aih-tone) 18%, var(--cp-surface)); color: var(--aih-tone); font-size: 2.6cqw; }
.aih-rail-row b { display: block; color: var(--cp-text); font-size: clamp(.52rem, 1.9cqw, .74rem); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aih-rail-row span { display: block; color: var(--cp-text-muted); font-size: clamp(.46rem, 1.65cqw, .64rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aih-rail-row.is-1 { animation-name: aih-row-1; } .aih-rail-row.is-2 { animation-name: aih-row-2; } .aih-rail-row.is-3 { animation-name: aih-row-3; }
.aih-rail-foot { display: flex; align-items: center; gap: 1cqw; margin-top: 2cqw; color: var(--cp-accent); font-size: clamp(.46rem, 1.65cqw, .64rem); font-weight: 800; animation-name: aih-row-4; }
.aih-pill-1 { left: 0; top: 2%; animation: hs-float-c 7s ease-in-out .6s infinite; }
.aih-pill-2 { left: 2%; bottom: 10%; }

@keyframes aih-shimmer { to { transform: translateX(100%); } }
@keyframes aih-skel { 0%, 24% { opacity: 1; } 28%, 100% { opacity: 0; } }
@keyframes aih-type-1 { 0%, 9% { max-width: 0; } 15%, 100% { max-width: 100%; } }
@keyframes aih-type-2 { 0%, 15% { max-width: 0; } 21%, 100% { max-width: 100%; } }
@keyframes aih-type-3 { 0%, 21% { max-width: 0; } 25%, 100% { max-width: 100%; } }
@keyframes aih-card-2 { 0%, 30% { opacity: 0; transform: translateY(.7em); } 34%, 96% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes aih-late { 0%, 34% { opacity: 0; } 37%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes aih-pointer { 0%, 42% { opacity: 0; transform: translate(2.5em, 5em); } 46% { opacity: 1; transform: translate(0, 0); } 48% { transform: scale(.8); } 50%, 53% { opacity: 1; transform: scale(1); } 57%, 100% { opacity: 0; transform: none; } }
@keyframes aih-ask { 0%, 50% { max-width: 0; } 58%, 92% { max-width: 100%; } 96%, 100% { max-width: 0; } }
@keyframes aih-send { 0%, 57% { transform: scale(1); } 59% { transform: scale(.82); } 61%, 100% { transform: scale(1); } }
@keyframes aih-answer { 0%, 60% { opacity: 0; transform: translateY(1.2em); } 64%, 92% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: translateY(1.2em); } }
@keyframes aih-bar { 0%, 64% { transform: scaleX(0); } 72%, 100% { transform: scaleX(1); } }
@keyframes aih-rail { 0%, 3% { opacity: 0; transform: translateY(.6rem); } 7%, 100% { opacity: 1; transform: none; } }
@keyframes aih-row-1 { 0%, 8% { opacity: 0; transform: translateX(-.6rem); } 12%, 100% { opacity: 1; transform: none; } }
@keyframes aih-row-2 { 0%, 12% { opacity: 0; transform: translateX(-.6rem); } 16%, 100% { opacity: 1; transform: none; } }
@keyframes aih-row-3 { 0%, 16% { opacity: 0; transform: translateX(-.6rem); } 20%, 100% { opacity: 1; transform: none; } }
@keyframes aih-row-4 { 0%, 20% { opacity: 0; } 24%, 100% { opacity: 1; } }

/* The card press when the pointer taps the first suggestion. */
.aih-card.is-1 { animation-name: aih-card-1-press; }
@keyframes aih-card-1-press { 0%, 26% { opacity: 0; transform: translateY(.7em); } 30%, 47% { opacity: 1; transform: none; border-color: color-mix(in srgb, var(--aih-tone) 45%, var(--cs-line)); } 49% { transform: scale(.97); border-color: var(--cp-accent); box-shadow: 0 0 0 .25em color-mix(in srgb, var(--cp-accent) 25%, transparent); } 52%, 96% { opacity: 1; transform: none; border-color: color-mix(in srgb, var(--aih-tone) 45%, var(--cs-line)); box-shadow: none; } 100% { opacity: 0; } }

@media (max-width: 991.98px) {
    .aih-stage { margin: 0 auto; }
}
@media (max-width: 575.98px) {
    .aih-stage { aspect-ratio: 10 / 13.6; max-width: 26rem; }
    .aih-phone { --w: 62cqw; right: 50%; transform: translateX(50%); }
    .aih-rail, .aih-pill-1, .aih-pill-2 { display: none; }
    .aih-glow { inset: 4% 10%; }
}
@media (prefers-reduced-motion: reduce) {
    .aih-stage *, .aih-stage *::after { animation: none !important; }
    .aih-skel, .aih-pointer, .aih-answer { display: none; }
    .aih-ask em { max-width: 0; }
    .aih-card, .aih-dots, .aih-note, .aih-rail, .aih-rail-row, .aih-rail-foot { opacity: 1; transform: none; }
}
