/* Messenger-style chat toasts + badge helpers */
.chat-toast-host{
  position:fixed;z-index:12000;right:16px;bottom:96px;
  display:flex;flex-direction:column;gap:10px;
  width:min(360px,calc(100vw - 24px));
  pointer-events:none
}
.chat-toast{
  pointer-events:auto;
  display:grid;grid-template-columns:40px 1fr auto;gap:10px;align-items:start;
  padding:12px 14px;border-radius:16px;
  background:color-mix(in srgb,#1a1208 92%,#000);
  border:1px solid color-mix(in srgb,#f6c85a 45%,transparent);
  color:#fff8e8;
  box-shadow:0 12px 32px rgba(0,0,0,.35);
  animation:chat-toast-in .28s ease-out;
  cursor:pointer
}
.chat-toast.is-out{animation:chat-toast-out .22s ease-in forwards}
.chat-toast__avatar{
  width:40px;height:40px;border-radius:50%;
  display:grid;place-items:center;font-weight:800;font-size:.85rem;
  background:linear-gradient(145deg,#f6c85a,#c98a1a);color:#1a1208
}
.chat-toast__meta{min-width:0}
.chat-toast__channel{
  font-size:.68rem;text-transform:uppercase;letter-spacing:.04em;opacity:.7;margin:0 0 2px
}
.chat-toast__name{font-weight:800;margin:0;font-size:.95rem}
.chat-toast__body{
  margin:2px 0 0;font-size:.86rem;opacity:.9;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden
}
.chat-toast__close{
  border:0;background:transparent;color:inherit;opacity:.6;cursor:pointer;
  font-size:1.1rem;line-height:1;padding:0 2px
}
.chat-toast__close:hover{opacity:1}
@keyframes chat-toast-in{
  from{opacity:0;transform:translateY(12px) scale(.96)}
  to{opacity:1;transform:none}
}
@keyframes chat-toast-out{
  to{opacity:0;transform:translateY(8px) scale(.96)}
}
.chat-notify-perm{
  position:fixed;z-index:11900;left:50%;bottom:24px;transform:translateX(-50%);
  width:min(420px,calc(100vw - 24px));
  display:grid;gap:8px;padding:14px 16px;border-radius:16px;
  background:#1e1510;border:1px solid #f6c85a66;color:#fff8e8;
  box-shadow:0 10px 28px rgba(0,0,0,.3)
}
.chat-notify-perm p{margin:0;font-size:.9rem}
.chat-notify-perm__actions{display:flex;flex-wrap:wrap;gap:8px}
.chat-notify-perm button{cursor:pointer}
.chat-fab.has-unread .chat-unread,
.chat-tab-unread,
.nav-chat-badge,
.agent-inbox-chip .chat-unread{
  display:inline-grid;place-items:center;
  min-width:1.15rem;height:1.15rem;padding:0 4px;
  border-radius:999px;background:#ef4444;color:#fff;
  font-size:.68rem;font-weight:800;line-height:1
}
.nav-chat-badge{
  margin-left:6px;vertical-align:middle
}
.nav-chat-badge:empty,
.nav-chat-badge[data-count="0"]{display:none}
@media (max-width:640px){
  .chat-toast-host{right:10px;left:10px;width:auto;bottom:88px}
}

/* ===== CSS-ONLY permanent float lock (no JS position logic) ===== */
.floating-container,
#matka-float-stack.floating-container{
  position: fixed !important;
  bottom: 20px !important;
  right: 15px !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
  z-index: 2147483647 !important;
  width: 72px !important;
  height: 120px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  display: block !important;
  overflow: visible !important;
  pointer-events: none !important;
  -webkit-transform: none !important;
  translate: none !important;
}

/* Absolute slots inside the frozen shell — show/hide of scroll-top cannot move CHAT */
.floating-container .chat-dock,
#matka-float-stack.floating-container .chat-dock,
body.theme-home .floating-container .chat-dock{
  position: absolute !important;
  bottom: 0 !important;
  right: 0 !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
  margin: 0 !important;
  pointer-events: auto !important;
  z-index: 2 !important;
}
.floating-container .scroll-top-btn,
.floating-container .scroll-top-btn[data-v-40ed4f7e],
#matka-float-stack.floating-container .scroll-top-btn{
  position: absolute !important;
  bottom: 70px !important;
  right: 8px !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
  margin: 0 !important;
  pointer-events: auto !important;
  z-index: 1 !important;
}

/* Kill fab ping / hover motion that looked like bouncing */
.chat-fab,
#floating-chat-btn,
.chat-widget-button,
.chat-fab.ping,
.chat-fab.has-unread,
.chat-fab:hover,
.chat-fab:focus,
.chat-fab:active,
.scroll-top-btn svg{
  animation: none !important;
  transition: none !important;
  transform: none !important;
  -webkit-transform: none !important;
}
.chat-fab,
#floating-chat-btn,
.chat-widget-button{
  position: relative !important;
  box-shadow: 0 10px 22px #d977065c, inset 0 1px #ffffff8c !important;
}
.chat-fab.has-unread{
  box-shadow: 0 10px 22px #d977065c, 0 0 0 3px #9b2c2c2e !important;
}

/* Fallback if Vue has not been adopted yet — still CSS-only fixed pins */
.chat-dock{
  position: fixed !important;
  bottom: 20px !important;
  right: 15px !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}
.floating-container .chat-dock{
  position: absolute !important;
  bottom: 0 !important;
  right: 0 !important;
}
.scroll-top-btn,
.scroll-top-btn[data-v-40ed4f7e]{
  position: fixed !important;
  bottom: 90px !important;
  right: 15px !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  transition: none !important;
  animation: none !important;
  z-index: 85 !important;
}
.floating-container .scroll-top-btn,
.floating-container .scroll-top-btn[data-v-40ed4f7e]{
  position: absolute !important;
  bottom: 70px !important;
  right: 8px !important;
}

@media (max-width: 768px){
  .floating-container,
  #matka-float-stack.floating-container{
    position: fixed !important;
    bottom: 20px !important;
    right: 15px !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
    z-index: 2147483647 !important;
  }
  .chat-panel{
    max-height: min(70dvh, 620px) !important;
    width: min(420px, calc(100vw - 24px)) !important;
    overflow: hidden !important;
  }
  .chat-panel .chat-log{
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
@media (prefers-reduced-motion: reduce){
  .floating-container,
  .chat-dock,
  .chat-fab,
  .scroll-top-btn{
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
