.phurex-ai-chat {
  --phx-yellow: #fbbc21;
  --phx-dark: #101820;
  --phx-text: #1d252d;
  --phx-muted: #75808a;
  --phx-border: #e8ebee;
  --phx-bg: #ffffff;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999999;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.phurex-chat-launcher {
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  padding: 0;
  cursor: pointer;
  box-shadow: none;
  position: relative;
  z-index: 3;
  pointer-events: auto;
  display: grid;
  place-items: center;
  transition: transform .2s ease, box-shadow .2s ease;
}

.phurex-chat-launcher:hover {
  transform: translateY(-3px);
  box-shadow: none;
}

.phurex-chat-launcher img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.phurex-chat-pulse {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--phx-yellow);
  border: 3px solid #fff;
}

.phurex-chat-panel {
  width: min(390px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  position: absolute;
  right: 0;
  bottom: 86px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--phx-bg);
  border: 1px solid rgba(16, 24, 32, .08);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(16, 24, 32, .22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.phurex-ai-chat.is-open .phurex-chat-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.phurex-chat-header {
  min-height: 76px;
  padding: 13px 14px 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background:
    linear-gradient(135deg, rgba(251,188,33,.16), rgba(251,188,33,0) 52%),
    #fff;
  border-bottom: 1px solid var(--phx-border);
}

.phurex-chat-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.phurex-chat-avatar {
  width: 47px;
  height: 47px;
  border-radius: 15px;
  background: #f7f8f9;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid #eef0f2;
}

.phurex-chat-avatar img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.phurex-chat-brand strong {
  display: block;
  color: var(--phx-dark);
  font-size: 15px;
  line-height: 1.25;
}

.phurex-chat-brand span {
  display: block;
  margin-top: 3px;
  color: var(--phx-muted);
  font-size: 12px;
}

.phurex-chat-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 0;
  background: #f3f5f6;
  color: var(--phx-dark);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.phurex-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 10px;
  background:
    radial-gradient(circle at 100% 0%, rgba(251,188,33,.08), transparent 32%),
    #fbfcfc;
  scroll-behavior: smooth;
}

.phurex-chat-message {
  display: flex;
  margin: 0 0 12px;
}

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

.phurex-chat-bubble {
  max-width: 86%;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.phurex-chat-message.bot .phurex-chat-bubble {
  color: var(--phx-text);
  background: #fff;
  border: 1px solid var(--phx-border);
  border-bottom-left-radius: 5px;
}

.phurex-chat-message.user .phurex-chat-bubble {
  color: #111;
  background: var(--phx-yellow);
  border-bottom-right-radius: 5px;
}

.phurex-chat-bubble a {
  display: inline-flex;
  margin: 8px 4px 2px 0;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--phx-dark);
  color: #fff !important;
  text-decoration: none !important;
  font-size: 12px;
  font-weight: 700;
}

.phurex-chat-typing {
  padding: 4px 18px 10px;
  background: #fbfcfc;
}

.phurex-chat-typing span {
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
  display: inline-block;
  background: var(--phx-yellow);
  animation: phxTyping 1s infinite ease-in-out;
}

.phurex-chat-typing span:nth-child(2) { animation-delay: .12s; }
.phurex-chat-typing span:nth-child(3) { animation-delay: .24s; }

@keyframes phxTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.phurex-chat-form {
  padding: 12px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border-top: 1px solid var(--phx-border);
  background: #fff;
}

.phurex-chat-form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 110px;
  resize: none;
  border: 1px solid #dfe4e8;
  border-radius: 14px;
  outline: none;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--phx-text);
  background: #fff;
  box-shadow: none;
}

.phurex-chat-form textarea:focus {
  border-color: var(--phx-yellow);
}

.phurex-chat-form button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  background: var(--phx-yellow);
  color: #121212;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 800;
}

@media (max-width: 600px) {
  .phurex-ai-chat {
    right: 14px;
    bottom: 14px;
  }

  .phurex-chat-launcher {
    width: 64px;
    height: 64px;
    border-radius: 21px;
  }

  .phurex-chat-panel {
    position: fixed;
    right: 10px;
    left: 10px;
    bottom: 88px;
    width: auto;
    height: min(620px, calc(100vh - 108px));
    border-radius: 20px;
  }
}


