.iwc-chatbot-root,
.iwc-chatbot-root * {
  box-sizing: border-box;
}

.iwc-chatbot-root {
  --iwc-accent: #25d366;
  --iwc-header: #075e54;
  --iwc-header-text: #ffffff;
  --iwc-panel-width: 380px;
  position: fixed;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 999999;
  width: auto;
  color: #15211d;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

.iwc-chatbot-root[data-iwc-ready="0"] {
  visibility: hidden;
}

.iwc-chatbot-root.iwc-position-right {
  right: max(22px, env(safe-area-inset-right));
}

.iwc-chatbot-root.iwc-position-left {
  left: max(22px, env(safe-area-inset-left));
}

.iwc-chatbot-root button,
.iwc-chatbot-root input,
.iwc-chatbot-root textarea {
  font: inherit;
}

.iwc-chatbot-root button {
  margin: 0;
  border: 0;
  cursor: pointer;
}

.iwc-chatbot-root button:focus-visible,
.iwc-chatbot-root input:focus-visible,
.iwc-chatbot-root textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--iwc-accent) 35%, transparent);
  outline-offset: 2px;
}

.iwc-chatbot-root [hidden] {
  display: none !important;
}

.iwc-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 18px 10px 12px;
  border-radius: 999px;
  background: var(--iwc-accent);
  color: #fff;
  box-shadow: 0 14px 38px rgba(9, 56, 37, 0.25), 0 4px 12px rgba(9, 56, 37, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.iwc-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(9, 56, 37, 0.3), 0 6px 16px rgba(9, 56, 37, 0.2);
}

