/* =============================================================
   PJL CHAT WIDGET — site-wide AI sprinkler diagnostic chat
   - Floating launcher pill (only visible when conversation is active)
   - Panel: right-side on desktop/tablet, fullscreen on mobile
   - Triggered by [data-pjl-chat] buttons OR pjlChat.open() programmatically
   - State persists across page navigation (localStorage)
   - Brand-matched: Barlow Condensed headers, dark green + amber palette,
     architectural shapes — same visual language as the rest of PJL.
   ============================================================= */

:root {
  --pjl-chat-green: #1B4D2E;
  --pjl-chat-green-mid: #2D6A42;
  --pjl-chat-green-light: #4A8C5C;
  --pjl-chat-green-pale: #EAF3DE;
  --pjl-chat-amber: #E07B24;
  --pjl-chat-amber-light: #F59B4A;
  --pjl-chat-dark: #0F1F14;
  --pjl-chat-cream: #FAFAF5;
  --pjl-chat-cream-deep: #F2EFE6;
  --pjl-chat-white: #FFFFFF;
  --pjl-chat-ink: #1A1A1A;
  --pjl-chat-ink-soft: #4A4A4A;
  --pjl-chat-muted: #7A7A7A;
  --pjl-chat-line: #DCD7CA;
  --pjl-chat-warning: #B8862E;
  --pjl-chat-shadow-launcher: 0 8px 22px rgba(15, 31, 20, .35);
  --pjl-chat-shadow-panel: 0 4px 12px rgba(15, 31, 20, .12), 0 24px 60px rgba(15, 31, 20, .22);
}

/* ---------- Floating launcher pill ----------
   Stacks above the water-savings float widget when both are visible:
   savings sits at bottom-right (bottom: 24px), chat sits above it.
   When the savings widget is dismissed/hidden, the body class drops
   off and chat falls back to the original 24px bottom anchor. */
.pjl-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 22px 14px 14px;
  background: var(--pjl-chat-green);
  color: var(--pjl-chat-cream);
  border: none;
  border-radius: 999px;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--pjl-chat-shadow-launcher);
  transition: transform .15s, box-shadow .15s, background .2s, bottom .2s ease;
}
/* Body gets `.has-savings-float` whenever the savings widget is on
   screen (toggled by the savings JS). Chat launcher rides above it
   with a generous gap so the two pieces read as a deliberate stack
   rather than a stuck-together blob. The card-height value also
   accounts for the close button that hangs ~8px above the card top. */
body.has-savings-float .pjl-chat-launcher {
  bottom: calc(24px + 132px + 24px);  /* base + savings card height (incl. close-btn overflow) + gap */
}
.pjl-chat-launcher.is-visible { display: inline-flex; }
.pjl-chat-launcher:hover {
  background: var(--pjl-chat-green-mid);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 31, 20, .42);
}
.pjl-chat-launcher-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--pjl-chat-amber);
  color: var(--pjl-chat-white);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', 'Outfit', system-ui, sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.5px;
}
.pjl-chat-launcher-dot {
  position: absolute;
  top: 8px; right: 10px;
  width: 12px; height: 12px;
  background: var(--pjl-chat-amber);
  border: 2px solid var(--pjl-chat-green);
  border-radius: 50%;
  display: none;
}
.pjl-chat-launcher.has-unread .pjl-chat-launcher-dot { display: block; }

/* ---------- Panel container ---------- */
.pjl-chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  width: 500px;
  max-width: calc(100vw - 48px);
  height: 740px;
  max-height: calc(100vh - 48px);
  background: var(--pjl-chat-cream);
  border: 1px solid var(--pjl-chat-line);
  border-radius: 14px;
  box-shadow: var(--pjl-chat-shadow-panel);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  color: var(--pjl-chat-ink);
  -webkit-font-smoothing: antialiased;
  animation: pjlChatSlideUp .28s cubic-bezier(.2,.8,.2,1);
}
.pjl-chat-panel.is-open { display: flex; }
@keyframes pjlChatSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pjl-chat-panel * { box-sizing: border-box; }

/* ---------- Header (dark green bar, amber avatar, Barlow Condensed) ---------- */
.pjl-chat-header {
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--pjl-chat-green);
  color: var(--pjl-chat-cream);
  flex-shrink: 0;
  border-bottom: 3px solid var(--pjl-chat-amber);
}
.pjl-chat-header-brand { display: flex; align-items: center; gap: 14px; }
.pjl-chat-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--pjl-chat-amber);
  color: var(--pjl-chat-white);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', 'Outfit', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.pjl-chat-brand-text .pjl-chat-brand {
  font-family: 'Barlow Condensed', 'Outfit', system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--pjl-chat-cream);
  line-height: 1;
}
.pjl-chat-brand-status {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--pjl-chat-green-pale);
  text-transform: uppercase;
  margin-top: 5px;
  display: flex; align-items: center; gap: 7px;
  font-weight: 500;
}
.pjl-chat-status-dot {
  width: 8px; height: 8px;
  background: #6FE588;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(111, 229, 136, .6);
  animation: pjlChatPulse 2s infinite;
}
@keyframes pjlChatPulse {
  0%   { box-shadow: 0 0 0 0 rgba(111, 229, 136, .6); }
  70%  { box-shadow: 0 0 0 7px rgba(111, 229, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 229, 136, 0); }
}
.pjl-chat-header-actions { display: flex; gap: 6px; }
.pjl-chat-icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, .08);
  color: var(--pjl-chat-cream);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.pjl-chat-icon-btn:hover { background: rgba(255, 255, 255, .18); }

/* ---------- Messages area ---------- */
.pjl-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px 20px 14px;
  background: var(--pjl-chat-cream);
  display: flex; flex-direction: column; gap: 12px;
}
.pjl-chat-msg-row { display: flex; align-items: flex-end; gap: 10px; animation: pjlChatMsgIn .25s ease; }
@keyframes pjlChatMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.pjl-chat-msg-row.user { justify-content: flex-end; }
.pjl-chat-msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--pjl-chat-amber);
  color: var(--pjl-chat-white);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', 'Outfit', system-ui, sans-serif;
  font-size: 16px; font-weight: 800;
  flex-shrink: 0;
}
.pjl-chat-msg-avatar.hidden { visibility: hidden; }
.pjl-chat-msg-bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.pjl-chat-msg-row.pjl .pjl-chat-msg-bubble {
  background: var(--pjl-chat-white);
  border: 1px solid var(--pjl-chat-line);
  border-bottom-left-radius: 3px;
  color: var(--pjl-chat-ink);
  box-shadow: 0 1px 2px rgba(15, 31, 20, .04);
}
.pjl-chat-msg-row.user .pjl-chat-msg-bubble {
  background: var(--pjl-chat-green);
  color: var(--pjl-chat-cream);
  border-bottom-right-radius: 3px;
  box-shadow: 0 1px 2px rgba(15, 31, 20, .12);
}
.pjl-chat-msg-row.pjl .pjl-chat-msg-bubble strong { color: var(--pjl-chat-green); }
.pjl-chat-msg-row.user .pjl-chat-msg-bubble strong { color: var(--pjl-chat-amber-light); }
.pjl-chat-link {
  color: var(--pjl-chat-amber);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(224, 123, 36, .4);
  text-underline-offset: 2px;
  transition: color .12s, text-decoration-color .12s;
}
.pjl-chat-link:hover {
  color: var(--pjl-chat-amber-light);
  text-decoration-color: var(--pjl-chat-amber-light);
}
.pjl-chat-msg-row.user .pjl-chat-msg-bubble .pjl-chat-link {
  color: var(--pjl-chat-amber-light);
  text-decoration-color: rgba(245, 155, 74, .5);
}

.pjl-chat-photo-attachments {
  display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  max-width: 78%;
  margin-bottom: 4px;
}
.pjl-chat-photo-attachments img {
  width: 100%; max-width: 200px;
  border-radius: 10px;
  border: 1px solid var(--pjl-chat-line);
  display: block;
}

