.pa-chatbot {
  --pa-accent: #087f8c;
  --pa-bg: #ffffff;
  --pa-text: #172126;
  --pa-panel-width: 440px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--pa-text);
  box-sizing: border-box;
}

.pa-chatbot *, .pa-chatbot *::before, .pa-chatbot *::after { box-sizing: inherit; }
.pa-chatbot[hidden], .pa-chatbot__panel[hidden] { display: none !important; }
.pa-chatbot .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;
}

.pa-chatbot--floating {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999999;
}

.pa-chatbot__launcher {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: var(--pa-accent);
  color: #fff;
  font-size: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  cursor: pointer;
}

.pa-chatbot__panel {
  display: flex;
  flex-direction: column;
  width: var(--pa-panel-width);
  max-width: calc(100vw - 28px);
  height: min(590px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid rgba(20, 60, 70, .16);
  border-radius: 18px;
  background: var(--pa-bg);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .22);
}

.pa-chatbot--floating .pa-chatbot__panel { margin-bottom: 12px; }
.pa-chatbot--inline .pa-chatbot__panel { width: 100%; max-width: 680px; height: 620px; margin: 20px auto; }

.pa-chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 14px 18px;
  background: var(--pa-accent);
  color: #fff;
}

.pa-chatbot__header strong, .pa-chatbot__header small { display: block; }
.pa-chatbot__header strong { font-size: 18px; line-height: 1.25; }
.pa-chatbot__header small { font-size: 14px; line-height: 1.35; }
.pa-chatbot__header small { margin-top: 2px; opacity: .85; }
.pa-chatbot__close { border: 0; background: transparent; color: #fff; font-size: 30px; cursor: pointer; }

.pa-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: #f2f7f7;
}

.pa-chatbot__message {
  max-width: 86%;
  margin: 0 0 12px;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.pa-chatbot__message--assistant { background: #fff; border-bottom-left-radius: 4px; }
.pa-chatbot__message--user { margin-left: auto; background: var(--pa-accent); color: #fff; border-bottom-right-radius: 4px; }
.pa-chatbot__message--typing { background: #e4eeee; color: #526269; font-size: 13px; }
.pa-chatbot__message--error { background: #fff1f1; color: #a51d1d; }

.pa-chatbot__form {
  display: flex;
  gap: 9px;
  align-items: flex-end;
  padding: 12px;
  border-top: 1px solid #dce7e8;
  background: #fff;
}

.pa-chatbot__input {
  flex: 1;
  min-height: 42px;
  max-height: 110px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid #bdcdd0;
  border-radius: 12px;
  font-size: 16px;
  font: inherit;
}

.pa-chatbot__input:focus { border-color: var(--pa-accent); outline: 2px solid color-mix(in srgb, var(--pa-accent), transparent 78%); }
.pa-chatbot__send { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--pa-accent); color: #fff; cursor: pointer; }
.pa-chatbot__send:disabled { opacity: .55; cursor: wait; }
.pa-chatbot__notice { margin: 0; padding: 0 12px 10px; background: #fff; color: #66767c; font-size: 11px; text-align: center; }

@media (max-width: 520px) {
  .pa-chatbot--floating { right: 10px; bottom: 10px; }
  .pa-chatbot--floating .pa-chatbot__panel { width: calc(100vw - 20px); height: calc(100vh - 90px); }
}
