/* Website assistant widget */
.jaw, .jaw * { box-sizing: border-box; }
.jaw {
  --n9: #0b1f33; --n8: #112c47; --n7: #1a3d60; --g5: #c49a3c; --g6: #a8822e; --g1: #f7efdc;
  --ink: #1b2430; --mut: #5b6878; --line: #e3e8ee; --soft: #f4f6fa;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; color: var(--ink);
}

/* ---------- launcher + teaser */
.jaw-launcher {
  position: fixed; right: 22px; bottom: 22px; z-index: 900; display: flex; align-items: center; gap: 10px;
  padding: 8px 20px 8px 8px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--n9), var(--n7)); color: #fff; font: 600 15px/1 "Inter", system-ui, sans-serif;
  box-shadow: 0 14px 34px rgba(11,31,51,.34); transition: transform .18s, box-shadow .18s;
}
.jaw-launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(11,31,51,.4); }
.jaw-launcher .dot { position: relative; width: 42px; height: 42px; border-radius: 50%; background: var(--g5); color: var(--n9); display: grid; place-items: center; }
.jaw-launcher .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--g5); animation: jaw-pulse 2.4s ease-out infinite; }
.jaw-launcher svg { width: 20px; height: 20px; }
.jaw-teaser.hidden { display: none; }
.jaw-launcher .ic-x { display: none; }
.jaw.is-open .jaw-launcher .ic-chat { display: none; }
.jaw.is-open .jaw-launcher .ic-x { display: block; }
@keyframes jaw-pulse { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.7); opacity: 0; } }

.jaw-teaser {
  position: fixed; right: 22px; bottom: 90px; z-index: 899; max-width: 260px; background: #fff; border-radius: 16px 16px 4px 16px;
  padding: 12px 34px 12px 14px; box-shadow: 0 14px 40px rgba(11,31,51,.2); font-size: 14px; cursor: pointer; animation: jaw-rise .4s ease-out;
}
.jaw-teaser b { display: block; color: var(--n9); margin-bottom: 2px; }
.jaw-teaser button { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; background: none; color: #8793a2; cursor: pointer; font-size: 18px; line-height: 1; border-radius: 6px; }
.jaw-teaser button:hover { background: var(--soft); }
@keyframes jaw-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- panel */
.jaw .jaw-panel {
  padding: 0; margin: 0;
  position: fixed; right: 22px; bottom: 92px; z-index: 901; width: 404px; max-width: calc(100vw - 24px);
  height: 640px; max-height: calc(100vh - 116px); display: none; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 22px; box-shadow: 0 30px 80px rgba(11,31,51,.32), 0 0 0 1px rgba(11,31,51,.06);
}
.jaw-panel.open { display: flex; animation: jaw-in .26s cubic-bezier(.2,.8,.2,1); transform-origin: bottom right; }
@keyframes jaw-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 520px) {
  .jaw .jaw-panel { left: 0; right: 0; top: 0; bottom: 0; width: auto; max-width: none; height: auto; max-height: none; border-radius: 0; }
  .jaw.is-open .jaw-launcher { display: none; }
  .jaw-launcher { padding: 8px; right: 14px; bottom: 14px; }
  .jaw-launcher .label { display: none; }
  .jaw-teaser { right: 14px; bottom: 76px; }
}

