.yuma-guide,
.yuma-guide * { box-sizing: border-box; }

.yuma-guide {
  --yuma-guide-red: #ed1b2f;
  --yuma-guide-deep-red: #a90025;
  --yuma-guide-navy: #071625;
  --yuma-guide-ink: #f6f2e9;
  --yuma-guide-muted: #c8d4d8;
  --yuma-guide-gold: #d5ad66;
  position: fixed;
  right: 22px;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 9998;
  width: 86px;
  height: 78px;
  color: var(--yuma-guide-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  isolation: isolate;
}

.yuma-guide.is-arriving { animation: yuma-guide-arrive 1.35s cubic-bezier(.2,.75,.25,1) both; }

.yuma-guide__bird-button {
  position: absolute;
  inset: 5px 0 0;
  width: 86px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 28px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,.34));
  -webkit-tap-highlight-color: transparent;
}

.yuma-guide__bird-button::after {
  content: "";
  position: absolute;
  left: 17px;
  right: 15px;
  bottom: 4px;
  height: 10px;
  border-radius: 50%;
  background: rgba(2,11,19,.23);
  filter: blur(7px);
  z-index: -1;
}

.yuma-guide__bird-button:focus-visible,
.yuma-guide__portrait-button:focus-visible,
.yuma-guide__welcome-close:focus-visible,
.yuma-guide__panel-close:focus-visible,
.yuma-guide__question:focus-visible,
.yuma-guide__search input:focus-visible,
.yuma-guide__search button:focus-visible,
.yuma-guide a:focus-visible {
  outline: 3px solid var(--yuma-guide-gold);
  outline-offset: 3px;
}

.yuma-guide__bird-stage {
  display: block;
  width: 100%;
  height: 100%;
  animation: yuma-guide-bob 5.8s ease-in-out infinite;
  transform-origin: 50% 74%;
}

.yuma-guide__bird { display: block; width: 100%; height: 100%; overflow: visible; }
.yuma-guide__wing-left,
.yuma-guide__wing-right,
.yuma-guide__head { transform-box: fill-box; }

.yuma-guide__wing-left {
  transform-origin: 92% 78%;
  animation: yuma-guide-wing-left 5.2s cubic-bezier(.45,.05,.35,1) infinite;
}

.yuma-guide__wing-right {
  transform-origin: 8% 78%;
  animation: yuma-guide-wing-right 5.2s cubic-bezier(.45,.05,.35,1) infinite;
}

.yuma-guide.is-engaged .yuma-guide__wing-left { animation: yuma-guide-wing-left-engaged .68s ease-in-out 1, yuma-guide-wing-left 5.2s .68s cubic-bezier(.45,.05,.35,1) infinite; }
.yuma-guide.is-engaged .yuma-guide__wing-right { animation: yuma-guide-wing-right-engaged .68s ease-in-out 1, yuma-guide-wing-right 5.2s .68s cubic-bezier(.45,.05,.35,1) infinite; }

.yuma-guide__head {
  transform-origin: 76% 82%;
  animation: yuma-guide-head 8.4s ease-in-out infinite;
}

.yuma-guide__welcome,
.yuma-guide__menu {
  position: absolute;
  right: 6px;
  bottom: 84px;
  border: 1px solid rgba(213,173,102,.38);
  background: rgba(7,22,37,.985);
  box-shadow: 0 18px 48px rgba(0,0,0,.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.yuma-guide__welcome {
  display: grid;
  grid-template-columns: 72px minmax(0,1fr);
  align-items: center;
  gap: 12px;
  width: min(350px, calc(100vw - 32px));
  padding: 13px 42px 13px 13px;
  border-radius: 18px 18px 5px 18px;
  font-size: .9rem;
  line-height: 1.42;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.97);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}

.yuma-guide__welcome.is-visible { opacity: 1; visibility: visible; transform: none; }

.yuma-guide__portrait-button {
  display: block;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 8px 22px;
  background: transparent;
  cursor: pointer;
  animation: yuma-guide-greeting 8.2s 1.7s ease-in-out infinite;
}

.yuma-guide__portrait {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(213,173,102,.42);
  border-radius: inherit;
  background: #1a1a17;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
}

.yuma-guide__portrait img,
.yuma-guide__panel-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 31% 24%;
}

.yuma-guide__eyelid {
  --yuma-blink-angle: 0deg;
  position: absolute;
  z-index: 2;
  width: 9.5%;
  height: 5.2%;
  border-radius: 65% 65% 55% 55%;
  background: #e89578;
  box-shadow: inset 0 -1px 0 rgba(67,25,27,.8);
  opacity: 0;
  transform: rotate(var(--yuma-blink-angle)) scaleY(.08);
  transform-origin: 50% 100%;
  animation: yuma-guide-blink 7.2s 2.1s ease-in-out infinite;
  pointer-events: none;
}

