#mercury-chat-root {
  --mercury-color:#173f37;
  --mercury-ink:#18231f;
  --mercury-muted:#71807a;
  --mercury-surface:#ffffff;
  --mercury-paper:#f5f8f6;
  --mercury-line:#dfe7e3;
  --mercury-whatsapp:#08783a;
  --mercury-focus:#83c8b2;
  position:fixed;
  z-index:999999;
  bottom:22px;
  color:var(--mercury-ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  font-synthesis:none;
  line-height:1.4;
  scrollbar-width:thin;
  scrollbar-color:#a9bdb6 transparent;
}
#mercury-chat-root.mercury-chat--right { right:22px; }
#mercury-chat-root.mercury-chat--left { left:22px; }
#mercury-chat-root *,#mercury-chat-root *::before,#mercury-chat-root *::after { box-sizing:border-box; }
#mercury-chat-root * { scrollbar-width:thin; scrollbar-color:#a9bdb6 transparent; }
#mercury-chat-root *::-webkit-scrollbar { width:8px; height:8px; }
#mercury-chat-root *::-webkit-scrollbar-track { background:transparent; }
#mercury-chat-root *::-webkit-scrollbar-thumb { border:2px solid transparent; border-radius:999px; background:#a9bdb6; background-clip:padding-box; }
#mercury-chat-root button,#mercury-chat-root input,#mercury-chat-root textarea { font:inherit; }
#mercury-chat-root button,#mercury-chat-root a { -webkit-tap-highlight-color:transparent; }

