#nyu-pet-root {
  --pet-gold: #dac5a2;
  --pet-black: #0a0a0a;
  --pet-white: #f5f5f3;
  font-family: Arial, Helvetica, sans-serif;
  position: relative;
  z-index: 2147483000;
}

.nyu-pet {
  position: fixed;
  width: 132px;
  height: 132px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  user-select: none;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .28));
  isolation: isolate;
  z-index: 3;
}

.nyu-pet::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(218, 197, 162, .44);
  box-shadow: 0 0 26px rgba(218, 197, 162, .34);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.28);
  transform-origin: center;
  filter: blur(1px);
  pointer-events: none;
  will-change: transform, opacity, filter;
  z-index: -1;
}

#nyu-pet-root:not(.is-chat-open) .nyu-pet::before {
  animation: nyu-pet-attention-pulse 2.7s cubic-bezier(.16, .66, .34, 1) infinite;
}

#nyu-pet-root.is-chat-open .nyu-pet::before {
  animation: none;
  opacity: 0;
}

.nyu-pet:active { cursor: grabbing; }
.nyu-pet:focus-visible { outline: 2px solid var(--pet-gold); outline-offset: 4px; border-radius: 22px; }
.nyu-pet img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; image-rendering: pixelated; transform-origin: 50% 52%; opacity: 1; transition: opacity .09s linear, transform .09s ease; z-index: 1; }
.nyu-pet.is-changing img { opacity: .25; transform: scale(.97); }
.nyu-pet[data-state="phone"] img { animation: nyu-pet-phone 1.1s steps(2, end) infinite; }
.nyu-pet[data-state="fly"][data-direction="up-left"] img { transform: rotate(-12deg) translateY(-3px); }
.nyu-pet[data-state="fly"][data-direction="up"] img { transform: translateY(-6px); }
.nyu-pet[data-state="fly"][data-direction="up-right"] img { transform: rotate(12deg) translateY(-3px); }
.nyu-pet[data-state="fly"][data-direction="down-left"] img { transform: rotate(10deg) translateY(5px); }
.nyu-pet[data-state="fly"][data-direction="down"] img { transform: translateY(7px) scale(.98); }
.nyu-pet[data-state="fly"][data-direction="down-right"] img { transform: rotate(-10deg) translateY(5px); }

.nyu-pet-tip {
  position: fixed;
  max-width: 285px;
  padding: 14px 17px;
  border-radius: 18px 18px 5px 18px;
  color: #151515;
  background: var(--pet-white);
  box-shadow: 0 14px 45px rgba(0, 0, 0, .24);
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 2;
}
.nyu-pet-tip.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; cursor: pointer; }
.nyu-pet-tip strong { display: block; margin-bottom: 4px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }

.nyu-pet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.nyu-pet-chat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(390px, calc(100vw - 36px));
  height: min(680px, calc(100dvh - 36px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  color: #141414;
  background: #ececea;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 28px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .42);
  opacity: 0;
  transform: translateY(18px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
#nyu-pet-root.is-chat-open .nyu-pet-backdrop { opacity: 1; pointer-events: auto; }
#nyu-pet-root.is-chat-open .nyu-pet-chat { opacity: 1; transform: none; pointer-events: auto; }

.nyu-pet-chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; color: white; background: #171719; }
.nyu-pet-chat__avatar { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.nyu-pet-chat__title { flex: 1; }
.nyu-pet-chat__title strong, .nyu-pet-chat__title span { display: block; }
.nyu-pet-chat__title span { margin-top: 2px; color: #aaa9ad; font-size: 12px; }
.nyu-pet-chat__close { width: 38px; height: 38px; border: 1px solid #49494d; border-radius: 50%; color: white; background: transparent; font-size: 24px; cursor: pointer; }
.nyu-pet-messages { overflow: auto; padding: 18px 14px 10px; scroll-behavior: smooth; }
.nyu-pet-message { width: fit-content; max-width: 86%; margin: 0 0 9px; padding: 11px 13px; border-radius: 17px 17px 17px 5px; background: white; font-size: 14px; line-height: 1.42; white-space: pre-wrap; }
.nyu-pet-message--user { margin-left: auto; border-radius: 17px 17px 5px 17px; background: var(--pet-gold); }
.nyu-pet-quick { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 4px; }
.nyu-pet-quick button, .nyu-pet-quick a { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 8px 11px; border: 1px solid #b7b7b2; border-radius: 999px; color: #1d1d1d; background: transparent; cursor: pointer; font: inherit; font-size: 12px; line-height: 1.2; text-decoration: none; }
.nyu-pet-quick a[data-primary] { color: white; background: #171719; border-color: #171719; }
.nyu-pet-lead { margin-top: 12px; padding: 13px; border-radius: 16px; background: white; }
.nyu-pet-lead label { display: block; margin-bottom: 9px; font-size: 12px; color: #666; }
.nyu-pet-lead input { box-sizing: border-box; width: 100%; margin-top: 5px; padding: 10px 11px; border: 1px solid #cececa; border-radius: 10px; font: inherit; }
.nyu-pet-lead button { width: 100%; padding: 11px; border: 0; border-radius: 999px; background: #171719; color: white; cursor: pointer; font-weight: 700; }
.nyu-pet-lead small { display: block; margin-top: 8px; color: #777; line-height: 1.3; }
.nyu-pet-composer { display: grid; grid-template-columns: 1fr 46px; gap: 8px; padding: 11px; background: white; border-top: 1px solid #d7d7d3; }
.nyu-pet-composer input { min-width: 0; padding: 12px 14px; border: 1px solid #d0d0cc; border-radius: 999px; font: inherit; }
.nyu-pet-composer button { border: 0; border-radius: 50%; color: #161616; background: var(--pet-gold); font-size: 20px; cursor: pointer; }

@keyframes nyu-pet-phone { 50% { transform: rotate(1.5deg) translateY(1px); } }

@keyframes nyu-pet-attention-pulse {
  0% {
    opacity: .56;
    transform: translate(-50%, -50%) scale(.28);
    filter: blur(1px);
  }
  58% {
    opacity: .24;
    filter: blur(9px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.15);
    filter: blur(24px);
  }
}

@media (max-width: 640px) {
  .nyu-pet { width: 94px; height: 94px; }
  .nyu-pet-chat { inset: auto 0 0; width: 100%; height: min(82dvh, 690px); border-radius: 24px 24px 0 0; }
  .nyu-pet-tip { max-width: min(255px, calc(100vw - 120px)); font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .nyu-pet *, .nyu-pet-chat, .nyu-pet-backdrop, .nyu-pet-tip { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .nyu-pet::before { animation: none !important; opacity: 0 !important; }
}
