.eng-study-pet {
    position: fixed;
    z-index: 880;
    right: 22px;
    bottom: 16px;
    display: grid;
    justify-items: center;
    width: 270px;
    font-family: inherit;
    user-select: none;
}

.eng-study-pet[hidden],
.eng-study-pet [hidden] {
    display: none !important;
}
.eng-study-pet.is-hidden .eng-study-pet-bubble,
.eng-study-pet.is-hidden .eng-study-pet-mascot { display: none; }
/* Hidden-pet geometry is shared in study-pet-peek.css. */

.eng-study-pet-mascot {
    position: relative;
    display: grid;
    place-items: center;
    width: 118px;
    height: 118px;
    margin: -2px 0 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    filter: drop-shadow(0 9px 9px rgba(24, 37, 62, 0.18));
    cursor: grab;
    touch-action: none;
}

.eng-study-pet-mascot:active { cursor: grabbing; }
.eng-study-pet-mascot:focus-visible {
    outline: 3px solid rgba(232, 135, 76, 0.42);
    outline-offset: 2px;
    border-radius: 45%;
}
.eng-study-pet-mascot img {
    display: block;
    width: 118px;
    height: 118px;
    object-fit: contain;
    pointer-events: none;
    transform-origin: 50% 72%;
    animation: eng-study-pet-float 3.2s ease-in-out infinite;
}

.eng-study-pet-princess-blink {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}
.eng-study-pet[data-pet="princess"][data-expression="normal"] .eng-study-pet-mascot img {
    animation: none;
    transform: none;
}
.eng-study-pet[data-pet="princess"][data-expression="normal"].is-princess-blinking:not(.is-authored-motion) .eng-study-pet-princess-blink {
    animation: eng-princess-eye-blink 1s steps(1, end) 1;
}
@keyframes eng-princess-eye-blink {
    0%, 24%, 39%, 64%, 79%, 100% { opacity: 0; }
    25%, 38%, 65%, 78% { opacity: 1; }
}

