.live-chat[hidden],
.live-chat-launch[hidden],
.live-chat-panel[hidden],
.live-chat-gate[hidden],
.live-chat-room[hidden],
.live-chat-error[hidden],
.live-chat-status[hidden] {
  display: none !important;
}

.live-chat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  font-family: "Noto Sans Bengali", sans-serif;
  max-width: calc(100vw - 16px);
}

.live-chat.is-open {
  inset: auto 18px 18px auto;
}

.live-chat-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: #145c3a;
  color: #fff;
  border-radius: 999px;
  padding: 7px 12px 7px 7px;
  box-shadow: 0 8px 20px rgba(16, 40, 28, 0.2);
  cursor: pointer;
}

.live-chat-launch-copy {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.live-chat-launch-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #17824a;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.live-chat-panel {
  position: relative;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 36px));
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 22px 48px rgba(16, 40, 28, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(20, 92, 58, 0.12);
}

.live-chat-head {
  background: linear-gradient(135deg, #145c3a, #17824a);
  color: #fff;
  padding: 14px 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.live-chat-head h2 {
  margin: 0;
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.live-chat-head p {
  margin: 6px 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  opacity: 0.92;
}

.live-chat-close {
  border: 0;
  background: rgba(255,255,255,0.16);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.live-chat-close-label {
  display: none;
}

.live-chat-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f4faf6;
}

.live-chat-gate {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.live-chat-gate label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
  color: #145c3a;
}

.live-chat-gate input {
  border: 1px solid rgba(20, 92, 58, 0.16);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
}

.live-chat-error {
  color: #9a3b32;
  font-weight: 700;
  font-size: 0.88rem;
  margin: 0;
}

.live-chat-submit {
  border: 0;
  border-radius: 999px;
  background: #17824a;
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 11px 16px;
  cursor: pointer;
}

.live-chat-room {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.live-chat-status {
  margin: 0;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #355746;
  background: #e7f6ee;
}

.live-chat-status.is-warn {
  background: #fff4d6;
  color: #6a5410;
}

.live-chat-log-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
}
.live-chat-log {
  height: 100%;
  overflow: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-jump {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 3;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: #c4a035;
  color: #10281c;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(16, 40, 28, 0.18);
}
.chat-jump[hidden] { display: none !important; }
.chat-history-loader {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: #fff4d6;
  color: #6a5410;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(16, 40, 28, 0.12);
  white-space: nowrap;
}
.chat-history-loader[hidden] { display: none !important; }

.live-chat-bubble {
  max-width: 86%;
  padding: 9px 11px;
  border-radius: 14px;
  background: #fff;
  align-self: flex-start;
  box-shadow: 0 4px 12px rgba(16, 40, 28, 0.05);
  font-size: 0.94rem;
}

.live-chat-bubble.is-me {
  background: #17824a;
  color: #fff;
  align-self: flex-end;
}

.live-chat-bubble.is-system {
  align-self: center;
  background: #fff6d8;
  color: #6a5410;
  text-align: center;
  font-size: 0.84rem;
  max-width: 94%;
}

.live-chat-bubble img {
  display: block;
  max-width: 220px;
  width: 100%;
  border-radius: 10px;
  margin-bottom: 4px;
}

.live-chat-attach {
  flex-shrink: 0;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 12px;
  background: #e7f6ee;
  color: #145c3a;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.live-chat-attach-full { display: none; }

.live-chat-composer.is-uploading .live-chat-attach,
.live-chat-composer.is-uploading .live-chat-send {
  pointer-events: none;
  opacity: 0.55;
}

.live-chat-image-pending {
  position: relative;
  display: block;
}

.live-chat-image-pending img {
  margin: 0;
  filter: brightness(0.72);
}

.live-chat-image-pending-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  padding: 8px;
}

.live-chat-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: live-chat-spin 0.7s linear infinite;
}

@keyframes live-chat-spin {
  to { transform: rotate(360deg); }
}

.live-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid rgba(20, 92, 58, 0.1);
}

.live-chat-composer textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 1px solid rgba(20, 92, 58, 0.16);
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  min-height: 40px;
  max-height: 88px;
}

.live-chat-send {
  flex-shrink: 0;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #17824a;
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
}

.live-chat-call {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #145c3a;
  color: #fff;
}

.live-chat-call p {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
}

.live-chat-call [data-chat-call-start] {
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  background: #fff;
  color: #145c3a;
}

.live-chat-room > audio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.call-stage[hidden] { display: none !important; }
.call-stage {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: linear-gradient(180deg, #145c3a 0%, #0d3b26 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px 28px;
  text-align: center;
}
.call-stage-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  display: grid;
  place-items: center;
  font-size: 2.2rem;
}
.call-stage-name {
  margin: 8px 0 0;
  font-size: 1.25rem;
  font-weight: 800;
}
.call-stage-status {
  margin: 0;
  opacity: 0.9;
  font-weight: 700;
}
.call-stage-timer {
  margin: 4px 0 12px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.call-stage-tools[hidden] { display: none !important; }
.call-stage-tools {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 4px 0 22px;
}
.call-stage-tool {
  width: 76px;
  border: 0;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.call-stage-tool span {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  display: grid;
  place-items: center;
  font-size: 1.55rem;
}
.call-stage-tool[data-chat-call-mute].is-on span {
  background: #f8fafc;
  color: #111;
}
.call-stage-tool[data-chat-call-speaker].is-on span {
  background: #22c55e;
  color: #052e16;
}
.call-stage-tool small {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0.92;
}
.call-stage-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.call-stage-actions button {
  min-width: 120px;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}
.call-stage-accept { background: #22c55e; color: #052e16; }
.call-stage-decline,
.call-stage-hangup { background: #dc2626; color: #fff; }

.live-chat-composer-close {
  display: none;
}

.live-chat--combo {
  left: 12px;
  right: auto;
  bottom: 12px;
}

@media (max-width: 640px) {
  .live-chat {
    right: 12px;
    bottom: 12px;
    left: auto;
    max-width: none;
  }

  .live-chat.is-open {
    inset: 0;
    width: 100%;
    max-width: none;
    display: block;
  }

  .live-chat-panel {
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .live-chat-head {
    padding: max(12px, env(safe-area-inset-top)) 12px 12px;
    align-items: center;
  }

  .live-chat-head p {
    font-size: 0.78rem;
  }

  .live-chat-composer {
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
  }

  .live-chat-send {
    height: 44px;
    font-size: 0.95rem;
  }

  .live-chat-composer-close {
    display: none !important;
  }
}

@media (max-width: 859px) {
  .live-chat-composer {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "attach attach"
      "input send";
    align-items: end;
    gap: 8px;
  }

  .live-chat-attach {
    grid-area: attach;
    width: 100%;
    height: 42px;
    justify-content: center;
    font-size: 0.9rem;
  }

  .live-chat-attach-short { display: none; }
  .live-chat-attach-full { display: inline; }

  .live-chat-composer textarea {
    grid-area: input;
    flex: none;
    min-width: 0;
  }

  .live-chat-send {
    grid-area: send;
  }

  .live-chat.live-chat--combo {
    left: 12px;
    right: auto;
    bottom: 92px;
  }

  .live-chat.live-chat--combo.is-open {
    inset: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
  }

  .live-chat--combo .live-chat-launch {
    display: none !important;
  }
}
