/* Pink Sulfur — chat widget (P1) */

.ps-chat-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #f34779; /* --pink */
  color: #fff;
  font-family: joschmi, sans-serif;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, background 0.18s ease;
}
.ps-chat-toggle:hover { background: #d94f66; transform: scale(1.05); }

.ps-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 9999;
  width: min(380px, calc(100vw - 48px));
  height: min(560px, calc(100vh - 140px));
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: mencken-std, serif;
  color: #030303;
}
.ps-chat-panel.is-open { display: flex; }

.ps-chat-header {
  padding: 14px 16px;
  background: #f34779;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ps-chat-header h3 {
  margin: 0;
  font-family: joschmi, sans-serif;
  font-size: 18px;
  font-weight: normal;
  letter-spacing: 0.5px;
}
.ps-chat-header button {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}

.ps-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafafa;
}

.ps-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ps-msg.user {
  align-self: flex-end;
  background: #f34779;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ps-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #030303;
  border: 1px solid #ececec;
  border-bottom-left-radius: 4px;
}
.ps-msg.bot.is-thinking::after {
  content: '…';
  display: inline-block;
  margin-left: 2px;
  opacity: 0.6;
  animation: ps-blink 1.2s infinite;
}
@keyframes ps-blink {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.7; }
}
.ps-msg.error {
  align-self: center;
  background: #f5f5f5;
  color: #a47b7b;
  font-size: 13px;
  font-style: italic;
  border: 1px dashed #e2e2e2;
}

.ps-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #ececec;
  background: #fff;
}
.ps-chat-input textarea {
  flex: 1;
  resize: none;
  border: 1px solid #d3d3d3;
  border-radius: 8px;
  padding: 8px 10px;
  font-family: mencken-std, serif;
  font-size: 15px;
  color: #030303;
  outline: none;
  max-height: 120px;
}
.ps-chat-input textarea:focus { border-color: #f34779; }
.ps-chat-input button {
  background: #f34779;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-family: joschmi, sans-serif;
  font-size: 14px;
  cursor: pointer;
}
.ps-chat-input button:disabled { background: #d3d3d3; cursor: not-allowed; }

@media (max-width: 480px) {
  .ps-chat-panel { right: 12px; left: 12px; width: auto; bottom: 84px; }
  .ps-chat-toggle { right: 16px; bottom: 16px; }
}
