:root {
  --pp-accent: #0f8bd9;
  --pp-accent-dark: #0c6fac;
  --pp-ink: #0b2436;
  --pp-body: #5d666f;
  --pp-border: #e6edf2;
  --pp-surface: #f5f9fb;
  --pp-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#pp-agent-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pp-accent);
  color: #fff;
  border: 3px solid #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(11, 36, 54, 0.22);
  font-size: 26px;
  z-index: 999999;
  padding: 0;
  overflow: hidden;
  transition: transform 0.15s ease;
}

#pp-agent-launcher:hover {
  transform: scale(1.05);
}

#pp-agent-launcher.pp-pulse {
  animation: pp-pulse-ring 2s ease-out 3;
}

@keyframes pp-pulse-ring {
  0% { box-shadow: 0 6px 20px rgba(11, 36, 54, 0.22), 0 0 0 0 rgba(15, 139, 217, 0.55); }
  70% { box-shadow: 0 6px 20px rgba(11, 36, 54, 0.22), 0 0 0 14px rgba(15, 139, 217, 0); }
  100% { box-shadow: 0 6px 20px rgba(11, 36, 54, 0.22), 0 0 0 0 rgba(15, 139, 217, 0); }
}

#pp-agent-teaser {
  position: fixed;
  bottom: 30px;
  right: 96px;
  max-width: 240px;
  background: #fff;
  color: var(--pp-ink);
  border: 1px solid var(--pp-border);
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  padding: 12px 14px;
  font-family: var(--pp-font);
  font-size: 13px !important;
  line-height: 1.4 !important;
  box-shadow: 0 10px 30px rgba(11, 36, 54, 0.18);
  z-index: 999998;
  cursor: pointer;
  animation: pp-teaser-in 0.35s ease;
}

#pp-agent-teaser .close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pp-ink);
  color: #fff;
  border: 2px solid #fff;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@keyframes pp-teaser-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  #pp-agent-teaser {
    right: 20px;
    bottom: 92px;
    max-width: calc(100vw - 40px);
  }
}

#pp-agent-launcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#pp-agent-panel {
  position: fixed;
  bottom: 96px;
  right: 20px;
  width: 350px;
  max-width: calc(100vw - 40px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(11, 36, 54, 0.25), 0 0 0 1px rgba(15, 139, 217, 0.35),
    0 0 40px rgba(15, 139, 217, 0.35);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  font-family: var(--pp-font);
  border: 1px solid var(--pp-border);
}

#pp-agent-panel.open {
  display: flex;
}

#pp-agent-header {
  background: var(--pp-ink);
  color: #fff;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#pp-agent-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

#pp-agent-header-left img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--pp-accent);
}

#pp-agent-header small {
  display: block;
  font-weight: 600;
  opacity: 1;
  color: #f3e063;
  font-size: 11px;
  margin-top: 2px;
}

#pp-agent-brand {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--pp-body);
  padding: 8px 0;
  border-top: 1px solid var(--pp-border);
  background: var(--pp-surface);
}

#pp-agent-brand a {
  color: var(--pp-accent-dark);
  text-decoration: none;
  font-weight: 800;
}

#pp-agent-brand a:hover {
  text-decoration: underline;
}

#pp-agent-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
}

#pp-agent-close:hover {
  opacity: 1;
}

#pp-agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--pp-surface);
}

.pp-msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 13px !important;
  line-height: 1.45 !important;
  font-family: var(--pp-font) !important;
}

.pp-msg.user {
  align-self: flex-end;
  background: var(--pp-ink);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.pp-msg.assistant {
  align-self: flex-start;
  background: #fff;
  color: var(--pp-ink);
  border: 1px solid var(--pp-border);
  border-bottom-left-radius: 4px;
}

.pp-plan-card {
  align-self: flex-start;
  max-width: 90%;
  background: #fff;
  border: 1px solid var(--pp-border);
  border-left: 3px solid var(--pp-accent);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 12px;
}

.pp-plan-card .name {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--pp-ink);
}

.pp-plan-card .price {
  color: var(--pp-body);
  margin-bottom: 10px;
}

.pp-plan-card a {
  display: inline-block;
  background: var(--pp-accent);
  color: #fff;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.15s ease;
}

.pp-plan-card a:hover {
  background: var(--pp-accent-dark);
}

#pp-agent-inputrow {
  display: flex;
  border-top: 1px solid var(--pp-border);
  padding: 10px;
  gap: 8px;
  background: #fff;
}

#pp-agent-input {
  flex: 1;
  border: 1px solid var(--pp-border);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px !important;
  line-height: 1.4 !important;
  outline: none;
  font-family: var(--pp-font) !important;
  color: var(--pp-ink);
  box-shadow: none;
  height: auto;
}

#pp-agent-input:focus {
  border-color: var(--pp-accent);
}

#pp-agent-input::placeholder {
  color: #9ca3af;
}

#pp-agent-send {
  background: var(--pp-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

#pp-agent-send:hover:not(:disabled) {
  background: var(--pp-accent-dark);
}

#pp-agent-send:disabled {
  opacity: 0.5;
  cursor: default;
}
