/* Live chat widget (customer site). Uses the site's existing colour variables. */
#ipchat { position: fixed; right: 16px; bottom: 16px; z-index: 1040; font-family: var(--ip-font-sans, system-ui, sans-serif); }
#ipchat .ipc-fab { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--ip-primary, #2E2E52); color: #fff; font-size: 1.5rem; box-shadow: 0 8px 24px -8px rgba(46,46,82,.6); position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; }
#ipchat .ipc-fab:focus-visible { outline: 3px solid #8FA8FF; outline-offset: 2px; }
#ipchat .ipc-dot { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #D53427; color: #fff; font-size: .7rem; line-height: 18px; text-align: center; display: none; }
#ipchat .ipc-panel { display: none; position: absolute; right: 0; bottom: 68px; width: 360px; max-width: calc(100vw - 24px); height: 520px; max-height: calc(100vh - 100px); background: #fff; border-radius: 1rem; box-shadow: 0 18px 50px -12px rgba(46,46,82,.45); flex-direction: column; overflow: hidden; border: 1px solid var(--ip-border, #D9DAE3); }
#ipchat.open .ipc-panel { display: flex; }
#ipchat .ipc-head { background: var(--ip-primary, #2E2E52); color: #fff; padding: .75rem 1rem; display: flex; align-items: center; gap: .6rem; }
#ipchat .ipc-head b { font-size: 1rem; display: block; }
#ipchat .ipc-head small { opacity: .85; font-size: .78rem; }
#ipchat .ipc-status { width: 10px; height: 10px; border-radius: 50%; background: #9aa; flex: none; }
#ipchat .ipc-status.on { background: #4cd08a; }
#ipchat .ipc-close { margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.25rem; cursor: pointer; line-height: 1; }
#ipchat .ipc-body { flex: 1; overflow-y: auto; padding: .75rem; background: var(--ip-background, #F8F8FA); font-size: .92rem; }
#ipchat .ipc-msg { max-width: 85%; margin-bottom: .5rem; padding: .5rem .7rem; border-radius: .8rem; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
#ipchat .ipc-msg.you { margin-left: auto; background: var(--ip-primary, #2E2E52); color: #fff; border-bottom-right-radius: .2rem; }
#ipchat .ipc-msg.staff { background: #fff; border: 1px solid var(--ip-border, #D9DAE3); border-bottom-left-radius: .2rem; }
#ipchat .ipc-msg.system { max-width: 100%; text-align: center; background: none; color: var(--ip-muted-foreground, #6B6B85); font-size: .8rem; }
#ipchat .ipc-time { display: block; font-size: .68rem; opacity: .7; margin-top: .15rem; }
#ipchat .ipc-file { display: block; font-size: .82rem; color: inherit; text-decoration: underline; }
#ipchat .ipc-typing { font-size: .8rem; color: var(--ip-muted-foreground, #6B6B85); padding: 0 .75rem .3rem; min-height: 1.2rem; background: var(--ip-background, #F8F8FA); }
#ipchat .ipc-foot { border-top: 1px solid var(--ip-border, #D9DAE3); padding: .5rem; background: #fff; }
#ipchat .ipc-foot textarea, #ipchat .ipc-form input, #ipchat .ipc-form textarea { width: 100%; border: 1px solid var(--ip-border, #D9DAE3); border-radius: .5rem; padding: .45rem .6rem; font-size: .9rem; margin-bottom: .4rem; }
#ipchat .ipc-foot textarea { resize: none; height: 44px; margin: 0; }
#ipchat .ipc-row { display: flex; gap: .4rem; align-items: center; margin-top: .4rem; }
#ipchat .ipc-btn { border: 0; border-radius: 999px; background: var(--ip-primary, #2E2E52); color: #fff; padding: .45rem 1rem; font-weight: 600; font-size: .85rem; cursor: pointer; min-height: 40px; }
#ipchat .ipc-btn.ghost { background: #fff; color: var(--ip-primary, #2E2E52); border: 1px solid var(--ip-border, #D9DAE3); }
#ipchat .ipc-btn:disabled { opacity: .6; cursor: default; }
#ipchat .ipc-form { padding: .75rem; overflow-y: auto; flex: 1; background: var(--ip-background, #F8F8FA); }
#ipchat .ipc-note { font-size: .78rem; color: var(--ip-muted-foreground, #6B6B85); }
#ipchat .ipc-err { color: #D53427; font-size: .82rem; margin: .25rem 0; }
#ipchat .ipc-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
#ipchat .ipc-link { background: none; border: 0; color: var(--ip-brand, #5C6EF8); padding: 0; font-size: .78rem; text-decoration: underline; cursor: pointer; }
@media (max-width: 480px) {
  #ipchat { right: 10px; bottom: 10px; }
  #ipchat .ipc-panel { position: fixed; inset: 0; width: auto; max-width: none; height: auto; max-height: none; border-radius: 0; }
  #ipchat .ipc-foot textarea, #ipchat .ipc-form input, #ipchat .ipc-form textarea { font-size: 16px; }   /* stops iOS zooming on focus */
}
@media (prefers-reduced-motion: no-preference) { #ipchat .ipc-panel { animation: ipcin .15s ease-out; } @keyframes ipcin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } } }
