/* PEATS assistant — chat widget (loaded on every public page). */
.pb-root, .pb-win, .pb-root *, .pb-win * { box-sizing: border-box; }
.pb-root { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 2147483000; font-family: var(--font-body, Inter, system-ui, sans-serif); }

/* launcher */
.pb-launch {
  position: relative; display: grid; place-items: center; width: 3.6rem; height: 3.6rem; margin-left: auto; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: var(--navy, #0b1220);
  box-shadow: 0 10px 30px rgba(11, 18, 32, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: transform 300ms var(--ease, ease), box-shadow 300ms ease;
}
.pb-launch:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 36px rgba(11, 18, 32, 0.42); }
.pb-launch:focus-visible { outline: 2px solid var(--accent, #d96a2b); outline-offset: 3px; }
.pb-launch svg { width: 1.5rem; height: 1.5rem; }
.pb-dot { position: absolute; top: 0.2rem; right: 0.2rem; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: #2ecc71; border: 2px solid var(--navy, #0b1220); }

/* small prompt above the launcher */
.pb-nudge {
  position: relative; max-width: 15rem; margin: 0 0 0.7rem auto; padding: 0.75rem 1rem; border-radius: 14px 14px 4px 14px;
  background: #fff; color: #0b1220; font-size: 0.86rem; line-height: 1.45; cursor: pointer;
  box-shadow: 0 10px 30px rgba(11, 18, 32, 0.18); animation: pbUp 400ms ease both;
}
.pb-nudge b { color: var(--accent-dark, #a64a17); }
.pb-nudge-x { position: absolute; top: -0.45rem; right: -0.45rem; width: 1.3rem; height: 1.3rem; padding: 0; border: 0; border-radius: 50%; background: #0b1220; color: #fff; font-size: 0.75rem; line-height: 1; cursor: pointer; }
@keyframes pbUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* window */
.pb-win {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 2147483000; display: none; flex-direction: column;
  width: min(24.5rem, calc(100vw - 2rem)); height: min(40rem, calc(100vh - 2.5rem)); overflow: hidden; border-radius: 18px;
  background: #f4f6f9; color: #0b1220; font-family: var(--font-body, Inter, system-ui, sans-serif);
  box-shadow: 0 28px 80px rgba(5, 8, 15, 0.45); animation: pbUp 300ms ease both;
}
.pb-win.pb-open { display: flex; }

.pb-head { display: flex; flex: none; align-items: center; gap: 0.8rem; padding: 0.95rem 1rem; color: #fff; background: linear-gradient(135deg, #0b1220, #16233b); }
.pb-av { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; overflow: hidden; border-radius: 11px; background: #fff; }
.pb-av img { width: 100%; height: 100%; object-fit: cover; }
.pb-htxt { flex: 1; min-width: 0; }
.pb-htxt h4 { margin: 0; font-family: var(--font-head, Sora, sans-serif); font-size: 0.98rem; font-weight: 600; letter-spacing: -0.01em; color: #fff; }
.pb-htxt span { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.15rem; font-size: 0.75rem; color: rgba(255, 255, 255, 0.7); }
.pb-live { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #2ecc71; }
.pb-x { display: grid; place-items: center; flex: none; width: 2.2rem; height: 2.2rem; padding: 0; border: 0; border-radius: 9px; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.pb-x:hover { background: rgba(255, 255, 255, 0.26); }
.pb-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.pb-body { display: flex; flex: 1; flex-direction: column; gap: 0.7rem; padding: 1rem 0.95rem 0.5rem; overflow-y: auto; overscroll-behavior: contain; }
.pb-msg { max-width: 88%; padding: 0.7rem 0.9rem; border-radius: 15px; font-size: 0.9rem; line-height: 1.55; word-wrap: break-word; animation: pbUp 220ms ease both; }
.pb-bot { align-self: flex-start; border-bottom-left-radius: 4px; background: #fff; color: #1b2433; box-shadow: 0 2px 9px rgba(11, 18, 32, 0.07); }
.pb-user { align-self: flex-end; border-bottom-right-radius: 4px; background: #0b1220; color: #fff; }
.pb-msg p { margin: 0; color: inherit; }
.pb-msg p + p { margin-top: 0.55rem; }
.pb-msg strong { font-weight: 700; }
.pb-msg a { color: var(--accent-dark, #a64a17); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pb-li { position: relative; padding-left: 1rem; margin-top: 0.3rem; }
.pb-li::before { content: ""; position: absolute; left: 0.1rem; top: 0.7em; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--accent, #d96a2b); }

.pb-chips { display: flex; flex-wrap: wrap; align-self: flex-start; gap: 0.45rem; max-width: 96%; }
.pb-chip { padding: 0.45rem 0.8rem; border: 1.5px solid #0b1220; border-radius: 999px; background: #fff; color: #0b1220; font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: background 160ms, color 160ms; }
.pb-chip:hover, .pb-chip:focus-visible { background: #0b1220; color: #fff; outline: none; }
.pb-chip-lead { border-color: var(--accent, #d96a2b); color: var(--accent-dark, #a64a17); }
.pb-chip-lead:hover, .pb-chip-lead:focus-visible { background: var(--accent, #d96a2b); border-color: var(--accent, #d96a2b); color: #fff; }

.pb-type { display: flex; align-self: flex-start; gap: 0.25rem; padding: 0.8rem 1rem; border-radius: 15px; border-bottom-left-radius: 4px; background: #fff; box-shadow: 0 2px 9px rgba(11, 18, 32, 0.07); }
.pb-type i { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: #b6bdc7; animation: pbBounce 1.3s infinite; }
.pb-type i:nth-child(2) { animation-delay: 0.18s; }
.pb-type i:nth-child(3) { animation-delay: 0.36s; }
@keyframes pbBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-4px); opacity: 1; } }

/* lead form inside the chat */
.pb-form { align-self: stretch; display: grid; gap: 0.6rem; padding: 0.95rem; border-radius: 15px; background: #fff; box-shadow: 0 2px 12px rgba(11, 18, 32, 0.09); animation: pbUp 250ms ease both; }
.pb-form h5 { margin: 0; font-family: var(--font-head, Sora, sans-serif); font-size: 0.95rem; font-weight: 600; color: #0b1220; }
.pb-form p { margin: 0; font-size: 0.78rem; color: #5b6577; }
.pb-form label { display: grid; gap: 0.2rem; font-size: 0.74rem; font-weight: 600; color: #2b3445; }
.pb-form input[type="text"], .pb-form input[type="email"], .pb-form input[type="tel"], .pb-form select, .pb-form textarea {
  width: 100%; padding: 0.55rem 0.65rem; border: 1px solid rgba(11, 18, 32, 0.18); border-radius: 9px; background: #fff; color: #0b1220; font: inherit; font-size: 0.86rem; font-weight: 400;
}
.pb-form textarea { resize: vertical; min-height: 3.6rem; }
.pb-form input:focus-visible, .pb-form select:focus-visible, .pb-form textarea:focus-visible { outline: 2px solid var(--accent, #d96a2b); outline-offset: 1px; }
.pb-form .pb-consent { display: flex; align-items: flex-start; gap: 0.5rem; font-weight: 400; font-size: 0.74rem; color: #5b6577; line-height: 1.4; }
.pb-form .pb-consent input { flex: none; margin-top: 0.1rem; accent-color: var(--accent, #d96a2b); }
.pb-form-err { color: #b3261e; font-size: 0.78rem; }
.pb-send { padding: 0.65rem 1rem; border: 0; border-radius: 10px; background: var(--accent, #d96a2b); color: #fff; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.pb-send:hover { background: var(--accent-dark, #a64a17); }
.pb-send:disabled { opacity: 0.6; cursor: wait; }
.pb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* input bar */
.pb-input { display: flex; flex: none; gap: 0.5rem; padding: 0.7rem 0.8rem; border-top: 1px solid rgba(11, 18, 32, 0.08); background: #fff; }
.pb-input input { flex: 1; min-width: 0; padding: 0.6rem 0.8rem; border: 1px solid rgba(11, 18, 32, 0.16); border-radius: 999px; background: #fff; color: #0b1220; font: inherit; font-size: 0.9rem; }
.pb-input input:focus-visible { outline: 2px solid var(--accent, #d96a2b); outline-offset: 1px; }
.pb-input button { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; padding: 0; border: 0; border-radius: 50%; background: #0b1220; color: #fff; cursor: pointer; }
.pb-input button svg { width: 1.1rem; height: 1.1rem; }
.pb-foot { flex: none; padding: 0 0.9rem 0.6rem; background: #fff; text-align: center; font-size: 0.68rem; color: #8a93a3; }

@media (max-width: 640px) {
  .pb-root { right: 0.9rem; bottom: 0.9rem; bottom: calc(0.9rem + env(safe-area-inset-bottom, 0px)); }
  .pb-win { inset: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .pb-head { padding-top: calc(0.95rem + env(safe-area-inset-top, 0px)); }
  .pb-input { padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .pb-win, .pb-nudge, .pb-msg, .pb-form { animation: none; } .pb-type i { animation: none; } }
