/* A quiet, optional invitation. It never takes keyboard focus or plays audio. */
.kai-followup { position: fixed; right: 24px; bottom: 94px; z-index: 70; width: min(356px, calc(100vw - 28px)); max-height: calc(100dvh - 130px); overflow: auto; padding: 20px; border: 1px solid #d9e1ea; border-radius: 20px; background: #fff; color: #102b46; box-shadow: 0 12px 45px #102b4630; }
.kai-followup[hidden] { display: none; }
.kai-followup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.kai-followup-head strong { font-size: 13px; }
.kai-followup-head small { font-size: 11px; color: #475569; }
.kai-followup-head button { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; border: 1px solid #d9e1ea; background: #f7f9fc; color: #102b46; font: inherit; font-size: 22px; cursor: pointer; }
.kai-followup h2 { font-size: 20px; line-height: 1.3; letter-spacing: -.025em; margin: 0 0 10px; }
.kai-followup p { font-size: 13px; line-height: 1.6; margin: 0 0 12px; color: #475569; }
.kai-followup .kai-offer { color: #102b46; font-size: 15px; font-weight: 750; margin-bottom: 5px; }
.kai-followup .kai-offer-note { font-size: 11px; line-height: 1.5; }
.kai-followup .button { width: 100%; min-height: 46px; font-size: 13px; margin: 3px 0 5px; }
.kai-followup-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kai-followup-actions a, .kai-followup-actions button { font: inherit; font-size: 12px; font-weight: 650; color: #102b46; background: none; border: 0; padding: 6px 0; min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.kai-followup [data-kai-status]:empty { display:none; }
@media (max-width: 600px) { .kai-followup { right: 14px; bottom: 86px; padding: 16px; max-height: 58dvh; } .kai-followup h2 { font-size: 18px; } }
@media (prefers-reduced-motion: no-preference) { .kai-followup:not([hidden]) { animation: kai-reveal .18s ease-out; } @keyframes kai-reveal { from { opacity:0; transform:translateY(7px); } to { opacity:1; transform:translateY(0); } } }

.kai-identity { display:flex; align-items:center; gap:10px; }
.kai-avatar { display:grid; place-items:center; width:42px; height:42px; border-radius:13px; color:#ff9b53; background:#102b46; flex-shrink:0; }
.kai-avatar svg { width:26px; height:26px; }
.kai-identity strong, .kai-identity small { display:block; }
.kai-identity strong { font-size:15px; }
.kai-identity small { margin-top:2px; }

/* Kai greets in a reserved hero slot, then becomes the single chat launcher. */
.kai-welcome-slot { min-height: 104px; margin-top: 10px; }
.kai-launcher { display:flex; align-items:center; gap:8px; width:310px; max-width:100%; height:96px; padding:4px 14px 4px 2px; background:#fff; border:1px solid #d9e1ea; border-radius:18px; color:#102b46; font:inherit; text-align:left; cursor:pointer; box-shadow:0 6px 22px #102b4610; transform-origin:top left; }
.kai-launcher[hidden] { display:none; }
.kai-launcher:focus-visible { outline:3px solid #ff9b53; outline-offset:4px; }
.kai-character { display:block; position:relative; width:86px; height:86px; flex-shrink:0; }
.kai-character img { display:block; width:100%; height:100%; object-fit:contain; }
.kai-launcher-copy { display:block; }
.kai-launcher-copy strong { display:block; font-size:16px; line-height:1.3; }
.kai-launcher-copy > span { display:block; font-size:12px; line-height:1.5; margin-top:3px; }
.kai-launcher-copy small { display:block; margin-top:4px; color:#475569; font-size:10px; }
.kai-launcher-copy b { color:#b74700; }
.kai-launcher.is-docked { position:fixed; z-index:72; bottom:20px; right:24px; width:200px; height:74px; border-radius:18px; padding:3px 10px 3px 0; border-bottom:3px solid #ff9b53; box-shadow:0 5px 24px #102b4624; }
.kai-launcher.is-docked .kai-character { width:70px; height:70px; }
.kai-launcher.is-docked .kai-launcher-copy strong { font-size:14px; }
.kai-launcher.is-docked .kai-launcher-copy > span { font-size:11px; }
.kai-launcher.is-docked .kai-launcher-copy small { display:none; }
.kai-working { display:none; position:absolute; inset:0; background-image:url('/assets/kai-working-sprite.png'); background-size:200% 200%; }
.kai-launcher.is-working .kai-character img { visibility:hidden; }
.kai-launcher.is-working .kai-working { display:block; animation:kai-notes 1.4s step-end infinite; }
/* A short decorative clipboard motion beside, not over, the native close button. */
.kai-launcher.is-chat-open { right:98px; bottom:18px; width:78px; height:78px; background:transparent; border:0; box-shadow:none; padding:0; pointer-events:none; }
.kai-launcher.is-chat-open .kai-launcher-copy { display:none; }
.kai-avatar { width:54px; height:54px; background:#eaf0f6; border:1px solid #ff9b53; overflow:hidden; }
.kai-avatar img { width:100%; height:100%; object-fit:contain; }
@keyframes kai-notes { 0%,100% {background-position:0 0;} 25% {background-position:100% 0;} 50% {background-position:0 100%;} 75% {background-position:100% 100%;} }
@keyframes kai-hello { 0%,100% {transform:rotate(0);} 35% {transform:rotate(-4deg);} 70% {transform:rotate(3deg);} }
@media (prefers-reduced-motion:no-preference) { .kai-launcher:not(.is-docked) .kai-character { animation:kai-hello .8s ease-in-out 2; transform-origin:bottom center; } }
@media (max-width:600px) {
  .kai-launcher.is-docked { width:142px; height:60px; right:12px; bottom:16px; gap:3px; padding-right:6px; }
  .kai-launcher.is-docked .kai-character { width:53px; height:53px; }
  .kai-launcher.is-docked .kai-launcher-copy strong { font-size:12px; }
  .kai-launcher.is-docked .kai-launcher-copy > span { font-size:10px; max-width:73px; }
  .kai-launcher.is-chat-open { width:66px; right:82px; background:transparent; }
  .kai-followup { bottom:92px; }
}
@media (prefers-reduced-motion:reduce) { .kai-working, .kai-character { animation:none!important; } }
/* In the mobile hero's ordered grid, greet after the intro and before Riley. */
@media (max-width:780px) { .kai-welcome-slot { order:2; } }