.iwc-launcher-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.iwc-launcher-label {
  max-width: 180px;
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iwc-wa-icon {
  display: block;
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.iwc-unread-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.iwc-panel {
  position: absolute;
  bottom: 74px;
  width: min(var(--iwc-panel-width), calc(100vw - 28px));
  height: min(650px, calc(100vh - 120px));
  min-height: 470px;
  overflow: hidden;
  border: 1px solid rgba(18, 61, 46, 0.1);
  border-radius: 24px;
  background: #f4f7f5;
  box-shadow: 0 28px 80px rgba(10, 35, 27, 0.25), 0 8px 24px rgba(10, 35, 27, 0.14);
  animation: iwc-panel-in 190ms ease-out both;
}

.iwc-position-right .iwc-panel {
  right: 0;
}

.iwc-position-left .iwc-panel {
  left: 0;
}

@keyframes iwc-panel-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.iwc-panel-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 16px 16px;
  background: linear-gradient(135deg, var(--iwc-header), color-mix(in srgb, var(--iwc-header) 78%, #000));
  color: var(--iwc-header-text);
}

.iwc-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--iwc-header-text);
}

.iwc-avatar .iwc-wa-icon {
  width: 27px;
  height: 27px;
}

.iwc-header-copy {
  min-width: 0;
  flex: 1;
}

.iwc-header-copy strong {
  display: block;
  overflow: hidden;
  color: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iwc-header-copy span {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  overflow: hidden;
  color: color-mix(in srgb, var(--iwc-header-text) 82%, transparent);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iwc-header-copy span i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #49e681;
  box-shadow: 0 0 0 3px rgba(73, 230, 129, 0.14);
}

.iwc-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: transparent;
  color: var(--iwc-header-text);
  transition: background 160ms ease;
}

.iwc-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

.iwc-close svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.iwc-conversation-view {
  position: relative;
  height: calc(100% - 244px);
  min-height: 210px;
  background-color: #efeae2;
  background-image:
    radial-gradient(circle at 10px 10px, rgba(12, 79, 54, 0.028) 1.2px, transparent 1.2px),
    radial-gradient(circle at 32px 28px, rgba(12, 79, 54, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
}

.iwc-messages {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 15px 74px;
  overscroll-behavior: contain;
  scrollbar-color: rgba(30, 67, 54, 0.2) transparent;
  scrollbar-width: thin;
}

.iwc-message {
  display: flex;
  width: 100%;
  margin: 0 0 10px;
  animation: iwc-message-in 180ms ease-out both;
}

.iwc-message--bot {
  justify-content: flex-start;
}

.iwc-message--user {
  justify-content: flex-end;
}

@keyframes iwc-message-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.iwc-message-bubble {
  position: relative;
  max-width: 84%;
  padding: 10px 11px 7px;
  border-radius: 13px;
  box-shadow: 0 1px 1px rgba(25, 55, 44, 0.08);
}

.iwc-message--bot .iwc-message-bubble {
  border-top-left-radius: 4px;
  background: #fff;
}

.iwc-message--user .iwc-message-bubble {
  border-top-right-radius: 4px;
  background: #d9fdd3;
}

.iwc-message-bubble p {
  margin: 0;
  color: #17251f;
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.iwc-message-time {
  display: block;
  margin-top: 4px;
  color: #77837e;
  font-size: 9.5px;
  line-height: 1;
  text-align: right;
}

.iwc-typing {
  position: absolute;
  left: 15px;
  bottom: 60px;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 54px;
  height: 32px;
  padding: 0 12px;
  border-radius: 13px 13px 13px 4px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(25, 55, 44, 0.08);
}

.iwc-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8a9691;
  animation: iwc-typing-dot 1.1s infinite ease-in-out;
}

.iwc-typing span:nth-child(2) {
  animation-delay: 120ms;
}

.iwc-typing span:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes iwc-typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.iwc-quick-replies {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 12px 12px;
  background: linear-gradient(to top, rgba(239, 234, 226, 1) 72%, rgba(239, 234, 226, 0));
  scrollbar-width: none;
}

.iwc-quick-replies::-webkit-scrollbar {
  display: none;
}

.iwc-quick-reply {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--iwc-accent) 50%, #d5ddd9) !important;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: color-mix(in srgb, var(--iwc-header) 85%, #1b2d26);
  font-size: 11.5px !important;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.iwc-quick-reply:hover {
  border-color: var(--iwc-accent) !important;
  background: #fff;
  transform: translateY(-1px);
}

.iwc-panel-footer {
  height: 160px;
  padding: 10px 12px 8px;
  border-top: 1px solid rgba(26, 63, 50, 0.08);
  background: #f7f9f8;
}

.iwc-message-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.iwc-message-form textarea {
  width: 100%;
  min-height: 43px;
  max-height: 96px;
  resize: none;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #dce3df;
  border-radius: 16px;
  background: #fff;
  color: #17251f;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: none;
}

.iwc-message-form textarea::placeholder {
  color: #88938f;
}

.iwc-message-form textarea:focus {
  border-color: color-mix(in srgb, var(--iwc-accent) 65%, #b9c7c0);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--iwc-accent) 13%, transparent);
}

.iwc-send {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  border-radius: 50%;
  background: var(--iwc-accent);
  color: #fff;
  transition: transform 150ms ease, filter 150ms ease;
}

.iwc-send:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.iwc-send svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.iwc-whatsapp-handoff,
.iwc-submit-lead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  margin-top: 9px !important;
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--iwc-accent);
  color: #fff;
  font-size: 13px !important;
  font-weight: 800;
  line-height: 1.2;
  transition: transform 150ms ease, filter 150ms ease;
}

.iwc-whatsapp-handoff:hover,
.iwc-submit-lead:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.iwc-whatsapp-handoff:disabled,
.iwc-submit-lead:disabled {
  cursor: not-allowed;
  filter: grayscale(0.5);
  opacity: 0.56;
  transform: none;
}

.iwc-whatsapp-handoff .iwc-wa-icon,
.iwc-submit-lead .iwc-wa-icon {
  width: 19px;
  height: 19px;
}

.iwc-powered-by,
.iwc-config-warning {
  display: block;
  margin-top: 6px;
  color: #8a9590;
  font-size: 9.5px;
  line-height: 1.2;
  text-align: center;
}

.iwc-config-warning {
  color: #9a5d19;
}

.iwc-lead-view {
  height: calc(100% - 84px);
  overflow-y: auto;
  padding: 18px 18px 22px;
  background: #f7f9f8;
}

.iwc-back-to-chat {
  padding: 4px 0;
  background: transparent;
  color: color-mix(in srgb, var(--iwc-header) 88%, #111);
  font-size: 12px !important;
  font-weight: 700;
}

.iwc-lead-heading {
  margin: 18px 0 16px;
}

.iwc-lead-heading h3 {
  margin: 0 0 6px;
  color: #13221c;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.iwc-lead-heading p {
  margin: 0;
  color: #64716c;
  font-size: 12.5px;
  line-height: 1.5;
}

.iwc-form-field {
  margin-bottom: 12px;
}

.iwc-form-field label {
  display: block;
  margin-bottom: 5px;
  color: #33423c;
  font-size: 11.5px;
  font-weight: 750;
}

.iwc-form-field input {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #d8e0dc;
  border-radius: 10px;
  background: #fff;
  color: #17251f;
  box-shadow: none;
}

.iwc-form-field input:focus {
  border-color: var(--iwc-accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--iwc-accent) 13%, transparent);
}

.iwc-privacy-note {
  margin: 6px 0 10px;
  color: #75817c;
  font-size: 10.5px;
  line-height: 1.45;
}

.iwc-form-error {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff0f0;
  color: #a62222;
  font-size: 11.5px;
}

.iwc-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.iwc-chatbot-root .screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 600px) {
  .iwc-chatbot-root {
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .iwc-chatbot-root.iwc-position-right {
    right: max(14px, env(safe-area-inset-right));
  }

  .iwc-chatbot-root.iwc-position-left {
    left: max(14px, env(safe-area-inset-left));
  }

  .iwc-launcher {
    width: 58px;
    height: 58px;
    min-height: 58px;
    padding: 10px;
    justify-content: center;
  }

  .iwc-launcher-label {
    display: none;
  }

  .iwc-panel {
    position: fixed;
    top: max(10px, env(safe-area-inset-top));
    right: 10px !important;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px !important;
    width: auto;
    height: auto;
    min-height: 0;
    border-radius: 20px;
  }

  .iwc-conversation-view {
    height: calc(100% - 244px);
  }
}

@media (min-width: 601px) {
  .iwc-chatbot-root.iwc-hide-desktop {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .iwc-chatbot-root.iwc-hide-mobile {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iwc-chatbot-root *,
  .iwc-chatbot-root *::before,
  .iwc-chatbot-root *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