.jaw-head { position: relative; flex: none; background: radial-gradient(260px 120px at 100% 0, rgba(196,154,60,.3), transparent 70%), linear-gradient(135deg, var(--n9), var(--n7)); color: #fff; padding: 16px 14px 16px 16px; display: flex; gap: 12px; align-items: center; }
.jaw-av { position: relative; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--g5); color: var(--n9); display: grid; place-items: center; font: 700 15px "Source Serif 4", Georgia, serif; letter-spacing: .02em; }
.jaw-av.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.jaw-head .jaw-av::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: #4ade80; border: 2.5px solid var(--n8); }
.jaw-head .t { flex: 1; min-width: 0; }
.jaw-head strong { display: block; font-size: 16px; line-height: 1.2; }
.jaw-head small { display: block; color: #b9c8d8; font-size: 12.5px; margin-top: 2px; }
.jaw-ib { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.jaw-ib:hover { background: rgba(255,255,255,.22); }
.jaw-ib svg { width: 18px; height: 18px; }

.jaw-body { flex: 1; overflow-y: auto; padding: 18px 14px 6px; background: var(--soft); scroll-behavior: smooth; overscroll-behavior: contain; }
.jaw-body::-webkit-scrollbar { width: 6px; } .jaw-body::-webkit-scrollbar-thumb { background: #cdd5df; border-radius: 6px; }

/* messages */
.jaw-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-end; animation: jaw-rise .25s ease-out; }
.jaw-row.user { justify-content: flex-end; }
.jaw-row .b { max-width: 84%; padding: 10px 14px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere; }
.jaw-row.bot .b { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(11,31,51,.04); }
.jaw-row.user .b { background: linear-gradient(135deg, var(--n8), var(--n7)); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.jaw-row.err .b { background: #fff5f5; border-color: #f3c6c6; color: #7f1d1d; }
.jaw-row .b p { margin: 0 0 8px; } .jaw-row .b p:last-child { margin-bottom: 0; }
.jaw-row .b ul, .jaw-row .b ol { margin: 4px 0 8px; padding-left: 20px; } .jaw-row .b li { margin: 2px 0; }
.jaw-row .b a { color: var(--n7); text-underline-offset: 2px; }
.jaw-row .b sup { line-height: 0; } .jaw-row .b sup a { color: var(--g6); font-weight: 700; text-decoration: none; font-size: 11px; padding: 0 1px; }
.jaw-time { font-size: 11px; color: #8b97a6; margin: -6px 0 10px 36px; }
.jaw-row.user + .jaw-time { text-align: right; margin-left: 0; }

.jaw-src { margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--mut); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.jaw-src a, .jaw-src .s { display: inline-flex; gap: 5px; align-items: center; background: var(--soft); color: var(--n7); border-radius: 7px; padding: 3px 8px; text-decoration: none; font-weight: 500; }
.jaw-src a:hover { background: var(--g1); }
.jaw-src svg { width: 12px; height: 12px; }

.jaw-typing .b { display: flex; gap: 4px; padding: 15px 14px; }
.jaw-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa7b6; animation: jaw-bounce 1s infinite; }
.jaw-typing i:nth-child(2) { animation-delay: .15s; } .jaw-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes jaw-bounce { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* welcome + quick actions */
.jaw-welcome { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px 14px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(11,31,51,.04); }
.jaw-welcome h3 { margin: 0 0 4px; font: 600 18px/1.25 "Source Serif 4", Georgia, serif; color: var(--n9); }
.jaw-welcome p { margin: 0 0 14px; color: var(--mut); font-size: 14px; }
.jaw-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.jaw-quick button { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; padding: 11px 12px; border: 1px solid var(--line); background: var(--soft); border-radius: 12px; cursor: pointer; font: 600 13px/1.3 "Inter", system-ui, sans-serif; color: var(--n8); transition: border-color .15s, background .15s, transform .15s; }
.jaw-quick button:hover { border-color: var(--g5); background: #fffaf0; transform: translateY(-1px); }
.jaw-quick svg { width: 20px; height: 20px; color: var(--g6); }
.jaw-human { display: flex; gap: 8px; margin-top: 10px; }
.jaw-human a, .jaw-human button { flex: 1; display: inline-flex; gap: 6px; justify-content: center; align-items: center; padding: 9px 10px; border-radius: 10px; font: 600 13px "Inter", system-ui, sans-serif; text-decoration: none; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--n8); }
.jaw-human a:hover, .jaw-human button:hover { border-color: var(--n7); }
.jaw-human svg { width: 15px; height: 15px; }

.jaw-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: -2px 0 12px 36px; animation: jaw-rise .25s ease-out; }
.jaw-chips button { border: 1px solid #c9d3de; background: #fff; color: var(--n7); border-radius: 999px; padding: 6px 12px; font: 500 13px "Inter", system-ui, sans-serif; cursor: pointer; }
.jaw-chips button:hover { border-color: var(--g5); background: #fffaf0; }
.jaw-chips button.pri { background: var(--n8); color: #fff; border-color: var(--n8); }

/* lead form */
.jaw-lead { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 0 0 14px; box-shadow: 0 6px 20px rgba(11,31,51,.07); animation: jaw-rise .3s ease-out; }
.jaw-lead h4 { margin: 0 0 3px; font: 600 17px/1.25 "Source Serif 4", Georgia, serif; color: var(--n9); }
.jaw-lead p.sub { margin: 0 0 6px; font-size: 13px; color: var(--mut); }
.jaw-lead label.l { display: block; font-size: 12.5px; font-weight: 600; color: var(--n9); margin: 10px 0 4px; }
.jaw-lead label.l .opt { font-weight: 400; color: var(--mut); }
.jaw-lead input[type=text], .jaw-lead input[type=email], .jaw-lead input[type=tel], .jaw-lead select {
  width: 100%; padding: 10px 11px; border: 1px solid #c8d1dc; border-radius: 10px; font: 16px "Inter", system-ui, sans-serif; background: #fff; color: var(--ink);
}
.jaw-lead input:focus, .jaw-lead select:focus { outline: 3px solid rgba(26,61,96,.14); border-color: var(--n7); }
.jaw-lead .seg { display: flex; gap: 6px; }
.jaw-lead .seg label { flex: 1; position: relative; }
.jaw-lead .seg input { position: absolute; opacity: 0; }
.jaw-lead .seg span { display: block; text-align: center; padding: 8px 6px; border: 1px solid #c8d1dc; border-radius: 10px; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.jaw-lead .seg input:checked + span { background: var(--n8); border-color: var(--n8); color: #fff; }
.jaw-lead .seg input:focus-visible + span { outline: 3px solid rgba(26,61,96,.25); }
.jaw-lead .consent { display: flex; gap: 9px; font-size: 12px; line-height: 1.45; color: var(--mut); margin: 12px 0; align-items: flex-start; }
.jaw-lead .consent input { margin-top: 2px; flex: none; width: 16px; height: 16px; accent-color: var(--n8); }
.jaw-lead .row { display: flex; gap: 8px; }
.jaw-lead .row button { flex: 1; }
.jaw-lead .err { color: #9b1c1c; font-size: 12.5px; margin-top: 8px; min-height: 1em; }
.jaw-lead .hp { position: absolute; left: -9999px; }
.jaw-btn { border: 0; border-radius: 11px; padding: 11px 14px; font: 600 14px "Inter", system-ui, sans-serif; cursor: pointer; }
.jaw-btn.primary { background: linear-gradient(135deg, var(--n8), var(--n7)); color: #fff; }
.jaw-btn.primary:disabled { opacity: .6; cursor: default; }
.jaw-btn.ghost { background: #eef2f6; color: var(--n7); flex: 0 0 auto !important; }

.jaw-done { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 16px; margin-bottom: 14px; animation: jaw-rise .3s ease-out; }
.jaw-done .ck { width: 48px; height: 48px; border-radius: 50%; background: #e7f6ec; color: #17603a; display: grid; place-items: center; margin: 0 auto 10px; }
.jaw-done .ck svg { width: 24px; height: 24px; }
.jaw-done h4 { margin: 0 0 4px; font: 600 17px "Source Serif 4", Georgia, serif; color: var(--n9); }
.jaw-done p { margin: 0; color: var(--mut); font-size: 14px; }

/* composer */
.jaw-foot { flex: none; border-top: 1px solid var(--line); background: #fff; padding: 10px 12px 8px; }
.jaw-form { display: flex; gap: 6px; align-items: flex-end; border: 1px solid #c8d1dc; border-radius: 16px; padding: 5px 5px 5px 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.jaw-form:focus-within { border-color: var(--n7); box-shadow: 0 0 0 3px rgba(26,61,96,.12); }
.jaw-form textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; padding: 8px 0; font: 16px/1.4 "Inter", system-ui, sans-serif; max-height: 112px; min-height: 38px; color: var(--ink); }
.jaw-send { flex: none; width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--g5); color: var(--n9); cursor: pointer; display: grid; place-items: center; transition: transform .15s, background .15s; }
.jaw-send:hover:not(:disabled) { background: #d4ab4f; transform: scale(1.05); }
.jaw-send:disabled { opacity: .45; cursor: default; }
.jaw-send svg { width: 18px; height: 18px; }
.jaw-note { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: #7a8696; margin-top: 7px; padding: 0 4px; }
.jaw-note button { background: none; border: 0; color: var(--n7); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; white-space: nowrap; }

.jaw :focus-visible { outline: 3px solid var(--g5); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .jaw *, .jaw *::before, .jaw *::after { animation: none !important; transition: none !important; } .jaw-body { scroll-behavior: auto; } }

/* answer meta: time + rating */
.jaw-time { display: flex; align-items: center; gap: 8px; }
.jaw-row.user + .jaw-time { justify-content: flex-end; }
.jaw-rate { display: inline-flex; gap: 2px; margin-left: 2px; }
.jaw-rate button { border: 0; background: none; cursor: pointer; font-size: 13px; line-height: 1; padding: 3px 5px; border-radius: 6px; opacity: .45; filter: grayscale(1); transition: opacity .15s, filter .15s, background .15s; }
.jaw-rate button:hover { opacity: .9; filter: none; background: #e9edf3; }
.jaw-rate button.on { opacity: 1; filter: none; background: var(--g1); }
.jaw-chips button.pri { display: inline-flex; gap: 6px; align-items: center; }
.jaw-chips button.pri svg { width: 13px; height: 13px; }

/* short screens (landscape phones, small laptops): give the conversation room */
@media (max-height: 560px) and (min-width: 521px) {
  .jaw .jaw-panel { right: 12px; bottom: 12px; height: calc(100vh - 24px); max-height: calc(100vh - 24px); }
  .jaw.is-open .jaw-launcher { display: none; }
  .jaw-head { padding: 10px 12px; }
  .jaw-av { width: 36px; height: 36px; border-radius: 11px; }
  .jaw-note span { display: none; }
  .jaw-foot { padding: 8px 12px 6px; }
}
@media (max-height: 420px) { .jaw-welcome p { display: none; } .jaw-quick button { flex-direction: row; align-items: center; } }
/* tablets: a little more width for reading */
@media (min-width: 521px) and (max-width: 1100px) { .jaw .jaw-panel { width: 440px; } }
/* keyboard open on phones: dvh already shrinks the panel; keep the composer pinned */
.jaw-panel { overscroll-behavior: contain; }
