.vb-chat-root,
.vb-chat-root * {
  box-sizing: border-box;
}

.vb-chat-root[data-state="open"] .vb-chat-launch {
  visibility: hidden;
  pointer-events: none;
}

.vb-chat-new {
  margin: 10px 12px 12px;
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--vbchat-green);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.vb-chat-new:hover {
  background: var(--vbchat-green-dark);
}

.vb-chat-new[hidden] {
  display: none;
}

@media (max-width: 520px) {
  .vb-chat-root {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .vb-chat-panel {
    position: fixed;
    inset: auto 12px calc(12px + env(safe-area-inset-bottom, 0px)) auto;
    width: min(340px, calc(100vw - 24px));
    height: min(480px, calc(100dvh - 90px));
    max-height: calc(100dvh - 90px);
    min-height: 0;
  }

  .vb-chat-root.has-thread .vb-chat-welcome {
    display: none;
  }

  .vb-chat-header {
    padding: 12px 14px;
  }

  .vb-chat-avatar {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .vb-chat-heading strong {
    font-size: 15px;
  }

  .vb-chat-close {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin: 0 0 0 auto;
    padding: 0;
  }

  .vb-chat-welcome {
    padding: 12px 14px 10px;
  }

  .vb-chat-messages {
    min-height: 0;
    padding: 10px 10px 2px;
  }

  .vb-chat-bubble {
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 12px;
  }

  .vb-chat-compose {
    align-items: center;
    gap: 7px;
    padding: 9px;
  }

  .vb-chat-compose textarea {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 42px;
    max-height: 76px;
    padding: 9px 10px;
  }

  .vb-chat-compose button {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
  }

  .vb-chat-footnote {
    padding: 0 8px 8px;
    font-size: 9px;
  }

  .vb-chat-launch {
    max-width: calc(100vw - 24px);
    padding: 12px 15px;
  }
}