.phurex-chat-promo {
  position: absolute;
  right: 4px;
  bottom: 82px;
  width: max-content;
  max-width: min(280px, calc(100vw - 40px));
  min-height: 42px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(16, 24, 32, .08);
  border-radius: 15px 15px 5px 15px;
  box-shadow: 0 12px 34px rgba(16, 24, 32, .15);
  color: var(--phx-dark);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  cursor: pointer;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .22s ease, transform .22s ease;
  z-index: 2;
}

.phurex-chat-promo::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--phx-yellow);
  box-shadow: 0 0 0 4px rgba(251, 188, 33, .16);
}

.phurex-chat-promo-arrow {
  position: absolute;
  right: 18px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 1px solid rgba(16, 24, 32, .08);
  border-bottom: 1px solid rgba(16, 24, 32, .08);
  transform: rotate(45deg);
}

.phurex-chat-promo.is-changing {
  opacity: 0;
  transform: translateY(5px);
}

.phurex-ai-chat.is-open .phurex-chat-promo {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.phurex-chat-launcher img {
  filter: drop-shadow(0 12px 20px rgba(16, 24, 32, .18));
}

@media (max-width: 600px) {
  .phurex-chat-promo {
    right: 0;
    bottom: 75px;
    max-width: min(250px, calc(100vw - 30px));
    font-size: 12.5px;
  }
}


.phurex-chat-lead-wrap {
  padding: 0 16px 12px;
  background: #fbfcfc;
}

.phurex-chat-lead-wrap[hidden] {
  display: none !important;
}

.phurex-lead-intro-message {
  margin-bottom: 8px;
}

.phurex-lead-card {
  padding: 14px;
  border: 1px solid rgba(251, 188, 33, .52);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(16, 24, 32, .08);
}

.phurex-lead-card-head {
  margin-bottom: 12px;
}

.phurex-lead-card-head strong {
  display: block;
  color: var(--phx-dark);
  font-size: 14px;
}

.phurex-lead-card-head span {
  display: block;
  margin-top: 4px;
  color: var(--phx-muted);
  font-size: 12px;
  line-height: 1.4;
}

.phurex-lead-card > label:not(.phurex-lead-consent) {
  display: block;
  margin-bottom: 9px;
}

.phurex-lead-card > label:not(.phurex-lead-consent) > span {
  display: block;
  margin-bottom: 5px;
  color: var(--phx-text);
  font-size: 11px;
  font-weight: 700;
}

.phurex-lead-card input[type="text"],
.phurex-lead-card input[type="tel"] {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid #dfe4e8;
  border-radius: 11px;
  outline: 0;
  background: #fff;
  color: var(--phx-text);
  font: inherit;
  font-size: 13px;
}

.phurex-lead-card input[type="text"]:focus,
.phurex-lead-card input[type="tel"]:focus {
  border-color: var(--phx-yellow);
  box-shadow: 0 0 0 3px rgba(251,188,33,.12);
}

.phurex-lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 11px;
  cursor: pointer;
}

.phurex-lead-consent input {
  margin: 3px 0 0;
  accent-color: var(--phx-yellow);
  flex: 0 0 auto;
}

.phurex-lead-consent span {
  color: var(--phx-muted);
  font-size: 10px;
  line-height: 1.35;
}

.phurex-lead-submit {
  width: 100%;
  min-height: 41px;
  border: 0;
  border-radius: 11px;
  background: var(--phx-yellow);
  color: #111;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.phurex-lead-submit:disabled {
  opacity: .65;
  cursor: wait;
}

.phurex-lead-status {
  min-height: 0;
  margin-top: 7px;
  color: #2d6a43;
  font-size: 10px;
  line-height: 1.35;
}

.phurex-lead-status.is-error {
  color: #a33232;
}


/* v1.3 critical frontend/cache hardening */
#phurex-ai-chat.phurex-ai-chat {
  position: fixed !important;
  right: 24px !important;
  bottom: 24px !important;
  z-index: 2147483000 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#phurex-ai-chat .phurex-chat-launcher {
  position: relative !important;
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  background: transparent !important;
  border: 0 !important;
}

#phurex-ai-chat .phurex-chat-panel {
  display: flex !important;
}

#phurex-ai-chat:not(.is-open) .phurex-chat-panel {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#phurex-ai-chat.is-open .phurex-chat-panel {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#phurex-ai-chat .phurex-chat-launcher img,
#phurex-ai-chat .phurex-chat-avatar img {
  max-width: none !important;
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
}

@media (max-width: 600px) {
  #phurex-ai-chat.phurex-ai-chat {
    right: 14px !important;
    bottom: 14px !important;
  }
}
