:root {
  --ptb-navy: #090f8f;
  --ptb-navy-dark: #070b68;
  --ptb-beige: #e4cbb2;
  --ptb-bg: #eef8ff;
  --ptb-text: #111827;
  --ptb-border: #d9dee7;
}

.ptb-ai-floating {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999999;
  font-family: Arial, Helvetica, sans-serif;
}

.ptb-ai-fab {
  border: 0;
  border-radius: 999px;
  background: var(--ptb-navy);
  color: #fff;
  box-shadow: 0 8px 25px rgba(0,0,0,.22);
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.ptb-ai-fab:hover { background: var(--ptb-navy-dark); }

.ptb-ai-fab span { font-size: 20px; }

.ptb-ai-panel {
  position: absolute;
  right: 0;
  bottom: 60px;
  width: 380px;
  max-width: calc(100vw - 30px);
}

.ptb-ai-window {
  background: #fff;
  border: 1px solid var(--ptb-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 55px rgba(0,0,0,.24);
}

.ptb-ai-header {
  background: var(--ptb-navy);
  color: #fff;
  padding: 15px 16px;
}

.ptb-ai-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ptb-ai-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ptb-beige);
  display: grid;
  place-items: center;
  font-size: 19px;
}

.ptb-ai-brand strong,
.ptb-ai-brand span {
  display: block;
}

.ptb-ai-brand strong {
  font-size: 14px;
  line-height: 1.25;
}

.ptb-ai-brand span {
  font-size: 12px;
  opacity: .82;
  margin-top: 3px;
}

.ptb-ai-close {
  position: absolute;
  right: 10px;
  top: 8px;
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 27px;
  cursor: pointer;
}

.ptb-ai-messages {
  height: 290px;
  overflow-y: auto;
  padding: 15px;
  background: var(--ptb-bg);
}

.ptb-ai-message {
  max-width: 86%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.45;
}

.ptb-ai-message.user {
  margin-left: auto;
  background: var(--ptb-navy);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ptb-ai-message.assistant {
  margin-right: auto;
  background: #fff;
  color: var(--ptb-text);
  border: 1px solid var(--ptb-border);
  border-bottom-left-radius: 4px;
}

.ptb-ai-message.error {
  border-color: #d88;
}

.ptb-ai-message.typing {
  opacity: .65;
  font-style: italic;
}

.ptb-ai-suggestions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--ptb-border);
  background: #fff;
}

.ptb-ai-suggestions button {
  flex: 0 0 auto;
  border: 1px solid #c8cde5;
  background: #f7f8ff;
  color: var(--ptb-navy-dark);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  cursor: pointer;
}

.ptb-ai-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--ptb-border);
  background: #fff;
}

.ptb-ai-input {
  min-width: 0;
  flex: 1;
  border: 1px solid #cfd4de;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.ptb-ai-input:focus {
  border-color: var(--ptb-navy);
  box-shadow: 0 0 0 2px rgba(9,15,143,.10);
}

.ptb-ai-send {
  width: 43px;
  border: 0;
  border-radius: 10px;
  background: var(--ptb-navy);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}

.ptb-ai-send:disabled {
  opacity: .55;
  cursor: wait;
}

.ptb-ai-note {
  padding: 0 12px 10px;
  background: #fff;
  color: #697386;
  font-size: 10px;
  text-align: center;
}

.ptb-ai-embedded {
  max-width: 760px;
  margin: 25px auto;
}

.ptb-ai-embedded .ptb-ai-window {
  position: relative;
}

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

@media (max-width: 520px) {
  .ptb-ai-floating {
    right: 12px;
    bottom: 12px;
  }

  .ptb-ai-panel {
    right: -2px;
    width: min(380px, calc(100vw - 24px));
    bottom: 58px;
  }

  .ptb-ai-fab b {
    display: none;
  }

  .ptb-ai-fab {
    width: 50px;
    height: 50px;
    padding: 0;
    justify-content: center;
  }
}
