.pet-dialogue-card{--pet-accent:#e9b3a2;display:grid;grid-template-columns:96px minmax(0,1fr);grid-template-rows:auto auto;column-gap:8px;flex:0 0 auto;padding:8px 10px 6px;border-top:1px solid #b5ac7766;background:linear-gradient(120deg,#19382f,#302f29);box-sizing:border-box;color:#fff0d1;min-height:142px}
.pet-dialogue-card[data-species=water],.pet-world-bubble[data-species=water]{--pet-accent:#b4e8f3;background:linear-gradient(120deg,#162e36,#1e3e40)}.pet-dialogue-card[data-species=feather],.pet-world-bubble[data-species=feather]{--pet-accent:#cfe9bc;background:linear-gradient(120deg,#183a31,#344233)}
.pet-dialogue-copy{min-width:0;align-self:center}.pet-dialogue-copy strong{display:block;font-size:14px;line-height:1.3;color:var(--pet-accent);overflow-wrap:anywhere}.pet-dialogue-copy small{display:block;font-size:10px;color:#bccbc3;font-weight:normal;margin-top:3px}.pet-dialogue-copy p{margin:6px 0 0;font:14px/1.5 system-ui,sans-serif!important;min-height:42px;overflow-wrap:anywhere}
.pet-dialogue-tools{grid-column:1/-1;display:flex;justify-content:space-between;gap:8px;align-items:center;margin-top:4px}.pet-dialogue-tools label{display:flex;align-items:center;gap:5px;font-size:11px;color:#c4d3c7}.pet-dialogue-tools select,.pet-dialogue-tools button{background:#123127;color:#ede8cc;border:1px solid #738776;border-radius:6px;font:12px/1.3 system-ui!important;padding:5px!important;min-height:34px!important;height:auto!important}.pet-dialogue-tools select{max-width:110px}.pet-dialogue-tools button{min-width:64px}
.pet-dialogue-tools label{white-space:nowrap}.pet-dialogue-tools select{width:108px;flex-shrink:0}
.pet-emote{position:relative;width:96px;height:96px;align-self:center;background-size:200% 200%;background-repeat:no-repeat;overflow:visible;pointer-events:none}.pet-emote canvas{width:100%;height:100%;display:block;image-rendering:auto!important;opacity:0}.pet-emote.emote-ready{background-image:none!important}.pet-emote.emote-ready canvas{opacity:1}.pet-emote-fx{position:absolute;right:3px;top:13px;font:20px/1 system-ui;font-style:normal;color:#ff93aa;text-shadow:0 0 6px #e6758c66;animation:pet-heart 2.6s ease-in-out infinite;pointer-events:none}.pet-emote[data-effect=spark] .pet-emote-fx{color:#ffe4a0;animation:pet-spark 2s ease-in-out infinite}.pet-emote[data-effect=puff] .pet-emote-fx{color:#dcf0ff;animation:pet-puff 2.8s ease-out infinite}.pet-emote[data-effect=flame] .pet-emote-fx{color:#ffbd63;animation:pet-flame 1.1s ease-in-out infinite}.pet-emote[data-effect=tear] .pet-emote-fx{color:#8bcdf0;font-size:10px;right:23%;top:55%;animation:pet-tear 2.8s ease-in infinite}.pet-emote[data-effect=sleep] .pet-emote-fx{color:#e5eac7;font-size:17px;animation:pet-sleep 3s ease-out infinite}.pet-emote-paused .pet-emote-fx{animation-play-state:paused}
@keyframes pet-heart{0%,100%{transform:translateY(3px) scale(.8);opacity:.5}50%{transform:translateY(-5px) scale(1.1);opacity:1}}@keyframes pet-spark{0%,100%{transform:scale(.6) rotate(-12deg);opacity:.3}50%{transform:scale(1.1) rotate(12deg);opacity:1}}@keyframes pet-puff{0%{opacity:0;transform:translate(-4px,2px) scale(.4)}35%{opacity:.9}100%{opacity:0;transform:translate(6px,-5px) scale(1)}}@keyframes pet-flame{50%{transform:translateY(-3px) rotate(8deg) scale(.9)}}@keyframes pet-tear{0%,30%{opacity:0;transform:translateY(0) scaleX(.7)}45%{opacity:1}100%{opacity:0;transform:translateY(15px) scaleX(.7)}}@keyframes pet-sleep{0%{opacity:0;transform:translate(0,4px) scale(.6)}40%{opacity:.9}100%{opacity:0;transform:translate(6px,-8px) scale(1.1)}}
.pet-world-bubble{--pet-accent:#e9b3a2;position:fixed;z-index:18;pointer-events:none;display:flex;align-items:center;gap:4px;width:176px;min-height:62px;padding:5px 7px;border:1px solid var(--pet-accent);border-radius:15px;background:linear-gradient(120deg,#382b30,#22382f);box-shadow:0 3px 10px #071c2266;box-sizing:border-box;color:#fff0d1;animation:pet-bubble-in .16s ease-out}.pet-world-bubble span{font:12px/1.45 system-ui,sans-serif;overflow-wrap:anywhere;min-width:0;max-width:118px}.pet-world-bubble .pet-emote{width:44px;height:44px;flex:0 0 44px}.pet-world-bubble .pet-emote-fx{font-size:12px;right:1px;top:4px}.pet-world-bubble.emote-only{width:60px;min-height:60px;padding:7px}.pet-world-bubble.emote-only .pet-emote{width:44px;height:44px}.pet-rename{font-size:12px;margin-top:8px}.pet-rename summary{cursor:pointer;color:#e8daa7;min-height:30px}.pet-rename input{width:100%;box-sizing:border-box;background:#153b30;color:#fff2cf;border:1px solid #78947c;padding:7px;font:14px system-ui;min-height:38px;margin-top:4px}.pet-rename button{width:100%;margin-top:5px}.pet-rename label{display:block;color:#becbbf}
@keyframes pet-bubble-in{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:350px){.pet-dialogue-card{grid-template-columns:80px minmax(0,1fr);padding:6px 8px;min-height:134px}.pet-dialogue-card .pet-emote{width:80px;height:80px}.pet-dialogue-copy p{font-size:13px!important}.pet-dialogue-tools label{font-size:10px}}
@media(prefers-reduced-motion:reduce){.pet-emote-fx,.pet-world-bubble{animation:none!important}}

/* Compact companion strip: action shares the name row, leaving the dialogue unobstructed. */
#modal[data-view="灵宠"] .pet-dialogue-card{grid-template-columns:68px minmax(0,1fr);grid-template-rows:1fr;min-height:98px;gap:8px;padding:8px 10px;border-radius:10px;margin:0 6px 4px;align-items:center;background:linear-gradient(115deg,#203c32,#283c32);border:1px solid #80916b60}
#modal[data-view="灵宠"] .pet-dialogue-card .pet-emote{width:68px;height:68px}
.pet-dialogue-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;min-width:0}.pet-dialogue-heading strong{font-size:13px;min-width:0;overflow-wrap:anywhere}
#modal[data-view="灵宠"] .pet-dialogue-heading button{flex:0 0 auto;min-height:36px!important;height:auto!important;padding:5px 8px!important;min-width:60px;font:12px/1.2 system-ui!important;background:#36513d;border:1px solid #95a475;border-radius:14px;color:#f0e2b1;white-space:nowrap;touch-action:manipulation}
.pet-personality-label{display:block;font-size:10px;color:#aabeb0;line-height:1.3}.pet-dialogue-copy p{font-size:13px!important;line-height:1.45!important;min-height:36px;margin-top:5px}
@media(max-width:350px){#modal[data-view="灵宠"] .pet-dialogue-card{grid-template-columns:56px minmax(0,1fr);padding:7px;gap:6px;min-height:94px}#modal[data-view="灵宠"] .pet-dialogue-card .pet-emote{width:56px;height:56px}.pet-dialogue-heading strong{font-size:12px}#modal[data-view="灵宠"] .pet-dialogue-heading button{font-size:11px!important;padding:4px 6px!important;min-width:54px}}

/* 108: two compact rows; keep the action on the name row and all dialogue visible. */
#modal[data-view="灵宠"] .pet-dialogue-card{grid-template-columns:52px minmax(0,1fr);min-height:76px;padding:5px 8px;gap:7px;margin:0 6px 3px}
#modal[data-view="灵宠"] .pet-dialogue-card .pet-emote{width:52px;height:52px}
#modal[data-view="灵宠"] .pet-dialogue-card .pet-personality-label{display:none}
#modal[data-view="灵宠"] .pet-dialogue-heading button{min-height:32px!important;padding:3px 8px!important;min-width:60px}
#modal[data-view="灵宠"] .pet-dialogue-copy p{min-height:0;margin:2px 0 0;font-size:12px!important;line-height:1.4!important}
#modal[data-view="灵宠"] .pet-dialogue-heading strong{font-size:13px}
@media(max-width:350px){#modal[data-view="灵宠"] .pet-dialogue-card{grid-template-columns:44px minmax(0,1fr);gap:5px;padding:5px 6px}#modal[data-view="灵宠"] .pet-dialogue-card .pet-emote{width:44px;height:44px}#modal[data-view="灵宠"] .pet-dialogue-heading strong{font-size:12px}#modal[data-view="灵宠"] .pet-dialogue-heading button{min-width:54px}}
.pet-world-bubble.compact{width:148px;min-height:54px}.pet-world-bubble.compact .pet-emote{width:36px;height:36px;flex-basis:36px}
