/* ContractorPro.Leads Assistant (contractor pages only). Everything is scoped under #cpla-root / .cpla-* so the
   dashboard's global button/input/label styles never leak in, and nothing here leaks out. */
#cpla-root { --cpla-navy:#0a2f66; --cpla-blue:#0b63ce; --cpla-blue-dark:#084c9e; --cpla-soft:#eef4fc; --cpla-line:#dde4ee;
  --cpla-ink:#14213d; --cpla-muted:#5f6b7d; --cpla-green:#3aa834;
  font:15px/1.5 Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; color:var(--cpla-ink); }
#cpla-root[hidden] { display:none !important; }
#cpla-root *, #cpla-root *::before, #cpla-root *::after { box-sizing:border-box; }
#cpla-root button { font:inherit; margin:0; cursor:pointer; -webkit-tap-highlight-color:transparent; }
#cpla-root button:focus-visible, #cpla-root input:focus-visible, #cpla-root a:focus-visible { outline:3px solid #7fb2f0; outline-offset:2px; }
#cpla-root img { display:block; }

/* ---- launcher ---- */
#cpla-root .cpla-launch { position:fixed; z-index:2147483000; right:calc(18px + env(safe-area-inset-right, 0px)); bottom:calc(18px + env(safe-area-inset-bottom, 0px));
  width:64px; height:76px; padding:0; border:0; background:transparent; display:flex; flex-direction:column; align-items:center; }
#cpla-root .cpla-launch .cpla-face { width:64px; height:64px; border-radius:50%; overflow:hidden; background:#dbeafe; border:3px solid #fff;
  box-shadow:0 6px 20px rgba(10,47,102,.28), 0 1px 3px rgba(10,47,102,.25); transition:transform .18s ease; }
#cpla-root .cpla-launch .cpla-face img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
#cpla-root .cpla-launch .cpla-tag { margin-top:-12px; position:relative; background:var(--cpla-navy); color:#fff; font-size:12px; font-weight:700;
  letter-spacing:.02em; line-height:1; padding:5px 10px; border-radius:999px; border:2px solid #fff; box-shadow:0 2px 6px rgba(10,47,102,.25); }
#cpla-root .cpla-launch .cpla-dot { position:absolute; top:2px; right:2px; width:14px; height:14px; border-radius:50%; background:var(--cpla-green); border:2px solid #fff; }
#cpla-root .cpla-launch:hover .cpla-face { transform:translateY(-2px); }
#cpla-root.cpla-open .cpla-launch, #cpla-root.cpla-typing-elsewhere .cpla-launch { display:none; }

/* ---- panel ---- */
#cpla-root .cpla-panel { position:fixed; z-index:2147483001; right:calc(18px + env(safe-area-inset-right, 0px)); bottom:calc(18px + env(safe-area-inset-bottom, 0px));
  width:392px; height:min(640px, calc(100vh - 36px)); background:#fff; border-radius:18px; border:1px solid var(--cpla-line);
  box-shadow:0 24px 60px rgba(10,47,102,.28), 0 2px 8px rgba(10,47,102,.12); display:flex; flex-direction:column; overflow:hidden; }
#cpla-root .cpla-panel[hidden] { display:none; }
#cpla-root .cpla-head { background:var(--cpla-navy); color:#fff; padding:12px 12px 12px 14px; display:flex; align-items:center; gap:10px; flex:none; }
#cpla-root .cpla-head .cpla-av { width:40px; height:40px; border-radius:50%; overflow:hidden; border:2px solid rgba(255,255,255,.85); flex:none; background:#dbeafe; }
#cpla-root .cpla-head .cpla-av img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
#cpla-root .cpla-head .cpla-ttl { flex:1; min-width:0; }
#cpla-root .cpla-head h2 { margin:0; font-size:15px; font-weight:700; line-height:1.25; color:#fff; letter-spacing:0; }
#cpla-root .cpla-head .cpla-sub { font-size:12px; color:rgba(255,255,255,.72); display:flex; align-items:center; gap:5px; }
#cpla-root .cpla-head .cpla-sub::before { content:""; width:7px; height:7px; border-radius:50%; background:#6fdc6a; }
#cpla-root .cpla-lang { display:flex; border:1px solid rgba(255,255,255,.35); border-radius:999px; padding:2px; flex:none; }
#cpla-root .cpla-lang button { background:transparent; border:0; color:rgba(255,255,255,.85); font-size:12px; font-weight:700; padding:4px 9px; border-radius:999px; min-width:34px; }
#cpla-root .cpla-lang button[aria-pressed="true"] { background:#fff; color:var(--cpla-navy); }
#cpla-root .cpla-x { background:transparent; border:0; color:#fff; width:36px; height:36px; border-radius:10px; display:grid; place-items:center; flex:none; padding:0; }
#cpla-root .cpla-x:hover { background:rgba(255,255,255,.12); }
#cpla-root .cpla-x svg { width:20px; height:20px; }

