/* ============================================================================
   Keel · Persistent Amanda dock + "Living Ledger" motion language
   One bundle, auto-wired on every marketing page. Self-contained tokens so it
   renders identically regardless of the host page's :root.
   ========================================================================== */
.kl-dock,.kl-dock *{box-sizing:border-box}
.kl-dock{
  --kl-ink:#15121E;--kl-ink2:#2C2A38;--kl-muted:#525A6B;--kl-faint:#838B98;
  --kl-line:#E9E6DF;--kl-card:#fff;--kl-canvas:#FAF9F7;
  --kl-indigo:#4F46E5;--kl-indigo2:#6D5BF0;--kl-indigo-ink:#3A33B5;
  --kl-lav:#EEEBFB;--kl-lav2:#F5F3FE;--kl-gold:#FBBF4C;--kl-green:#1F9D57;
  --kl-ease:cubic-bezier(.165,.84,.44,1);
  --kl-shadow:0 1px 2px rgba(20,18,30,.04),0 8px 24px -10px rgba(20,18,30,.18);
  --kl-shadow-lg:0 2px 6px rgba(20,18,30,.06),0 30px 70px -24px rgba(40,33,140,.42);
  font-family:'Hanken Grotesk','Geist','Inter',system-ui,-apple-system,sans-serif;
  position:fixed;right:22px;bottom:22px;z-index:150;
}
/* hide the dock entirely while a lead/demo modal is open so it never covers the form */
body.kl-modal-open .kl-dock{opacity:0;pointer-events:none;visibility:hidden}
/* phone: Amanda lives as a reachable thumb-zone bar, always one tap away */
@media (max-width:560px){
  .kl-dock{left:12px;right:12px;bottom:12px}
  .kl-launch{position:absolute;left:0;right:0;bottom:0;width:100%;justify-content:flex-start;
    border-radius:18px;padding:9px 10px 9px 9px;box-shadow:0 12px 34px -10px rgba(40,33,140,.4)}
  .kl-launch .kl-ava{width:42px;height:42px}
  .kl-launch .kl-hook{max-width:none;flex:1;overflow:hidden}
  .kl-launch .kl-hooktx{padding:0 6px 0 12px;white-space:nowrap}
  .kl-launch .kl-hooktx b,.kl-launch .kl-hooktx span{overflow:hidden;text-overflow:ellipsis}
  .kl-launch .kl-x{display:none!important}
  .kl-launch::after{content:"→";flex:none;width:34px;height:34px;margin-left:6px;border-radius:50%;
    background:var(--kl-indigo);color:#fff;font-size:18px;font-weight:700;line-height:1;
    display:flex;align-items:center;justify-content:center}
}

