/* One stable contact stack. These rules replace old scroll/focus hiding rules. */
:root{--qm-contact-bottom:calc(100px + env(safe-area-inset-bottom,0px) + var(--qm-contact-keyboard,0px))}
html body [data-testid=button-whatsapp-fab],html body.qmcr-actions-open [data-testid=button-whatsapp-fab],html body .qm-chat-fab{position:fixed!important;inset:auto!important;inset-inline-end:12px!important;width:48px!important;height:48px!important;min-width:48px;min-height:48px;margin:0!important;border-radius:50%;display:grid;place-items:center;z-index:48;opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:none!important;box-shadow:0 5px 16px #12141f33}
html body [data-testid=button-whatsapp-fab],html body.qmcr-actions-open [data-testid=button-whatsapp-fab]{bottom:calc(var(--qm-contact-bottom) + 58px)!important}
html body .qm-chat-fab{bottom:var(--qm-contact-bottom)!important;background:#12141f;color:#fff;border:1px solid #ffffff50;cursor:pointer}
html.qm-night body .qm-chat-fab{background:#f2eee2;color:#12141f;border-color:#fff}
html body .qm-chat-fab[hidden]{display:none!important}
.qm-chat-fab:focus-visible,[data-testid=button-whatsapp-fab]:focus-visible{outline:3px solid #e88442;outline-offset:3px}
.qm-chat-dialog{position:fixed;inset:var(--qm-chat-top,0px) 0 auto auto;margin:10px 10px 0;width:min(410px,calc(100vw - 20px));height:min(700px,calc(var(--qm-chat-height,100dvh) - 20px - env(safe-area-inset-bottom,0px)));max-height:none;max-width:none;padding:0;border:1px solid #d7dbe3;border-radius:22px;background:#fafafa;color:#12141f;font:14px/1.7 Cairo,Sora,sans-serif;box-shadow:0 18px 60px #0004;overflow:hidden;box-sizing:border-box}
html[dir=rtl] .qm-chat-dialog{inset-inline-start:auto;inset-inline-end:0}
.qm-chat-dialog[open]{display:flex;flex-direction:column}
.qm-chat-dialog::backdrop{background:#12141f66;backdrop-filter:blur(3px)}
.qm-chat-dialog *{box-sizing:border-box}
.qm-chat-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;background:#12141f;color:#fff;flex-shrink:0}
.qm-chat-head strong{display:block;font-size:17px}.qm-chat-head small{display:block;font-size:11px;color:#e2e3e8}
.qm-chat-dialog button,.qm-chat-dialog textarea,.qm-chat-dialog select{font:inherit}
.qm-chat-close{border:1px solid #ffffff55;border-radius:10px;background:transparent;color:inherit;min-height:44px;padding:6px 12px;cursor:pointer}
.qm-chat-log{flex:1;min-height:80px;overflow-y:auto;overscroll-behavior:contain;padding:14px;scroll-padding:12px}
.qm-chat-bubble{width:fit-content;max-width:95%;padding:10px 13px;border-radius:16px 16px 16px 4px;background:#fff;border:1px solid #e3e5ea;margin:0 0 12px;white-space:pre-wrap;overflow-wrap:anywhere}
.qm-chat-user{margin-inline-start:auto;background:#fff0e5;border-color:#f1c4a0;border-radius:16px 16px 4px 16px}
.qm-chat-team{background:#edf7f0;border-color:#b7d4bf}
.qm-chat-topics{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}.qm-chat-topics button{background:#fff;border:1px solid #ba4b2d;color:#a83b20;padding:7px 11px;min-height:44px;border-radius:999px;cursor:pointer}
.qm-chat-history{border-top:1px solid #e0e3e8;padding-top:12px}.qm-chat-meta,.qm-chat-empty{display:block;font-size:11px;color:#616777;margin-bottom:7px}.qm-chat-thread{margin-bottom:18px}
.qm-chat-notice{font-size:12px;color:#9b3c20;margin:0;padding:0 14px;flex-shrink:0}.qm-chat-notice:empty{display:none}
.qm-chat-refresh{border:0;background:transparent;color:#943b23;text-decoration:underline;min-height:44px;flex-shrink:0;cursor:pointer}
.qm-chat-compose{display:grid;grid-template-columns:1fr auto;gap:7px;padding:10px 14px max(12px,env(safe-area-inset-bottom,0px));border-top:1px solid #e0e3e8;flex-shrink:0;background:#fff}
.qm-chat-compose label,.qm-chat-compose textarea,.qm-chat-compose small{grid-column:1/-1}.qm-chat-compose label{font-size:12px;font-weight:700}.qm-chat-compose textarea,.qm-chat-compose select{min-width:0;width:100%;border:1px solid #cbd0d9;border-radius:10px;padding:8px 10px;font-size:16px;background:#fff;color:#12141f}.qm-chat-compose textarea{resize:none;max-height:84px}.qm-chat-compose select{grid-row:4;min-height:44px}.qm-chat-compose small{font-size:10px;color:#616777;line-height:1.6}.qm-chat-send{grid-row:4;border:0;border-radius:10px;background:#bd442c;color:#fff;padding:8px 14px;min-height:44px;cursor:pointer}.qm-chat-dialog button:disabled{opacity:.5;cursor:wait}
.qm-chat-guest{padding:10px 14px 16px;font-size:12px;border-top:1px solid #ddd}.qm-chat-guest a{display:block;text-decoration:underline;color:#a43c22;min-height:44px;padding-top:8px}
.qm-chat-dialog :is(button,a,textarea,select):focus-visible{outline:3px solid #e88442;outline-offset:2px}
html.qm-night .qm-chat-dialog{background:#15171d;color:#f2eee2;border-color:#41444c}html.qm-night .qm-chat-bubble,html.qm-night .qm-chat-compose,html.qm-night .qm-chat-compose textarea,html.qm-night .qm-chat-compose select,html.qm-night .qm-chat-topics button{background:#22252e;color:#f2eee2;border-color:#4c505d}html.qm-night .qm-chat-user{background:#3d291d;border-color:#805233}html.qm-night .qm-chat-team{background:#1d3528;border-color:#3e6950}html.qm-night .qm-chat-meta,html.qm-night .qm-chat-empty,html.qm-night .qm-chat-compose small{color:#b8bcc8}html.qm-night .qm-chat-refresh,html.qm-night .qm-chat-notice,html.qm-night .qm-chat-guest a{color:#ffb477}
@media(min-width:768px){:root{--qm-contact-bottom:calc(24px + var(--qm-contact-keyboard,0px))}.qm-chat-dialog{margin:20px}}
@media(max-height:520px){.qm-chat-head{padding:7px 12px}.qm-chat-head small{display:none}.qm-chat-compose{padding:6px 12px;gap:4px}.qm-chat-compose label,.qm-chat-compose small{display:none}.qm-chat-compose textarea{max-height:48px}.qm-chat-compose select,.qm-chat-send{grid-row:2}.qm-chat-refresh{min-height:34px}}
@media(prefers-reduced-motion:reduce){html body [data-testid=button-whatsapp-fab],.qm-chat-fab{transition:none!important}}

/* On mobile, both contact buttons sit side by side in the bottom-left corner,
   inside the same bottom overlay band as the pill navigation (below ~90px).
   That keeps the mid-screen interaction zone free of floating controls - no
   input, toggle or label is ever covered - while both support entries stay
   visible and tappable at 44px. Form pages reserve modest bottom clearance
   for the band instead of a side gutter, so content keeps the standard
   symmetric page margins and fills the screen width. */
@media(max-width:767px){
  html body .qm-chat-fab{bottom:calc(20px + env(safe-area-inset-bottom,0px) + var(--qm-contact-keyboard,0px))!important;inset-inline-end:10px!important;width:44px!important;height:44px!important;min-width:44px;min-height:44px}
  html body [data-testid=button-whatsapp-fab],html body.qmcr-actions-open [data-testid=button-whatsapp-fab]{bottom:calc(20px + env(safe-area-inset-bottom,0px) + var(--qm-contact-keyboard,0px))!important;inset-inline-end:62px!important;width:44px!important;height:44px!important;min-width:44px;min-height:44px}
  body.qm-contact-forms #root main{padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))!important;padding-inline-end:1rem!important}
}
.qm-chat-compose select{-webkit-appearance:none;appearance:none;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:right 12px center,right 7px center;background-size:5px 5px;background-repeat:no-repeat;padding-right:28px}
html.qm-night .qm-chat-compose select{background-color:#22252e!important;color:#f2eee2!important;-webkit-text-fill-color:#f2eee2;color-scheme:dark}