.eng-study-pet-bubble {
    position: relative;
    width: max-content;
    min-width: 178px;
    max-width: min(290px, calc(100vw - 24px));
    padding: 8px 9px;
    border: 1px solid #efb083;
    border-radius: 17px 17px 17px 5px;
    background: rgba(255, 253, 250, 0.98);
    color: #703b24;
    box-shadow: 0 9px 24px rgba(80, 47, 29, 0.14);
    transform-origin: 76% bottom;
    animation: eng-study-pet-bubble-in 0.2s ease-out;
}
.eng-study-pet-bubble::after {
    position: absolute;
    right: 42px;
    bottom: -8px;
    width: 14px;
    height: 14px;
    border-right: 1px solid #efb083;
    border-bottom: 1px solid #efb083;
    background: #fffdfa;
    content: "";
    transform: rotate(45deg);
}
.eng-study-pet-bubble.is-expanded { width: min(270px, calc(100vw - 24px)); }
.eng-study-pet-bubble.is-attendance,
.eng-study-pet-bubble.is-saved-files {
    min-height: 142px;
    padding: 12px;
}
.eng-study-pet-bubble-head {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 25px;
    align-items: center;
    gap: 2px;
}
.eng-study-pet-prompt,
.eng-study-pet-more {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.eng-study-pet-prompt {
    min-height: 28px;
    padding: 2px 4px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 850;
    line-height: 1.35;
    text-align: left;
}
.eng-study-pet-more {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    padding: 0;
    border-radius: 50%;
    color: #a46a4a;
    font-size: 15px;
    line-height: 1;
}
.eng-study-pet-more:hover { background: #fff0e5; color: #7b381d; }

.product-ui-site .account-menu-pet {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.eng-study-pet-search {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 6px;
    overflow: hidden;
    border: 1px solid #e7b18d;
    border-radius: 11px;
    background: #fff;
}
.eng-study-pet-search input {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 6px 9px;
    border: 0;
    outline: 0;
    color: #17233a;
    font: inherit;
    font-size: 12px;
}
.eng-study-pet-search button,
.eng-study-pet-confirm button {
    min-width: 52px;
    border: 0;
    background: #e9874c;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}
.eng-study-pet-search button:disabled { opacity: 0.55; }
.eng-study-pet-confirm {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 7px;
}
.eng-study-pet-bubble.is-attendance .eng-study-pet-confirm,
.eng-study-pet-bubble.is-saved-files .eng-study-pet-confirm {
    margin-bottom: 12px;
}
.eng-study-pet-bubble.is-attendance .eng-study-pet-search,
.eng-study-pet-bubble.is-saved-files .eng-study-pet-search {
    margin-top: 0;
}
.eng-study-pet-confirm button { min-height: 32px; border-radius: 10px; }
.eng-study-pet-confirm button:last-child {
    border: 1px solid #e7b18d;
    background: #fff;
    color: #7b442b;
}
.eng-study-pet-actions {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: 7px;
}
.eng-study-pet-actions a,
.eng-study-pet-actions button {
    display: grid;
    place-items: center;
    min-height: 31px;
    padding: 5px 7px;
    border: 1px solid #f0d3bf;
    border-radius: 9px;
    background: #fff8f2;
    color: #7b442b;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.eng-study-pet.is-reacting .eng-study-pet-mascot img { animation: eng-study-pet-pop 0.38s ease-in-out 2 alternate; }
.eng-study-pet.is-dragging .eng-study-pet-mascot img { animation: eng-study-pet-drag 0.22s ease-in-out infinite alternate; }
.eng-study-pet.is-searching .eng-study-pet-mascot img { animation: eng-study-pet-search 0.3s ease-in-out infinite alternate; }
.eng-study-pet.is-bored .eng-study-pet-mascot img { animation: eng-study-pet-bored 2.8s ease-in-out infinite; }
.eng-study-pet.is-sleeping .eng-study-pet-mascot img { animation: eng-study-pet-sleep 3.8s ease-in-out infinite; }
.eng-study-pet[data-expression="happy"] .eng-study-pet-mascot img { animation: eng-study-pet-pop .7s ease-in-out infinite alternate; }
.eng-study-pet[data-expression="curious"] .eng-study-pet-mascot img { animation: eng-study-pet-curious 1.8s ease-in-out infinite; }
.eng-study-pet[data-expression="focus"] .eng-study-pet-mascot img { animation: eng-study-pet-focus 2.4s ease-in-out infinite; }
.eng-study-pet[data-expression="starry"] .eng-study-pet-mascot img { animation: eng-study-pet-starry 1.7s ease-in-out infinite; }
.eng-study-pet[data-expression="found"] .eng-study-pet-mascot img { animation: eng-study-pet-found 0.48s ease-in-out infinite alternate; }
.eng-study-pet[data-expression="confused"] .eng-study-pet-mascot img { animation: eng-study-pet-confused 1.25s ease-in-out infinite; }
.eng-study-pet[data-expression="pleading"] .eng-study-pet-mascot img { animation: eng-study-pet-pleading 2.2s ease-in-out infinite; }
.eng-study-pet[data-expression="greeting"] .eng-study-pet-mascot img { animation: eng-pet-wave .72s ease-in-out infinite alternate; }
.eng-study-pet[data-expression="thumbsup"] .eng-study-pet-mascot img { animation: eng-pet-thumbsup .68s ease-in-out infinite alternate; }

@keyframes eng-study-pet-float { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(1deg); } }
@keyframes eng-study-pet-pop { from { transform: scale(1) rotate(-3deg); } to { transform: scale(1.09) rotate(4deg); } }
@keyframes eng-study-pet-drag { from { transform: scale(1.03) rotate(-7deg); } to { transform: scale(1.03) rotate(7deg); } }
@keyframes eng-study-pet-search { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes eng-study-pet-bored { 0%,100% { transform: translateY(1px) rotate(-2deg); } 50% { transform: translateY(5px) rotate(2deg); } }
@keyframes eng-study-pet-sleep { 0%,100% { transform: translateY(3px) rotate(-2deg) scale(.98); } 50% { transform: translateY(6px) rotate(1deg) scale(1); } }
@keyframes eng-study-pet-curious { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(2deg); } }
@keyframes eng-study-pet-focus { 0%,100% { transform: translateY(1px) scale(1); } 50% { transform: translateY(-3px) scale(1.025); } }
@keyframes eng-study-pet-starry { 0%,100% { transform: translateY(0) rotate(-1deg) scale(1); } 50% { transform: translateY(-7px) rotate(2deg) scale(1.045); } }
@keyframes eng-study-pet-found { from { transform: translateY(0) scale(1) rotate(-2deg); } to { transform: translateY(-9px) scale(1.06) rotate(3deg); } }
@keyframes eng-study-pet-confused { 0%,100% { transform: translateX(0) rotate(-2deg); } 35% { transform: translateX(-3px) rotate(-4deg); } 70% { transform: translateX(3px) rotate(3deg); } }
@keyframes eng-study-pet-pleading { 0%,100% { transform: translateY(1px) rotate(-1deg) scale(1); } 50% { transform: translateY(-3px) rotate(1deg) scale(1.025); } }
@keyframes eng-study-pet-bubble-in { from { opacity: 0; transform: translateY(7px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes eng-pet-wave { from { transform: translateY(0) rotate(-5deg); } to { transform: translateY(-7px) rotate(6deg) scale(1.04); } }
@keyframes eng-pet-thumbsup { from { transform: translateY(0) scale(1); } to { transform: translateY(-9px) scale(1.08) rotate(2deg); } }

@media (max-width: 640px) {
    .eng-study-pet { right: 8px; bottom: 8px; width: min(260px, calc(100vw - 16px)); }
    .eng-study-pet-mascot,
    .eng-study-pet-mascot img { width: 96px; height: 96px; }
    .eng-study-pet-bubble { min-width: 165px; max-width: min(260px, calc(100vw - 16px)); }
}
@media (prefers-reduced-motion: reduce) {
    .eng-study-pet-princess-blink,
    .eng-study-pet-mascot img,
    .eng-study-pet-bubble { animation: none !important; }
}
