/* The Leximus chat (chat.js), like WhatsApp: a panel in the page; on the Leximus page (.agchat-fill) it fills the
   area under the tabs. */
.agchat{--agchat-bg:#fffaf0;--agchat-ink:#3b2f25;--agchat-line:#eadcc1;--agchat-me:linear-gradient(135deg,#e8261c,#f2702a);
 display:flex;flex-direction:column;height:min(620px,72vh);height:min(620px,72dvh);min-height:380px;background:var(--agchat-bg);
 border:1px solid var(--agchat-line);border-radius:16px;overflow:hidden;position:relative;color:var(--agchat-ink)}
.agchat svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
/* header bar */
.agchat-top{flex:none;display:flex;align-items:center;gap:10px;padding:8px 10px 8px 14px;background:#fffdf8;border-bottom:1px solid var(--agchat-line)}
/* his face, cropped from the first frame of the sprite sheet (3 x 2 frames) */
.agchat-avatar,.agchat-leximus::before{--s:38px;background:#fff url('/assets/leximus-working-v3.webp') calc(var(--s) * -.58) calc(var(--s) * -.04)/calc(var(--s) * 7.5) calc(var(--s) * 5) no-repeat}
.agchat-avatar{flex:none;width:38px;height:38px;border-radius:50%;box-shadow:0 0 0 2px #d9a44166}
.agchat-who{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;line-height:1.2}
.agchat-who b{font:600 16px/1.2 var(--sans)}
.agchat-who small{font-size:12.5px;color:#7b6a52;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.agchat-new{flex:none;width:40px;height:40px;border-radius:50%;border:0;background:none;color:#6b5a44;display:grid;place-items:center;padding:0}
.agchat-new:hover,.agchat-new:focus-visible{background:#f3e7cf;color:#8c3e23}
/* messages */
.agchat-log{list-style:none;margin:0;padding:16px 14px 10px;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:8px;-webkit-overflow-scrolling:touch}
.agchat-msg{max-width:min(78%,600px);padding:10px 14px;border-radius:20px;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;position:relative}
.agchat-leximus{align-self:flex-start;margin-left:40px;background:#fff;border:1px solid var(--agchat-line);border-bottom-left-radius:6px;font:17.5px/1.5 Forum,Georgia,serif}
.agchat-leximus::before{content:"";position:absolute;left:-40px;bottom:0;width:30px;height:30px;border-radius:50%;--s:30px;box-shadow:0 0 0 1px #d9a44166}
.agchat-leximus+.agchat-leximus::before{display:none}
.agchat-visitor{align-self:flex-end;background:var(--agchat-me);color:#fff;border-bottom-right-radius:6px;font:15.5px/1.45 var(--sans);margin-top:6px}
.agchat-visitor+.agchat-leximus{margin-top:6px}
.agchat-msg .chat-links{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0 0;font:13px/1.4 var(--sans);white-space:normal}
.agchat-msg .chat-links a{border:1px solid #d9bd8b;border-radius:20px;padding:6px 12px;color:#803b22;text-decoration:none;background:#fffaf0}
.agchat-msg .chat-handoff{margin-top:10px;display:flex;font-size:13px;white-space:normal}
.agchat-typing{padding:14px 16px}
.agchat-dots{display:inline-flex;gap:5px;align-items:center;height:12px}
.agchat-dots i{width:7px;height:7px;border-radius:50%;background:#b89a6c;animation:agchat-dot 1.2s infinite ease-in-out}
.agchat-dots i:nth-child(2){animation-delay:.15s}.agchat-dots i:nth-child(3){animation-delay:.3s}
@keyframes agchat-dot{0%,60%,100%{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
@media(prefers-reduced-motion:reduce){.agchat-dots i{animation:none;opacity:.7}}
/* suggestions, just above the input */
.agchat-chips{flex:none;display:flex;gap:8px;overflow-x:auto;padding:4px 12px 8px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.agchat-chips::-webkit-scrollbar{display:none}
.agchat-chips[hidden]{display:none}
.agchat-chip{flex:none;font:14px/1.2 var(--sans);padding:9px 14px;min-height:38px;border-radius:999px;border:1px solid #e0c99d;background:#fffdf8;color:#6b3a22;white-space:nowrap}
.agchat-chip:hover,.agchat-chip:focus-visible{border-color:#e8261c;color:#a52c17}
/* the input: a pill that grows, with a round send button */
.agchat-status:empty{display:none}
.agchat-status{flex:none;margin:0;padding:6px 16px;font-size:13px;color:#a52c17}
.agchat-compose{flex:none;display:flex;align-items:flex-end;gap:8px;margin:0;padding:8px 10px 6px}
.agchat-compose textarea{flex:1 1 auto;min-width:0;box-sizing:border-box;resize:none;font:16px/1.35 var(--sans);padding:10px 16px;min-height:44px;border:1px solid #d9c7a4;border-radius:22px;background:#fff;color:var(--agchat-ink);max-height:140px;overflow-y:hidden}
.agchat-compose textarea:focus{outline:none;border-color:#e8261c;box-shadow:0 0 0 3px #e8261c22}
.agchat-send{flex:none;width:44px;height:44px;border-radius:50%;border:0;background:var(--agchat-me);color:#fff;display:grid;place-items:center;transition:opacity .15s,transform .15s}
.agchat-send svg{width:22px;height:22px;stroke-width:2.4}
.agchat-send:disabled{background:#e4d7bf;color:#fffaf0}
.agchat-send:not(:disabled):active{transform:scale(.94)}
.agchat-note{flex:none;font-size:11px;line-height:1.4;color:#857256;margin:0;padding:0 18px 8px;text-align:center}
.agchat-note summary{cursor:pointer;list-style:none;display:inline}
.agchat-note summary::-webkit-details-marker{display:none}
.agchat-note summary::after{content:" ⓘ"}
.agchat-note[open] summary{display:block;margin-bottom:2px}
/* The Leximus page (.agchat-fill): the chat fills the area under the tabs, edge to edge, with no card frame. chat.js
   sets its height to the visible screen below the tabs (and above the iPhone keyboard). */
.agchat.agchat-fill{height:calc(100vh - 80px);height:calc(100dvh - 80px);max-height:820px;min-height:340px;border:0;border-radius:0;background:var(--agchat-bg)}
.agchat-fill .agchat-top{border-bottom:1px solid var(--agchat-line);background:#fffdf8}
.agchat-fill .agchat-note{padding-bottom:max(10px,env(safe-area-inset-bottom))}
@media(min-width:760px){
 .agchat-fill .agchat-log,.agchat-fill .agchat-chips,.agchat-fill .agchat-compose,.agchat-fill .agchat-status{width:100%;max-width:780px;margin-inline:auto;box-sizing:border-box}
 .agchat-fill .agchat-chips{flex-wrap:wrap;justify-content:center;overflow:visible}
 .agchat-fill .agchat-log{padding-top:24px}
}
@media(max-width:600px){.agchat-msg{max-width:84%}.agchat-leximus{font-size:17px}}
@media print{.agchat-compose,.agchat-new,.agchat-chips{display:none}.agchat{height:auto}.agchat-log{overflow:visible}}
/* Typing on a phone (chat.js typingOn, .agchat-keyboard): the chat is pinned to the visible area above the keyboard; the page
   behind does not scroll. chat.js sets its height and offset from visualViewport. */
.agchat-lock,.agchat-lock body{overflow:hidden;overscroll-behavior:none}
.agchat.agchat-keyboard{position:fixed;left:0;right:0;top:0;z-index:2000;max-height:none;min-height:0;border-radius:0}
.agchat-keyboard .agchat-note,.agchat-keyboard .agchat-chips{display:none}
.agchat-keyboard .agchat-compose{padding-bottom:8px}
.agchat-link{color:#a52c17;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}
.agchat-visitor .agchat-link{color:#fff}
