/* Portal button visibility / contrast audit — 2026-10-26.
   Presentation only. Never override [hidden] or JS-controlled disabled state.
   Intentionally do not target crop handles, blank-page canvases, swatches,
   invisible file upload inputs, toggles or browser/provider-owned checkout UI. */

/* The old .action-btn rule set WHITE letters but did not set a background.
   This fixes the plain Verify, Open, Retry and other unthemed controls. */
:is(#mainApp,#signUpScreen,#renewalScreen,#portalAuthPage,
    #accountRecoveryDialog,#walletDialog,#referralActivationDialog,
    #refundRequestDialog,#purchaseHistoryDialog,
    #accountDeleteRequestDialog,#trialUpgradeDialog,
    #np-password-dialog,#bulkAutoAddMoreDialog,#bulkAutoManualCropDialog)
.action-btn:not(.btn-add):not(.btn-download):not(.btn-reset):not(:disabled),
#signupCouponVerify:not(:disabled),#renewalCouponVerify:not(:disabled){
  background:#1e40af!important;
  border:1px solid #1e3a8a!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  text-shadow:none!important;
  font-weight:750!important;
  box-shadow:0 2px 8px rgba(15,23,42,.18)!important;
}

/* Strong, consistent role colours (not pastel fills with white text). */
:is(#mainApp,#signUpScreen,#renewalScreen,#portalAuthPage,
    #walletDialog,#referralActivationDialog,#trialUpgradeDialog)
:is(.action-btn.btn-add,.login-btn,.payment-link-btn):not(:disabled),
#mainApp.workspace-tool-focused :is(.action-btn.btn-add,.login-btn):not(:disabled){
  background:#166534!important;
  border:1px solid #14532d!important;
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
  text-shadow:none!important;
}
:is(#mainApp,#signUpScreen,#renewalScreen,#portalAuthPage)
.action-btn.btn-download:not(:disabled),
#mainApp.workspace-tool-focused .action-btn.btn-download:not(:disabled){
  background:#1d4ed8!important;
  border:1px solid #1e40af!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
:is(#mainApp,#signUpScreen,#renewalScreen,#portalAuthPage)
.action-btn.btn-reset:not(:disabled),
#mainApp.workspace-tool-focused .action-btn.btn-reset:not(:disabled){
  background:#991b1b!important;
  border:1px solid #7f1d1d!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

/* Payment actions retain the distinctive blue checkout affordance. */
:is(#razorpaySignupBtn,#renewalPaymentLink,#trialUpgradeCheckoutBtn,
    #myAccountCouponPaidBtn,#signupCouponPaidBtn,#renewalCouponPaidBtn,
    #referralActivationPayBtn,#signupCouponVerify):not(:disabled){
  background:#1d4ed8!important;
  border:2px solid #1e40af!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}

/* Recovery is NOT another Pay action. Amber surface + dark ink clearly
   distinguishes it, including in light panels and when the theme changes. */
:is(#signupCouponRecoverBtn,#renewalCouponRecoverBtn,
    #myAccountCouponRecoverBtn):not(:disabled){
  background:#fef08a!important;
  border:2px solid #a16207!important;
  color:#422006!important;
  -webkit-text-fill-color:#422006!important;
  text-shadow:none!important;
  font-weight:800!important;
  font-size:14px!important;
  line-height:1.4!important;
  min-height:44px!important;
  max-width:100%!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
  box-shadow:0 0 0 1px rgba(161,98,7,.22),0 4px 14px rgba(66,32,6,.16)!important;
}
/* A stronger container-level selector is needed for old dark/light theme rules. */
body.op-light :is(#signupCouponRecoverBtn,#renewalCouponRecoverBtn,#myAccountCouponRecoverBtn),
html.op-theme-dark :is(#signupCouponRecoverBtn,#renewalCouponRecoverBtn,#myAccountCouponRecoverBtn){
  background:#fef08a!important;
  border-color:#a16207!important;
  color:#422006!important;
  -webkit-text-fill-color:#422006!important;
}

:is(#myAccountCouponVerify,#myAccountCouponRedeem,#myAccountCouponToggle,
    #renewalCouponVerify,#renewalCouponFreeBtn,#signupCouponVerify,
    #refreshMyCouponHistory,#retryMyAccountCouponGift,
    #retryMyAccountCouponWalletGift,#referralYearRewardBtn,
    #referralLifetimeRewardBtn,#renewalReferralYearRewardBtn,
    #renewalReferralLifetimeRewardBtn):not(:disabled){
  min-height:40px!important;
  font-size:13px!important;
  line-height:1.4!important;
  font-weight:750!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}

/* All interactive action text and nested icons/text labels should stay readable
   even when old blanket theme rules recolour every <span> or <strong>. */
:is(#mainApp,#signUpScreen,#renewalScreen,#portalAuthPage)
:is(.action-btn,.login-btn,.payment-link-btn):not(:disabled) :is(span,strong,b,small){
  color:inherit!important;
  -webkit-text-fill-color:currentColor!important;
  opacity:1!important;
}
/* Controls need a visible disabled state, not invisible grey-on-grey letters.
   Do not change their disabled attribute, hit testing or API behaviour. */
:is(#mainApp,#signUpScreen,#renewalScreen,#portalAuthPage,
    #accountRecoveryDialog,#walletDialog,#trialUpgradeDialog)
:is(.action-btn,.login-btn,.payment-link-btn,.payment-plan-choice):disabled{
  background:#e2e8f0!important;
  border:1px solid #94a3b8!important;
  color:#475569!important;
  -webkit-text-fill-color:#475569!important;
  opacity:1!important;
  cursor:not-allowed!important;
  box-shadow:none!important;
  text-shadow:none!important;
}
html.op-theme-dark :is(#mainApp,#walletDialog,#trialUpgradeDialog)
:is(.action-btn,.login-btn,.payment-link-btn,.payment-plan-choice):disabled{
  background:#334155!important;
  border-color:#64748b!important;
  color:#e2e8f0!important;
  -webkit-text-fill-color:#e2e8f0!important;
}

/* Keep keyboard focus visible and text uncropped on narrow screens. */
:is(#mainApp,#signUpScreen,#renewalScreen,#portalAuthPage)
:is(.action-btn,.login-btn,.payment-link-btn,.payment-plan-choice):focus-visible,
:is(#signupCouponRecoverBtn,#renewalCouponRecoverBtn,#myAccountCouponRecoverBtn):focus-visible{
  outline:3px solid #f59e0b!important;
  outline-offset:3px!important;
}
@media(max-width:640px){
  :is(#signupCouponRecoverBtn,#renewalCouponRecoverBtn,
      #myAccountCouponRecoverBtn,#myAccountCouponPaidBtn,
      #signupCouponPaidBtn,#renewalCouponPaidBtn){
    width:100%!important;
    max-width:100%!important;
    padding:10px 12px!important;
  }
}

/* Operator grid previously shrank many action labels to 11px. */
#mainApp.workspace-tool-focused .tab-content.active :is(.action-btn,.login-btn){
  font-size:13px!important;
  line-height:1.4!important;
  min-height:38px!important;
  font-weight:750!important;
}
#mainApp.workspace-tool-focused .tab-content.active :is(.action-btn,.login-btn):not([hidden]){
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}


/* Preserve action meaning: login and financial checkout use blue; deleting an
   account stays unmistakably dangerous rather than looking like a normal link. */
:is(#mainApp,#signUpScreen,#renewalScreen,#portalAuthPage)
.login-btn:not(:disabled),
#mainApp.workspace-tool-focused .login-btn:not(:disabled){
  background:#1d4ed8!important;
  border:1px solid #1e40af!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
#accountDeleteRequestBtn:not(:disabled){
  background:#991b1b!important;
  border:2px solid #7f1d1d!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
