/* splash-assistant
   Scoped under .spa- / [data-spa-root]. Animate only transform and opacity.
   No libraries. Design sizes: 72px desktop, 88px mobile, 84px at ≤375. Bottom inset 24px + safe-area. */

[data-spa-root]{
  --spa-size:72px;
  --spa-aspect:337 / 256;
  --spa-bar-h:0px;
  --spa-bar-gap:24px;
  --spa-bar-lift:0px;
  --spa-nav-h:0px;
  --spa-avoid-x:0px;
  --spa-avoid-y:0px;
  --spa-navy:#002D62;
  --spa-focus:#3FD0C9;
  --spa-lime:#A8FF00;
  --spa-ink:#001F40;
  --spa-chip-scale:1;
  position:fixed;
  right:calc(16px + env(safe-area-inset-right, 0px));
  /* Same reference as .mobbar { bottom:0 }: layout-viewport bottom + safe-area.
     Never rewritten from scroll JS, so Splash and the bar move together
     when iOS shows or hides the toolbar. */
  bottom:calc(var(--spa-bar-h) + env(safe-area-inset-bottom, 0px) + var(--spa-bar-gap));
  z-index:8900;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:12px;
  width:auto;
  margin:0;
  padding:0;
  pointer-events:none;
  opacity:0;
  transform:translate3d(var(--spa-avoid-x), var(--spa-avoid-y), 0);
  transition:opacity .28s ease;
}
@media (max-width:768px){
  /* 64px = 8+48+8 bar padding/content, excluding safe-area (added in bottom). */
  [data-spa-root]{ --spa-size:88px; --spa-bar-h:64px; --spa-bar-gap:12px; }
}
@media (max-width:480px){
  [data-spa-root]{ --spa-chip-scale:calc(64 / 88); }
}
@media (max-width:375px){
  [data-spa-root]{ --spa-size:84px; --spa-chip-scale:calc(64 / 84); }
}

/* While the mobile trust-chip row is in view, visually rest at 64px by scaling
   the avatar only (layout size stays 88/84, so growing after scroll is CLS-free). */
[data-spa-root] .spa-btn{
  transform-origin:bottom right;
  transition:transform .45s cubic-bezier(.22, 1, .36, 1);
}
[data-spa-root][data-spa-spot="bl"] .spa-btn,
[data-spa-root][data-spa-spot="ml"] .spa-btn{
  transform-origin:bottom left;
}
[data-spa-root][data-spa-spot="tl"] .spa-btn{ transform-origin:top left; }
[data-spa-root][data-spa-spot="tr"] .spa-btn{ transform-origin:top right; }
[data-spa-root].is-chip-rest .spa-btn{
  transform:scale(var(--spa-chip-scale, 0.72727));
}
/* First-screen hold: not enough room under the chips (<48px). Hidden, not focusable. */
[data-spa-root].is-chip-hidden{
  opacity:0 !important;
  visibility:hidden;
  pointer-events:none !important;
}
[data-spa-root].is-chip-hidden .spa-btn,
[data-spa-root].is-chip-hidden .spa-bubble,
[data-spa-root].is-chip-hidden .spa-tab{
  pointer-events:none !important;
}
[data-spa-root].spa-reduced .spa-btn,
[data-spa-root].is-dragging .spa-btn{
  transition:none;
}
@media (prefers-reduced-motion:reduce){
  [data-spa-root] .spa-btn{ transition:none; }
}
[data-spa-root].is-in,
[data-spa-root].is-entering,
[data-spa-root].is-settling{
  opacity:1;
}
[data-spa-root].is-chat-open,
[data-spa-root].is-menu-open{
  opacity:0;
  pointer-events:none;
}
[data-spa-root].is-paused,
[data-spa-root].is-paused *{
  animation-play-state:paused !important;
}

/* Fixed box — reserved from the first paint of the widget; no CLS. */
[data-spa-root] .spa-enter,
[data-spa-root] .spa-settle,
[data-spa-root] .spa-idle,
[data-spa-root] .spa-swim,
[data-spa-root] .spa-act,
[data-spa-root] .spa-glance,
[data-spa-root] .spa-art,
[data-spa-root] .spa-shadow,
[data-spa-root] .spa-drops,
[data-spa-root] .spa-dot{
  pointer-events:none;
}
[data-spa-root].is-roaming .spa-btn,
[data-spa-root].is-snapping .spa-btn,
[data-spa-root].is-entering .spa-btn{
  pointer-events:none;
}
/* Sticky CTAs stay above Splash if a frame would overlap, so taps reach Call / Free Quote. */
@media (max-width:768px){
  .mobbar{ z-index:9000 !important; }
}
[data-spa-root] .spa-btn{
  pointer-events:auto;
  position:relative;
  box-sizing:content-box;
  width:var(--spa-size);
  height:calc(var(--spa-size) * 337 / 256);
  min-width:var(--spa-size);
  min-height:calc(var(--spa-size) * 337 / 256);
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  cursor:pointer;
  border-radius:18px;
  -webkit-tap-highlight-color:transparent;
  appearance:none;
  -webkit-appearance:none;
  font:inherit;
  color:inherit;
  overflow:visible;
}
[data-spa-root] .spa-btn:focus{ outline:none; }
[data-spa-root] .spa-btn:focus-visible{
  outline:3px solid var(--spa-focus);
  outline-offset:3px;
}

[data-spa-root] .spa-enter,
[data-spa-root] .spa-settle,
[data-spa-root] .spa-idle,
[data-spa-root] .spa-glance{
  display:block;
  width:100%;
  height:100%;
  position:relative;
  transform-origin:50% 80%;
}
[data-spa-root] .spa-glance{ position:relative; }

[data-spa-root] .spa-art{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center bottom;
  pointer-events:none;
  user-select:none;
  -webkit-user-drag:none;
  display:block;
}
[data-spa-root] .spa-art-blink{ opacity:0; }
[data-spa-root].is-blink .spa-art-blink{ opacity:1; }

