#jfa-chat-toggle {position:fixed;left:16px;bottom:max(16px,env(safe-area-inset-bottom));z-index:1001;border:0;border-radius:28px;padding:12px 18px;background:var(--accent,#805e3b);color:white;font:600 14px system-ui;cursor:pointer;box-shadow:0 3px 16px #0003;max-width:calc(100vw - 110px)}
#jfa-chat-panel {position:fixed;left:16px;bottom:76px;width:min(620px,calc(100vw - 104px));max-height:min(880px,calc(100dvh - 108px));z-index:1002;display:flex;flex-direction:column;gap:14px;padding:24px;background:#fff;color:#242424;border:1px solid #ddd;border-radius:18px;box-shadow:0 12px 54px #0003;font:16px/1.6 system-ui;box-sizing:border-box;overflow:auto}
#jfa-chat-panel[hidden] {display:none!important}
#jfa-chat-panel * {box-sizing:border-box}
#jfa-chat-panel header {display:flex;align-items:center;justify-content:space-between;gap:8px}
#jfa-chat-panel header strong {font-size:19px;line-height:1.35}
#jfa-chat-close {border:0;background:transparent;font:28px system-ui;cursor:pointer;min-width:36px;min-height:36px}
#jfa-chat-log {overflow:auto;min-height:320px;max-height:min(620px,58dvh);overflow-wrap:anywhere;white-space:pre-wrap}
#jfa-chat-log p {margin:8px 0;padding:8px;border-radius:8px;background:#f3f1ee;font:inherit}
#jfa-chat-panel form {display:flex;flex-direction:column;gap:8px}
#jfa-chat-panel textarea {width:100%;min-height:110px;resize:vertical;max-height:280px;border:1px solid #bbb;border-radius:6px;padding:8px;font:16px system-ui}
#jfa-chat-panel button[type=submit] {padding:13px;border:0;border-radius:6px;background:var(--accent,#805e3b);color:#fff;cursor:pointer}
#jfa-chat-panel :disabled {cursor:not-allowed;opacity:.6}
#jfa-chat-status {margin:0;font-size:14px;overflow-wrap:anywhere}
#jfa-chat-toggle:focus-visible,#jfa-chat-panel :focus-visible {outline:3px solid #2673ba;outline-offset:3px}
@media(max-width:360px) {#jfa-chat-panel {left:8px;width:calc(100vw - 88px);padding:10px}#jfa-chat-toggle {left:8px}}

/* English leads; Chinese is a secondary line, not equal-weight duplicate text. */
#jfa-chat-panel .jfa-chat-en,#jfa-chat-toggle .jfa-chat-en {display:block;line-height:1.5}
#jfa-chat-panel .jfa-chat-zh,#jfa-chat-toggle .jfa-chat-zh {display:block;font-size:.8em;font-weight:400;line-height:1.5;margin-top:3px;opacity:.72}
#jfa-chat-toggle {padding:9px 18px;background:var(--primary,#2C3E50)}
#jfa-chat-panel {bottom:92px}
#jfa-chat-panel button[type=submit] {background:var(--primary,#2C3E50);font-size:16px;font-weight:600}

#jfa-chat-contacts {margin:0;font-size:15px;display:flex;flex-wrap:wrap;gap:4px 10px;align-items:center}
#jfa-chat-contacts a {color:var(--primary,#2C3E50);font-weight:600;text-decoration:underline;padding:4px 0}
#jfa-chat-contacts[hidden] {display:none!important}

/* Narrow screens: the panel may use nearly the whole width but always stops 104px short of the
   right edge, which is where the floating WhatsApp/Email buttons live. */
@media(max-width:560px){
  /* The floating WhatsApp/Email column is fixed to the bottom-right. Lift the panel above it so the
     panel can use nearly the whole screen width instead of stopping 104px short of the right edge. */
  #jfa-chat-panel {left:12px;right:12px;bottom:140px;padding:18px;width:auto;max-height:calc(100dvh - 164px);font-size:15px}
  #jfa-chat-log {min-height:220px;max-height:min(460px,46dvh)}
  #jfa-chat-panel textarea {min-height:92px}
}
