/* mflow-chat — online-support widget, fixed bottom-LEFT in both languages (physical left on purpose) */
.chat{position:fixed;left:20px;bottom:20px;z-index:calc(var(--mf-z-header) + 1);font-size:.95rem}
html.srch-open .chat,html.nav-open .chat{opacity:0;visibility:hidden}
.chat-fab{display:inline-flex;align-items:center;gap:8px;height:48px;padding:0 18px 0 16px;border-radius:var(--mf-r-pill);background-color:var(--mf-primary);background-image:var(--mf-grad-btn);color:var(--mf-on-primary);font-weight:700;text-decoration:none;box-shadow:var(--mf-glow);transition:transform var(--mf-dur-fast) var(--mf-ease),box-shadow var(--mf-dur) var(--mf-ease)}
.chat-fab:hover{color:var(--mf-on-primary);transform:translateY(-2px);box-shadow:var(--mf-glow-hover)}
.chat-fab:focus-visible{outline:3px solid var(--mf-focus,#93C5FD);outline-offset:3px}
.chat-fab svg{flex:none}
.chat.is-open .chat-fab{display:none}
.chat-panel{position:absolute;left:0;bottom:0;width:min(380px,calc(100vw - 24px));height:min(560px,calc(100vh - 104px));height:min(560px,calc(100dvh - 104px));min-height:min(320px,calc(100vh - 104px));display:flex;flex-direction:column;background:var(--mf-surface);color:var(--mf-text);border:1px solid var(--mf-border);border-radius:20px;box-shadow:var(--mf-shadow-lg);overflow:hidden}
.chat-panel[hidden]{display:none}
.chat-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;background-color:var(--mf-primary);background-image:var(--mf-grad-btn);color:var(--mf-on-primary)}
.chat-head strong{display:block;font-size:1rem}
.chat-head small{display:block;opacity:.9;font-size:.85rem;line-height:1.5}
.chat-head-btns{display:flex;gap:4px;flex:none}
.chat-ib{display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:50%;background:rgba(255,255,255,.16);color:inherit;cursor:pointer}
.chat-ib:hover{background:rgba(255,255,255,.28)}
.chat-ib:focus-visible{outline:2px solid #fff;outline-offset:2px}
.chat-log{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:14px;display:flex;flex-direction:column;gap:10px;background:var(--mf-bg-soft,var(--mf-surface-2))}
.chat-m{max-width:88%;padding:9px 13px;border-radius:16px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;font-size:.93rem}
.chat-m.bot{align-self:flex-start;background:var(--mf-surface);border:1px solid var(--mf-border);border-end-start-radius:5px}
.chat-m.me{align-self:flex-end;background:var(--mf-primary);color:var(--mf-on-primary);border-end-end-radius:5px}
.chat-m.typing{color:var(--mf-muted)}
.chat-m.typing::after{content:"";display:inline-block;width:1.4em;text-align:start;animation:mf-chat-dots 1.2s steps(4,end) infinite}
@keyframes mf-chat-dots{0%{content:""}25%{content:"."}50%{content:".."}75%,100%{content:"..."}}
.chat-src{align-self:flex-start;display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:.85rem;color:var(--mf-muted)}
.chat-src a{padding:3px 10px;border:1px solid var(--mf-border-strong);border-radius:var(--mf-r-pill);color:var(--mf-link);text-decoration:none;background:var(--mf-surface)}
.chat-src a:hover{border-color:var(--mf-primary);background:var(--mf-primary-soft)}
.chat-form{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--mf-border);background:var(--mf-surface)}
.chat-form textarea{flex:1;min-height:42px;max-height:110px;margin:0;padding:10px 12px;resize:none;border:1px solid var(--mf-border-strong);border-radius:14px;background:var(--mf-surface);color:var(--mf-text);font:inherit;line-height:1.5}
.chat-form textarea:focus-visible{outline:2px solid var(--mf-primary);outline-offset:1px}
.chat-send{flex:none;display:grid;place-items:center;width:42px;height:42px;border:0;border-radius:50%;background-color:var(--mf-primary);background-image:var(--mf-grad-btn);color:var(--mf-on-primary);cursor:pointer}
.chat-send:disabled{opacity:.5;cursor:not-allowed}
.chat-send svg{transform:scaleX(var(--mf-dir,1))}
.chat-foot{padding:8px 12px 10px;text-align:center;border-top:1px solid var(--mf-border);background:var(--mf-surface)}
.chat-form + .chat-foot{border-top:0;padding-top:0}
.chat-ticket{display:inline-block;padding:7px 16px;border:1px solid var(--mf-border-strong);border-radius:var(--mf-r-pill);color:var(--mf-link);font-size:.86rem;font-weight:600;text-decoration:none}
.chat-ticket:hover{border-color:var(--mf-primary);background:var(--mf-primary-soft)}
@media (max-width:560px){
  .chat{left:12px;bottom:12px}
  .chat-fab{width:48px;padding:0;justify-content:center}
  .chat-fab-t{display:none}
  .chat-panel{height:min(78vh,560px,calc(100vh - 88px));height:min(78dvh,560px,calc(100dvh - 88px))}
  html.chat-open .to-top{opacity:0;visibility:hidden}
}
@media (prefers-reduced-motion:reduce){.chat-fab,.chat-m.typing::after{transition:none;animation:none}}

/* mobile: page must not scroll behind the open chat */
.chat-panel{overscroll-behavior:contain}
@media (max-width:560px){html.chat-open,html.chat-open body{overflow:hidden}.chat-log{-webkit-overflow-scrolling:touch;touch-action:pan-y}}

/* Letter-by-letter reply: the not-yet-shown part keeps its space but is invisible, so the bubble never jumps */
.chat-m.is-typing{cursor:pointer}
.chat-rest{color:transparent;-webkit-user-select:none;user-select:none}
.chat-src.chat-in{animation:mf-chat-in .35s var(--mf-ease,ease) both}
@keyframes mf-chat-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.chat-src.chat-in{animation:none}}

@media (max-width:760px){.chat textarea,.chat input[type=text],[data-chat-input]{font-size:16px}}