/* Online marker — 10px lime dot, 2px navy ring, bottom-right. No text. */
[data-spa-root] .spa-dot{
  position:absolute;
  right:2px;
  bottom:6px;
  width:10px;
  height:10px;
  box-sizing:border-box;
  border-radius:50%;
  background:var(--spa-lime);
  box-shadow:0 0 0 2px #002D62;
  pointer-events:none;
  z-index:2;
  opacity:1;
  transition:opacity 200ms ease;
}
/* Fade the online dot out during BIG moves (~150ms), then back in on settle (~200ms).
   Also hide it during roam hops / landing and drag, where it would sit detached. */
[data-spa-root].is-idle-spin .spa-dot,
[data-spa-root].is-idle-cartwheel .spa-dot,
[data-spa-root].is-idle-dive .spa-dot,
[data-spa-root].is-idle-capflip .spa-dot,
[data-spa-root].is-idle-doublehop .spa-dot,
[data-spa-root].is-idle-ohjump .spa-dot,
[data-spa-root].is-idle-pop .spa-dot,
[data-spa-root].is-idle-splash .spa-dot,
[data-spa-root].is-roaming .spa-dot,
[data-spa-root].is-landing .spa-dot,
[data-spa-root].is-dragging .spa-dot{
  opacity:0;
  transition-duration:150ms;
}

/* Soft ground shadow: static blur, only transform+opacity are animated. */
[data-spa-root] .spa-shadow{
  position:absolute;
  left:50%;
  bottom:0;
  width:70%;
  height:12px;
  background:#002D62;
  border-radius:50%;
  filter:blur(5px);
  opacity:0;
  pointer-events:none;
  z-index:0;
  transform:translateX(-50%) scale(.92);
}
[data-spa-root] .spa-enter,
[data-spa-root] .spa-settle,
[data-spa-root] .spa-idle,
[data-spa-root] .spa-glance{
  z-index:1;
}
[data-spa-root].is-in .spa-shadow{
  animation:spa-shadow 3.2s ease-in-out infinite;
}
@keyframes spa-shadow{
  /* Synced to spa-bob: character is highest at 0%/100%, lowest at 50%. */
  0%,100%{ transform:translateX(-50%) scale(.78); opacity:.12; }
  50%{ transform:translateX(-50%) scale(1); opacity:.20; }
}

/* Entrance: off the right edge, gentle curve, one small dip, 1.1s.
   cubic-bezier(.22,1,.36,1). Body tilt -8deg → 0. */
@keyframes spa-enter{
  0%{ transform:translate3d(180px,28px,0) rotate(-14deg) scale(.96); }
  42%{ transform:translate3d(48px,-26px,0) rotate(-6deg) scale(1); }
  72%{ transform:translate3d(10px,6px,0) rotate(-2deg); }
  100%{ transform:translate3d(0,0,0) rotate(0deg); }
}
@keyframes spa-enter-left{
  0%{ transform:translate3d(-180px,28px,0) rotate(14deg) scale(.96); }
  42%{ transform:translate3d(-48px,-26px,0) rotate(6deg) scale(1); }
  72%{ transform:translate3d(-10px,6px,0) rotate(2deg); }
  100%{ transform:translate3d(0,0,0) rotate(0deg); }
}
[data-spa-root][data-spa-spot="bl"].is-entering .spa-enter,
[data-spa-root][data-spa-spot="tl"].is-entering .spa-enter{
  animation-name:spa-enter-left;
}
@keyframes spa-settle{
  0%{ transform:scale(1.06); }
  55%{ transform:scale(0.97); }
  100%{ transform:scale(1); }
}
@keyframes spa-bob{
  0%,100%{ transform:translate3d(0,-4px,0); }
  50%{ transform:translate3d(0,4px,0); }
}
/* Bottom docks: bob up only so the sprite never eats the 12px bar gap. */
@keyframes spa-bob-up{
  0%,100%{ transform:translate3d(0,-8px,0); }
  50%{ transform:translate3d(0,0,0); }
}
@keyframes spa-glance{
  0%{ transform:rotate(0deg); }
  35%{ transform:rotate(6deg); }
  65%{ transform:rotate(6deg); }
  100%{ transform:rotate(0deg); }
}
@keyframes spa-fade{
  from{ opacity:0; }
  to{ opacity:1; }
}

[data-spa-root].is-entering .spa-enter{
  animation:spa-enter .95s cubic-bezier(.22,1,.36,1) both;
}
[data-spa-root].is-settling .spa-settle{
  animation:spa-settle 280ms ease both;
}
/* Landing wave after the swoop (pairs with a one-shot blink in JS). */
@keyframes spa-enter-wave{
  0%{ transform:rotate(0deg) scale(1); }
  28%{ transform:rotate(-12deg) scale(0.86); }
  55%{ transform:rotate(10deg) scale(0.86); }
  78%{ transform:rotate(-5deg) scale(0.92); }
  100%{ transform:rotate(0deg) scale(1); }
}
[data-spa-root].is-enter-wave .spa-act{
  animation:spa-enter-wave .28s ease-in-out both;
  transform-origin:50% 50%;
}
[data-spa-root].is-in .spa-idle{
  animation:spa-bob 3.2s ease-in-out infinite;
}
[data-spa-root][data-spa-spot="bl"].is-in .spa-idle,
[data-spa-root][data-spa-spot="br"].is-in .spa-idle{
  animation-name:spa-bob-up;
}
[data-spa-root].is-glancing .spa-glance{
  animation:spa-glance .7s ease both;
}

/* Reduced motion: skip flight and bob/tilt; fade in already settled. Blink is OK. */
@media (prefers-reduced-motion:reduce){
  [data-spa-root].is-entering .spa-enter,
  [data-spa-root].is-settling .spa-settle,
  [data-spa-root].is-in .spa-idle,
  [data-spa-root].is-in .spa-shadow,
  [data-spa-root].is-glancing .spa-glance,
  [data-spa-root].is-enter-wave .spa-act{ animation:none !important; }
  [data-spa-root].is-in,
  [data-spa-root].is-entering,
  [data-spa-root].is-settling{
    animation:spa-fade .3s ease both;
  }
}
[data-spa-root].spa-reduced.is-entering .spa-enter,
[data-spa-root].spa-reduced.is-settling .spa-settle,
[data-spa-root].spa-reduced.is-in .spa-idle,
[data-spa-root].spa-reduced.is-in .spa-shadow,
[data-spa-root].spa-reduced.is-glancing .spa-glance,
[data-spa-root].spa-reduced.is-enter-wave .spa-act{ animation:none !important; }
[data-spa-root].spa-reduced.is-in,
[data-spa-root].spa-reduced.is-entering,
[data-spa-root].spa-reduced.is-settling{
  animation:spa-fade .3s ease both;
}

