/*
 * v3.9.628 — small refinements to the ORIGINAL chat window (tse-safari-chat.css stays the design).
 * Only additions for the chat platform (status, delivery, team replies, handover) and readability.
 */

/* Readability: slightly larger message text, same colours, corners and spacing. */
.tse-safari-chat__bubble{font-size:14px;line-height:1.5}
.tse-safari-chat__bubble a{color:#3b6b18;text-decoration:underline;overflow-wrap:anywhere}
.tse-safari-chat__messages{scroll-behavior:smooth;overscroll-behavior:contain}
.tse-safari-chat__welcome .tse-safari-chat__optional{font-weight:400;color:#6b766d}

/* Real conversation status in the original header pill. */
.tse-safari-chat[data-tse-chat-status="waiting"] .tse-safari-chat__online{background:#fff4dc;color:#7a5200}
.tse-safari-chat[data-tse-chat-status="resolved"] .tse-safari-chat__online{background:#eef0ec;color:#4a554d}

/* Team replies: same assistant bubble with the specialist's name. */
.tse-safari-chat__sender{font-size:11px;font-weight:700;line-height:1.2;color:#386a11}
.tse-safari-chat__message--agent .tse-safari-chat__bubble--assistant{border-color:#d3e3c4}

/* System notices (handover, resolved). */
.tse-safari-chat__message--system{align-self:center;max-width:92%}
.tse-safari-chat__system{margin:0;padding:6px 12px;border-radius:12px;background:#eef2eb;color:#47564a;font-size:12px;line-height:1.45;text-align:center;white-space:pre-wrap}

/* Delivery indicator and retry for visitor messages. */
.tse-safari-chat__delivery{align-self:flex-end;font-size:10px;line-height:1.1;color:#5e7a4c}
.tse-safari-chat__message--visitor[data-state="pending"] .tse-safari-chat__bubble{opacity:.75}
.tse-safari-chat__message--visitor[data-state="failed"] .tse-safari-chat__delivery{color:#a42323;font-weight:700}
.tse-safari-chat__message--visitor{flex-wrap:wrap;justify-content:flex-start}
.tse-safari-chat__retry{align-self:center;min-height:32px;padding:5px 11px!important;border:1px solid #d3dfcc!important;border-radius:20px!important;background:#fff!important;color:#a42323!important;font:700 12px/1.2 inherit;cursor:pointer}
.tse-safari-chat__older{align-self:center;min-height:32px;padding:5px 12px!important;border:1px solid #d3dfcc!important;border-radius:20px!important;background:#fff!important;color:#315b18!important;font-size:12px;cursor:pointer}
.tse-safari-chat__older:disabled{opacity:.6;cursor:wait}

/* "Talk to Laurent" button and request card in the original form style. */
.tse-safari-chat__handover-link{align-self:flex-start;min-height:40px;margin:2px 0 9px;padding:9px 14px!important;border:1px solid #68A522!important;border-radius:12px!important;background:#fff!important;color:#3b6b18!important;font:700 12px/1.35 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;cursor:pointer}
.tse-safari-chat__handover-link[hidden],.tse-safari-chat__quick-replies button[hidden]{display:none!important}
.tse-safari-chat__handover{display:flex;flex-direction:column;gap:8px;flex:none;padding:14px;border:1px solid #e2e8dd;border-radius:14px;background:#fff}
.tse-safari-chat__handover strong{font-size:14px;color:#1c2720}
.tse-safari-chat__handover p{margin:0;font-size:12px;line-height:1.5;color:#47564a}
.tse-safari-chat__handover fieldset{margin:0;padding:0;border:0;display:flex;flex-direction:column;gap:6px}
.tse-safari-chat__handover legend{font-size:12px;font-weight:650;color:#2c3a30;margin-bottom:4px}
.tse-safari-chat__handover label{display:flex;gap:8px;align-items:flex-start;font-size:12px;line-height:1.45;color:#2c3a30}
.tse-safari-chat__handover input[type="radio"]{margin-top:2px;accent-color:#68A522}
.tse-safari-chat__handover input[type="text"],.tse-safari-chat__handover input[type="email"]{width:100%;min-height:44px;border:1px solid #cbd5ca!important;border-radius:12px!important;background:#fff!important;padding:10px 12px!important;font-size:15px!important;color:#202a24!important;box-shadow:none!important}
.tse-safari-chat__handover input:focus-visible{outline:2px solid #68A522;outline-offset:2px}
.tse-safari-chat__handover-row{display:flex;gap:8px;justify-content:flex-end}
.tse-safari-chat__handover-row button{min-height:42px;padding:9px 14px!important;border-radius:12px!important;font-weight:700;font-size:13px;cursor:pointer;border:1px solid #d3dfcc!important;background:#fff!important;color:#315b18!important}
.tse-safari-chat__handover-row button[type="submit"]{border-color:#68A522!important;background:#68A522!important;color:#fff!important}
.tse-safari-chat__handover-row button:disabled{opacity:.6;cursor:wait}

/* Unread team replies while the chat is closed. */
[data-tse-chat-unread]{position:relative}
[data-tse-chat-unread]::after{content:attr(data-tse-chat-unread);position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#c0392b;color:#fff;font:700 11px/18px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;text-align:center;box-shadow:0 0 0 2px #fff;pointer-events:none}

@media(max-width:767px){
 /* 16px prevents iOS from zooming the page when the composer is focused. */
 .tse-safari-chat__form textarea,.tse-safari-chat__welcome input:not([name="website"]),.tse-safari-chat__handover input[type="text"],.tse-safari-chat__handover input[type="email"]{font-size:16px!important}
}
@media(prefers-reduced-motion:reduce){.tse-safari-chat__messages{scroll-behavior:auto}}
