.floating-contact {
  position: fixed;
  z-index: 800;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  pointer-events: none;
}

.floating-contact-direct {
  position: fixed;
  right: 0;
  top: 42%;
  display: grid;
  width: 250px;
  gap: 6px;
  justify-items: end;
  pointer-events: none;
  font-family: "Segoe UI", Arial, sans-serif;
}

.floating-contact-action,
.floating-contact-chat,
.floating-contact-dialog button {
  border: 0;
  cursor: pointer;
}

.floating-contact-action {
  position: relative;
  display: block;
  width: 54px;
  height: 54px;
  pointer-events: auto;
  overflow: hidden;
  border-radius: 6px 0 0 6px;
  color: #fff;
  background: #9198a3;
  box-shadow: 0 8px 20px rgba(15, 30, 24, .14);
  transition: width .2s ease, background-color .2s ease;
}

.floating-contact-action span {
  position: absolute;
  right: 58px;
  top: 50%;
  opacity: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  transform: translate(8px, -50%);
  transition: opacity .16s ease, transform .2s ease;
}

.floating-contact-action svg {
  position: absolute;
  right: 15px;
  top: 15px;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.floating-contact-action:hover,
.floating-contact-action:focus-visible {
  width: 250px;
  outline: none;
}

.floating-contact-action:hover span,
.floating-contact-action:focus-visible span {
  opacity: 1;
  transform: translate(0, -50%);
}

.floating-contact-whatsapp:hover,
.floating-contact-whatsapp:focus-visible {
  background: #0a7fd0;
}

.floating-contact-email:hover,
.floating-contact-email:focus-visible {
  background: #087eae;
}

.floating-contact-chat {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #0968f5;
  background: #0968f5;
  box-shadow: 0 14px 34px rgba(9, 104, 245, .28);
  pointer-events: auto;
  transition: transform .18s ease, box-shadow .18s ease;
}

.floating-contact-chat:hover,
.floating-contact-chat:focus-visible {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(9, 104, 245, .36);
}

.floating-contact-chat-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #0968f5;
  background: #fff;
}

.floating-contact-chat-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.floating-contact-callout {
  position: absolute;
  right: 74px;
  top: 12px;
  min-width: max-content;
  padding: 9px 13px;
  border: 1px solid #d8e3ef;
  border-radius: 6px;
  color: #0968f5;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 42, 72, .13);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.floating-contact-callout::after {
  position: absolute;
  right: -6px;
  top: 11px;
  width: 10px;
  height: 10px;
  border-top: 1px solid #d8e3ef;
  border-right: 1px solid #d8e3ef;
  background: #fff;
  content: "";
  transform: rotate(45deg);
}

.floating-contact-backdrop {
  position: fixed;
  z-index: 890;
  inset: 0;
  background: rgba(6, 22, 43, .12);
  pointer-events: none;
}

.floating-contact-dialog[hidden],
.floating-contact-welcome[hidden],
.floating-contact-conversation[hidden] {
  display: none;
}

.floating-contact-dialog {
  position: fixed;
  z-index: 900;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(438px, calc(100vw - 28px));
  height: min(660px, calc(100dvh - 28px));
  overflow: hidden;
  border: 1px solid #dbe5ee;
  border-radius: 22px;
  color: #15212d;
  background: #fff;
  box-shadow: 0 26px 74px rgba(3, 35, 78, .28);
  font-family: "Segoe UI", Arial, sans-serif;
}

.floating-contact-welcome,
.floating-contact-conversation {
  height: 100%;
  min-height: 0;
  background: #fff;
}

.floating-contact-conversation {
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
}

.floating-contact-dialog-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  min-height: 76px;
  padding: 0 14px;
  color: #fff;
  background: #0968f5;
}

.floating-contact-dialog-header h2 {
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-contact-dialog-header button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: transparent;
}

.floating-contact-dialog-header button {
  padding: 0 0 3px;
  border-radius: 50%;
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
}

.floating-contact-dialog-header button:hover,
.floating-contact-dialog-header button:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, .13);
}

.floating-contact-close {
  font-size: 28px !important;
}

