*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

:root {
  --pmc-chat-bg: #0f172a;
  --pmc-chat-accent: #f59e0b;
  --pmc-chat-card: #ffffff;
  --pmc-chat-text: #0f172a;
  --pmc-chat-muted: #64748b;
  --pmc-chat-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

#pmc-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #111827;
  color: #f8fafc;
  border-radius: 999px;
  box-shadow: var(--pmc-chat-shadow);
  cursor: pointer;
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#pmc-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.28);
}

#pmc-chat-launcher img {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  background: #ffffff;
}

#pmc-chat-launcher span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

#pmc-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 520px;
  background: var(--pmc-chat-card);
  color: var(--pmc-chat-text);
  border-radius: 16px;
  box-shadow: var(--pmc-chat-shadow);
  overflow: hidden;
  display: none;
  z-index: 9999;
}

#pmc-chat-panel.open {
  display: flex;
  flex-direction: column;
  animation: pmc-chat-pop 0.2s ease;
}

@keyframes pmc-chat-pop {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#pmc-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #f8fafc;
}

#pmc-chat-header img {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #ffffff;
  object-fit: cover;
}

#pmc-chat-header .title {
  font-weight: 700;
  font-size: 14px;
}

#pmc-chat-header .subtitle {
  font-size: 11px;
  color: #cbd5f5;
}

#pmc-chat-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #f8fafc;
  font-size: 18px;
  cursor: pointer;
}

#pmc-chat-messages {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  background: #f8fafc;
}

.pmc-chat-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.pmc-chat-row.user {
  justify-content: flex-end;
}

.pmc-chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.pmc-chat-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
}

.pmc-chat-bubble.user {
  align-self: flex-end;
  background: #1d4ed8;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.pmc-chat-bubble.bot {
  align-self: flex-start;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.pmc-chat-bubble.bot a {
  color: #1d4ed8;
  text-decoration: underline;
  word-break: break-all;
}

.pmc-chat-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 14px;
}

.pmc-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: pmc-chat-bounce 1s infinite ease-in-out;
}

.pmc-chat-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.pmc-chat-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pmc-chat-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

#pmc-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.pmc-chat-consent {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  background: #fffdf5;
  color: #475569;
  font-size: 11px;
  line-height: 1.4;
}

.pmc-chat-consent label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
}

#pmc-chat-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
}

#pmc-chat-send {
  border: none;
  background: var(--pmc-chat-accent);
  color: #111827;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
}

@media (max-width: 520px) {
  #pmc-chat-launcher {
    right: 12px;
    bottom: 86px;
  }

  #pmc-chat-panel {
    right: 12px;
    bottom: 140px;
    width: calc(100vw - 24px);
    height: 70vh;
  }

  #pmc-chat-launcher span {
    display: none;
  }
}