/* Speech bubble — navy #002D62 on white, ≤220px, max two lines, 4.5:1+ contrast. */
[data-spa-root] .spa-bubble{
  pointer-events:auto;
  position:relative;
  box-sizing:border-box;
  width:max-content;
  max-width:220px;
  margin:0;
  padding:10px 36px 10px 12px;
  background:#fff;
  color:var(--spa-navy);
  border-radius:14px 14px 4px 14px;
  box-shadow:0 0 0 1px rgba(0,45,98,.08);
  filter:drop-shadow(0 8px 24px rgba(0,31,64,.18));
  opacity:0;
  transform:translate3d(0,6px,0);
  transition:opacity .25s ease,transform .25s ease;
}
/* 10px tail on the bottom-right, pointing at Splash. */
[data-spa-root] .spa-bubble::after{
  content:"";
  position:absolute;
  right:16px;
  bottom:-10px;
  width:0;
  height:0;
  border-left:7px solid transparent;
  border-right:7px solid transparent;
  border-top:10px solid #fff;
  pointer-events:none;
  z-index:1;
}
[data-spa-root] .spa-bubble.is-on{
  opacity:1;
  transform:translate3d(0,0,0);
}
[data-spa-root] .spa-bubble[hidden]{ display:none !important; }
[data-spa-root] .spa-bubble-msg{
  display:block;
  width:100%;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  color:var(--spa-navy);
  font:600 14px/1.35 Nunito,system-ui,-apple-system,sans-serif;
  text-align:left;
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
}
[data-spa-root] .spa-bubble-msg:focus{ outline:none; }
[data-spa-root] .spa-bubble-msg:focus-visible{
  outline:2px solid var(--spa-focus);
  outline-offset:2px;
  border-radius:6px;
}
[data-spa-root] .spa-bubble-x{
  position:absolute;
  top:0;
  right:0;
  width:36px;
  height:36px;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  color:var(--spa-navy);
  font:600 22px/1 system-ui,-apple-system,sans-serif;
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  border-radius:8px;
}
[data-spa-root] .spa-bubble-x:focus{ outline:none; }
[data-spa-root] .spa-bubble-x:focus-visible{
  outline:2px solid var(--spa-focus);
  outline-offset:-2px;
}

/* Preview-only banner. Not part of the live pack. */
.spa-preview-banner{
  position:fixed;
  top:68px;
  left:0;
  right:0;
  z-index:199;
  background:#1b1b1b;
  color:#fff;
  font:600 12px/1.35 system-ui,Arial,sans-serif;
  letter-spacing:.02em;
  padding:6px 16px;
  text-align:center;
  pointer-events:none;
}

/* When the bubble would cover a hero/sticky CTA, dock it to the left of Splash. */
[data-spa-root].is-bubble-side{
  flex-direction:row;
  align-items:flex-end;
}
[data-spa-root].is-bubble-side .spa-bubble{
  border-radius:14px 4px 14px 14px;
}
/* Side-docked (e.g. 375): tail on the right edge, pointing toward Splash. */
[data-spa-root].is-bubble-side .spa-bubble::after{
  right:-10px;
  bottom:16px;
  border-left:10px solid #fff;
  border-right:0;
  border-top:7px solid transparent;
  border-bottom:7px solid transparent;
}

/* Reduced motion: ground shadow stays put (no bob sync). */
@media (prefers-reduced-motion:reduce){
  [data-spa-root].is-in .spa-shadow{
    opacity:.16;
    transform:translateX(-50%) scale(.92);
  }
}
[data-spa-root].spa-reduced.is-in .spa-shadow{
  opacity:.16;
  transform:translateX(-50%) scale(.92);
}

/* Temporarily hide the bubble while it would cover a compact control. */
[data-spa-root].is-bubble-hidden .spa-bubble{
  opacity:0;
  pointer-events:none;
}

/* ── v5 motion: spots, idle acts, droplets, drag, tuck. Transform+opacity only. */

[data-spa-root]{
  --spa-inset-r:calc(16px + env(safe-area-inset-right, 0px));
  --spa-inset-l:calc(16px + env(safe-area-inset-left, 0px));
  --spa-inset-b:calc(var(--spa-bar-h) + env(safe-area-inset-bottom, 0px) + var(--spa-bar-gap));
  --spa-inset-t:calc(var(--spa-nav-h, 0px) + env(safe-area-inset-top, 0px) + 8px);
  --spa-nudge-x:0px;
  --spa-nudge-y:0px;
  --spa-aqua:#3FD0C9;
  right:var(--spa-inset-r);
  left:auto;
  bottom:var(--spa-inset-b);
  top:auto;
  transform:translate3d(calc(var(--spa-avoid-x) + var(--spa-nudge-x)), calc(var(--spa-avoid-y) + var(--spa-nudge-y)), 0);
}
/* Smooth avoid/nudge only after a scroll gesture ends, never during the scroll. */
[data-spa-root].is-avoid-settle{
  transition:transform .28s ease,opacity .28s ease;
}
[data-spa-root][data-spa-spot="bl"],
[data-spa-root][data-spa-spot="ml"],
[data-spa-root][data-spa-spot="tl"]{
  left:var(--spa-inset-l);
  right:auto;
  align-items:flex-start;
}
[data-spa-root]{
  --spa-half-h:47px;
}
[data-spa-root][data-spa-spot="mr"],
[data-spa-root][data-spa-spot="ml"]{
  top:calc(50vh - var(--spa-half-h));
  bottom:auto;
  transform:translate3d(var(--spa-avoid-x), var(--spa-avoid-y), 0);
}
[data-spa-root][data-spa-spot="br"],
[data-spa-root][data-spa-spot="bl"]{
  top:auto;
  bottom:var(--spa-inset-b);
}
[data-spa-root][data-spa-spot="br"],
[data-spa-root][data-spa-spot="tr"]{
  left:auto;
  right:var(--spa-inset-r);
  align-items:flex-end;
}
[data-spa-root][data-spa-spot="tl"],
[data-spa-root][data-spa-spot="tr"]{
  top:var(--spa-inset-t);
  bottom:auto;
  flex-direction:column-reverse;
}
/* Bubble hangs below Splash at the top docks; tail points up at him. */
[data-spa-root][data-spa-spot="tl"] .spa-bubble,
[data-spa-root][data-spa-spot="tr"] .spa-bubble{
  border-radius:4px 14px 14px 14px;
}
[data-spa-root][data-spa-spot="tr"] .spa-bubble{
  border-radius:14px 4px 14px 14px;
}
[data-spa-root][data-spa-spot="tl"] .spa-bubble::after,
[data-spa-root][data-spa-spot="tr"] .spa-bubble::after{
  bottom:auto;
  top:-10px;
  border-top:0;
  border-bottom:10px solid #fff;
  border-left:7px solid transparent;
  border-right:7px solid transparent;
}
[data-spa-root][data-spa-spot="tl"] .spa-bubble::after{ left:16px; right:auto; }
[data-spa-root][data-spa-spot="tr"] .spa-bubble::after{ right:16px; left:auto; }
[data-spa-root][data-spa-spot="tl"].is-bubble-side,
[data-spa-root][data-spa-spot="tr"].is-bubble-side{
  flex-direction:row;
}
[data-spa-root][data-spa-spot="tl"].is-bubble-side{
  flex-direction:row;
}
[data-spa-root][data-spa-spot="tr"].is-bubble-side{
  flex-direction:row-reverse;
}

