/* ScreenFixer website chat widget */
.sfc { position: fixed; right: 18px; bottom: 18px; z-index: 2300; font-family: inherit; }
/* launcher: a conversational pill, centred at the bottom of the screen on desktop */
.sfc__launcher { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); width: auto !important; max-width: calc(100vw - 32px); display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 999px; border: none; background: #0f172a; color: #fff; box-shadow: 0 12px 30px rgba(15,23,42,.35); cursor: pointer; margin: 0; text-align: left; white-space: nowrap; animation: sfcIn .5s ease-out both; transition: background .15s, transform .15s, box-shadow .15s; }
.sfc__launcher:hover { background: #0071e3; transform: translateX(-50%) translateY(-2px); box-shadow: 0 16px 34px rgba(0,113,227,.4); }
.sfc__launcher-avatar { position: relative; width: 44px; height: 44px; border-radius: 50%; background: #0071e3; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; }
.sfc__launcher:hover .sfc__launcher-avatar { background: #0f172a; }
.sfc__launcher-avatar i { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid #0f172a; animation: sfcPulse 2s infinite; }
.sfc__launcher-text { display: flex; flex-direction: column; line-height: 1.15; }
.sfc__launcher-text b { font-size: 14px; }
.sfc__launcher-text small { font-size: 12px; opacity: .8; }
.sfc__launcher-icon { opacity: .9; flex-shrink: 0; }
.sfc__launcher-short { display: none; font-size: 13px; font-weight: 700; }
.sfc__launcher-x { position: absolute; top: -8px; right: -6px; width: 22px !important; height: 22px !important; padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 50%; background: #fff; color: #334155; font-size: 11px; font-weight: 700; line-height: 22px; text-align: center; box-shadow: 0 2px 8px rgba(15,23,42,.3); cursor: pointer; display: block; }
.sfc__launcher-x:hover { background: #dc2626; color: #fff; }
/* minimised: a smaller tab glued to the right edge, still one click away */
.sfc--docked .sfc__launcher { left: auto; right: 0; bottom: 120px; transform: none; padding: 6px 12px 6px 6px; gap: 8px; border-radius: 999px 0 0 999px; box-shadow: 0 8px 20px rgba(15,23,42,.3); animation: none; }
.sfc--docked .sfc__launcher:hover { transform: translateX(-4px); }
.sfc--docked .sfc__launcher-x, .sfc--docked .sfc__launcher-text, .sfc--docked .sfc__launcher-icon, .sfc--docked .sfc__teaser { display: none; }
.sfc--docked .sfc__launcher-short { display: inline; }
.sfc--docked .sfc__launcher-avatar { width: 36px; height: 36px; font-size: 12px; }
.sfc__badge { position: absolute; top: -6px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px; background: #dc2626; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 6px; border: 2px solid #fff; }
.sfc--open .sfc__launcher, .sfc--open .sfc__teaser { display: none; }
/* teaser bubble shown once, a few seconds after the page loads */
.sfc__teaser { position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); max-width: 320px; background: #fff; color: #0f172a; border-radius: 16px; border-bottom-left-radius: 4px; padding: 12px 34px 12px 14px; font-size: 13.5px; line-height: 1.4; box-shadow: 0 14px 34px rgba(15,23,42,.25); border: 1px solid #e2e8f0; animation: sfcIn .4s ease-out both; }
.sfc__teaser[hidden] { display: none; }
.sfc__teaser-close { position: absolute; top: 6px; right: 8px; background: none; border: none; color: #94a3b8; font-size: 13px; cursor: pointer; padding: 4px; margin: 0; width: auto; }
@keyframes sfcPulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.6); } 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@keyframes sfcIn { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.sfc__panel { position: fixed; right: 18px; bottom: 18px; width: 380px; max-width: calc(100vw - 24px); height: 600px; max-height: calc(100vh - 36px); background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(15,23,42,.35); display: flex; flex-direction: column; overflow: hidden; }
.sfc__panel[hidden] { display: none; }
.sfc__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #0f172a; color: #fff; }
.sfc__avatar { width: 36px; height: 36px; border-radius: 50%; background: #0071e3; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.sfc__title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.sfc__title b { font-size: 14px; }
.sfc__title span { font-size: 12px; opacity: .8; }
.sfc__title span.is-live { color: #4ade80; opacity: 1; }
.sfc__title span.is-waiting { color: #fbbf24; opacity: 1; }
.sfc__close { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; padding: 4px 6px; margin: 0; width: auto; }
.sfc__log { flex: 1; overflow-y: auto; padding: 14px 12px 6px; background: #f8fafc; display: flex; flex-direction: column; gap: 8px; }
.sfc__msg { max-width: 86%; padding: 9px 12px; border-radius: 16px; font-size: 14px; line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
.sfc__msg a { color: #0071e3; text-decoration: underline; }
.sfc__msg--assistant, .sfc__msg--staff { background: #fff; border: 1px solid #e2e8f0; border-bottom-left-radius: 4px; align-self: flex-start; }
.sfc__msg--staff { border-color: #bbf7d0; background: #f0fdf4; }
.sfc__msg--customer { background: #0071e3; color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.sfc__msg--system { background: transparent; color: #64748b; font-size: 12px; text-align: center; align-self: center; max-width: 100%; padding: 2px 6px; }
.sfc__who { display: block; font-size: 11px; color: #64748b; margin-bottom: 2px; }
.sfc__typing { display: inline-flex; gap: 4px; padding: 10px 14px; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; border-bottom-left-radius: 4px; align-self: flex-start; }
.sfc__typing i { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: sfcBounce 1.2s infinite; }
.sfc__typing i:nth-child(2) { animation-delay: .2s; } .sfc__typing i:nth-child(3) { animation-delay: .4s; }
@keyframes sfcBounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
.sfc__actions { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 90%; }
.sfc__btn { border: 1.5px solid #0071e3; background: #fff; color: #0071e3; border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; cursor: pointer; margin: 0; width: auto; }
.sfc__btn:hover { background: #0071e3; color: #fff; }
.sfc__btn--ghost { border-color: #cbd5e1; color: #475569; }
.sfc__btn--ghost:hover { background: #f1f5f9; color: #0f172a; }
.sfc__contact { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 10px 12px; align-self: stretch; display: grid; gap: 6px; }
.sfc__contact p { margin: 0 0 2px; font-size: 13px; color: #334155; }
.sfc__contact input { width: 100%; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 10px; padding: 8px 10px; font-size: 14px; margin: 0; background: #fff; color: #0f172a; }
.sfc__contact button { margin: 0; }
.sfc__wait { font-size: 12px; color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 6px 10px; align-self: center; }
.sfc__chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 12px; background: #f8fafc; }
.sfc__chips:empty { display: none; }
.sfc__chip { border: 1px solid #cbd5e1; background: #fff; border-radius: 999px; padding: 6px 11px; font-size: 12.5px; color: #0f172a; cursor: pointer; margin: 0; width: auto; }
.sfc__chip:hover { border-color: #0071e3; color: #0071e3; }
.sfc__form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e2e8f0; background: #fff; align-items: flex-end; }
.sfc__form textarea { flex: 1; resize: none; border: 1px solid #cbd5e1; border-radius: 14px; padding: 10px 12px; font-size: 14px; font-family: inherit; line-height: 1.4; max-height: 120px; margin: 0; box-sizing: border-box; background: #fff; color: #0f172a; }
.sfc__form textarea::placeholder { color: #94a3b8; }
.sfc__form textarea:focus { outline: none; border-color: #0071e3; box-shadow: 0 0 0 3px rgba(0,113,227,.15); }
.sfc__send { width: 42px; height: 42px; border-radius: 50%; border: none; background: #0071e3; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; margin: 0; padding: 0; }
.sfc__send:disabled { opacity: .5; cursor: default; }
.sfc__foot { font-size: 10.5px; color: #94a3b8; text-align: center; padding: 4px 10px 8px; background: #fff; }
body.nav-open .sfc { display: none; }
@media (max-width: 768px) {
    .sfc { right: 14px; bottom: 16px; }
    /* phones: compact pill in the corner (the sticky order bar owns the bottom centre) */
    .sfc__launcher { left: auto; right: 14px; bottom: 16px; transform: none; padding: 6px 14px 6px 6px; gap: 8px; animation: none; }
    .sfc__launcher:hover { transform: none; }
    .sfc__launcher-avatar { width: 38px; height: 38px; font-size: 12px; }
    .sfc__launcher-text b { font-size: 13px; }
    .sfc__launcher-text small { display: none; }
    .sfc__launcher-icon { display: none; }
    .sfc--lift .sfc__launcher { bottom: 84px; }
    /* phones, minimised: a round floating button in the bottom-right corner */
    .sfc--docked .sfc__launcher { right: 14px; bottom: 16px; width: 52px !important; height: 52px; padding: 0; border-radius: 50%; justify-content: center; }
    .sfc--docked.sfc--lift .sfc__launcher { bottom: 84px; }
    .sfc--docked .sfc__launcher-short, .sfc--docked .sfc__launcher-avatar { display: none; }
    .sfc--docked .sfc__launcher-icon { display: block; }
    .sfc__launcher-x { top: -6px; right: -4px; }
    .sfc__teaser { left: 14px; right: 14px; bottom: 74px; transform: none; max-width: none; animation: none; }
    .sfc--lift .sfc__teaser { bottom: 142px; }
    .sfc__panel { right: 0; bottom: 0; left: 0; width: 100%; max-width: none; height: 100%; max-height: 100dvh; border-radius: 0; }
    .sfc__msg { max-width: 92%; }
}

/* exit-intent survey */
.sfc__exit { position: fixed; inset: 0; z-index: 2400; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sfc__exit[hidden] { display: none; }
.sfc__exit-card { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 18px; padding: 26px 24px 22px; box-shadow: 0 24px 60px rgba(15,23,42,.35); text-align: center; animation: sfcCard .25s ease-out both; }
.sfc__exit-close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: #64748b; font-size: 16px; cursor: pointer; padding: 4px; margin: 0; width: auto; }
.sfc__exit-icon { font-size: 34px; margin-bottom: 4px; }
.sfc__exit-card h3 { font-size: 19px; font-weight: 800; color: #0f172a; margin: 0 0 6px; }
.sfc__exit-card p { font-size: 13.5px; color: #64748b; margin: 0 0 14px; line-height: 1.45; }
.sfc__exit-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.sfc__exit-btn { border: 1.5px solid #e2e8f0; background: #f8fafc; color: #0f172a; border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 600; cursor: pointer; margin: 0; text-align: left; line-height: 1.3; width: auto !important; }
.sfc__exit-btn:hover, .sfc__exit-btn.is-on { border-color: #0071e3; background: #eff6ff; color: #0071e3; }
.sfc__exit-form { display: flex; gap: 8px; align-items: flex-end; }
.sfc__exit-form textarea { flex: 1; border: 1px solid #cbd5e1; border-radius: 12px; padding: 9px 12px; font-size: 13.5px; font-family: inherit; resize: none; margin: 0; background: #fff; color: #0f172a; box-sizing: border-box; }
.sfc__exit-form .sfc__btn { background: #0071e3; color: #fff; padding: 10px 18px; }
.sfc__exit-thanks { font-size: 15px; font-weight: 700; color: #15803d; padding: 12px 0 4px; }
@keyframes sfcCard { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .sfc__exit-reasons { grid-template-columns: 1fr; } .sfc__exit-card { padding: 22px 16px 18px; } }

/* the assistant steps in after the exit survey: centred, with a backdrop */
.sfc--center::before { content: ''; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 2290; animation: sfcFade .3s ease-out both; }
.sfc--center .sfc__panel { right: auto; bottom: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); height: min(640px, calc(100vh - 40px)); width: 420px; z-index: 2300; animation: sfcCard .3s ease-out both; }
@keyframes sfcFade { from { opacity: 0; } to { opacity: 1; } }
.sfc__exit-reasons.is-shake { animation: sfcShake .4s; }
@keyframes sfcShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (max-width: 768px) { .sfc--center .sfc__panel { left: 0; top: 0; transform: none; width: 100%; height: 100%; } }