/* ---- collapsed launcher --------------------------------------------------- */
.kl-launch{
  position:absolute;right:0;bottom:0;display:flex;align-items:center;gap:0;
  background:var(--kl-card);border:1px solid var(--kl-line);border-radius:999px;
  box-shadow:var(--kl-shadow);cursor:pointer;padding:6px;
  transition:transform .45s var(--kl-ease),box-shadow .45s var(--kl-ease),border-color .3s;
}
.kl-launch:hover{transform:translateY(-3px);box-shadow:var(--kl-shadow-lg);border-color:#D9D5CC}
.kl-launch:active{transform:translateY(-1px) scale(.99)}
.kl-ava{position:relative;width:46px;height:46px;border-radius:50%;flex:none;background:var(--kl-lav)}
.kl-ava img,.kl-ava video{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%}
.kl-dot{position:absolute;right:-1px;bottom:-1px;width:13px;height:13px;border-radius:50%;z-index:2;
  background:var(--kl-green);box-shadow:0 0 0 2.5px var(--kl-card);animation:klDot 2.4s var(--kl-ease) infinite}
@keyframes klDot{0%,100%{box-shadow:0 0 0 2.5px var(--kl-card),0 0 0 4px rgba(31,157,87,.0)}
  50%{box-shadow:0 0 0 2.5px var(--kl-card),0 0 0 7px rgba(31,157,87,.16)}}
/* speech-bubble hook that slides out of the launcher */
.kl-hook{max-width:0;overflow:hidden;white-space:nowrap;display:flex;align-items:center;
  transition:max-width .6s var(--kl-ease),padding .6s var(--kl-ease)}
.kl-hooktx{font-size:14px;font-weight:600;color:var(--kl-ink2);padding:0 4px 0 12px;
  display:flex;flex-direction:column;line-height:1.25}
.kl-hooktx small{font-size:11.5px;font-weight:600;color:var(--kl-indigo);letter-spacing:.02em}
.kl-launch.kl-open-hook .kl-hook{max-width:300px;padding-right:10px}
.kl-x{flex:none;width:22px;height:22px;border-radius:50%;border:none;background:transparent;
  color:var(--kl-faint);cursor:pointer;display:none;align-items:center;justify-content:center;margin-right:2px}
.kl-launch.kl-open-hook .kl-x{display:flex}
.kl-x:hover{background:var(--kl-canvas);color:var(--kl-ink)}
.kl-x svg{width:13px;height:13px;stroke:currentColor;stroke-width:2.4;fill:none;stroke-linecap:round}
.kl-launch.kl-nudge{animation:klNudge 1.2s var(--kl-ease)}
@keyframes klNudge{0%,100%{transform:none}30%{transform:translateY(-7px) rotate(-1.5deg)}60%{transform:translateY(-2px)}}

/* ---- expanded panel ------------------------------------------------------- */
.kl-panel{position:absolute;right:0;bottom:0;width:384px;max-width:calc(100vw - 28px);
  height:min(620px,78vh);background:var(--kl-card);border:1px solid var(--kl-line);
  border-radius:22px;box-shadow:var(--kl-shadow-lg);display:flex;flex-direction:column;
  overflow:hidden;transform:translateY(14px) scale(.98);transform-origin:bottom right;
  opacity:0;pointer-events:none;transition:transform .42s var(--kl-ease),opacity .3s var(--kl-ease)}
.kl-dock.kl-open .kl-panel{transform:none;opacity:1;pointer-events:auto}
.kl-dock.kl-open .kl-launch{transform:translateY(8px) scale(.9);opacity:0;pointer-events:none}
/* phone (≤768px): the chat is a TRUE TAKEOVER — it owns the whole screen.
   100dvh rides the URL-bar collapse; JS pins the height to visualViewport while
   the iOS keyboard is up. Solid background edge-to-edge, above demo bars.
   Desktop (>768px) keeps the docked panel unchanged. */
@media (max-width:768px){
  .kl-dock.kl-open{z-index:2147482000}
  .kl-panel{position:fixed;top:0;left:0;right:0;bottom:0;width:100%;max-width:100%;
    height:100vh;height:100dvh;border:none;border-radius:0;box-shadow:none;
    background:var(--kl-card);transform:translateY(18px)}
  .kl-dock.kl-open .kl-panel{transform:none}
  .kl-body{-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding-bottom:10px}
  .kl-foot{padding-bottom:calc(11px + env(safe-area-inset-bottom))}
}

.kl-head{display:flex;align-items:center;gap:11px;padding:15px 16px;
  background:linear-gradient(135deg,var(--kl-indigo),var(--kl-indigo2));color:#fff;flex:none}
.kl-head .kl-ava{width:40px;height:40px;box-shadow:0 0 0 2px rgba(255,255,255,.35)}
.kl-hname{font-size:16px;font-weight:800;letter-spacing:-.2px;line-height:1.1}
.kl-hstat{font-size:12px;font-weight:600;color:rgba(255,255,255,.82);display:flex;align-items:center;gap:6px;margin-top:2px}
.kl-hstat i{width:7px;height:7px;border-radius:50%;background:#5BE6A0;display:inline-block;box-shadow:0 0 0 0 rgba(91,230,160,.5);animation:klDot 2.4s infinite}
.kl-min{margin-left:auto;width:32px;height:32px;border-radius:9px;border:none;cursor:pointer;
  background:rgba(255,255,255,.16);color:#fff;display:flex;align-items:center;justify-content:center}
.kl-min:hover{background:rgba(255,255,255,.28)}
.kl-min svg{width:16px;height:16px;stroke:currentColor;stroke-width:2.4;fill:none;stroke-linecap:round;stroke-linejoin:round}

.kl-body{flex:1;overflow-y:auto;padding:18px 16px 8px;background:var(--kl-canvas);
  display:flex;flex-direction:column;gap:12px;scroll-behavior:smooth}
.kl-body::-webkit-scrollbar{width:7px}
.kl-body::-webkit-scrollbar-thumb{background:#DAD6CD;border-radius:8px}

.kl-msg{max-width:84%;font-size:14.5px;line-height:1.5;padding:11px 14px;border-radius:16px;
  font-weight:500;animation:klRise .42s var(--kl-ease) both}
@keyframes klRise{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:none}}
.kl-msg.a{align-self:flex-start;background:var(--kl-card);color:var(--kl-ink2);
  border:1px solid var(--kl-line);border-bottom-left-radius:5px}
.kl-msg.u{align-self:flex-end;background:var(--kl-indigo);color:#fff;border-bottom-right-radius:5px}
.kl-msg b{font-weight:700;color:inherit}
.kl-msg.a b{color:var(--kl-indigo-ink)}
/* live typing cursor — the Living Ledger signature */
.kl-cursor{display:inline-block;width:.5ch;height:1.05em;vertical-align:-.16em;margin-left:1px;
  background:var(--kl-indigo);border-radius:1px;animation:klBlink 1s steps(2,end) infinite}
@keyframes klBlink{50%{opacity:0}}
/* three-dot "thinking" */
.kl-typing{align-self:flex-start;display:flex;gap:4px;padding:13px 15px;background:var(--kl-card);
  border:1px solid var(--kl-line);border-radius:16px;border-bottom-left-radius:5px}
.kl-typing span{width:7px;height:7px;border-radius:50%;background:#B9BECB;animation:klTyp 1.1s infinite}
.kl-typing span:nth-child(2){animation-delay:.16s}.kl-typing span:nth-child(3){animation-delay:.32s}
@keyframes klTyp{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-5px);opacity:1}}

/* ledger card that streams work-lines (used in answers + page sections) */
.kl-ledger{align-self:flex-start;max-width:92%;background:var(--kl-card);border:1px solid var(--kl-line);
  border-radius:16px;border-bottom-left-radius:5px;padding:6px 6px;width:100%}
.kl-ll-row{display:flex;align-items:center;gap:9px;padding:8px 10px;font-size:13.5px;font-weight:600;
  color:var(--kl-ink2);border-radius:10px;opacity:0;transform:translateY(6px);
  transition:opacity .4s var(--kl-ease),transform .4s var(--kl-ease)}
.kl-ll-row.in{opacity:1;transform:none}
.kl-ll-row.done{background:var(--kl-lav2)}
.kl-ll-ic{width:20px;height:20px;border-radius:6px;flex:none;display:flex;align-items:center;justify-content:center;
  background:var(--kl-lav);color:var(--kl-indigo)}
.kl-ll-ic svg{width:13px;height:13px;stroke:currentColor;stroke-width:2.6;fill:none;stroke-linecap:round;stroke-linejoin:round}
.kl-ll-row.work .kl-ll-ic{background:#FFF3D6;color:#9A6B12}
.kl-ll-row.work .kl-ll-ic svg{animation:klSpin .9s linear infinite}
@keyframes klSpin{to{transform:rotate(360deg)}}

.kl-foot{flex:none;border-top:1px solid var(--kl-line);background:var(--kl-card);padding:11px 12px}
.kl-chips{display:flex;gap:7px;overflow-x:auto;padding-bottom:9px;scrollbar-width:none}
.kl-chips::-webkit-scrollbar{display:none}
.kl-chip{flex:none;font-family:inherit;font-size:12.5px;font-weight:600;color:var(--kl-indigo-ink);
  background:var(--kl-lav2);border:1px solid var(--kl-lav);border-radius:999px;padding:7px 13px;cursor:pointer;
  white-space:nowrap;transition:background .2s,transform .2s var(--kl-ease)}
.kl-chip:hover{background:var(--kl-lav);transform:translateY(-1px)}
.kl-chip.kl-fresh{animation:klChipIn .34s var(--kl-ease) both}
@keyframes klChipIn{from{opacity:0;transform:translateY(5px) scale(.96)}to{opacity:1;transform:none}}
/* the demo CTA: filled, iconed, unmistakably different from the prompt chips */
.kl-chip.kl-cta{display:inline-flex;align-items:center;gap:6px;color:#fff;font-weight:700;
  background:var(--kl-indigo);border-color:var(--kl-indigo);
  box-shadow:0 4px 12px -5px rgba(79,70,229,.6)}
.kl-chip.kl-cta:hover{background:var(--kl-indigo-ink);border-color:var(--kl-indigo-ink);transform:translateY(-1px)}
.kl-chip.kl-cta svg{width:14px;height:14px;stroke:currentColor;stroke-width:2.2;fill:none;stroke-linecap:round;stroke-linejoin:round}
.kl-chiphint{flex:none;align-self:center;font-size:12px;font-weight:600;color:var(--kl-faint);
  padding:7px 4px;white-space:nowrap}
/* Amanda's "go there" link after an answer — feels like she's walking you over */
.kl-go{align-self:flex-start;display:inline-flex;align-items:center;gap:8px;margin-top:-2px;
  font-family:inherit;font-size:13.5px;font-weight:700;color:#fff;text-decoration:none;
  background:var(--kl-indigo);border-radius:13px;padding:10px 14px;cursor:pointer;
  box-shadow:0 6px 16px -7px rgba(79,70,229,.7);animation:klRise .42s var(--kl-ease) both;
  transition:background .2s,transform .2s var(--kl-ease)}
.kl-go:hover{background:var(--kl-indigo-ink);transform:translateY(-1px)}
.kl-go svg{width:16px;height:16px;stroke:currentColor;stroke-width:2.3;fill:none;stroke-linecap:round;stroke-linejoin:round;
  transition:transform .2s var(--kl-ease)}
.kl-go:hover svg{transform:translateX(3px)}
.kl-inrow{display:flex;align-items:center;gap:8px;background:var(--kl-canvas);border:1px solid var(--kl-line);
  border-radius:13px;padding:5px 5px 5px 14px}
.kl-inrow:focus-within{border-color:var(--kl-indigo);box-shadow:0 0 0 3px rgba(79,70,229,.12)}
.kl-in{flex:1;border:none;background:transparent;outline:none;font-family:inherit;font-size:14.5px;
  font-weight:500;color:var(--kl-ink);padding:7px 0}
.kl-in::placeholder{color:var(--kl-faint)}
.kl-send{flex:none;width:38px;height:38px;border-radius:10px;border:none;cursor:pointer;
  background:var(--kl-indigo);color:#fff;display:flex;align-items:center;justify-content:center;
  transition:background .2s,transform .2s var(--kl-ease)}
.kl-send:hover{background:var(--kl-indigo-ink);transform:translateY(-1px)}
.kl-send svg{width:17px;height:17px;stroke:currentColor;stroke-width:2.3;fill:none;stroke-linecap:round;stroke-linejoin:round}
.kl-disc{text-align:center;font-size:10.5px;color:var(--kl-faint);font-weight:600;margin-top:9px;letter-spacing:.01em}

/* ============================================================================
   LIVING-LEDGER page motion utilities (applied to page content in Wave 2)
   ========================================================================== */
.kl-anim .kl-reveal{opacity:0;transform:translateY(20px);
  transition:opacity .7s var(--kl-ease),transform .7s var(--kl-ease)}
.kl-anim .kl-reveal.in{opacity:1;transform:none}
/* numbers that assemble token-by-token instead of rolling up from zero */
.kl-num{font-variant-numeric:tabular-nums}
.kl-num .kl-tok{display:inline-block;opacity:0;transform:translateY(.32em);filter:blur(3px);
  transition:opacity .26s var(--kl-ease),transform .26s var(--kl-ease),filter .26s var(--kl-ease)}
.kl-num .kl-tok.in{opacity:1;transform:none;filter:none}

@media (prefers-reduced-motion:reduce){
  .kl-dock *,.kl-anim .kl-reveal,.kl-num .kl-tok{animation:none!important;transition:none!important;
    opacity:1!important;transform:none!important;filter:none!important}
  .kl-cursor{display:none}
}

/* ---- Voice: Amanda takes a live call (merged into the persistent dock) ---- */
.kl-call{background:rgba(124,108,240,.14);color:#6D5BF0;border:none;border-radius:50%;width:30px;height:30px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;flex:none;margin-left:auto;transition:background .15s}
.kl-call:hover{background:rgba(124,108,240,.24)}
.kl-call svg{width:16px;height:16px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
.kl-head .kl-min{margin-left:8px}
.kl-talk{display:inline-flex;align-items:center;gap:6px;color:#6D5BF0!important;border-color:rgba(124,108,240,.4)!important}
.kl-talk svg{width:13px;height:13px;stroke:currentColor;stroke-width:2.2;fill:none;stroke-linecap:round;stroke-linejoin:round}
.vcall{position:fixed;inset:0;z-index:2147483000;display:none;align-items:center;justify-content:center;padding:18px;background:rgba(8,9,16,.62);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.vcall.show{display:flex;animation:vcFade .28s ease}
@keyframes vcFade{from{opacity:0}to{opacity:1}}
.vc-card{position:relative;width:min(390px,100%);background:linear-gradient(180deg,#1B1E30,#0F1220);border:1px solid rgba(255,255,255,.09);border-radius:26px;padding:32px 26px 22px;text-align:center;color:#fff;box-shadow:0 40px 90px -24px rgba(0,0,0,.7);font-family:inherit}
.vc-top{display:inline-flex;align-items:center;gap:7px;font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#9AA0B6}
.vc-top i{width:7px;height:7px;border-radius:50%;background:#34D399;animation:vcLive 1.8s infinite}
@keyframes vcLive{0%{box-shadow:0 0 0 0 rgba(52,211,153,.5)}70%{box-shadow:0 0 0 8px rgba(52,211,153,0)}100%{box-shadow:0 0 0 0 rgba(52,211,153,0)}}
.vc-avwrap{position:relative;width:130px;height:130px;margin:22px auto 0}
.vc-halo{position:absolute;inset:-8px;border-radius:50%;background:radial-gradient(circle,rgba(124,108,240,.55),transparent 66%);transform:scale(1);transition:transform .12s ease-out;filter:blur(3px)}
.vc-ring{position:absolute;inset:0;border-radius:50%;border:2px solid rgba(124,108,240,.45);opacity:0}
.vcall.show .vc-ring{animation:vcRing 2.4s ease-out infinite}
.vcall.show .vc-ring.r2{animation-delay:1.2s}
@keyframes vcRing{0%{transform:scale(1);opacity:.7}100%{transform:scale(1.5);opacity:0}}
.vc-av{position:absolute;inset:6px;border-radius:50%;overflow:hidden;border:2px solid rgba(255,255,255,.16);background:#0F1320}
.vc-av video,.vc-av img{width:100%;height:100%;object-fit:cover;display:block}
.vc-name{font-size:21px;font-weight:650;letter-spacing:-.3px;margin-top:18px}
.vc-time{font-size:12.5px;color:#9AA0B6;margin-top:3px;font-variant-numeric:tabular-nums}
.vc-cap{min-height:74px;display:flex;align-items:center;justify-content:center;font-size:15px;line-height:1.5;color:#EDEFF6;max-width:316px;margin:15px auto 0;transition:opacity .2s}
.vc-wave{display:flex;align-items:flex-end;justify-content:center;gap:3px;height:22px;margin-top:6px}
.vc-wave i{width:3px;height:5px;border-radius:3px;background:#7C6CF0;opacity:.45}
.vcall.speaking .vc-wave i{animation:vcBar .9s ease-in-out infinite}
.vc-wave i:nth-child(2){animation-delay:.1s}.vc-wave i:nth-child(3){animation-delay:.2s}.vc-wave i:nth-child(4){animation-delay:.32s}.vc-wave i:nth-child(5){animation-delay:.16s}.vc-wave i:nth-child(6){animation-delay:.26s}.vc-wave i:nth-child(7){animation-delay:.06s}
@keyframes vcBar{0%,100%{height:5px;opacity:.45}50%{height:20px;opacity:1}}
.vc-controls{display:flex;align-items:flex-start;justify-content:center;gap:34px;margin-top:22px}
.vc-ctl{display:flex;flex-direction:column;align-items:center;gap:7px}
.vc-ctl button{width:54px;height:54px;border-radius:50%;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-family:inherit;transition:transform .14s}
.vc-ctl button:active{transform:scale(.93)}
.vc-ctl svg{width:22px;height:22px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
.vc-mute button{background:rgba(255,255,255,.1);color:#fff}.vc-mute.on button{background:#fff;color:#15182A}
.vc-end button{background:#EF4444;color:#fff;box-shadow:0 10px 22px -8px rgba(239,68,68,.65)}
.vc-ctl span{font-size:11px;color:#9AA0B6;font-weight:600}
.vc-foot{font-size:10.5px;color:#6B7088;margin-top:15px;line-height:1.4}
.vc-cta{display:none;margin:18px auto 0;align-items:center;justify-content:center;gap:8px;background:#6D5BF0;color:#fff;border:none;border-radius:14px;padding:14px 22px;font-family:inherit;font-size:15px;font-weight:650;cursor:pointer;box-shadow:0 16px 34px -10px rgba(109,91,240,.72);transition:transform .15s}
.vc-cta:hover{transform:translateY(-2px)}
.vc-cta svg{width:16px;height:16px;stroke:#fff;stroke-width:2.4;fill:none;stroke-linecap:round;stroke-linejoin:round}
.vcall.ended .vc-cta{display:inline-flex;animation:vcFade .4s ease}
.vcall.ended .vc-wave{opacity:.25}
.vcall.ended .vc-controls{margin-top:18px}
.vcall.ended .vc-mute{opacity:.5}