/* Mid spots: keep the avatar box at 50vh even if the bubble is open, by
   positioning the bubble out of flow (same visual gap as the flex layout). */
[data-spa-root][data-spa-spot="mr"] .spa-bubble,
[data-spa-root][data-spa-spot="ml"] .spa-bubble{
  position:absolute;
  bottom:calc(100% + 12px);
  top:auto;
}
[data-spa-root][data-spa-spot="mr"] .spa-bubble{ right:0; left:auto; }
[data-spa-root][data-spa-spot="ml"] .spa-bubble{ left:0; right:auto; }
[data-spa-root][data-spa-spot="ml"].is-bubble-side,
[data-spa-root][data-spa-spot="bl"].is-bubble-side{
  flex-direction:row-reverse;
}
[data-spa-root][data-spa-spot="ml"].is-bubble-side .spa-bubble,
[data-spa-root][data-spa-spot="bl"].is-bubble-side .spa-bubble{
  border-radius:4px 14px 14px 14px;
}
[data-spa-root][data-spa-spot="ml"].is-bubble-side .spa-bubble::after,
[data-spa-root][data-spa-spot="bl"].is-bubble-side .spa-bubble::after{
  left:-10px;
  right:auto;
  bottom:16px;
  border-right:10px solid #fff;
  border-left:0;
  border-top:7px solid transparent;
  border-bottom:7px solid transparent;
}
[data-spa-root][data-spa-spot="mr"].is-bubble-side .spa-bubble{
  right:auto;
  left:auto;
  bottom:0;
  margin-right:12px;
}

[data-spa-root] .spa-btn{
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
}

/* Extra pose frames sit on the same box as idle/blink. */
[data-spa-root] .spa-art-look-left,
[data-spa-root] .spa-art-look-right,
[data-spa-root] .spa-art-oh{
  opacity:0;
}
[data-spa-root].is-look-left .spa-art-look-left,
[data-spa-root].is-look-right .spa-art-look-right,
[data-spa-root].is-oh .spa-art-oh{ opacity:1; }
[data-spa-root].is-look-left .spa-art-idle,
[data-spa-root].is-look-right .spa-art-idle,
[data-spa-root].is-oh .spa-art-idle{ opacity:0; }

/* Pause the standing bob while an act plays so they don't compound. */
[data-spa-root].is-acting .spa-idle,
[data-spa-root].is-acting .spa-glance{
  /* Snap to the layout rest box so a move never stacks on a mid-bob dip. */
  animation:none !important;
  transform:none;
}
[data-spa-root].is-acting .spa-shadow{
  animation-play-state:paused !important;
}
[data-spa-root] .spa-act{
  display:block;
  width:100%;
  height:100%;
  transform-origin:50% 80%;
}

@keyframes spa-wiggle{
  0%{ transform:rotate(0deg) scale(1); }
  25%{ transform:rotate(-8deg) scale(0.86); }
  50%{ transform:rotate(8deg) scale(0.86); }
  75%{ transform:rotate(-4deg) scale(0.86); }
  100%{ transform:rotate(0deg) scale(1); }
}
@keyframes spa-nod{
  0%{ transform:translate3d(0,0,0) rotate(0deg) scale(1); }
  20%{ transform:translate3d(0,0,0) rotate(8deg) scale(0.86); }
  45%{ transform:translate3d(0,0,0) rotate(8deg) scale(0.86); }
  100%{ transform:translate3d(0,0,0) rotate(0deg) scale(1); }
}
@keyframes spa-hop{
  0%{ transform:scale(1,1) translate3d(0,0,0); }
  18%{ transform:scale(1.08,0.92) translate3d(0,0,0); }
  50%{ transform:scale(1,1) translate3d(0,-8px,0); }
  78%{ transform:scale(1.08,0.92) translate3d(0,0,0); }
  100%{ transform:scale(1,1) translate3d(0,0,0); }
}
@keyframes spa-hop-shadow{
  0%,100%{ transform:translateX(-50%) scale(.92); opacity:.16; }
  18%{ transform:translateX(-50%) scale(1.05); opacity:.2; }
  50%{ transform:translateX(-50%) scale(.45); opacity:.08; }
  78%{ transform:translateX(-50%) scale(1.05); opacity:.2; }
}
@keyframes spa-peek-right{
  0%{ transform:translate3d(0,0,0); }
  22%{ transform:translate3d(8px,0,0); }
  58%{ transform:translate3d(8px,0,0); }
  100%{ transform:translate3d(0,0,0); }
}
@keyframes spa-peek-left{
  0%{ transform:translate3d(0,0,0); }
  22%{ transform:translate3d(-8px,0,0); }
  58%{ transform:translate3d(-8px,0,0); }
  100%{ transform:translate3d(0,0,0); }
}
@keyframes spa-land{
  0%{ transform:scale(1,1); }
  40%{ transform:scale(1.06,0.94); }
  100%{ transform:scale(1,1); }
}

