/* Nect Me support chat (the button in the corner and its panel), for the member app and the website (chat.js).
   Everything is under .nm--chat, so it looks the same on both and does not need the website's stylesheet. The website's own copy of the older
   rules stays in site.css; the same values are used here. New in this file: the helper-first chat (chips, "Talk to a person", the handover form). */
.nm--chat{
  --ink:#16130F; --ink2:#4A453D; --mute:#6B655B; --line:#E3DED3; --line2:#8F887C;
  --blue:#0E5A43; --blue-d:#0A4332; --blue-soft:#E4EDE7; --coral:#F6F3EC; --sand:#ECE7DC; --mint:#0E5A43; --mint-soft:#E4EDE7;
  --danger:#B3261E; --danger-soft:#F7E4E2; --soft:#F6F3EC;
  --f-d:"Newsreader",Georgia,"Times New Roman",serif;
  --f-b:"Instrument Sans",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --ease:cubic-bezier(.2,.8,.2,1);
  font-family:var(--f-b); color:var(--ink);
}
.nm--chat *,.nm--chat *::before,.nm--chat *::after{box-sizing:border-box}

/* the button */
.nm--chat .nmc-fab{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:70;display:inline-flex;align-items:center;gap:10px;height:56px;padding:0 20px 0 16px;border:0;border-radius:var(--r-s,6px);background:#16130F;color:#fff;font:650 .98rem var(--f-b);cursor:pointer;box-shadow:var(--sh2,0 12px 28px -14px rgba(22,19,15,.38));transition:transform .2s var(--ease)}
.nm--chat .nmc-fab:hover{transform:translateY(-2px)}
.nm--chat .nmc-fab:focus-visible,.nm--chat .nmc button:focus-visible,.nm--chat .nmc a:focus-visible{outline:3px solid #fff;outline-offset:2px;box-shadow:0 0 0 5px var(--blue)}
.nm--chat .nmc-fab svg{flex:none;stroke:#fff;color:#fff}
.nm--chat .nmc-fab .dot{width:10px;height:10px;border-radius:50%;background:#CFC8BA;border:2px solid #fff;margin-left:-2px;box-sizing:content-box}
.nm--chat .nmc-fab.is-online .dot{background:#2fd08a;box-shadow:0 0 0 4px rgba(47,208,138,.25)}
.nm--chat .nmc-fab b{display:none;min-width:20px;height:20px;padding:0 6px;border-radius:var(--r-s,6px);background:var(--coral);color:#22100a;font:800 .72rem/20px var(--f-b);text-align:center}
.nm--chat .nmc-fab.has-new b{display:inline-block}
@media(max-width:560px){.nm--chat .nmc-fab span.lbl{display:none}.nm--chat .nmc-fab{width:56px;padding:0;justify-content:center}.nm--chat .nmc-fab .dot{position:absolute;right:12px;top:12px;margin:0}}
/* inside the member app, on a phone the bottom tab bar is there, so the button sits above it */
@media(max-width:1023px){body.has-tab .nm--chat .nmc-fab{bottom:calc(var(--d-tab,56px) + 22px + env(safe-area-inset-bottom))}}
body.app-has-modal .nm--chat .nmc-fab{display:none}
.nm--chat .nmc-fab{transition:transform .2s var(--ease),opacity .2s}
.nm--chat .nmc-fab.nmc-fab--up{bottom:calc(88px + env(safe-area-inset-bottom))}
.nm--chat .nmc-fab.nmc-fab--tuck{opacity:0;pointer-events:none;transform:translateY(14px)}
.nm--chat .nmc-fab.nmc-fab--edge:not(:hover):not(:focus-visible){transform:translateX(calc(100% - 20px));opacity:.92}
@media(max-width:560px){.page-legal .nm--chat .nmc-fab{width:46px;height:46px;bottom:calc(12px + env(safe-area-inset-bottom));right:12px}}

/* the panel */
.nm--chat .nmc{position:fixed;z-index:80;right:16px;bottom:calc(84px + env(safe-area-inset-bottom));width:min(380px,calc(100vw - 24px));max-height:min(620px,calc(100dvh - 110px));display:flex;flex-direction:column;border-radius:var(--r,16px);background:#fff;border:1px solid var(--line);box-shadow:var(--sh2,0 12px 28px -14px rgba(22,19,15,.38));overflow:hidden;line-height:1.45;transform:translateY(16px) scale(.97);opacity:0;visibility:hidden;transition:transform .3s var(--ease),opacity .25s,visibility .3s}
.nm--chat .nmc.is-open{transform:none;opacity:1;visibility:visible}
@media(max-width:560px){.nm--chat .nmc{right:8px;left:8px;width:auto;bottom:calc(8px + env(safe-area-inset-bottom));max-height:calc(100dvh - 16px)}}
.nm--chat .nmc__head{display:flex;align-items:center;gap:12px;padding:16px 16px 14px 18px;background:#16130F;color:#fff}
.nm--chat .nmc__head b{display:block;font:500 1.05rem var(--f-d)}
.nm--chat .nmc__head small{display:block;opacity:.9;font-size:.82rem}
.nm--chat .nmc__logo{flex:none;width:38px;height:38px;border-radius:var(--r,16px);background:#fff}
.nm--chat .nmc__x{margin-left:auto;flex:none;width:44px;height:44px;border:0;border-radius:50%;background:rgba(255,255,255,.18);color:#fff;display:grid;place-items:center;cursor:pointer}
.nm--chat .nmc__body{flex:1;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:10px;background:#F6F3EC;min-height:220px}
.nm--chat .nmc.is-live .nmc__body{min-height:260px}
.nm--chat .nmc__msg{max-width:88%;padding:10px 14px;border-radius:var(--r,16px);font-size:1rem;line-height:1.45;word-wrap:break-word;overflow-wrap:anywhere;white-space:pre-wrap}
.nm--chat .nmc__msg--them{align-self:flex-start;background:#fff;border:1px solid var(--line);border-bottom-left-radius:4px}
.nm--chat .nmc__msg--me{align-self:flex-end;background:var(--blue);color:#fff;border-bottom-right-radius:4px}
.nm--chat .nmc__msg--sys{align-self:center;background:transparent;color:var(--mute);font-size:.84rem;text-align:center}
.nm--chat .nmc__msg--bot{background:var(--soft)}
.nm--chat .nmc__msg.is-pending{opacity:.6}
.nm--chat .nmc__msg.is-failed{background:var(--danger-soft);opacity:1}
.nm--chat .nmc__auto{display:block;font-size:.76rem;font-weight:600;color:var(--mute);margin:0 0 4px;white-space:normal}
.nm--chat .nmc__go{display:table;margin-top:8px;font-weight:600;white-space:normal;color:var(--blue-d)}

/* quick questions, and the offer of a person under an answer */
.nm--chat .nmc__chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:2px}
.nm--chat .nmc__chip{min-height:44px;padding:8px 14px;border-radius:var(--r-s,6px);border:1.5px solid var(--line2);background:#fff;color:var(--ink);font:600 1rem var(--f-b);cursor:pointer;text-align:left}
.nm--chat .nmc__chip:hover{border-color:var(--blue);color:var(--blue-d)}
.nm--chat .nmc__offer{display:flex}
.nm--chat .nmc__report{display:block;margin-top:8px;padding:8px 0;min-height:36px;font:inherit;font-size:14px;background:none;border:0;color:var(--blue-d);text-decoration:underline;cursor:pointer;text-align:left}
.nm--chat .nmc__report:disabled{color:var(--ink2);text-decoration:none;cursor:default}
.nm--chat .nmc__person{padding:8px 12px 0;display:flex;justify-content:center;background:#fff;border-top:1px solid var(--line)}
.nm--chat .nmc__person .s-btn{min-height:44px;width:100%}

/* forms */
.nm--chat .nmc__form{display:grid;gap:10px;padding:16px;overflow:auto}
.nm--chat .nmc__form p{margin:0}
.nm--chat .s-field{display:grid;gap:6px;min-width:0}
.nm--chat .s-field>span{font-weight:650;font-size:.84rem}
.nm--chat input,.nm--chat select,.nm--chat textarea{width:100%;min-height:46px;padding:10px 13px;border:1.5px solid var(--line2);border-radius:var(--r,16px);background:#fff;color:var(--ink);font:400 16px/1.4 var(--f-b)}
.nm--chat textarea{min-height:90px;resize:vertical}
.nm--chat input:focus,.nm--chat select:focus,.nm--chat textarea:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(14,90,67,.2)}
.nm--chat .s-hp{position:absolute;left:-9999px;width:1px;height:1px;opacity:0}
.nm--chat .s-err{padding:12px 14px;border-radius:var(--r,16px);background:var(--danger-soft);color:#8C1D17;font-weight:600;font-size:.94rem}
.nm--chat .s-err[hidden]{display:none}
.nm--chat .s-form__fine{font-size:.875rem;color:var(--mute)}
.nm--chat .s-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 20px;border-radius:var(--r,16px);border:1.5px solid transparent;font:650 .98rem var(--f-b);text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.nm--chat .s-btn[disabled]{opacity:.55;pointer-events:none}
.nm--chat .s-btn--primary{background:var(--blue);color:#fff}
.nm--chat .s-btn--primary:hover{background:var(--blue-d)}
.nm--chat .s-btn--soft{background:var(--blue-soft);color:var(--blue-d)}
.nm--chat .s-btn--ghost{background:#fff;border-color:var(--line2);color:var(--ink)}
.nm--chat .s-done{text-align:center;padding:24px 14px}
.nm--chat .s-done__tick{display:inline-grid;place-items:center;width:64px;height:64px;border-radius:50%;background:var(--mint-soft);color:var(--mint);margin-bottom:12px}
.nm--chat .s-done h3{font:500 1.4rem var(--f-d);margin:0 0 8px}
.nm--chat .s-done p{color:var(--ink2);margin:0 0 8px}

/* the typing bar, the foot and the "everyone is busy" box */
.nm--chat .nmc__send{display:flex;gap:8px;padding:12px;border-top:1px solid var(--line);background:#fff}
.nm--chat .nmc__person+.nmc__send{border-top:0}
.nm--chat .nmc__send textarea{min-height:46px;max-height:110px;padding:11px 14px;border-radius:var(--r,16px);resize:none;flex:1;display:block}
.nm--chat .nmc__send button{flex:none;width:46px;height:46px;border-radius:50%;border:0;background:var(--blue);color:#fff;display:grid;place-items:center;cursor:pointer;padding:0}
.nm--chat .nmc__send button:disabled{opacity:.5}
.nm--chat .nmc__foot{display:flex;justify-content:space-between;gap:8px;padding:8px 16px 12px;background:#fff;font-size:.8rem;color:var(--mute)}
.nm--chat .nmc__foot:empty{display:none}
.nm--chat .nmc__foot button{border:0;background:none;color:var(--mute);text-decoration:underline;cursor:pointer;padding:6px 0;min-height:32px}
.nm--chat .nmc__slow{padding:12px 16px;background:var(--sand);border-top:1px solid #F1E4D3;font-size:.9rem}
.nm--chat .nmc__slow p{margin:0 0 8px;color:var(--ink)}
.nm--chat .nmc__slow form{display:flex;gap:8px;flex-wrap:wrap}
.nm--chat .nmc__slow input{flex:1 1 150px;min-height:44px}
.nm--chat .nmc__slow .s-btn{min-height:44px;padding:0 16px}

@media(prefers-reduced-motion:reduce){.nm--chat .nmc,.nm--chat .nmc-fab{transition:none}}
