.zifchat-widget{position:fixed;bottom:22px;z-index:999999;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif}.zifchat-right{right:22px}.zifchat-left{left:22px}.zifchat-launcher{width:62px;height:62px;border:0;border-radius:22px;background:var(--zifchat-bubble,#25d366);box-shadow:0 12px 34px rgba(15,23,42,.24);cursor:pointer;display:grid;place-items:center;transition:.2s transform,.2s border-radius}.zifchat-launcher:hover{transform:translateY(-2px)}.zifchat-launcher svg{width:30px;fill:#fff}.zifchat-x{display:none;color:#fff;font-size:32px;line-height:1}.is-open .zifchat-chat-icon{display:none}.is-open .zifchat-x{display:block}.zifchat-window{position:absolute;bottom:78px;width:350px;max-width:calc(100vw - 32px);background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:22px;box-shadow:0 24px 70px rgba(15,23,42,.22);overflow:hidden;opacity:0;transform:translateY(14px) scale(.97);pointer-events:none;transition:.2s}.zifchat-right .zifchat-window{right:0}.zifchat-left .zifchat-window{left:0}.is-open .zifchat-window{opacity:1;transform:none;pointer-events:auto}.zifchat-header{background:var(--zifchat-header,#075e54);color:#fff;padding:17px;display:flex;align-items:center;gap:11px}.zifchat-avatar{width:42px;height:42px;border-radius:14px;background:rgba(255,255,255,.18);display:grid;place-items:center;font-weight:800}.zifchat-header-copy{display:flex;flex-direction:column;flex:1}.zifchat-header-copy strong{font-size:15px}.zifchat-header-copy span{font-size:12px;opacity:.8;margin-top:2px}.zifchat-close{border:0;background:transparent;color:#fff;font-size:26px;cursor:pointer}.zifchat-body{padding:20px;background:linear-gradient(145deg,#f0f5f3,#e8eeeb);min-height:145px}.zifchat-message{display:inline-block;max-width:88%;padding:12px 14px;background:#fff;border-radius:4px 14px 14px 14px;color:#17211d;font-size:14px;line-height:1.5;box-shadow:0 2px 8px rgba(15,23,42,.07)}.zifchat-compose{display:flex;gap:8px;align-items:flex-end;padding:11px;background:#fff;border-top:1px solid #eef1f0}.zifchat-compose textarea{box-sizing:border-box;flex:1;resize:none;min-height:42px;max-height:92px;border:1px solid #dfe5e2;border-radius:14px;padding:11px 13px;outline:0;font:inherit;font-size:14px}.zifchat-compose textarea:focus{border-color:#25d366;box-shadow:0 0 0 3px rgba(37,211,102,.1)}.zifchat-compose button{width:42px;height:42px;border:0;border-radius:14px;background:#25d366;display:grid;place-items:center;cursor:pointer}.zifchat-compose button svg{width:19px;fill:#fff}.zifchat-powered{text-align:center;font-size:10px;color:#8a9690;padding:0 0 8px;background:#fff}.zifchat-powered strong{color:#4d5a54}@media(max-width:420px){.zifchat-widget{bottom:16px}.zifchat-right{right:16px}.zifchat-left{left:16px}.zifchat-window{width:calc(100vw - 32px)}}.zifchat-section-title{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#718078;margin:18px 2px 8px}.zifchat-agents{display:grid;gap:7px}.zifchat-agent{width:100%;border:1px solid #e2e8e5;background:#fff;border-radius:14px;padding:10px;display:flex;align-items:center;gap:10px;text-align:left;cursor:pointer;transition:.18s}.zifchat-agent:hover,.zifchat-agent.is-selected{border-color:#25d366;box-shadow:0 4px 16px rgba(37,211,102,.12)}.zifchat-agent-avatar{width:36px;height:36px;border-radius:12px;background:#eafaf0;color:#138a43;display:grid;place-items:center;font-weight:800}.zifchat-agent-copy{display:flex;flex-direction:column;flex:1}.zifchat-agent-copy strong{font-size:13px;color:#17211d}.zifchat-agent-copy small{font-size:11px;color:#718078;margin-top:2px}.zifchat-chevron{font-size:22px;color:#9aa6a0}.zifchat-quick-replies{display:flex;flex-wrap:wrap;gap:7px}.zifchat-quick{border:1px solid #dce6e1;background:#fff;color:#33443c;border-radius:999px;padding:8px 10px;font-size:12px;cursor:pointer}.zifchat-quick:hover{border-color:#25d366;color:#138a43}.zifchat-body{max-height:380px;overflow:auto}

.zifchat-agent-avatar{overflow:hidden}.zifchat-agent-avatar img{width:100%;height:100%;object-fit:cover;display:block}

.zifchat-agent.is-unavailable{opacity:.55;cursor:not-allowed;background:#f8faf9}.zifchat-agent.is-unavailable:hover{border-color:#e2e8e5;box-shadow:none}.zifchat-agent.is-unavailable .zifchat-chevron{display:none}

/* ZifChat Pro AI layer */
.zifchat-ai-panel{padding:14px;border-bottom:1px solid #e5e7eb;background:#fff}
.zifchat-ai-intro{font-size:13px;line-height:1.45;margin-bottom:10px}
.zifchat-ai-messages{max-height:190px;overflow:auto;display:flex;flex-direction:column;gap:7px;margin:8px 0}
.zifchat-ai-msg{max-width:88%;padding:8px 10px;border-radius:10px;font-size:13px;line-height:1.4}
.zifchat-ai-msg.user{align-self:flex-end;background:#dcfce7}
.zifchat-ai-msg.assistant{align-self:flex-start;background:#f3f4f6}
.zifchat-ai-form{display:flex;gap:6px}
.zifchat-ai-input{min-width:0;flex:1;padding:9px 10px;border:1px solid #d1d5db;border-radius:8px}
.zifchat-ai-form button,.zifchat-ai-human,.zifchat-ai-handoff{cursor:pointer}
.zifchat-ai-form button{padding:8px 12px;border:0;border-radius:8px;background:#16a34a;color:#fff}
.zifchat-ai-human{margin-top:8px;padding:0;border:0;background:transparent;text-decoration:underline;font-size:12px}
.zifchat-ai-handoff{display:block;margin:5px 0 0;padding:8px 10px;border:0;border-radius:8px;background:#16a34a;color:#fff}

/* ZifChat Pro AI full-chat mode */
.zifchat-ai-mode .zifchat-body{padding:0;background:#fff;min-height:360px;max-height:440px;overflow:hidden}
.zifchat-ai-mode .zifchat-body>:not(.zifchat-ai-panel){display:none!important}
.zifchat-ai-mode .zifchat-compose{display:none!important}
.zifchat-ai-mode .zifchat-ai-panel{display:flex;flex-direction:column;box-sizing:border-box;min-height:360px;max-height:440px;padding:16px;background:#fff;border:0}
.zifchat-ai-welcome{display:flex;gap:10px;padding-bottom:12px;border-bottom:1px solid #eef1f0;font-size:13px;line-height:1.45}
.zifchat-ai-avatar{flex:0 0 34px;width:34px;height:34px;border-radius:11px;background:#eafaf0;color:#138a43;display:grid;place-items:center;font-size:11px;font-weight:800}
.zifchat-ai-welcome strong{display:block;margin-bottom:2px}.zifchat-ai-messages{flex:1;max-height:none;min-height:190px;overflow-y:auto;padding:12px 2px;display:flex;flex-direction:column;gap:8px;margin:0}
.zifchat-ai-msg{max-width:86%;padding:9px 11px;border-radius:12px;font-size:13px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}
.zifchat-ai-msg.user{align-self:flex-end;background:#dcfce7;border-bottom-right-radius:4px}.zifchat-ai-msg.assistant{align-self:flex-start;background:#f3f4f6;border-bottom-left-radius:4px}
.zifchat-ai-form{display:flex;gap:7px;padding-top:10px;border-top:1px solid #eef1f0}.zifchat-ai-input{box-sizing:border-box;min-width:0;flex:1;height:42px;padding:9px 11px;border:1px solid #d8dfdc;border-radius:12px;outline:0;font:inherit;font-size:13px}
.zifchat-ai-form button{height:42px;padding:0 15px;border:0;border-radius:12px;background:#16a34a;color:#fff;font-weight:600}.zifchat-ai-human{align-self:flex-start;margin-top:9px;padding:0;border:0;background:transparent;color:#475569;text-decoration:underline;font-size:12px}
.zifchat-ai-handoff{align-self:flex-start;margin-top:2px;padding:8px 11px;border:0;border-radius:9px;background:#16a34a;color:#fff;font-size:12px;font-weight:600}
.zifchat-ai-typing{display:flex!important;gap:4px;align-items:center;width:42px;min-height:18px}.zifchat-ai-typing span{width:6px;height:6px;border-radius:50%;background:#8b9791;animation:zifchatTyping 1s infinite ease-in-out}.zifchat-ai-typing span:nth-child(2){animation-delay:.15s}.zifchat-ai-typing span:nth-child(3){animation-delay:.3s}@keyframes zifchatTyping{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-3px);opacity:1}}


/* ZifChat Premium Widget polish — additive; behavior unchanged */
.zifchat-widget,.zifchat-panel,.zifchat-chat{font-synthesis:none}
.zifchat-panel,.zifchat-chat{border:1px solid rgba(17,54,34,.10);box-shadow:0 22px 65px rgba(15,36,25,.18)}
.zifchat-panel button,.zifchat-chat button,.zifchat-launcher{transition:transform .14s ease,box-shadow .14s ease,opacity .14s ease}
.zifchat-panel button:hover,.zifchat-chat button:hover{transform:translateY(-1px)}
.zifchat-panel button:focus-visible,.zifchat-chat button:focus-visible,.zifchat-launcher:focus-visible{outline:3px solid rgba(21,128,61,.28);outline-offset:2px}
.zifchat-agent,.zifchat-agent-card{transition:background .15s,border-color .15s,transform .15s}
.zifchat-agent:hover,.zifchat-agent-card:hover{transform:translateY(-1px)}
.zifchat-agent img,.zifchat-agent-card img{object-fit:cover}
.zifchat-ai-message,.zifchat-message{line-height:1.52}
@media(max-width:600px){.zifchat-panel,.zifchat-chat{max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 28px)!important}}
@media(prefers-reduced-motion:reduce){.zifchat-panel button,.zifchat-chat button,.zifchat-launcher,.zifchat-agent,.zifchat-agent-card{transition:none!important;transform:none!important}}


/* RC5 — visible premium frontend motion */
@keyframes zifchatPopIn{0%{opacity:0;transform:translateY(16px) scale(.78)}70%{opacity:1;transform:translateY(-3px) scale(1.04)}100%{opacity:1;transform:none}}
@keyframes zifchatNudgeIn{0%,35%{opacity:0;transform:translateX(8px)}100%{opacity:1;transform:none}}
@keyframes zifchatOpen{0%{opacity:0;transform:translateY(22px) scale(.94)}100%{opacity:1;transform:none}}
@keyframes zifchatRowIn{0%{opacity:0;transform:translateY(8px)}100%{opacity:1;transform:none}}
.zifchat-launcher{animation:zifchatPopIn .55s cubic-bezier(.2,.85,.2,1) both}
.zifchat-launcher-nudge{position:absolute;bottom:10px;right:74px;white-space:nowrap;background:#fff;color:#1f352a;border:1px solid #dce8e1;border-radius:12px;padding:9px 12px;font-size:12px;font-weight:700;box-shadow:0 8px 24px rgba(15,36,25,.13);animation:zifchatNudgeIn .7s ease .65s both;pointer-events:none}
.zifchat-left .zifchat-launcher-nudge{left:74px;right:auto}
.zifchat-launcher-nudge:after{content:"";position:absolute;right:-5px;top:50%;width:9px;height:9px;background:#fff;border-top:1px solid #dce8e1;border-right:1px solid #dce8e1;transform:translateY(-50%) rotate(45deg)}
.zifchat-left .zifchat-launcher-nudge:after{left:-5px;right:auto;border:0;border-left:1px solid #dce8e1;border-bottom:1px solid #dce8e1}
.zifchat-just-opened .zifchat-window{animation:zifchatOpen .32s cubic-bezier(.2,.85,.2,1) both}
.zifchat-just-opened .zifchat-agent,.zifchat-just-opened .zifchat-quick{animation:zifchatRowIn .3s ease both}
.zifchat-just-opened .zifchat-agent:nth-child(2),.zifchat-just-opened .zifchat-quick:nth-child(2){animation-delay:.05s}
.zifchat-just-opened .zifchat-agent:nth-child(3),.zifchat-just-opened .zifchat-quick:nth-child(3){animation-delay:.10s}
.zifchat-ai-msg{animation:zifchatRowIn .2s ease both}
@media(max-width:480px){.zifchat-launcher-nudge{display:none}}
@media(prefers-reduced-motion:reduce){.zifchat-launcher,.zifchat-launcher-nudge,.zifchat-just-opened .zifchat-window,.zifchat-just-opened .zifchat-agent,.zifchat-just-opened .zifchat-quick,.zifchat-ai-msg{animation:none!important}}

/* RC6 — contextual page-aware frontend */
.zifchat-launcher-nudge{max-width:230px;overflow:hidden;text-overflow:ellipsis}
.zifchat-ai-welcome{animation:zifchatRowIn .28s ease both}
.zifchat-ai-panel{background:linear-gradient(180deg,#fff,#fbfdfc)}


/* RC7 — clear, dismissible attention animation */
@keyframes zifchatAttentionBounce{0%,100%{transform:translateY(0)}12%{transform:translateY(-9px)}24%{transform:translateY(0)}34%{transform:translateY(-5px)}44%{transform:translateY(0)}}
@keyframes zifchatClickMeFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
.zifchat-launcher{animation:zifchatPopIn .55s cubic-bezier(.2,.85,.2,1) both,zifchatAttentionBounce 2.8s ease-in-out 1.1s infinite!important}
.zifchat-launcher-nudge{display:flex;align-items:center;gap:8px;animation:zifchatNudgeIn .7s ease .55s both,zifchatClickMeFloat 2.1s ease-in-out 1.3s infinite!important;padding:8px 8px 8px 12px!important;pointer-events:auto!important}
.zifchat-launcher-nudge[hidden]{display:none!important}
.zifchat-nudge-dismiss{display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:50%;background:#eef3f0;color:#53665c;font-size:16px;line-height:1;cursor:pointer}
.zifchat-nudge-dismiss:hover{background:#e2ebe6;color:#243b2f}
.zifchat-widget.is-open .zifchat-launcher{animation:none!important}
@media(prefers-reduced-motion:reduce){.zifchat-launcher,.zifchat-launcher-nudge{animation:none!important}}


/* v1.15 Final UI Release Candidate — frontend finish */
.zifchat-window{transform-origin:bottom right}
.zifchat-left .zifchat-window{transform-origin:bottom left}
.zifchat-header{min-height:54px}
.zifchat-body{scrollbar-width:thin;scrollbar-color:#aebbb4 transparent}
.zifchat-ai-messages{scrollbar-width:thin;scrollbar-color:#aebbb4 transparent}
.zifchat-ai-msg{line-height:1.55}
.zifchat-ai-msg.user{box-shadow:0 3px 10px rgba(22,163,74,.07)}
.zifchat-ai-msg.assistant{box-shadow:0 3px 10px rgba(15,36,25,.045)}
.zifchat-ai-form{gap:9px}
.zifchat-ai-input{min-height:44px}
.zifchat-ai-form button,.zifchat-ai-handoff{min-height:42px;font-weight:750}
.zifchat-ai-human{transition:color .15s,opacity .15s}
.zifchat-ai-human:hover{opacity:.78}
.zifchat-launcher:focus-visible,.zifchat-close:focus-visible,.zifchat-agent:focus-visible,.zifchat-quick:focus-visible,.zifchat-ai-form button:focus-visible,.zifchat-ai-handoff:focus-visible,.zifchat-nudge-dismiss:focus-visible{outline:3px solid rgba(21,128,61,.22);outline-offset:2px}
@media(max-width:480px){
 .zifchat-window{width:calc(100vw - 24px)!important;max-width:none!important;bottom:76px!important}
 .zifchat-right .zifchat-window{right:-4px!important}.zifchat-left .zifchat-window{left:-4px!important}
 .zifchat-ai-messages{max-height:42vh!important}
}

.zifchat-human-mode .zifchat-body{padding-top:14px}.zifchat-human-mode .zifchat-message{background:linear-gradient(135deg,#f6faf7,#fff);border:1px solid #dfe9e3}.zifchat-human-mode .zifchat-agents{margin-top:6px}.zifchat-woo-cta{display:block!important;width:100%;margin:12px 0!important;border-radius:10px!important;min-height:46px!important;font-weight:800!important}

.zifchat-return-ai{display:flex;align-items:center;justify-content:center;gap:7px;width:calc(100% - 32px);margin:12px 16px 0;padding:10px 14px;border:1px solid #cfe1d6;border-radius:10px;background:#f5faf7;color:#176536;font:inherit;font-weight:750;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}.zifchat-return-ai:hover{background:#edf8f1;border-color:#afd2bd;transform:translateY(-1px)}.zifchat-return-ai[hidden]{display:none!important}.zifchat-return-ai:focus-visible{outline:3px solid rgba(21,128,61,.18);outline-offset:2px}

/* Compact AI return action: intentionally secondary, like "Talk to a human". */
.zifchat-return-ai{width:auto!important;min-height:0!important;margin:8px auto 2px!important;padding:5px 9px!important;border:0!important;border-radius:7px!important;background:transparent!important;box-shadow:none!important;color:#65766d!important;font-size:12px!important;font-weight:650!important;line-height:1.3!important;transform:none!important}
.zifchat-return-ai:hover{background:#f3f7f4!important;color:#176536!important;transform:none!important}
.zifchat-return-ai:focus-visible{outline:2px solid rgba(21,128,61,.22)!important;outline-offset:2px}

.zifchat-woo-cta{background:#25D366!important;border-color:#25D366!important;color:#fff!important;text-shadow:none!important;box-shadow:none!important}
.zifchat-woo-cta:hover,.zifchat-woo-cta:focus{background:#1ebe5d!important;border-color:#1ebe5d!important;color:#fff!important}
.zifchat-woo-cta:focus-visible{outline:3px solid rgba(37,211,102,.24)!important;outline-offset:2px}

/* ZifChat 1.17 final frontend cleanup */
.zifchat-widget{--zif-ui-radius:14px}
.zifchat-panel{border-radius:20px!important}
.zifchat-agent{border-radius:14px!important}
.zifchat-compose input,.zifchat-compose textarea{border-radius:12px!important}
.zifchat-return-ai{font-size:12px!important;margin-top:6px!important}

/* v1.21.6 — compact viewport-safe widget + iOS input fix */
.zifchat-window{height:auto!important;min-height:0!important;max-height:calc(100dvh - 118px);display:flex;flex-direction:column}
.zifchat-header{flex:0 0 auto}
.zifchat-body{flex:0 1 auto;min-height:0;overflow-y:auto}
.zifchat-compose,.zifchat-powered{flex:0 0 auto}
@media(max-width:600px){
 .zifchat-widget{bottom:12px!important;right:12px!important;left:auto!important}
 .zifchat-window{position:fixed!important;top:12px!important;right:12px!important;bottom:86px!important;left:12px!important;width:auto!important;max-width:none!important;max-height:none!important;height:auto!important;border-radius:18px!important}
 .zifchat-body{max-height:none!important;overscroll-behavior:contain}
 .zifchat-compose textarea,.zifchat-ai-input{font-size:16px!important}
 .zifchat-compose textarea{min-height:46px}
 .zifchat-ai-input{height:46px!important;min-height:46px!important}
 .zifchat-ai-mode .zifchat-body{flex:1 1 auto;min-height:0!important;max-height:none!important}
 .zifchat-ai-mode .zifchat-ai-panel{flex:1 1 auto;min-height:0!important;max-height:none!important}
 .zifchat-ai-messages{min-height:0!important;max-height:none!important}
}

/* v1.21.7 — conversation-first sizing and mobile keyboard viewport */
/* Desktop/tablet: the window must hug its real content. No decorative empty top/bottom space. */
.zifchat-window{
  height:fit-content!important;
  min-height:0!important;
  max-height:min(680px,calc(100dvh - 112px))!important;
  padding:0!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
}
.zifchat-window>.zifchat-header{order:0;flex:0 0 auto!important;margin:0!important}
.zifchat-window>.zifchat-body{order:1;flex:0 1 auto!important;min-height:0!important;margin:0!important;overflow-y:auto!important}
.zifchat-window>.zifchat-return-ai{order:2}
.zifchat-window>.zifchat-compose{order:3;flex:0 0 auto!important;margin:0!important}
.zifchat-window>.zifchat-powered{order:4;flex:0 0 auto!important;margin:0!important;padding:7px 0 10px!important}
.zifchat-human-mode .zifchat-body{max-height:min(430px,calc(100dvh - 270px))!important}
.zifchat-ai-mode .zifchat-window{height:min(620px,calc(100dvh - 112px))!important}
.zifchat-ai-mode .zifchat-body{flex:1 1 auto!important;min-height:0!important;max-height:none!important}
.zifchat-ai-mode .zifchat-ai-panel{height:100%!important;min-height:0!important;max-height:none!important}
.zifchat-ai-mode .zifchat-ai-messages{flex:1 1 auto!important;min-height:90px!important;max-height:none!important;overflow-y:auto!important;overscroll-behavior:contain}

@media(max-width:600px){
  /* Use the *visible* iOS/Android viewport. JS updates these values when the keyboard opens. */
  .zifchat-window{
    position:fixed!important;
    top:var(--zifchat-vv-top,8px)!important;
    right:8px!important;
    bottom:auto!important;
    left:8px!important;
    width:auto!important;
    max-width:none!important;
    height:calc(var(--zifchat-vv-height,100dvh) - 16px)!important;
    max-height:calc(var(--zifchat-vv-height,100dvh) - 16px)!important;
    border-radius:18px!important;
  }
  .zifchat-header{padding:13px 15px!important;min-height:58px!important}
  .zifchat-body{flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch}
  .zifchat-compose{padding:9px!important;flex:0 0 auto!important}
  .zifchat-powered{padding:5px 0 7px!important;line-height:1.2!important}
  .zifchat-compose textarea,.zifchat-ai-input{font-size:16px!important;line-height:1.35!important;-webkit-text-size-adjust:100%}
  .zifchat-ai-mode .zifchat-window{height:calc(var(--zifchat-vv-height,100dvh) - 16px)!important}
  .zifchat-ai-mode .zifchat-body,.zifchat-ai-mode .zifchat-ai-panel{flex:1 1 auto!important;min-height:0!important;height:auto!important;max-height:none!important}
  .zifchat-ai-mode .zifchat-ai-messages{flex:1 1 auto!important;min-height:80px!important;max-height:none!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch}
  /* Keep the launcher out of the way while the keyboard is occupying the visual viewport. */
  .zifchat-keyboard-open .zifchat-launcher,.zifchat-keyboard-open .zifchat-launcher-nudge{display:none!important}
}

/* v1.22.10 — mobile compact chat when keyboard is closed.
 * Preserve the visual-viewport/full-height conversation mode only while typing. */
@media(max-width:600px){
  .zifchat-window,
  .zifchat-ai-mode .zifchat-window{
    top:auto!important;
    bottom:12px!important;
    height:auto!important;
    max-height:calc(var(--zifchat-vv-height,100dvh) - 24px)!important;
  }
  .zifchat-window>.zifchat-body,
  .zifchat-ai-mode .zifchat-body{
    flex:0 1 auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:calc(var(--zifchat-vv-height,100dvh) - 155px)!important;
  }
  .zifchat-ai-mode .zifchat-ai-panel{
    flex:0 1 auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
  }
  .zifchat-ai-mode .zifchat-ai-messages{
    flex:0 1 auto!important;
    min-height:80px!important;
    max-height:min(330px,calc(var(--zifchat-vv-height,100dvh) - 310px))!important;
    overflow-y:auto!important;
  }

  /* While the software keyboard is open, expand into the visible viewport so
   * the visitor can keep recent conversation context above the input. */
  .zifchat-keyboard-open .zifchat-window,
  .zifchat-keyboard-open.zifchat-ai-mode .zifchat-window{
    top:var(--zifchat-vv-top,8px)!important;
    bottom:auto!important;
    height:calc(var(--zifchat-vv-height,100dvh) - 16px)!important;
    max-height:calc(var(--zifchat-vv-height,100dvh) - 16px)!important;
  }
  .zifchat-keyboard-open .zifchat-window>.zifchat-body,
  .zifchat-keyboard-open.zifchat-ai-mode .zifchat-body,
  .zifchat-keyboard-open.zifchat-ai-mode .zifchat-ai-panel{
    flex:1 1 auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
  }
  .zifchat-keyboard-open.zifchat-ai-mode .zifchat-ai-messages{
    flex:1 1 auto!important;
    min-height:80px!important;
    max-height:none!important;
  }
}


/* v1.22.11: Free chat text sizing + safe AI links */
.zifchat-message,.zifchat-ai-msg{font-size:var(--zifchat-font-size,14px)!important}
.zifchat-ai-welcome,.zifchat-agent-copy strong{font-size:calc(var(--zifchat-font-size,14px) - 1px)!important}
.zifchat-agent-copy small,.zifchat-quick,.zifchat-section-title,.zifchat-ai-human,.zifchat-ai-handoff{font-size:calc(var(--zifchat-font-size,14px) - 2px)!important}
.zifchat-ai-input,.zifchat-compose textarea{font-size:var(--zifchat-font-size,14px)}
.zifchat-ai-link{color:#08783d;text-decoration:underline;text-decoration-thickness:1.5px;text-underline-offset:2px;font-weight:650;overflow-wrap:anywhere;word-break:break-word}
.zifchat-ai-link:hover,.zifchat-ai-link:focus{color:#065f32;text-decoration-thickness:2px}
@media(max-width:600px){.zifchat-ai-input,.zifchat-compose textarea{font-size:16px!important}}
