/* ---------- shared (competitor tool) ---------- */
.pa-app {
  --pa-bg: #f7f4ee; --pa-surface: #ffffff; --pa-ink: #1f1b16; --pa-muted: #6b6258;
  --pa-border: #e4ddce; --pa-border-d: #d4cab5; --pa-accent: #2f7d54;
  font-family: 'Inter', system-ui, sans-serif; color: var(--pa-ink);
  background: var(--pa-bg); border-radius: 16px; padding: 26px 22px; max-width: 820px; margin: 0 auto; box-sizing: border-box;
}
.pa-app.pa-competitor { --pa-accent: #2f7d54; }
.pa-app * { box-sizing: border-box; }

.pa-head { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; flex-wrap: wrap; }
.pa-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--pa-muted); }
.pa-switch { margin-left: auto; display: inline-flex; gap: 3px; padding: 3px; background: var(--pa-surface); border: 1px solid var(--pa-border); border-radius: 10px; }
.pa-switch button { border: none; background: transparent; cursor: pointer; padding: 6px 12px; border-radius: 7px; font: 600 13px/1 'Inter', sans-serif; color: var(--pa-muted); }
.pa-switch button.is-active { background: var(--pa-ink); color: #fff; }

.pa-title { font-family: 'Inter', serif; font-weight: 800; font-size: 30px; line-height: 1.08; margin: 6px 0 6px; }
.pa-sub { color: var(--pa-muted); font-size: 15px; margin: 0 0 18px; max-width: 600px; }

.pa-panel { background: var(--pa-surface); border: 1px solid var(--pa-border); border-radius: 14px; padding: 18px; }
.pa-label { font-weight: 600; font-size: 13px; display: block; margin-bottom: 8px; }
.pa-input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--pa-border-d); background: #fffdf9; font: 400 15px/1.5 'Inter', sans-serif; color: var(--pa-ink); }
.pa-input:focus { outline: none; border-color: var(--pa-accent); }
.pa-field-label { font-weight: 600; font-size: 13px; margin-top: 16px; }

.pa-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.pa-chip { border: none; cursor: pointer; padding: 6px 11px; border-radius: 8px; font: 500 12.5px 'Inter', sans-serif; color: var(--pa-muted); background: transparent; box-shadow: inset 0 0 0 1px var(--pa-border); }
.pa-chip.is-active { background: var(--pa-accent); color: #fff; box-shadow: none; }

.pa-btn { border: none; margin-top: 18px; width: 100%; padding: 13px; border-radius: 11px; background: var(--pa-accent); color: #fff; font: 700 15px 'Inter', sans-serif; cursor: pointer; }
.pa-btn:disabled { background: var(--pa-border-d); cursor: not-allowed; }

.pa-note { margin-top: 16px; padding: 13px; border-radius: 10px; background: #fbe6df; color: #cf4524; font-size: 14px; font-weight: 500; }
.pa-loading { margin-top: 18px; font-size: 14px; color: var(--pa-muted); }
.pa-progress { height: 3px; border-radius: 999px; background: var(--pa-border); overflow: hidden; position: relative; margin-bottom: 8px; }
.pa-progress > span { position: absolute; width: 33%; height: 100%; background: var(--pa-accent); animation: paScan 1.3s infinite linear; }
@keyframes paScan { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }

.pa-result { margin-top: 24px; }
.pa-headline { font-family: 'Inter', serif; font-weight: 700; font-size: 19px; line-height: 1.35; margin-bottom: 18px; padding-left: 15px; border-left: 3px solid var(--pa-accent); }
.pa-meta { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--pa-muted); margin-bottom: 12px; }
.pa-insight { background: var(--pa-surface); border: 1px solid var(--pa-border); border-radius: 12px; padding: 15px; margin-bottom: 11px; }
.pa-cat { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: var(--pa-accent); padding: 3px 8px; border-radius: 5px; }
.pa-insight-title { font-weight: 700; font-size: 15px; margin-left: 9px; }
.pa-insight-detail { font-size: 14px; line-height: 1.55; color: var(--pa-muted); margin: 8px 0; }
.pa-source { font-size: 11px; color: var(--pa-muted); }
.pa-block { margin-top: 14px; padding: 16px; border-radius: 13px; background: var(--pa-surface); border: 1px solid var(--pa-border); }
.pa-block-title { font-weight: 700; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 8px; }
.pa-list { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.7; }
.pa-fine { font-size: 11px; color: var(--pa-muted); margin-top: 18px; opacity: .85; }

/* ---------- chat widget ---------- */
.pa-chat {
  --pa-accent: #449AFC;
  font-family: 'Inter', system-ui, sans-serif; color: #1f1b16;
  display: flex; flex-direction: column; background: #fff; border: 1px solid #CED4E6;
  border-radius: 8px; overflow: hidden; width: 100%; max-width: 440px;
  height: 560px; max-height: 80vh; box-shadow: 0 10px 40px rgba(0,0,0,.08); box-sizing: border-box;
}
.pa-chat * { box-sizing: border-box; }
.pa-chat-head { display: flex; align-items: center; gap: 8px; padding: 13px 16px; background: #181D31; color: #fff; }
.pa-chat-name { font-weight: 700; font-size: 15px; }
.pa-chat-switch { margin-left: auto; display: inline-flex; gap: 3px; }
.pa-chat-switch button { border: none; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; padding: 4px 9px; border-radius: 6px; font: 600 11px 'Inter', sans-serif; }
.pa-chat-switch button.is-active { background: var(--pa-accent); }
.pa-chat-close { margin-left: auto; background: transparent; border: none; color: #fff; cursor: pointer; font-size: 22px; line-height: 1; padding: 0 4px; }
.pa-chat-switch + .pa-chat-close { margin-left: 6px; }
.pa-chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.pa-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.pa-msg.bot { align-self: flex-start; background: #F0F0F0; color: #434453; border: none; border-bottom-left-radius: 4px; }
.pa-msg.user { align-self: flex-end; background: var(--pa-accent); color: #fff; border-bottom-right-radius: 4px; }
.pa-typing { align-self: flex-start; color: #434453; font-size: 13px; font-style: italic; }
.pa-chat-suggest { display: flex; flex-wrap: nowrap; gap: 7px; padding: 10px 13px; color: #434453; background: #F4F6FA; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.pa-chat-suggest:empty { display: none; }
.pa-chat-suggest .pa-chip { background: #fff; border: 1px solid #CED4E6; margin: 0; flex: 0 0 auto; white-space: nowrap; }
.pa-chat-suggest::-webkit-scrollbar { height: 6px; }
.pa-chat-suggest::-webkit-scrollbar-thumb { background: #CED4E6; border-radius: 999px; }
.pa-chat-suggest::-webkit-scrollbar-track { background: transparent; }
.pa-chat-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #CED4E6; background: #fff; }
.pa-chat-input { height: auto !important; flex: 1; border: 1px solid #CED4E6; border-radius: 8px; padding: 10px 12px; font: 400 14.5px/1.4 'Inter', sans-serif; resize: none; max-height: 120px; color: #434453; background: #fbfbfb; transition: all 0.2s ease-out; }
.pa-chat-input:focus { outline: none; border-color: var(--pa-accent); }
.pa-send { border: none; background: var(--pa-accent); color: #fff; border-radius: 8px; padding: 0 16px; font: 600 14px 'Inter', sans-serif; cursor: pointer; transition: all 0.2s ease-out; }
.pa-send:hover {
  background: #3184e3 !important;
}
.pa-send:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- floating bubble ---------- */
.pa-bubble-launcher {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 99998;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #449AFC;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;

  /* Needed for pulse */
  overflow: visible;
}

.pa-bubble-launcher::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(68, 154, 252, 0.6);
  z-index: -1;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.6);
    opacity: 0;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.pa-bubble-launcher svg { width: 26px; height: 26px; }
.pa-bubble-panel { position: fixed; bottom: 90px; right: 22px; z-index: 99999; width: 380px; max-width: calc(100vw - 36px); display: none; }
.pa-bubble-panel.is-open { display: block; }
.pa-bubble-launcher.pa-pos-bl { right: auto; left: 22px; }
.pa-bubble-panel.pa-pos-bl { right: auto; left: 22px; }
.pa-bubble-panel .pa-chat { height: 62vh; max-height: 600px; max-width: none; }
@media (max-width: 480px) { .pa-bubble-panel { left: 12px; right: 12px; bottom: 86px; width: auto; } .pa-app { padding: 20px 14px; } .pa-title { font-size: 25px; } }