[data-spa-root].is-idle-wiggle .spa-act{ animation:spa-wiggle .9s ease-in-out both; transform-origin:50% 50%; }
[data-spa-root].is-idle-nod .spa-act{ animation:spa-nod .8s ease-in-out both; transform-origin:50% 50%; }
[data-spa-root].is-idle-hop .spa-act{ animation:spa-hop .7s ease-in-out both; }
[data-spa-root].is-idle-hop .spa-shadow{ animation:spa-hop-shadow .7s ease-in-out both !important; }
[data-spa-root].is-idle-peek-right .spa-act{ animation:spa-peek-right 1.4s ease-in-out both; }
[data-spa-root].is-idle-peek-left .spa-act{ animation:spa-peek-left 1.4s ease-in-out both; }
[data-spa-root].is-landing .spa-act{ animation:spa-land .22s ease-out both; }

/* Droplets — 6px aqua, burst from behind him (scale+opacity). */
[data-spa-root] .spa-drops{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:0;
  overflow:visible;
}
[data-spa-root] .spa-drop{
  position:absolute;
  left:50%;
  top:42%;
  width:6px;
  height:6px;
  margin:-3px;
  border-radius:50%;
  background:#3FD0C9;
  opacity:0;
  transform:scale(.2);
  pointer-events:none;
}
[data-spa-root].is-idle-splash .spa-drop{
  animation:spa-drop 1.2s ease-out both;
}
[data-spa-root].is-idle-splash .spa-drop:nth-child(1){ --dx:-18px; --dy:-28px; animation-delay:0ms; }
[data-spa-root].is-idle-splash .spa-drop:nth-child(2){ --dx:16px; --dy:-30px; animation-delay:40ms; }
[data-spa-root].is-idle-splash .spa-drop:nth-child(3){ --dx:-26px; --dy:-8px; animation-delay:70ms; }
[data-spa-root].is-idle-splash .spa-drop:nth-child(4){ --dx:24px; --dy:-6px; animation-delay:90ms; }
[data-spa-root].is-idle-splash .spa-drop:nth-child(5){ --dx:2px; --dy:-36px; animation-delay:50ms; }
@keyframes spa-drop{
  0%{ opacity:0; transform:translate3d(0,0,0) scale(.2); }
  12%{ opacity:1; transform:translate3d(calc(var(--dx) * .35), calc(var(--dy) * .35), 0) scale(1); }
  100%{ opacity:0; transform:translate3d(var(--dx), var(--dy), 0) scale(.35); }
}

/* Drag */
[data-spa-root].is-dragging{
  transition:none;
  z-index:8910;
  cursor:grabbing;
}
[data-spa-root].is-dragging .spa-btn{ transform:scale(1.08); cursor:grabbing; }
[data-spa-root].is-chip-rest.is-dragging .spa-btn{ transform:scale(calc(var(--spa-chip-scale, 0.72727) * 1.08)); cursor:grabbing; }
[data-spa-root].is-dragging .spa-shadow{ opacity:.4 !important; animation:none !important; }
[data-spa-root].is-shadow-left .spa-shadow{ /* JS may park a clone; in-btn shadow hides */
  opacity:0 !important;
  animation:none !important;
}
.spa-shadow-orphan{
  position:fixed;
  width:50px;
  height:12px;
  background:#002D62;
  border-radius:50%;
  filter:blur(5px);
  opacity:.4;
  pointer-events:none;
  z-index:8890;
  transform:translate(-50%,0) scale(.92);
  margin:0;
}
[data-spa-root].is-snapping{ transition:none; }

/* "Hide Splash" underlined text link under the message. ≥44px tap area via padding.
   × stays top-right and only closes the bubble. Keep the 220px cap. */
[data-spa-root] .spa-bubble{
  padding:10px 36px 6px 12px;
}
[data-spa-root] .spa-bubble-hide{
  display:inline-block;
  position:static;
  box-sizing:border-box;
  width:auto;
  min-width:0;
  min-height:44px;
  height:auto;
  margin:2px 0 0;
  padding:12px 0;
  border:0;
  background:transparent;
  color:var(--spa-navy);
  font:600 14px/1.35 Nunito,system-ui,-apple-system,sans-serif;
  letter-spacing:normal;
  text-transform:none;
  text-decoration:underline;
  text-underline-offset:2px;
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  border-radius:4px;
  text-align:left;
  z-index:auto;
}
[data-spa-root] .spa-bubble-hide:focus{ outline:none; }
[data-spa-root] .spa-bubble-hide:focus-visible{
  outline:2px solid var(--spa-focus);
  outline-offset:2px;
}

/* Tuck tab: 28×56 aqua half-pill flush to the edge, ≥44px hit area.
   Splash peeks at ~48px, clipped so about 40% of his face shows. */