.yuma-guide__eyelid--left { --yuma-blink-angle: -8deg; left: 39.7%; top: 22.8%; }
.yuma-guide__eyelid--right { --yuma-blink-angle: -13deg; left: 53.8%; top: 18.9%; animation-delay: 2.13s; }

.yuma-guide__welcome-copy { min-width: 0; }
.yuma-guide__welcome-copy strong { display: block; color: var(--yuma-guide-gold); font-weight: 780; font-size: .98rem; }
.yuma-guide__welcome-copy span { display: block; color: #e7edef; }

.yuma-guide__welcome-close,
.yuma-guide__panel-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(213,173,102,.26);
  border-radius: 50%;
  color: #dce6e8;
  background: rgba(255,255,255,.05);
  font: 500 1.05rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.yuma-guide__welcome-close { position: absolute; top: 8px; right: 8px; }
.yuma-guide__welcome-close:hover,
.yuma-guide__panel-close:hover { color: #fff; background: rgba(255,255,255,.1); }

.yuma-guide__menu {
  width: min(398px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 118px));
  overflow: hidden;
  border-radius: 22px 22px 6px 22px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(.97);
  transform-origin: right bottom;
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.yuma-guide__menu.is-open { opacity: 1; visibility: visible; transform: none; }

.yuma-guide__header {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) 32px;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-bottom: 1px solid rgba(213,173,102,.2);
  background: rgba(255,255,255,.025);
}

.yuma-guide__panel-portrait {
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid rgba(213,173,102,.42);
  border-radius: 15px 15px 6px 15px;
}

.yuma-guide__header strong { display: block; color: var(--yuma-guide-gold); font-size: 1rem; }
.yuma-guide__header small { display: block; color: var(--yuma-guide-muted); font-size: .72rem; line-height: 1.25; }
.yuma-guide__body { max-height: calc(min(680px, 100vh - 118px) - 74px); overflow-y: auto; padding: 14px; scrollbar-width: thin; scrollbar-color: rgba(213,173,102,.35) transparent; }
.yuma-guide__prompt { margin: 0 0 10px; color: #fff; font-size: .95rem; font-weight: 680; }

.yuma-guide__questions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.yuma-guide__question {
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid rgba(213,173,102,.22);
  border-radius: 11px;
  color: #eef3f3;
  background: rgba(255,255,255,.035);
  font: 620 .78rem/1.25 system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
}
.yuma-guide__question:hover { border-color: rgba(237,27,47,.55); background: rgba(237,27,47,.1); }

.yuma-guide__search { margin-top: 13px; }
.yuma-guide__search label { display: block; margin-bottom: 5px; color: var(--yuma-guide-gold); font-size: .74rem; font-weight: 750; }
.yuma-guide__search > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
.yuma-guide__search input {
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  border: 1px solid rgba(213,173,102,.28);
  border-radius: 10px;
  color: #fff;
  background: rgba(255,255,255,.055);
  font: 500 .84rem/1 system-ui, sans-serif;
}
.yuma-guide__search input::placeholder { color: #9eb0b8; }
.yuma-guide__search button {
  min-width: 58px;
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--yuma-guide-deep-red);
  font: 750 .82rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.yuma-guide__response:empty { display: none; }
.yuma-guide__response { margin-top: 10px; padding: 10px; border-left: 2px solid var(--yuma-guide-red); border-radius: 0 9px 9px 0; background: rgba(237,27,47,.07); }
.yuma-guide__response p { margin: 0; color: #e7edef; font-size: .8rem; line-height: 1.45; }
.yuma-guide__answer-links { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.yuma-guide__answer-links a { color: var(--yuma-guide-gold); font-size: .78rem; font-weight: 720; text-decoration: none; }

.yuma-guide__results { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.yuma-guide__results a { display: block; padding: 8px; border-radius: 8px; color: #fff; background: rgba(255,255,255,.035); text-decoration: none; }
.yuma-guide__results a:hover { background: rgba(255,255,255,.075); }
.yuma-guide__results strong { display: block; color: var(--yuma-guide-gold); font-size: .8rem; }
.yuma-guide__results span { display: block; margin-top: 2px; color: var(--yuma-guide-muted); font-size: .74rem; line-height: 1.35; }

.yuma-guide__quick { margin-top: 11px; border-top: 1px solid rgba(213,173,102,.16); padding-top: 10px; }
.yuma-guide__quick summary { color: var(--yuma-guide-gold); font-size: .76rem; font-weight: 750; cursor: pointer; }
.yuma-guide__quick ul { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 7px 0 0; padding: 0; list-style: none; }
.yuma-guide__quick a { display: block; padding: 6px 7px; border-radius: 7px; color: #eaf0f1; background: rgba(255,255,255,.035); font-size: .76rem; text-decoration: none; }

.yuma-guide__notice { margin: 11px 0 0; padding-top: 10px; border-top: 1px solid rgba(213,173,102,.16); color: #cbd6da; font-size: .7rem; line-height: 1.42; }
.yuma-guide__privacy { margin: 5px 0 0; color: #91a5ae; font-size: .66rem; line-height: 1.35; }

@keyframes yuma-guide-arrive {
  0% { opacity: 0; transform: translate(42vw,-48vh) rotate(-13deg) scale(.64); }
  55% { opacity: 1; transform: translate(-8px,-12px) rotate(4deg) scale(1.04); }
  78% { transform: translate(4px,-4px) rotate(-2deg) scale(.98); }
  100% { opacity: 1; transform: none; }
}

@keyframes yuma-guide-bob {
  0%,100% { transform: translateY(0) rotate(0); }
  45% { transform: translateY(-5px) rotate(-.8deg); }
  60% { transform: translateY(-3px) rotate(.5deg); }
}

@keyframes yuma-guide-wing-left {
  0%,2%,14%,100% { transform: rotate(0deg) scaleY(1); }
  5% { transform: rotate(24deg) translateY(2px) scaleY(.68); }
  8% { transform: rotate(-11deg) translateY(-2px) scaleY(1.08); }
  11% { transform: rotate(18deg) translateY(1px) scaleY(.76); }
}

@keyframes yuma-guide-wing-right {
  0%,2%,14%,100% { transform: rotate(0deg) scaleY(1); }
  5% { transform: rotate(-24deg) translateY(2px) scaleY(.68); }
  8% { transform: rotate(11deg) translateY(-2px) scaleY(1.08); }
  11% { transform: rotate(-18deg) translateY(1px) scaleY(.76); }
}

@keyframes yuma-guide-wing-left-engaged { 0%,100% { transform: rotate(0); } 25% { transform: rotate(26deg) scaleY(.65); } 50% { transform: rotate(-12deg) scaleY(1.08); } 75% { transform: rotate(20deg) scaleY(.72); } }
@keyframes yuma-guide-wing-right-engaged { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-26deg) scaleY(.65); } 50% { transform: rotate(12deg) scaleY(1.08); } 75% { transform: rotate(-20deg) scaleY(.72); } }

@keyframes yuma-guide-head { 0%,38%,52%,100% { transform: rotate(0); } 42% { transform: rotate(-6deg) translate(-1px,1px); } 47% { transform: rotate(3deg); } }
@keyframes yuma-guide-blink { 0%,43%,47%,100% { opacity: 0; transform: rotate(var(--yuma-blink-angle)) scaleY(.08); } 44.4%,45.7% { opacity: .96; transform: rotate(var(--yuma-blink-angle)) scaleY(1); } }
@keyframes yuma-guide-greeting { 0%,8%,100% { transform: rotate(0); } 2% { transform: rotate(-2deg) translateY(-1px); } 4% { transform: rotate(2deg) translateY(-2px); } 6% { transform: rotate(-1deg); } }

@media (max-width: 640px) {
  .yuma-guide { right: 10px; bottom: max(16px,env(safe-area-inset-bottom)); width: 68px; height: 64px; }
  .yuma-guide__bird-button { width: 68px; height: 60px; }
  .yuma-guide__welcome,
  .yuma-guide__menu { right: 2px; bottom: 70px; width: min(366px,calc(100vw - 40px)); }
  .yuma-guide__welcome { grid-template-columns: 60px minmax(0,1fr); gap: 9px; padding: 11px 38px 11px 11px; font-size: .83rem; }
  .yuma-guide__portrait-button { width: 60px; height: 60px; border-radius: 18px 18px 7px 18px; }
  .yuma-guide__menu { max-height: min(650px,calc(100vh - 94px)); }
  .yuma-guide__body { max-height: calc(min(650px,100vh - 94px) - 74px); padding: 12px; }
  .yuma-guide__questions { grid-template-columns: 1fr; gap: 5px; }
  .yuma-guide__question { min-height: 38px; padding: 7px 9px; font-size: .76rem; }
}

@media (prefers-reduced-motion: reduce) {
  .yuma-guide,
  .yuma-guide__bird-stage,
  .yuma-guide__wing-left,
  .yuma-guide__wing-right,
  .yuma-guide__head,
  .yuma-guide__eyelid,
  .yuma-guide__portrait-button { animation: none !important; }
  .yuma-guide__eyelid { display: none; }
  .yuma-guide__welcome,
  .yuma-guide__menu { transition: none !important; }
}

@media print { .yuma-guide { display: none !important; } }
