.mojo {
  --mojo-gap: 12px;
  --mojo-panel-max: 390px;
  --mojo-bottom: calc(var(--mojo-gap) + env(safe-area-inset-bottom));
  --mojo-ink: #151412;
  --mojo-paper: #f4f0e8;
  --mojo-gold: #d3bb93;
  position: fixed;
  z-index: 55;
  inset: auto max(var(--mojo-gap), env(safe-area-inset-right)) var(--mojo-bottom) auto;
  color: var(--mojo-ink);
  font: 400 1rem/1.45 var(--sans, 'DM Sans', sans-serif);
}

.mojo [hidden], .mojo[hidden] { display: none !important; }
.mojo button, .mojo input { font: inherit; }
.mojo button { cursor: pointer; }
.mojo button:disabled { cursor: default; opacity: .45; }
.mojo :is(button, a, input):focus-visible { outline: 2px solid #9d6e32; outline-offset: 2px; }

.mojo-head { display: block; position: relative; transform-origin: 50% 85%; }
.mojo-head img { display: block; width: 100%; height: auto; }
.mojo-mouth { position: absolute; display: block; pointer-events: none; }
.mojo-eyelids { position: absolute; inset: 0; pointer-events: none; }
.mojo-eyelids::before, .mojo-eyelids::after {
  content: "";
  position: absolute;
  top: 46.5%;
  left: 34.5%;
  width: 10%;
  height: 4.3%;
  border-radius: 52% 52% 48% 48%;
  background: linear-gradient(#914b2c, #c88353 60%, #542b1f 95%);
  opacity: 0;
  transform: scaleY(.03);
  animation: mojo-blink 5.8s 1.7s infinite;
}
.mojo-eyelids::after { left: 57.2%; top: 46%; }
.mojo-reacting .mojo-face .mojo-head { animation: mojo-nod .48s ease-out; }
@keyframes mojo-blink {
  0%, 46%, 50%, 80%, 83%, 100% { opacity: 0; transform: scaleY(.03); }
  48%, 81.5% { opacity: 1; transform: scaleY(1); }
}
@keyframes mojo-nod {
  0%, 100% { transform: none; }
  42% { transform: translateY(2px) rotate(7deg) scale(.95); }
  70% { transform: rotate(-3deg); }
}

.mojo-restore {
  --mojo-launcher-art: 116px;
  position: relative;
  display: block;
  width: 72px;
  height: 126px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}
.mojo-restore img {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: var(--mojo-launcher-art);
  max-width: none;
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 4px #1c100bb3);
  pointer-events: none;
}
.mojo-restore:is(:hover, :focus-visible) img {
  filter: drop-shadow(0 3px 5px #1c100bf2);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .mojo-restore img { transition: transform .18s ease-out; }
  .mojo-restore:hover img { transform: translate(-50%, -5px); }
}

.mojo-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--mojo-gold);
  border-radius: 50%;
  background: var(--mojo-ink);
  color: var(--mojo-paper);
}
.mojo-close::before,
.mojo-close::after {
  content: "";
  grid-area: 1 / 1;
  width: 13px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
}
.mojo-close::after { transform: rotate(-45deg); }
@media (prefers-reduced-motion: reduce) {
  .mojo .mojo-mouth { display: none; }
  .mojo .mojo-head,
  .mojo-reacting .mojo-face .mojo-head,
  .mojo .mojo-eyelids::before,
  .mojo .mojo-eyelids::after { animation: none; }
}

.mojo-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(var(--mojo-panel-max), calc(100vw - 2 * var(--mojo-gap) - env(safe-area-inset-left) - env(safe-area-inset-right)));
  height: min(500px, calc(100dvh - var(--mojo-bottom) - 12px - env(safe-area-inset-top)));
  overflow: hidden;
  border: 1px solid var(--mojo-gold);
  border-radius: 22px;
  background: var(--mojo-paper);
  box-shadow: 0 14px 42px #25190e3d;
}
.mojo-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 44px;
  gap: 8px;
  align-items: center;
  padding: 11px 13px;
  background: var(--mojo-ink);
  color: var(--mojo-paper);
}
.mojo-face {
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--mojo-gold);
  border-radius: 50%;
  background: #3b2a1b;
}
.mojo-header strong { display: block; font: 600 1.55rem/1 var(--display, Italiana, serif); }
.mojo-header div > span { display: block; margin-top: 3px; color: var(--mojo-gold); font-size: .875rem; }
.mojo-close { grid-column: -2; border-color: #8b765b; }

.mojo-body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.mojo-log { display: grid; gap: 12px; padding: 14px; }
.mojo :is(.mojo-log, .mojo-tour) p {
  margin: 0;
  color: inherit;
  font: inherit;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.mojo-answer, .mojo-guest {
  width: fit-content;
  max-width: 94%;
  padding: 10px 12px;
  border: 1px solid #ded0b7;
  border-radius: 4px 14px 14px;
  background: #fffcf7;
}
.mojo-guest {
  justify-self: end;
  border-color: #463726;
  border-radius: 14px 4px 14px 14px;
  background: #35291e;
  color: #fffaf0;
}
.mojo-wave {
  position: relative;
  display: block;
  width: 132px;
  max-width: 100%;
  margin-top: 7px;
  overflow: hidden;
}
.mojo-wave img { display: block; width: 100%; height: auto; }
.mojo-wave .mojo-wave-frames {
  position: absolute;
  inset: 0;
  width: 400%;
  max-width: none;
  visibility: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .mojo-waving:not(:has(.mojo-mouth:not([hidden]))) {
    .mojo-wave-still { animation: mojo-wave-still .9s step-end; }
    .mojo-wave-frames { animation: mojo-wave-frames .9s step-end; }
  }
}
@keyframes mojo-wave-still {
  from { visibility: hidden; }
  to { visibility: visible; }
}
@keyframes mojo-wave-frames {
  0% { visibility: visible; transform: none; }
  18% { transform: translateX(-25%); }
  39% { transform: translateX(-50%); }
  68% { transform: translateX(-75%); }
  100% { visibility: hidden; transform: translateX(-75%); }
}

.mojo-stage {
  --mojo-stride-width: 55px;
  --mojo-crossing: 2.8s;
  position: relative;
  min-width: 0;
  margin: 0 14px;
  padding-top: 20px;
  pointer-events: none;
}
.mojo-track {
  width: calc(100% - var(--mojo-stride-width));
  animation: mojo-cross var(--mojo-crossing) linear infinite alternate;
}
.mojo-walker {
  width: var(--mojo-stride-width);
  aspect-ratio: 192 / 208;
  background: url('/img/mojo-shine-stride.webp') repeat-x 0 0 / 800% 200%;
  animation: mojo-stride 1.05s steps(8, end) infinite, mojo-direction calc(2 * var(--mojo-crossing)) step-end infinite;
}
.mojo-aside {
  position: absolute;
  inset: 0 auto auto 0;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid var(--mojo-gold);
  border-radius: 14px;
  background: #fffaf0;
  color: var(--mojo-ink);
  font-size: .75rem;
  line-height: 1.35;
}
@keyframes mojo-cross {
  to { transform: translateX(100%); }
}
@keyframes mojo-stride {
  to { background-position-x: calc(-8 * var(--mojo-stride-width)); }
}
@keyframes mojo-direction {
  0%, 100% { background-position-y: 0; }
  50% { background-position-y: 100%; }
}
@media (min-width: 820px) {
  .mojo-stage {
    --mojo-stride-width: 100px;
    --mojo-crossing: 3.9s;
    position: fixed;
    inset: auto auto max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    width: min(530px, calc(100vw - var(--mojo-panel-max) - 55px));
    margin: 0;
    padding: 0;
  }
  .mojo-aside { inset: auto auto 100% 18px; }
}
@media (max-width: 360px) {
  .mojo-aside { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mojo .mojo-stage { display: none; }
}
.mojo-links { display: grid; gap: 2px; margin-top: 6px; }
.mojo-links a, .mojo-tour-visit {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 36px;
  color: #65431f;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mojo-tour { display: grid; gap: 8px; padding: 14px; }
.mojo .mojo-progress { font-size: .875rem; font-weight: 700; color: #65431f; }
.mojo-tour h2 { margin: 0; font: 600 1.65rem/1.1 var(--display, Italiana, serif); letter-spacing: 0; }
.mojo-tour-nav, .mojo-quick, .mojo-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.mojo-choices { margin-top: 8px; }
.mojo-quick { padding: 6px 12px 8px; }
.mojo-quick button, .mojo-tour-nav button, .mojo-choices button {
  min-height: 36px;
  padding: 5px 9px;
  border: 1px solid #bca57f;
  border-radius: 18px;
  background: #fffaf0;
  color: var(--mojo-ink);
  font-size: .875rem;
  font-weight: 600;
}
.mojo-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid #d6c7af;
}
.mojo-form input, .mojo-form button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #bca57f;
  border-radius: 10px;
  background: #fffaf0;
  color: var(--mojo-ink);
}
.mojo-form button {
  background: var(--mojo-ink);
  color: var(--mojo-paper);
  font-weight: 700;
}
.mojo :is(.mojo-close, .mojo-quick button, .mojo-tour-nav button, .mojo-choices button, .mojo-form button):hover {
  background: var(--mojo-gold);
  color: var(--mojo-ink);
}
@media (max-width: 620px) {
  .mojo { --mojo-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .mojo:has(.mojo-panel[hidden]) {
    right: auto;
    left: max(var(--mojo-gap), env(safe-area-inset-left));
  }
  .mojo-restore { --mojo-launcher-art: 96px; width: 58px; height: 104px; }
}

.mojo:not(.mojo-voice-ready) :is(.mojo-listen, .mojo-mute),
.mojo-muted .mojo-listen { display: none; }

.mojo-mute, .mojo-listen {
  width: fit-content;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid #bca57f;
  border-radius: 18px;
  background: #fffaf0;
  color: var(--mojo-ink);
  font-size: .875rem;
  font-weight: 700;
}
.mojo-mute {
  min-height: 44px;
  border-color: #8b765b;
  background: transparent;
  color: var(--mojo-paper);
}
.mojo-answer .mojo-listen { margin-bottom: 8px; }
.mojo :is(.mojo-mute, .mojo-listen):hover { background: var(--mojo-gold); color: var(--mojo-ink); }
.mojo-audio-status {
  margin: 0;
  padding: 4px 12px;
  color: #65431f;
  font-size: .875rem;
}

.mojo-mic-ready .mojo-form { grid-template-columns: minmax(0, 1fr) 44px auto; }
.mojo-form .mojo-mic { display: grid; place-items: center; padding: 0; }
.mojo-listening .mojo-form .mojo-mic { background: var(--mojo-gold); color: var(--mojo-ink); }
.mojo-mic-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: #65431f;
  font-size: .875rem;
}
.mojo-form .mojo-type-instead {
  width: auto;
  min-height: 36px;
  padding: 3px 6px;
  border: 0;
  background: transparent;
  color: #65431f;
  font-size: .875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

