/* Jade Assistant chat (includes/frontend.php). Above the Jade sticky header (z 100); below its mobile menu (200), lightbox (2000) and the popup. */
.jas{ position:fixed; right:20px; bottom:20px; z-index:150; font-family:var(--brand-sans, "Poppins", ui-sans-serif, system-ui, sans-serif); }
.jas .screen-reader-text{ position:absolute !important; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.jas__toggle{
  display:grid; place-items:center;
  width:58px; height:58px; padding:0;
  border:0; border-radius:50%;
  background:var(--brand-deep, #C9674F); color:#fff;
  box-shadow:0 8px 24px rgba(0,0,0,.22);
  cursor:pointer; transition:transform .2s ease;
}
.jas__toggle:hover{ transform:translateY(-2px); }
.jas__toggle:focus-visible, .jas__close:focus-visible, .jas__chip:focus-visible, .jas__send:focus-visible, .jas__action:focus-visible{ outline:3px solid var(--brand-ink, #252525); outline-offset:2px; }
.jas__toggle svg{ width:28px; height:28px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.jas.is-open .jas__toggle{ display:none; }

.jas__panel{
  display:flex; flex-direction:column;
  width:min(380px, calc(100vw - 32px));
  height:min(580px, calc(100vh - 40px));
  height:min(580px, calc(100dvh - 40px));
  border-radius:18px;
  background:var(--brand-bg, #FFF6F4); color:var(--brand-ink, #252525);
  box-shadow:0 20px 60px rgba(0,0,0,.28);
  overflow:hidden;
}
.jas__panel[hidden]{ display:none; }
.jas__head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 14px 14px 20px;
  background:var(--brand-deep, #C9674F); color:#fff;
}
.jas__title{ margin:0; font:600 16px/1.3 var(--brand-sans, "Poppins", ui-sans-serif, system-ui, sans-serif); color:#fff; }
.jas__close{ display:grid; place-items:center; width:36px; height:36px; padding:0; border:0; border-radius:50%; background:transparent; color:#fff; cursor:pointer; }
.jas__close:hover{ background:rgba(255,255,255,.15); }
.jas__close svg{ width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; }

.jas__log{ flex:1; display:flex; flex-direction:column; gap:10px; padding:16px; overflow-y:auto; overscroll-behavior:contain; }
.jas__msg{
  max-width:88%; margin:0; padding:10px 14px;
  border-radius:14px;
  font:400 14px/1.55 var(--brand-sans, "Poppins", ui-sans-serif, system-ui, sans-serif);
  white-space:pre-line; overflow-wrap:anywhere;
}
.jas__msg--bot{ align-self:flex-start; background:#fff; color:var(--brand-ink, #252525); border:1px solid var(--brand-line, #EFE3E0); border-bottom-left-radius:4px; }
.jas__msg--user{ align-self:flex-end; background:var(--brand-brown, #4A3431); color:#fff; border-bottom-right-radius:4px; }
.jas__msg--wait{ color:#6A7478; font-style:italic; }
.jas__actions{ display:flex; flex-wrap:wrap; gap:8px; align-self:flex-start; max-width:88%; }
.jas__action{
  display:inline-flex; align-items:center; min-height:36px; padding:7px 14px;
  border:1px solid var(--brand-deep, #C9674F); border-radius:999px;
  background:#fff; color:var(--brand-deep-text, #AD5139);
  font:500 13px/1.2 var(--brand-sans, "Poppins", ui-sans-serif, system-ui, sans-serif); text-decoration:none;
}
.jas__action--primary{ background:var(--brand-deep, #C9674F); color:#fff; }
.jas__action:hover{ border-color:var(--brand-brown, #4A3431); }

.jas__quick{ display:flex; flex-wrap:wrap; gap:8px; padding:0 16px 10px; }
.jas__quick[hidden]{ display:none; }
.jas__chip{
  min-height:34px; padding:6px 12px;
  border:1px solid var(--brand-line, #EFE3E0); border-radius:999px;
  background:#fff; color:var(--brand-ink, #252525);
  font:500 13px/1.2 var(--brand-sans, "Poppins", ui-sans-serif, system-ui, sans-serif); cursor:pointer;
}
.jas__chip:hover{ border-color:var(--brand-deep, #C9674F); }

.jas__form{ display:flex; align-items:flex-end; gap:8px; padding:10px 12px; border-top:1px solid var(--brand-line, #EFE3E0); background:#fff; }
.jas__input{
  flex:1; min-height:42px; max-height:120px; padding:10px 12px;
  border:1px solid var(--brand-line, #EFE3E0); border-radius:12px;
  background:#fff; color:var(--brand-ink, #252525);
  font:400 15px/1.4 var(--brand-sans, "Poppins", ui-sans-serif, system-ui, sans-serif); resize:none; overflow-y:hidden;
}
.jas__input:focus{ outline:2px solid var(--brand-deep, #C9674F); outline-offset:0; border-color:transparent; }
.jas__send{ display:grid; place-items:center; flex:none; width:42px; height:42px; padding:0; border:0; border-radius:50%; background:var(--brand-deep, #C9674F); color:#fff; cursor:pointer; }
.jas__send:disabled{ opacity:.5; cursor:default; }
.jas__send svg{ width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.jas__note{ margin:0; padding:0 14px 10px; background:#fff; font:400 11px/1.4 var(--brand-sans, "Poppins", ui-sans-serif, system-ui, sans-serif); color:#6A7478; }

/* Phones: above the quick bar (64px); the open panel fills the width. */
@media (max-width:767px){
  .jas{ right:14px; bottom:calc(64px + 14px + env(safe-area-inset-bottom)); }
  .jas.is-open{ left:8px; right:8px; }
  .jas__panel{ width:100%; height:min(560px, calc(100vh - 64px - 40px)); height:min(560px, calc(100dvh - 64px - 40px - env(safe-area-inset-bottom))); }
  .jas__input{ font-size:16px; } /* no zoom-in on iOS */
}
@media (prefers-reduced-motion:reduce){ .jas__toggle{ transition:none; } .jas__toggle:hover{ transform:none; } }
/* Jade mobile "More" sheet open: keep the chat out of its way. */
body:has(.jf-sheet.is-open) .jas{ display:none; }