.floating-contact-dialog-header .floating-contact-back {
  display: inline-flex;
  width: auto;
  min-width: 72px;
  gap: 6px;
  padding: 0 8px 1px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.floating-contact-dialog-header .floating-contact-back span {
  font-size: 31px;
  font-weight: 300;
  line-height: .8;
}

.floating-contact-thread {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 24px 30px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.floating-contact-thread-welcome {
  height: calc(100% - 76px);
}

.floating-contact-agent-label {
  margin: 0 0 8px 62px;
  color: #394654;
  font-size: 13px;
  letter-spacing: 0;
}

.floating-contact-message-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.floating-contact-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid #e0e5ea;
  border-radius: 50%;
  color: #245c88;
  background: #eef2f5;
}

.floating-contact-avatar svg {
  width: 30px;
  height: 30px;
  fill: #efc39c;
  stroke: #214f73;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.floating-contact-message {
  margin: 0;
  border-radius: 5px 13px 13px;
  font-size: 16px;
  line-height: 1.55;
}

.floating-contact-message-agent {
  max-width: 300px;
  padding: 13px 15px;
  color: #fff;
  background: #0968f5;
}

.floating-contact-question {
  display: block;
  max-width: 230px;
  margin: 25px 0 28px auto;
  padding: 14px 18px;
  border-radius: 12px !important;
  color: #17212b;
  background: #e9ebee;
  font: inherit;
  font-size: 16px;
  text-align: left;
}

.floating-contact-question:hover,
.floating-contact-question:focus-visible {
  outline: 2px solid rgba(9, 104, 245, .28);
  background: #e1e5e9;
}

.floating-contact-conversation-card {
  position: relative;
  display: grid;
  width: calc(100% - 62px);
  gap: 7px;
  margin: 34px 0 0 62px;
  padding: 18px 54px 18px 18px;
  border: 1px solid #dfe6ed;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16, 45, 76, .09);
  color: #15212d;
  font-family: inherit;
  text-align: left;
}

.floating-contact-conversation-card strong {
  font-size: 17px;
}

.floating-contact-conversation-card small {
  color: #77828e;
  font-size: 13px;
}

.floating-contact-conversation-card svg {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #0968f5;
  stroke-width: 2;
  transform: translateY(-50%);
}

.floating-contact-conversation-card:hover,
.floating-contact-conversation-card:focus-visible {
  outline: 2px solid rgba(9, 104, 245, .22);
  transform: translateY(-1px);
}

.floating-contact-thread-form {
  padding-top: 22px;
}

.floating-contact-form-card {
  margin: 24px 0 0 62px;
}

.floating-contact-dialog .opm-contact-form-floating {
  display: grid;
  width: 100%;
  max-width: none;
  gap: 17px;
}

.floating-contact-dialog .opm-contact-form-floating > label {
  position: relative;
  display: block;
  margin: 0;
  border: 1px solid #d7dce2;
  border-radius: 14px;
  background: #fff;
}

.floating-contact-dialog .opm-contact-form-floating > label > span,
.floating-contact-dialog .opm-phone-prefix > span {
  position: absolute;
  z-index: 2;
  left: 14px;
  top: -9px;
  max-width: calc(100% - 28px);
  overflow: hidden;
  padding: 0 6px;
  color: #151b22;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-contact-dialog .opm-floating-phone > .opm-phone-prefix > span {
  max-width: 260px;
  overflow: visible;
}

.floating-contact-dialog .opm-contact-form-floating input,
.floating-contact-dialog .opm-contact-form-floating select,
.floating-contact-dialog .opm-contact-form-floating textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 14px;
  color: #111820;
  background: transparent;
  font: inherit;
  letter-spacing: 0;
}

.floating-contact-dialog .opm-contact-form-floating input,
.floating-contact-dialog .opm-contact-form-floating select {
  height: 56px;
  padding: 10px 16px 5px;
}

.floating-contact-dialog .opm-contact-form-floating textarea {
  min-height: 108px;
  padding: 17px 16px 10px;
  resize: vertical;
}

.floating-contact-dialog .opm-contact-form-floating > label:focus-within,
.floating-contact-dialog .opm-floating-phone:focus-within {
  border-color: #0968f5;
  box-shadow: 0 0 0 3px rgba(9, 104, 245, .1);
}

.floating-contact-dialog .opm-contact-form-floating input:focus,
.floating-contact-dialog .opm-contact-form-floating select:focus,
.floating-contact-dialog .opm-contact-form-floating textarea:focus {
  outline: none;
}

.floating-contact-dialog .opm-floating-phone {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  border: 1px solid #d7dce2;
  border-radius: 14px;
  background: #fff;
}

.floating-contact-dialog .opm-phone-prefix {
  position: relative;
  display: block;
  border-right: 1px solid #e2e6ea;
}

.floating-contact-dialog .opm-phone-prefix select {
  cursor: pointer;
}

.floating-contact-dialog .opm-hidden-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.floating-contact-dialog .opm-actions {
  display: flex;
  justify-content: flex-start;
  margin: 2px 0 0;
}

