:root {
  --mascot-owl-bg: var(--white);
  --mascot-owl-line: #d5e4d8;
  --mascot-enaga-bg: #fdf8f4;
  --mascot-enaga-line: #ead9cf;
  --mascot-name: var(--text-mid);
}

.mascot-chat { margin: 2.2rem 0 2.6rem; }
:is(h3, h4) + .mascot-chat { margin-top: 1.2rem; }
:is(.section-h, .step-header, .step-h) + .mascot-chat { margin-top: 0; }

.mascot-talk {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  margin: 0.4rem 0;
  max-width: 700px;
}
.mascot-talk.is-right { flex-direction: row-reverse; margin-left: auto; }

.mascot-face {
  flex: 0 0 auto;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mascot-img {
  display: block;
  width: 76px;
  height: 76px;
  transform-origin: 50% 88%;
  animation: mascot-sway 6s ease-in-out infinite;
  user-select: none;
}
.mascot-talk.is-right .mascot-img { animation-delay: -3s; }
.mascot-name {
  font-family: 'Cormorant Garamond', 'Noto Serif JP', serif;
  font-size: 0.8rem;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--mascot-name);
  white-space: nowrap;
}

.mascot-bubble {
  --bg: var(--mascot-owl-bg);
  --line: var(--mascot-owl-line);
  position: relative;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem 1.05rem;
  margin-bottom: 1.45rem;
  font-size: 0.92rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}
.mascot-talk--enaga .mascot-bubble {
  --bg: var(--mascot-enaga-bg);
  --line: var(--mascot-enaga-line);
}
.mascot-talk .mascot-bubble p { font-size: inherit; line-height: inherit; margin: 0 0 0.5rem; }
.mascot-talk .mascot-bubble > :last-child { margin-bottom: 0; }
.mascot-bubble::before {
  content: "";
  position: absolute;
  bottom: 14px;
  left: -6.5px;
  width: 11px;
  height: 11px;
  background: var(--bg);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}
.mascot-talk.is-right .mascot-bubble::before { left: auto; right: -6.5px; transform: rotate(-135deg); }

.mascot-figure { margin: 2.6rem auto 0; }
.mascot-art {
  display: block;
  width: min(170px, 46vw);
  height: auto;
  margin: 0 auto;
}

.mascot-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes mascot-sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-1.5deg) translateY(0.5px); }
}
@media (prefers-reduced-motion: reduce) {
  .mascot-img { animation: none; }
}

@media (max-width: 32.5em) {
  .mascot-face, .mascot-img { width: 60px; }
  .mascot-img { height: 60px; }
  .mascot-talk { gap: 0.5rem; }
  .mascot-bubble { padding: 0.6rem 0.85rem; font-size: 0.9rem; margin-bottom: 1.35rem; }
}
