/* MenkulEX Platform 1.2.372: adaptive positioning of the EXISTING robot.
   Route-sensitive, safe-area-aware; never creates a second robot or menu. */
.xan-customer-ai-v180.mx363-assistant-dock{
  --mx372-bottom-clearance:0px;
  --mx372-keyboard-clearance:0px;
  --mx372-menu-max-height:70dvh;
  position:fixed!important;
  right:16px!important;
  bottom:calc(12px + var(--mx372-bottom-clearance) + env(safe-area-inset-bottom,0px))!important;
}
.xan-customer-ai-v180.mx363-assistant-dock .mx363-assistant-menu{
  max-height:min(var(--mx372-menu-max-height),calc(100dvh - 24px))!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  scrollbar-width:thin;
}
.xan-customer-ai-v180.mx363-assistant-dock.is-floating.is-open .xcai-shell{
  bottom:calc(12px + var(--mx372-bottom-clearance) + var(--mx372-keyboard-clearance) + env(safe-area-inset-bottom,0px))!important;
  right:max(8px,env(safe-area-inset-right,0px))!important;
  max-height:max(0px,calc(100dvh - 26px - var(--mx372-bottom-clearance) - var(--mx372-keyboard-clearance) - env(safe-area-inset-bottom,0px)))!important;
}
@media(max-width:1024px), (hover:none) and (pointer:coarse){
 .xan-customer-ai-v180.mx363-assistant-dock{
   right:max(8px,env(safe-area-inset-right,0px))!important;
   bottom:calc(12px + var(--mx372-bottom-clearance) + env(safe-area-inset-bottom,0px))!important;
   width:76px!important;height:76px!important;
 }
 .xan-customer-ai-v180.mx363-assistant-dock .mx363-robot-launch{
   inset:2px!important;width:72px!important;height:72px!important;
 }
 .xan-customer-ai-v180.mx363-assistant-dock .mx363-assistant-menu{
   right:76px!important;
   width:min(176px,calc(100vw - 105px))!important;
   max-width:calc(100vw - 105px)!important;
   bottom:0!important;
   padding:4px 3px!important;
 }
 .xan-customer-ai-v180.mx363-assistant-dock .mx366-quick-toggle{
   width:35px!important;height:35px!important;min-width:35px!important;min-height:35px!important;
   left:-7px!important;top:-8px!important;
 }
 .xan-customer-ai-v180.mx363-assistant-dock .mx363-assistant-action{
   min-height:36px!important;padding:8px 11px!important;font-size:12px!important;
 }
 .xan-customer-ai-v180.mx363-assistant-dock.is-floating.is-open .xcai-shell{
   width:min(410px,calc(100vw - 16px))!important;
 }
}
@media(max-width:390px){
 .xan-customer-ai-v180.mx363-assistant-dock .mx363-assistant-menu{
   right:73px!important;width:min(160px,calc(100vw - 99px))!important;
   max-width:calc(100vw - 99px)!important;
 }
}
/* Native portal screens have a fixed mobile navigation. JS replaces the
   68px fallback with the ACTUAL visible navigation clearance. */
@media(max-width:1024px){
 :is(body.cm-body,body.xan-pw-body,body.mx-portal-body) > .xan-customer-ai-v180.mx363-assistant-dock{
   --mx372-bottom-clearance:68px;
   right:max(8px,env(safe-area-inset-right,0px))!important;
   bottom:calc(12px + var(--mx372-bottom-clearance) + env(safe-area-inset-bottom,0px))!important;
 }
}
/* Fullscreen map/tour and focused edit controls should not be covered. */
@media(max-width:1024px){
 body.xan-pw-location-fullscreen-v1404 > .mx363-assistant-dock,
 body.xan-pw-tour-open-v1438 > .mx363-assistant-dock,
 body[data-mx372-keyboard="1"] > .mx363-assistant-dock:not(.is-open){
   visibility:hidden!important;pointer-events:none!important;
 }
}
@media print{.mx363-assistant-dock{display:none!important}}
@media(prefers-reduced-motion:reduce){
 .xan-customer-ai-v180.mx363-assistant-dock .mx363-assistant-action{
  animation-duration:0.01ms!important;animation-delay:0ms!important;
 }
}

/* v386: Theme .141's real mobile "Ofis" dock. Keep the ONE robot above it.
   When JavaScript resolves actual height, use whichever clearance is larger. */
@media(max-width:760px){
 body.xan-has-mobile-dock .xan-customer-ai-v180.mx363-assistant-dock:not([data-mx373-placement-ready="1"]):not(.is-open){
   bottom:max(calc(94px + env(safe-area-inset-bottom,0px)),calc(12px + var(--mx372-bottom-clearance,0px) + env(safe-area-inset-bottom,0px)))!important;
 }
 body.xan-has-mobile-dock .xan-customer-ai-v180.mx363-assistant-dock:not([data-mx373-placement-ready="1"]).is-open .xcai-shell{
   bottom:max(calc(88px + env(safe-area-inset-bottom,0px)),calc(12px + var(--mx372-bottom-clearance,0px) + var(--mx372-keyboard-clearance,0px) + env(safe-area-inset-bottom,0px)))!important;
 }
}
