/* Funnelr chat widget (chat.js). Brand colours from the --f-* variables; --f-chat-lift keeps it above bottom bars. */
.f-chat { position: fixed; bottom: calc(20px + var(--f-chat-lift, 0px) + env(safe-area-inset-bottom)); z-index: 2147481000; font: 400 15px/1.45 var(--f-font, system-ui, sans-serif); color: var(--f-text); transition: bottom .25s, opacity .2s; }
.f-chat-right { right: 20px; } .f-chat-left { left: 20px; }
.f-chat.f-chat-under { opacity: 0; pointer-events: none; }
.f-chat, .f-chat * { box-sizing: border-box; }
.f-chat div, .f-chat form, .f-chat p, .f-chat button { margin: 0; }
.f-chat .f-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.f-chat-bub { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--f-accent); color: var(--f-accent-ink); box-shadow: 0 14px 40px -10px rgba(0, 0, 0, .55); transition: transform .2s; }
.f-chat-bub:hover { transform: translateY(-2px) scale(1.04); }
.f-chat-bub:focus-visible, .f-chat button:focus-visible, .f-chat textarea:focus-visible, .f-chat input:focus-visible { outline: 2px solid var(--f-accent); outline-offset: 2px; }
.f-chat-bub svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.f-chat-n { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--f-error, #e5484d); color: #fff; font: 700 11.5px/20px var(--f-font); text-align: center; }
.f-chat.is-open .f-chat-bub { transform: scale(.9); }
.f-chat-panel { position: absolute; bottom: 72px; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 140px - var(--f-chat-lift, 0px))); display: flex; flex-direction: column; background: var(--f-card); border: 1px solid var(--f-line2); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
.f-chat-right .f-chat-panel { right: 0; } .f-chat-left .f-chat-panel { left: 0; }
.f-chat-panel[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .f-chat-panel:not([hidden]) { animation: f-chat-in .25s cubic-bezier(.2, .8, .2, 1); } @keyframes f-chat-in { from { opacity: 0; transform: translateY(12px) scale(.98); } } }
.f-chat-hd { display: flex; align-items: center; gap: 11px; padding: 13px 12px 13px 16px; background: var(--f-bg2); border-bottom: 1px solid var(--f-line); }
.f-chat-hd img, .f-chat-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: var(--f-accent); }
.f-chat-hd > div { flex: 1; min-width: 0; } .f-chat-hd b { display: block; color: var(--f-hi); font-weight: 650; }
.f-chat-sub { display: block; color: var(--f-mute); font-size: 12.5px; }
.f-chat-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--f-mute); font-size: 22px; line-height: 1; cursor: pointer; }
.f-chat-x:hover { background: var(--f-card2); color: var(--f-hi); }
.f-chat-log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 9px; overscroll-behavior: contain; }
.f-chat-m { max-width: 86%; display: flex; flex-direction: column; gap: 3px; }
.f-chat-m > div { padding: 9px 13px; border-radius: 16px; background: var(--f-card2); color: var(--f-text); word-wrap: break-word; }
.f-chat-m > div p { margin: 0 0 .5em; } .f-chat-m > div p:last-child { margin: 0; } .f-chat-m > div a { color: inherit; text-decoration: underline; }
.f-chat-m > div ul, .f-chat-m > div ol { margin: .2em 0 .5em; padding-left: 1.2em; }
.f-chat-m > i { font-style: normal; font-size: 11px; font-weight: 650; color: var(--f-dim); padding: 0 6px; }
.f-chat-m.from-visitor { align-self: flex-end; } .f-chat-m.from-visitor > div { background: var(--f-accent); color: var(--f-accent-ink); border-bottom-right-radius: 5px; }
.f-chat-m.from-owner > div, .f-chat-m.from-ai > div { border-bottom-left-radius: 5px; }
.f-chat-m.from-ai > i { color: var(--f-accent); }
.f-chat-m.from-system { align-self: center; max-width: 94%; } .f-chat-m.from-system > div { background: transparent; color: var(--f-mute); font-size: 13px; text-align: center; padding: 2px 6px; }
.f-chat-pending { opacity: .6; }
.f-chat-dots > div { display: flex; gap: 4px; padding: 13px 14px; } .f-chat-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--f-mute); }
@media (prefers-reduced-motion: no-preference) { .f-chat-dots span { animation: f-chat-d 1.2s infinite; } .f-chat-dots span:nth-child(2) { animation-delay: .2s; } .f-chat-dots span:nth-child(3) { animation-delay: .4s; } @keyframes f-chat-d { 50% { opacity: .25; } } }
.f-chat-foot { border-top: 1px solid var(--f-line); padding: 10px; display: grid; gap: 8px; background: var(--f-card); }
.f-chat-person { justify-self: start; border: 1px solid var(--f-line2); background: transparent; color: var(--f-hi); border-radius: 99px; padding: 6px 12px; font: 600 13px var(--f-font); cursor: pointer; }
.f-chat-person:hover { border-color: var(--f-accent); }
.f-chat-mail p { margin: 0 0 6px; color: var(--f-mute); font-size: 13px; }
.f-chat-mail div, .f-chat-form { display: flex; gap: 8px; align-items: flex-end; }
.f-chat-mail input, .f-chat-form textarea { flex: 1; min-width: 0; border: 1px solid var(--f-line2); background: var(--f-bg); color: var(--f-text); border-radius: 12px; padding: 10px 12px; font: 400 15px/1.35 var(--f-font); resize: none; }
.f-chat-form textarea { max-height: 140px; }
.f-chat-mail button, .f-chat-form button { flex: none; border: 0; cursor: pointer; background: var(--f-accent); color: var(--f-accent-ink); border-radius: 12px; height: 42px; padding: 0 14px; font: 600 14px var(--f-font); }
.f-chat-form button { width: 42px; padding: 0; display: grid; place-items: center; } .f-chat-form button svg { width: 18px; height: 18px; fill: currentColor; }
.f-chat-form button:disabled { opacity: .5; }
.f-chat-err { margin: 0; color: var(--f-error, #e5484d); font-size: 13px; }
.f-chat-err[hidden], .f-chat-mail[hidden], .f-chat-person[hidden], .f-chat-n[hidden] { display: none; }
@media (max-width: 520px) {
  .f-chat-right { right: 14px; } .f-chat-left { left: 14px; }
  .f-chat.is-open { inset: 0; bottom: 0; }
  .f-chat.is-open .f-chat-bub { display: none; }
  .f-chat.is-open .f-chat-panel { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; }
}
