.neo-companion {
  --neo-mint: #9de5cd;
  position: fixed;
  inset: 0 auto auto 0;
  width: 76px;
  height: 138px;
  z-index: 45;
  pointer-events: none;
  transition: transform 0ms linear;
  contain: layout style;
}
.neo-companion[hidden], .neo-companion-menu[hidden] { display: none !important; }
.neo-companion .neo-companion-actor {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  position: relative;
  box-sizing: border-box;
  width: 76px;
  height: 138px;
  padding: 4px 2px 0;
  margin: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: #e3fff5;
  box-shadow: none;
  font: inherit;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}
.neo-companion .neo-companion-actor:hover { background: transparent; box-shadow: none; }
.neo-companion .neo-companion-actor:focus-visible,
.neo-companion .neo-companion-options:focus-visible,
.neo-companion-menu button:focus-visible { outline: 2px solid var(--neo-mint); outline-offset: 4px; }
.neo-companion-person { display: block; width: 66px; height: 111px; overflow: visible; filter: drop-shadow(0 1px 2px #0009) drop-shadow(0 0 5px #69b89a35); }
.neo-companion-shadow { fill: #0005; }
.neo-companion-figure { transform-origin: 36px 104px; }
.neo-companion-arm, .neo-companion-leg { fill: #101923; stroke: #6b8f86; stroke-width: .7; stroke-linejoin: round; }
.neo-companion-arm { transform-box: view-box; transform-origin: 36px 43px; }
.neo-companion-leg { transform-box: view-box; transform-origin: 36px 74px; }
.neo-companion-shoe { fill: #0b111a; stroke: #8aa99d; stroke-width: .75; }
.neo-companion-coat { fill: #111d25; stroke: #93b5a9; stroke-width: .85; stroke-linejoin: round; }
.neo-companion-shirt { fill: #243d3b; }
.neo-companion-lapel { fill: #0b151d; stroke: #597f73; stroke-width: 1; stroke-linejoin: round; }
.neo-companion-coat-edge { fill: none; stroke: #406456; stroke-width: .75; }
.neo-companion-skin, .neo-companion-neck { fill: #aeb8aa; stroke: #60776b; stroke-width: .7; }
.neo-companion-face { fill: #c1c5b6; stroke: #5b7467; stroke-width: .7; }
.neo-companion-hair { fill: #080d15; stroke: #526b61; stroke-width: .55; }
.neo-companion-glasses { fill: #02080f; stroke: #80bba1; stroke-width: .7; }
.neo-companion-glint { stroke: #91f2bf; stroke-width: 1.1; stroke-linecap: round; }
.neo-companion-mouth { fill: none; stroke: #64746a; stroke-width: 1; stroke-linecap: round; }
.neo-companion-name {
  display: block;
  padding: 2px 10px 3px;
  border: 1px solid #83cdb65c;
  border-radius: 20px;
  background: #0b1c25ed;
  color: #c9f4e6;
  font-size: 11px;
  font-weight: 600;
  line-height: 15px;
  letter-spacing: .06em;
  box-shadow: 0 3px 12px #0003;
}
.neo-companion .neo-companion-options {
  position: absolute;
  top: 0;
  right: -9px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  min-height: 0;
  padding: 0 0 6px;
  margin: 0;
  border: 1px solid #6eaa955e;
  border-radius: 14px;
  background: #122632;
  color: #bdebdc;
  box-shadow: 0 2px 8px #0003;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 120ms;
}
.neo-companion:hover .neo-companion-options,
.neo-companion:focus-within .neo-companion-options { opacity: 1; }
.neo-companion-menu {
  position: absolute;
  bottom: 22px;
  left: 78px;
  display: grid;
  gap: 5px;
  width: min(202px, calc(100vw - 24px));
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #4b7568;
  border-radius: 14px;
  background: #10222ff5;
  color: #dff4ed;
  box-shadow: 0 12px 35px #0006;
  pointer-events: auto;
}
.neo-companion-menu-left .neo-companion-menu { left: auto; right: 78px; }
.neo-companion-menu strong { padding: 0 5px 3px; font-size: 13px; }
.neo-companion-menu button { padding: 8px; border: 0; border-radius: 7px; background: #1a3542; color: #ddf1eb; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.neo-companion-menu button:hover { background: #254a54; }
.neo-companion-menu small { padding: 4px 5px 0; color: #a4c3bc; font-size: 10px; }
.neo-companion-dragging .neo-companion-actor { cursor: grabbing; }
.neo-companion-dragging .neo-companion-person { filter: drop-shadow(0 5px 4px #0008) drop-shadow(0 0 8px #76dcb765); }
.neo-companion-walking .neo-companion-arm-front,
.neo-companion-walking .neo-companion-leg-back { animation: neo-step 560ms ease-in-out infinite alternate; }
.neo-companion-walking .neo-companion-arm-back,
.neo-companion-walking .neo-companion-leg-front { animation: neo-step 560ms ease-in-out infinite alternate-reverse; }
.neo-companion-walking .neo-companion-figure { animation: neo-bob 560ms ease-in-out infinite; }
.neo-companion[data-direction="left"] .neo-companion-person { transform: scaleX(-1); }
@keyframes neo-step { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
@keyframes neo-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@media (max-width: 600px) {
  .neo-companion { width: 64px; height: 116px; }
  .neo-companion .neo-companion-actor { width: 64px; height: 116px; }
  .neo-companion-person { width: 55px; height: 92px; }
  .neo-companion .neo-companion-options { right: -3px; top: 0; opacity: .85; }
  .neo-companion-menu { width: min(184px, calc(100vw - 24px)); left: 65px; }
  .neo-companion-menu-left .neo-companion-menu { left: auto; right: 65px; }
  .neo-companion-name { padding-top: 1px; padding-bottom: 1px; font-size: 10px; line-height: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .neo-companion, .neo-companion * { animation: none !important; transition: none !important; }
}

/* Finite local gestures. The chat hit target and document layout never move. */
.neo-companion-torso { transform-box: view-box; transform-origin: 36px 74px; }
.neo-companion-effects { pointer-events: none; }
.neo-companion-shot { fill: none; stroke: #c5dbd5; stroke-width: 2.6; stroke-linecap: round; opacity: 0; }
.neo-companion-shot-two { --neo-shot-delay: 120ms; }
.neo-companion-shot-three { --neo-shot-delay: 240ms; }
.neo-companion-stop-palm { fill: #c1c5b6; stroke: #60776b; stroke-width: .7; stroke-linejoin: round; opacity: 0; }
.neo-companion-dodge-legs { fill: #101923; stroke: #6b8f86; stroke-width: .7; stroke-linejoin: round; opacity: 0; }
.neo-companion-stopping .neo-companion-arm-front { transform-origin: 24px 42px; animation: neo-palm-reach 4200ms ease-in-out both; }
.neo-companion-stopping .neo-companion-arm-front .neo-companion-skin { animation: neo-raised-hand-hide 4200ms linear both; }
.neo-companion-stopping .neo-companion-stop-palm { animation: neo-open-palm 4200ms ease both; }
.neo-companion-stopping .neo-companion-stop-shots .neo-companion-shot { animation: neo-shot-freeze 3800ms cubic-bezier(.16,.8,.24,1) both; animation-delay: var(--neo-shot-delay,0ms); }
.neo-companion-dodging .neo-companion-torso { animation: neo-bullet-time-lean 5400ms cubic-bezier(.22,.61,.36,1) both; }
.neo-companion-dodging .neo-companion-leg { animation: neo-standing-legs-hide 5400ms ease both; }
.neo-companion-dodging .neo-companion-dodge-legs { animation: neo-bent-legs 5400ms ease both; }
.neo-companion-dodging .neo-companion-dodge-shots .neo-companion-shot { animation: neo-shot-pass 5000ms linear both; animation-delay: var(--neo-shot-delay,0ms); }
@keyframes neo-palm-reach {
  0%,5%,100% { transform: rotate(0deg); }
  22%,78% { transform: rotate(-112deg); }
}
@keyframes neo-raised-hand-hide { 0%,10%,94%,100% { opacity: 1; } 22%,82% { opacity: 0; } }
@keyframes neo-open-palm { 0%,16%,88%,100% { opacity: 0; } 24%,76% { opacity: 1; } }
@keyframes neo-shot-freeze {
  0%,8% { opacity: 0; transform: translate(25px,0); }
  16% { opacity: .85; transform: translate(12px,0); }
  29%,65% { opacity: 1; transform: translate(0,0); }
  80% { opacity: .7; transform: translate(-1px,19px) rotate(5deg); }
  100% { opacity: 0; transform: translate(-2px,36px) rotate(9deg); }
}
@keyframes neo-bullet-time-lean {
  0%,4%,100% { transform: translate(0,0) rotate(0deg) scale(1); }
  23%,78% { transform: translate(11px,3px) rotate(-64deg) scale(.72); }
}
@keyframes neo-standing-legs-hide { 0%,5%,98%,100% { opacity: 1; } 24%,78% { opacity: 0; } }
@keyframes neo-bent-legs { 0%,5%,98%,100% { opacity: 0; } 24%,78% { opacity: 1; } }
@keyframes neo-shot-pass {
  0%,25% { opacity: 0; transform: translateX(25px); }
  32% { opacity: 1; transform: translateX(8px); }
  72% { opacity: 1; transform: translateX(-70px); }
  80%,100% { opacity: 0; transform: translateX(-92px); }
}

/* The welcome-page portrait shares the app character and stays in the page layout. */
.neo-portrait {
  display: inline-block;
  width: 80px;
  height: 128px;
  flex: none;
  pointer-events: none;
}
.neo-portrait .neo-companion-person { width: 100%; height: 100%; }
.neo-portrait .neo-wave-shoulder { transform-box: view-box; transform-origin: 49px 43px; }
.neo-portrait .neo-wave-elbow { transform-box: view-box; transform-origin: 56px 59px; }
.neo-portrait .neo-wave-wrist { transform-box: view-box; transform-origin: 58px 74px; }