[data-spa-root] .spa-tab{
  pointer-events:auto;
  position:absolute;
  width:44px;
  height:56px;
  min-width:44px;
  min-height:44px;
  padding:0;
  margin:0;
  border:0;
  background:transparent;
  cursor:pointer;
  appearance:none;
  -webkit-appearance:none;
  display:none;
  z-index:3;
  overflow:visible;
}
[data-spa-root] .spa-tab-pill{
  pointer-events:none;
  position:absolute;
  top:0;
  width:28px;
  height:56px;
  background:var(--spa-aqua, #3FD0C9);
  overflow:hidden;
  box-shadow:0 2px 10px rgba(0,31,64,.2);
  transition:transform .3s cubic-bezier(.22, 1, .36, 1);
}
[data-spa-root] .spa-tab-peek{
  position:absolute;
  width:48px;
  max-width:none;
  height:calc(48px * 337 / 256);
  top:6px;
  object-fit:contain;
  object-position:center top;
  display:block;
  pointer-events:none;
  user-select:none;
  -webkit-user-drag:none;
}
[data-spa-root].is-tucked{
  width:44px;
  height:56px;
  min-width:0;
  opacity:1 !important;
  pointer-events:auto;
  gap:0;
}
[data-spa-root].is-tucked .spa-btn,
[data-spa-root].is-tucked .spa-bubble,
[data-spa-root].is-tucked .spa-dot,
[data-spa-root].is-tucked .spa-shadow{ display:none !important; }
[data-spa-root].is-tucked .spa-tab{ display:block; }

/* Right-edge docks: pill flush right, rounded on the open (left) side only. */
[data-spa-root].is-tucked[data-spa-spot="br"],
[data-spa-root].is-tucked[data-spa-spot="tr"],
[data-spa-root].is-tucked[data-spa-spot="mr"]{
  right:0;
  left:auto;
}
[data-spa-root].is-tucked[data-spa-spot="br"] .spa-tab,
[data-spa-root].is-tucked[data-spa-spot="tr"] .spa-tab,
[data-spa-root].is-tucked[data-spa-spot="mr"] .spa-tab{
  right:0; left:auto; top:0;
}
[data-spa-root].is-tucked[data-spa-spot="br"] .spa-tab-pill,
[data-spa-root].is-tucked[data-spa-spot="tr"] .spa-tab-pill,
[data-spa-root].is-tucked[data-spa-spot="mr"] .spa-tab-pill{
  right:0; left:auto;
  border-radius:28px 0 0 28px;
  transform:translateX(100%);
}
[data-spa-root].is-tucked.is-tab-in[data-spa-spot="br"] .spa-tab-pill,
[data-spa-root].is-tucked.is-tab-in[data-spa-spot="tr"] .spa-tab-pill,
[data-spa-root].is-tucked.is-tab-in[data-spa-spot="mr"] .spa-tab-pill{
  transform:translateX(0);
}
[data-spa-root].is-tucked[data-spa-spot="br"] .spa-tab-peek,
[data-spa-root].is-tucked[data-spa-spot="tr"] .spa-tab-peek,
[data-spa-root].is-tucked[data-spa-spot="mr"] .spa-tab-peek{
  right:-26px;
  left:auto;
}

/* Left-edge docks: pill flush left, rounded on the open (right) side only. */
[data-spa-root].is-tucked[data-spa-spot="bl"],
[data-spa-root].is-tucked[data-spa-spot="tl"],
[data-spa-root].is-tucked[data-spa-spot="ml"]{
  left:0;
  right:auto;
}
[data-spa-root].is-tucked[data-spa-spot="bl"] .spa-tab,
[data-spa-root].is-tucked[data-spa-spot="tl"] .spa-tab,
[data-spa-root].is-tucked[data-spa-spot="ml"] .spa-tab{
  left:0; right:auto; top:0;
}
[data-spa-root].is-tucked[data-spa-spot="bl"] .spa-tab-pill,
[data-spa-root].is-tucked[data-spa-spot="tl"] .spa-tab-pill,
[data-spa-root].is-tucked[data-spa-spot="ml"] .spa-tab-pill{
  left:0; right:auto;
  border-radius:0 28px 28px 0;
  transform:translateX(-100%);
}
[data-spa-root].is-tucked.is-tab-in[data-spa-spot="bl"] .spa-tab-pill,
[data-spa-root].is-tucked.is-tab-in[data-spa-spot="tl"] .spa-tab-pill,
[data-spa-root].is-tucked.is-tab-in[data-spa-spot="ml"] .spa-tab-pill{
  transform:translateX(0);
}
[data-spa-root].is-tucked[data-spa-spot="bl"] .spa-tab-peek,
[data-spa-root].is-tucked[data-spa-spot="tl"] .spa-tab-peek,
[data-spa-root].is-tucked[data-spa-spot="ml"] .spa-tab-peek{
  left:-26px;
  right:auto;
}

[data-spa-root].is-tucked[data-spa-spot="mr"],
[data-spa-root].is-tucked[data-spa-spot="ml"]{
  /* Tab sits on the vertical edge at mid height. */
  top:50vh;
  bottom:auto;
}
[data-spa-root] .spa-tab:focus{ outline:none; }
[data-spa-root] .spa-tab:focus-visible .spa-tab-pill{
  outline:3px solid var(--spa-navy);
  outline-offset:2px;
}
@media (prefers-reduced-motion:reduce){
  [data-spa-root] .spa-tab-pill{ transition:none !important; }
}
[data-spa-root].spa-reduced .spa-tab-pill{ transition:none !important; }


/* Scroll swim lives on a wrapper so it never moves the dock. */
[data-spa-root] .spa-swim{
  display:block;
  width:100%;
  height:100%;
  transform-origin:50% 70%;
  transform:translateY(var(--spa-swim-y, 0px)) rotate(var(--spa-swim-rot, 0deg)) scale(var(--spa-swim-scale, 1));
  will-change:transform;
}
[data-spa-root].is-scroll-settle .spa-swim{
  animation:spa-scroll-settle .3s ease-out both;
}
@keyframes spa-scroll-settle{
  0%{ transform:translateY(var(--spa-swim-y, 0px)) rotate(var(--spa-swim-rot, 0deg)) scale(var(--spa-swim-scale, 1)); }
  40%{ transform:translateY(0) rotate(0deg) scale(1.06,0.92); }
  100%{ transform:translateY(0) rotate(0deg) scale(1,1); }
}

/* ── Extra idle moves (all ≤1.5s, transform/opacity + existing frames) ── */
@keyframes spa-spin{
  0%{ transform:rotate(0deg) scale(1); }
  12%{ transform:rotate(0deg) scale(0.70); }
  88%{ transform:rotate(360deg) scale(0.70); }
  100%{ transform:rotate(360deg) scale(1); }
}
@keyframes spa-doublehop{
  0%{ transform:scale(1,1) translate3d(0,0,0); }
  10%{ transform:scale(1.08,0.9) translate3d(0,0,0); }
  28%{ transform:scale(1,1) translate3d(0,-8px,0); }
  42%{ transform:scale(1.08,0.9) translate3d(0,0,0); }
  58%{ transform:scale(1.08,0.9) translate3d(0,0,0); }
  76%{ transform:scale(1,1) translate3d(0,-8px,0); }
  90%{ transform:scale(1.08,0.92) translate3d(0,0,0); }
  100%{ transform:scale(1,1) translate3d(0,0,0); }
}
@keyframes spa-doublehop-shadow{
  0%,100%{ transform:translateX(-50%) scale(.92); opacity:.16; }
  10%,58%,90%{ transform:translateX(-50%) scale(1.05); opacity:.2; }
  28%,76%{ transform:translateX(-50%) scale(.42); opacity:.08; }
}
@keyframes spa-bounce{
  0%{ transform:scale(1,1) translate3d(0,0,0); }
  22%{ transform:scale(1.12,0.84) translate3d(0,0,0); }
  48%{ transform:scale(1,1) translate3d(0,-8px,0); }
  70%{ transform:scale(1.08,0.9) translate3d(0,0,0); }
  100%{ transform:scale(1,1) translate3d(0,0,0); }
}
@keyframes spa-shimmy{
  0%{ transform:translate3d(0,0,0) rotate(0deg) scale(1); }
  20%{ transform:translate3d(-6px,0,0) rotate(-6deg) scale(0.86); }
  40%{ transform:translate3d(6px,0,0) rotate(6deg) scale(0.86); }
  60%{ transform:translate3d(-5px,0,0) rotate(-5deg) scale(0.86); }
  80%{ transform:translate3d(5px,0,0) rotate(4deg) scale(0.86); }
  100%{ transform:translate3d(0,0,0) rotate(0deg) scale(1); }
}
@keyframes spa-tiltlook{
  0%{ transform:rotate(0deg) translate3d(0,0,0) scale(1); }
  25%{ transform:rotate(-10deg) translate3d(0,0,0) scale(0.86); }
  70%{ transform:rotate(-10deg) translate3d(0,0,0) scale(0.86); }
  100%{ transform:rotate(0deg) translate3d(0,0,0) scale(1); }
}
@keyframes spa-ohjump{
  0%{ transform:scale(1,1) translate3d(0,0,0); }
  18%{ transform:scale(1.1,0.88) translate3d(0,0,0); }
  42%{ transform:scale(1,1) translate3d(0,-8px,0); }
  62%{ transform:scale(1,1) translate3d(0,-8px,0); }
  80%{ transform:scale(1.1,0.88) translate3d(0,0,0); }
  100%{ transform:scale(1,1) translate3d(0,0,0); }
}
@keyframes spa-dive{
  0%{ transform:translate3d(0,0,0) scale(1,1); }
  30%{ transform:translate3d(0,8px,0) scale(1.06,0.9); }
  55%{ transform:translate3d(0,8px,0) scale(1.06,0.9); }
  78%{ transform:translate3d(0,0,0) scale(1,1); }
  100%{ transform:translate3d(0,0,0) scale(1,1); }
}
@keyframes spa-dive-up{
  0%{ transform:translate3d(0,0,0) scale(1,1); }
  30%{ transform:translate3d(0,0,0) scale(1.06,0.9); }
  55%{ transform:translate3d(0,0,0) scale(1.06,0.9); }
  78%{ transform:translate3d(0,-8px,0) scale(1,1); }
  100%{ transform:translate3d(0,0,0) scale(1,1); }
}
@keyframes spa-cartwheel{
  0%{ transform:rotate(0deg) scale(1); }
  12%{ transform:rotate(0deg) scale(0.70); }
  40%{ transform:rotate(-48deg) scale(0.70); }
  70%{ transform:rotate(32deg) scale(0.70); }
  88%{ transform:rotate(0deg) scale(0.70); }
  100%{ transform:rotate(0deg) scale(1); }
}
@keyframes spa-wink{
  0%{ transform:rotate(0deg) scale(1,1); }
  20%{ transform:rotate(-6deg) scale(0.86); }
  55%{ transform:rotate(-6deg) scale(0.86); }
  100%{ transform:rotate(0deg) scale(1,1); }
}
@keyframes spa-blinkheavy{
  0%,18%,32%,50%,64%,82%,100%{ opacity:0; }
  6%,14%,38%,46%,70%,78%{ opacity:1; }
}
@keyframes spa-happy{
  0%{ transform:rotate(0deg) translate3d(0,0,0) scale(1); }
  20%{ transform:rotate(-8deg) translate3d(-4px,0,0) scale(0.86); }
  40%{ transform:rotate(8deg) translate3d(4px,0,0) scale(0.86); }
  60%{ transform:rotate(-6deg) translate3d(-3px,0,0) scale(0.86); }
  80%{ transform:rotate(6deg) translate3d(3px,0,0) scale(0.86); }
  100%{ transform:rotate(0deg) translate3d(0,0,0) scale(1); }
}
@keyframes spa-capflip{
  0%{ transform:rotate(0deg) scale(1) translate3d(0,0,0); }
  12%{ transform:rotate(0deg) scale(0.70) translate3d(0,0,0); }
  30%{ transform:rotate(-28deg) scale(0.70) translate3d(0,-6px,0); }
  55%{ transform:rotate(-28deg) scale(0.70) translate3d(0,-6px,0); }
  78%{ transform:rotate(8deg) scale(0.70) translate3d(0,0,0); }
  88%{ transform:rotate(0deg) scale(0.70) translate3d(0,0,0); }
  100%{ transform:rotate(0deg) scale(1) translate3d(0,0,0); }
}

[data-spa-root].is-idle-spin .spa-act{ animation:spa-spin 1s ease-in-out both; transform-origin:50% 50%; }
[data-spa-root].is-idle-doublehop .spa-act{ animation:spa-doublehop 1.4s ease-in-out both; }
[data-spa-root].is-idle-doublehop .spa-shadow{ animation:spa-doublehop-shadow 1.4s ease-in-out both !important; }
[data-spa-root].is-idle-bounce .spa-act{ animation:spa-bounce .9s ease-in-out both; }
[data-spa-root].is-idle-shimmy .spa-act{ animation:spa-shimmy .9s ease-in-out both; transform-origin:50% 50%; }
[data-spa-root].is-idle-tiltlook .spa-act{ animation:spa-tiltlook 1.2s ease-in-out both; transform-origin:50% 50%; }
[data-spa-root].is-idle-ohjump .spa-act{ animation:spa-ohjump 1.1s ease-in-out both; }
[data-spa-root].is-idle-dive .spa-act{ animation:spa-dive 1s ease-in-out both; }
[data-spa-root][data-spa-spot="bl"].is-idle-dive .spa-act,
[data-spa-root][data-spa-spot="br"].is-idle-dive .spa-act{ animation-name:spa-dive-up; }
[data-spa-root].is-idle-cartwheel .spa-act{ animation:spa-cartwheel 1.2s ease-in-out both; transform-origin:50% 50%; }
[data-spa-root].is-idle-wink .spa-act{ animation:spa-wink .8s ease-in-out both; transform-origin:50% 50%; }
[data-spa-root].is-idle-wink .spa-art-blink{ opacity:1; }
[data-spa-root].is-idle-wink .spa-art-idle{ opacity:0; }
[data-spa-root].is-idle-happy .spa-act{ animation:spa-happy 1.2s ease-in-out both; transform-origin:50% 50%; }
[data-spa-root].is-idle-happy .spa-drop,
[data-spa-root].is-idle-pop .spa-drop{ animation:spa-drop 1.2s ease-out both; }
[data-spa-root].is-idle-happy .spa-drop:nth-child(1),
[data-spa-root].is-idle-pop .spa-drop:nth-child(1){ --dx:-18px; --dy:-28px; animation-delay:0ms; }
[data-spa-root].is-idle-happy .spa-drop:nth-child(2),
[data-spa-root].is-idle-pop .spa-drop:nth-child(2){ --dx:16px; --dy:-30px; animation-delay:40ms; }
[data-spa-root].is-idle-happy .spa-drop:nth-child(3),
[data-spa-root].is-idle-pop .spa-drop:nth-child(3){ --dx:-26px; --dy:-8px; animation-delay:70ms; }
[data-spa-root].is-idle-happy .spa-drop:nth-child(4),
[data-spa-root].is-idle-pop .spa-drop:nth-child(4){ --dx:24px; --dy:-6px; animation-delay:90ms; }
[data-spa-root].is-idle-happy .spa-drop:nth-child(5),
[data-spa-root].is-idle-pop .spa-drop:nth-child(5){ --dx:2px; --dy:-36px; animation-delay:50ms; }
[data-spa-root].is-idle-capflip .spa-act{ animation:spa-capflip 1.1s ease-in-out both; transform-origin:50% 50%; }
[data-spa-root].is-idle-blinkheavy .spa-art-blink{ animation:spa-blinkheavy 1s ease-in-out both; }

/* Reduced motion also kills the new idles and the scroll swim. */
/* Reduced motion: no idles, roaming hops, or droplets. Blink/look swaps stay. */
@media (prefers-reduced-motion:reduce){
  [data-spa-root].is-idle-wiggle .spa-act,
  [data-spa-root].is-idle-nod .spa-act,
  [data-spa-root].is-idle-hop .spa-act,
  [data-spa-root].is-idle-hop .spa-shadow,
  [data-spa-root].is-idle-peek-right .spa-act,
  [data-spa-root].is-idle-peek-left .spa-act,
  [data-spa-root].is-idle-splash .spa-drop,
  [data-spa-root].is-idle-spin .spa-act,
  [data-spa-root].is-idle-doublehop .spa-act,
  [data-spa-root].is-idle-doublehop .spa-shadow,
  [data-spa-root].is-idle-bounce .spa-act,
  [data-spa-root].is-idle-shimmy .spa-act,
  [data-spa-root].is-idle-tiltlook .spa-act,
  [data-spa-root].is-idle-ohjump .spa-act,
  [data-spa-root].is-idle-dive .spa-act,
  [data-spa-root].is-idle-cartwheel .spa-act,
  [data-spa-root].is-idle-wink .spa-act,
  [data-spa-root].is-idle-happy .spa-act,
  [data-spa-root].is-idle-happy .spa-drop,
  [data-spa-root].is-idle-pop .spa-drop,
  [data-spa-root].is-idle-capflip .spa-act,
  [data-spa-root].is-idle-blinkheavy .spa-art-blink,
  [data-spa-root].is-landing .spa-act,
  [data-spa-root].is-scroll-settle .spa-swim,
  [data-spa-root] .spa-swim{ animation:none !important; transform:none !important; }
}
[data-spa-root].spa-reduced.is-idle-wiggle .spa-act,
[data-spa-root].spa-reduced.is-idle-nod .spa-act,
[data-spa-root].spa-reduced.is-idle-hop .spa-act,
[data-spa-root].spa-reduced.is-idle-hop .spa-shadow,
[data-spa-root].spa-reduced.is-idle-peek-right .spa-act,
[data-spa-root].spa-reduced.is-idle-peek-left .spa-act,
[data-spa-root].spa-reduced.is-idle-splash .spa-drop,
[data-spa-root].spa-reduced.is-idle-spin .spa-act,
[data-spa-root].spa-reduced.is-idle-doublehop .spa-act,
[data-spa-root].spa-reduced.is-idle-doublehop .spa-shadow,
[data-spa-root].spa-reduced.is-idle-bounce .spa-act,
[data-spa-root].spa-reduced.is-idle-shimmy .spa-act,
[data-spa-root].spa-reduced.is-idle-tiltlook .spa-act,
[data-spa-root].spa-reduced.is-idle-ohjump .spa-act,
[data-spa-root].spa-reduced.is-idle-dive .spa-act,
[data-spa-root].spa-reduced.is-idle-cartwheel .spa-act,
[data-spa-root].spa-reduced.is-idle-wink .spa-act,
[data-spa-root].spa-reduced.is-idle-happy .spa-act,
[data-spa-root].spa-reduced.is-idle-happy .spa-drop,
[data-spa-root].spa-reduced.is-idle-pop .spa-drop,
[data-spa-root].spa-reduced.is-idle-capflip .spa-act,
[data-spa-root].spa-reduced.is-idle-blinkheavy .spa-art-blink,
[data-spa-root].spa-reduced.is-landing .spa-act,
[data-spa-root].spa-reduced.is-scroll-settle .spa-swim,
[data-spa-root].spa-reduced .spa-swim{ animation:none !important; transform:none !important; }