.pjl-chat-typing-row { display: flex; align-items: flex-end; gap: 10px; }
.pjl-chat-typing-bubble {
  background: var(--pjl-chat-white);
  border: 1px solid var(--pjl-chat-line);
  padding: 12px 16px;
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  display: flex; gap: 5px;
  box-shadow: 0 1px 2px rgba(15, 31, 20, .04);
}
.pjl-chat-typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--pjl-chat-green-light);
  animation: pjlChatTyping 1.4s infinite ease-in-out both;
}
.pjl-chat-typing-dot:nth-child(1) { animation-delay: -.32s; }
.pjl-chat-typing-dot:nth-child(2) { animation-delay: -.16s; }
@keyframes pjlChatTyping {
  0%, 80%, 100% { transform: scale(.7); opacity: .5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ---------- Booking form bubble ---------- */
.pjl-chat-form-bubble {
  background: var(--pjl-chat-white);
  border: 1px solid var(--pjl-chat-line);
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  padding: 22px;
  max-width: 92%;
  box-shadow: 0 2px 8px rgba(15, 31, 20, .06);
}
.pjl-chat-form-bubble h3 {
  font-family: 'Barlow Condensed', 'Outfit', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--pjl-chat-green);
  margin: 0 0 8px;
}
.pjl-chat-form-bubble p {
  font-size: 13px;
  color: var(--pjl-chat-ink-soft);
  margin: 0 0 16px;
  line-height: 1.5;
}
.pjl-chat-form-grid {
  display: grid; gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}
.pjl-chat-form-grid .full { grid-column: 1 / -1; }
.pjl-chat-form-bubble label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 5px;
  color: var(--pjl-chat-ink);
}
.pjl-chat-form-bubble label .req { color: var(--pjl-chat-amber); }
.pjl-chat-form-bubble input,
.pjl-chat-form-bubble textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--pjl-chat-line);
  border-radius: 8px;
  background: var(--pjl-chat-cream);
  font-family: inherit;
  font-size: 14px;
  color: var(--pjl-chat-ink);
  transition: border-color .15s, background .15s;
}
.pjl-chat-form-bubble input:focus,
.pjl-chat-form-bubble textarea:focus {
  outline: none;
  border-color: var(--pjl-chat-green-mid);
  background: var(--pjl-chat-white);
}
.pjl-chat-form-bubble button[type="submit"] {
  background: var(--pjl-chat-amber);
  color: var(--pjl-chat-white);
  border: none;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, transform .12s;
  width: 100%;
  box-shadow: 0 4px 12px rgba(224, 123, 36, .25);
}
.pjl-chat-form-bubble button[type="submit"]:hover {
  background: var(--pjl-chat-amber-light);
  transform: translateY(-1px);
}
.pjl-chat-form-bubble button[type="submit"]:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Composer ---------- */
.pjl-chat-photo-rail {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px 18px 0;
}
.pjl-chat-photo-rail:empty { display: none; }
.pjl-chat-photo-chip {
  position: relative;
  width: 60px; height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--pjl-chat-line);
  background: var(--pjl-chat-cream);
}
.pjl-chat-photo-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pjl-chat-photo-chip-x {
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(15, 31, 20, .78);
  color: white;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.pjl-chat-photo-chip-x:hover { background: var(--pjl-chat-dark); }

.pjl-chat-composer {
  border-top: 1px solid var(--pjl-chat-line);
  background: var(--pjl-chat-white);
  padding: 14px 18px 14px;
  flex-shrink: 0;
}
.pjl-chat-composer-inner {
  display: flex; gap: 10px; align-items: flex-end;
}
.pjl-chat-attach-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--pjl-chat-cream);
  color: var(--pjl-chat-green);
  border: 1.5px solid var(--pjl-chat-line);
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, color .15s;
}
.pjl-chat-attach-btn:hover:not(:disabled) {
  background: var(--pjl-chat-green-pale);
  border-color: var(--pjl-chat-green-mid);
}
.pjl-chat-attach-btn:disabled { opacity: .35; cursor: not-allowed; }
.pjl-chat-textarea {
  flex: 1;
  min-width: 0; /* allow flex shrink so the textarea respects composer width on small screens */
  resize: none;
  max-height: 130px;
  min-height: 44px;
  padding: 12px 18px;
  border: 1.5px solid var(--pjl-chat-line);
  border-radius: 22px;
  background: var(--pjl-chat-cream);
  font-family: inherit;
  font-size: 15px;
  color: var(--pjl-chat-ink);
  line-height: 1.4;
  overflow-y: auto;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pjl-chat-textarea:focus {
  outline: none;
  border-color: var(--pjl-chat-green-mid);
  background: var(--pjl-chat-white);
  white-space: pre-wrap; /* allow real multiline once the user is typing */
}
.pjl-chat-textarea:not(:placeholder-shown) { white-space: pre-wrap; }
.pjl-chat-textarea::placeholder {
  color: var(--pjl-chat-muted);
  opacity: 1; /* iOS otherwise dims this further */
}
.pjl-chat-textarea:disabled { opacity: .5; cursor: not-allowed; }
.pjl-chat-send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--pjl-chat-amber);
  color: var(--pjl-chat-white);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .12s;
  box-shadow: 0 3px 10px rgba(224, 123, 36, .3);
}
.pjl-chat-send-btn:hover:not(:disabled) {
  background: var(--pjl-chat-amber-light);
  transform: scale(1.06);
}
.pjl-chat-send-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }

