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

.pam-chat {
  --gold: #d4af37;
  --gold-soft: #c49b66;
  --gold-pale: #f6e7c6;
  --text: #f7f3ea;
  --muted: #b9b1a4;
  --bg: #0a0705;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Montserrat", system-ui, sans-serif;
  display: block;
  position: fixed !important;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  font-family: var(--sans);
  color: var(--text);
  pointer-events: none;
}

.pam-chat > * {
  pointer-events: auto;
}


.pam-chat-launch {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #1a1208;
  background: linear-gradient(180deg, #f3d7a0, #b8860b);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 24px rgba(212, 175, 55, 0.35);
  position: relative;
  transition: transform 0.2s ease;
}

.pam-chat-launch:hover {
  transform: translateY(-2px) scale(1.03);
}

.pam-chat-launch-icon {
  width: 28px;
  height: 28px;
  display: block;
}

.pam-chat-launch-icon svg {
  width: 100%;
  height: 100%;
}

.pam-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.pam-chat-badge[hidden] {
  display: none;
}

.pam-chat-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(380px, calc(100vw - 28px));
  height: min(560px, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(500px 180px at 80% 0%, rgba(184, 134, 11, 0.18), transparent 60%),
    var(--bg);
  border: 1px solid rgba(212, 175, 55, 0.38);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.pam-chat-panel[hidden] {
  display: none;
}

.pam-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
}

.pam-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 12%;
  border: 2px solid #e8c992;
}

.pam-chat-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
}

.pam-chat-status {
  margin: 2px 0 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.pam-chat-status.is-online {
  color: #4ade80;
}

.pam-chat-close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  color: var(--gold-pale);
  display: grid;
  place-items: center;
}

.pam-chat-close svg {
  width: 18px;
  height: 18px;
}

.pam-chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pam-chat-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.pam-chat-bubble.is-operator {
  align-self: flex-start;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.28);
  color: var(--gold-pale);
}

.pam-chat-bubble.is-visitor {
  align-self: flex-end;
  background: linear-gradient(180deg, #f3d7a0, #c49b66);
  color: #1a1208;
}

.pam-chat-bubble.is-ghost {
  opacity: 0.92;
}

.pam-chat-typing {
  margin: 0;
  padding: 0 18px 8px;
  font-size: 12px;
  color: var(--gold-soft);
  font-style: italic;
}

.pam-chat-typing[hidden] {
  display: none;
}

.pam-chat-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
}

.pam-chat-form #pam-chat-name {
  flex: 1 1 100%;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.pam-chat-form textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 110px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.pam-chat-form textarea:focus {
  outline: 1px solid var(--gold);
}

.pam-chat-form button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #1a1208;
  background: linear-gradient(180deg, #f3d7a0, #b8860b);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.pam-chat-form button svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 640px) {
  .pam-chat {
    right: 14px;
    bottom: 14px;
  }

  .pam-chat-panel {
    position: fixed;
    inset: 10px 10px 86px;
    width: auto;
    height: auto;
    bottom: 86px;
  }
}
