/* Phil Shannon Realty Assistant — animated bilingual chatbot */
#psa-root, #psa-root * { box-sizing: border-box; }
#psa-root { --psa-dark:#13293D; --psa-amber:#F2A541; --psa-teal:#2A7F8F; --psa-tint:#EAF2F4; --psa-red:#C8553D; --psa-green:#3A8F5C; --psa-ink:#1D2B36;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 15px; line-height: 1.4; color: var(--psa-ink); }
#psa-root.psa-floating { position: fixed; right: 22px; bottom: 22px; z-index: 999999; }
#psa-root.psa-inline { position: relative; max-width: 420px; margin: 20px auto; }

/* launcher */
.psa-launch { position: relative; width: 74px; height: 74px; border-radius: 50%; border: 4px solid var(--psa-amber); padding: 0; cursor: pointer;
  background: var(--psa-dark) center/cover no-repeat; box-shadow: 0 10px 30px rgba(19,41,61,.35); animation: psa-bob 3s ease-in-out infinite; transition: transform .25s; }
.psa-launch:hover { transform: scale(1.08) rotate(-4deg); }
.psa-launch::before, .psa-launch::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--psa-amber); animation: psa-ripple 2.4s ease-out infinite; pointer-events: none; }
.psa-launch::after { animation-delay: 1.2s; }
.psa-launch .psa-dot { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; background: var(--psa-green); border: 3px solid #fff; border-radius: 50%; animation: psa-pulse 1.6s infinite; }
.psa-teaser { position: absolute; right: 88px; bottom: 14px; width: 230px; background: #fff; color: var(--psa-ink); padding: 12px 14px; border-radius: 16px 16px 4px 16px;
  box-shadow: 0 10px 30px rgba(19,41,61,.2); font-size: 14px; animation: psa-teaser 0.7s .8s both cubic-bezier(.2,1.4,.4,1); cursor: pointer; }
.psa-teaser b { color: var(--psa-teal); }
.psa-teaser .psa-x { position: absolute; top: 4px; right: 8px; font-size: 14px; color: #999; cursor: pointer; }
.psa-wave { display: inline-block; animation: psa-wave 1.8s 1.6s 3; transform-origin: 70% 70%; }

/* window */
.psa-win { position: absolute; right: 0; bottom: 90px; width: 380px; max-width: calc(100vw - 30px); height: 600px; max-height: calc(100vh - 130px); background: #fff; border-radius: 22px;
  box-shadow: 0 24px 60px rgba(19,41,61,.35); display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right;
  transform: scale(.2) translateY(40px); opacity: 0; pointer-events: none; transition: transform .45s cubic-bezier(.2,1.3,.4,1), opacity .3s; }
.psa-inline .psa-win { position: relative; bottom: auto; right: auto; width: 100%; transform: none; opacity: 1; pointer-events: auto; }
.psa-open .psa-win { transform: none; opacity: 1; pointer-events: auto; }
.psa-open .psa-teaser { display: none; }

.psa-head { position: relative; background: var(--psa-dark); color: #fff; padding: 16px 16px 14px; display: flex; align-items: center; gap: 12px; overflow: hidden; }
.psa-head::before, .psa-head::after { content: ""; position: absolute; border-radius: 50%; background: var(--psa-teal); opacity: .35; animation: psa-drift 9s ease-in-out infinite alternate; }
.psa-head::before { width: 160px; height: 160px; right: -50px; top: -80px; }
.psa-head::after { width: 90px; height: 90px; right: 90px; bottom: -60px; background: var(--psa-amber); opacity: .25; animation-duration: 7s; }
.psa-av { position: relative; z-index: 1; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--psa-amber); background: center/cover no-repeat; flex: none; }
.psa-av::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; background: var(--psa-green); border: 2px solid var(--psa-dark); }
.psa-ht { position: relative; z-index: 1; flex: 1; min-width: 0; }
.psa-ht b { display: block; font-size: 17px; }
.psa-ht span { font-size: 12.5px; color: #cfe0e6; }
.psa-lang { position: relative; z-index: 1; display: flex; background: rgba(255,255,255,.12); border-radius: 20px; padding: 3px; }
.psa-lang button { border: 0; background: none; color: #fff; font-weight: 700; font-size: 12px; padding: 5px 9px; border-radius: 16px; cursor: pointer; transition: background .25s, color .25s; }
.psa-lang button.on { background: var(--psa-amber); color: var(--psa-dark); }
.psa-close { position: relative; z-index: 1; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 0 4px; transition: transform .25s; }
.psa-close:hover { transform: rotate(90deg); }
.psa-inline .psa-close { display: none; }

.psa-body { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: linear-gradient(#f6fafb, #fff); scroll-behavior: smooth; }
.psa-msg { display: flex; margin: 8px 0; animation: psa-in .45s both cubic-bezier(.2,1.2,.4,1); }
.psa-msg.bot { justify-content: flex-start; }
.psa-msg.me { justify-content: flex-end; }
.psa-bub { max-width: 86%; padding: 10px 13px; border-radius: 16px; box-shadow: 0 2px 6px rgba(19,41,61,.07); }
.bot .psa-bub { background: #fff; border: 1px solid #e3ecef; border-bottom-left-radius: 4px; }
.me .psa-bub { background: var(--psa-teal); color: #fff; border-bottom-right-radius: 4px; }
.psa-bub b { color: var(--psa-dark); }
.me .psa-bub b { color: #fff; }
.psa-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.psa-typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--psa-teal); animation: psa-dots 1s infinite; }
.psa-typing i:nth-child(2) { animation-delay: .15s; } .psa-typing i:nth-child(3) { animation-delay: .3s; }

.psa-list { list-style: none; margin: 8px 0 0; padding: 0; }
.psa-list li { display: flex; gap: 10px; align-items: flex-start; margin: 7px 0; opacity: 0; animation: psa-slide .4s both; }
.psa-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--psa-teal); }
.psa-n.red { background: var(--psa-red); } .psa-n.green { background: var(--psa-green); } .psa-n.dark { background: var(--psa-dark); color: var(--psa-amber); }
.psa-list small { display: block; color: #55646e; font-size: 13px; }

.psa-check { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 6px 4px; border-radius: 10px; transition: background .2s; }
.psa-check:hover { background: var(--psa-tint); }
.psa-box { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--psa-teal); display: flex; align-items: center; justify-content: center; transition: all .25s; }
.psa-check.done .psa-box { background: var(--psa-green); border-color: var(--psa-green); animation: psa-pop .35s; }
.psa-check.done .psa-box::after { content: "✓"; color: #fff; font-weight: 900; font-size: 14px; }
.psa-check.done span { text-decoration: line-through; color: #7d8f99; }
.psa-prog { height: 8px; background: var(--psa-tint); border-radius: 8px; overflow: hidden; margin: 10px 0 4px; }
.psa-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--psa-teal), var(--psa-green)); transition: width .5s cubic-bezier(.2,1,.4,1); }

.psa-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 14px 4px; }
.psa-chip { border: 2px solid var(--psa-teal); background: #fff; color: var(--psa-teal); font-weight: 700; font-size: 13px; padding: 6px 11px; border-radius: 18px; cursor: pointer;
  opacity: 0; animation: psa-up .35s both; transition: background .2s, color .2s, transform .2s; }
.psa-chip:hover { background: var(--psa-teal); color: #fff; transform: translateY(-2px); }
.psa-chip.amber { border-color: var(--psa-amber); color: var(--psa-dark); background: var(--psa-amber); }

.psa-foot { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid #e3ecef; }
.psa-foot input { flex: 1; border: 2px solid #dbe6ea; border-radius: 22px; padding: 9px 14px; font-size: 14px; outline: none; transition: border-color .2s; min-width: 0; }
.psa-foot input:focus { border-color: var(--psa-teal); }
.psa-send { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; background: var(--psa-amber); color: var(--psa-dark); font-size: 18px; cursor: pointer; transition: transform .2s; }
.psa-send:hover { transform: scale(1.1) rotate(-12deg); }
.psa-cta { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.psa-cta a { flex: 1; text-align: center; text-decoration: none; background: var(--psa-dark); color: #fff !important; padding: 9px 10px; border-radius: 12px; font-weight: 700; font-size: 13px; transition: transform .2s; }
.psa-cta a:hover { transform: translateY(-2px); }
.psa-cta a.amber { background: var(--psa-amber); color: var(--psa-dark) !important; }
.psa-form input, .psa-form select, .psa-form textarea { width: 100%; margin: 4px 0; border: 2px solid #dbe6ea; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; }
.psa-form button { width: 100%; margin-top: 6px; border: 0; background: var(--psa-amber); color: var(--psa-dark); font-weight: 800; padding: 10px; border-radius: 12px; cursor: pointer; }
.psa-credit { text-align: center; font-size: 11px; color: #9aa9b1; padding: 0 0 8px; }
.psa-confetti { position: absolute; width: 8px; height: 12px; top: 0; animation: psa-fall 1.6s ease-in forwards; pointer-events: none; z-index: 5; }

@keyframes psa-bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
@keyframes psa-ripple { 0% { transform: scale(1); opacity: .8 } 100% { transform: scale(1.6); opacity: 0 } }
@keyframes psa-pulse { 0%,100% { transform: scale(1) } 50% { transform: scale(1.25) } }
@keyframes psa-teaser { 0% { opacity: 0; transform: translateX(30px) scale(.6) } 100% { opacity: 1; transform: none } }
@keyframes psa-wave { 0%,60%,100% { transform: rotate(0) } 10%,30% { transform: rotate(18deg) } 20%,40% { transform: rotate(-10deg) } }
@keyframes psa-drift { 0% { transform: translate(0,0) } 100% { transform: translate(-30px,20px) scale(1.2) } }
@keyframes psa-in { 0% { opacity: 0; transform: translateY(14px) scale(.96) } 100% { opacity: 1; transform: none } }
@keyframes psa-slide { 0% { opacity: 0; transform: translateX(-16px) } 100% { opacity: 1; transform: none } }
@keyframes psa-up { 0% { opacity: 0; transform: translateY(10px) } 100% { opacity: 1; transform: none } }
@keyframes psa-dots { 0%,100% { transform: translateY(0); opacity: .4 } 50% { transform: translateY(-5px); opacity: 1 } }
@keyframes psa-pop { 0% { transform: scale(.5) } 70% { transform: scale(1.2) } 100% { transform: scale(1) } }
@keyframes psa-fall { 0% { transform: translateY(0) rotate(0); opacity: 1 } 100% { transform: translateY(520px) rotate(540deg); opacity: 0 } }
@media (prefers-reduced-motion: reduce) { #psa-root *, #psa-root *::before, #psa-root *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition: none !important; } }
@media (max-width: 480px) { #psa-root.psa-floating { right: 12px; bottom: 12px; } .psa-win { height: calc(100vh - 120px); } .psa-teaser { width: 190px; } }