.pjl-chat-composer-meta {
  margin-top: 8px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--pjl-chat-muted);
  text-transform: uppercase;
  font-weight: 500;
}
.pjl-chat-composer-meta button {
  background: none; border: none;
  font-family: inherit;
  color: var(--pjl-chat-muted);
  font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(122,122,122,.3);
}
.pjl-chat-composer-meta button:hover { color: var(--pjl-chat-green); }

/* ---------- Thank-you overlay (inside the panel) ---------- */
.pjl-chat-ty {
  position: absolute; inset: 0;
  background: var(--pjl-chat-cream);
  display: none;
  align-items: center; justify-content: center;
  z-index: 5;
  padding: 32px;
  text-align: center;
}
.pjl-chat-ty.is-visible { display: flex; }
.pjl-chat-ty-card { max-width: 380px; }
.pjl-chat-ty-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--pjl-chat-green);
  color: var(--pjl-chat-cream);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
  font-size: 32px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(15, 31, 20, .25);
}
.pjl-chat-ty h2 {
  font-family: 'Barlow Condensed', 'Outfit', system-ui, sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--pjl-chat-green);
  margin: 0 0 12px;
  line-height: 1.05;
}
.pjl-chat-ty p {
  font-size: 14px;
  color: var(--pjl-chat-ink-soft);
  line-height: 1.55;
  margin: 0 0 22px;
}
.pjl-chat-ty button {
  background: var(--pjl-chat-green);
  color: var(--pjl-chat-cream);
  border: none;
  padding: 12px 26px;
  border-radius: 999px;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.pjl-chat-ty button:hover {
  background: var(--pjl-chat-green-mid);
  transform: translateY(-1px);
}
.pjl-chat-ty {
  align-items: flex-start;
  padding-top: 28px;
  overflow-y: auto;
}
.pjl-chat-ty-card {
  width: 100%;
  max-width: 440px;
}
.pjl-chat-ty-portal {
  background: var(--pjl-chat-green-pale);
  border: 1px solid rgba(27, 77, 46, .18);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 22px;
  text-align: left;
}
.pjl-chat-ty-portal strong {
  display: block;
  font-family: 'Barlow Condensed', 'Outfit', system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--pjl-chat-green);
  margin-bottom: 4px;
}
.pjl-chat-ty-portal a[data-pjl-ty-portal-link] {
  display: block;
  word-break: break-all;
  font-size: 12px;
  color: var(--pjl-chat-green-mid);
  text-decoration: underline;
  text-decoration-color: rgba(27, 77, 46, .35);
  margin-bottom: 6px;
}
.pjl-chat-ty-portal a[data-pjl-ty-portal-link]:hover { color: var(--pjl-chat-green); }
.pjl-chat-ty-portal-note {
  font-size: 11px !important;
  color: var(--pjl-chat-ink-soft) !important;
  line-height: 1.45 !important;
  margin: 0 !important;
}
.pjl-chat-ty-upsell {
  background: var(--pjl-chat-cream-deep);
  border-radius: 12px;
  padding: 18px 16px;
  margin-bottom: 22px;
  text-align: left;
}
.pjl-chat-ty-upsell h3 {
  font-family: 'Barlow Condensed', 'Outfit', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--pjl-chat-green);
  margin: 0 0 6px;
}
.pjl-chat-ty-upsell > p {
  font-size: 12px !important;
  color: var(--pjl-chat-ink-soft) !important;
  margin: 0 0 12px !important;
  line-height: 1.45 !important;
}
.pjl-chat-ty-upsell-primary {
  display: block;
  background: var(--pjl-chat-green);
  color: var(--pjl-chat-cream);
  border: none;
  border-radius: 10px;
  padding: 18px 18px 16px;
  text-decoration: none;
  text-align: left;
  transition: transform .12s, box-shadow .15s, background .15s;
  box-shadow: 0 4px 14px rgba(15, 31, 20, .18);
}
.pjl-chat-ty-upsell-primary:hover {
  background: var(--pjl-chat-green-mid);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 31, 20, .25);
}
.pjl-chat-ty-upsell-primary-tag {
  display: inline-block;
  font-family: 'Barlow Condensed', 'Outfit', system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--pjl-chat-amber);
  margin-bottom: 6px;
}
.pjl-chat-ty-upsell-primary strong {
  display: block;
  font-family: 'Barlow Condensed', 'Outfit', system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--pjl-chat-cream);
  margin-bottom: 6px;
  line-height: 1.05;
}
.pjl-chat-ty-upsell-primary-price {
  display: block;
  font-size: 12px;
  color: var(--pjl-chat-green-pale);
  font-weight: 500;
  line-height: 1.4;
}

