#oml2d-stage{
  position:fixed !important;
  z-index:75 !important;
  filter:drop-shadow(0 12px 18px rgba(15,23,42,.16));
  transform-origin:50% 100%;
  right:0 !important;
  bottom:0 !important;
}
#oml2d-stage:hover{
  filter:drop-shadow(0 16px 22px rgba(15,23,42,.22));
}
html[data-theme="dark"] #oml2d-stage{
  filter:drop-shadow(0 10px 18px rgba(0,0,0,.42));
}
#oml2d-stage.pet-off{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}
#oml2d-canvas{
  z-index:1 !important;
}
#oml2d-tips{
  z-index:10 !important;
  left:-76px !important;
  right:auto !important;
  top:28% !important;
  bottom:auto !important;
  width:190px !important;
  max-width:min(190px,52vw) !important;
  min-height:auto !important;
  border-radius:12px !important;
  border:1px solid var(--line) !important;
  background:var(--card) !important;
  color:var(--text) !important;
  font-size:13px !important;
  line-height:1.5 !important;
  box-shadow:var(--shadow-lg) !important;
}
#oml2d-tips::after{
  content:'';
  position:absolute;
  right:-8px;
  top:50%;
  width:0;
  height:0;
  border-top:7px solid transparent;
  border-bottom:7px solid transparent;
  border-left:8px solid var(--card);
  transform:translateY(-50%);
}
#oml2d-tips-content{
  color:var(--text) !important;
  font-weight:600;
  padding:4px 2px;
}
@media (max-width:700px){
  #oml2d-stage{
    transform-origin:100% 100%;
  }
}

#oml2d-stage[data-mood="happy"]{
  filter:drop-shadow(0 0 18px rgba(31,138,98,.42));
}
#oml2d-stage[data-mood="proud"]{
  filter:drop-shadow(0 0 20px rgba(31,138,98,.55));
}
#oml2d-stage[data-mood="encouraged"]{
  filter:drop-shadow(0 0 18px rgba(195,58,50,.32));
}
#oml2d-stage[data-mood="careful"]{
  filter:drop-shadow(0 0 16px rgba(82,96,113,.34));
}
#oml2d-stage[data-mood="curious"]{
  filter:drop-shadow(0 0 18px rgba(53,111,229,.42));
}
#oml2d-stage[data-mood="urgent"]{
  filter:drop-shadow(0 0 20px rgba(195,58,50,.46));
}

.pet-chat{
  position:fixed;
  z-index:78;
  width:min(330px,calc(100vw - 24px));
  max-height:min(440px,calc(100vh - 70px));
  display:flex;
  flex-direction:column;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:var(--shadow-lg);
  overflow:hidden;
  font-size:13px;
}
.pet-chat[hidden]{
  display:none;
}
.pet-chat-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 10px 9px 14px;
  border-bottom:1px solid var(--line);
  background:var(--accent-weak);
}
.pet-chat-status{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
  font-weight:700;
  color:var(--accent);
}
.pet-chat-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex:none;
}
.pet-icon-btn{
  width:26px;
  height:26px;
  padding:0;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--card);
  color:var(--muted);
  font-size:12px;
  line-height:1;
}
.pet-icon-btn:hover{
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-weak);
}
.pet-chat-quick{
  display:flex;
  gap:6px;
  padding:8px 10px;
  overflow-x:auto;
  border-bottom:1px solid var(--line);
  scrollbar-width:thin;
}
.pet-quick-btn{
  flex:0 0 auto;
  min-height:28px;
  padding:4px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--card);
  color:var(--text);
  font-size:12px;
  white-space:nowrap;
}
.pet-quick-btn:hover{
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-weak);
}
.pet-chat-messages{
  flex:1;
  min-height:180px;
  max-height:260px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:10px;
  overscroll-behavior:contain;
  scrollbar-width:thin;
}
.pet-msg{
  display:flex;
  max-width:88%;
}
.pet-msg-user{
  align-self:flex-end;
}
.pet-msg-ai{
  align-self:flex-start;
}
.pet-msg-bubble{
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
  white-space:pre-wrap;
  word-break:break-word;
}
.pet-msg-user .pet-msg-bubble{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}
.pet-msg-loading .pet-msg-bubble{
  color:var(--muted);
  font-style:italic;
}
.pet-msg-time{
  display:block;
  margin-top:3px;
  font-size:10px;
  color:var(--muted);
}
.pet-msg-actions{
  display:flex;
  gap:4px;
  margin-top:4px;
  opacity:0;
  transition:opacity .12s;
}
.pet-msg:hover .pet-msg-actions{
  opacity:1;
}
.pet-msg-action{
  padding:2px 6px;
  border:1px solid var(--line);
  border-radius:5px;
  background:var(--card);
  color:var(--muted);
  font-size:10px;
  line-height:1.4;
}
.pet-msg-action:hover{
  border-color:var(--accent);
  color:var(--accent);
}
@media (max-width:700px){
  .pet-msg-actions{
    opacity:1;
  }
}
.pet-chat-form{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px;
  border-top:1px solid var(--line);
}
.pet-chat-form input{
  flex:1;
  min-width:0;
  min-height:34px;
  padding:0 10px;
  border:1px solid var(--line);
  border-radius:var(--radius-control);
  background:var(--bg);
  color:var(--text);
  font-size:13px;
  outline:none;
}
.pet-chat-form input:focus{
  border-color:var(--accent);
  background:var(--card);
}
@media (max-width:700px){
  .pet-chat{
    width:calc(100vw - 24px);
    max-height:min(420px,calc(100vh - 70px));
  }
}
