.gmchat-fab{
  position:fixed;
  right:16px;
  bottom:calc(env(safe-area-inset-bottom, 0px) + 16px);
  width:62px;
  height:62px;
  padding:6px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,.3);
  background:#000;
  box-shadow:0 16px 34px rgba(0,0,0,.32);
  overflow:hidden;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:170;
}
.gmchat-fab img{
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center;
  display:block;
}

.gmchat-win{
  position:fixed;
  right:16px;
  bottom:calc(env(safe-area-inset-bottom, 0px) + var(--gmchat-open-bottom, 90px));
  width:min(390px, calc(100vw - 24px));
  height:min(520px, 72vh);
  background:linear-gradient(180deg, #1a1112 0%, #100c0d 100%);
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  box-shadow:0 22px 52px rgba(0,0,0,.42);
  display:none;
  flex-direction:column;
  overflow:hidden;
  z-index:170;
}
.gmchat-win.open{ display:flex; }
.gmchat-win.keyboard{
  --gmchat-open-bottom: 8px;
}

body.gmchat-page-lock{
  overscroll-behavior:none;
  touch-action:manipulation;
}

.gmchat-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px;
  border-bottom:1px solid rgba(255,255,255,.12);
  color:#fff;
  background:linear-gradient(135deg, rgba(201,39,36,.34), rgba(0,0,0,.2));
}
.gmchat-title{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.gmchat-title img{
  width:34px;
  height:34px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.24);
}
.gmchat-meta{
  display:flex;
  flex-direction:column;
  min-width:0;
  line-height:1.1;
}
.gmchat-meta b{
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.gmchat-meta span{ color:#d7c9ca; font-size:12px; }

.gmchat-actions{ display:flex; gap:8px; }
.gmchat-btn{
  border:1px solid rgba(255,255,255,.2);
  background:rgba(255,255,255,.08);
  color:#fff;
  border-radius:10px;
  padding:8px 10px;
  cursor:pointer;
  font-size:12px;
}
.gmchat-btn:hover{ background:rgba(255,255,255,.14); }

.gmchat-body{
  flex:1;
  overflow:auto;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  color:#fff;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.gmchat-msg{
  max-width:86%;
  padding:10px 12px;
  border-radius:13px;
  border:1px solid rgba(255,255,255,.16);
  white-space:pre-wrap;
  word-break:break-word;
  font-size:14px;
  line-height:1.35;
}
.gmchat-msg.user{
  margin-left:auto;
  background:rgba(201,39,36,.26);
  border-color:rgba(201,39,36,.42);
}
.gmchat-msg.bot{
  margin-right:auto;
  background:rgba(255,255,255,.08);
}

.gmchat-typing{ display:inline-flex; gap:6px; align-items:center; }
.gmchat-dot{
  width:6px;
  height:6px;
  border-radius:999px;
  background:#d4c9ca;
  opacity:.6;
  animation:gmchat-bounce 1s infinite ease-in-out;
}
.gmchat-dot:nth-child(2){ animation-delay:.15s; }
.gmchat-dot:nth-child(3){ animation-delay:.3s; }
@keyframes gmchat-bounce{
  0%,80%,100%{ transform:translateY(0); opacity:.5; }
  40%{ transform:translateY(-4px); opacity:1; }
}

.gmchat-hint{
  color:#d5c9ca;
  font-size:11px;
  padding:0 12px 8px;
}

.gmchat-foot{
  border-top:1px solid rgba(255,255,255,.12);
  padding:10px;
  display:flex;
  gap:8px;
  align-items:center;
  background:rgba(0,0,0,.18);
}
.gmchat-input{
  flex:1;
  resize:none;
  height:40px;
  max-height:120px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.24);
  background:rgba(255,255,255,.08);
  color:#fff;
  padding:10px 12px;
  outline:none;
  font-size:16px;
  line-height:1.3;
  overscroll-behavior:contain;
}
.gmchat-send{
  border:none;
  background:linear-gradient(135deg, #c92724, #9b1d1b);
  color:#fff;
  border-radius:12px;
  padding:10px 12px;
  font-weight:800;
  cursor:pointer;
}
.gmchat-send:disabled{ opacity:.62; cursor:not-allowed; }

@media (max-width: 560px){
  .gmchat-fab{
    right:12px;
    width:58px;
    height:58px;
  }
  .gmchat-win{
    right:12px;
    width:calc(100vw - 24px);
    height:min(72vh, 520px);
    bottom:calc(env(safe-area-inset-bottom, 0px) + var(--gmchat-open-bottom, 82px));
  }
}