/* ---------- Error toast (inside the panel) ---------- */
.pjl-chat-toast {
  position: absolute;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  background: #B85C3D;
  color: white;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(184, 92, 61, .35);
  animation: pjlChatMsgIn .3s ease;
  z-index: 10;
  max-width: calc(100% - 32px);
}

/* ---------- Tablet (768-1199px): slightly narrower than full desktop ---------- */
@media (max-width: 1199px) and (min-width: 768px) {
  .pjl-chat-panel {
    width: 460px;
    height: 700px;
  }
}

/* ---------- Mobile (<768px): full-screen ---------- */
@media (max-width: 767px) {
  .pjl-chat-panel {
    bottom: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    animation: pjlChatSlideMobile .3s cubic-bezier(.2,.8,.2,1);
  }
  @keyframes pjlChatSlideMobile {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .pjl-chat-launcher {
    bottom: 18px;
    right: 18px;
    padding: 12px 18px 12px 12px;
    font-size: 12px;
  }
  /* Mobile stack: savings card is shorter on phones, but we still
     want a clear gap so the launcher doesn't look glued to it. */
  body.has-savings-float .pjl-chat-launcher {
    bottom: calc(18px + 96px + 18px);
  }
  .pjl-chat-form-grid { grid-template-columns: 1fr; }
  .pjl-chat-header { padding: 16px 18px; }
  .pjl-chat-brand-text .pjl-chat-brand { font-size: 20px; }
  .pjl-chat-composer { padding: 10px 12px 10px; }
  .pjl-chat-composer-inner { gap: 8px; }
  .pjl-chat-attach-btn,
  .pjl-chat-send-btn { width: 42px; height: 42px; }
  .pjl-chat-textarea {
    font-size: 16px; /* iOS won't auto-zoom on focus when input >= 16px */
    padding: 11px 16px;
    min-height: 42px;
  }
  .pjl-chat-composer-meta {
    margin-top: 6px;
    font-size: 9px;
    letter-spacing: 0.8px;
  }
  .pjl-chat-composer-meta button { font-size: 9px; }
}

/* ---------- Lock body scroll only on mobile when open ---------- */
@media (max-width: 767px) {
  body.pjl-chat-locked {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}