.mercury-launcher {
  position:relative;
  width:60px;
  height:60px;
  display:grid;
  place-items:center;
  margin-left:auto;
  border:0;
  border-radius:20px 20px 7px 20px;
  color:#fff;
  background:var(--mercury-color);
  box-shadow:0 15px 40px rgba(17,45,37,.28);
  cursor:pointer;
  transition:transform .18s ease,box-shadow .18s ease;
}
.mercury-chat--left .mercury-launcher { margin-right:auto; margin-left:0; border-radius:20px 20px 20px 7px; }
.mercury-launcher:hover { transform:translateY(-2px); box-shadow:0 18px 46px rgba(17,45,37,.34); }
.mercury-launcher:focus-visible,.mercury-close:focus-visible,.mercury-whatsapp-action:focus-visible,.mercury-start:focus-visible,.mercury-composer button:focus-visible { outline:3px solid var(--mercury-focus); outline-offset:3px; }
.mercury-launcher>i { position:absolute; top:3px; right:4px; width:12px; height:12px; border:2px solid #fff; border-radius:50%; background:#5ee3aa; }
.mercury-chat-icon { font-size:33px; line-height:1; transform:rotate(-28deg); }
.mercury-close-icon { display:none; position:absolute; inset:0; align-items:center; justify-content:center; font-size:30px; font-weight:300; line-height:1; transform:translateY(-1px); }
.is-open .mercury-chat-icon,.is-open .mercury-launcher>i { display:none; }
.is-open .mercury-close-icon { display:flex; }

.mercury-widget {
  position:absolute;
  right:0;
  bottom:74px;
  width:min(392px,calc(100vw - 28px));
  height:min(650px,calc(100vh - 112px));
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid var(--mercury-line);
  border-radius:24px 24px 8px 24px;
  background:var(--mercury-surface);
  box-shadow:0 26px 80px rgba(15,40,32,.23),0 2px 8px rgba(15,40,32,.08);
  opacity:0;
  visibility:hidden;
  transform:translateY(14px) scale(.975);
  transform-origin:bottom right;
  transition:opacity .2s ease,transform .2s ease,visibility .2s ease;
}
.mercury-chat--left .mercury-widget { right:auto; left:0; border-radius:24px 24px 24px 8px; transform-origin:bottom left; }
.is-open .mercury-widget { opacity:1; visibility:visible; transform:none; }

.mercury-widget__header { min-height:88px; display:flex; align-items:center; gap:12px; padding:16px 16px 16px 18px; color:#fff; background:var(--mercury-color); background:linear-gradient(125deg,var(--mercury-color),color-mix(in srgb,var(--mercury-color) 80%,#071c16)); }
.mercury-widget__logo { flex:0 0 auto; width:45px; height:45px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.35); border-radius:15px 15px 5px 15px; background:rgba(255,255,255,.06); font-family:Georgia,"Times New Roman",serif; font-size:23px; }
.mercury-widget__brand { flex:1; min-width:0; }
.mercury-widget__brand strong { display:block; overflow:hidden; font-size:15px; font-weight:760; white-space:nowrap; text-overflow:ellipsis; }
.mercury-widget__brand small { display:flex; align-items:center; gap:6px; margin-top:4px; color:rgba(255,255,255,.76); font-size:11px; }
.mercury-widget__brand small i { width:8px; height:8px; border-radius:50%; background:#60e5ac; box-shadow:0 0 0 3px rgba(96,229,172,.12); }
.mercury-widget__actions { flex:0 0 auto; display:flex; align-items:center; gap:7px; }
.mercury-whatsapp-action { height:36px; display:flex; align-items:center; gap:7px; padding:0 10px 0 7px; border:1px solid rgba(255,255,255,.25); border-radius:11px; color:#fff; background:var(--mercury-whatsapp); text-decoration:none; box-shadow:0 5px 14px rgba(0,0,0,.12); transition:filter .16s ease,transform .16s ease; }
.mercury-whatsapp-action:hover { color:#fff; filter:brightness(1.05); transform:translateY(-1px); }
.mercury-whatsapp-action span { width:23px; height:23px; display:grid; place-items:center; border-radius:50%; color:var(--mercury-whatsapp); background:#fff; font-size:8px; font-weight:900; letter-spacing:-.04em; }
.mercury-whatsapp-action b { font-size:10px; font-weight:760; }
.mercury-close { flex:0 0 36px; width:36px; height:36px; display:grid; place-items:center; margin:0; padding:0; border:0; border-radius:11px; color:#fff; background:rgba(255,255,255,.12); font-size:24px; font-weight:400; line-height:1; text-align:center; cursor:pointer; transition:background .16s ease; }
.mercury-close:hover { background:rgba(255,255,255,.2); }

.mercury-widget__body { flex:1; min-height:0; padding:24px 20px 17px; overflow-y:auto; background-color:#fbfdfc; background-image:radial-gradient(rgba(23,63,55,.055) .7px,transparent .7px),linear-gradient(180deg,#f4faf7 0,#fbfdfc 36%,#fff 100%); background-size:15px 15px,100% 100%; }
.mercury-intro { position:relative; padding:0 10px 20px; text-align:center; }
.mercury-intro__eyebrow { display:block; margin-bottom:10px; color:#568174; font-size:8px; font-weight:850; letter-spacing:.18em; }
.mercury-agent { width:54px; height:54px; display:grid; place-items:center; margin:0 auto 13px; border:1px solid #d3e8df; border-radius:18px 18px 6px 18px; color:var(--mercury-color); background:#e3f3ed; box-shadow:0 7px 20px rgba(21,74,60,.08); font-family:Georgia,"Times New Roman",serif; font-size:23px; }
.mercury-welcome { max-width:285px; margin:0 auto; font-family:Georgia,"Times New Roman",serif; font-size:19px; font-weight:600; line-height:1.42; letter-spacing:-.01em; }
.mercury-response-time { margin:9px 0 0; color:var(--mercury-muted); font-size:11px; }

.mercury-contact-form { display:grid; gap:11px; padding:1px; }
.mercury-field { display:grid; gap:6px; color:#52615c; font-size:10px; font-weight:750; }
.mercury-field input { width:100%; height:44px; border:1px solid #d8e2de; border-radius:12px; padding:0 13px; outline:0; color:var(--mercury-ink); background:rgba(255,255,255,.92); font-size:13px; transition:border-color .16s ease,box-shadow .16s ease,background .16s ease; }
.mercury-field input:hover { border-color:#bccdc6; }
.mercury-field input:focus { border-color:#68a891; background:#fff; box-shadow:0 0 0 4px rgba(63,139,113,.11); }
.mercury-field input[aria-invalid="true"] { border-color:#ba5050; box-shadow:0 0 0 3px rgba(186,80,80,.1); }
.mercury-form-error,.mercury-error { min-height:0; color:#a53f3f; font-size:10px; line-height:1.4; text-align:center; }
.mercury-form-error:not(:empty),.mercury-error:not(:empty) { min-height:18px; }
.mercury-start { width:100%; height:46px; display:flex; align-items:center; justify-content:center; margin-top:2px; padding:0 18px; border:0; border-radius:13px 13px 5px 13px; color:#fff; background:var(--mercury-color); box-shadow:0 8px 18px rgba(23,63,55,.17); font-size:13px; font-weight:780; line-height:1.2; text-align:center; text-transform:none; letter-spacing:.01em; cursor:pointer; transition:transform .16s ease,box-shadow .16s ease; }
.mercury-start:hover { transform:translateY(-1px); box-shadow:0 10px 22px rgba(23,63,55,.22); }
.mercury-honeypot { position:absolute; left:-10000px; width:1px; height:1px; overflow:hidden; }

.mercury-conversation,.mercury-message-list { height:100%; }
.mercury-message-list { display:flex; flex-direction:column; gap:13px; overflow-y:auto; padding:2px 3px 12px; scroll-behavior:smooth; }
.mercury-bubble { display:flex; flex-direction:column; max-width:84%; font-size:13px; line-height:1.52; }
.mercury-bubble>div { padding:11px 13px; border:1px solid #e1e8e5; border-radius:15px 15px 15px 5px; color:#43514c; background:rgba(239,244,241,.96); box-shadow:0 4px 12px rgba(21,55,44,.04); white-space:pre-wrap; overflow-wrap:anywhere; }
.mercury-bubble time { margin-top:4px; color:#929d99; font-size:9px; font-variant-numeric:tabular-nums; }
.mercury-bubble--visitor { align-self:flex-end; align-items:flex-end; }
.mercury-bubble--visitor>div { border-color:transparent; border-radius:15px 15px 5px 15px; color:#fff; background:var(--mercury-color); box-shadow:0 6px 16px rgba(23,63,55,.12); }

.mercury-composer { min-height:78px; display:flex; align-items:flex-end; gap:10px; padding:13px 14px; border-top:1px solid var(--mercury-line); background:#fff; box-shadow:0 -8px 24px rgba(23,63,55,.035); }
.mercury-composer textarea { flex:1; min-height:46px; max-height:92px; resize:none; border:1px solid #d8e2de; border-radius:14px; padding:12px 13px; outline:0; color:var(--mercury-ink); background:#fafcfb; font-size:13px; line-height:1.5; transition:border-color .16s ease,box-shadow .16s ease; }
.mercury-composer textarea:focus { border-color:#68a891; background:#fff; box-shadow:0 0 0 4px rgba(63,139,113,.1); }
.mercury-composer button { flex:0 0 auto; width:46px; height:46px; border:0; border-radius:14px 14px 5px 14px; color:#fff; background:var(--mercury-color); box-shadow:0 7px 16px rgba(23,63,55,.18); font-size:17px; cursor:pointer; }
.mercury-composer button:disabled { opacity:.5; cursor:not-allowed; }
.mercury-widget footer { flex:0 0 28px; display:flex; align-items:center; justify-content:center; gap:3px; border-top:1px solid #eef2f0; color:#9ca7a3; background:#fff; font-size:8px; }
.mercury-widget footer strong { color:#6f7e78; }
#mercury-chat-root [hidden] { display:none; }

/*
 * Theme collision protection.
 * WordPress themes often apply global button rules (padding, min-width,
 * line-height and text transforms). Keep the widget controls geometrically
 * stable so their icons and labels remain centered on every storefront.
 */
#mercury-chat-root .mercury-launcher {
  width:60px !important;
  min-width:60px !important;
  max-width:60px !important;
  height:60px !important;
  min-height:60px !important;
  max-height:60px !important;
  padding:0 !important;
  text-align:center !important;
  text-transform:none !important;
  letter-spacing:normal !important;
  appearance:none;
  -webkit-appearance:none;
}
#mercury-chat-root .mercury-close {
  width:36px !important;
  min-width:36px !important;
  max-width:36px !important;
  height:36px !important;
  min-height:36px !important;
  max-height:36px !important;
  margin:0 !important;
  padding:0 !important;
  line-height:1 !important;
  text-align:center !important;
  text-indent:0 !important;
  text-transform:none !important;
  letter-spacing:normal !important;
  appearance:none;
  -webkit-appearance:none;
}
#mercury-chat-root .mercury-whatsapp-action {
  min-width:0 !important;
  margin:0 !important;
  line-height:1 !important;
  text-transform:none !important;
  letter-spacing:normal !important;
}
#mercury-chat-root .mercury-start {
  min-width:0 !important;
  min-height:46px !important;
  margin-top:2px !important;
  padding:0 18px !important;
  line-height:1.2 !important;
  text-align:center !important;
  text-transform:none !important;
  letter-spacing:.01em !important;
  appearance:none;
  -webkit-appearance:none;
}
#mercury-chat-root .mercury-field input {
  min-width:0 !important;
  max-width:none !important;
  margin:0 !important;
  padding:0 13px !important;
  line-height:normal !important;
  text-transform:none !important;
  letter-spacing:normal !important;
  appearance:none;
  -webkit-appearance:none;
}

@media (max-width:520px) {
  #mercury-chat-root { right:12px; bottom:12px; left:12px; }
  .mercury-widget { position:fixed; top:10px; right:10px; bottom:82px; left:10px; width:auto; height:auto; border-radius:20px 20px 7px 20px; }
  .mercury-chat--left .mercury-widget { right:10px; left:10px; }
  .mercury-launcher,.mercury-chat--left .mercury-launcher { margin-right:0; margin-left:auto; }
  .mercury-widget__body { padding-right:16px; padding-left:16px; }
  .mercury-whatsapp-action b { display:none; }
  .mercury-whatsapp-action { width:36px; justify-content:center; padding:0; }
}

@media (prefers-reduced-motion:reduce) {
  #mercury-chat-root * { scroll-behavior:auto; transition-duration:.01ms; animation-duration:.01ms; animation-iteration-count:1; }
}

@media (forced-colors:active) {
  #mercury-chat-root * { scrollbar-color:auto; }
  .mercury-launcher,.mercury-start,.mercury-composer button,.mercury-bubble--visitor>div,.mercury-whatsapp-action { border:1px solid ButtonText; }
}