.floating-contact-dialog .opm-actions button {
  min-height: 56px;
  padding: 0 24px;
  border-radius: 11px;
  color: #fff;
  background: #0968f5;
  box-shadow: 0 8px 18px rgba(9, 104, 245, .22);
  font-size: 17px;
  font-weight: 700;
}

.floating-contact-dialog .opm-actions button::before {
  margin-right: 9px;
  content: "➤";
}

.floating-contact-dialog .opm-actions button:hover,
.floating-contact-dialog .opm-actions button:focus-visible {
  outline: none;
  background: #0759d1;
}

.floating-contact-dialog .opm-actions button:disabled {
  cursor: wait;
  opacity: .65;
}

.floating-contact-dialog .opm-result {
  margin-top: 0;
}

.floating-contact-dialog .opm-result p {
  margin: 0;
}

.floating-contact-dialog .opm-success,
.floating-contact-dialog .opm-error {
  padding: 12px 14px;
  border-radius: 8px;
}

.floating-contact-dialog .opm-success {
  color: #176541;
  background: #edf8f2;
}

.floating-contact-dialog .opm-error {
  color: #8c2c24;
  background: #fff0ee;
}

.floating-contact.is-dialog-open {
  visibility: hidden;
}

@media (max-width: 640px) {
  .floating-contact {
    right: max(13px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .floating-contact-direct {
    top: 44%;
    width: 48px;
  }

  .floating-contact-action {
    width: 48px;
    height: 48px;
  }

  .floating-contact-action span {
    display: none;
  }

  .floating-contact-action svg {
    right: 13px;
    top: 13px;
    width: 22px;
    height: 22px;
  }

  .floating-contact-action:hover,
  .floating-contact-action:focus-visible {
    width: 48px;
  }

  .floating-contact-chat {
    width: 60px;
    height: 60px;
  }

  .floating-contact-chat-icon {
    width: 42px;
    height: 42px;
  }

  .floating-contact-callout {
    right: 69px;
    top: 11px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .floating-contact-dialog {
    right: max(7px, env(safe-area-inset-right));
    bottom: max(7px, env(safe-area-inset-bottom));
    width: calc(100vw - max(14px, env(safe-area-inset-left) + env(safe-area-inset-right)));
    height: min(650px, calc(100dvh - 14px));
    border-radius: 18px;
  }

  .floating-contact-dialog-header {
    min-height: 70px;
  }

  .floating-contact-dialog-header h2 {
    font-size: 20px;
  }

  .floating-contact-thread {
    padding: 22px 16px 26px;
  }

  .floating-contact-thread-welcome {
    height: calc(100% - 70px);
  }

  .floating-contact-agent-label {
    margin-left: 48px;
  }

  .floating-contact-avatar {
    width: 40px;
    height: 40px;
  }

  .floating-contact-avatar svg {
    width: 25px;
    height: 25px;
  }

  .floating-contact-message {
    font-size: 15px;
  }

  .floating-contact-message-agent {
    max-width: calc(100% - 52px);
  }

  .floating-contact-conversation-card,
  .floating-contact-form-card {
    margin-left: 0;
  }

  .floating-contact-conversation-card {
    width: 100%;
  }
}

body.device-render-mobile .floating-contact {
  right: max(13px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
}

body.device-render-mobile .floating-contact-direct {
  top: 44%;
  width: 48px;
}

body.device-render-mobile .floating-contact-action {
  width: 48px;
  height: 48px;
}

body.device-render-mobile .floating-contact-action span {
  display: none;
}

body.device-render-mobile .floating-contact-action svg {
  right: 13px;
  top: 13px;
  width: 22px;
  height: 22px;
}

body.device-render-mobile .floating-contact-action:hover,
body.device-render-mobile .floating-contact-action:focus-visible {
  width: 48px;
}

body.device-render-mobile .floating-contact-dialog {
  right: max(7px, env(safe-area-inset-right));
  bottom: max(7px, env(safe-area-inset-bottom));
  width: calc(100vw - 14px);
  height: min(650px, calc(100vh - 14px));
  border-radius: 18px;
}

body.device-render-mobile .floating-contact-thread {
  padding: 22px 16px 26px;
}

body.device-render-mobile .floating-contact-agent-label {
  margin-left: 48px;
}

body.device-render-mobile .floating-contact-avatar {
  width: 40px;
  height: 40px;
}

body.device-render-mobile .floating-contact-message-agent {
  max-width: calc(100% - 52px);
}

body.device-render-mobile .floating-contact-conversation-card,
body.device-render-mobile .floating-contact-form-card {
  margin-left: 0;
}

body.device-render-mobile .floating-contact-conversation-card {
  width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .floating-contact-action,
  .floating-contact-action span,
  .floating-contact-chat {
    transition: none;
  }
}
