/* Runtime stability hotfix — never hide an already rendered route while background owners settle. */
html[data-route-pending="1"] #app>main,
html[data-shell-pending="1"] #app>main:not(.app-boot){
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
}
html[data-route-pending="1"] #app::after,
html[data-shell-pending="1"] body::after{display:none!important;content:none!important}

/* Keep the live app painted while country/config hydration finishes. */
#app>main{backface-visibility:hidden;-webkit-backface-visibility:hidden}
.chat-app{contain:layout paint style}
.chat-top,.chat-progress,.chat-messages,#chat-footer{transform:translateZ(0)}

/* Route-owned async surfaces settle off-paint instead of briefly showing superseded content. */
html[data-ce-route-settling="1"] .dashboard-actions .dash-primary,
html[data-ce-route-settling="1"] [data-ce-payout-owner-wallet],
html[data-ce-route-settling="1"] [data-ce-payout-owner-withdraw],
html[data-ce-route-settling="1"] [data-premium-task-feed],
html[data-ce-route-settling="1"] .premium-referral-dock,
html[data-ce-route-settling="1"] .ce-share-earn{visibility:hidden!important;opacity:0!important;pointer-events:none!important}
html[data-ce-route-settling="1"] .dashboard-actions{min-height:148px}
html[data-ce-route-settling="1"] .wallet-stats{transform:translateZ(0)}

/* Do not animate layout/state corrections. Motion is reserved for user-initiated feedback. */
#app .app-page :is(.balance-card,.wallet-stats,.task-card,.flow-card,.ce-daily-plan,.ce-payout-owner,.premium-task-feed,.dashboard-actions,.transaction-list){transition-property:background-color,border-color,color,box-shadow!important;transition-duration:.16s!important}

/* Final avatar paint should not resize the chat when the image becomes available. */
.partner-avatar,.mini-avatar{overflow:hidden}
.partner-avatar img,.mini-avatar img,.maya-avatar-image{width:100%;height:100%;display:block;object-fit:cover;border-radius:inherit}
.partner-avatar>i{z-index:2}

/* Mobile controls remain available while asynchronous enhancements load. */
button,[data-route],a[href]{touch-action:manipulation}

/* Legacy surfaces are retired. Hide them before compatibility cleanup runs so they never flash. */
.dashboard-notice-backdrop,.ce-return-offer,.ce-task-filters,.ce-task-card-meta,.ce-guide-card,.ce-live-earning,.ce-share-earn,.premium-referral-dock{display:none!important}
.ce-share-earn,.premium-referral-dock{visibility:hidden!important;pointer-events:none!important}

/* General task return copy is finalized in the next animation frame; never paint the superseded core copy first. */
.return-card:has(#complete-task):not([data-task-return-ready="1"]){visibility:hidden!important}

/* WhatsApp/browser returns reconcile in the background; do not replace the page with a loader. */
html[data-fast-return="1"] .app-boot{visibility:hidden!important;opacity:0!important}