#cpla-root .cpla-body { flex:1; min-height:0; overflow-y:auto; padding:14px 14px 6px; background:#f6f8fc; overscroll-behavior:contain; }
#cpla-root .cpla-row { display:flex; gap:8px; align-items:flex-end; margin:0 0 10px; }
#cpla-root .cpla-row.cpla-me { justify-content:flex-end; }
#cpla-root .cpla-row .cpla-mini { width:28px; height:28px; border-radius:50%; overflow:hidden; flex:none; background:#dbeafe; border:1px solid var(--cpla-line); }
#cpla-root .cpla-row .cpla-mini img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
#cpla-root .cpla-bubble { max-width:84%; padding:9px 12px; border-radius:16px; white-space:pre-wrap; overflow-wrap:anywhere; font-size:14.5px; line-height:1.5; }
#cpla-root .cpla-bot .cpla-bubble { background:#fff; border:1px solid var(--cpla-line); border-bottom-left-radius:5px; color:var(--cpla-ink); }
#cpla-root .cpla-me .cpla-bubble { background:var(--cpla-blue); color:#fff; border-bottom-right-radius:5px; }
#cpla-root .cpla-bubble a { color:var(--cpla-blue-dark); font-weight:600; }
#cpla-root .cpla-me .cpla-bubble a { color:#fff; }
#cpla-root .cpla-sr { position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

#cpla-root .cpla-quick { margin:4px 0 12px 36px; }
#cpla-root .cpla-quick h3 { font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--cpla-muted); margin:0 0 6px; font-weight:700; }
#cpla-root .cpla-quick ul { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:6px; }
#cpla-root .cpla-quick button { background:#fff; color:var(--cpla-blue-dark); border:1px solid #bcd3f0; border-radius:999px; padding:7px 12px; font-size:13.5px; font-weight:600; text-align:left; line-height:1.3; }
#cpla-root .cpla-quick button:hover { background:var(--cpla-soft); border-color:var(--cpla-blue); }

#cpla-root .cpla-team { margin:-2px 0 12px 36px; display:flex; flex-direction:column; gap:6px; align-items:flex-start; }
#cpla-root .cpla-team button.cpla-teambtn { background:var(--cpla-green); color:#fff; border:0; border-radius:10px; padding:8px 14px; font-size:14px; font-weight:700; }
#cpla-root .cpla-team button.cpla-teambtn:hover { background:#2f8c2a; }
#cpla-root .cpla-team label { font-size:13px; font-weight:600; color:var(--cpla-ink); margin:0; display:block; }
#cpla-root .cpla-team input { width:min(260px, 100%); padding:8px 10px; font:inherit; font-size:14px; border:1px solid #c5d0de; border-radius:9px; background:#fff; color:var(--cpla-ink); margin:0; box-shadow:none; }
#cpla-root .cpla-team .cpla-err { color:#b42318; font-size:13px; }

#cpla-root .cpla-typing .cpla-bubble { display:inline-flex; gap:4px; align-items:center; padding:12px 14px; }
#cpla-root .cpla-typing i { width:7px; height:7px; border-radius:50%; background:#9fb0c8; animation:cpla-b 1.1s infinite ease-in-out; }
#cpla-root .cpla-typing i:nth-child(2) { animation-delay:.15s; }
#cpla-root .cpla-typing i:nth-child(3) { animation-delay:.3s; }
@keyframes cpla-b { 0%,80%,100% { transform:translateY(0); opacity:.5; } 40% { transform:translateY(-4px); opacity:1; } }

#cpla-root .cpla-foot { flex:none; border-top:1px solid var(--cpla-line); background:#fff; padding:10px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
#cpla-root .cpla-form { display:flex; gap:8px; margin:0; }
#cpla-root .cpla-form input { flex:1; min-width:0; padding:10px 12px; font:inherit; font-size:16px; border:1px solid #c5d0de; border-radius:12px; background:#fff; color:var(--cpla-ink); margin:0; box-shadow:none; width:auto; }
#cpla-root .cpla-form input:focus { border-color:var(--cpla-blue); box-shadow:0 0 0 3px rgba(11,99,206,.15); outline:none; }
#cpla-root .cpla-form button { background:var(--cpla-blue); color:#fff; border:0; border-radius:12px; padding:0 16px; font-weight:700; font-size:14.5px; min-height:44px; }
#cpla-root .cpla-form button:hover { background:var(--cpla-blue-dark); }
#cpla-root .cpla-form button[disabled] { opacity:.55; cursor:default; }
#cpla-root .cpla-note { font-size:11.5px; color:var(--cpla-muted); margin:6px 2px 0; text-align:center; }

/* phones: launcher smaller, room under the page content so it never sits on a submit button; panel = full-screen sheet */
@media (max-width:760px) {
  body.cpla-pad { padding-bottom:88px !important; }
  #cpla-root .cpla-launch { right:calc(12px + env(safe-area-inset-right, 0px)); bottom:calc(12px + env(safe-area-inset-bottom, 0px)); width:56px; height:68px; }
  #cpla-root .cpla-launch .cpla-face { width:56px; height:56px; }
}
@media (max-width:560px) {
  #cpla-root .cpla-panel { inset:0; right:0; bottom:0; width:100%; height:100%; height:100dvh; border-radius:0; border:0; }
  #cpla-root .cpla-head { padding-top:calc(12px + env(safe-area-inset-top, 0px)); }
  #cpla-root .cpla-bubble { max-width:88%; }
}
@media (prefers-reduced-motion:reduce) {
  #cpla-root .cpla-typing i { animation:none; opacity:.8; }
  #cpla-root .cpla-launch .cpla-face { transition:none; }
}
@media print { #cpla-root { display:none !important; } }
