/* Shared button alignment, loaded after each page's layout styles. */
html body:is([class], body) :is(button, input[type="submit"], input[type="button"],
  a.btn, a[role="button"], a.signet-auth-btn, a.mini-button,
  a.subscription-manage-action, a.connect-action, a.download-file-link,
  a.app-link, a.mobile-utility-link, a.legal-back, a.telegram-back-link) {
  text-align: center !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Keep card buttons' stacked content and login buttons' balanced icon columns. */
html body:is([class], body) :is(button, a.btn, a.subscription-manage-action, a.connect-action,
  a.download-file-link, a.app-link) > :is(span, b, strong, small) {
  text-align: center !important;
}
html body:is([class], body) :is(button.btn, a.btn):not(.trial-action):not([hidden]) {
  display: inline-flex !important;
}
html body:is([class], body) :is(button, a[role="button"], a.btn) > svg {
  flex-shrink: 0;
}

/* These legacy surfaces previously forced left alignment with stronger selectors. */
html body.simple-cabinet.dashboard-page .home-subscription-item .simple-actions :is(.btn, button),
html body.simple-cabinet .download-links .app-link,
html body.simple-cabinet #help-connect .download-links .app-link {
  text-align: center !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Both payment actions occupy the entire shared grid row, including wrapped text. */
body.simple-cabinet.dashboard-page.modern-cabinet .modern-payment-footer {
  align-items: stretch !important;
}
body.simple-cabinet.dashboard-page.modern-cabinet .modern-payment-footer button {
  align-self: stretch !important;
  box-sizing: border-box;
  height: 100% !important;
  width: 100% !important;
}

/* Return actions share a visible button surface, including links in mobile docks. */
@layer signet-back-actions {
  .back-button {
    align-items: center !important; justify-content: center !important;
    box-sizing: border-box; min-width: 0 !important; min-height: 44px !important;
    height: auto !important; padding: 10px 16px !important;
    border: 0 !important; border-radius: 12px !important;
    background: #1c3540 !important; color: #e4f1f6 !important;
    font-size: 15px !important; font-weight: 500 !important; line-height: 1.35 !important;
    text-decoration: none !important; text-align: center !important;
    white-space: normal !important; cursor: pointer;
  }
  .back-button:not([hidden]) { display: inline-flex !important; }
  .back-button:hover { background: #264a55 !important; }
  .is-renewing .manage-panel-back.back-button {
    min-height: 40px !important; padding: 8px 12px !important; font-size: 14px !important;
  }
  @media (max-width: 780px) {
    .modern-connect-bottom {
      padding: 12px 76px calc(12px + env(safe-area-inset-bottom)) 16px !important;
    }
    .modern-connect-bottom .back-button { flex: 1 1 auto; width: 100% !important; }
  }
}
