:root {
  --pfx-ai-blue: #0044ff;
  --pfx-ai-lime: #d4fd41;
  --pfx-ai-ink: #0a0b0d;
  --pfx-ai-muted: #697177;
  --pfx-ai-line: rgba(10, 11, 13, .1);
}

.pfx-ai, .pfx-ai * { box-sizing: border-box; }
.pfx-ai { position: fixed; z-index: 999999; right: max(24px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); font-family: Aeonik, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--pfx-ai-ink); }
.pfx-ai button, .pfx-ai textarea { font: inherit; }
.pfx-ai__launcher { position: relative; display: grid; width: 64px; height: 64px; padding: 0; place-items: center; border: 0; border-radius: 22px; color: #fff; background: var(--pfx-ai-blue); box-shadow: 0 18px 46px rgba(0, 68, 255, .32); cursor: pointer; transition: transform .25s cubic-bezier(.22,1,.36,1), border-radius .25s ease, background .25s ease; }
.pfx-ai__launcher:hover { transform: translateY(-3px) scale(1.03); }
.pfx-ai__launcher:focus-visible, .pfx-ai button:focus-visible, .pfx-ai textarea:focus-visible, .pfx-ai a:focus-visible { outline: 3px solid var(--pfx-ai-lime); outline-offset: 3px; }
.pfx-ai__launcher-icon, .pfx-ai__launcher-close { grid-area: 1 / 1; transition: opacity .18s ease, transform .3s cubic-bezier(.22,1,.36,1); }
.pfx-ai__launcher-icon { width: 29px; height: 29px; }
.pfx-ai__launcher-icon svg, .pfx-ai__brand svg, .pfx-ai__send svg { display: block; width: 100%; height: 100%; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.pfx-ai__launcher-close { font-size: 34px; font-weight: 300; line-height: 1; opacity: 0; transform: rotate(-90deg) scale(.7); }
.pfx-ai__status { position: absolute; right: -3px; top: -3px; width: 17px; height: 17px; border: 4px solid #fff; border-radius: 50%; background: var(--pfx-ai-lime); }
.pfx-ai.is-open .pfx-ai__launcher { border-radius: 50%; background: #0a0b0d; }
.pfx-ai.is-open .pfx-ai__launcher-icon { opacity: 0; transform: rotate(90deg) scale(.7); }
.pfx-ai.is-open .pfx-ai__launcher-close { opacity: 1; transform: rotate(0) scale(1); }
.pfx-ai.is-open .pfx-ai__status { display: none; }

.pfx-ai__panel { position: absolute; right: 0; bottom: 78px; display: grid; grid-template-rows: auto minmax(150px, 1fr) auto auto auto; width: min(430px, calc(100vw - 32px)); height: min(690px, calc(100vh - 126px)); overflow: hidden; border: 1px solid rgba(255,255,255,.82); border-radius: 30px; background: linear-gradient(145deg, rgba(255,255,255,.97) 18%, rgba(238,247,255,.95) 100%); box-shadow: 0 30px 90px rgba(20, 37, 55, .24); backdrop-filter: blur(24px); opacity: 0; visibility: hidden; transform: translateY(24px) scale(.94); transform-origin: 92% 100%; pointer-events: none; transition: opacity .22s ease, transform .38s cubic-bezier(.16,1,.3,1), visibility 0s linear .38s; }
.pfx-ai__panel::before { content: ""; position: absolute; z-index: -1; top: -160px; right: -120px; width: 360px; height: 360px; border-radius: 50%; background: rgba(0, 68, 255, .17); filter: blur(52px); }
.pfx-ai.is-open .pfx-ai__panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); pointer-events: auto; transition-delay: 0s; }

.pfx-ai__header { display: grid; grid-template-columns: 48px 1fr 38px; gap: 12px; align-items: center; padding: 20px 20px 15px; border-bottom: 1px solid var(--pfx-ai-line); }
.pfx-ai__brand { display: grid; width: 48px; height: 48px; padding: 13px; place-items: center; border-radius: 16px; color: #fff; background: var(--pfx-ai-blue); box-shadow: 0 10px 25px rgba(0,68,255,.2); }
.pfx-ai__header strong { display: block; overflow: hidden; font-size: 18px; font-weight: 650; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; text-overflow: ellipsis; }
.pfx-ai__header span { display: block; margin-top: 4px; color: var(--pfx-ai-muted); font-size: 12px; line-height: 1.2; }
.pfx-ai__icon-button { width: 38px; height: 38px; padding: 0; border: 1px solid var(--pfx-ai-line); border-radius: 13px; color: var(--pfx-ai-ink); background: rgba(255,255,255,.78); font-size: 27px; font-weight: 300; line-height: 1; cursor: pointer; }

.pfx-ai__conversation { min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 18px 18px 8px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(0,68,255,.24) transparent; }
.pfx-ai__message { display: flex; align-items: flex-end; gap: 8px; margin: 0 0 14px; animation: pfx-ai-message .35s cubic-bezier(.16,1,.3,1) both; }
.pfx-ai__message--visitor { justify-content: flex-end; }
.pfx-ai__message-icon { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border: 1px solid rgba(0,68,255,.12); border-radius: 10px; color: var(--pfx-ai-blue); background: #fff; font-size: 15px; }
.pfx-ai__bubble { max-width: 84%; padding: 12px 14px; border: 1px solid var(--pfx-ai-line); border-radius: 17px 17px 17px 5px; color: #24282b; background: rgba(255,255,255,.94); font-size: 14px; line-height: 1.45; white-space: pre-line; }
.pfx-ai__message--visitor .pfx-ai__bubble { border: 0; border-radius: 17px 17px 5px 17px; color: #fff; background: var(--pfx-ai-blue); }
.pfx-ai__typing { display: flex; gap: 5px; width: 54px; padding: 13px 14px; }
.pfx-ai__typing i { width: 6px; height: 6px; border-radius: 50%; background: #8b949a; animation: pfx-ai-dot 1s ease-in-out infinite; }
.pfx-ai__typing i:nth-child(2) { animation-delay: .12s; }
.pfx-ai__typing i:nth-child(3) { animation-delay: .24s; }

.pfx-ai__project { margin: 0 0 14px 36px; overflow: hidden; border: 1px solid var(--pfx-ai-line); border-radius: 20px; background: rgba(255,255,255,.96); box-shadow: 0 13px 34px rgba(32,45,54,.08); animation: pfx-ai-message .42s cubic-bezier(.16,1,.3,1) both; }
.pfx-ai__project-media { position: relative; height: 132px; overflow: hidden; color: var(--pfx-ai-blue); background: linear-gradient(135deg, #dbeaff, #f7fbff); }
.pfx-ai__project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.16,1,.3,1); }
.pfx-ai__project:hover .pfx-ai__project-media img { transform: scale(1.035); }
.pfx-ai__project-media--empty { display: grid; place-items: center; font-size: 38px; }
.pfx-ai__score { position: absolute; left: 12px; bottom: 10px; padding: 6px 9px; border-radius: 8px; color: #101412; background: var(--pfx-ai-lime); font-size: 11px; font-weight: 750; line-height: 1; }
.pfx-ai__project-body { padding: 14px; }
.pfx-ai__project-eyebrow { overflow: hidden; margin-bottom: 5px; color: #7d858a; font-size: 10px; font-weight: 600; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.pfx-ai__project-body > strong { display: block; font-size: 17px; font-weight: 650; line-height: 1.2; letter-spacing: -.02em; }
.pfx-ai__facts { display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: center; margin-top: 10px; color: #50585d; font-size: 12px; }
.pfx-ai__facts b { color: var(--pfx-ai-blue); font-size: 15px; font-weight: 700; }
.pfx-ai__project-body p { margin: 10px 0 0; color: var(--pfx-ai-muted); font-size: 12px; line-height: 1.35; }
.pfx-ai__project-link { display: inline-flex; margin-top: 12px; color: var(--pfx-ai-ink); font-size: 12px; font-weight: 700; text-decoration: none; }
.pfx-ai__project-link::after { content: "↗"; margin-left: 5px; color: var(--pfx-ai-blue); }

.pfx-ai__suggestions { display: flex; gap: 7px; overflow-x: auto; padding: 8px 18px 10px; scrollbar-width: none; }
.pfx-ai__suggestions::-webkit-scrollbar { display: none; }
.pfx-ai__suggestions button { flex: 0 0 auto; padding: 8px 10px; border: 1px solid rgba(0,68,255,.16); border-radius: 10px; color: #22282d; background: rgba(255,255,255,.76); font-size: 11px; cursor: pointer; transition: border-color .2s, background .2s; }
.pfx-ai__suggestions button:hover { border-color: var(--pfx-ai-blue); background: #fff; }

.pfx-ai__form { display: grid; grid-template-columns: 1fr 46px; gap: 8px; align-items: end; margin: 0 14px 8px; padding: 7px 7px 7px 14px; border: 1px solid rgba(0,68,255,.14); border-radius: 18px; background: #fff; box-shadow: 0 12px 32px rgba(20,37,55,.1); }
.pfx-ai__form textarea { width: 100%; min-height: 44px; max-height: 116px; padding: 11px 0 7px; resize: none; border: 0; outline: 0; color: var(--pfx-ai-ink); background: transparent; font-size: 14px; line-height: 1.35; }
.pfx-ai__form textarea::placeholder { color: #929ba0; }
.pfx-ai__send { display: grid; width: 46px; height: 46px; padding: 13px; place-items: center; border: 0; border-radius: 14px; color: #fff; background: var(--pfx-ai-blue); cursor: pointer; transition: transform .2s, opacity .2s; }
.pfx-ai__send:hover { transform: translateY(-1px); }
.pfx-ai__send:disabled { opacity: .45; cursor: wait; }
.pfx-ai__honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.pfx-ai__powered { padding: 0 0 11px; color: #9aa2a7; font-size: 9px; letter-spacing: .025em; text-align: center; }

@keyframes pfx-ai-message { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pfx-ai-dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 560px) {
  .pfx-ai { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); }
  .pfx-ai__launcher { width: 58px; height: 58px; border-radius: 19px; }
  .pfx-ai__panel { position: fixed; inset: 10px 10px 82px; width: auto; height: auto; max-height: none; border-radius: 24px; transform-origin: 95% 100%; }
  .pfx-ai__header { padding: 15px; }
  .pfx-ai__conversation { padding: 15px 13px 6px; }
  .pfx-ai__project { margin-left: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .pfx-ai *, .pfx-ai *::before, .pfx-ai *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
